@senior-gestao-pessoas/payroll-core 9.5.0-f5093372-3d3f-4b82-a958-d1cdf848ce4d → 9.5.0-feature-hcmgdp-11492-21838e72

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 (42) hide show
  1. package/bundles/senior-gestao-pessoas-payroll-core.umd.js +467 -902
  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 -16
  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 +43 -10
  6. package/components/historical-pix-account/historical-pix-account.component.d.ts +10 -39
  7. package/components/historical-pix-account/historical-pix-account.service.d.ts +0 -1
  8. package/components/historical-pix-account-list/historical-pix-account-list.component.d.ts +2 -9
  9. package/components/utils/format-utils/format-utils.service.d.ts +3 -30
  10. package/esm2015/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.js +202 -34
  11. package/esm2015/components/historical-pix-account/historical-pix-account.component.js +29 -259
  12. package/esm2015/components/historical-pix-account/historical-pix-account.module.js +1 -5
  13. package/esm2015/components/historical-pix-account/historical-pix-account.service.js +1 -8
  14. package/esm2015/components/historical-pix-account-list/historical-pix-account-list.component.js +8 -41
  15. package/esm2015/components/utils/format-utils/format-utils.service.js +5 -88
  16. package/esm2015/public_api.js +1 -2
  17. package/esm2015/senior-gestao-pessoas-payroll-core.js +2 -3
  18. package/esm5/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.js +217 -58
  19. package/esm5/components/historical-pix-account/historical-pix-account.component.js +58 -301
  20. package/esm5/components/historical-pix-account/historical-pix-account.module.js +1 -5
  21. package/esm5/components/historical-pix-account/historical-pix-account.service.js +1 -8
  22. package/esm5/components/historical-pix-account-list/historical-pix-account-list.component.js +8 -46
  23. package/esm5/components/utils/format-utils/format-utils.service.js +5 -88
  24. package/esm5/public_api.js +1 -2
  25. package/esm5/senior-gestao-pessoas-payroll-core.js +2 -3
  26. package/fesm2015/senior-gestao-pessoas-payroll-core.js +502 -897
  27. package/fesm2015/senior-gestao-pessoas-payroll-core.js.map +1 -1
  28. package/fesm5/senior-gestao-pessoas-payroll-core.js +464 -898
  29. package/fesm5/senior-gestao-pessoas-payroll-core.js.map +1 -1
  30. package/package.json +1 -1
  31. package/public_api.d.ts +0 -1
  32. package/senior-gestao-pessoas-payroll-core.d.ts +1 -2
  33. package/senior-gestao-pessoas-payroll-core.metadata.json +1 -1
  34. package/components/historical-pix-account/historical-pix-account-base.d.ts +0 -27
  35. package/components/shared/index.d.ts +0 -1
  36. package/components/shared/shared-state.service.d.ts +0 -20
  37. package/esm2015/components/historical-pix-account/historical-pix-account-base.js +0 -173
  38. package/esm2015/components/shared/index.js +0 -2
  39. package/esm2015/components/shared/shared-state.service.js +0 -46
  40. package/esm5/components/historical-pix-account/historical-pix-account-base.js +0 -186
  41. package/esm5/components/shared/index.js +0 -2
  42. package/esm5/components/shared/shared-state.service.js +0 -47
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/forms'), require('primeng/blockui'), require('primeng/progressspinner'), require('@angular/router'), require('@ngx-translate/core'), require('rxjs/operators'), require('primeng/breadcrumb'), require('@angular/common'), require('primeng/dropdown'), require('primeng/inputmask'), require('primeng/inputtext'), require('primeng/shared'), require('@seniorsistemas/angular-components'), require('moment'), require('rxjs'), require('primeng/tooltip'), require('primeng/table'), require('@angular/common/http'), require('primeng/api'), require('@senior-gestao-pessoas/angular-components'), require('ng2-img-cropper'), require('primeng/button'), require('primeng/dialog'), require('primeng/fileupload'), require('chance'), require('moment-business'), require('primeng/autocomplete'), require('primeng/splitbutton'), require('primeng/components/common/messageservice'), require('@seniorsistemas/senior-platform-data'), require('primeng/toast'), require('ng2-currency-mask'), require('primeng/fieldset'), require('primeng/panel'), require('primeng/confirmdialog'), require('primeng/tabview')) :
3
- typeof define === 'function' && define.amd ? define('@senior-gestao-pessoas/payroll-core', ['exports', '@angular/core', '@angular/forms', 'primeng/blockui', 'primeng/progressspinner', '@angular/router', '@ngx-translate/core', 'rxjs/operators', 'primeng/breadcrumb', '@angular/common', 'primeng/dropdown', 'primeng/inputmask', 'primeng/inputtext', 'primeng/shared', '@seniorsistemas/angular-components', 'moment', 'rxjs', 'primeng/tooltip', 'primeng/table', '@angular/common/http', 'primeng/api', '@senior-gestao-pessoas/angular-components', 'ng2-img-cropper', 'primeng/button', 'primeng/dialog', 'primeng/fileupload', 'chance', 'moment-business', 'primeng/autocomplete', 'primeng/splitbutton', 'primeng/components/common/messageservice', '@seniorsistemas/senior-platform-data', 'primeng/toast', 'ng2-currency-mask', 'primeng/fieldset', 'primeng/panel', 'primeng/confirmdialog', 'primeng/tabview'], factory) :
4
- (global = global || self, factory((global['senior-gestao-pessoas'] = global['senior-gestao-pessoas'] || {}, global['senior-gestao-pessoas']['payroll-core'] = {}), global.ng.core, global.ng.forms, global.blockui, global.progressspinner, global.ng.router, global.core$1, global.rxjs.operators, global.breadcrumb, global.ng.common, global.dropdown, global.inputmask, global.inputtext, global.shared, global.angularComponents, global.moment_, global.rxjs, global.tooltip, global.table, global.ng.common.http, global.api, global.angularComponents$1, global.ng2ImgCropper, global.button, global.dialog, global.fileupload, global.chance, global.business, global.autocomplete, global.splitbutton, global.messageservice, global.seniorPlatformData, global.toast, global.ng2CurrencyMask, global.fieldset, global.panel, global.confirmdialog, global.tabview));
5
- }(this, (function (exports, core, forms, blockui, progressspinner, router, core$1, operators, breadcrumb, common, dropdown, inputmask, inputtext, shared, angularComponents, moment_, rxjs, tooltip, table, http, api, angularComponents$1, ng2ImgCropper, button, dialog, fileupload, chance, business, autocomplete, splitbutton, messageservice, seniorPlatformData, toast, ng2CurrencyMask, fieldset, panel, confirmdialog, tabview) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/forms'), require('primeng/blockui'), require('primeng/progressspinner'), require('@angular/router'), require('@ngx-translate/core'), require('rxjs/operators'), require('primeng/breadcrumb'), require('@angular/common'), require('primeng/dropdown'), require('primeng/inputmask'), require('primeng/inputtext'), require('primeng/shared'), require('@seniorsistemas/angular-components'), require('moment'), require('rxjs'), require('primeng/tooltip'), require('primeng/table'), require('@angular/common/http'), require('primeng/api'), require('@senior-gestao-pessoas/angular-components'), require('ng2-img-cropper'), require('primeng/button'), require('primeng/dialog'), require('primeng/fileupload'), require('chance'), require('moment-business'), require('primeng/autocomplete'), require('primeng/splitbutton'), require('primeng/components/common/messageservice'), require('@seniorsistemas/senior-platform-data'), require('primeng/toast'), require('ng2-currency-mask'), require('primeng/fieldset'), require('primeng/panel'), require('primeng/confirmdialog')) :
3
+ typeof define === 'function' && define.amd ? define('@senior-gestao-pessoas/payroll-core', ['exports', '@angular/core', '@angular/forms', 'primeng/blockui', 'primeng/progressspinner', '@angular/router', '@ngx-translate/core', 'rxjs/operators', 'primeng/breadcrumb', '@angular/common', 'primeng/dropdown', 'primeng/inputmask', 'primeng/inputtext', 'primeng/shared', '@seniorsistemas/angular-components', 'moment', 'rxjs', 'primeng/tooltip', 'primeng/table', '@angular/common/http', 'primeng/api', '@senior-gestao-pessoas/angular-components', 'ng2-img-cropper', 'primeng/button', 'primeng/dialog', 'primeng/fileupload', 'chance', 'moment-business', 'primeng/autocomplete', 'primeng/splitbutton', 'primeng/components/common/messageservice', '@seniorsistemas/senior-platform-data', 'primeng/toast', 'ng2-currency-mask', 'primeng/fieldset', 'primeng/panel', 'primeng/confirmdialog'], factory) :
4
+ (global = global || self, factory((global['senior-gestao-pessoas'] = global['senior-gestao-pessoas'] || {}, global['senior-gestao-pessoas']['payroll-core'] = {}), global.ng.core, global.ng.forms, global.blockui, global.progressspinner, global.ng.router, global.core$1, global.rxjs.operators, global.breadcrumb, global.ng.common, global.dropdown, global.inputmask, global.inputtext, global.shared, global.angularComponents, global.moment_, global.rxjs, global.tooltip, global.table, global.ng.common.http, global.api, global.angularComponents$1, global.ng2ImgCropper, global.button, global.dialog, global.fileupload, global.chance, global.business, global.autocomplete, global.splitbutton, global.messageservice, global.seniorPlatformData, global.toast, global.ng2CurrencyMask, global.fieldset, global.panel, global.confirmdialog));
5
+ }(this, (function (exports, core, forms, blockui, progressspinner, router, core$1, operators, breadcrumb, common, dropdown, inputmask, inputtext, shared, angularComponents, moment_, rxjs, tooltip, table, http, api, angularComponents$1, ng2ImgCropper, button, dialog, fileupload, chance, business, autocomplete, splitbutton, messageservice, seniorPlatformData, toast, ng2CurrencyMask, fieldset, panel, confirmdialog) { 'use strict';
6
6
 
7
7
  business = business && business.hasOwnProperty('default') ? business['default'] : business;
8
8
 
@@ -9339,25 +9339,6 @@
9339
9339
  }
9340
9340
  return null;
9341
9341
  };
9342
- /**
9343
- * Retorna o CPF formatado
9344
- * @param cpf CPF
9345
- */
9346
- FormatUtilsService.getFormattedCpfEdited = function (cpf) {
9347
- if (!cpf)
9348
- return '';
9349
- cpf = cpf.replace(/\D/g, '').slice(0, 11);
9350
- if (cpf.length > 9) {
9351
- cpf = cpf.replace(/^(\d{3})(\d{3})(\d{3})(\d{2})$/, "$1.$2.$3-$4");
9352
- }
9353
- else if (cpf.length > 6) {
9354
- cpf = cpf.replace(/^(\d{3})(\d{3})(\d{0,3})$/, "$1.$2.$3");
9355
- }
9356
- else if (cpf.length > 3) {
9357
- cpf = cpf.replace(/^(\d{3})(\d{0,3})$/, "$1.$2");
9358
- }
9359
- return cpf;
9360
- };
9361
9342
  /**
9362
9343
  * Retorna o CNPJ formatado
9363
9344
  * @param cnpj CNPJ
@@ -9373,28 +9354,6 @@
9373
9354
  }
9374
9355
  return null;
9375
9356
  };
9376
- /**
9377
- * Retorna o CNPJ formatado
9378
- * @param cnpj CNPJ
9379
- */
9380
- FormatUtilsService.getFormattedCnpjEdited = function (cnpj) {
9381
- if (!cnpj)
9382
- return '';
9383
- cnpj = cnpj.replace(/\D/g, '').slice(0, 14);
9384
- if (cnpj.length > 12) {
9385
- cnpj = cnpj.replace(/^(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})$/, "$1.$2.$3/$4-$5");
9386
- }
9387
- else if (cnpj.length > 8) {
9388
- cnpj = cnpj.replace(/^(\d{2})(\d{3})(\d{3})(\d{0,4})$/, "$1.$2.$3/$4");
9389
- }
9390
- else if (cnpj.length > 5) {
9391
- cnpj = cnpj.replace(/^(\d{2})(\d{3})(\d{0,3})$/, "$1.$2.$3");
9392
- }
9393
- else if (cnpj.length > 2) {
9394
- cnpj = cnpj.replace(/^(\d{2})(\d{0,3})$/, "$1.$2");
9395
- }
9396
- return cnpj;
9397
- };
9398
9357
  /**
9399
9358
  * Retorna a mascara do CPF/CNPJ
9400
9359
  * @param key Valores possíveis são CPF ou CNPJ
@@ -9409,24 +9368,6 @@
9409
9368
  return "";
9410
9369
  }
9411
9370
  };
9412
- /**
9413
- * Método para formatar o número de inscrição do cliente.
9414
- * @param subscriptionNumber
9415
- * @param pixKeyType
9416
- * @returns
9417
- */
9418
- FormatUtilsService.getFormattedSubscriptionNumber = function (subscriptionNumber, pixKeyType) {
9419
- if (!subscriptionNumber || !pixKeyType)
9420
- return subscriptionNumber;
9421
- switch (pixKeyType) {
9422
- case 'CNPJ':
9423
- return this.getFormattedCnpjEdited(subscriptionNumber);
9424
- case 'CPF':
9425
- return this.getFormattedCpfEdited(subscriptionNumber);
9426
- default:
9427
- return subscriptionNumber;
9428
- }
9429
- };
9430
9371
  /**
9431
9372
  * Metódo para formatar o número de telefone.
9432
9373
  * @param telephoneNumber String contendo o número de telefone.
@@ -9458,13 +9399,6 @@
9458
9399
  }
9459
9400
  return tel;
9460
9401
  };
9461
- /**
9462
- * Metódo para formatar a porcentagem para 2 casas decimais.
9463
- * @param value Número a ser formatado.
9464
- */
9465
- FormatUtilsService.getFormattedPercentage = function (value) {
9466
- return parseFloat(value).toFixed(2).replace('.', ',') + '%';
9467
- };
9468
9402
  /**
9469
9403
  * Metódo para formatar o número de telefone de um campo Input.
9470
9404
  * @param event Evento do Input do campo de telefone.
@@ -9478,506 +9412,62 @@
9478
9412
  event.target.value = FormatUtilsService.getFormattedTelephoneNumber(telephoneNumber);
9479
9413
  };
9480
9414
  /**
9481
- * Formata o campo de input de CPF em tempo real.
9482
- * @param event Evento do input
9483
- */
9484
- FormatUtilsService.formatCpfInputEvent = function (event) {
9485
- var cpf = event.target.value;
9486
- // Permite apagar nos pontos sensíveis
9487
- if (event.keyCode === 8 && (cpf.length === 4 || cpf.length === 8 || cpf.length === 12)) {
9488
- return;
9489
- }
9490
- event.target.value = FormatUtilsService.getFormattedCpfEdited(cpf);
9491
- };
9492
- /**
9493
- * Formata o campo de input de CNPJ em tempo real.
9494
- * @param event Evento do input
9415
+ * Metódo para formatar a porcentagem para 2 casas decimais.
9416
+ * @param value Número a ser formatado.
9495
9417
  */
9496
- FormatUtilsService.formatCnpjInputEvent = function (event) {
9497
- var cnpj = event.target.value;
9498
- // Permite apagar nos pontos sensíveis
9499
- if (event.keyCode === 8 && (cnpj.length === 3 || cnpj.length === 7 || cnpj.length === 11 || cnpj.length === 16)) {
9500
- return;
9501
- }
9502
- event.target.value = FormatUtilsService.getFormattedCnpjEdited(cnpj);
9418
+ FormatUtilsService.getFormattedPercentage = function (value) {
9419
+ return parseFloat(value).toFixed(2).replace('.', ',') + '%';
9503
9420
  };
9504
9421
  return FormatUtilsService;
9505
9422
  }());
9506
9423
 
9507
- var SharedStateService = /** @class */ (function () {
9508
- function SharedStateService() {
9509
- this.hideFieldSubject = new rxjs.BehaviorSubject(true);
9510
- this.hideField$ = this.hideFieldSubject.asObservable();
9511
- this.showButtonSubject = new rxjs.BehaviorSubject(true);
9512
- this.showButton$ = this.showButtonSubject.asObservable();
9513
- this.saveButtonSubject = new rxjs.BehaviorSubject(true);
9514
- this.saveButton$ = this.saveButtonSubject.asObservable();
9515
- this.showEditMode = new rxjs.BehaviorSubject(true);
9516
- this.showEditMode$ = this.showEditMode.asObservable();
9517
- this.activeValidatorsOnEditModalOpen = new rxjs.Subject();
9518
- this.activeValidatorsOnEditModalOpen$ = this.activeValidatorsOnEditModalOpen.asObservable();
9519
- this.shouldReloadWindowOnlyEditMode = new rxjs.BehaviorSubject(false);
9520
- this.shouldReloadWindowOnlyEditMode$ = this.shouldReloadWindowOnlyEditMode.asObservable();
9521
- }
9522
- SharedStateService.prototype.setHideField = function (value) {
9523
- this.hideFieldSubject.next(value);
9524
- };
9525
- SharedStateService.prototype.setShowButton = function (value) {
9526
- this.showButtonSubject.next(value);
9527
- };
9528
- SharedStateService.prototype.setSaveButton = function (value) {
9529
- this.saveButtonSubject.next(value);
9530
- };
9531
- SharedStateService.prototype.setShowEditMode = function (value) {
9532
- this.showEditMode.next(value);
9533
- };
9534
- SharedStateService.prototype.setShouldReloadWindowOnlyEditMode = function (value) {
9535
- this.shouldReloadWindowOnlyEditMode.next(value);
9536
- };
9537
- SharedStateService.prototype.triggerActiveValidatorsOnEditModalOpen = function () {
9538
- this.activeValidatorsOnEditModalOpen.next();
9539
- };
9540
- SharedStateService.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function SharedStateService_Factory() { return new SharedStateService(); }, token: SharedStateService, providedIn: "root" });
9541
- SharedStateService = __decorate([
9542
- core.Injectable({
9543
- providedIn: 'root',
9544
- })
9545
- ], SharedStateService);
9546
- return SharedStateService;
9547
- }());
9548
-
9549
- var GenericValidator = /** @class */ (function () {
9550
- function GenericValidator() {
9551
- }
9552
- /**
9553
- * Valida o CEI (Cadastro específico de INSS) digitado.
9554
- */
9555
- GenericValidator.isValidCei = function (control) {
9556
- var cei = control.value;
9557
- if (!cei)
9558
- return null;
9559
- else if (cei.length != 11)
9560
- return null;
9561
- var multiplicadorBase = "3298765432";
9562
- var total = 0;
9563
- var resto = 0;
9564
- var multiplicando = 0;
9565
- var multiplicador = 0;
9566
- if (cei.length !== 11 ||
9567
- cei === "00000000000" ||
9568
- cei === "11111111111" ||
9569
- cei === "22222222222" ||
9570
- cei === "33333333333" ||
9571
- cei === "44444444444" ||
9572
- cei === "55555555555" ||
9573
- cei === "66666666666" ||
9574
- cei === "77777777777" ||
9575
- cei === "88888888888" ||
9576
- cei === "99999999999")
9577
- return { invalidCei: true };
9578
- else {
9579
- for (var i = 0; i < 10; i++) {
9580
- multiplicando = parseInt(cei.substring(i, i + 1), 10);
9581
- multiplicador = parseInt(multiplicadorBase.substring(i, i + 1), 10);
9582
- total += multiplicando * multiplicador;
9583
- }
9584
- resto = 11 - (total % 11);
9585
- resto = resto === 10 || resto === 11 ? 0 : resto;
9586
- var digito = parseInt("" + cei.charAt(10), 10);
9587
- return resto === digito ? null : { invalidCei: true };
9588
- }
9589
- };
9590
- /**
9591
- * Valida se o CPF é valido. Deve-se ser informado o cpf sem máscara.
9592
- */
9593
- GenericValidator.isValidCpf = function (control) {
9594
- var cpf = control.value;
9595
- if (cpf) {
9596
- var numbers = void 0, digits = void 0, sum = void 0, i = void 0, result = void 0, equalDigits = void 0;
9597
- equalDigits = 1;
9598
- if (cpf.length < 11) {
9599
- return null;
9600
- }
9601
- for (i = 0; i < cpf.length - 1; i++) {
9602
- if (cpf.charAt(i) !== cpf.charAt(i + 1)) {
9603
- equalDigits = 0;
9604
- break;
9605
- }
9606
- }
9607
- if (!equalDigits) {
9608
- numbers = cpf.substring(0, 9);
9609
- digits = cpf.substring(9);
9610
- sum = 0;
9611
- for (i = 10; i > 1; i--) {
9612
- sum += numbers.charAt(10 - i) * i;
9613
- }
9614
- result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9615
- if (result !== Number(digits.charAt(0))) {
9616
- return { cpfNotValid: true };
9617
- }
9618
- numbers = cpf.substring(0, 10);
9619
- sum = 0;
9620
- for (i = 11; i > 1; i--) {
9621
- sum += numbers.charAt(11 - i) * i;
9622
- }
9623
- result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9624
- if (result !== Number(digits.charAt(1))) {
9625
- return { cpfNotValid: true };
9626
- }
9627
- return null;
9628
- }
9629
- else {
9630
- return { cpfNotValid: true };
9631
- }
9632
- }
9633
- return null;
9634
- };
9635
- /**
9636
- * Valida se o CNPJ é valido. Deve-se ser informado o cpf sem máscara.
9637
- */
9638
- GenericValidator.isValidCnpj = function (control) {
9639
- var cnpj = control.value;
9640
- if (cnpj) {
9641
- var size = void 0, numbers = void 0, digits = void 0, sum = void 0, pos = void 0, result = void 0;
9642
- cnpj = cnpj.replace(/[^\d]+/g, '');
9643
- if (cnpj.length !== 14) {
9644
- return null;
9645
- }
9646
- // Elimina CNPJs invalidos conhecidos
9647
- if (cnpj === '00000000000000' ||
9648
- cnpj === '11111111111111' ||
9649
- cnpj === '22222222222222' ||
9650
- cnpj === '33333333333333' ||
9651
- cnpj === '44444444444444' ||
9652
- cnpj === '55555555555555' ||
9653
- cnpj === '66666666666666' ||
9654
- cnpj === '77777777777777' ||
9655
- cnpj === '88888888888888' ||
9656
- cnpj === '99999999999999') {
9657
- return { cnpjNotValid: true };
9658
- }
9659
- // Valida DVs
9660
- size = cnpj.length - 2;
9661
- numbers = cnpj.substring(0, size);
9662
- digits = cnpj.substring(size);
9663
- sum = 0;
9664
- pos = size - 7;
9665
- for (var i = size; i >= 1; i--) {
9666
- sum += numbers.charAt(size - i) * pos--;
9667
- if (pos < 2) {
9668
- pos = 9;
9669
- }
9670
- }
9671
- result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9672
- if (result !== Number(digits.charAt(0))) {
9673
- return { cnpjNotValid: true };
9674
- }
9675
- size = size + 1;
9676
- numbers = cnpj.substring(0, size);
9677
- sum = 0;
9678
- pos = size - 7;
9679
- for (var i = size; i >= 1; i--) {
9680
- sum += numbers.charAt(size - i) * pos--;
9681
- if (pos < 2) {
9682
- pos = 9;
9683
- }
9684
- }
9685
- result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9686
- if (result !== Number(digits.charAt(1))) {
9687
- return { cnpjNotValid: true };
9688
- }
9689
- return null;
9690
- }
9691
- return null;
9692
- };
9693
- /**
9694
- * Válida o número de telefone da chave PIX.
9695
- */
9696
- GenericValidator.isValidPhoneNumber = function (control) {
9697
- var cellPhoneKey = control.value || '';
9698
- cellPhoneKey = cellPhoneKey.replace(/[\s()-]/g, '');
9699
- var regexNumberTelephone = /^[1-9][\d]{1,2}\d{8,10}$/;
9700
- var isValidNumberTelephone = regexNumberTelephone.test(cellPhoneKey);
9701
- return isValidNumberTelephone ? null : { invalidPhoneNumber: true };
9702
- };
9703
- /**
9704
- * Valida o email da chave PIX.
9705
- */
9706
- GenericValidator.isValidEmail = function (control) {
9707
- var emailKey = control.value;
9708
- var regexValidEmail = /^[\w-\.]+@[\w-]+(\.[\w-]{2,4}){1,2}$/;
9709
- var isValidEmail = regexValidEmail.test(emailKey);
9710
- return isValidEmail ? null : { invalidEmail: true };
9711
- };
9712
- return GenericValidator;
9713
- }());
9714
-
9715
- var HistoricakPixAccountBase = /** @class */ (function () {
9716
- function HistoricakPixAccountBase(formBuilder) {
9717
- this._paramsForm = new forms.FormGroup({});
9718
- this._defaultCpfNumber = null;
9719
- this.initialValidatorOfPercentage = [forms.Validators.required, forms.Validators.min(0.01)];
9720
- this.pixAccountList = [];
9721
- this.maxValuePercentage = 100.0;
9722
- this.isShowPixKeyFieldValidatorMessage = false;
9424
+ var HistoricalPixAccountComponent = /** @class */ (function () {
9425
+ function HistoricalPixAccountComponent(translateService, cd, formBuilder, messageService) {
9426
+ var _this = this;
9427
+ this.translateService = translateService;
9428
+ this.cd = cd;
9723
9429
  this.formBuilder = formBuilder;
9724
- this.createFormGroupBase();
9725
- }
9726
- HistoricakPixAccountBase.prototype.phoneMask = function (event) {
9727
- FormatUtilsService.formatTelephoneInputEvent(event);
9728
- };
9729
- HistoricakPixAccountBase.prototype.cpfMask = function (event) {
9730
- FormatUtilsService.formatCpfInputEvent(event);
9731
- };
9732
- HistoricakPixAccountBase.prototype.cnpjMask = function (event) {
9733
- FormatUtilsService.formatCnpjInputEvent(event);
9734
- };
9735
- HistoricakPixAccountBase.prototype.onChangePixKeyType = function (item, form) {
9736
- if (!item || !item.key)
9737
- return;
9738
- this.pixKeyType = item.key;
9739
- var targetForm = (typeof form !== 'undefined' && form !== null)
9740
- ? form
9741
- : this.pixAccountFormGroup;
9742
- this.isShowPixKeyFieldValidatorMessage = true;
9743
- var pixKeyControl = targetForm.get("pixKey");
9744
- if (pixKeyControl) {
9745
- pixKeyControl.reset();
9746
- }
9747
- this.setPixKeyValidators(true, targetForm);
9748
- if (item.key === "CPF") {
9749
- this.setDefaultCpfPixKey(targetForm);
9750
- }
9751
- };
9752
- HistoricakPixAccountBase.prototype.onClearPixKeyType = function (form) {
9753
- var targetForm = (typeof form !== 'undefined' && form !== null)
9754
- ? form
9755
- : this.pixAccountFormGroup;
9756
- this.isShowPixKeyFieldValidatorMessage = false;
9757
- if (targetForm.get("pixKey")) {
9758
- targetForm.get("pixKey").reset();
9759
- }
9760
- };
9761
- HistoricakPixAccountBase.prototype.setDefaultCpfPixKey = function (form) {
9762
- var targetForm = (typeof form !== 'undefined' && form !== null)
9763
- ? form
9764
- : this.pixAccountFormGroup;
9765
- if (this._defaultCpfNumber) {
9766
- if (targetForm.get("pixKey")) {
9767
- targetForm.get("pixKey").setValue(this._defaultCpfNumber);
9768
- }
9769
- }
9770
- else {
9771
- var sheetDocument = this._paramsForm.get("sheetDocument");
9772
- if (sheetDocument && sheetDocument.get("cpfNumber")) {
9773
- var cpf = sheetDocument.get("cpfNumber").value;
9774
- if (cpf && targetForm.get("pixKey")) {
9775
- targetForm.get("pixKey").setValue(cpf);
9776
- }
9777
- }
9778
- }
9779
- };
9780
- HistoricakPixAccountBase.prototype.createFormGroupBase = function () {
9781
- this.pixAccountFormGroup = this.formBuilder.group({
9782
- id: this.formBuilder.control(null),
9783
- index: this.formBuilder.control(null),
9784
- employee: this.formBuilder.control({ value: { tableId: null }, disabled: true }),
9785
- dateChange: this.formBuilder.control(null),
9786
- pixKeyType: this.formBuilder.control(null, forms.Validators.required),
9787
- pixKey: this.formBuilder.control(null),
9788
- percentage: this.formBuilder.control(null, forms.Validators.compose(__spread(this.initialValidatorOfPercentage, [
9789
- forms.Validators.max(this.maxValuePercentage),
9790
- ]))),
9791
- externalId: this.formBuilder.control(null),
9792
- customFields: this.formBuilder.control(null),
9793
- });
9794
- };
9795
- HistoricakPixAccountBase.prototype.setValidatorsAccordingList = function (pixAccountList, index, isEditMode, form) {
9796
- if (index === void 0) { index = null; }
9797
- if (isEditMode === void 0) { isEditMode = true; }
9798
- var targetForm = (typeof form !== 'undefined' && form !== null)
9799
- ? form
9800
- : this.pixAccountFormGroup;
9801
- this.pixAccountList = (pixAccountList && pixAccountList.length > 0)
9802
- ? [].concat(pixAccountList)
9803
- : [];
9804
- var percentageIncluded = [];
9805
- for (var i = 0; i < this.pixAccountList.length; i++) {
9806
- var field = this.pixAccountList[i];
9807
- if (field && field.percentage && i !== index) {
9808
- percentageIncluded.push(field.percentage);
9809
- }
9810
- }
9811
- this.beforeSetPixKeyTypeValidator(targetForm);
9812
- this.setPixKeyValidators(isEditMode, targetForm);
9813
- this.validatePercentageValid(percentageIncluded, targetForm);
9814
- };
9815
- HistoricakPixAccountBase.prototype.beforeSetPixKeyTypeValidator = function (form) {
9816
- var control = form.get("pixKeyType");
9817
- if (this.pixAccountList && this.pixAccountList.length) {
9818
- control.setValidators(forms.Validators.compose([
9819
- forms.Validators.required,
9820
- this.validateDuplicatePixKeyTypeBankAccount(this.pixAccountList),
9821
- ]));
9822
- }
9823
- else {
9824
- control.setValidators(forms.Validators.required);
9825
- }
9826
- control.updateValueAndValidity();
9827
- };
9828
- HistoricakPixAccountBase.prototype.setPixKeyValidators = function (isEditMode, form) {
9829
- var pixKey = form.get("pixKey");
9830
- switch (this.pixKeyType) {
9831
- case "TELEPHONE":
9832
- pixKey.setValidators(forms.Validators.compose([forms.Validators.required, GenericValidator.isValidPhoneNumber]));
9833
- break;
9834
- case "EMAIL":
9835
- pixKey.setValidators(forms.Validators.compose([forms.Validators.required, GenericValidator.isValidEmail]));
9836
- break;
9837
- case "CPF":
9838
- pixKey.setValidators(forms.Validators.compose([forms.Validators.required, GenericValidator.isValidCpf]));
9839
- break;
9840
- case "CNPJ":
9841
- pixKey.setValidators(forms.Validators.compose([forms.Validators.required, GenericValidator.isValidCnpj]));
9842
- break;
9843
- case "RANDOM_KEY":
9844
- pixKey.setValidators(forms.Validators.required);
9845
- break;
9846
- default:
9847
- pixKey.clearValidators();
9848
- }
9849
- if (isEditMode) {
9850
- pixKey.enable();
9851
- }
9852
- pixKey.updateValueAndValidity();
9853
- };
9854
- HistoricakPixAccountBase.prototype.validatePercentageValid = function (listValue, form) {
9855
- var percentage = form.get("percentage");
9856
- this.maxValuePercentage = listValue.reduce(function (acc, val) { return acc - val; }, 100.0);
9857
- percentage.setValidators(forms.Validators.compose(__spread(this.initialValidatorOfPercentage, [
9858
- forms.Validators.max(this.maxValuePercentage),
9859
- ])));
9860
- percentage.updateValueAndValidity();
9861
- };
9862
- HistoricakPixAccountBase.prototype.validateDuplicatePixKeyTypeBankAccount = function (listCompare) {
9863
- return function (control) {
9864
- var value = control.value;
9865
- var isDuplicate = listCompare.some(function (field) {
9866
- return value &&
9867
- field.pixKeyType.key === "BANK_ACCOUNT" &&
9868
- value.key === "BANK_ACCOUNT";
9869
- });
9870
- return isDuplicate ? { pixKeyTypeBankAccountDuplicate: true } : null;
9871
- };
9872
- };
9873
- Object.defineProperty(HistoricakPixAccountBase.prototype, "paramsForm", {
9874
- get: function () {
9875
- return this._paramsForm;
9876
- },
9877
- set: function (value) {
9878
- this._paramsForm = value;
9879
- },
9880
- enumerable: true,
9881
- configurable: true
9882
- });
9883
- Object.defineProperty(HistoricakPixAccountBase.prototype, "defaultCpfNumber", {
9884
- get: function () {
9885
- return this._defaultCpfNumber;
9886
- },
9887
- set: function (value) {
9888
- this._defaultCpfNumber = value;
9889
- },
9890
- enumerable: true,
9891
- configurable: true
9892
- });
9893
- return HistoricakPixAccountBase;
9894
- }());
9895
-
9896
- var HistoricalPixAccountService = /** @class */ (function () {
9897
- function HistoricalPixAccountService(http) {
9898
- this.http = http;
9899
- }
9900
- HistoricalPixAccountService.prototype.query = function (path, body, service) {
9901
- if (service === void 0) { service = exports.ServiceType.PAYROLL; }
9902
- return this.http.query(path, body, service);
9903
- };
9904
- HistoricalPixAccountService.prototype.enumQuery = function () {
9905
- var path = 'enumQuery';
9906
- var body = {
9907
- names: ['PixKeyType']
9908
- };
9909
- return this.http.query(path, body, exports.ServiceType.PAYROLL);
9910
- };
9911
- HistoricalPixAccountService.ctorParameters = function () { return [
9912
- { type: HttpClientService }
9913
- ]; };
9914
- HistoricalPixAccountService = __decorate([
9915
- core.Injectable()
9916
- ], HistoricalPixAccountService);
9917
- return HistoricalPixAccountService;
9918
- }());
9919
-
9920
- var HistoricalPixAccountComponent = /** @class */ (function (_super) {
9921
- __extends(HistoricalPixAccountComponent, _super);
9922
- function HistoricalPixAccountComponent(translateService, cd, formBuilder, sharedStateService, service) {
9923
- var _this = _super.call(this, formBuilder) || this;
9924
- _this.translateService = translateService;
9925
- _this.cd = cd;
9926
- _this.sharedStateService = sharedStateService;
9927
- _this.service = service;
9928
- _this.recordByRow = 1;
9929
- _this.showDateChange = false;
9930
- _this.isEditMode = false;
9931
- _this.isViewMode = false;
9932
- _this.withSideBar = true;
9933
- _this.listDataReciever = [];
9934
- _this.addExistentHistoricData = [];
9935
- _this.getListPixAccount = [];
9936
- _this.isEditModeForSave = false;
9937
- _this.showField = false;
9938
- _this.isViewModeActive = new core.EventEmitter();
9939
- _this.isEditModeActive = new core.EventEmitter();
9940
- _this.isDeleteModeActive = new core.EventEmitter();
9941
- _this.isValidChangeForm = new core.EventEmitter();
9942
- _this.reloadOnlyOnEdit = new core.EventEmitter();
9943
- _this.listFromApp = [];
9944
- _this.visibleChange = new core.EventEmitter();
9945
- _this.ngUnsubscribe = new rxjs.Subject();
9946
- _this.orderBy = {
9430
+ this.messageService = messageService;
9431
+ this.recordByRow = 1;
9432
+ this.showDateChange = false;
9433
+ this.isEditMode = false;
9434
+ this.isViewMode = false;
9435
+ this.withSideBar = true;
9436
+ this.defaultCpfNumber = null;
9437
+ this.listDataReciever = [];
9438
+ this.showButtonEdit = false;
9439
+ this.isViewModeActive = new core.EventEmitter();
9440
+ this.isEditModeActive = new core.EventEmitter();
9441
+ this.isDeleteModeActive = new core.EventEmitter();
9442
+ this.listFromApp = [];
9443
+ this.visibleChange = new core.EventEmitter();
9444
+ this.ngUnsubscribe = new rxjs.Subject();
9445
+ this.orderBy = {
9947
9446
  field: "dateChange",
9948
9447
  direction: exports.DirectionEnumeration.DESC,
9949
9448
  };
9950
- _this.pixAccountItemInput = {};
9951
- _this.totalRecords = 0;
9952
- _this.actionLabel = _this.translateService.instant("hcm.payroll.entries_query_actions_total_title");
9953
- _this.loading = true;
9954
- _this.listData = [];
9955
- _this.listDataNoPage = [];
9956
- _this.showButtonView = true;
9957
- _this.showEditMode = false;
9958
- _this.hasRecordsPix = true;
9959
- _this.hideFields = _this.sharedStateService.hideField$;
9960
- _this.suggestions = [];
9961
- _this.formGroupByRow = {};
9962
- _this.cols = [
9449
+ this.pixAccountItemInput = {};
9450
+ this.totalRecords = 0;
9451
+ this.actionLabel = this.translateService.instant("hcm.payroll.entries_query_actions_total_title");
9452
+ this.loading = true;
9453
+ this.listData = [];
9454
+ this.listDataNoPage = [];
9455
+ this.permitsEditBankAccount = false;
9456
+ this.cols = [
9963
9457
  {
9964
- label: _this.translateService.instant("hcm.payroll.employees_addition_pix_key_type"),
9458
+ label: this.translateService.instant("hcm.payroll.employees_addition_pix_key_type"),
9965
9459
  field: "pixKeyType",
9966
9460
  },
9967
9461
  {
9968
- label: _this.translateService.instant("hcm.payroll.employees_addition_pix_key"),
9462
+ label: this.translateService.instant("hcm.payroll.employees_addition_pix_key"),
9969
9463
  field: "pixKey",
9970
9464
  },
9971
9465
  {
9972
- label: _this.translateService.instant("hcm.payroll.historical_pix_account_label_percentage"),
9466
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_percentage"),
9973
9467
  field: "percentage",
9974
9468
  },
9975
- {
9976
- label: _this.translateService.instant("hcm.payroll.movimentation_generic_action"),
9977
- field: "actions",
9978
- }
9979
9469
  ];
9980
- _this.actions = function (rowData, key) {
9470
+ this.actions = function (rowData, key) {
9981
9471
  if (rowData === void 0) { rowData = {}; }
9982
9472
  return [
9983
9473
  {
@@ -9995,7 +9485,7 @@
9995
9485
  },
9996
9486
  },
9997
9487
  {
9998
- visible: !!(!_this.isEditMode && _this.withSideBar),
9488
+ visible: !!((!_this.isEditMode && _this.withSideBar) || _this.showButtonEdit),
9999
9489
  label: _this.translateService.instant("hcm.payroll.edit"),
10000
9490
  command: function () {
10001
9491
  if (_this.isAllowToEditHistorical) {
@@ -10014,7 +9504,7 @@
10014
9504
  },
10015
9505
  },
10016
9506
  {
10017
- visible: !_this.isEditMode || _this.showEditMode,
9507
+ visible: !_this.isEditMode,
10018
9508
  label: _this.translateService.instant("hcm.payroll.delete"),
10019
9509
  command: function () {
10020
9510
  if (_this.isAllowToDeleteHistorical) {
@@ -10032,48 +9522,17 @@
10032
9522
  },
10033
9523
  ];
10034
9524
  };
10035
- _this.createFormGroup();
10036
- return _this;
9525
+ this.createFormGroup();
10037
9526
  }
10038
9527
  HistoricalPixAccountComponent.prototype.ngOnInit = function () {
10039
- var _this = this;
10040
- this.showFields = this.showField;
10041
9528
  this.formGroup.setControl(this.fieldFormGroup, this.historicalPixAccountList);
10042
- this.sharedStateService.showButton$.subscribe(function (value) {
10043
- _this.showButtonView = value;
10044
- });
10045
- this.sharedStateService.showEditMode$.subscribe(function (value) {
10046
- _this.showEditMode = value;
10047
- _this.isEditModeForSave = value;
10048
- });
10049
- this.sharedStateService.shouldReloadWindowOnlyEditMode$.subscribe(function (value) {
10050
- _this.reloadOnlyOnEdit.emit(value);
10051
- });
10052
- this.sharedStateService.activeValidatorsOnEditModalOpen$
10053
- .subscribe(function () {
10054
- Object.values(_this.formGroupByRow).forEach(function (fg) {
10055
- Object.values(fg.controls).forEach(function (control) {
10056
- control.markAsTouched();
10057
- control.updateValueAndValidity();
10058
- });
10059
- });
10060
- _this.emitFormValidity();
10061
- });
10062
9529
  };
10063
9530
  HistoricalPixAccountComponent.prototype.ngOnChanges = function (changes) {
10064
9531
  if (changes['listDataReciever'] && changes['listDataReciever'].currentValue) {
10065
9532
  this.listFromApp = changes['listDataReciever'].currentValue;
10066
9533
  }
10067
- if (changes['addExistentHistoricData'] && changes['addExistentHistoricData'].currentValue) {
10068
- this.getHistoricalPixAccountList();
10069
- }
10070
- if (changes['addExistentHistoricData'] && changes['addExistentHistoricData'].currentValue) {
10071
- var newData = changes['addExistentHistoricData'].currentValue;
10072
- this.rebuildFormGroupMap(newData);
10073
- }
10074
- if (changes['isEditMode']) {
10075
- this.isEditMode = changes['isEditMode'].currentValue;
10076
- this.cd.detectChanges();
9534
+ if (changes['showButtonEdit'] && changes['showButtonEdit'].currentValue) {
9535
+ this.permitsEditBankAccount = changes['showButtonEdit'].currentValue;
10077
9536
  }
10078
9537
  };
10079
9538
  HistoricalPixAccountComponent.prototype.createFormGroup = function () {
@@ -10088,98 +9547,6 @@
10088
9547
  HistoricalPixAccountComponent.prototype.ngAfterViewInit = function () {
10089
9548
  this.cd.detectChanges();
10090
9549
  };
10091
- HistoricalPixAccountComponent.prototype.emitFormValidity = function () {
10092
- var allValid = Object.values(this.formGroupByRow).every(function (fg) {
10093
- fg.updateValueAndValidity();
10094
- return fg.valid;
10095
- });
10096
- this.isValidChangeForm.emit(allValid);
10097
- };
10098
- HistoricalPixAccountComponent.prototype.filterPixKeyType = function (event) {
10099
- var _this = this;
10100
- var query = event.query;
10101
- this.service.enumQuery().subscribe(function (response) {
10102
- var pixKeyTypeEnum = response.results.find(function (result) { return result.enumName === 'PixKeyType'; });
10103
- if (pixKeyTypeEnum) {
10104
- _this.suggestions = pixKeyTypeEnum.items.filter(function (item) {
10105
- return item.value.toLowerCase().includes(query.toLowerCase());
10106
- });
10107
- }
10108
- else {
10109
- _this.suggestions = [];
10110
- }
10111
- });
10112
- };
10113
- HistoricalPixAccountComponent.prototype.createPixRowFormGroup = function () {
10114
- return this.formBuilder.group({
10115
- pixKeyType: [null, forms.Validators.required],
10116
- pixKey: [null],
10117
- percentage: [0, forms.Validators.compose(__spread(this.initialValidatorOfPercentage, [
10118
- forms.Validators.max(this.maxValuePercentage),
10119
- ]))]
10120
- });
10121
- };
10122
- HistoricalPixAccountComponent.prototype.onPixKeyInput = function (event, index) {
10123
- var inputValue = event.target.value;
10124
- var inputRawValue = inputValue.replace(/\D/g, '');
10125
- var form = this.formGroupByRow[index];
10126
- var pixKeyControl = form.get('pixKey');
10127
- if (pixKeyControl) {
10128
- pixKeyControl.setValue(inputRawValue, { emitEvent: false });
10129
- pixKeyControl.markAsDirty();
10130
- pixKeyControl.updateValueAndValidity();
10131
- }
10132
- this.setPixKeyValidators(true, form);
10133
- this.emitFormValidity();
10134
- };
10135
- HistoricalPixAccountComponent.prototype.onBlurPixCpfAndCnpj = function (index) {
10136
- var form = this.formGroupByRow[index];
10137
- var pixKeyControl = form.get('pixKey');
10138
- var pixKeyTypeControl = form.get('pixKeyType');
10139
- if (!pixKeyControl || !pixKeyTypeControl)
10140
- return;
10141
- var currentValue = pixKeyControl.value;
10142
- var pixKeyType = pixKeyTypeControl.value.key;
10143
- var rawValue = (currentValue || '').replace(/\D/g, '');
10144
- pixKeyControl.setValue(rawValue, { emitEvent: false });
10145
- if (pixKeyControl.valid) {
10146
- form.patchValue({
10147
- pixKeyFormatted: FormatUtilsService.getFormattedSubscriptionNumber(rawValue, pixKeyType)
10148
- });
10149
- }
10150
- this.emitFormValidity();
10151
- };
10152
- HistoricalPixAccountComponent.prototype.getFormattedPixKey = function (type, value) {
10153
- return FormatUtilsService.getFormattedSubscriptionNumber(value, type);
10154
- };
10155
- HistoricalPixAccountComponent.prototype.syncPixDataToParentForm = function () {
10156
- if (!this.isEditModeForSave)
10157
- return;
10158
- var values = Object.values(this.formGroupByRow).map(function (fg) {
10159
- var value = fg.getRawValue();
10160
- var pixKeyType = value.pixKeyType.key;
10161
- if (pixKeyType === 'CPF' || pixKeyType === 'CNPJ') {
10162
- value.pixKey = (value.pixKey || '').replace(/[.\-\/]/g, '');
10163
- }
10164
- else if (pixKeyType === 'TELEPHONE') {
10165
- value.pixKey = (value.pixKey || '').replace(/[()\s\-]/g, '');
10166
- }
10167
- return value;
10168
- });
10169
- this.formGroup
10170
- .get(this.fieldFormGroup)
10171
- .get('historicalPixAccountList')
10172
- .setValue(values);
10173
- this.emitFormValidity();
10174
- };
10175
- HistoricalPixAccountComponent.prototype.syncResetPixFormToParent = function () {
10176
- this.formGroupByRow = {};
10177
- this.historicalPixAccountList.reset();
10178
- this.historicalPixAccountList.get('historicalPixAccountList').setValue([]);
10179
- if (this.addExistentHistoricData.length) {
10180
- this.rebuildFormGroupMap(this.addExistentHistoricData);
10181
- }
10182
- };
10183
9550
  HistoricalPixAccountComponent.prototype.onLazyLoad = function (event) {
10184
9551
  var _this = this;
10185
9552
  var first = event && event.first ? event.first : 0;
@@ -10207,7 +9574,6 @@
10207
9574
  this.refreshCssInIE11();
10208
9575
  }
10209
9576
  this.loading = false;
10210
- this.cd.detectChanges();
10211
9577
  };
10212
9578
  /**
10213
9579
  * Um Bug de CSS que acontece nas linhas da tabela, que resolve só atualizando qualquer parte do CSS da pagina.
@@ -10225,68 +9591,12 @@
10225
9591
  this.pixAccountItemInput = {};
10226
9592
  this.visible = true;
10227
9593
  };
10228
- HistoricalPixAccountComponent.prototype.addPix = function () {
10229
- var newItem = {
10230
- pixKeyType: {},
10231
- pixKey: '',
10232
- percentage: 0
10233
- };
10234
- var index = this.addExistentHistoricData.length;
10235
- this.addExistentHistoricData = __spread(this.addExistentHistoricData, [
10236
- newItem
10237
- ]);
10238
- this.formGroupByRow[index] = this.createPixRowFormGroup();
10239
- this.setValidatorsAccordingList(this.addExistentHistoricData, index, true);
10240
- this.emitFormValidity();
10241
- };
10242
- HistoricalPixAccountComponent.prototype.deletePix = function (index) {
10243
- if (this.dataListPix.editingCell) {
10244
- this.dataListPix.editingCell = null;
10245
- }
10246
- this.addExistentHistoricData = this.addExistentHistoricData.filter(function (_, i) { return i !== index; });
10247
- this.rebuildFormGroupMap(this.addExistentHistoricData);
10248
- this.emitFormValidity();
10249
- };
10250
- HistoricalPixAccountComponent.prototype.rebuildFormGroupMap = function (data) {
10251
- var _this = this;
10252
- this.formGroupByRow = {};
10253
- data.forEach(function (item, index) {
10254
- var form = _this.createPixRowFormGroup();
10255
- var pixKeyType = item.pixKeyType.key;
10256
- var pixKeyRaw = item.pixKey;
10257
- if (pixKeyType === 'CPF' || pixKeyType === 'CNPJ') {
10258
- item.pixKey = FormatUtilsService.getFormattedSubscriptionNumber(pixKeyRaw, pixKeyType);
10259
- }
10260
- if (pixKeyType === 'TELEPHONE') {
10261
- item.pixKey = FormatUtilsService.getFormattedTelephoneNumber(pixKeyRaw);
10262
- }
10263
- form.patchValue(item);
10264
- _this.formGroupByRow[index] = form;
10265
- _this.pixKeyType = pixKeyType;
10266
- _this.setPixKeyValidators(true, form);
10267
- _this.setValidatorsAccordingList(data, index, _this.isEditMode);
10268
- var listValues = data
10269
- .filter(function (_, i) { return i !== index; })
10270
- .map(function (row) { return row.percentage ? parseFloat(row.percentage) : 0; });
10271
- _this.validatePercentageValid(listValues, form);
10272
- });
10273
- this.emitFormValidity();
10274
- };
10275
- HistoricalPixAccountComponent.prototype.onPixKeyTypeChange = function (item, index) {
10276
- var _this = this;
10277
- var form = this.formGroupByRow[index];
10278
- this.onChangePixKeyType(item, form);
10279
- this.addExistentHistoricData[index].pixKey = '';
10280
- setTimeout(function () {
10281
- if (_this.dataListPix.editingCell) {
10282
- _this.dataListPix.editingCell = null;
10283
- }
9594
+ HistoricalPixAccountComponent.prototype.isNotAllowMessage = function () {
9595
+ this.messageService.add({
9596
+ severity: "error",
9597
+ summary: this.translateService.instant("hcm.payroll.error"),
9598
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10284
9599
  });
10285
- this.cd.detectChanges();
10286
- };
10287
- HistoricalPixAccountComponent.prototype.onPixKeyTypeClear = function (index) {
10288
- var form = this.formGroupByRow[index];
10289
- this.onClearPixKeyType(form);
10290
9600
  };
10291
9601
  HistoricalPixAccountComponent.prototype.deleteAnnuityItem = function (index) {
10292
9602
  var newlist = __spread(this.getHistoricalPixAccountList());
@@ -10348,23 +9658,6 @@
10348
9658
  this.msgTotalLimitByPercentage = null;
10349
9659
  }
10350
9660
  };
10351
- HistoricalPixAccountComponent.prototype.onSyncValue = function (field, index) {
10352
- if (this.formGroupByRow &&
10353
- this.formGroupByRow[index] &&
10354
- this.formGroupByRow[index].get(field)) {
10355
- var control = this.formGroupByRow[index].get(field);
10356
- var value = control.value;
10357
- this.addExistentHistoricData[index][field] = value;
10358
- control.markAsDirty();
10359
- control.markAsTouched();
10360
- control.updateValueAndValidity();
10361
- var currentList = this.addExistentHistoricData.map(function (item, i) {
10362
- return i === index ? 0 : item.percentage;
10363
- });
10364
- this.validatePercentageValid(currentList, this.formGroupByRow[index]);
10365
- this.emitFormValidity();
10366
- }
10367
- };
10368
9661
  Object.defineProperty(HistoricalPixAccountComponent.prototype, "scopedActions", {
10369
9662
  get: function () {
10370
9663
  return this.actions.bind(this);
@@ -10431,20 +9724,9 @@
10431
9724
  set: function (value) {
10432
9725
  this._visible = value;
10433
9726
  this.visibleChange.emit(this.visible);
10434
- },
10435
- enumerable: true,
10436
- configurable: true
10437
- });
10438
- Object.defineProperty(HistoricalPixAccountComponent.prototype, "paramsForm", {
10439
- set: function (value) {
10440
- this._paramsForm = value;
10441
- },
10442
- enumerable: true,
10443
- configurable: true
10444
- });
10445
- Object.defineProperty(HistoricalPixAccountComponent.prototype, "defaultCpfNumber", {
10446
- set: function (value) {
10447
- this._defaultCpfNumber = value;
9727
+ if (!value) {
9728
+ this.pixAccountItemInput = {};
9729
+ }
10448
9730
  },
10449
9731
  enumerable: true,
10450
9732
  configurable: true
@@ -10496,15 +9778,11 @@
10496
9778
  { type: core$1.TranslateService },
10497
9779
  { type: core.ChangeDetectorRef },
10498
9780
  { type: forms.FormBuilder },
10499
- { type: SharedStateService },
10500
- { type: HistoricalPixAccountService }
9781
+ { type: api.MessageService }
10501
9782
  ]; };
10502
9783
  __decorate([
10503
9784
  core.ViewChild(angularComponents.CustomFieldsComponent, { static: false })
10504
9785
  ], HistoricalPixAccountComponent.prototype, "customFields", void 0);
10505
- __decorate([
10506
- core.ViewChild('dataListPix', { static: false })
10507
- ], HistoricalPixAccountComponent.prototype, "dataListPix", void 0);
10508
9786
  __decorate([
10509
9787
  core.Input()
10510
9788
  ], HistoricalPixAccountComponent.prototype, "formGroup", void 0);
@@ -10546,22 +9824,19 @@
10546
9824
  ], HistoricalPixAccountComponent.prototype, "withSideBar", void 0);
10547
9825
  __decorate([
10548
9826
  core.Input()
10549
- ], HistoricalPixAccountComponent.prototype, "permission", void 0);
9827
+ ], HistoricalPixAccountComponent.prototype, "paramsForm", void 0);
10550
9828
  __decorate([
10551
9829
  core.Input()
10552
- ], HistoricalPixAccountComponent.prototype, "listDataReciever", void 0);
9830
+ ], HistoricalPixAccountComponent.prototype, "defaultCpfNumber", void 0);
10553
9831
  __decorate([
10554
9832
  core.Input()
10555
- ], HistoricalPixAccountComponent.prototype, "addExistentHistoricData", void 0);
10556
- __decorate([
10557
- core.Input()
10558
- ], HistoricalPixAccountComponent.prototype, "getListPixAccount", void 0);
9833
+ ], HistoricalPixAccountComponent.prototype, "permission", void 0);
10559
9834
  __decorate([
10560
9835
  core.Input()
10561
- ], HistoricalPixAccountComponent.prototype, "isEditModeForSave", void 0);
9836
+ ], HistoricalPixAccountComponent.prototype, "listDataReciever", void 0);
10562
9837
  __decorate([
10563
9838
  core.Input()
10564
- ], HistoricalPixAccountComponent.prototype, "showField", void 0);
9839
+ ], HistoricalPixAccountComponent.prototype, "showButtonEdit", void 0);
10565
9840
  __decorate([
10566
9841
  core.Output()
10567
9842
  ], HistoricalPixAccountComponent.prototype, "isViewModeActive", void 0);
@@ -10571,12 +9846,6 @@
10571
9846
  __decorate([
10572
9847
  core.Output()
10573
9848
  ], HistoricalPixAccountComponent.prototype, "isDeleteModeActive", void 0);
10574
- __decorate([
10575
- core.Output()
10576
- ], HistoricalPixAccountComponent.prototype, "isValidChangeForm", void 0);
10577
- __decorate([
10578
- core.Output()
10579
- ], HistoricalPixAccountComponent.prototype, "reloadOnlyOnEdit", void 0);
10580
9849
  __decorate([
10581
9850
  core.Input()
10582
9851
  ], HistoricalPixAccountComponent.prototype, "dateChange", null);
@@ -10589,44 +9858,214 @@
10589
9858
  __decorate([
10590
9859
  core.Input()
10591
9860
  ], HistoricalPixAccountComponent.prototype, "visible", null);
10592
- __decorate([
10593
- core.Input()
10594
- ], HistoricalPixAccountComponent.prototype, "paramsForm", null);
10595
- __decorate([
10596
- core.Input()
10597
- ], HistoricalPixAccountComponent.prototype, "defaultCpfNumber", null);
10598
9861
  HistoricalPixAccountComponent = __decorate([
10599
9862
  core.Component({
10600
9863
  // tslint:disable-next-line:component-selector
10601
9864
  selector: "c-historical-pix-account",
10602
- 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 [showField]=\"showFields\"\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 *ngIf=\"showFields || !showEditMode || !(hideFields | async)\" 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 *ngIf=\"showButtonView\" [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 *ngIf=\"showButtonView\" 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 && showButtonView\">\n <s-button id=\"table-admission-btn-actions-{{key}}\"\n *ngIf=\"!isViewMode && 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=\"!isViewMode && 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\n<!-- Template exlusivo para edi\u00E7\u00E3o de pix via modal-->\n<div *ngIf=\"!withSideBar && showEditMode && (hideFields | async)\" class=\"ui-g-12\">\n <!-- Bot\u00E3o Adicionar -->\n <div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <s-button\n id=\"btn-save\"\n label=\"{{ 'hcm.payroll.historical_pix_account_add' | translate}}\"\n priority=\"primary\"\n (onClick)=\"addPix()\">\n </s-button>\n </div>\n </div>\n\n <!-- Tabela -->\n <p-table #dataListPix sortField=\"percentage\"\n [columns]=\"cols\"\n [value]=\"addExistentHistoricData\"\n [pageLinks]=\"3\"\n [paginator]=\"true\"\n [responsive]=\"true\"\n [rows]=\"10\"\n [resetPageOnSort]=\"false\"\n [tableStyle]=\"{'margin-top': '2rem'}\"\n [customSort]=\"true\">\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th *ngFor=\"let col of cols\">\n {{ col.label }}\n </th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-item let-rowIndex=\"rowIndex\">\n <ng-container *ngIf=\"formGroupByRow[rowIndex]\" [formGroup]=\"formGroupByRow[rowIndex]\">\n <tr>\n <!-- Tipo de Chave -->\n <td class=\"ui-md-6 ui-sm-12 required\"\n [pEditableColumn]=\"item.pixKeyType\" pEditableColumnField=\"pixKeyType\">\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <div style=\"width: 100%; position: relative;\">\n <p-autoComplete\n [suggestions]=\"suggestions\"\n (completeMethod)=\"filterPixKeyType($event)\"\n formControlName=\"pixKeyType\"\n [dropdown]=\"true\"\n (onSelect)=\"onPixKeyTypeChange($event, rowIndex)\"\n (onClear)=\"onPixKeyTypeClear(rowIndex)\"\n (ngModelChange)=\"onSyncValue('pixKeyType', rowIndex)\"\n field=\"value\"\n placeholder=\"{{'hcm.payroll.select' | translate}}\"\n appendTo=\"body\"\n [panelStyle]=\"{ maxWidth: '300px', width: '100%' }\"\n [inputStyle]=\"{ width: '100%' }\"\n ></p-autoComplete>\n\n <s-control-errors [control]=\"formGroupByRow[rowIndex]?.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 </ng-template>\n <ng-template pTemplate=\"output\">\n {{ item.pixKeyType?.value }}\n </ng-template>\n </p-cellEditor>\n </td>\n\n <!-- Chave Pix -->\n <td class=\"ui-md-6 ui-sm-12 required\"\n [pEditableColumn]=\"item.pixKey\" pEditableColumnField=\"pixKey\"\n [ngClass]=\"{'required': item.pixKeyType.key !== 'BANK_ACCOUNT',\n 'disabled': item.pixKeyType && item.pixKeyType.key === 'BANK_ACCOUNT'\n }\">\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <ng-container [ngSwitch]=\"item.pixKeyType.key\">\n <input *ngSwitchCase=\"'TELEPHONE'\"\n only-number\n pInputText\n type=\"text\"\n formControlName=\"pixKey\"\n (keyup)=\"phoneMask($event)\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\"\n maxlength=\"15\"\n placeholder=\"(__) ____-____\" />\n\n <input *ngSwitchCase=\"'CPF'\"\n type=\"text\"\n pInputText\n formControlName=\"pixKey\"\n maxlength=\"14\"\n placeholder=\"___.___.___-__\"\n (input)=\"onPixKeyInput($event, rowIndex)\"\n (blur)=\"onBlurPixCpfAndCnpj(rowIndex)\"\n (keyup)=\"cpfMask($event)\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\" />\n\n <input *ngSwitchCase=\"'CNPJ'\"\n type=\"text\"\n pInputText\n formControlName=\"pixKey\"\n maxlength=\"18\"\n placeholder=\"___.___.___/____-__\"\n (input)=\"onPixKeyInput($event, rowIndex)\"\n (blur)=\"onBlurPixCpfAndCnpj(rowIndex)\"\n (keyup)=\"cnpjMask($event)\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\" />\n\n <input *ngSwitchCase=\"'EMAIL'\"\n pInputText\n type=\"email\"\n formControlName=\"pixKey\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\"\n placeholder=\"{{ 'hcm.payroll.employees_addition_email' | translate }}\" />\n\n <input *ngSwitchCase=\"'BANK_ACCOUNT'\"\n pInputText\n formControlName=\"pixKey\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\"\n [disabled]=\"true\" />\n\n <input *ngSwitchDefault\n pInputText\n type=\"text\"\n formControlName=\"pixKey\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\"\n maxlength=\"100\" />\n </ng-container>\n\n <s-control-errors *ngIf=\"isShowPixKeyFieldValidatorMessage\"\n [control]=\"formGroupByRow[rowIndex]?.get('pixKey')\"\n [errorMessages]=\"{\n required: 'hcm.payroll.required' | translate,\n invalidPhoneNumber: 'hcm.payroll.employees_addition_invalid_phone_number' | translate: { value: formGroupByRow[rowIndex]?.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 </ng-template>\n <ng-template pTemplate=\"output\">\n {{ getFormattedPixKey(item.pixKeyType?.key, item.pixKey) }}\n </ng-template>\n </p-cellEditor>\n </td>\n\n <!-- Percentual -->\n <td class=\"ui-md-6 ui-sm-12 required\"\n [pEditableColumn]=\"item.percentage\" pEditableColumnField=\"percentage\">\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <input\n pInputText type=\"number\"\n formControlName=\"percentage\"\n (ngModelChange)=\"onSyncValue('percentage', rowIndex)\"\n >\n <s-control-errors\n [control]=\"formGroupByRow[rowIndex]?.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 </ng-template>\n <ng-template pTemplate=\"output\">\n {{ item.percentage?.toFixed(2).replace('.', ',') }}%\n </ng-template>\n </p-cellEditor>\n </td>\n\n <!-- Bot\u00E3o de excluir -->\n <td>\n <s-button\n id=\"btn-delete\"\n label=\"{{ 'hcm.payroll.delete' | translate }}\"\n priority=\"default\"\n (onClick)=\"deletePix(rowIndex)\">\n </s-button>\n </td>\n </tr>\n </ng-container>\n </ng-template>\n </p-table>\n</div>\n",
9865
+ 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 && !isViewMode\">\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 [permitsEditBankAccountForm]=\"permitsEditBankAccount\"\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 *ngIf=\"!isViewMode\" [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 *ngIf=\"!isViewMode\" 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 && !isViewMode\">\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",
10603
9866
  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}"]
10604
9867
  })
10605
9868
  ], HistoricalPixAccountComponent);
10606
9869
  return HistoricalPixAccountComponent;
10607
- }(HistoricakPixAccountBase));
10608
-
10609
- var HistoricalPixAccountFormComponent = /** @class */ (function (_super) {
10610
- __extends(HistoricalPixAccountFormComponent, _super);
10611
- function HistoricalPixAccountFormComponent(formBuilder, cd, sharedStateService) {
10612
- var _this = _super.call(this, formBuilder) || this;
10613
- _this.cd = cd;
10614
- _this.sharedStateService = sharedStateService;
10615
- _this.withSideBar = true;
10616
- _this.isEditMode = false;
10617
- _this.showField = false;
10618
- _this.visibleChange = new core.EventEmitter();
10619
- _this.pixAccountItemToList = new core.EventEmitter();
10620
- _this.ngUnsubscribe = new rxjs.Subject();
10621
- _this.labelBtnAdd = "hcm.payroll.employees_add";
10622
- _this.visibleBtnSave = true;
10623
- _this.isView = false;
10624
- _this.isShowPixKeyFieldValidatorMessage = false;
10625
- _this.hideFields = _this.sharedStateService.hideField$;
10626
- _this.registerSubjects();
10627
- return _this;
10628
- }
10629
- HistoricalPixAccountFormComponent.prototype.ngOnInit = function () { };
9870
+ }());
9871
+
9872
+ var GenericValidator = /** @class */ (function () {
9873
+ function GenericValidator() {
9874
+ }
9875
+ /**
9876
+ * Valida o CEI (Cadastro específico de INSS) digitado.
9877
+ */
9878
+ GenericValidator.isValidCei = function (control) {
9879
+ var cei = control.value;
9880
+ if (!cei)
9881
+ return null;
9882
+ else if (cei.length != 11)
9883
+ return null;
9884
+ var multiplicadorBase = "3298765432";
9885
+ var total = 0;
9886
+ var resto = 0;
9887
+ var multiplicando = 0;
9888
+ var multiplicador = 0;
9889
+ if (cei.length !== 11 ||
9890
+ cei === "00000000000" ||
9891
+ cei === "11111111111" ||
9892
+ cei === "22222222222" ||
9893
+ cei === "33333333333" ||
9894
+ cei === "44444444444" ||
9895
+ cei === "55555555555" ||
9896
+ cei === "66666666666" ||
9897
+ cei === "77777777777" ||
9898
+ cei === "88888888888" ||
9899
+ cei === "99999999999")
9900
+ return { invalidCei: true };
9901
+ else {
9902
+ for (var i = 0; i < 10; i++) {
9903
+ multiplicando = parseInt(cei.substring(i, i + 1), 10);
9904
+ multiplicador = parseInt(multiplicadorBase.substring(i, i + 1), 10);
9905
+ total += multiplicando * multiplicador;
9906
+ }
9907
+ resto = 11 - (total % 11);
9908
+ resto = resto === 10 || resto === 11 ? 0 : resto;
9909
+ var digito = parseInt("" + cei.charAt(10), 10);
9910
+ return resto === digito ? null : { invalidCei: true };
9911
+ }
9912
+ };
9913
+ /**
9914
+ * Valida se o CPF é valido. Deve-se ser informado o cpf sem máscara.
9915
+ */
9916
+ GenericValidator.isValidCpf = function (control) {
9917
+ var cpf = control.value;
9918
+ if (cpf) {
9919
+ var numbers = void 0, digits = void 0, sum = void 0, i = void 0, result = void 0, equalDigits = void 0;
9920
+ equalDigits = 1;
9921
+ if (cpf.length < 11) {
9922
+ return null;
9923
+ }
9924
+ for (i = 0; i < cpf.length - 1; i++) {
9925
+ if (cpf.charAt(i) !== cpf.charAt(i + 1)) {
9926
+ equalDigits = 0;
9927
+ break;
9928
+ }
9929
+ }
9930
+ if (!equalDigits) {
9931
+ numbers = cpf.substring(0, 9);
9932
+ digits = cpf.substring(9);
9933
+ sum = 0;
9934
+ for (i = 10; i > 1; i--) {
9935
+ sum += numbers.charAt(10 - i) * i;
9936
+ }
9937
+ result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9938
+ if (result !== Number(digits.charAt(0))) {
9939
+ return { cpfNotValid: true };
9940
+ }
9941
+ numbers = cpf.substring(0, 10);
9942
+ sum = 0;
9943
+ for (i = 11; i > 1; i--) {
9944
+ sum += numbers.charAt(11 - i) * i;
9945
+ }
9946
+ result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9947
+ if (result !== Number(digits.charAt(1))) {
9948
+ return { cpfNotValid: true };
9949
+ }
9950
+ return null;
9951
+ }
9952
+ else {
9953
+ return { cpfNotValid: true };
9954
+ }
9955
+ }
9956
+ return null;
9957
+ };
9958
+ /**
9959
+ * Valida se o CNPJ é valido. Deve-se ser informado o cpf sem máscara.
9960
+ */
9961
+ GenericValidator.isValidCnpj = function (control) {
9962
+ var cnpj = control.value;
9963
+ if (cnpj) {
9964
+ var size = void 0, numbers = void 0, digits = void 0, sum = void 0, pos = void 0, result = void 0;
9965
+ cnpj = cnpj.replace(/[^\d]+/g, '');
9966
+ if (cnpj.length !== 14) {
9967
+ return null;
9968
+ }
9969
+ // Elimina CNPJs invalidos conhecidos
9970
+ if (cnpj === '00000000000000' ||
9971
+ cnpj === '11111111111111' ||
9972
+ cnpj === '22222222222222' ||
9973
+ cnpj === '33333333333333' ||
9974
+ cnpj === '44444444444444' ||
9975
+ cnpj === '55555555555555' ||
9976
+ cnpj === '66666666666666' ||
9977
+ cnpj === '77777777777777' ||
9978
+ cnpj === '88888888888888' ||
9979
+ cnpj === '99999999999999') {
9980
+ return { cnpjNotValid: true };
9981
+ }
9982
+ // Valida DVs
9983
+ size = cnpj.length - 2;
9984
+ numbers = cnpj.substring(0, size);
9985
+ digits = cnpj.substring(size);
9986
+ sum = 0;
9987
+ pos = size - 7;
9988
+ for (var i = size; i >= 1; i--) {
9989
+ sum += numbers.charAt(size - i) * pos--;
9990
+ if (pos < 2) {
9991
+ pos = 9;
9992
+ }
9993
+ }
9994
+ result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9995
+ if (result !== Number(digits.charAt(0))) {
9996
+ return { cnpjNotValid: true };
9997
+ }
9998
+ size = size + 1;
9999
+ numbers = cnpj.substring(0, size);
10000
+ sum = 0;
10001
+ pos = size - 7;
10002
+ for (var i = size; i >= 1; i--) {
10003
+ sum += numbers.charAt(size - i) * pos--;
10004
+ if (pos < 2) {
10005
+ pos = 9;
10006
+ }
10007
+ }
10008
+ result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
10009
+ if (result !== Number(digits.charAt(1))) {
10010
+ return { cnpjNotValid: true };
10011
+ }
10012
+ return null;
10013
+ }
10014
+ return null;
10015
+ };
10016
+ /**
10017
+ * Válida o número de telefone da chave PIX.
10018
+ */
10019
+ GenericValidator.isValidPhoneNumber = function (control) {
10020
+ var cellPhoneKey = control.value || '';
10021
+ cellPhoneKey = cellPhoneKey.replace(/[\s()-]/g, '');
10022
+ var regexNumberTelephone = /^[1-9][\d]{1,2}\d{8,10}$/;
10023
+ var isValidNumberTelephone = regexNumberTelephone.test(cellPhoneKey);
10024
+ return isValidNumberTelephone ? null : { invalidPhoneNumber: true };
10025
+ };
10026
+ /**
10027
+ * Valida o email da chave PIX.
10028
+ */
10029
+ GenericValidator.isValidEmail = function (control) {
10030
+ var emailKey = control.value;
10031
+ var regexValidEmail = /^[\w-\.]+@[\w-]+(\.[\w-]{2,4}){1,2}$/;
10032
+ var isValidEmail = regexValidEmail.test(emailKey);
10033
+ return isValidEmail ? null : { invalidEmail: true };
10034
+ };
10035
+ return GenericValidator;
10036
+ }());
10037
+
10038
+ var HistoricalPixAccountFormComponent = /** @class */ (function () {
10039
+ function HistoricalPixAccountFormComponent(formBuilder, cd) {
10040
+ this.formBuilder = formBuilder;
10041
+ this.cd = cd;
10042
+ this.withSideBar = true;
10043
+ this.isEditMode = false;
10044
+ this.paramsForm = new forms.FormGroup({});
10045
+ this.defaultCpfNumber = null;
10046
+ this.permitsEditBankAccountForm = false;
10047
+ this.visibleChange = new core.EventEmitter();
10048
+ this.pixAccountItemToList = new core.EventEmitter();
10049
+ this.ngUnsubscribe = new rxjs.Subject();
10050
+ this.initialValidatorOfPercentage = [forms.Validators.required, forms.Validators.min(0.01)];
10051
+ this.labelBtnAdd = "hcm.payroll.employees_add";
10052
+ this.maxValuePercentage = 100.00;
10053
+ this.visibleBtnSave = true;
10054
+ this.isView = false;
10055
+ this.isShowPixKeyFieldValidatorMessage = false;
10056
+ this.createFormGroup();
10057
+ this.registerSubjects();
10058
+ }
10059
+ HistoricalPixAccountFormComponent.prototype.ngOnInit = function () {
10060
+ };
10061
+ HistoricalPixAccountFormComponent.prototype.ngDoCheck = function () {
10062
+ if (this.pixAccountFormGroup && this.pixKeyType === "BANK_ACCOUNT") {
10063
+ var pixKeyControl = this.pixAccountFormGroup.get("pixKey");
10064
+ if (pixKeyControl && !pixKeyControl.disabled) {
10065
+ pixKeyControl.disable();
10066
+ }
10067
+ }
10068
+ };
10630
10069
  HistoricalPixAccountFormComponent.prototype.ngAfterViewInit = function () {
10631
10070
  this.cd.detectChanges();
10632
10071
  };
@@ -10634,7 +10073,38 @@
10634
10073
  this.ngUnsubscribe.next(true);
10635
10074
  this.ngUnsubscribe.unsubscribe();
10636
10075
  };
10637
- HistoricalPixAccountFormComponent.prototype.registerSubjects = function () { };
10076
+ HistoricalPixAccountFormComponent.prototype.registerSubjects = function () {
10077
+ };
10078
+ HistoricalPixAccountFormComponent.prototype.createFormGroup = function () {
10079
+ this.pixAccountFormGroup = this.formBuilder.group({
10080
+ id: this.formBuilder.control(null),
10081
+ index: this.formBuilder.control(null),
10082
+ employee: this.formBuilder.control({ value: { tableId: null }, disabled: true }),
10083
+ dateChange: this.formBuilder.control(null),
10084
+ pixKeyType: this.formBuilder.control(null, forms.Validators.required),
10085
+ pixKey: this.formBuilder.control(null),
10086
+ percentage: this.formBuilder.control(null, forms.Validators.compose(__spread(this.initialValidatorOfPercentage, [
10087
+ forms.Validators.max(this.maxValuePercentage),
10088
+ ]))),
10089
+ externalId: this.formBuilder.control(null),
10090
+ customFields: this.formBuilder.control(null),
10091
+ });
10092
+ };
10093
+ HistoricalPixAccountFormComponent.prototype.onChangePixKeyType = function (item) {
10094
+ if (item.key) {
10095
+ this.pixKeyType = item.key;
10096
+ this.isShowPixKeyFieldValidatorMessage = true;
10097
+ this.pixAccountFormGroup.get("pixKey").reset();
10098
+ this.setPixKeyValidators(true);
10099
+ if (item.key === "CPF") {
10100
+ this.setDefaultCpfPixKey();
10101
+ }
10102
+ }
10103
+ };
10104
+ HistoricalPixAccountFormComponent.prototype.onClearPixKeyType = function () {
10105
+ this.isShowPixKeyFieldValidatorMessage = false;
10106
+ this.pixAccountFormGroup.get("pixKey").reset();
10107
+ };
10638
10108
  Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "visible", {
10639
10109
  get: function () {
10640
10110
  return this._visible;
@@ -10673,8 +10143,7 @@
10673
10143
  });
10674
10144
  HistoricalPixAccountFormComponent.prototype.formatPixKeyTelephoneNumber = function () {
10675
10145
  if (this.pixKeyType === "TELEPHONE") {
10676
- var pixKeyCtrl = this.pixAccountFormGroup.get("pixKey");
10677
- pixKeyCtrl.setValue(FormatUtilsService.getFormattedTelephoneNumber(pixKeyCtrl.value));
10146
+ this.pixAccountFormGroup.get("pixKey").setValue(FormatUtilsService.getFormattedTelephoneNumber(this.pixAccountFormGroup.get("pixKey").value));
10678
10147
  }
10679
10148
  };
10680
10149
  HistoricalPixAccountFormComponent.prototype.convertDTOToShowWithCustomFields = function (data) {
@@ -10686,14 +10155,14 @@
10686
10155
  this.visibleBtnSave = isEditMode;
10687
10156
  if (this.pixAccountFormGroup.get("pixKeyType").value) {
10688
10157
  this.pixKeyType = this.pixAccountFormGroup.get("pixKeyType").value.key;
10689
- this.setPixKeyValidators(isEditMode, this.pixAccountFormGroup);
10158
+ this.setPixKeyValidators(isEditMode);
10690
10159
  this.formatPixKeyTelephoneNumber();
10691
10160
  }
10692
10161
  configEnabledFields(this.pixAccountFormGroup, isEditMode, [
10693
10162
  "pixKeyType",
10694
10163
  "pixKey",
10695
10164
  "percentage",
10696
- "customFields"
10165
+ "customFields",
10697
10166
  ], []);
10698
10167
  };
10699
10168
  HistoricalPixAccountFormComponent.prototype.close = function () {
@@ -10701,11 +10170,13 @@
10701
10170
  this.visible = false;
10702
10171
  };
10703
10172
  HistoricalPixAccountFormComponent.prototype.addItem = function () {
10173
+ this.pixAccountFormGroup.updateValueAndValidity();
10174
+ verifyValidationsForm.call(this.pixAccountFormGroup);
10704
10175
  if (this.pixAccountFormGroup.valid) {
10705
10176
  if (this.employeeId) {
10706
10177
  this.pixAccountFormGroup.get("employee").setValue({
10707
10178
  tableId: this.employeeId,
10708
- name: ""
10179
+ name: "",
10709
10180
  });
10710
10181
  }
10711
10182
  this.pixAccountItemToList.emit(this.pixAccountFormGroup.getRawValue());
@@ -10737,10 +10208,14 @@
10737
10208
  return {
10738
10209
  prefix: "",
10739
10210
  thousands: this.currency.thousandsSeparator,
10740
- decimal: this.currency.decimalSeparator
10211
+ decimal: this.currency.decimalSeparator,
10741
10212
  };
10742
10213
  };
10743
10214
  Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "getListPixAccount", {
10215
+ /**
10216
+ * O Input que recebe a lista do component pai e chama o método de validação passando a lista recebida.
10217
+ * @param pixAccountList
10218
+ */
10744
10219
  set: function (pixAccountList) {
10745
10220
  if (pixAccountList) {
10746
10221
  this.setValidatorsAccordingList(pixAccountList, null, false);
@@ -10752,6 +10227,85 @@
10752
10227
  enumerable: true,
10753
10228
  configurable: true
10754
10229
  });
10230
+ /**
10231
+ * Recebe a lista de registros já inseridos na tabela adiciona em uma variável os valores que serão usados para
10232
+ * a validação dos campos "percentage" e "pixAccount".
10233
+ * 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
10234
+ * no array de comparação dos validators.
10235
+ * @param pixAccountList
10236
+ * @param index
10237
+ */
10238
+ HistoricalPixAccountFormComponent.prototype.setValidatorsAccordingList = function (pixAccountList, index, isEditMode) {
10239
+ if (index === void 0) { index = null; }
10240
+ if (isEditMode === void 0) { isEditMode = true; }
10241
+ this.pixAccountList = pixAccountList && pixAccountList.length ? __spread(pixAccountList) : [];
10242
+ var percentageIncluded = [];
10243
+ if (this.pixAccountList && this.pixAccountList.length) {
10244
+ this.pixAccountList.filter(function (field, key) {
10245
+ if (field["percentage"] && key != index) {
10246
+ percentageIncluded.push(field["percentage"]);
10247
+ }
10248
+ });
10249
+ }
10250
+ this.beforeSetPixKeyTypeValidator();
10251
+ this.setPixKeyValidators(isEditMode);
10252
+ this.validatePercentageValid(percentageIncluded);
10253
+ };
10254
+ /**
10255
+ * Antes de setar o validator prepara as variáveis necessária para que seja feita a validação do campo.
10256
+ */
10257
+ HistoricalPixAccountFormComponent.prototype.setPixKeyValidators = function (isEditMode) {
10258
+ var genericPixKey = this.pixAccountFormGroup.get("pixKey");
10259
+ if (this.pixKeyType) {
10260
+ switch (this.pixKeyType) {
10261
+ case "TELEPHONE":
10262
+ genericPixKey.setValidators(forms.Validators.compose([
10263
+ forms.Validators.required, GenericValidator.isValidPhoneNumber,
10264
+ ]));
10265
+ break;
10266
+ case "EMAIL":
10267
+ genericPixKey.setValidators(forms.Validators.compose([
10268
+ forms.Validators.required, GenericValidator.isValidEmail,
10269
+ ]));
10270
+ break;
10271
+ case "CPF":
10272
+ genericPixKey.setValidators(forms.Validators.compose([
10273
+ forms.Validators.required, GenericValidator.isValidCpf,
10274
+ ]));
10275
+ break;
10276
+ case "CNPJ":
10277
+ genericPixKey.setValidators(forms.Validators.compose([
10278
+ forms.Validators.required, GenericValidator.isValidCnpj,
10279
+ ]));
10280
+ break;
10281
+ case "RANDOM_KEY":
10282
+ genericPixKey.setValidators(forms.Validators.required);
10283
+ break;
10284
+ default:
10285
+ genericPixKey.setValidators(null);
10286
+ break;
10287
+ }
10288
+ if (isEditMode) {
10289
+ genericPixKey.enable();
10290
+ }
10291
+ genericPixKey.updateValueAndValidity();
10292
+ }
10293
+ };
10294
+ /**
10295
+ * Este método calcula as parcentagens que já foram inseridas, e seta a diferença para chegar em
10296
+ * 100% na validação do campo "percentage" como um novo maxValue;
10297
+ * @param listValue
10298
+ */
10299
+ HistoricalPixAccountFormComponent.prototype.validatePercentageValid = function (listValue) {
10300
+ var percentage = this.pixAccountFormGroup.get("percentage");
10301
+ this.maxValuePercentage = listValue
10302
+ .reduce(function (currentValue, total) { return currentValue - total; }, 100.00);
10303
+ percentage
10304
+ .setValidators(forms.Validators.compose(__spread(this.initialValidatorOfPercentage, [
10305
+ forms.Validators.max(this.maxValuePercentage),
10306
+ ])));
10307
+ percentage.updateValueAndValidity();
10308
+ };
10755
10309
  Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "isViewMode", {
10756
10310
  set: function (condition) {
10757
10311
  this.isView = !!(condition && !this.withSideBar);
@@ -10762,24 +10316,59 @@
10762
10316
  enumerable: true,
10763
10317
  configurable: true
10764
10318
  });
10765
- Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "paramsForm", {
10766
- set: function (value) {
10767
- this._paramsForm = value;
10768
- },
10769
- enumerable: true,
10770
- configurable: true
10771
- });
10772
- Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "defaultCpfNumber", {
10773
- set: function (value) {
10774
- this._defaultCpfNumber = value;
10775
- },
10776
- enumerable: true,
10777
- configurable: true
10778
- });
10319
+ HistoricalPixAccountFormComponent.prototype.phoneMask = function (event) {
10320
+ FormatUtilsService.formatTelephoneInputEvent(event);
10321
+ };
10322
+ HistoricalPixAccountFormComponent.prototype.setDefaultCpfPixKey = function () {
10323
+ if (this.defaultCpfNumber) {
10324
+ this.pixAccountFormGroup.get("pixKey").setValue(this.defaultCpfNumber);
10325
+ }
10326
+ else {
10327
+ var sheetDocument = this.paramsForm.get("sheetDocument");
10328
+ if (sheetDocument) {
10329
+ var cpf = sheetDocument.get("cpfNumber").value;
10330
+ if (cpf) {
10331
+ this.pixAccountFormGroup.get("pixKey").setValue(cpf);
10332
+ }
10333
+ }
10334
+ }
10335
+ };
10336
+ HistoricalPixAccountFormComponent.prototype.beforeSetPixKeyTypeValidator = function () {
10337
+ var pixKeyType = this.pixAccountFormGroup.get("pixKeyType");
10338
+ if (this.pixAccountList && this.pixAccountList.length && pixKeyType) {
10339
+ pixKeyType
10340
+ .setValidators(forms.Validators.compose([
10341
+ forms.Validators.required,
10342
+ this.validateDuplicatePixKeyTypeBankAccount(this.pixAccountList),
10343
+ ]));
10344
+ }
10345
+ else {
10346
+ pixKeyType.setValidators(forms.Validators.required);
10347
+ }
10348
+ };
10349
+ HistoricalPixAccountFormComponent.prototype.validateDuplicatePixKeyTypeBankAccount = function (listCompare) {
10350
+ var _this = this;
10351
+ return function (control) {
10352
+ var value = control && control.value;
10353
+ var condition = false;
10354
+ listCompare.filter(function (field) {
10355
+ if (value) {
10356
+ if (field["pixKeyType"].key === 'BANK_ACCOUNT' && value.key === field["pixKeyType"].key) {
10357
+ return condition = true;
10358
+ }
10359
+ }
10360
+ });
10361
+ if (condition && !_this.permitsEditBankAccountForm) {
10362
+ return { pixKeyTypeBankAccountDuplicate: true };
10363
+ }
10364
+ else {
10365
+ return null;
10366
+ }
10367
+ };
10368
+ };
10779
10369
  HistoricalPixAccountFormComponent.ctorParameters = function () { return [
10780
10370
  { type: forms.FormBuilder },
10781
- { type: core.ChangeDetectorRef },
10782
- { type: SharedStateService }
10371
+ { type: core.ChangeDetectorRef }
10783
10372
  ]; };
10784
10373
  __decorate([
10785
10374
  core.ViewChild(angularComponents.CustomFieldsComponent, { static: true })
@@ -10801,7 +10390,13 @@
10801
10390
  ], HistoricalPixAccountFormComponent.prototype, "isEditMode", void 0);
10802
10391
  __decorate([
10803
10392
  core.Input()
10804
- ], HistoricalPixAccountFormComponent.prototype, "showField", void 0);
10393
+ ], HistoricalPixAccountFormComponent.prototype, "paramsForm", void 0);
10394
+ __decorate([
10395
+ core.Input()
10396
+ ], HistoricalPixAccountFormComponent.prototype, "defaultCpfNumber", void 0);
10397
+ __decorate([
10398
+ core.Input()
10399
+ ], HistoricalPixAccountFormComponent.prototype, "permitsEditBankAccountForm", void 0);
10805
10400
  __decorate([
10806
10401
  core.Output()
10807
10402
  ], HistoricalPixAccountFormComponent.prototype, "visibleChange", void 0);
@@ -10820,21 +10415,32 @@
10820
10415
  __decorate([
10821
10416
  core.Input()
10822
10417
  ], HistoricalPixAccountFormComponent.prototype, "isViewMode", null);
10823
- __decorate([
10824
- core.Input()
10825
- ], HistoricalPixAccountFormComponent.prototype, "paramsForm", null);
10826
- __decorate([
10827
- core.Input()
10828
- ], HistoricalPixAccountFormComponent.prototype, "defaultCpfNumber", null);
10829
10418
  HistoricalPixAccountFormComponent = __decorate([
10830
10419
  core.Component({
10831
10420
  selector: "pix-account",
10832
- template: "<div id=\"main\">\n <form *ngIf=\"showField || !(hideFields | async)\" [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\" maxlength=\"100\" />\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",
10421
+ 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\" maxlength=\"100\" />\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",
10833
10422
  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}"]
10834
10423
  })
10835
10424
  ], HistoricalPixAccountFormComponent);
10836
10425
  return HistoricalPixAccountFormComponent;
10837
- }(HistoricakPixAccountBase));
10426
+ }());
10427
+
10428
+ var HistoricalPixAccountService = /** @class */ (function () {
10429
+ function HistoricalPixAccountService(http) {
10430
+ this.http = http;
10431
+ }
10432
+ HistoricalPixAccountService.prototype.query = function (path, body, service) {
10433
+ if (service === void 0) { service = exports.ServiceType.PAYROLL; }
10434
+ return this.http.query(path, body, service);
10435
+ };
10436
+ HistoricalPixAccountService.ctorParameters = function () { return [
10437
+ { type: HttpClientService }
10438
+ ]; };
10439
+ HistoricalPixAccountService = __decorate([
10440
+ core.Injectable()
10441
+ ], HistoricalPixAccountService);
10442
+ return HistoricalPixAccountService;
10443
+ }());
10838
10444
 
10839
10445
  var HistoricalPixAccountModule = /** @class */ (function () {
10840
10446
  function HistoricalPixAccountModule() {
@@ -10864,8 +10470,6 @@
10864
10470
  angularComponents.CustomFieldsModule,
10865
10471
  panel.PanelModule,
10866
10472
  inputmask.InputMaskModule,
10867
- dropdown.DropdownModule,
10868
- tabview.TabViewModule,
10869
10473
  ],
10870
10474
  declarations: [HistoricalPixAccountComponent, HistoricalPixAccountFormComponent],
10871
10475
  providers: [HistoricalPixAccountService, api.ConfirmationService],
@@ -10908,7 +10512,7 @@
10908
10512
 
10909
10513
  var moment$e = moment_;
10910
10514
  var HistoricalPixAccountListComponent = /** @class */ (function () {
10911
- function HistoricalPixAccountListComponent(confirmationService, translateService, activatedRoute, cd, router, messageService, historicalPixAccountListService, sharedStateService) {
10515
+ function HistoricalPixAccountListComponent(confirmationService, translateService, activatedRoute, cd, router, messageService, historicalPixAccountListService) {
10912
10516
  this.confirmationService = confirmationService;
10913
10517
  this.translateService = translateService;
10914
10518
  this.activatedRoute = activatedRoute;
@@ -10916,14 +10520,13 @@
10916
10520
  this.router = router;
10917
10521
  this.messageService = messageService;
10918
10522
  this.historicalPixAccountListService = historicalPixAccountListService;
10919
- this.sharedStateService = sharedStateService;
10920
10523
  this.endPoint = "hcm/payroll/queries/historicalEmployeePixQuery";
10921
10524
  this.keyPayload = "historicalEmployeePix";
10922
10525
  this.withSidebar = true;
10923
10526
  this.isOnlyView = new core.EventEmitter();
10924
10527
  this.isOnlyEdit = new core.EventEmitter();
10925
10528
  this.enableView = new core.EventEmitter();
10926
- this.isEditJudicialDependentPix = new core.EventEmitter();
10529
+ this.enableEdit = new core.EventEmitter();
10927
10530
  this.ngUnsubscribe = new rxjs.Subject();
10928
10531
  this.loading = true;
10929
10532
  this.columns = [
@@ -10943,7 +10546,6 @@
10943
10546
  HistoricalPixAccountListComponent.prototype.ngOnDestroy = function () {
10944
10547
  this.ngUnsubscribe.next();
10945
10548
  this.ngUnsubscribe.complete();
10946
- this.unsubscribe();
10947
10549
  };
10948
10550
  HistoricalPixAccountListComponent.prototype.ngAfterViewInit = function () {
10949
10551
  this.cd.detectChanges();
@@ -10963,9 +10565,6 @@
10963
10565
  label: this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
10964
10566
  command: function () {
10965
10567
  if (_this.isAllowToViewHistorical) {
10966
- _this.sharedStateService.setHideField(true);
10967
- _this.sharedStateService.setShowButton(false);
10968
- _this.sharedStateService.setShowEditMode(false);
10969
10568
  var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
10970
10569
  if (_this.withSidebar) {
10971
10570
  _this.isOnlyView.emit(true);
@@ -10974,7 +10573,6 @@
10974
10573
  });
10975
10574
  }
10976
10575
  else {
10977
- _this.sharedStateService.setSaveButton(false);
10978
10576
  _this.enableView.emit(dateChange);
10979
10577
  }
10980
10578
  }
@@ -10987,22 +10585,16 @@
10987
10585
  label: this.translateService.instant("hcm.payroll.edit"),
10988
10586
  command: function () {
10989
10587
  if (_this.isAllowToEditHistorical) {
10990
- _this.sharedStateService.setHideField(true);
10991
- _this.sharedStateService.setShowButton(false);
10992
- _this.sharedStateService.setShowEditMode(true);
10993
10588
  var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
10994
10589
  if (_this.withSidebar) {
10590
+ _this.isOnlyView.emit(false);
10591
+ _this.isOnlyEdit.emit(true);
10995
10592
  _this.router.navigate(["historical-pix-account/" + dateChange], {
10996
10593
  relativeTo: _this.activatedRoute,
10997
10594
  });
10998
- _this.sharedStateService.setShouldReloadWindowOnlyEditMode(true);
10999
10595
  }
11000
10596
  else {
11001
- setTimeout(function () {
11002
- _this.sharedStateService.triggerActiveValidatorsOnEditModalOpen();
11003
- });
11004
- _this.sharedStateService.setSaveButton(true);
11005
- _this.enableView.emit(dateChange);
10597
+ _this.enableEdit.emit(dateChange);
11006
10598
  }
11007
10599
  }
11008
10600
  else {
@@ -11087,24 +10679,6 @@
11087
10679
  this.lastRecord = payload[0];
11088
10680
  }
11089
10681
  };
11090
- HistoricalPixAccountListComponent.prototype.unsubscribe = function () {
11091
- if (this._subscription) {
11092
- this._subscription.unsubscribe();
11093
- }
11094
- };
11095
- Object.defineProperty(HistoricalPixAccountListComponent.prototype, "hideFieldsOnAdd$", {
11096
- set: function (subject) {
11097
- var _this = this;
11098
- this.unsubscribe();
11099
- if (subject) {
11100
- this._subscription = subject.subscribe(function (value) {
11101
- _this.sharedStateService.setHideField(value);
11102
- });
11103
- }
11104
- },
11105
- enumerable: true,
11106
- configurable: true
11107
- });
11108
10682
  Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToAddHistorical", {
11109
10683
  get: function () {
11110
10684
  return (this.permission["incluir"]);
@@ -11157,8 +10731,7 @@
11157
10731
  { type: core.ChangeDetectorRef },
11158
10732
  { type: router.Router },
11159
10733
  { type: api.MessageService },
11160
- { type: HistoricalPixAccountListService },
11161
- { type: SharedStateService }
10734
+ { type: HistoricalPixAccountListService }
11162
10735
  ]; };
11163
10736
  __decorate([
11164
10737
  core.ViewChild(angularComponents.CustomFieldsComponent, { static: false })
@@ -11184,9 +10757,6 @@
11184
10757
  __decorate([
11185
10758
  core.Input()
11186
10759
  ], HistoricalPixAccountListComponent.prototype, "withSidebar", void 0);
11187
- __decorate([
11188
- core.Input()
11189
- ], HistoricalPixAccountListComponent.prototype, "hideField", void 0);
11190
10760
  __decorate([
11191
10761
  core.Output()
11192
10762
  ], HistoricalPixAccountListComponent.prototype, "isOnlyView", void 0);
@@ -11198,10 +10768,7 @@
11198
10768
  ], HistoricalPixAccountListComponent.prototype, "enableView", void 0);
11199
10769
  __decorate([
11200
10770
  core.Output()
11201
- ], HistoricalPixAccountListComponent.prototype, "isEditJudicialDependentPix", void 0);
11202
- __decorate([
11203
- core.Input()
11204
- ], HistoricalPixAccountListComponent.prototype, "hideFieldsOnAdd$", null);
10771
+ ], HistoricalPixAccountListComponent.prototype, "enableEdit", void 0);
11205
10772
  __decorate([
11206
10773
  core.Input()
11207
10774
  ], HistoricalPixAccountListComponent.prototype, "reloadList", null);
@@ -11324,7 +10891,6 @@
11324
10891
  exports.PermissionService = PermissionService;
11325
10892
  exports.ReportService = ReportService;
11326
10893
  exports.ServicesModule = ServicesModule;
11327
- exports.SharedStateService = SharedStateService;
11328
10894
  exports.SpinnerLoaderComponent = SpinnerLoaderComponent;
11329
10895
  exports.SpinnerLoaderModule = SpinnerLoaderModule;
11330
10896
  exports.StringMethods = StringMethods;
@@ -11420,8 +10986,7 @@
11420
10986
  exports.ɵo = AutocompleteService;
11421
10987
  exports.ɵp = LookupService$1;
11422
10988
  exports.ɵq = HistoricalBankAccountFormComponent;
11423
- exports.ɵr = HistoricakPixAccountBase;
11424
- exports.ɵs = HistoricalPixAccountFormComponent;
10989
+ exports.ɵr = HistoricalPixAccountFormComponent;
11425
10990
 
11426
10991
  Object.defineProperty(exports, '__esModule', { value: true });
11427
10992