@senior-gestao-pessoas/payroll-core 9.5.0-fbdcba79-4ef6-4255-9628-f5e2e790112a → 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 +465 -916
  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 -40
  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 -262
  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 +6 -44
  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 -304
  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 +6 -49
  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 +500 -911
  27. package/fesm2015/senior-gestao-pessoas-payroll-core.js.map +1 -1
  28. package/fesm5/senior-gestao-pessoas-payroll-core.js +462 -912
  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 -24
  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 -54
  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 -55
@@ -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,514 +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
- this.hideBtnAddForViewMode = new rxjs.BehaviorSubject(false);
9522
- this.hideBtnAddForViewMode$ = this.hideBtnAddForViewMode.asObservable();
9523
- }
9524
- SharedStateService.prototype.setHideField = function (value) {
9525
- this.hideFieldSubject.next(value);
9526
- };
9527
- SharedStateService.prototype.setShowButton = function (value) {
9528
- this.showButtonSubject.next(value);
9529
- };
9530
- SharedStateService.prototype.setSaveButton = function (value) {
9531
- this.saveButtonSubject.next(value);
9532
- };
9533
- SharedStateService.prototype.setShowEditMode = function (value) {
9534
- this.showEditMode.next(value);
9535
- };
9536
- SharedStateService.prototype.setShouldReloadWindowOnlyEditMode = function (value) {
9537
- this.shouldReloadWindowOnlyEditMode.next(value);
9538
- };
9539
- SharedStateService.prototype.triggerActiveValidatorsOnEditModalOpen = function () {
9540
- this.activeValidatorsOnEditModalOpen.next();
9541
- };
9542
- SharedStateService.prototype.setHideBtnAddForViewMode = function (value) {
9543
- this.hideBtnAddForViewMode.next(value);
9544
- };
9545
- SharedStateService.prototype.resetHideField = function () {
9546
- this.hideFieldSubject.next(true);
9547
- };
9548
- SharedStateService.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function SharedStateService_Factory() { return new SharedStateService(); }, token: SharedStateService, providedIn: "root" });
9549
- SharedStateService = __decorate([
9550
- core.Injectable({
9551
- providedIn: 'root',
9552
- })
9553
- ], SharedStateService);
9554
- return SharedStateService;
9555
- }());
9556
-
9557
- var GenericValidator = /** @class */ (function () {
9558
- function GenericValidator() {
9559
- }
9560
- /**
9561
- * Valida o CEI (Cadastro específico de INSS) digitado.
9562
- */
9563
- GenericValidator.isValidCei = function (control) {
9564
- var cei = control.value;
9565
- if (!cei)
9566
- return null;
9567
- else if (cei.length != 11)
9568
- return null;
9569
- var multiplicadorBase = "3298765432";
9570
- var total = 0;
9571
- var resto = 0;
9572
- var multiplicando = 0;
9573
- var multiplicador = 0;
9574
- if (cei.length !== 11 ||
9575
- cei === "00000000000" ||
9576
- cei === "11111111111" ||
9577
- cei === "22222222222" ||
9578
- cei === "33333333333" ||
9579
- cei === "44444444444" ||
9580
- cei === "55555555555" ||
9581
- cei === "66666666666" ||
9582
- cei === "77777777777" ||
9583
- cei === "88888888888" ||
9584
- cei === "99999999999")
9585
- return { invalidCei: true };
9586
- else {
9587
- for (var i = 0; i < 10; i++) {
9588
- multiplicando = parseInt(cei.substring(i, i + 1), 10);
9589
- multiplicador = parseInt(multiplicadorBase.substring(i, i + 1), 10);
9590
- total += multiplicando * multiplicador;
9591
- }
9592
- resto = 11 - (total % 11);
9593
- resto = resto === 10 || resto === 11 ? 0 : resto;
9594
- var digito = parseInt("" + cei.charAt(10), 10);
9595
- return resto === digito ? null : { invalidCei: true };
9596
- }
9597
- };
9598
- /**
9599
- * Valida se o CPF é valido. Deve-se ser informado o cpf sem máscara.
9600
- */
9601
- GenericValidator.isValidCpf = function (control) {
9602
- var cpf = control.value;
9603
- if (cpf) {
9604
- var numbers = void 0, digits = void 0, sum = void 0, i = void 0, result = void 0, equalDigits = void 0;
9605
- equalDigits = 1;
9606
- if (cpf.length < 11) {
9607
- return null;
9608
- }
9609
- for (i = 0; i < cpf.length - 1; i++) {
9610
- if (cpf.charAt(i) !== cpf.charAt(i + 1)) {
9611
- equalDigits = 0;
9612
- break;
9613
- }
9614
- }
9615
- if (!equalDigits) {
9616
- numbers = cpf.substring(0, 9);
9617
- digits = cpf.substring(9);
9618
- sum = 0;
9619
- for (i = 10; i > 1; i--) {
9620
- sum += numbers.charAt(10 - i) * i;
9621
- }
9622
- result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9623
- if (result !== Number(digits.charAt(0))) {
9624
- return { cpfNotValid: true };
9625
- }
9626
- numbers = cpf.substring(0, 10);
9627
- sum = 0;
9628
- for (i = 11; i > 1; i--) {
9629
- sum += numbers.charAt(11 - i) * i;
9630
- }
9631
- result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9632
- if (result !== Number(digits.charAt(1))) {
9633
- return { cpfNotValid: true };
9634
- }
9635
- return null;
9636
- }
9637
- else {
9638
- return { cpfNotValid: true };
9639
- }
9640
- }
9641
- return null;
9642
- };
9643
- /**
9644
- * Valida se o CNPJ é valido. Deve-se ser informado o cpf sem máscara.
9645
- */
9646
- GenericValidator.isValidCnpj = function (control) {
9647
- var cnpj = control.value;
9648
- if (cnpj) {
9649
- var size = void 0, numbers = void 0, digits = void 0, sum = void 0, pos = void 0, result = void 0;
9650
- cnpj = cnpj.replace(/[^\d]+/g, '');
9651
- if (cnpj.length !== 14) {
9652
- return null;
9653
- }
9654
- // Elimina CNPJs invalidos conhecidos
9655
- if (cnpj === '00000000000000' ||
9656
- cnpj === '11111111111111' ||
9657
- cnpj === '22222222222222' ||
9658
- cnpj === '33333333333333' ||
9659
- cnpj === '44444444444444' ||
9660
- cnpj === '55555555555555' ||
9661
- cnpj === '66666666666666' ||
9662
- cnpj === '77777777777777' ||
9663
- cnpj === '88888888888888' ||
9664
- cnpj === '99999999999999') {
9665
- return { cnpjNotValid: true };
9666
- }
9667
- // Valida DVs
9668
- size = cnpj.length - 2;
9669
- numbers = cnpj.substring(0, size);
9670
- digits = cnpj.substring(size);
9671
- sum = 0;
9672
- pos = size - 7;
9673
- for (var i = size; i >= 1; i--) {
9674
- sum += numbers.charAt(size - i) * pos--;
9675
- if (pos < 2) {
9676
- pos = 9;
9677
- }
9678
- }
9679
- result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9680
- if (result !== Number(digits.charAt(0))) {
9681
- return { cnpjNotValid: true };
9682
- }
9683
- size = size + 1;
9684
- numbers = cnpj.substring(0, size);
9685
- sum = 0;
9686
- pos = size - 7;
9687
- for (var i = size; i >= 1; i--) {
9688
- sum += numbers.charAt(size - i) * pos--;
9689
- if (pos < 2) {
9690
- pos = 9;
9691
- }
9692
- }
9693
- result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9694
- if (result !== Number(digits.charAt(1))) {
9695
- return { cnpjNotValid: true };
9696
- }
9697
- return null;
9698
- }
9699
- return null;
9700
- };
9701
- /**
9702
- * Válida o número de telefone da chave PIX.
9703
- */
9704
- GenericValidator.isValidPhoneNumber = function (control) {
9705
- var cellPhoneKey = control.value || '';
9706
- cellPhoneKey = cellPhoneKey.replace(/[\s()-]/g, '');
9707
- var regexNumberTelephone = /^[1-9][\d]{1,2}\d{8,10}$/;
9708
- var isValidNumberTelephone = regexNumberTelephone.test(cellPhoneKey);
9709
- return isValidNumberTelephone ? null : { invalidPhoneNumber: true };
9710
- };
9711
- /**
9712
- * Valida o email da chave PIX.
9713
- */
9714
- GenericValidator.isValidEmail = function (control) {
9715
- var emailKey = control.value;
9716
- var regexValidEmail = /^[\w-\.]+@[\w-]+(\.[\w-]{2,4}){1,2}$/;
9717
- var isValidEmail = regexValidEmail.test(emailKey);
9718
- return isValidEmail ? null : { invalidEmail: true };
9719
- };
9720
- return GenericValidator;
9721
- }());
9722
-
9723
- var HistoricakPixAccountBase = /** @class */ (function () {
9724
- function HistoricakPixAccountBase(formBuilder) {
9725
- this._paramsForm = new forms.FormGroup({});
9726
- this._defaultCpfNumber = null;
9727
- this.initialValidatorOfPercentage = [forms.Validators.required, forms.Validators.min(0.01)];
9728
- this.pixAccountList = [];
9729
- this.maxValuePercentage = 100.0;
9730
- 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;
9731
9429
  this.formBuilder = formBuilder;
9732
- this.createFormGroupBase();
9733
- }
9734
- HistoricakPixAccountBase.prototype.phoneMask = function (event) {
9735
- FormatUtilsService.formatTelephoneInputEvent(event);
9736
- };
9737
- HistoricakPixAccountBase.prototype.cpfMask = function (event) {
9738
- FormatUtilsService.formatCpfInputEvent(event);
9739
- };
9740
- HistoricakPixAccountBase.prototype.cnpjMask = function (event) {
9741
- FormatUtilsService.formatCnpjInputEvent(event);
9742
- };
9743
- HistoricakPixAccountBase.prototype.onChangePixKeyType = function (item, form) {
9744
- if (!item || !item.key)
9745
- return;
9746
- this.pixKeyType = item.key;
9747
- var targetForm = (typeof form !== 'undefined' && form !== null)
9748
- ? form
9749
- : this.pixAccountFormGroup;
9750
- this.isShowPixKeyFieldValidatorMessage = true;
9751
- var pixKeyControl = targetForm.get("pixKey");
9752
- if (pixKeyControl) {
9753
- pixKeyControl.reset();
9754
- }
9755
- this.setPixKeyValidators(true, targetForm);
9756
- if (item.key === "CPF") {
9757
- this.setDefaultCpfPixKey(targetForm);
9758
- }
9759
- };
9760
- HistoricakPixAccountBase.prototype.onClearPixKeyType = function (form) {
9761
- var targetForm = (typeof form !== 'undefined' && form !== null)
9762
- ? form
9763
- : this.pixAccountFormGroup;
9764
- this.isShowPixKeyFieldValidatorMessage = false;
9765
- if (targetForm.get("pixKey")) {
9766
- targetForm.get("pixKey").reset();
9767
- }
9768
- };
9769
- HistoricakPixAccountBase.prototype.setDefaultCpfPixKey = function (form) {
9770
- var targetForm = (typeof form !== 'undefined' && form !== null)
9771
- ? form
9772
- : this.pixAccountFormGroup;
9773
- if (this._defaultCpfNumber) {
9774
- if (targetForm.get("pixKey")) {
9775
- targetForm.get("pixKey").setValue(this._defaultCpfNumber);
9776
- }
9777
- }
9778
- else {
9779
- var sheetDocument = this._paramsForm.get("sheetDocument");
9780
- if (sheetDocument && sheetDocument.get("cpfNumber")) {
9781
- var cpf = sheetDocument.get("cpfNumber").value;
9782
- if (cpf && targetForm.get("pixKey")) {
9783
- targetForm.get("pixKey").setValue(cpf);
9784
- }
9785
- }
9786
- }
9787
- };
9788
- HistoricakPixAccountBase.prototype.createFormGroupBase = function () {
9789
- this.pixAccountFormGroup = this.formBuilder.group({
9790
- id: this.formBuilder.control(null),
9791
- index: this.formBuilder.control(null),
9792
- employee: this.formBuilder.control({ value: { tableId: null }, disabled: true }),
9793
- dateChange: this.formBuilder.control(null),
9794
- pixKeyType: this.formBuilder.control(null, forms.Validators.required),
9795
- pixKey: this.formBuilder.control(null),
9796
- percentage: this.formBuilder.control(null, forms.Validators.compose(__spread(this.initialValidatorOfPercentage, [
9797
- forms.Validators.max(this.maxValuePercentage),
9798
- ]))),
9799
- externalId: this.formBuilder.control(null),
9800
- customFields: this.formBuilder.control(null),
9801
- });
9802
- };
9803
- HistoricakPixAccountBase.prototype.setValidatorsAccordingList = function (pixAccountList, index, isEditMode, form) {
9804
- if (index === void 0) { index = null; }
9805
- if (isEditMode === void 0) { isEditMode = true; }
9806
- var targetForm = (typeof form !== 'undefined' && form !== null)
9807
- ? form
9808
- : this.pixAccountFormGroup;
9809
- this.pixAccountList = (pixAccountList && pixAccountList.length > 0)
9810
- ? [].concat(pixAccountList)
9811
- : [];
9812
- var percentageIncluded = [];
9813
- for (var i = 0; i < this.pixAccountList.length; i++) {
9814
- var field = this.pixAccountList[i];
9815
- if (field && field.percentage && i !== index) {
9816
- percentageIncluded.push(field.percentage);
9817
- }
9818
- }
9819
- this.beforeSetPixKeyTypeValidator(targetForm);
9820
- this.setPixKeyValidators(isEditMode, targetForm);
9821
- this.validatePercentageValid(percentageIncluded, targetForm);
9822
- };
9823
- HistoricakPixAccountBase.prototype.beforeSetPixKeyTypeValidator = function (form) {
9824
- var control = form.get("pixKeyType");
9825
- if (this.pixAccountList && this.pixAccountList.length) {
9826
- control.setValidators(forms.Validators.compose([
9827
- forms.Validators.required,
9828
- this.validateDuplicatePixKeyTypeBankAccount(this.pixAccountList),
9829
- ]));
9830
- }
9831
- else {
9832
- control.setValidators(forms.Validators.required);
9833
- }
9834
- control.updateValueAndValidity();
9835
- };
9836
- HistoricakPixAccountBase.prototype.setPixKeyValidators = function (isEditMode, form) {
9837
- var pixKey = form.get("pixKey");
9838
- switch (this.pixKeyType) {
9839
- case "TELEPHONE":
9840
- pixKey.setValidators(forms.Validators.compose([forms.Validators.required, GenericValidator.isValidPhoneNumber]));
9841
- break;
9842
- case "EMAIL":
9843
- pixKey.setValidators(forms.Validators.compose([forms.Validators.required, GenericValidator.isValidEmail]));
9844
- break;
9845
- case "CPF":
9846
- pixKey.setValidators(forms.Validators.compose([forms.Validators.required, GenericValidator.isValidCpf]));
9847
- break;
9848
- case "CNPJ":
9849
- pixKey.setValidators(forms.Validators.compose([forms.Validators.required, GenericValidator.isValidCnpj]));
9850
- break;
9851
- case "RANDOM_KEY":
9852
- pixKey.setValidators(forms.Validators.required);
9853
- break;
9854
- default:
9855
- pixKey.clearValidators();
9856
- }
9857
- if (isEditMode) {
9858
- pixKey.enable();
9859
- }
9860
- pixKey.updateValueAndValidity();
9861
- };
9862
- HistoricakPixAccountBase.prototype.validatePercentageValid = function (listValue, form) {
9863
- var percentage = form.get("percentage");
9864
- this.maxValuePercentage = listValue.reduce(function (acc, val) { return acc - val; }, 100.0);
9865
- percentage.setValidators(forms.Validators.compose(__spread(this.initialValidatorOfPercentage, [
9866
- forms.Validators.max(this.maxValuePercentage),
9867
- ])));
9868
- percentage.updateValueAndValidity();
9869
- };
9870
- HistoricakPixAccountBase.prototype.validateDuplicatePixKeyTypeBankAccount = function (listCompare) {
9871
- return function (control) {
9872
- var value = control.value;
9873
- var isDuplicate = listCompare.some(function (field) {
9874
- return value &&
9875
- field.pixKeyType.key === "BANK_ACCOUNT" &&
9876
- value.key === "BANK_ACCOUNT";
9877
- });
9878
- return isDuplicate ? { pixKeyTypeBankAccountDuplicate: true } : null;
9879
- };
9880
- };
9881
- Object.defineProperty(HistoricakPixAccountBase.prototype, "paramsForm", {
9882
- get: function () {
9883
- return this._paramsForm;
9884
- },
9885
- set: function (value) {
9886
- this._paramsForm = value;
9887
- },
9888
- enumerable: true,
9889
- configurable: true
9890
- });
9891
- Object.defineProperty(HistoricakPixAccountBase.prototype, "defaultCpfNumber", {
9892
- get: function () {
9893
- return this._defaultCpfNumber;
9894
- },
9895
- set: function (value) {
9896
- this._defaultCpfNumber = value;
9897
- },
9898
- enumerable: true,
9899
- configurable: true
9900
- });
9901
- return HistoricakPixAccountBase;
9902
- }());
9903
-
9904
- var HistoricalPixAccountService = /** @class */ (function () {
9905
- function HistoricalPixAccountService(http) {
9906
- this.http = http;
9907
- }
9908
- HistoricalPixAccountService.prototype.query = function (path, body, service) {
9909
- if (service === void 0) { service = exports.ServiceType.PAYROLL; }
9910
- return this.http.query(path, body, service);
9911
- };
9912
- HistoricalPixAccountService.prototype.enumQuery = function () {
9913
- var path = 'enumQuery';
9914
- var body = {
9915
- names: ['PixKeyType']
9916
- };
9917
- return this.http.query(path, body, exports.ServiceType.PAYROLL);
9918
- };
9919
- HistoricalPixAccountService.ctorParameters = function () { return [
9920
- { type: HttpClientService }
9921
- ]; };
9922
- HistoricalPixAccountService = __decorate([
9923
- core.Injectable()
9924
- ], HistoricalPixAccountService);
9925
- return HistoricalPixAccountService;
9926
- }());
9927
-
9928
- var HistoricalPixAccountComponent = /** @class */ (function (_super) {
9929
- __extends(HistoricalPixAccountComponent, _super);
9930
- function HistoricalPixAccountComponent(translateService, cd, formBuilder, sharedStateService, service) {
9931
- var _this = _super.call(this, formBuilder) || this;
9932
- _this.translateService = translateService;
9933
- _this.cd = cd;
9934
- _this.sharedStateService = sharedStateService;
9935
- _this.service = service;
9936
- _this.recordByRow = 1;
9937
- _this.showDateChange = false;
9938
- _this.isEditMode = false;
9939
- _this.isViewMode = false;
9940
- _this.withSideBar = true;
9941
- _this.listDataReciever = [];
9942
- _this.addExistentHistoricData = [];
9943
- _this.getListPixAccount = [];
9944
- _this.isEditModeForSave = false;
9945
- _this.showField = false;
9946
- _this.isViewModeActive = new core.EventEmitter();
9947
- _this.isEditModeActive = new core.EventEmitter();
9948
- _this.isDeleteModeActive = new core.EventEmitter();
9949
- _this.isValidChangeForm = new core.EventEmitter();
9950
- _this.reloadOnlyOnEdit = new core.EventEmitter();
9951
- _this.listFromApp = [];
9952
- _this.visibleChange = new core.EventEmitter();
9953
- _this.ngUnsubscribe = new rxjs.Subject();
9954
- _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 = {
9955
9446
  field: "dateChange",
9956
9447
  direction: exports.DirectionEnumeration.DESC,
9957
9448
  };
9958
- _this.pixAccountItemInput = {};
9959
- _this.totalRecords = 0;
9960
- _this.actionLabel = _this.translateService.instant("hcm.payroll.entries_query_actions_total_title");
9961
- _this.loading = true;
9962
- _this.listData = [];
9963
- _this.listDataNoPage = [];
9964
- _this.showButtonView = true;
9965
- _this.showEditMode = false;
9966
- _this.hasRecordsPix = true;
9967
- _this.hideFields = _this.sharedStateService.hideField$;
9968
- _this.suggestions = [];
9969
- _this.formGroupByRow = {};
9970
- _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 = [
9971
9457
  {
9972
- label: _this.translateService.instant("hcm.payroll.employees_addition_pix_key_type"),
9458
+ label: this.translateService.instant("hcm.payroll.employees_addition_pix_key_type"),
9973
9459
  field: "pixKeyType",
9974
9460
  },
9975
9461
  {
9976
- label: _this.translateService.instant("hcm.payroll.employees_addition_pix_key"),
9462
+ label: this.translateService.instant("hcm.payroll.employees_addition_pix_key"),
9977
9463
  field: "pixKey",
9978
9464
  },
9979
9465
  {
9980
- label: _this.translateService.instant("hcm.payroll.historical_pix_account_label_percentage"),
9466
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_percentage"),
9981
9467
  field: "percentage",
9982
9468
  },
9983
- {
9984
- label: _this.translateService.instant("hcm.payroll.movimentation_generic_action"),
9985
- field: "actions",
9986
- }
9987
9469
  ];
9988
- _this.actions = function (rowData, key) {
9470
+ this.actions = function (rowData, key) {
9989
9471
  if (rowData === void 0) { rowData = {}; }
9990
9472
  return [
9991
9473
  {
@@ -10003,7 +9485,7 @@
10003
9485
  },
10004
9486
  },
10005
9487
  {
10006
- visible: !!(!_this.isEditMode && _this.withSideBar),
9488
+ visible: !!((!_this.isEditMode && _this.withSideBar) || _this.showButtonEdit),
10007
9489
  label: _this.translateService.instant("hcm.payroll.edit"),
10008
9490
  command: function () {
10009
9491
  if (_this.isAllowToEditHistorical) {
@@ -10022,7 +9504,7 @@
10022
9504
  },
10023
9505
  },
10024
9506
  {
10025
- visible: !_this.isEditMode || _this.showEditMode,
9507
+ visible: !_this.isEditMode,
10026
9508
  label: _this.translateService.instant("hcm.payroll.delete"),
10027
9509
  command: function () {
10028
9510
  if (_this.isAllowToDeleteHistorical) {
@@ -10040,51 +9522,17 @@
10040
9522
  },
10041
9523
  ];
10042
9524
  };
10043
- _this.createFormGroup();
10044
- return _this;
9525
+ this.createFormGroup();
10045
9526
  }
10046
9527
  HistoricalPixAccountComponent.prototype.ngOnInit = function () {
10047
- var _this = this;
10048
- this.showFields = this.showField;
10049
9528
  this.formGroup.setControl(this.fieldFormGroup, this.historicalPixAccountList);
10050
- this.sharedStateService.showButton$.subscribe(function (value) {
10051
- _this.showButtonView = value;
10052
- });
10053
- this.sharedStateService.showEditMode$.subscribe(function (value) {
10054
- _this.showEditMode = value;
10055
- _this.isEditModeForSave = value;
10056
- });
10057
- this.sharedStateService.shouldReloadWindowOnlyEditMode$.subscribe(function (value) {
10058
- _this.reloadOnlyOnEdit.emit(value);
10059
- });
10060
- this.sharedStateService.hideBtnAddForViewMode$.subscribe(function (value) {
10061
- _this.hideBtnAddForViewMode = value;
10062
- });
10063
- this.sharedStateService.activeValidatorsOnEditModalOpen$
10064
- .subscribe(function () {
10065
- Object.values(_this.formGroupByRow).forEach(function (fg) {
10066
- Object.values(fg.controls).forEach(function (control) {
10067
- control.markAsTouched();
10068
- control.updateValueAndValidity();
10069
- });
10070
- });
10071
- _this.emitFormValidity();
10072
- });
10073
9529
  };
10074
9530
  HistoricalPixAccountComponent.prototype.ngOnChanges = function (changes) {
10075
9531
  if (changes['listDataReciever'] && changes['listDataReciever'].currentValue) {
10076
9532
  this.listFromApp = changes['listDataReciever'].currentValue;
10077
9533
  }
10078
- if (changes['addExistentHistoricData'] && changes['addExistentHistoricData'].currentValue) {
10079
- this.getHistoricalPixAccountList();
10080
- }
10081
- if (changes['addExistentHistoricData'] && changes['addExistentHistoricData'].currentValue) {
10082
- var newData = changes['addExistentHistoricData'].currentValue;
10083
- this.rebuildFormGroupMap(newData);
10084
- }
10085
- if (changes['isEditMode']) {
10086
- this.isEditMode = changes['isEditMode'].currentValue;
10087
- this.cd.detectChanges();
9534
+ if (changes['showButtonEdit'] && changes['showButtonEdit'].currentValue) {
9535
+ this.permitsEditBankAccount = changes['showButtonEdit'].currentValue;
10088
9536
  }
10089
9537
  };
10090
9538
  HistoricalPixAccountComponent.prototype.createFormGroup = function () {
@@ -10099,98 +9547,6 @@
10099
9547
  HistoricalPixAccountComponent.prototype.ngAfterViewInit = function () {
10100
9548
  this.cd.detectChanges();
10101
9549
  };
10102
- HistoricalPixAccountComponent.prototype.emitFormValidity = function () {
10103
- var allValid = Object.values(this.formGroupByRow).every(function (fg) {
10104
- fg.updateValueAndValidity();
10105
- return fg.valid;
10106
- });
10107
- this.isValidChangeForm.emit(allValid);
10108
- };
10109
- HistoricalPixAccountComponent.prototype.filterPixKeyType = function (event) {
10110
- var _this = this;
10111
- var query = event.query;
10112
- this.service.enumQuery().subscribe(function (response) {
10113
- var pixKeyTypeEnum = response.results.find(function (result) { return result.enumName === 'PixKeyType'; });
10114
- if (pixKeyTypeEnum) {
10115
- _this.suggestions = pixKeyTypeEnum.items.filter(function (item) {
10116
- return item.value.toLowerCase().includes(query.toLowerCase());
10117
- });
10118
- }
10119
- else {
10120
- _this.suggestions = [];
10121
- }
10122
- });
10123
- };
10124
- HistoricalPixAccountComponent.prototype.createPixRowFormGroup = function () {
10125
- return this.formBuilder.group({
10126
- pixKeyType: [null, forms.Validators.required],
10127
- pixKey: [null],
10128
- percentage: [0, forms.Validators.compose(__spread(this.initialValidatorOfPercentage, [
10129
- forms.Validators.max(this.maxValuePercentage),
10130
- ]))]
10131
- });
10132
- };
10133
- HistoricalPixAccountComponent.prototype.onPixKeyInput = function (event, index) {
10134
- var inputValue = event.target.value;
10135
- var inputRawValue = inputValue.replace(/\D/g, '');
10136
- var form = this.formGroupByRow[index];
10137
- var pixKeyControl = form.get('pixKey');
10138
- if (pixKeyControl) {
10139
- pixKeyControl.setValue(inputRawValue, { emitEvent: false });
10140
- pixKeyControl.markAsDirty();
10141
- pixKeyControl.updateValueAndValidity();
10142
- }
10143
- this.setPixKeyValidators(true, form);
10144
- this.emitFormValidity();
10145
- };
10146
- HistoricalPixAccountComponent.prototype.onBlurPixCpfAndCnpj = function (index) {
10147
- var form = this.formGroupByRow[index];
10148
- var pixKeyControl = form.get('pixKey');
10149
- var pixKeyTypeControl = form.get('pixKeyType');
10150
- if (!pixKeyControl || !pixKeyTypeControl)
10151
- return;
10152
- var currentValue = pixKeyControl.value;
10153
- var pixKeyType = pixKeyTypeControl.value.key;
10154
- var rawValue = (currentValue || '').replace(/\D/g, '');
10155
- pixKeyControl.setValue(rawValue, { emitEvent: false });
10156
- if (pixKeyControl.valid) {
10157
- form.patchValue({
10158
- pixKeyFormatted: FormatUtilsService.getFormattedSubscriptionNumber(rawValue, pixKeyType)
10159
- });
10160
- }
10161
- this.emitFormValidity();
10162
- };
10163
- HistoricalPixAccountComponent.prototype.getFormattedPixKey = function (type, value) {
10164
- return FormatUtilsService.getFormattedSubscriptionNumber(value, type);
10165
- };
10166
- HistoricalPixAccountComponent.prototype.syncPixDataToParentForm = function () {
10167
- if (!this.isEditModeForSave)
10168
- return;
10169
- var values = Object.values(this.formGroupByRow).map(function (fg) {
10170
- var value = fg.getRawValue();
10171
- var pixKeyType = value.pixKeyType.key;
10172
- if (pixKeyType === 'CPF' || pixKeyType === 'CNPJ') {
10173
- value.pixKey = (value.pixKey || '').replace(/[.\-\/]/g, '');
10174
- }
10175
- else if (pixKeyType === 'TELEPHONE') {
10176
- value.pixKey = (value.pixKey || '').replace(/[()\s\-]/g, '');
10177
- }
10178
- return value;
10179
- });
10180
- this.formGroup
10181
- .get(this.fieldFormGroup)
10182
- .get('historicalPixAccountList')
10183
- .setValue(values);
10184
- this.emitFormValidity();
10185
- };
10186
- HistoricalPixAccountComponent.prototype.syncResetPixFormToParent = function () {
10187
- this.formGroupByRow = {};
10188
- this.historicalPixAccountList.reset();
10189
- this.historicalPixAccountList.get('historicalPixAccountList').setValue([]);
10190
- if (this.addExistentHistoricData.length) {
10191
- this.rebuildFormGroupMap(this.addExistentHistoricData);
10192
- }
10193
- };
10194
9550
  HistoricalPixAccountComponent.prototype.onLazyLoad = function (event) {
10195
9551
  var _this = this;
10196
9552
  var first = event && event.first ? event.first : 0;
@@ -10218,7 +9574,6 @@
10218
9574
  this.refreshCssInIE11();
10219
9575
  }
10220
9576
  this.loading = false;
10221
- this.cd.detectChanges();
10222
9577
  };
10223
9578
  /**
10224
9579
  * Um Bug de CSS que acontece nas linhas da tabela, que resolve só atualizando qualquer parte do CSS da pagina.
@@ -10236,68 +9591,12 @@
10236
9591
  this.pixAccountItemInput = {};
10237
9592
  this.visible = true;
10238
9593
  };
10239
- HistoricalPixAccountComponent.prototype.addPix = function () {
10240
- var newItem = {
10241
- pixKeyType: {},
10242
- pixKey: '',
10243
- percentage: 0
10244
- };
10245
- var index = this.addExistentHistoricData.length;
10246
- this.addExistentHistoricData = __spread(this.addExistentHistoricData, [
10247
- newItem
10248
- ]);
10249
- this.formGroupByRow[index] = this.createPixRowFormGroup();
10250
- this.setValidatorsAccordingList(this.addExistentHistoricData, index, true);
10251
- this.emitFormValidity();
10252
- };
10253
- HistoricalPixAccountComponent.prototype.deletePix = function (index) {
10254
- if (this.dataListPix.editingCell) {
10255
- this.dataListPix.editingCell = null;
10256
- }
10257
- this.addExistentHistoricData = this.addExistentHistoricData.filter(function (_, i) { return i !== index; });
10258
- this.rebuildFormGroupMap(this.addExistentHistoricData);
10259
- this.emitFormValidity();
10260
- };
10261
- HistoricalPixAccountComponent.prototype.rebuildFormGroupMap = function (data) {
10262
- var _this = this;
10263
- this.formGroupByRow = {};
10264
- data.forEach(function (item, index) {
10265
- var form = _this.createPixRowFormGroup();
10266
- var pixKeyType = item.pixKeyType.key;
10267
- var pixKeyRaw = item.pixKey;
10268
- if (pixKeyType === 'CPF' || pixKeyType === 'CNPJ') {
10269
- item.pixKey = FormatUtilsService.getFormattedSubscriptionNumber(pixKeyRaw, pixKeyType);
10270
- }
10271
- if (pixKeyType === 'TELEPHONE') {
10272
- item.pixKey = FormatUtilsService.getFormattedTelephoneNumber(pixKeyRaw);
10273
- }
10274
- form.patchValue(item);
10275
- _this.formGroupByRow[index] = form;
10276
- _this.pixKeyType = pixKeyType;
10277
- _this.setPixKeyValidators(true, form);
10278
- _this.setValidatorsAccordingList(data, index, _this.isEditMode);
10279
- var listValues = data
10280
- .filter(function (_, i) { return i !== index; })
10281
- .map(function (row) { return row.percentage ? parseFloat(row.percentage) : 0; });
10282
- _this.validatePercentageValid(listValues, form);
10283
- });
10284
- this.emitFormValidity();
10285
- };
10286
- HistoricalPixAccountComponent.prototype.onPixKeyTypeChange = function (item, index) {
10287
- var _this = this;
10288
- var form = this.formGroupByRow[index];
10289
- this.onChangePixKeyType(item, form);
10290
- this.addExistentHistoricData[index].pixKey = '';
10291
- setTimeout(function () {
10292
- if (_this.dataListPix.editingCell) {
10293
- _this.dataListPix.editingCell = null;
10294
- }
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"),
10295
9599
  });
10296
- this.cd.detectChanges();
10297
- };
10298
- HistoricalPixAccountComponent.prototype.onPixKeyTypeClear = function (index) {
10299
- var form = this.formGroupByRow[index];
10300
- this.onClearPixKeyType(form);
10301
9600
  };
10302
9601
  HistoricalPixAccountComponent.prototype.deleteAnnuityItem = function (index) {
10303
9602
  var newlist = __spread(this.getHistoricalPixAccountList());
@@ -10359,23 +9658,6 @@
10359
9658
  this.msgTotalLimitByPercentage = null;
10360
9659
  }
10361
9660
  };
10362
- HistoricalPixAccountComponent.prototype.onSyncValue = function (field, index) {
10363
- if (this.formGroupByRow &&
10364
- this.formGroupByRow[index] &&
10365
- this.formGroupByRow[index].get(field)) {
10366
- var control = this.formGroupByRow[index].get(field);
10367
- var value = control.value;
10368
- this.addExistentHistoricData[index][field] = value;
10369
- control.markAsDirty();
10370
- control.markAsTouched();
10371
- control.updateValueAndValidity();
10372
- var currentList = this.addExistentHistoricData.map(function (item, i) {
10373
- return i === index ? 0 : item.percentage;
10374
- });
10375
- this.validatePercentageValid(currentList, this.formGroupByRow[index]);
10376
- this.emitFormValidity();
10377
- }
10378
- };
10379
9661
  Object.defineProperty(HistoricalPixAccountComponent.prototype, "scopedActions", {
10380
9662
  get: function () {
10381
9663
  return this.actions.bind(this);
@@ -10442,20 +9724,9 @@
10442
9724
  set: function (value) {
10443
9725
  this._visible = value;
10444
9726
  this.visibleChange.emit(this.visible);
10445
- },
10446
- enumerable: true,
10447
- configurable: true
10448
- });
10449
- Object.defineProperty(HistoricalPixAccountComponent.prototype, "paramsForm", {
10450
- set: function (value) {
10451
- this._paramsForm = value;
10452
- },
10453
- enumerable: true,
10454
- configurable: true
10455
- });
10456
- Object.defineProperty(HistoricalPixAccountComponent.prototype, "defaultCpfNumber", {
10457
- set: function (value) {
10458
- this._defaultCpfNumber = value;
9727
+ if (!value) {
9728
+ this.pixAccountItemInput = {};
9729
+ }
10459
9730
  },
10460
9731
  enumerable: true,
10461
9732
  configurable: true
@@ -10507,15 +9778,11 @@
10507
9778
  { type: core$1.TranslateService },
10508
9779
  { type: core.ChangeDetectorRef },
10509
9780
  { type: forms.FormBuilder },
10510
- { type: SharedStateService },
10511
- { type: HistoricalPixAccountService }
9781
+ { type: api.MessageService }
10512
9782
  ]; };
10513
9783
  __decorate([
10514
9784
  core.ViewChild(angularComponents.CustomFieldsComponent, { static: false })
10515
9785
  ], HistoricalPixAccountComponent.prototype, "customFields", void 0);
10516
- __decorate([
10517
- core.ViewChild('dataListPix', { static: false })
10518
- ], HistoricalPixAccountComponent.prototype, "dataListPix", void 0);
10519
9786
  __decorate([
10520
9787
  core.Input()
10521
9788
  ], HistoricalPixAccountComponent.prototype, "formGroup", void 0);
@@ -10557,22 +9824,19 @@
10557
9824
  ], HistoricalPixAccountComponent.prototype, "withSideBar", void 0);
10558
9825
  __decorate([
10559
9826
  core.Input()
10560
- ], HistoricalPixAccountComponent.prototype, "permission", void 0);
9827
+ ], HistoricalPixAccountComponent.prototype, "paramsForm", void 0);
10561
9828
  __decorate([
10562
9829
  core.Input()
10563
- ], HistoricalPixAccountComponent.prototype, "listDataReciever", void 0);
9830
+ ], HistoricalPixAccountComponent.prototype, "defaultCpfNumber", void 0);
10564
9831
  __decorate([
10565
9832
  core.Input()
10566
- ], HistoricalPixAccountComponent.prototype, "addExistentHistoricData", void 0);
10567
- __decorate([
10568
- core.Input()
10569
- ], HistoricalPixAccountComponent.prototype, "getListPixAccount", void 0);
9833
+ ], HistoricalPixAccountComponent.prototype, "permission", void 0);
10570
9834
  __decorate([
10571
9835
  core.Input()
10572
- ], HistoricalPixAccountComponent.prototype, "isEditModeForSave", void 0);
9836
+ ], HistoricalPixAccountComponent.prototype, "listDataReciever", void 0);
10573
9837
  __decorate([
10574
9838
  core.Input()
10575
- ], HistoricalPixAccountComponent.prototype, "showField", void 0);
9839
+ ], HistoricalPixAccountComponent.prototype, "showButtonEdit", void 0);
10576
9840
  __decorate([
10577
9841
  core.Output()
10578
9842
  ], HistoricalPixAccountComponent.prototype, "isViewModeActive", void 0);
@@ -10582,12 +9846,6 @@
10582
9846
  __decorate([
10583
9847
  core.Output()
10584
9848
  ], HistoricalPixAccountComponent.prototype, "isDeleteModeActive", void 0);
10585
- __decorate([
10586
- core.Output()
10587
- ], HistoricalPixAccountComponent.prototype, "isValidChangeForm", void 0);
10588
- __decorate([
10589
- core.Output()
10590
- ], HistoricalPixAccountComponent.prototype, "reloadOnlyOnEdit", void 0);
10591
9849
  __decorate([
10592
9850
  core.Input()
10593
9851
  ], HistoricalPixAccountComponent.prototype, "dateChange", null);
@@ -10600,44 +9858,214 @@
10600
9858
  __decorate([
10601
9859
  core.Input()
10602
9860
  ], HistoricalPixAccountComponent.prototype, "visible", null);
10603
- __decorate([
10604
- core.Input()
10605
- ], HistoricalPixAccountComponent.prototype, "paramsForm", null);
10606
- __decorate([
10607
- core.Input()
10608
- ], HistoricalPixAccountComponent.prototype, "defaultCpfNumber", null);
10609
9861
  HistoricalPixAccountComponent = __decorate([
10610
9862
  core.Component({
10611
9863
  // tslint:disable-next-line:component-selector
10612
9864
  selector: "c-historical-pix-account",
10613
- 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<div class=\"ui-g-1\" *ngIf=\"withSideBar && !isEditMode && !hideBtnAddForViewMode\">\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",
10614
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}"]
10615
9867
  })
10616
9868
  ], HistoricalPixAccountComponent);
10617
9869
  return HistoricalPixAccountComponent;
10618
- }(HistoricakPixAccountBase));
10619
-
10620
- var HistoricalPixAccountFormComponent = /** @class */ (function (_super) {
10621
- __extends(HistoricalPixAccountFormComponent, _super);
10622
- function HistoricalPixAccountFormComponent(formBuilder, cd, sharedStateService) {
10623
- var _this = _super.call(this, formBuilder) || this;
10624
- _this.cd = cd;
10625
- _this.sharedStateService = sharedStateService;
10626
- _this.withSideBar = true;
10627
- _this.isEditMode = false;
10628
- _this.showField = false;
10629
- _this.visibleChange = new core.EventEmitter();
10630
- _this.pixAccountItemToList = new core.EventEmitter();
10631
- _this.ngUnsubscribe = new rxjs.Subject();
10632
- _this.labelBtnAdd = "hcm.payroll.employees_add";
10633
- _this.visibleBtnSave = true;
10634
- _this.isView = false;
10635
- _this.isShowPixKeyFieldValidatorMessage = false;
10636
- _this.hideFields = _this.sharedStateService.hideField$;
10637
- _this.registerSubjects();
10638
- return _this;
10639
- }
10640
- 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
+ };
10641
10069
  HistoricalPixAccountFormComponent.prototype.ngAfterViewInit = function () {
10642
10070
  this.cd.detectChanges();
10643
10071
  };
@@ -10645,7 +10073,38 @@
10645
10073
  this.ngUnsubscribe.next(true);
10646
10074
  this.ngUnsubscribe.unsubscribe();
10647
10075
  };
10648
- 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
+ };
10649
10108
  Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "visible", {
10650
10109
  get: function () {
10651
10110
  return this._visible;
@@ -10684,8 +10143,7 @@
10684
10143
  });
10685
10144
  HistoricalPixAccountFormComponent.prototype.formatPixKeyTelephoneNumber = function () {
10686
10145
  if (this.pixKeyType === "TELEPHONE") {
10687
- var pixKeyCtrl = this.pixAccountFormGroup.get("pixKey");
10688
- pixKeyCtrl.setValue(FormatUtilsService.getFormattedTelephoneNumber(pixKeyCtrl.value));
10146
+ this.pixAccountFormGroup.get("pixKey").setValue(FormatUtilsService.getFormattedTelephoneNumber(this.pixAccountFormGroup.get("pixKey").value));
10689
10147
  }
10690
10148
  };
10691
10149
  HistoricalPixAccountFormComponent.prototype.convertDTOToShowWithCustomFields = function (data) {
@@ -10697,14 +10155,14 @@
10697
10155
  this.visibleBtnSave = isEditMode;
10698
10156
  if (this.pixAccountFormGroup.get("pixKeyType").value) {
10699
10157
  this.pixKeyType = this.pixAccountFormGroup.get("pixKeyType").value.key;
10700
- this.setPixKeyValidators(isEditMode, this.pixAccountFormGroup);
10158
+ this.setPixKeyValidators(isEditMode);
10701
10159
  this.formatPixKeyTelephoneNumber();
10702
10160
  }
10703
10161
  configEnabledFields(this.pixAccountFormGroup, isEditMode, [
10704
10162
  "pixKeyType",
10705
10163
  "pixKey",
10706
10164
  "percentage",
10707
- "customFields"
10165
+ "customFields",
10708
10166
  ], []);
10709
10167
  };
10710
10168
  HistoricalPixAccountFormComponent.prototype.close = function () {
@@ -10712,11 +10170,13 @@
10712
10170
  this.visible = false;
10713
10171
  };
10714
10172
  HistoricalPixAccountFormComponent.prototype.addItem = function () {
10173
+ this.pixAccountFormGroup.updateValueAndValidity();
10174
+ verifyValidationsForm.call(this.pixAccountFormGroup);
10715
10175
  if (this.pixAccountFormGroup.valid) {
10716
10176
  if (this.employeeId) {
10717
10177
  this.pixAccountFormGroup.get("employee").setValue({
10718
10178
  tableId: this.employeeId,
10719
- name: ""
10179
+ name: "",
10720
10180
  });
10721
10181
  }
10722
10182
  this.pixAccountItemToList.emit(this.pixAccountFormGroup.getRawValue());
@@ -10748,10 +10208,14 @@
10748
10208
  return {
10749
10209
  prefix: "",
10750
10210
  thousands: this.currency.thousandsSeparator,
10751
- decimal: this.currency.decimalSeparator
10211
+ decimal: this.currency.decimalSeparator,
10752
10212
  };
10753
10213
  };
10754
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
+ */
10755
10219
  set: function (pixAccountList) {
10756
10220
  if (pixAccountList) {
10757
10221
  this.setValidatorsAccordingList(pixAccountList, null, false);
@@ -10763,6 +10227,85 @@
10763
10227
  enumerable: true,
10764
10228
  configurable: true
10765
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
+ };
10766
10309
  Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "isViewMode", {
10767
10310
  set: function (condition) {
10768
10311
  this.isView = !!(condition && !this.withSideBar);
@@ -10773,24 +10316,59 @@
10773
10316
  enumerable: true,
10774
10317
  configurable: true
10775
10318
  });
10776
- Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "paramsForm", {
10777
- set: function (value) {
10778
- this._paramsForm = value;
10779
- },
10780
- enumerable: true,
10781
- configurable: true
10782
- });
10783
- Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "defaultCpfNumber", {
10784
- set: function (value) {
10785
- this._defaultCpfNumber = value;
10786
- },
10787
- enumerable: true,
10788
- configurable: true
10789
- });
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
+ };
10790
10369
  HistoricalPixAccountFormComponent.ctorParameters = function () { return [
10791
10370
  { type: forms.FormBuilder },
10792
- { type: core.ChangeDetectorRef },
10793
- { type: SharedStateService }
10371
+ { type: core.ChangeDetectorRef }
10794
10372
  ]; };
10795
10373
  __decorate([
10796
10374
  core.ViewChild(angularComponents.CustomFieldsComponent, { static: true })
@@ -10812,7 +10390,13 @@
10812
10390
  ], HistoricalPixAccountFormComponent.prototype, "isEditMode", void 0);
10813
10391
  __decorate([
10814
10392
  core.Input()
10815
- ], 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);
10816
10400
  __decorate([
10817
10401
  core.Output()
10818
10402
  ], HistoricalPixAccountFormComponent.prototype, "visibleChange", void 0);
@@ -10831,21 +10415,32 @@
10831
10415
  __decorate([
10832
10416
  core.Input()
10833
10417
  ], HistoricalPixAccountFormComponent.prototype, "isViewMode", null);
10834
- __decorate([
10835
- core.Input()
10836
- ], HistoricalPixAccountFormComponent.prototype, "paramsForm", null);
10837
- __decorate([
10838
- core.Input()
10839
- ], HistoricalPixAccountFormComponent.prototype, "defaultCpfNumber", null);
10840
10418
  HistoricalPixAccountFormComponent = __decorate([
10841
10419
  core.Component({
10842
10420
  selector: "pix-account",
10843
- 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",
10844
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}"]
10845
10423
  })
10846
10424
  ], HistoricalPixAccountFormComponent);
10847
10425
  return HistoricalPixAccountFormComponent;
10848
- }(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
+ }());
10849
10444
 
10850
10445
  var HistoricalPixAccountModule = /** @class */ (function () {
10851
10446
  function HistoricalPixAccountModule() {
@@ -10875,8 +10470,6 @@
10875
10470
  angularComponents.CustomFieldsModule,
10876
10471
  panel.PanelModule,
10877
10472
  inputmask.InputMaskModule,
10878
- dropdown.DropdownModule,
10879
- tabview.TabViewModule,
10880
10473
  ],
10881
10474
  declarations: [HistoricalPixAccountComponent, HistoricalPixAccountFormComponent],
10882
10475
  providers: [HistoricalPixAccountService, api.ConfirmationService],
@@ -10919,7 +10512,7 @@
10919
10512
 
10920
10513
  var moment$e = moment_;
10921
10514
  var HistoricalPixAccountListComponent = /** @class */ (function () {
10922
- function HistoricalPixAccountListComponent(confirmationService, translateService, activatedRoute, cd, router, messageService, historicalPixAccountListService, sharedStateService) {
10515
+ function HistoricalPixAccountListComponent(confirmationService, translateService, activatedRoute, cd, router, messageService, historicalPixAccountListService) {
10923
10516
  this.confirmationService = confirmationService;
10924
10517
  this.translateService = translateService;
10925
10518
  this.activatedRoute = activatedRoute;
@@ -10927,14 +10520,13 @@
10927
10520
  this.router = router;
10928
10521
  this.messageService = messageService;
10929
10522
  this.historicalPixAccountListService = historicalPixAccountListService;
10930
- this.sharedStateService = sharedStateService;
10931
10523
  this.endPoint = "hcm/payroll/queries/historicalEmployeePixQuery";
10932
10524
  this.keyPayload = "historicalEmployeePix";
10933
10525
  this.withSidebar = true;
10934
10526
  this.isOnlyView = new core.EventEmitter();
10935
10527
  this.isOnlyEdit = new core.EventEmitter();
10936
10528
  this.enableView = new core.EventEmitter();
10937
- this.isEditJudicialDependentPix = new core.EventEmitter();
10529
+ this.enableEdit = new core.EventEmitter();
10938
10530
  this.ngUnsubscribe = new rxjs.Subject();
10939
10531
  this.loading = true;
10940
10532
  this.columns = [
@@ -10954,7 +10546,6 @@
10954
10546
  HistoricalPixAccountListComponent.prototype.ngOnDestroy = function () {
10955
10547
  this.ngUnsubscribe.next();
10956
10548
  this.ngUnsubscribe.complete();
10957
- this.unsubscribe();
10958
10549
  };
10959
10550
  HistoricalPixAccountListComponent.prototype.ngAfterViewInit = function () {
10960
10551
  this.cd.detectChanges();
@@ -10974,20 +10565,14 @@
10974
10565
  label: this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
10975
10566
  command: function () {
10976
10567
  if (_this.isAllowToViewHistorical) {
10977
- _this.sharedStateService.setHideField(true);
10978
- _this.sharedStateService.setShowButton(false);
10979
- _this.sharedStateService.setShowEditMode(false);
10980
10568
  var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
10981
10569
  if (_this.withSidebar) {
10982
10570
  _this.isOnlyView.emit(true);
10983
- _this.isOnlyEdit.emit(false);
10984
- _this.sharedStateService.setHideBtnAddForViewMode(true);
10985
10571
  _this.router.navigate(["historical-pix-account/" + dateChange], {
10986
10572
  relativeTo: _this.activatedRoute,
10987
10573
  });
10988
10574
  }
10989
10575
  else {
10990
- _this.sharedStateService.setSaveButton(false);
10991
10576
  _this.enableView.emit(dateChange);
10992
10577
  }
10993
10578
  }
@@ -11000,25 +10585,16 @@
11000
10585
  label: this.translateService.instant("hcm.payroll.edit"),
11001
10586
  command: function () {
11002
10587
  if (_this.isAllowToEditHistorical) {
11003
- _this.sharedStateService.setHideField(true);
11004
- _this.sharedStateService.setShowButton(false);
11005
- _this.sharedStateService.setShowEditMode(true);
11006
10588
  var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
11007
10589
  if (_this.withSidebar) {
11008
10590
  _this.isOnlyView.emit(false);
11009
10591
  _this.isOnlyEdit.emit(true);
11010
- _this.sharedStateService.setHideBtnAddForViewMode(false);
11011
10592
  _this.router.navigate(["historical-pix-account/" + dateChange], {
11012
10593
  relativeTo: _this.activatedRoute,
11013
10594
  });
11014
- _this.sharedStateService.setShouldReloadWindowOnlyEditMode(true);
11015
10595
  }
11016
10596
  else {
11017
- setTimeout(function () {
11018
- _this.sharedStateService.triggerActiveValidatorsOnEditModalOpen();
11019
- });
11020
- _this.sharedStateService.setSaveButton(true);
11021
- _this.enableView.emit(dateChange);
10597
+ _this.enableEdit.emit(dateChange);
11022
10598
  }
11023
10599
  }
11024
10600
  else {
@@ -11103,24 +10679,6 @@
11103
10679
  this.lastRecord = payload[0];
11104
10680
  }
11105
10681
  };
11106
- HistoricalPixAccountListComponent.prototype.unsubscribe = function () {
11107
- if (this._subscription) {
11108
- this._subscription.unsubscribe();
11109
- }
11110
- };
11111
- Object.defineProperty(HistoricalPixAccountListComponent.prototype, "hideFieldsOnAdd$", {
11112
- set: function (subject) {
11113
- var _this = this;
11114
- this.unsubscribe();
11115
- if (subject) {
11116
- this._subscription = subject.subscribe(function (value) {
11117
- _this.sharedStateService.setHideField(value);
11118
- });
11119
- }
11120
- },
11121
- enumerable: true,
11122
- configurable: true
11123
- });
11124
10682
  Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToAddHistorical", {
11125
10683
  get: function () {
11126
10684
  return (this.permission["incluir"]);
@@ -11173,8 +10731,7 @@
11173
10731
  { type: core.ChangeDetectorRef },
11174
10732
  { type: router.Router },
11175
10733
  { type: api.MessageService },
11176
- { type: HistoricalPixAccountListService },
11177
- { type: SharedStateService }
10734
+ { type: HistoricalPixAccountListService }
11178
10735
  ]; };
11179
10736
  __decorate([
11180
10737
  core.ViewChild(angularComponents.CustomFieldsComponent, { static: false })
@@ -11200,9 +10757,6 @@
11200
10757
  __decorate([
11201
10758
  core.Input()
11202
10759
  ], HistoricalPixAccountListComponent.prototype, "withSidebar", void 0);
11203
- __decorate([
11204
- core.Input()
11205
- ], HistoricalPixAccountListComponent.prototype, "hideField", void 0);
11206
10760
  __decorate([
11207
10761
  core.Output()
11208
10762
  ], HistoricalPixAccountListComponent.prototype, "isOnlyView", void 0);
@@ -11214,10 +10768,7 @@
11214
10768
  ], HistoricalPixAccountListComponent.prototype, "enableView", void 0);
11215
10769
  __decorate([
11216
10770
  core.Output()
11217
- ], HistoricalPixAccountListComponent.prototype, "isEditJudicialDependentPix", void 0);
11218
- __decorate([
11219
- core.Input()
11220
- ], HistoricalPixAccountListComponent.prototype, "hideFieldsOnAdd$", null);
10771
+ ], HistoricalPixAccountListComponent.prototype, "enableEdit", void 0);
11221
10772
  __decorate([
11222
10773
  core.Input()
11223
10774
  ], HistoricalPixAccountListComponent.prototype, "reloadList", null);
@@ -11340,7 +10891,6 @@
11340
10891
  exports.PermissionService = PermissionService;
11341
10892
  exports.ReportService = ReportService;
11342
10893
  exports.ServicesModule = ServicesModule;
11343
- exports.SharedStateService = SharedStateService;
11344
10894
  exports.SpinnerLoaderComponent = SpinnerLoaderComponent;
11345
10895
  exports.SpinnerLoaderModule = SpinnerLoaderModule;
11346
10896
  exports.StringMethods = StringMethods;
@@ -11436,8 +10986,7 @@
11436
10986
  exports.ɵo = AutocompleteService;
11437
10987
  exports.ɵp = LookupService$1;
11438
10988
  exports.ɵq = HistoricalBankAccountFormComponent;
11439
- exports.ɵr = HistoricakPixAccountBase;
11440
- exports.ɵs = HistoricalPixAccountFormComponent;
10989
+ exports.ɵr = HistoricalPixAccountFormComponent;
11441
10990
 
11442
10991
  Object.defineProperty(exports, '__esModule', { value: true });
11443
10992