@senior-gestao-pessoas/payroll-core 9.5.0-fbdcba79-4ef6-4255-9628-f5e2e790112a → 9.5.0-feature-hcmgdp-11492-f438f1e4

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 +444 -881
  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 +13 -41
  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 +205 -34
  11. package/esm2015/components/historical-pix-account/historical-pix-account.component.js +43 -264
  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 +220 -58
  19. package/esm5/components/historical-pix-account/historical-pix-account.component.js +72 -306
  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 +388 -785
  27. package/fesm2015/senior-gestao-pessoas-payroll-core.js.map +1 -1
  28. package/fesm5/senior-gestao-pessoas-payroll-core.js +441 -877
  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,82 +9412,15 @@
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
9424
  var GenericValidator = /** @class */ (function () {
9558
9425
  function GenericValidator() {
9559
9426
  }
@@ -9720,72 +9587,47 @@
9720
9587
  return GenericValidator;
9721
9588
  }());
9722
9589
 
9723
- var HistoricakPixAccountBase = /** @class */ (function () {
9724
- function HistoricakPixAccountBase(formBuilder) {
9725
- this._paramsForm = new forms.FormGroup({});
9726
- this._defaultCpfNumber = null;
9590
+ var HistoricalPixAccountFormComponent = /** @class */ (function () {
9591
+ function HistoricalPixAccountFormComponent(formBuilder, cd) {
9592
+ this.formBuilder = formBuilder;
9593
+ this.cd = cd;
9594
+ this.withSideBar = true;
9595
+ this.isEditMode = false;
9596
+ this.paramsForm = new forms.FormGroup({});
9597
+ this.defaultCpfNumber = null;
9598
+ this.permitsEditBankAccountForm = false;
9599
+ this.visibleChange = new core.EventEmitter();
9600
+ this.pixAccountItemToList = new core.EventEmitter();
9601
+ this.ngUnsubscribe = new rxjs.Subject();
9727
9602
  this.initialValidatorOfPercentage = [forms.Validators.required, forms.Validators.min(0.01)];
9728
- this.pixAccountList = [];
9729
- this.maxValuePercentage = 100.0;
9603
+ this.labelBtnAdd = "hcm.payroll.employees_add";
9604
+ this.maxValuePercentage = 100.00;
9605
+ this.visibleBtnSave = true;
9606
+ this.isView = false;
9730
9607
  this.isShowPixKeyFieldValidatorMessage = false;
9731
- this.formBuilder = formBuilder;
9732
- this.createFormGroupBase();
9608
+ this.createFormGroup();
9609
+ this.registerSubjects();
9733
9610
  }
9734
- HistoricakPixAccountBase.prototype.phoneMask = function (event) {
9735
- FormatUtilsService.formatTelephoneInputEvent(event);
9611
+ HistoricalPixAccountFormComponent.prototype.ngOnInit = function () {
9736
9612
  };
9737
- HistoricakPixAccountBase.prototype.cpfMask = function (event) {
9738
- FormatUtilsService.formatCpfInputEvent(event);
9613
+ HistoricalPixAccountFormComponent.prototype.ngDoCheck = function () {
9614
+ if (this.pixAccountFormGroup && this.pixKeyType === "BANK_ACCOUNT") {
9615
+ var pixKeyControl = this.pixAccountFormGroup.get("pixKey");
9616
+ if (pixKeyControl && !pixKeyControl.disabled) {
9617
+ pixKeyControl.disable();
9618
+ }
9619
+ }
9739
9620
  };
9740
- HistoricakPixAccountBase.prototype.cnpjMask = function (event) {
9741
- FormatUtilsService.formatCnpjInputEvent(event);
9621
+ HistoricalPixAccountFormComponent.prototype.ngAfterViewInit = function () {
9622
+ this.cd.detectChanges();
9742
9623
  };
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
- }
9624
+ HistoricalPixAccountFormComponent.prototype.ngOnDestroy = function () {
9625
+ this.ngUnsubscribe.next(true);
9626
+ this.ngUnsubscribe.unsubscribe();
9768
9627
  };
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
- }
9628
+ HistoricalPixAccountFormComponent.prototype.registerSubjects = function () {
9787
9629
  };
9788
- HistoricakPixAccountBase.prototype.createFormGroupBase = function () {
9630
+ HistoricalPixAccountFormComponent.prototype.createFormGroup = function () {
9789
9631
  this.pixAccountFormGroup = this.formBuilder.group({
9790
9632
  id: this.formBuilder.control(null),
9791
9633
  index: this.formBuilder.control(null),
@@ -9800,192 +9642,391 @@
9800
9642
  customFields: this.formBuilder.control(null),
9801
9643
  });
9802
9644
  };
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);
9645
+ HistoricalPixAccountFormComponent.prototype.onChangePixKeyType = function (item) {
9646
+ if (item.key) {
9647
+ this.pixKeyType = item.key;
9648
+ this.isShowPixKeyFieldValidatorMessage = true;
9649
+ this.pixAccountFormGroup.get("pixKey").reset();
9650
+ this.setPixKeyValidators(true);
9651
+ if (item.key === "CPF") {
9652
+ this.setDefaultCpfPixKey();
9817
9653
  }
9818
9654
  }
9819
- this.beforeSetPixKeyTypeValidator(targetForm);
9820
- this.setPixKeyValidators(isEditMode, targetForm);
9821
- this.validatePercentageValid(percentageIncluded, targetForm);
9822
9655
  };
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();
9656
+ HistoricalPixAccountFormComponent.prototype.onClearPixKeyType = function () {
9657
+ this.isShowPixKeyFieldValidatorMessage = false;
9658
+ this.pixAccountFormGroup.get("pixKey").reset();
9659
+ };
9660
+ Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "visible", {
9661
+ get: function () {
9662
+ return this._visible;
9663
+ },
9664
+ set: function (value) {
9665
+ this._visible = value;
9666
+ this.visibleChange.emit(this.visible);
9667
+ },
9668
+ enumerable: true,
9669
+ configurable: true
9670
+ });
9671
+ Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "isEditAndViewValue", {
9672
+ set: function (value) {
9673
+ this.resetForm();
9674
+ this.visibleBtnSave = true;
9675
+ if (value && value.permitsEditBankAccount) {
9676
+ this.permitsEditBankAccountForm = true;
9677
+ }
9678
+ if (value && value.currentItem && Object.keys(value.currentItem).length) {
9679
+ this.pixAccountFormGroup.patchValue(this.convertDTOToShowWithCustomFields(__assign({}, value.currentItem)));
9680
+ this.labelBtnAdd = "hcm.payroll.employees_update";
9681
+ this.setValidatorsAccordingList(value.listData, value.currentItem["index"], value && value["isEditMode"]);
9682
+ if (!this.isView) {
9683
+ this.configEnableFields(value && value["isEditMode"]);
9684
+ }
9685
+ else {
9686
+ if (this.pixAccountFormGroup.get("pixKeyType").value) {
9687
+ this.pixKeyType = this.pixAccountFormGroup.get("pixKeyType").value.key;
9688
+ this.formatPixKeyTelephoneNumber();
9689
+ }
9690
+ }
9691
+ }
9692
+ else {
9693
+ this.labelBtnAdd = "hcm.payroll.employees_add";
9694
+ }
9695
+ },
9696
+ enumerable: true,
9697
+ configurable: true
9698
+ });
9699
+ HistoricalPixAccountFormComponent.prototype.formatPixKeyTelephoneNumber = function () {
9700
+ if (this.pixKeyType === "TELEPHONE") {
9701
+ this.pixAccountFormGroup.get("pixKey").setValue(FormatUtilsService.getFormattedTelephoneNumber(this.pixAccountFormGroup.get("pixKey").value));
9856
9702
  }
9857
- if (isEditMode) {
9858
- pixKey.enable();
9703
+ };
9704
+ HistoricalPixAccountFormComponent.prototype.convertDTOToShowWithCustomFields = function (data) {
9705
+ var obj = __assign({}, data);
9706
+ obj["customFields"] = mountCustomToShow(obj["customFields"]);
9707
+ return obj;
9708
+ };
9709
+ HistoricalPixAccountFormComponent.prototype.configEnableFields = function (isEditMode) {
9710
+ this.visibleBtnSave = isEditMode;
9711
+ if (this.pixAccountFormGroup.get("pixKeyType").value) {
9712
+ this.pixKeyType = this.pixAccountFormGroup.get("pixKeyType").value.key;
9713
+ this.setPixKeyValidators(isEditMode);
9714
+ this.formatPixKeyTelephoneNumber();
9859
9715
  }
9860
- pixKey.updateValueAndValidity();
9716
+ configEnabledFields(this.pixAccountFormGroup, isEditMode, [
9717
+ "pixKeyType",
9718
+ "pixKey",
9719
+ "percentage",
9720
+ "customFields",
9721
+ ], []);
9861
9722
  };
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();
9723
+ HistoricalPixAccountFormComponent.prototype.close = function () {
9724
+ this.resetForm();
9725
+ this.visible = false;
9869
9726
  };
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
- };
9727
+ HistoricalPixAccountFormComponent.prototype.addItem = function () {
9728
+ this.pixAccountFormGroup.updateValueAndValidity();
9729
+ verifyValidationsForm.call(this.pixAccountFormGroup);
9730
+ if (this.pixAccountFormGroup.valid) {
9731
+ if (this.employeeId) {
9732
+ this.pixAccountFormGroup.get("employee").setValue({
9733
+ tableId: this.employeeId,
9734
+ name: "",
9735
+ });
9736
+ }
9737
+ this.pixAccountItemToList.emit(this.pixAccountFormGroup.getRawValue());
9738
+ this.visible = false;
9739
+ this.resetForm();
9740
+ }
9741
+ };
9742
+ HistoricalPixAccountFormComponent.prototype.resetForm = function () {
9743
+ this.pixAccountFormGroup.reset();
9744
+ this.labelBtnAdd = "hcm.payroll.employees_add";
9745
+ if (this.customFields && this.customFields.formGroup)
9746
+ this.customFields.formGroup.reset();
9880
9747
  };
9881
- Object.defineProperty(HistoricakPixAccountBase.prototype, "paramsForm", {
9748
+ Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "percentagePlaceholder", {
9882
9749
  get: function () {
9883
- return this._paramsForm;
9884
- },
9885
- set: function (value) {
9886
- this._paramsForm = value;
9750
+ return "0" + (this.currency && this.currency.decimalSeparator) + "00";
9887
9751
  },
9888
9752
  enumerable: true,
9889
9753
  configurable: true
9890
9754
  });
9891
- Object.defineProperty(HistoricakPixAccountBase.prototype, "defaultCpfNumber", {
9755
+ Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "optionsPercentage", {
9892
9756
  get: function () {
9893
- return this._defaultCpfNumber;
9757
+ return __assign({}, this.getOptions(), { precision: 2 });
9894
9758
  },
9895
- set: function (value) {
9896
- this._defaultCpfNumber = value;
9759
+ enumerable: true,
9760
+ configurable: true
9761
+ });
9762
+ HistoricalPixAccountFormComponent.prototype.getOptions = function () {
9763
+ return {
9764
+ prefix: "",
9765
+ thousands: this.currency.thousandsSeparator,
9766
+ decimal: this.currency.decimalSeparator,
9767
+ };
9768
+ };
9769
+ Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "getListPixAccount", {
9770
+ /**
9771
+ * O Input que recebe a lista do component pai e chama o método de validação passando a lista recebida.
9772
+ * @param pixAccountList
9773
+ */
9774
+ set: function (pixAccountList) {
9775
+ if (pixAccountList) {
9776
+ this.setValidatorsAccordingList(pixAccountList, null, false);
9777
+ }
9778
+ else {
9779
+ this.resetForm();
9780
+ }
9897
9781
  },
9898
9782
  enumerable: true,
9899
9783
  configurable: true
9900
9784
  });
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);
9785
+ /**
9786
+ * Recebe a lista de registros já inseridos na tabela adiciona em uma variável os valores que serão usados para
9787
+ * a validação dos campos "percentage" e "pixAccount".
9788
+ * 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
9789
+ * no array de comparação dos validators.
9790
+ * @param pixAccountList
9791
+ * @param index
9792
+ */
9793
+ HistoricalPixAccountFormComponent.prototype.setValidatorsAccordingList = function (pixAccountList, index, isEditMode) {
9794
+ if (index === void 0) { index = null; }
9795
+ if (isEditMode === void 0) { isEditMode = true; }
9796
+ this.pixAccountList = pixAccountList && pixAccountList.length ? __spread(pixAccountList) : [];
9797
+ var percentageIncluded = [];
9798
+ if (this.pixAccountList && this.pixAccountList.length) {
9799
+ this.pixAccountList.filter(function (field, key) {
9800
+ if (field["percentage"] && key != index) {
9801
+ percentageIncluded.push(field["percentage"]);
9802
+ }
9803
+ });
9804
+ }
9805
+ this.beforeSetPixKeyTypeValidator();
9806
+ this.setPixKeyValidators(isEditMode);
9807
+ this.validatePercentageValid(percentageIncluded);
9808
+ };
9809
+ /**
9810
+ * Antes de setar o validator prepara as variáveis necessária para que seja feita a validação do campo.
9811
+ */
9812
+ HistoricalPixAccountFormComponent.prototype.setPixKeyValidators = function (isEditMode) {
9813
+ var genericPixKey = this.pixAccountFormGroup.get("pixKey");
9814
+ if (this.pixKeyType) {
9815
+ switch (this.pixKeyType) {
9816
+ case "TELEPHONE":
9817
+ genericPixKey.setValidators(forms.Validators.compose([
9818
+ forms.Validators.required, GenericValidator.isValidPhoneNumber,
9819
+ ]));
9820
+ break;
9821
+ case "EMAIL":
9822
+ genericPixKey.setValidators(forms.Validators.compose([
9823
+ forms.Validators.required, GenericValidator.isValidEmail,
9824
+ ]));
9825
+ break;
9826
+ case "CPF":
9827
+ genericPixKey.setValidators(forms.Validators.compose([
9828
+ forms.Validators.required, GenericValidator.isValidCpf,
9829
+ ]));
9830
+ break;
9831
+ case "CNPJ":
9832
+ genericPixKey.setValidators(forms.Validators.compose([
9833
+ forms.Validators.required, GenericValidator.isValidCnpj,
9834
+ ]));
9835
+ break;
9836
+ case "RANDOM_KEY":
9837
+ genericPixKey.setValidators(forms.Validators.required);
9838
+ break;
9839
+ default:
9840
+ genericPixKey.setValidators(null);
9841
+ break;
9842
+ }
9843
+ if (isEditMode) {
9844
+ genericPixKey.enable();
9845
+ }
9846
+ genericPixKey.updateValueAndValidity();
9847
+ }
9848
+ };
9849
+ /**
9850
+ * Este método calcula as parcentagens que já foram inseridas, e seta a diferença para chegar em
9851
+ * 100% na validação do campo "percentage" como um novo maxValue;
9852
+ * @param listValue
9853
+ */
9854
+ HistoricalPixAccountFormComponent.prototype.validatePercentageValid = function (listValue) {
9855
+ var percentage = this.pixAccountFormGroup.get("percentage");
9856
+ this.maxValuePercentage = listValue
9857
+ .reduce(function (currentValue, total) { return currentValue - total; }, 100.00);
9858
+ percentage
9859
+ .setValidators(forms.Validators.compose(__spread(this.initialValidatorOfPercentage, [
9860
+ forms.Validators.max(this.maxValuePercentage),
9861
+ ])));
9862
+ percentage.updateValueAndValidity();
9863
+ };
9864
+ Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "isViewMode", {
9865
+ set: function (condition) {
9866
+ this.isView = !!(condition && !this.withSideBar);
9867
+ this.configEnableFields(!this.isView);
9868
+ if (!this.isView)
9869
+ this.resetForm();
9870
+ },
9871
+ enumerable: true,
9872
+ configurable: true
9873
+ });
9874
+ HistoricalPixAccountFormComponent.prototype.phoneMask = function (event) {
9875
+ FormatUtilsService.formatTelephoneInputEvent(event);
9911
9876
  };
9912
- HistoricalPixAccountService.prototype.enumQuery = function () {
9913
- var path = 'enumQuery';
9914
- var body = {
9915
- names: ['PixKeyType']
9877
+ HistoricalPixAccountFormComponent.prototype.setDefaultCpfPixKey = function () {
9878
+ if (this.defaultCpfNumber) {
9879
+ this.pixAccountFormGroup.get("pixKey").setValue(this.defaultCpfNumber);
9880
+ }
9881
+ else {
9882
+ var sheetDocument = this.paramsForm.get("sheetDocument");
9883
+ if (sheetDocument) {
9884
+ var cpf = sheetDocument.get("cpfNumber").value;
9885
+ if (cpf) {
9886
+ this.pixAccountFormGroup.get("pixKey").setValue(cpf);
9887
+ }
9888
+ }
9889
+ }
9890
+ };
9891
+ HistoricalPixAccountFormComponent.prototype.beforeSetPixKeyTypeValidator = function () {
9892
+ var pixKeyType = this.pixAccountFormGroup.get("pixKeyType");
9893
+ if (this.pixAccountList && this.pixAccountList.length && pixKeyType) {
9894
+ pixKeyType
9895
+ .setValidators(forms.Validators.compose([
9896
+ forms.Validators.required,
9897
+ this.validateDuplicatePixKeyTypeBankAccount(this.pixAccountList),
9898
+ ]));
9899
+ }
9900
+ else {
9901
+ pixKeyType.setValidators(forms.Validators.required);
9902
+ }
9903
+ };
9904
+ HistoricalPixAccountFormComponent.prototype.validateDuplicatePixKeyTypeBankAccount = function (listCompare) {
9905
+ var _this = this;
9906
+ return function (control) {
9907
+ var value = control && control.value;
9908
+ var condition = false;
9909
+ listCompare.filter(function (field) {
9910
+ if (value) {
9911
+ if (field["pixKeyType"].key === 'BANK_ACCOUNT' && value.key === field["pixKeyType"].key) {
9912
+ return condition = true;
9913
+ }
9914
+ }
9915
+ });
9916
+ if (condition && !_this.permitsEditBankAccountForm) {
9917
+ return { pixKeyTypeBankAccountDuplicate: true };
9918
+ }
9919
+ else {
9920
+ return null;
9921
+ }
9916
9922
  };
9917
- return this.http.query(path, body, exports.ServiceType.PAYROLL);
9918
9923
  };
9919
- HistoricalPixAccountService.ctorParameters = function () { return [
9920
- { type: HttpClientService }
9924
+ HistoricalPixAccountFormComponent.ctorParameters = function () { return [
9925
+ { type: forms.FormBuilder },
9926
+ { type: core.ChangeDetectorRef }
9921
9927
  ]; };
9922
- HistoricalPixAccountService = __decorate([
9923
- core.Injectable()
9924
- ], HistoricalPixAccountService);
9925
- return HistoricalPixAccountService;
9928
+ __decorate([
9929
+ core.ViewChild(angularComponents.CustomFieldsComponent, { static: true })
9930
+ ], HistoricalPixAccountFormComponent.prototype, "customFields", void 0);
9931
+ __decorate([
9932
+ core.Input()
9933
+ ], HistoricalPixAccountFormComponent.prototype, "currency", void 0);
9934
+ __decorate([
9935
+ core.Input()
9936
+ ], HistoricalPixAccountFormComponent.prototype, "customEntity", void 0);
9937
+ __decorate([
9938
+ core.Input()
9939
+ ], HistoricalPixAccountFormComponent.prototype, "customService", void 0);
9940
+ __decorate([
9941
+ core.Input()
9942
+ ], HistoricalPixAccountFormComponent.prototype, "withSideBar", void 0);
9943
+ __decorate([
9944
+ core.Input()
9945
+ ], HistoricalPixAccountFormComponent.prototype, "isEditMode", void 0);
9946
+ __decorate([
9947
+ core.Input()
9948
+ ], HistoricalPixAccountFormComponent.prototype, "paramsForm", void 0);
9949
+ __decorate([
9950
+ core.Input()
9951
+ ], HistoricalPixAccountFormComponent.prototype, "defaultCpfNumber", void 0);
9952
+ __decorate([
9953
+ core.Input()
9954
+ ], HistoricalPixAccountFormComponent.prototype, "permitsEditBankAccountForm", void 0);
9955
+ __decorate([
9956
+ core.Output()
9957
+ ], HistoricalPixAccountFormComponent.prototype, "visibleChange", void 0);
9958
+ __decorate([
9959
+ core.Output()
9960
+ ], HistoricalPixAccountFormComponent.prototype, "pixAccountItemToList", void 0);
9961
+ __decorate([
9962
+ core.Input()
9963
+ ], HistoricalPixAccountFormComponent.prototype, "visible", null);
9964
+ __decorate([
9965
+ core.Input()
9966
+ ], HistoricalPixAccountFormComponent.prototype, "isEditAndViewValue", null);
9967
+ __decorate([
9968
+ core.Input()
9969
+ ], HistoricalPixAccountFormComponent.prototype, "getListPixAccount", null);
9970
+ __decorate([
9971
+ core.Input()
9972
+ ], HistoricalPixAccountFormComponent.prototype, "isViewMode", null);
9973
+ HistoricalPixAccountFormComponent = __decorate([
9974
+ core.Component({
9975
+ selector: "pix-account",
9976
+ 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",
9977
+ 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}"]
9978
+ })
9979
+ ], HistoricalPixAccountFormComponent);
9980
+ return HistoricalPixAccountFormComponent;
9926
9981
  }());
9927
9982
 
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 = {
9983
+ var HistoricalPixAccountComponent = /** @class */ (function () {
9984
+ function HistoricalPixAccountComponent(translateService, cd, formBuilder, messageService) {
9985
+ var _this = this;
9986
+ this.translateService = translateService;
9987
+ this.cd = cd;
9988
+ this.formBuilder = formBuilder;
9989
+ this.messageService = messageService;
9990
+ this.recordByRow = 1;
9991
+ this.showDateChange = false;
9992
+ this.isEditMode = false;
9993
+ this.isViewMode = false;
9994
+ this.withSideBar = true;
9995
+ this.defaultCpfNumber = null;
9996
+ this.listDataReciever = [];
9997
+ this.showButtonEdit = false;
9998
+ this.isViewModeActive = new core.EventEmitter();
9999
+ this.isEditModeActive = new core.EventEmitter();
10000
+ this.isDeleteModeActive = new core.EventEmitter();
10001
+ this.listFromApp = [];
10002
+ this.visibleChange = new core.EventEmitter();
10003
+ this.ngUnsubscribe = new rxjs.Subject();
10004
+ this.orderBy = {
9955
10005
  field: "dateChange",
9956
10006
  direction: exports.DirectionEnumeration.DESC,
9957
10007
  };
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 = [
10008
+ this.pixAccountItemInput = {};
10009
+ this.totalRecords = 0;
10010
+ this.actionLabel = this.translateService.instant("hcm.payroll.entries_query_actions_total_title");
10011
+ this.loading = true;
10012
+ this.listData = [];
10013
+ this.listDataNoPage = [];
10014
+ this.permitsEditBankAccount = false;
10015
+ this.cols = [
9971
10016
  {
9972
- label: _this.translateService.instant("hcm.payroll.employees_addition_pix_key_type"),
10017
+ label: this.translateService.instant("hcm.payroll.employees_addition_pix_key_type"),
9973
10018
  field: "pixKeyType",
9974
10019
  },
9975
10020
  {
9976
- label: _this.translateService.instant("hcm.payroll.employees_addition_pix_key"),
10021
+ label: this.translateService.instant("hcm.payroll.employees_addition_pix_key"),
9977
10022
  field: "pixKey",
9978
10023
  },
9979
10024
  {
9980
- label: _this.translateService.instant("hcm.payroll.historical_pix_account_label_percentage"),
10025
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_percentage"),
9981
10026
  field: "percentage",
9982
10027
  },
9983
- {
9984
- label: _this.translateService.instant("hcm.payroll.movimentation_generic_action"),
9985
- field: "actions",
9986
- }
9987
10028
  ];
9988
- _this.actions = function (rowData, key) {
10029
+ this.actions = function (rowData, key) {
9989
10030
  if (rowData === void 0) { rowData = {}; }
9990
10031
  return [
9991
10032
  {
@@ -10003,26 +10044,30 @@
10003
10044
  },
10004
10045
  },
10005
10046
  {
10006
- visible: !!(!_this.isEditMode && _this.withSideBar),
10047
+ visible: !!((!_this.isEditMode && _this.withSideBar) || _this.showButtonEdit),
10007
10048
  label: _this.translateService.instant("hcm.payroll.edit"),
10008
10049
  command: function () {
10050
+ _this.permitsEditBankAccount = true;
10009
10051
  if (_this.isAllowToEditHistorical) {
10010
10052
  rowData["index"] = key;
10011
- _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true };
10053
+ _this.pixAccountItemInput = {
10054
+ currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true, permitsEditBankAccount: true
10055
+ };
10012
10056
  _this.visible = true;
10013
10057
  }
10014
10058
  else {
10015
10059
  _this.isEditModeActive.emit(true);
10016
10060
  if (_this.listFromApp.length == 0) {
10017
10061
  rowData["index"] = key;
10018
- _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true };
10019
- _this.visible = true;
10062
+ _this.pixAccountItemInput = {
10063
+ currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true, permitsEditBankAccount: true
10064
+ };
10020
10065
  }
10021
10066
  }
10022
10067
  },
10023
10068
  },
10024
10069
  {
10025
- visible: !_this.isEditMode || _this.showEditMode,
10070
+ visible: !_this.isEditMode,
10026
10071
  label: _this.translateService.instant("hcm.payroll.delete"),
10027
10072
  command: function () {
10028
10073
  if (_this.isAllowToDeleteHistorical) {
@@ -10040,51 +10085,17 @@
10040
10085
  },
10041
10086
  ];
10042
10087
  };
10043
- _this.createFormGroup();
10044
- return _this;
10088
+ this.createFormGroup();
10045
10089
  }
10046
10090
  HistoricalPixAccountComponent.prototype.ngOnInit = function () {
10047
- var _this = this;
10048
- this.showFields = this.showField;
10049
10091
  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
10092
  };
10074
10093
  HistoricalPixAccountComponent.prototype.ngOnChanges = function (changes) {
10075
10094
  if (changes['listDataReciever'] && changes['listDataReciever'].currentValue) {
10076
10095
  this.listFromApp = changes['listDataReciever'].currentValue;
10077
10096
  }
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();
10097
+ if (changes['showButtonEdit'] && changes['showButtonEdit'].currentValue) {
10098
+ this.permitsEditBankAccount = changes['showButtonEdit'].currentValue;
10088
10099
  }
10089
10100
  };
10090
10101
  HistoricalPixAccountComponent.prototype.createFormGroup = function () {
@@ -10099,98 +10110,6 @@
10099
10110
  HistoricalPixAccountComponent.prototype.ngAfterViewInit = function () {
10100
10111
  this.cd.detectChanges();
10101
10112
  };
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
10113
  HistoricalPixAccountComponent.prototype.onLazyLoad = function (event) {
10195
10114
  var _this = this;
10196
10115
  var first = event && event.first ? event.first : 0;
@@ -10218,7 +10137,6 @@
10218
10137
  this.refreshCssInIE11();
10219
10138
  }
10220
10139
  this.loading = false;
10221
- this.cd.detectChanges();
10222
10140
  };
10223
10141
  /**
10224
10142
  * Um Bug de CSS que acontece nas linhas da tabela, que resolve só atualizando qualquer parte do CSS da pagina.
@@ -10236,68 +10154,12 @@
10236
10154
  this.pixAccountItemInput = {};
10237
10155
  this.visible = true;
10238
10156
  };
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
- }
10295
- });
10296
- this.cd.detectChanges();
10297
- };
10298
- HistoricalPixAccountComponent.prototype.onPixKeyTypeClear = function (index) {
10299
- var form = this.formGroupByRow[index];
10300
- this.onClearPixKeyType(form);
10157
+ HistoricalPixAccountComponent.prototype.isNotAllowMessage = function () {
10158
+ this.messageService.add({
10159
+ severity: "error",
10160
+ summary: this.translateService.instant("hcm.payroll.error"),
10161
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10162
+ });
10301
10163
  };
10302
10164
  HistoricalPixAccountComponent.prototype.deleteAnnuityItem = function (index) {
10303
10165
  var newlist = __spread(this.getHistoricalPixAccountList());
@@ -10331,6 +10193,10 @@
10331
10193
  $event["dateChange"] = this.dateChange;
10332
10194
  newDataList.push($event);
10333
10195
  }
10196
+ if (this.formComponent) {
10197
+ this.formComponent.permitsEditBankAccountForm = false;
10198
+ this.cd.detectChanges();
10199
+ }
10334
10200
  this.historicalPixAccountList.get("historicalPixAccountList").setValue(newDataList);
10335
10201
  this.verifyTotalPercentage();
10336
10202
  this.onLazyLoad({ first: this.getNumberPageByIndex(index, newDataList) });
@@ -10359,23 +10225,6 @@
10359
10225
  this.msgTotalLimitByPercentage = null;
10360
10226
  }
10361
10227
  };
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
10228
  Object.defineProperty(HistoricalPixAccountComponent.prototype, "scopedActions", {
10380
10229
  get: function () {
10381
10230
  return this.actions.bind(this);
@@ -10442,20 +10291,9 @@
10442
10291
  set: function (value) {
10443
10292
  this._visible = value;
10444
10293
  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;
10294
+ if (!value) {
10295
+ this.pixAccountItemInput = {};
10296
+ }
10459
10297
  },
10460
10298
  enumerable: true,
10461
10299
  configurable: true
@@ -10507,15 +10345,14 @@
10507
10345
  { type: core$1.TranslateService },
10508
10346
  { type: core.ChangeDetectorRef },
10509
10347
  { type: forms.FormBuilder },
10510
- { type: SharedStateService },
10511
- { type: HistoricalPixAccountService }
10348
+ { type: api.MessageService }
10512
10349
  ]; };
10513
10350
  __decorate([
10514
10351
  core.ViewChild(angularComponents.CustomFieldsComponent, { static: false })
10515
10352
  ], HistoricalPixAccountComponent.prototype, "customFields", void 0);
10516
10353
  __decorate([
10517
- core.ViewChild('dataListPix', { static: false })
10518
- ], HistoricalPixAccountComponent.prototype, "dataListPix", void 0);
10354
+ core.ViewChild(HistoricalPixAccountFormComponent, { static: false })
10355
+ ], HistoricalPixAccountComponent.prototype, "formComponent", void 0);
10519
10356
  __decorate([
10520
10357
  core.Input()
10521
10358
  ], HistoricalPixAccountComponent.prototype, "formGroup", void 0);
@@ -10557,22 +10394,19 @@
10557
10394
  ], HistoricalPixAccountComponent.prototype, "withSideBar", void 0);
10558
10395
  __decorate([
10559
10396
  core.Input()
10560
- ], HistoricalPixAccountComponent.prototype, "permission", void 0);
10561
- __decorate([
10562
- core.Input()
10563
- ], HistoricalPixAccountComponent.prototype, "listDataReciever", void 0);
10397
+ ], HistoricalPixAccountComponent.prototype, "paramsForm", void 0);
10564
10398
  __decorate([
10565
10399
  core.Input()
10566
- ], HistoricalPixAccountComponent.prototype, "addExistentHistoricData", void 0);
10400
+ ], HistoricalPixAccountComponent.prototype, "defaultCpfNumber", void 0);
10567
10401
  __decorate([
10568
10402
  core.Input()
10569
- ], HistoricalPixAccountComponent.prototype, "getListPixAccount", void 0);
10403
+ ], HistoricalPixAccountComponent.prototype, "permission", void 0);
10570
10404
  __decorate([
10571
10405
  core.Input()
10572
- ], HistoricalPixAccountComponent.prototype, "isEditModeForSave", void 0);
10406
+ ], HistoricalPixAccountComponent.prototype, "listDataReciever", void 0);
10573
10407
  __decorate([
10574
10408
  core.Input()
10575
- ], HistoricalPixAccountComponent.prototype, "showField", void 0);
10409
+ ], HistoricalPixAccountComponent.prototype, "showButtonEdit", void 0);
10576
10410
  __decorate([
10577
10411
  core.Output()
10578
10412
  ], HistoricalPixAccountComponent.prototype, "isViewModeActive", void 0);
@@ -10582,12 +10416,6 @@
10582
10416
  __decorate([
10583
10417
  core.Output()
10584
10418
  ], 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
10419
  __decorate([
10592
10420
  core.Input()
10593
10421
  ], HistoricalPixAccountComponent.prototype, "dateChange", null);
@@ -10600,252 +10428,33 @@
10600
10428
  __decorate([
10601
10429
  core.Input()
10602
10430
  ], 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
10431
  HistoricalPixAccountComponent = __decorate([
10610
10432
  core.Component({
10611
10433
  // tslint:disable-next-line:component-selector
10612
10434
  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",
10435
+ 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
10436
  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
10437
  })
10616
10438
  ], HistoricalPixAccountComponent);
10617
10439
  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 () { };
10641
- HistoricalPixAccountFormComponent.prototype.ngAfterViewInit = function () {
10642
- this.cd.detectChanges();
10643
- };
10644
- HistoricalPixAccountFormComponent.prototype.ngOnDestroy = function () {
10645
- this.ngUnsubscribe.next(true);
10646
- this.ngUnsubscribe.unsubscribe();
10647
- };
10648
- HistoricalPixAccountFormComponent.prototype.registerSubjects = function () { };
10649
- Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "visible", {
10650
- get: function () {
10651
- return this._visible;
10652
- },
10653
- set: function (value) {
10654
- this._visible = value;
10655
- this.visibleChange.emit(this.visible);
10656
- },
10657
- enumerable: true,
10658
- configurable: true
10659
- });
10660
- Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "isEditAndViewValue", {
10661
- set: function (value) {
10662
- this.resetForm();
10663
- this.visibleBtnSave = true;
10664
- if (value && value.currentItem && Object.keys(value.currentItem).length) {
10665
- this.pixAccountFormGroup.patchValue(this.convertDTOToShowWithCustomFields(__assign({}, value.currentItem)));
10666
- this.labelBtnAdd = "hcm.payroll.employees_update";
10667
- this.setValidatorsAccordingList(value.listData, value.currentItem["index"], value && value["isEditMode"]);
10668
- if (!this.isView) {
10669
- this.configEnableFields(value && value["isEditMode"]);
10670
- }
10671
- else {
10672
- if (this.pixAccountFormGroup.get("pixKeyType").value) {
10673
- this.pixKeyType = this.pixAccountFormGroup.get("pixKeyType").value.key;
10674
- this.formatPixKeyTelephoneNumber();
10675
- }
10676
- }
10677
- }
10678
- else {
10679
- this.labelBtnAdd = "hcm.payroll.employees_add";
10680
- }
10681
- },
10682
- enumerable: true,
10683
- configurable: true
10684
- });
10685
- HistoricalPixAccountFormComponent.prototype.formatPixKeyTelephoneNumber = function () {
10686
- if (this.pixKeyType === "TELEPHONE") {
10687
- var pixKeyCtrl = this.pixAccountFormGroup.get("pixKey");
10688
- pixKeyCtrl.setValue(FormatUtilsService.getFormattedTelephoneNumber(pixKeyCtrl.value));
10689
- }
10690
- };
10691
- HistoricalPixAccountFormComponent.prototype.convertDTOToShowWithCustomFields = function (data) {
10692
- var obj = __assign({}, data);
10693
- obj["customFields"] = mountCustomToShow(obj["customFields"]);
10694
- return obj;
10695
- };
10696
- HistoricalPixAccountFormComponent.prototype.configEnableFields = function (isEditMode) {
10697
- this.visibleBtnSave = isEditMode;
10698
- if (this.pixAccountFormGroup.get("pixKeyType").value) {
10699
- this.pixKeyType = this.pixAccountFormGroup.get("pixKeyType").value.key;
10700
- this.setPixKeyValidators(isEditMode, this.pixAccountFormGroup);
10701
- this.formatPixKeyTelephoneNumber();
10702
- }
10703
- configEnabledFields(this.pixAccountFormGroup, isEditMode, [
10704
- "pixKeyType",
10705
- "pixKey",
10706
- "percentage",
10707
- "customFields"
10708
- ], []);
10709
- };
10710
- HistoricalPixAccountFormComponent.prototype.close = function () {
10711
- this.resetForm();
10712
- this.visible = false;
10713
- };
10714
- HistoricalPixAccountFormComponent.prototype.addItem = function () {
10715
- if (this.pixAccountFormGroup.valid) {
10716
- if (this.employeeId) {
10717
- this.pixAccountFormGroup.get("employee").setValue({
10718
- tableId: this.employeeId,
10719
- name: ""
10720
- });
10721
- }
10722
- this.pixAccountItemToList.emit(this.pixAccountFormGroup.getRawValue());
10723
- this.visible = false;
10724
- this.resetForm();
10725
- }
10726
- };
10727
- HistoricalPixAccountFormComponent.prototype.resetForm = function () {
10728
- this.pixAccountFormGroup.reset();
10729
- this.labelBtnAdd = "hcm.payroll.employees_add";
10730
- if (this.customFields && this.customFields.formGroup)
10731
- this.customFields.formGroup.reset();
10732
- };
10733
- Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "percentagePlaceholder", {
10734
- get: function () {
10735
- return "0" + (this.currency && this.currency.decimalSeparator) + "00";
10736
- },
10737
- enumerable: true,
10738
- configurable: true
10739
- });
10740
- Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "optionsPercentage", {
10741
- get: function () {
10742
- return __assign({}, this.getOptions(), { precision: 2 });
10743
- },
10744
- enumerable: true,
10745
- configurable: true
10746
- });
10747
- HistoricalPixAccountFormComponent.prototype.getOptions = function () {
10748
- return {
10749
- prefix: "",
10750
- thousands: this.currency.thousandsSeparator,
10751
- decimal: this.currency.decimalSeparator
10752
- };
10440
+ }());
10441
+
10442
+ var HistoricalPixAccountService = /** @class */ (function () {
10443
+ function HistoricalPixAccountService(http) {
10444
+ this.http = http;
10445
+ }
10446
+ HistoricalPixAccountService.prototype.query = function (path, body, service) {
10447
+ if (service === void 0) { service = exports.ServiceType.PAYROLL; }
10448
+ return this.http.query(path, body, service);
10753
10449
  };
10754
- Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "getListPixAccount", {
10755
- set: function (pixAccountList) {
10756
- if (pixAccountList) {
10757
- this.setValidatorsAccordingList(pixAccountList, null, false);
10758
- }
10759
- else {
10760
- this.resetForm();
10761
- }
10762
- },
10763
- enumerable: true,
10764
- configurable: true
10765
- });
10766
- Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "isViewMode", {
10767
- set: function (condition) {
10768
- this.isView = !!(condition && !this.withSideBar);
10769
- this.configEnableFields(!this.isView);
10770
- if (!this.isView)
10771
- this.resetForm();
10772
- },
10773
- enumerable: true,
10774
- configurable: true
10775
- });
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
- });
10790
- HistoricalPixAccountFormComponent.ctorParameters = function () { return [
10791
- { type: forms.FormBuilder },
10792
- { type: core.ChangeDetectorRef },
10793
- { type: SharedStateService }
10450
+ HistoricalPixAccountService.ctorParameters = function () { return [
10451
+ { type: HttpClientService }
10794
10452
  ]; };
10795
- __decorate([
10796
- core.ViewChild(angularComponents.CustomFieldsComponent, { static: true })
10797
- ], HistoricalPixAccountFormComponent.prototype, "customFields", void 0);
10798
- __decorate([
10799
- core.Input()
10800
- ], HistoricalPixAccountFormComponent.prototype, "currency", void 0);
10801
- __decorate([
10802
- core.Input()
10803
- ], HistoricalPixAccountFormComponent.prototype, "customEntity", void 0);
10804
- __decorate([
10805
- core.Input()
10806
- ], HistoricalPixAccountFormComponent.prototype, "customService", void 0);
10807
- __decorate([
10808
- core.Input()
10809
- ], HistoricalPixAccountFormComponent.prototype, "withSideBar", void 0);
10810
- __decorate([
10811
- core.Input()
10812
- ], HistoricalPixAccountFormComponent.prototype, "isEditMode", void 0);
10813
- __decorate([
10814
- core.Input()
10815
- ], HistoricalPixAccountFormComponent.prototype, "showField", void 0);
10816
- __decorate([
10817
- core.Output()
10818
- ], HistoricalPixAccountFormComponent.prototype, "visibleChange", void 0);
10819
- __decorate([
10820
- core.Output()
10821
- ], HistoricalPixAccountFormComponent.prototype, "pixAccountItemToList", void 0);
10822
- __decorate([
10823
- core.Input()
10824
- ], HistoricalPixAccountFormComponent.prototype, "visible", null);
10825
- __decorate([
10826
- core.Input()
10827
- ], HistoricalPixAccountFormComponent.prototype, "isEditAndViewValue", null);
10828
- __decorate([
10829
- core.Input()
10830
- ], HistoricalPixAccountFormComponent.prototype, "getListPixAccount", null);
10831
- __decorate([
10832
- core.Input()
10833
- ], 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
- HistoricalPixAccountFormComponent = __decorate([
10841
- core.Component({
10842
- 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",
10844
- 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
- })
10846
- ], HistoricalPixAccountFormComponent);
10847
- return HistoricalPixAccountFormComponent;
10848
- }(HistoricakPixAccountBase));
10453
+ HistoricalPixAccountService = __decorate([
10454
+ core.Injectable()
10455
+ ], HistoricalPixAccountService);
10456
+ return HistoricalPixAccountService;
10457
+ }());
10849
10458
 
10850
10459
  var HistoricalPixAccountModule = /** @class */ (function () {
10851
10460
  function HistoricalPixAccountModule() {
@@ -10875,8 +10484,6 @@
10875
10484
  angularComponents.CustomFieldsModule,
10876
10485
  panel.PanelModule,
10877
10486
  inputmask.InputMaskModule,
10878
- dropdown.DropdownModule,
10879
- tabview.TabViewModule,
10880
10487
  ],
10881
10488
  declarations: [HistoricalPixAccountComponent, HistoricalPixAccountFormComponent],
10882
10489
  providers: [HistoricalPixAccountService, api.ConfirmationService],
@@ -10919,7 +10526,7 @@
10919
10526
 
10920
10527
  var moment$e = moment_;
10921
10528
  var HistoricalPixAccountListComponent = /** @class */ (function () {
10922
- function HistoricalPixAccountListComponent(confirmationService, translateService, activatedRoute, cd, router, messageService, historicalPixAccountListService, sharedStateService) {
10529
+ function HistoricalPixAccountListComponent(confirmationService, translateService, activatedRoute, cd, router, messageService, historicalPixAccountListService) {
10923
10530
  this.confirmationService = confirmationService;
10924
10531
  this.translateService = translateService;
10925
10532
  this.activatedRoute = activatedRoute;
@@ -10927,14 +10534,13 @@
10927
10534
  this.router = router;
10928
10535
  this.messageService = messageService;
10929
10536
  this.historicalPixAccountListService = historicalPixAccountListService;
10930
- this.sharedStateService = sharedStateService;
10931
10537
  this.endPoint = "hcm/payroll/queries/historicalEmployeePixQuery";
10932
10538
  this.keyPayload = "historicalEmployeePix";
10933
10539
  this.withSidebar = true;
10934
10540
  this.isOnlyView = new core.EventEmitter();
10935
10541
  this.isOnlyEdit = new core.EventEmitter();
10936
10542
  this.enableView = new core.EventEmitter();
10937
- this.isEditJudicialDependentPix = new core.EventEmitter();
10543
+ this.enableEdit = new core.EventEmitter();
10938
10544
  this.ngUnsubscribe = new rxjs.Subject();
10939
10545
  this.loading = true;
10940
10546
  this.columns = [
@@ -10954,7 +10560,6 @@
10954
10560
  HistoricalPixAccountListComponent.prototype.ngOnDestroy = function () {
10955
10561
  this.ngUnsubscribe.next();
10956
10562
  this.ngUnsubscribe.complete();
10957
- this.unsubscribe();
10958
10563
  };
10959
10564
  HistoricalPixAccountListComponent.prototype.ngAfterViewInit = function () {
10960
10565
  this.cd.detectChanges();
@@ -10974,20 +10579,14 @@
10974
10579
  label: this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
10975
10580
  command: function () {
10976
10581
  if (_this.isAllowToViewHistorical) {
10977
- _this.sharedStateService.setHideField(true);
10978
- _this.sharedStateService.setShowButton(false);
10979
- _this.sharedStateService.setShowEditMode(false);
10980
10582
  var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
10981
10583
  if (_this.withSidebar) {
10982
10584
  _this.isOnlyView.emit(true);
10983
- _this.isOnlyEdit.emit(false);
10984
- _this.sharedStateService.setHideBtnAddForViewMode(true);
10985
10585
  _this.router.navigate(["historical-pix-account/" + dateChange], {
10986
10586
  relativeTo: _this.activatedRoute,
10987
10587
  });
10988
10588
  }
10989
10589
  else {
10990
- _this.sharedStateService.setSaveButton(false);
10991
10590
  _this.enableView.emit(dateChange);
10992
10591
  }
10993
10592
  }
@@ -11000,25 +10599,16 @@
11000
10599
  label: this.translateService.instant("hcm.payroll.edit"),
11001
10600
  command: function () {
11002
10601
  if (_this.isAllowToEditHistorical) {
11003
- _this.sharedStateService.setHideField(true);
11004
- _this.sharedStateService.setShowButton(false);
11005
- _this.sharedStateService.setShowEditMode(true);
11006
10602
  var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
11007
10603
  if (_this.withSidebar) {
11008
10604
  _this.isOnlyView.emit(false);
11009
10605
  _this.isOnlyEdit.emit(true);
11010
- _this.sharedStateService.setHideBtnAddForViewMode(false);
11011
10606
  _this.router.navigate(["historical-pix-account/" + dateChange], {
11012
10607
  relativeTo: _this.activatedRoute,
11013
10608
  });
11014
- _this.sharedStateService.setShouldReloadWindowOnlyEditMode(true);
11015
10609
  }
11016
10610
  else {
11017
- setTimeout(function () {
11018
- _this.sharedStateService.triggerActiveValidatorsOnEditModalOpen();
11019
- });
11020
- _this.sharedStateService.setSaveButton(true);
11021
- _this.enableView.emit(dateChange);
10611
+ _this.enableEdit.emit(dateChange);
11022
10612
  }
11023
10613
  }
11024
10614
  else {
@@ -11103,24 +10693,6 @@
11103
10693
  this.lastRecord = payload[0];
11104
10694
  }
11105
10695
  };
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
10696
  Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToAddHistorical", {
11125
10697
  get: function () {
11126
10698
  return (this.permission["incluir"]);
@@ -11173,8 +10745,7 @@
11173
10745
  { type: core.ChangeDetectorRef },
11174
10746
  { type: router.Router },
11175
10747
  { type: api.MessageService },
11176
- { type: HistoricalPixAccountListService },
11177
- { type: SharedStateService }
10748
+ { type: HistoricalPixAccountListService }
11178
10749
  ]; };
11179
10750
  __decorate([
11180
10751
  core.ViewChild(angularComponents.CustomFieldsComponent, { static: false })
@@ -11200,9 +10771,6 @@
11200
10771
  __decorate([
11201
10772
  core.Input()
11202
10773
  ], HistoricalPixAccountListComponent.prototype, "withSidebar", void 0);
11203
- __decorate([
11204
- core.Input()
11205
- ], HistoricalPixAccountListComponent.prototype, "hideField", void 0);
11206
10774
  __decorate([
11207
10775
  core.Output()
11208
10776
  ], HistoricalPixAccountListComponent.prototype, "isOnlyView", void 0);
@@ -11214,10 +10782,7 @@
11214
10782
  ], HistoricalPixAccountListComponent.prototype, "enableView", void 0);
11215
10783
  __decorate([
11216
10784
  core.Output()
11217
- ], HistoricalPixAccountListComponent.prototype, "isEditJudicialDependentPix", void 0);
11218
- __decorate([
11219
- core.Input()
11220
- ], HistoricalPixAccountListComponent.prototype, "hideFieldsOnAdd$", null);
10785
+ ], HistoricalPixAccountListComponent.prototype, "enableEdit", void 0);
11221
10786
  __decorate([
11222
10787
  core.Input()
11223
10788
  ], HistoricalPixAccountListComponent.prototype, "reloadList", null);
@@ -11340,7 +10905,6 @@
11340
10905
  exports.PermissionService = PermissionService;
11341
10906
  exports.ReportService = ReportService;
11342
10907
  exports.ServicesModule = ServicesModule;
11343
- exports.SharedStateService = SharedStateService;
11344
10908
  exports.SpinnerLoaderComponent = SpinnerLoaderComponent;
11345
10909
  exports.SpinnerLoaderModule = SpinnerLoaderModule;
11346
10910
  exports.StringMethods = StringMethods;
@@ -11436,8 +11000,7 @@
11436
11000
  exports.ɵo = AutocompleteService;
11437
11001
  exports.ɵp = LookupService$1;
11438
11002
  exports.ɵq = HistoricalBankAccountFormComponent;
11439
- exports.ɵr = HistoricakPixAccountBase;
11440
- exports.ɵs = HistoricalPixAccountFormComponent;
11003
+ exports.ɵr = HistoricalPixAccountFormComponent;
11441
11004
 
11442
11005
  Object.defineProperty(exports, '__esModule', { value: true });
11443
11006