@senior-gestao-pessoas/payroll-core 9.4.0-da523d13-bda8-40be-a1f7-c0d945546f1c → 9.4.0-db1d034b-8b09-472f-9726-7fd71af961f4

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 +662 -499
  2. package/bundles/senior-gestao-pessoas-payroll-core.umd.js.map +1 -1
  3. package/bundles/senior-gestao-pessoas-payroll-core.umd.min.js +16 -1
  4. package/bundles/senior-gestao-pessoas-payroll-core.umd.min.js.map +1 -1
  5. package/components/historical-pix-account/historical-pix-account-base.d.ts +25 -0
  6. package/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.d.ts +8 -40
  7. package/components/historical-pix-account/historical-pix-account.component.d.ts +23 -6
  8. package/components/historical-pix-account/historical-pix-account.service.d.ts +1 -0
  9. package/components/historical-pix-account-list/historical-pix-account-list.component.d.ts +11 -2
  10. package/components/shared/index.d.ts +1 -0
  11. package/components/shared/shared-state.service.d.ts +14 -0
  12. package/esm2015/components/historical-pix-account/historical-pix-account-base.js +150 -0
  13. package/esm2015/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.js +29 -187
  14. package/esm2015/components/historical-pix-account/historical-pix-account.component.js +79 -18
  15. package/esm2015/components/historical-pix-account/historical-pix-account.module.js +5 -1
  16. package/esm2015/components/historical-pix-account/historical-pix-account.service.js +8 -1
  17. package/esm2015/components/historical-pix-account-list/historical-pix-account-list.component.js +65 -34
  18. package/esm2015/components/shared/index.js +2 -0
  19. package/esm2015/components/shared/shared-state.service.js +36 -0
  20. package/esm2015/public_api.js +2 -1
  21. package/esm2015/senior-gestao-pessoas-payroll-core.js +3 -2
  22. package/esm5/components/historical-pix-account/historical-pix-account-base.js +163 -0
  23. package/esm5/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.js +53 -201
  24. package/esm5/components/historical-pix-account/historical-pix-account.component.js +122 -48
  25. package/esm5/components/historical-pix-account/historical-pix-account.module.js +5 -1
  26. package/esm5/components/historical-pix-account/historical-pix-account.service.js +8 -1
  27. package/esm5/components/historical-pix-account-list/historical-pix-account-list.component.js +74 -34
  28. package/esm5/components/shared/index.js +2 -0
  29. package/esm5/components/shared/shared-state.service.js +37 -0
  30. package/esm5/public_api.js +2 -1
  31. package/esm5/senior-gestao-pessoas-payroll-core.js +3 -2
  32. package/fesm2015/senior-gestao-pessoas-payroll-core.js +564 -446
  33. package/fesm2015/senior-gestao-pessoas-payroll-core.js.map +1 -1
  34. package/fesm5/senior-gestao-pessoas-payroll-core.js +658 -496
  35. package/fesm5/senior-gestao-pessoas-payroll-core.js.map +1 -1
  36. package/locale/en-US.json +1 -1
  37. package/locale/es-ES.json +1 -1
  38. package/locale/pt-BR.json +1 -1
  39. package/package.json +1 -1
  40. package/public_api.d.ts +1 -0
  41. package/senior-gestao-pessoas-payroll-core.d.ts +2 -1
  42. package/senior-gestao-pessoas-payroll-core.metadata.json +1 -1
@@ -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')) :
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';
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';
6
6
 
7
7
  business = business && business.hasOwnProperty('default') ? business['default'] : business;
8
8
 
@@ -9421,51 +9421,450 @@
9421
9421
  return FormatUtilsService;
9422
9422
  }());
9423
9423
 
9424
- var HistoricalPixAccountComponent = /** @class */ (function () {
9425
- function HistoricalPixAccountComponent(translateService, cd, formBuilder, messageService) {
9426
- var _this = this;
9427
- this.translateService = translateService;
9428
- this.cd = cd;
9424
+ var SharedStateService = /** @class */ (function () {
9425
+ function SharedStateService() {
9426
+ this.hideFieldSubject = new rxjs.BehaviorSubject(true);
9427
+ this.hideField$ = this.hideFieldSubject.asObservable();
9428
+ this.showButtonSubject = new rxjs.BehaviorSubject(true);
9429
+ this.showButton$ = this.showButtonSubject.asObservable();
9430
+ this.saveButtonSubject = new rxjs.BehaviorSubject(true);
9431
+ this.saveButton$ = this.saveButtonSubject.asObservable();
9432
+ this.showEditMode = new rxjs.BehaviorSubject(true);
9433
+ this.showEditMode$ = this.showEditMode.asObservable();
9434
+ }
9435
+ SharedStateService.prototype.setHideField = function (value) {
9436
+ this.hideFieldSubject.next(value);
9437
+ };
9438
+ SharedStateService.prototype.setShowButton = function (value) {
9439
+ this.showButtonSubject.next(value);
9440
+ };
9441
+ SharedStateService.prototype.setSaveButton = function (value) {
9442
+ this.saveButtonSubject.next(value);
9443
+ };
9444
+ SharedStateService.prototype.setShowEditMode = function (value) {
9445
+ this.showEditMode.next(value);
9446
+ };
9447
+ SharedStateService.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function SharedStateService_Factory() { return new SharedStateService(); }, token: SharedStateService, providedIn: "root" });
9448
+ SharedStateService = __decorate([
9449
+ core.Injectable({
9450
+ providedIn: 'root',
9451
+ })
9452
+ ], SharedStateService);
9453
+ return SharedStateService;
9454
+ }());
9455
+
9456
+ var GenericValidator = /** @class */ (function () {
9457
+ function GenericValidator() {
9458
+ }
9459
+ /**
9460
+ * Valida o CEI (Cadastro específico de INSS) digitado.
9461
+ */
9462
+ GenericValidator.isValidCei = function (control) {
9463
+ var cei = control.value;
9464
+ if (!cei)
9465
+ return null;
9466
+ else if (cei.length != 11)
9467
+ return null;
9468
+ var multiplicadorBase = "3298765432";
9469
+ var total = 0;
9470
+ var resto = 0;
9471
+ var multiplicando = 0;
9472
+ var multiplicador = 0;
9473
+ if (cei.length !== 11 ||
9474
+ cei === "00000000000" ||
9475
+ cei === "11111111111" ||
9476
+ cei === "22222222222" ||
9477
+ cei === "33333333333" ||
9478
+ cei === "44444444444" ||
9479
+ cei === "55555555555" ||
9480
+ cei === "66666666666" ||
9481
+ cei === "77777777777" ||
9482
+ cei === "88888888888" ||
9483
+ cei === "99999999999")
9484
+ return { invalidCei: true };
9485
+ else {
9486
+ for (var i = 0; i < 10; i++) {
9487
+ multiplicando = parseInt(cei.substring(i, i + 1), 10);
9488
+ multiplicador = parseInt(multiplicadorBase.substring(i, i + 1), 10);
9489
+ total += multiplicando * multiplicador;
9490
+ }
9491
+ resto = 11 - (total % 11);
9492
+ resto = resto === 10 || resto === 11 ? 0 : resto;
9493
+ var digito = parseInt("" + cei.charAt(10), 10);
9494
+ return resto === digito ? null : { invalidCei: true };
9495
+ }
9496
+ };
9497
+ /**
9498
+ * Valida se o CPF é valido. Deve-se ser informado o cpf sem máscara.
9499
+ */
9500
+ GenericValidator.isValidCpf = function (control) {
9501
+ var cpf = control.value;
9502
+ if (cpf) {
9503
+ var numbers = void 0, digits = void 0, sum = void 0, i = void 0, result = void 0, equalDigits = void 0;
9504
+ equalDigits = 1;
9505
+ if (cpf.length < 11) {
9506
+ return null;
9507
+ }
9508
+ for (i = 0; i < cpf.length - 1; i++) {
9509
+ if (cpf.charAt(i) !== cpf.charAt(i + 1)) {
9510
+ equalDigits = 0;
9511
+ break;
9512
+ }
9513
+ }
9514
+ if (!equalDigits) {
9515
+ numbers = cpf.substring(0, 9);
9516
+ digits = cpf.substring(9);
9517
+ sum = 0;
9518
+ for (i = 10; i > 1; i--) {
9519
+ sum += numbers.charAt(10 - i) * i;
9520
+ }
9521
+ result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9522
+ if (result !== Number(digits.charAt(0))) {
9523
+ return { cpfNotValid: true };
9524
+ }
9525
+ numbers = cpf.substring(0, 10);
9526
+ sum = 0;
9527
+ for (i = 11; i > 1; i--) {
9528
+ sum += numbers.charAt(11 - i) * i;
9529
+ }
9530
+ result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9531
+ if (result !== Number(digits.charAt(1))) {
9532
+ return { cpfNotValid: true };
9533
+ }
9534
+ return null;
9535
+ }
9536
+ else {
9537
+ return { cpfNotValid: true };
9538
+ }
9539
+ }
9540
+ return null;
9541
+ };
9542
+ /**
9543
+ * Valida se o CNPJ é valido. Deve-se ser informado o cpf sem máscara.
9544
+ */
9545
+ GenericValidator.isValidCnpj = function (control) {
9546
+ var cnpj = control.value;
9547
+ if (cnpj) {
9548
+ var size = void 0, numbers = void 0, digits = void 0, sum = void 0, pos = void 0, result = void 0;
9549
+ cnpj = cnpj.replace(/[^\d]+/g, '');
9550
+ if (cnpj.length !== 14) {
9551
+ return null;
9552
+ }
9553
+ // Elimina CNPJs invalidos conhecidos
9554
+ if (cnpj === '00000000000000' ||
9555
+ cnpj === '11111111111111' ||
9556
+ cnpj === '22222222222222' ||
9557
+ cnpj === '33333333333333' ||
9558
+ cnpj === '44444444444444' ||
9559
+ cnpj === '55555555555555' ||
9560
+ cnpj === '66666666666666' ||
9561
+ cnpj === '77777777777777' ||
9562
+ cnpj === '88888888888888' ||
9563
+ cnpj === '99999999999999') {
9564
+ return { cnpjNotValid: true };
9565
+ }
9566
+ // Valida DVs
9567
+ size = cnpj.length - 2;
9568
+ numbers = cnpj.substring(0, size);
9569
+ digits = cnpj.substring(size);
9570
+ sum = 0;
9571
+ pos = size - 7;
9572
+ for (var i = size; i >= 1; i--) {
9573
+ sum += numbers.charAt(size - i) * pos--;
9574
+ if (pos < 2) {
9575
+ pos = 9;
9576
+ }
9577
+ }
9578
+ result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9579
+ if (result !== Number(digits.charAt(0))) {
9580
+ return { cnpjNotValid: true };
9581
+ }
9582
+ size = size + 1;
9583
+ numbers = cnpj.substring(0, size);
9584
+ sum = 0;
9585
+ pos = size - 7;
9586
+ for (var i = size; i >= 1; i--) {
9587
+ sum += numbers.charAt(size - i) * pos--;
9588
+ if (pos < 2) {
9589
+ pos = 9;
9590
+ }
9591
+ }
9592
+ result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9593
+ if (result !== Number(digits.charAt(1))) {
9594
+ return { cnpjNotValid: true };
9595
+ }
9596
+ return null;
9597
+ }
9598
+ return null;
9599
+ };
9600
+ /**
9601
+ * Válida o número de telefone da chave PIX.
9602
+ */
9603
+ GenericValidator.isValidPhoneNumber = function (control) {
9604
+ var cellPhoneKey = control.value || '';
9605
+ cellPhoneKey = cellPhoneKey.replace(/[\s()-]/g, '');
9606
+ var regexNumberTelephone = /^[1-9][\d]{1,2}\d{8,10}$/;
9607
+ var isValidNumberTelephone = regexNumberTelephone.test(cellPhoneKey);
9608
+ return isValidNumberTelephone ? null : { invalidPhoneNumber: true };
9609
+ };
9610
+ /**
9611
+ * Valida o email da chave PIX.
9612
+ */
9613
+ GenericValidator.isValidEmail = function (control) {
9614
+ var emailKey = control.value;
9615
+ var regexValidEmail = /^[\w-\.]+@[\w-]+(\.[\w-]{2,4}){1,2}$/;
9616
+ var isValidEmail = regexValidEmail.test(emailKey);
9617
+ return isValidEmail ? null : { invalidEmail: true };
9618
+ };
9619
+ return GenericValidator;
9620
+ }());
9621
+
9622
+ var HistoricakPixAccountBase = /** @class */ (function () {
9623
+ function HistoricakPixAccountBase(formBuilder) {
9624
+ this._paramsForm = new forms.FormGroup({});
9625
+ this._defaultCpfNumber = null;
9626
+ this.initialValidatorOfPercentage = [forms.Validators.required, forms.Validators.min(0.01)];
9627
+ this.pixAccountList = [];
9628
+ this.maxValuePercentage = 100.00;
9629
+ this.isShowPixKeyFieldValidatorMessage = false;
9429
9630
  this.formBuilder = formBuilder;
9430
- this.messageService = messageService;
9431
- this.recordByRow = 1;
9432
- this.showDateChange = false;
9433
- this.isEditMode = false;
9434
- this.isViewMode = false;
9435
- this.withSideBar = true;
9436
- this.defaultCpfNumber = null;
9437
- this.listDataReciever = [];
9438
- this.isViewModeActive = new core.EventEmitter();
9439
- this.isEditModeActive = new core.EventEmitter();
9440
- this.isDeleteModeActive = new core.EventEmitter();
9441
- this.listFromApp = [];
9442
- this.visibleChange = new core.EventEmitter();
9443
- this.ngUnsubscribe = new rxjs.Subject();
9444
- this.orderBy = {
9445
- field: "dateChange",
9446
- direction: exports.DirectionEnumeration.DESC,
9631
+ this.createFormGroupBase();
9632
+ }
9633
+ HistoricakPixAccountBase.prototype.phoneMask = function (event) {
9634
+ console.log("phoneMaskEvent", event);
9635
+ FormatUtilsService.formatTelephoneInputEvent(event);
9636
+ };
9637
+ HistoricakPixAccountBase.prototype.onChangePixKeyType = function (item) {
9638
+ console.log("onChangePixKeyType", item);
9639
+ if (item.key) {
9640
+ this.pixKeyType = item.key;
9641
+ this.isShowPixKeyFieldValidatorMessage = true;
9642
+ this.pixAccountFormGroup.get("pixKey").reset();
9643
+ this.setPixKeyValidators(true);
9644
+ if (item.key === "CPF") {
9645
+ this.setDefaultCpfPixKey();
9646
+ }
9647
+ }
9648
+ };
9649
+ HistoricakPixAccountBase.prototype.onClearPixKeyType = function () {
9650
+ this.isShowPixKeyFieldValidatorMessage = false;
9651
+ this.pixAccountFormGroup.get("pixKey").reset();
9652
+ };
9653
+ HistoricakPixAccountBase.prototype.setDefaultCpfPixKey = function () {
9654
+ if (this._defaultCpfNumber) {
9655
+ this.pixAccountFormGroup.get("pixKey").setValue(this._defaultCpfNumber);
9656
+ }
9657
+ else {
9658
+ var sheetDocument = this._paramsForm.get("sheetDocument");
9659
+ if (sheetDocument) {
9660
+ var cpf = sheetDocument.get("cpfNumber").value;
9661
+ if (cpf) {
9662
+ this.pixAccountFormGroup.get("pixKey").setValue(cpf);
9663
+ }
9664
+ }
9665
+ }
9666
+ };
9667
+ HistoricakPixAccountBase.prototype.createFormGroupBase = function () {
9668
+ this.pixAccountFormGroup = this.formBuilder.group({
9669
+ id: this.formBuilder.control(null),
9670
+ index: this.formBuilder.control(null),
9671
+ employee: this.formBuilder.control({ value: { tableId: null }, disabled: true }),
9672
+ dateChange: this.formBuilder.control(null),
9673
+ pixKeyType: this.formBuilder.control(null, forms.Validators.required),
9674
+ pixKey: this.formBuilder.control(null),
9675
+ percentage: this.formBuilder.control(null, forms.Validators.compose(__spread(this.initialValidatorOfPercentage, [
9676
+ forms.Validators.max(this.maxValuePercentage),
9677
+ ]))),
9678
+ externalId: this.formBuilder.control(null),
9679
+ customFields: this.formBuilder.control(null),
9680
+ });
9681
+ };
9682
+ HistoricakPixAccountBase.prototype.setValidatorsAccordingList = function (pixAccountList, index, isEditMode) {
9683
+ if (index === void 0) { index = null; }
9684
+ if (isEditMode === void 0) { isEditMode = true; }
9685
+ console.log("setValidatorsAccordingList", pixAccountList, index, isEditMode);
9686
+ this.pixAccountList = pixAccountList && pixAccountList.length ? __spread(pixAccountList) : [];
9687
+ var percentageIncluded = [];
9688
+ this.pixAccountList.forEach(function (field, key) {
9689
+ if (field["percentage"] && key !== index) {
9690
+ percentageIncluded.push(field["percentage"]);
9691
+ }
9692
+ });
9693
+ this.beforeSetPixKeyTypeValidator();
9694
+ this.setPixKeyValidators(isEditMode);
9695
+ this.validatePercentageValid(percentageIncluded);
9696
+ };
9697
+ HistoricakPixAccountBase.prototype.beforeSetPixKeyTypeValidator = function () {
9698
+ var pixKeyType = this.pixAccountFormGroup.get("pixKeyType");
9699
+ console.log("beforeSetPixKeyTypeValidator", this.pixAccountList, pixKeyType);
9700
+ if (this.pixAccountList && this.pixAccountList.length && pixKeyType) {
9701
+ pixKeyType.setValidators(forms.Validators.compose([
9702
+ forms.Validators.required,
9703
+ this.validateDuplicatePixKeyTypeBankAccount(this.pixAccountList),
9704
+ ]));
9705
+ }
9706
+ else {
9707
+ pixKeyType.setValidators(forms.Validators.required);
9708
+ }
9709
+ };
9710
+ HistoricakPixAccountBase.prototype.setPixKeyValidators = function (isEditMode) {
9711
+ var pixKey = this.pixAccountFormGroup.get("pixKey");
9712
+ console.log("setPixKeyValidators", this.pixKeyType, isEditMode);
9713
+ if (this.pixKeyType) {
9714
+ switch (this.pixKeyType) {
9715
+ case "TELEPHONE":
9716
+ pixKey.setValidators(forms.Validators.compose([forms.Validators.required, GenericValidator.isValidPhoneNumber]));
9717
+ break;
9718
+ case "EMAIL":
9719
+ pixKey.setValidators(forms.Validators.compose([forms.Validators.required, GenericValidator.isValidEmail]));
9720
+ break;
9721
+ case "CPF":
9722
+ pixKey.setValidators(forms.Validators.compose([forms.Validators.required, GenericValidator.isValidCpf]));
9723
+ break;
9724
+ case "CNPJ":
9725
+ pixKey.setValidators(forms.Validators.compose([forms.Validators.required, GenericValidator.isValidCnpj]));
9726
+ break;
9727
+ case "RANDOM_KEY":
9728
+ pixKey.setValidators(forms.Validators.required);
9729
+ break;
9730
+ default:
9731
+ pixKey.setValidators(null);
9732
+ }
9733
+ if (isEditMode) {
9734
+ pixKey.enable();
9735
+ }
9736
+ pixKey.updateValueAndValidity();
9737
+ }
9738
+ };
9739
+ HistoricakPixAccountBase.prototype.validatePercentageValid = function (listValue) {
9740
+ var percentage = this.pixAccountFormGroup.get("percentage");
9741
+ this.maxValuePercentage = listValue.reduce(function (acc, val) { return acc - val; }, 100.00);
9742
+ console.log("validatePercentageValid", this.maxValuePercentage);
9743
+ percentage.setValidators(forms.Validators.compose(__spread(this.initialValidatorOfPercentage, [
9744
+ forms.Validators.max(this.maxValuePercentage),
9745
+ ])));
9746
+ percentage.updateValueAndValidity();
9747
+ };
9748
+ HistoricakPixAccountBase.prototype.validateDuplicatePixKeyTypeBankAccount = function (listCompare) {
9749
+ return function (control) {
9750
+ var value = control && control.value;
9751
+ var isDuplicate = listCompare.some(function (field) {
9752
+ return value && field["pixKeyType"].key === 'BANK_ACCOUNT' && value.key === 'BANK_ACCOUNT';
9753
+ });
9754
+ return isDuplicate ? { pixKeyTypeBankAccountDuplicate: true } : null;
9447
9755
  };
9448
- this.pixAccountItemInput = {};
9449
- this.totalRecords = 0;
9450
- this.actionLabel = this.translateService.instant("hcm.payroll.entries_query_actions_total_title");
9451
- this.loading = true;
9452
- this.listData = [];
9453
- this.listDataNoPage = [];
9454
- this.cols = [
9756
+ };
9757
+ Object.defineProperty(HistoricakPixAccountBase.prototype, "paramsForm", {
9758
+ get: function () {
9759
+ return this._paramsForm;
9760
+ },
9761
+ set: function (value) {
9762
+ this._paramsForm = value;
9763
+ },
9764
+ enumerable: true,
9765
+ configurable: true
9766
+ });
9767
+ Object.defineProperty(HistoricakPixAccountBase.prototype, "defaultCpfNumber", {
9768
+ get: function () {
9769
+ return this._defaultCpfNumber;
9770
+ },
9771
+ set: function (value) {
9772
+ this._defaultCpfNumber = value;
9773
+ },
9774
+ enumerable: true,
9775
+ configurable: true
9776
+ });
9777
+ return HistoricakPixAccountBase;
9778
+ }());
9779
+
9780
+ var HistoricalPixAccountService = /** @class */ (function () {
9781
+ function HistoricalPixAccountService(http) {
9782
+ this.http = http;
9783
+ }
9784
+ HistoricalPixAccountService.prototype.query = function (path, body, service) {
9785
+ if (service === void 0) { service = exports.ServiceType.PAYROLL; }
9786
+ return this.http.query(path, body, service);
9787
+ };
9788
+ HistoricalPixAccountService.prototype.enumQuery = function () {
9789
+ var path = 'enumQuery';
9790
+ var body = {
9791
+ names: ['PixKeyType']
9792
+ };
9793
+ return this.http.query(path, body, exports.ServiceType.PAYROLL);
9794
+ };
9795
+ HistoricalPixAccountService.ctorParameters = function () { return [
9796
+ { type: HttpClientService }
9797
+ ]; };
9798
+ HistoricalPixAccountService = __decorate([
9799
+ core.Injectable()
9800
+ ], HistoricalPixAccountService);
9801
+ return HistoricalPixAccountService;
9802
+ }());
9803
+
9804
+ var HistoricalPixAccountComponent = /** @class */ (function (_super) {
9805
+ __extends(HistoricalPixAccountComponent, _super);
9806
+ function HistoricalPixAccountComponent(translateService, cd, formBuilder, messageService, sharedStateService, service) {
9807
+ var _this = _super.call(this, formBuilder) || this;
9808
+ _this.translateService = translateService;
9809
+ _this.cd = cd;
9810
+ _this.messageService = messageService;
9811
+ _this.sharedStateService = sharedStateService;
9812
+ _this.service = service;
9813
+ _this.recordByRow = 1;
9814
+ _this.showDateChange = false;
9815
+ _this.isEditMode = false;
9816
+ _this.isViewMode = false;
9817
+ _this.withSideBar = true;
9818
+ _this.listDataReciever = [];
9819
+ _this.addExistentHistoricData = [];
9820
+ _this.getListPixAccount = [];
9821
+ _this.isViewModeActive = new core.EventEmitter();
9822
+ _this.isEditModeActive = new core.EventEmitter();
9823
+ _this.isDeleteModeActive = new core.EventEmitter();
9824
+ _this.listFromApp = [];
9825
+ _this.visibleChange = new core.EventEmitter();
9826
+ _this.ngUnsubscribe = new rxjs.Subject();
9827
+ _this.orderBy = {
9828
+ field: "dateChange",
9829
+ direction: exports.DirectionEnumeration.DESC,
9830
+ };
9831
+ _this.pixAccountItemInput = {};
9832
+ _this.totalRecords = 0;
9833
+ _this.actionLabel = _this.translateService.instant("hcm.payroll.entries_query_actions_total_title");
9834
+ _this.loading = true;
9835
+ _this.listData = [];
9836
+ _this.listDataNoPage = [];
9837
+ _this.showButtonView = true;
9838
+ _this.showEditMode = false;
9839
+ _this.activeIndex = 0;
9840
+ _this.hasRecordsPix = true;
9841
+ _this.firstPix = 0;
9842
+ _this.maxValuePercentage = 100.00;
9843
+ _this.hideFields = _this.sharedStateService.hideField$;
9844
+ _this.suggestions = [];
9845
+ _this.cols = [
9455
9846
  {
9456
- label: this.translateService.instant("hcm.payroll.employees_addition_pix_key_type"),
9847
+ label: _this.translateService.instant("hcm.payroll.employees_addition_pix_key_type"),
9457
9848
  field: "pixKeyType",
9849
+ orderBy: 'pixKeyType.key',
9458
9850
  },
9459
9851
  {
9460
- label: this.translateService.instant("hcm.payroll.employees_addition_pix_key"),
9852
+ label: _this.translateService.instant("hcm.payroll.employees_addition_pix_key"),
9461
9853
  field: "pixKey",
9854
+ orderBy: 'pixKey',
9462
9855
  },
9463
9856
  {
9464
- label: this.translateService.instant("hcm.payroll.historical_pix_account_label_percentage"),
9857
+ label: _this.translateService.instant("hcm.payroll.historical_pix_account_label_percentage"),
9465
9858
  field: "percentage",
9859
+ orderBy: 'percentage',
9466
9860
  },
9861
+ {
9862
+ label: _this.translateService.instant("hcm.payroll.movimentation_generic_action"),
9863
+ field: "actions",
9864
+ orderBy: null,
9865
+ }
9467
9866
  ];
9468
- this.actions = function (rowData, key) {
9867
+ _this.actions = function (rowData, key) {
9469
9868
  if (rowData === void 0) { rowData = {}; }
9470
9869
  return [
9471
9870
  {
@@ -9502,7 +9901,7 @@
9502
9901
  },
9503
9902
  },
9504
9903
  {
9505
- visible: !_this.isEditMode,
9904
+ visible: !_this.isEditMode || _this.showEditMode,
9506
9905
  label: _this.translateService.instant("hcm.payroll.delete"),
9507
9906
  command: function () {
9508
9907
  if (_this.isAllowToDeleteHistorical) {
@@ -9520,15 +9919,26 @@
9520
9919
  },
9521
9920
  ];
9522
9921
  };
9523
- this.createFormGroup();
9922
+ _this.createFormGroup();
9923
+ return _this;
9524
9924
  }
9525
9925
  HistoricalPixAccountComponent.prototype.ngOnInit = function () {
9926
+ var _this = this;
9526
9927
  this.formGroup.setControl(this.fieldFormGroup, this.historicalPixAccountList);
9928
+ this.sharedStateService.showButton$.subscribe(function (value) {
9929
+ _this.showButtonView = value;
9930
+ });
9931
+ this.sharedStateService.showEditMode$.subscribe(function (value) {
9932
+ _this.showEditMode = value;
9933
+ });
9527
9934
  };
9528
9935
  HistoricalPixAccountComponent.prototype.ngOnChanges = function (changes) {
9529
9936
  if (changes['listDataReciever'] && changes['listDataReciever'].currentValue) {
9530
9937
  this.listFromApp = changes['listDataReciever'].currentValue;
9531
9938
  }
9939
+ if (changes['addExistentHistoricData'] && changes['addExistentHistoricData'].currentValue) {
9940
+ this.getHistoricalPixAccountList();
9941
+ }
9532
9942
  };
9533
9943
  HistoricalPixAccountComponent.prototype.createFormGroup = function () {
9534
9944
  this.historicalPixAccountList = this.formBuilder.group({
@@ -9542,6 +9952,21 @@
9542
9952
  HistoricalPixAccountComponent.prototype.ngAfterViewInit = function () {
9543
9953
  this.cd.detectChanges();
9544
9954
  };
9955
+ HistoricalPixAccountComponent.prototype.filterPixKeyType = function (event) {
9956
+ var _this = this;
9957
+ var query = event.query;
9958
+ this.service.enumQuery().subscribe(function (response) {
9959
+ var pixKeyTypeEnum = response.results.find(function (result) { return result.enumName === 'PixKeyType'; });
9960
+ if (pixKeyTypeEnum) {
9961
+ _this.suggestions = pixKeyTypeEnum.items.filter(function (item) {
9962
+ return item.value.toLowerCase().includes(query.toLowerCase());
9963
+ });
9964
+ }
9965
+ else {
9966
+ _this.suggestions = [];
9967
+ }
9968
+ });
9969
+ };
9545
9970
  HistoricalPixAccountComponent.prototype.onLazyLoad = function (event) {
9546
9971
  var _this = this;
9547
9972
  var first = event && event.first ? event.first : 0;
@@ -9586,12 +10011,16 @@
9586
10011
  this.pixAccountItemInput = {};
9587
10012
  this.visible = true;
9588
10013
  };
9589
- HistoricalPixAccountComponent.prototype.isNotAllowMessage = function () {
9590
- this.messageService.add({
9591
- severity: "error",
9592
- summary: this.translateService.instant("hcm.payroll.error"),
9593
- detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
9594
- });
10014
+ HistoricalPixAccountComponent.prototype.addPix = function () {
10015
+ var newItem = {
10016
+ pixKeyType: {},
10017
+ pixKey: '',
10018
+ percentage: 0
10019
+ };
10020
+ this.addExistentHistoricData = __spread(this.addExistentHistoricData, [newItem]);
10021
+ };
10022
+ HistoricalPixAccountComponent.prototype.deletePix = function (index) {
10023
+ this.addExistentHistoricData = this.addExistentHistoricData.filter(function (_, i) { return i !== index; });
9595
10024
  };
9596
10025
  HistoricalPixAccountComponent.prototype.deleteAnnuityItem = function (index) {
9597
10026
  var newlist = __spread(this.getHistoricalPixAccountList());
@@ -9723,6 +10152,20 @@
9723
10152
  enumerable: true,
9724
10153
  configurable: true
9725
10154
  });
10155
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "paramsForm", {
10156
+ set: function (value) {
10157
+ this._paramsForm = value;
10158
+ },
10159
+ enumerable: true,
10160
+ configurable: true
10161
+ });
10162
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "defaultCpfNumber", {
10163
+ set: function (value) {
10164
+ this._defaultCpfNumber = value;
10165
+ },
10166
+ enumerable: true,
10167
+ configurable: true
10168
+ });
9726
10169
  HistoricalPixAccountComponent.prototype.close = function () {
9727
10170
  this.visible = false;
9728
10171
  };
@@ -9770,7 +10213,9 @@
9770
10213
  { type: core$1.TranslateService },
9771
10214
  { type: core.ChangeDetectorRef },
9772
10215
  { type: forms.FormBuilder },
9773
- { type: api.MessageService }
10216
+ { type: api.MessageService },
10217
+ { type: SharedStateService },
10218
+ { type: HistoricalPixAccountService }
9774
10219
  ]; };
9775
10220
  __decorate([
9776
10221
  core.ViewChild(angularComponents.CustomFieldsComponent, { static: false })
@@ -9814,238 +10259,76 @@
9814
10259
  __decorate([
9815
10260
  core.Input()
9816
10261
  ], HistoricalPixAccountComponent.prototype, "withSideBar", void 0);
9817
- __decorate([
9818
- core.Input()
9819
- ], HistoricalPixAccountComponent.prototype, "paramsForm", void 0);
9820
- __decorate([
9821
- core.Input()
9822
- ], HistoricalPixAccountComponent.prototype, "defaultCpfNumber", void 0);
9823
10262
  __decorate([
9824
10263
  core.Input()
9825
10264
  ], HistoricalPixAccountComponent.prototype, "permission", void 0);
9826
10265
  __decorate([
9827
10266
  core.Input()
9828
10267
  ], HistoricalPixAccountComponent.prototype, "listDataReciever", void 0);
9829
- __decorate([
9830
- core.Output()
9831
- ], HistoricalPixAccountComponent.prototype, "isViewModeActive", void 0);
9832
- __decorate([
9833
- core.Output()
9834
- ], HistoricalPixAccountComponent.prototype, "isEditModeActive", void 0);
9835
- __decorate([
9836
- core.Output()
9837
- ], HistoricalPixAccountComponent.prototype, "isDeleteModeActive", void 0);
9838
- __decorate([
9839
- core.Input()
9840
- ], HistoricalPixAccountComponent.prototype, "dateChange", null);
9841
- __decorate([
9842
- core.Input()
9843
- ], HistoricalPixAccountComponent.prototype, "displayDateChange", null);
9844
- __decorate([
9845
- core.Input()
9846
- ], HistoricalPixAccountComponent.prototype, "addListData", null);
9847
- __decorate([
9848
- core.Input()
9849
- ], HistoricalPixAccountComponent.prototype, "visible", null);
9850
- HistoricalPixAccountComponent = __decorate([
9851
- core.Component({
9852
- // tslint:disable-next-line:component-selector
9853
- selector: "c-historical-pix-account",
9854
- template: "<s-sidebar *ngIf=\"withSideBar\" [visible]=\"visible\" (visibleChange)=\"close()\"\n header=\"{{'hcm.payroll.historical_pix_account_title_form'|translate}}\">\n<pix-account [(visible)]=\"visible\"\n [isEditAndViewValue]=\"pixAccountItemInput\"\n [currency]=\"currency\"\n [customEntity]=\"customEntity\"\n [customService]=\"customService\"\n [getListPixAccount]=\"listDataNoPage\"\n [paramsForm]=\"paramsForm\"\n (pixAccountItemToList)=\"addItemInList($event)\"\n [defaultCpfNumber]=\"defaultCpfNumber\"></pix-account>\n</s-sidebar>\n\n<div *ngIf=\"!withSideBar\">\n <pix-account [(visible)]=\"visible\"\n [isEditAndViewValue]=\"pixAccountItemInput\"\n [currency]=\"currency\"\n [customEntity]=\"customEntity\"\n [customService]=\"customService\"\n [getListPixAccount]=\"listDataNoPage\"\n [withSideBar]=\"false\"\n [isViewMode]=\"isViewMode\"\n [paramsForm]=\"paramsForm\"\n (pixAccountItemToList)=\"addItemInList($event)\"\n [defaultCpfNumber]=\"defaultCpfNumber\"></pix-account>\n</div>\n\n<div class=\"ui-g-1\" *ngIf=\"withSideBar && !isEditMode\">\n <div class=\"form-group \">\n <s-button id=\"ta-addPayAnnuity\"\n [disabled]=\"getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage\"\n (onClick)=\"add()\"\n [pTooltip]=\"getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage\"\n tooltipPosition=\"top\"\n label=\"{{'hcm.payroll.historical_pix_account_add'|translate}}\"></s-button>\n </div>\n</div>\n<div class=\"ui-g-12\">\n <p-table\n id=\"table-annuity\"\n [value]=\"listData\"\n [columns]=\"cols\"\n (onLazyLoad)=\"onLazyLoad($event)\"\n [lazy]=\"true\"\n [scrollable]=\"true\"\n [paginator]=\"true\"\n [totalRecords]=\"totalRecords\"\n [sortMode]=\"'multiple'\"\n *sLoadingState=\"loading\"\n [rows]=\"recordByRow\"\n dataKey=\"id\">\n <ng-template pTemplate=\"colgroup\" let-coumns>\n <colgroup>\n <col [ngClass]=\"'col-default-m'\">\n <col [ngClass]=\"'col-default-m'\">\n <col [ngClass]=\"'col-default-s'\">\n <col [ngClass]=\"'col-action'\">\n </colgroup>\n </ng-template>\n <ng-template pTemplate=\"header\" let-columns>\n <!-- Cabe\u00E7alhos quando da table \u00E9 permitido ordenar as colunas -->\n <tr>\n <!-- Cabe\u00E7alhos das colunas da tabela -->\n <th\n [pSortableColumn]=\"'pixKeyType'\"\n [pTooltip]=\"'hcm.payroll.employees_addition_pix_key_type' | translate\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >\n <div class=\"senior-header\" id=\"table-0\">\n <span\n id=\"table-annuity-s-0\">{{ 'hcm.payroll.employees_addition_pix_key_type' | translate }}</span>\n <p-sortIcon class=\"p-sorticon-status\"\n [field]=\"'hcm.payroll.employees_addition_pix_key_type' | translate\"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]=\"'pixKey'\"\n [pTooltip]=\"'hcm.payroll.employees_addition_pix_key' | translate\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >\n <div class=\"senior-header\">\n <span>{{ 'hcm.payroll.employees_addition_pix_key' | translate }}</span>\n <p-sortIcon class=\"p-sorticon-status\"\n [field]=\"'hcm.payroll.employees_addition_pix_key' | translate\"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]=\"'percentage'\"\n [pTooltip]=\"'hcm.payroll.historical_pix_account_label_percentage' | translate\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >\n <div class=\"senior-header\">\n <span>{{ 'hcm.payroll.historical_pix_account_label_percentage' | translate }}</span>\n <p-sortIcon class=\"p-sorticon-status\"\n [field]=\"'hcm.payroll.historical_pix_account_label_percentage' | translate\"></p-sortIcon>\n </div>\n </th>\n <!-- Cabe\u00E7alho da coluna de a\u00E7\u00F5es -->\n <th id=\"col-actions\"></th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowData let-key=\"rowIndex\">\n\n <tr [ngClass]=\"'row'+key\" [pSelectableRow]=\"rowData\">\n <td [pTooltip]=\"rowData?.pixKeyType.value\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ rowData?.pixKeyType.value }}</span>\n </td>\n\n <ng-container [ngSwitch]=\"rowData?.pixKeyType.key\">\n <td *ngSwitchCase=\"'TELEPHONE'\"\n [pTooltip]=\"getFormattedTelephoneNumber(rowData?.pixKey)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedTelephoneNumber(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchCase=\"'CPF'\"\n [pTooltip]=\"getFormattedCpf(rowData?.pixKey)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedCpf(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchCase=\"'CNPJ'\"\n [pTooltip]=\"getFormattedCnpj(rowData?.pixKey)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedCnpj(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchDefault\n [pTooltip]=\"rowData?.pixKey\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ rowData?.pixKey }}</span>\n </td>\n </ng-container>\n <td [pTooltip]=\"getFormattedPercentage(rowData?.percentage)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedPercentage(rowData?.percentage) }}</span>\n </td>\n <td id=\"col-actions-{{key}}\" class=\"col-actions \"\n *ngIf=\"actions && actions(rowData, key)?.length\">\n <s-button id=\"table-admission-btn-actions-{{key}}\"\n *ngIf=\"actions(rowData, key).length > 1\" [label]=\"actionLabel\"\n priority=\"default\" [model]=\"scopedActions(rowData, key)\"\n [disabled]=\"false\" [auxiliary]=\"true\"></s-button>\n\n <s-button id=\"table-admission-btn-action-{{key}}\"\n *ngIf=\"actions(rowData, key).length <= 1\"\n [label]=\"scopedActions(rowData, key)[0].label\"\n priority=\"default\"\n (click)=\"scopedActions(rowData, key)[0].command()\"\n [disabled]=\"false\" [auxiliary]=\"true\"></s-button>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"emptymessage\" let-columns>\n <tr>\n <td [attr.colspan]=\"columns.length +2\">\n {{'hcm.payroll.admission_empty_message'|translate}}\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"paginatorright\">\n <span *ngIf=\"totalRecords\">{{recordsMessage}}</span>\n </ng-template>\n </p-table>\n</div>\n",
9855
- 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}"]
9856
- })
9857
- ], HistoricalPixAccountComponent);
9858
- return HistoricalPixAccountComponent;
9859
- }());
9860
-
9861
- var GenericValidator = /** @class */ (function () {
9862
- function GenericValidator() {
9863
- }
9864
- /**
9865
- * Valida o CEI (Cadastro específico de INSS) digitado.
9866
- */
9867
- GenericValidator.isValidCei = function (control) {
9868
- var cei = control.value;
9869
- if (!cei)
9870
- return null;
9871
- else if (cei.length != 11)
9872
- return null;
9873
- var multiplicadorBase = "3298765432";
9874
- var total = 0;
9875
- var resto = 0;
9876
- var multiplicando = 0;
9877
- var multiplicador = 0;
9878
- if (cei.length !== 11 ||
9879
- cei === "00000000000" ||
9880
- cei === "11111111111" ||
9881
- cei === "22222222222" ||
9882
- cei === "33333333333" ||
9883
- cei === "44444444444" ||
9884
- cei === "55555555555" ||
9885
- cei === "66666666666" ||
9886
- cei === "77777777777" ||
9887
- cei === "88888888888" ||
9888
- cei === "99999999999")
9889
- return { invalidCei: true };
9890
- else {
9891
- for (var i = 0; i < 10; i++) {
9892
- multiplicando = parseInt(cei.substring(i, i + 1), 10);
9893
- multiplicador = parseInt(multiplicadorBase.substring(i, i + 1), 10);
9894
- total += multiplicando * multiplicador;
9895
- }
9896
- resto = 11 - (total % 11);
9897
- resto = resto === 10 || resto === 11 ? 0 : resto;
9898
- var digito = parseInt("" + cei.charAt(10), 10);
9899
- return resto === digito ? null : { invalidCei: true };
9900
- }
9901
- };
9902
- /**
9903
- * Valida se o CPF é valido. Deve-se ser informado o cpf sem máscara.
9904
- */
9905
- GenericValidator.isValidCpf = function (control) {
9906
- var cpf = control.value;
9907
- if (cpf) {
9908
- var numbers = void 0, digits = void 0, sum = void 0, i = void 0, result = void 0, equalDigits = void 0;
9909
- equalDigits = 1;
9910
- if (cpf.length < 11) {
9911
- return null;
9912
- }
9913
- for (i = 0; i < cpf.length - 1; i++) {
9914
- if (cpf.charAt(i) !== cpf.charAt(i + 1)) {
9915
- equalDigits = 0;
9916
- break;
9917
- }
9918
- }
9919
- if (!equalDigits) {
9920
- numbers = cpf.substring(0, 9);
9921
- digits = cpf.substring(9);
9922
- sum = 0;
9923
- for (i = 10; i > 1; i--) {
9924
- sum += numbers.charAt(10 - i) * i;
9925
- }
9926
- result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9927
- if (result !== Number(digits.charAt(0))) {
9928
- return { cpfNotValid: true };
9929
- }
9930
- numbers = cpf.substring(0, 10);
9931
- sum = 0;
9932
- for (i = 11; i > 1; i--) {
9933
- sum += numbers.charAt(11 - i) * i;
9934
- }
9935
- result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9936
- if (result !== Number(digits.charAt(1))) {
9937
- return { cpfNotValid: true };
9938
- }
9939
- return null;
9940
- }
9941
- else {
9942
- return { cpfNotValid: true };
9943
- }
9944
- }
9945
- return null;
9946
- };
9947
- /**
9948
- * Valida se o CNPJ é valido. Deve-se ser informado o cpf sem máscara.
9949
- */
9950
- GenericValidator.isValidCnpj = function (control) {
9951
- var cnpj = control.value;
9952
- if (cnpj) {
9953
- var size = void 0, numbers = void 0, digits = void 0, sum = void 0, pos = void 0, result = void 0;
9954
- cnpj = cnpj.replace(/[^\d]+/g, '');
9955
- if (cnpj.length !== 14) {
9956
- return null;
9957
- }
9958
- // Elimina CNPJs invalidos conhecidos
9959
- if (cnpj === '00000000000000' ||
9960
- cnpj === '11111111111111' ||
9961
- cnpj === '22222222222222' ||
9962
- cnpj === '33333333333333' ||
9963
- cnpj === '44444444444444' ||
9964
- cnpj === '55555555555555' ||
9965
- cnpj === '66666666666666' ||
9966
- cnpj === '77777777777777' ||
9967
- cnpj === '88888888888888' ||
9968
- cnpj === '99999999999999') {
9969
- return { cnpjNotValid: true };
9970
- }
9971
- // Valida DVs
9972
- size = cnpj.length - 2;
9973
- numbers = cnpj.substring(0, size);
9974
- digits = cnpj.substring(size);
9975
- sum = 0;
9976
- pos = size - 7;
9977
- for (var i = size; i >= 1; i--) {
9978
- sum += numbers.charAt(size - i) * pos--;
9979
- if (pos < 2) {
9980
- pos = 9;
9981
- }
9982
- }
9983
- result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9984
- if (result !== Number(digits.charAt(0))) {
9985
- return { cnpjNotValid: true };
9986
- }
9987
- size = size + 1;
9988
- numbers = cnpj.substring(0, size);
9989
- sum = 0;
9990
- pos = size - 7;
9991
- for (var i = size; i >= 1; i--) {
9992
- sum += numbers.charAt(size - i) * pos--;
9993
- if (pos < 2) {
9994
- pos = 9;
9995
- }
9996
- }
9997
- result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9998
- if (result !== Number(digits.charAt(1))) {
9999
- return { cnpjNotValid: true };
10000
- }
10001
- return null;
10002
- }
10003
- return null;
10004
- };
10005
- /**
10006
- * Válida o número de telefone da chave PIX.
10007
- */
10008
- GenericValidator.isValidPhoneNumber = function (control) {
10009
- var cellPhoneKey = control.value || '';
10010
- cellPhoneKey = cellPhoneKey.replace(/[\s()-]/g, '');
10011
- var regexNumberTelephone = /^[1-9][\d]{1,2}\d{8,10}$/;
10012
- var isValidNumberTelephone = regexNumberTelephone.test(cellPhoneKey);
10013
- return isValidNumberTelephone ? null : { invalidPhoneNumber: true };
10014
- };
10015
- /**
10016
- * Valida o email da chave PIX.
10017
- */
10018
- GenericValidator.isValidEmail = function (control) {
10019
- var emailKey = control.value;
10020
- var regexValidEmail = /^[\w-\.]+@[\w-]+(\.[\w-]{2,4}){1,2}$/;
10021
- var isValidEmail = regexValidEmail.test(emailKey);
10022
- return isValidEmail ? null : { invalidEmail: true };
10023
- };
10024
- return GenericValidator;
10025
- }());
10026
-
10027
- var HistoricalPixAccountFormComponent = /** @class */ (function () {
10028
- function HistoricalPixAccountFormComponent(formBuilder, cd) {
10029
- this.formBuilder = formBuilder;
10030
- this.cd = cd;
10031
- this.withSideBar = true;
10032
- this.isEditMode = false;
10033
- this.paramsForm = new forms.FormGroup({});
10034
- this.defaultCpfNumber = null;
10035
- this.visibleChange = new core.EventEmitter();
10036
- this.pixAccountItemToList = new core.EventEmitter();
10037
- this.ngUnsubscribe = new rxjs.Subject();
10038
- this.initialValidatorOfPercentage = [forms.Validators.required, forms.Validators.min(0.01)];
10039
- this.labelBtnAdd = "hcm.payroll.employees_add";
10040
- this.maxValuePercentage = 100.00;
10041
- this.visibleBtnSave = true;
10042
- this.isView = false;
10043
- this.isShowPixKeyFieldValidatorMessage = false;
10044
- this.createFormGroup();
10045
- this.registerSubjects();
10046
- }
10047
- HistoricalPixAccountFormComponent.prototype.ngOnInit = function () {
10048
- };
10268
+ __decorate([
10269
+ core.Input()
10270
+ ], HistoricalPixAccountComponent.prototype, "addExistentHistoricData", void 0);
10271
+ __decorate([
10272
+ core.Input()
10273
+ ], HistoricalPixAccountComponent.prototype, "getListPixAccount", void 0);
10274
+ __decorate([
10275
+ core.Output()
10276
+ ], HistoricalPixAccountComponent.prototype, "isViewModeActive", void 0);
10277
+ __decorate([
10278
+ core.Output()
10279
+ ], HistoricalPixAccountComponent.prototype, "isEditModeActive", void 0);
10280
+ __decorate([
10281
+ core.Output()
10282
+ ], HistoricalPixAccountComponent.prototype, "isDeleteModeActive", void 0);
10283
+ __decorate([
10284
+ core.Input()
10285
+ ], HistoricalPixAccountComponent.prototype, "dateChange", null);
10286
+ __decorate([
10287
+ core.Input()
10288
+ ], HistoricalPixAccountComponent.prototype, "displayDateChange", null);
10289
+ __decorate([
10290
+ core.Input()
10291
+ ], HistoricalPixAccountComponent.prototype, "addListData", null);
10292
+ __decorate([
10293
+ core.Input()
10294
+ ], HistoricalPixAccountComponent.prototype, "visible", null);
10295
+ __decorate([
10296
+ core.Input()
10297
+ ], HistoricalPixAccountComponent.prototype, "paramsForm", null);
10298
+ __decorate([
10299
+ core.Input()
10300
+ ], HistoricalPixAccountComponent.prototype, "defaultCpfNumber", null);
10301
+ HistoricalPixAccountComponent = __decorate([
10302
+ core.Component({
10303
+ // tslint:disable-next-line:component-selector
10304
+ selector: "c-historical-pix-account",
10305
+ template: "<s-sidebar *ngIf=\"withSideBar\" [visible]=\"visible\" (visibleChange)=\"close()\"\n header=\"{{'hcm.payroll.historical_pix_account_title_form'|translate}}\">\n<pix-account [(visible)]=\"visible\"\n [isEditAndViewValue]=\"pixAccountItemInput\"\n [currency]=\"currency\"\n [customEntity]=\"customEntity\"\n [customService]=\"customService\"\n [getListPixAccount]=\"listDataNoPage\"\n [paramsForm]=\"paramsForm\"\n (pixAccountItemToList)=\"addItemInList($event)\"\n [defaultCpfNumber]=\"defaultCpfNumber\"></pix-account>\n</s-sidebar>\n\n<div *ngIf=\"!withSideBar\">\n <pix-account [(visible)]=\"visible\"\n [isEditAndViewValue]=\"pixAccountItemInput\"\n [currency]=\"currency\"\n [customEntity]=\"customEntity\"\n [customService]=\"customService\"\n [getListPixAccount]=\"listDataNoPage\"\n [withSideBar]=\"false\"\n [isViewMode]=\"isViewMode\"\n [paramsForm]=\"paramsForm\"\n (pixAccountItemToList)=\"addItemInList($event)\"\n [defaultCpfNumber]=\"defaultCpfNumber\"></pix-account>\n</div>\n\n<div class=\"ui-g-1\" *ngIf=\"withSideBar && !isEditMode\">\n <div class=\"form-group \">\n <s-button id=\"ta-addPayAnnuity\"\n [disabled]=\"getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage\"\n (onClick)=\"add()\"\n [pTooltip]=\"getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage\"\n tooltipPosition=\"top\"\n label=\"{{'hcm.payroll.historical_pix_account_add'|translate}}\"></s-button>\n </div>\n</div>\n<div *ngIf=\"!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<div *ngIf=\"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 id=\"btn-save\" label=\"Adicionar\" priority=\"primary\" (onClick)=\"addPix()\"></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\" [pSortableColumn]=\"col.orderBy\">\n {{ col.label }}\n <p-sortIcon *ngIf=\"col.orderBy\" [field]=\"col.orderBy\"></p-sortIcon>\n </th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-item let-rowIndex=\"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 [(ngModel)]=\"item.pixKeyType\"\n [formControl]=\"pixAccountFormGroup.get('pixKeyType')\"\n [dropdown]=\"true\"\n field=\"value\"\n placeholder=\"Selecione o tipo de chave\"\n appendTo=\"body\"\n [panelStyle]=\"{ maxWidth: '300px', width: '100%' }\"\n [inputStyle]=\"{ width: '100%' }\"\n >\n </p-autoComplete>\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 </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\" [pEditableColumn]=\"item.pixKey\" pEditableColumnField=\"pixKey\"\n [ngClass]=\"{'required': item.pixKeyType.key !== 'BANK_ACCOUNT'}\">\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <ng-container [ngSwitch]=\"item.pixKeyType.key\">\n <!-- TELEPHONE -->\n <input *ngSwitchCase=\"'TELEPHONE'\"\n only-number\n pInputText\n type=\"text\"\n [(ngModel)]=\"item.pixKey\"\n [formControl]=\"pixAccountFormGroup.get('pixKey')\"\n (keyup)=\"phoneMask($event)\"\n maxlength=\"15\"\n placeholder=\"(__) ____-____\"/>\n\n <!-- CPF -->\n <p-inputMask *ngSwitchCase=\"'CPF'\"\n [(ngModel)]=\"item.pixKey\"\n [formControl]=\"pixAccountFormGroup.get('pixKey')\"\n placeholder=\"___.___.___-__\"\n mask=\"999.999.999-99\"\n [unmask]=\"true\">\n </p-inputMask>\n\n <!-- CNPJ -->\n <p-inputMask *ngSwitchCase=\"'CNPJ'\"\n [(ngModel)]=\"item.pixKey\"\n [formControl]=\"pixAccountFormGroup.get('pixKey')\"\n placeholder=\"__.___.___/____-__\"\n mask=\"99.999.999/9999-99\"\n [unmask]=\"true\">\n </p-inputMask>\n\n <!-- EMAIL -->\n <input *ngSwitchCase=\"'EMAIL'\"\n pInputText\n type=\"email\"\n [(ngModel)]=\"item.pixKey\"\n [formControl]=\"pixAccountFormGroup.get('pixKey')\"\n placeholder=\"{{'hcm.payroll.employees_addition_email' | translate}}\"/>\n\n <!-- BANK_ACCOUNT -->\n <input *ngSwitchCase=\"'BANK_ACCOUNT'\"\n pInputText\n [(ngModel)]=\"item.pixKey\"\n [formControl]=\"pixAccountFormGroup.get('pixKey')\"\n [disabled]=\"true\"/>\n\n <!-- DEFAULT -->\n <input *ngSwitchDefault\n pInputText\n type=\"text\"\n [(ngModel)]=\"item.pixKey\"\n [formControl]=\"pixAccountFormGroup.get('pixKey')\"\n maxlength=\"100\"/>\n </ng-container>\n\n <!-- Error messages -->\n <s-control-errors *ngIf=\"isShowPixKeyFieldValidatorMessage\"\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 </ng-template>\n\n <ng-template pTemplate=\"output\">\n {{ item.pixKey }}\n </ng-template>\n </p-cellEditor>\n </td>\n\n\n <!-- Percentual -->\n <td class=\"ui-md-6 ui-sm-12 required\" [pEditableColumn]=\"item.percentage\" pEditableColumnField=\"percentage\">\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <input pInputText type=\"number\" [(ngModel)]=\"item.percentage\" [formControl]=\"pixAccountFormGroup.get('percentage')\">\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 </ng-template>\n <ng-template pTemplate=\"output\">\n {{ item.percentage }}%\n </ng-template>\n </p-cellEditor>\n </td>\n\n <!-- Bot\u00E3o de excluir -->\n <td>\n <s-button id=\"btn-delete\" label=\"Excluir\" priority=\"default\" (onClick)=\"deletePix(rowIndex)\"></s-button>\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n",
10306
+ 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}"]
10307
+ })
10308
+ ], HistoricalPixAccountComponent);
10309
+ return HistoricalPixAccountComponent;
10310
+ }(HistoricakPixAccountBase));
10311
+
10312
+ var HistoricalPixAccountFormComponent = /** @class */ (function (_super) {
10313
+ __extends(HistoricalPixAccountFormComponent, _super);
10314
+ function HistoricalPixAccountFormComponent(formBuilder, cd, sharedStateService) {
10315
+ var _this = _super.call(this, formBuilder) || this;
10316
+ _this.cd = cd;
10317
+ _this.sharedStateService = sharedStateService;
10318
+ _this.withSideBar = true;
10319
+ _this.isEditMode = false;
10320
+ _this.visibleChange = new core.EventEmitter();
10321
+ _this.pixAccountItemToList = new core.EventEmitter();
10322
+ _this.ngUnsubscribe = new rxjs.Subject();
10323
+ _this.labelBtnAdd = "hcm.payroll.employees_add";
10324
+ _this.visibleBtnSave = true;
10325
+ _this.isView = false;
10326
+ _this.isShowPixKeyFieldValidatorMessage = false;
10327
+ _this.hideFields = _this.sharedStateService.hideField$;
10328
+ _this.registerSubjects();
10329
+ return _this;
10330
+ }
10331
+ HistoricalPixAccountFormComponent.prototype.ngOnInit = function () { };
10049
10332
  HistoricalPixAccountFormComponent.prototype.ngAfterViewInit = function () {
10050
10333
  this.cd.detectChanges();
10051
10334
  };
@@ -10053,38 +10336,7 @@
10053
10336
  this.ngUnsubscribe.next(true);
10054
10337
  this.ngUnsubscribe.unsubscribe();
10055
10338
  };
10056
- HistoricalPixAccountFormComponent.prototype.registerSubjects = function () {
10057
- };
10058
- HistoricalPixAccountFormComponent.prototype.createFormGroup = function () {
10059
- this.pixAccountFormGroup = this.formBuilder.group({
10060
- id: this.formBuilder.control(null),
10061
- index: this.formBuilder.control(null),
10062
- employee: this.formBuilder.control({ value: { tableId: null }, disabled: true }),
10063
- dateChange: this.formBuilder.control(null),
10064
- pixKeyType: this.formBuilder.control(null, forms.Validators.required),
10065
- pixKey: this.formBuilder.control(null),
10066
- percentage: this.formBuilder.control(null, forms.Validators.compose(__spread(this.initialValidatorOfPercentage, [
10067
- forms.Validators.max(this.maxValuePercentage),
10068
- ]))),
10069
- externalId: this.formBuilder.control(null),
10070
- customFields: this.formBuilder.control(null),
10071
- });
10072
- };
10073
- HistoricalPixAccountFormComponent.prototype.onChangePixKeyType = function (item) {
10074
- if (item.key) {
10075
- this.pixKeyType = item.key;
10076
- this.isShowPixKeyFieldValidatorMessage = true;
10077
- this.pixAccountFormGroup.get("pixKey").reset();
10078
- this.setPixKeyValidators(true);
10079
- if (item.key === "CPF") {
10080
- this.setDefaultCpfPixKey();
10081
- }
10082
- }
10083
- };
10084
- HistoricalPixAccountFormComponent.prototype.onClearPixKeyType = function () {
10085
- this.isShowPixKeyFieldValidatorMessage = false;
10086
- this.pixAccountFormGroup.get("pixKey").reset();
10087
- };
10339
+ HistoricalPixAccountFormComponent.prototype.registerSubjects = function () { };
10088
10340
  Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "visible", {
10089
10341
  get: function () {
10090
10342
  return this._visible;
@@ -10123,7 +10375,8 @@
10123
10375
  });
10124
10376
  HistoricalPixAccountFormComponent.prototype.formatPixKeyTelephoneNumber = function () {
10125
10377
  if (this.pixKeyType === "TELEPHONE") {
10126
- this.pixAccountFormGroup.get("pixKey").setValue(FormatUtilsService.getFormattedTelephoneNumber(this.pixAccountFormGroup.get("pixKey").value));
10378
+ var pixKeyCtrl = this.pixAccountFormGroup.get("pixKey");
10379
+ pixKeyCtrl.setValue(FormatUtilsService.getFormattedTelephoneNumber(pixKeyCtrl.value));
10127
10380
  }
10128
10381
  };
10129
10382
  HistoricalPixAccountFormComponent.prototype.convertDTOToShowWithCustomFields = function (data) {
@@ -10142,7 +10395,7 @@
10142
10395
  "pixKeyType",
10143
10396
  "pixKey",
10144
10397
  "percentage",
10145
- "customFields",
10398
+ "customFields"
10146
10399
  ], []);
10147
10400
  };
10148
10401
  HistoricalPixAccountFormComponent.prototype.close = function () {
@@ -10156,7 +10409,7 @@
10156
10409
  if (this.employeeId) {
10157
10410
  this.pixAccountFormGroup.get("employee").setValue({
10158
10411
  tableId: this.employeeId,
10159
- name: "",
10412
+ name: ""
10160
10413
  });
10161
10414
  }
10162
10415
  this.pixAccountItemToList.emit(this.pixAccountFormGroup.getRawValue());
@@ -10188,14 +10441,10 @@
10188
10441
  return {
10189
10442
  prefix: "",
10190
10443
  thousands: this.currency.thousandsSeparator,
10191
- decimal: this.currency.decimalSeparator,
10444
+ decimal: this.currency.decimalSeparator
10192
10445
  };
10193
10446
  };
10194
10447
  Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "getListPixAccount", {
10195
- /**
10196
- * O Input que recebe a lista do component pai e chama o método de validação passando a lista recebida.
10197
- * @param pixAccountList
10198
- */
10199
10448
  set: function (pixAccountList) {
10200
10449
  if (pixAccountList) {
10201
10450
  this.setValidatorsAccordingList(pixAccountList, null, false);
@@ -10207,85 +10456,6 @@
10207
10456
  enumerable: true,
10208
10457
  configurable: true
10209
10458
  });
10210
- /**
10211
- * Recebe a lista de registros já inseridos na tabela adiciona em uma variável os valores que serão usados para
10212
- * a validação dos campos "percentage" e "pixAccount".
10213
- * 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
10214
- * no array de comparação dos validators.
10215
- * @param pixAccountList
10216
- * @param index
10217
- */
10218
- HistoricalPixAccountFormComponent.prototype.setValidatorsAccordingList = function (pixAccountList, index, isEditMode) {
10219
- if (index === void 0) { index = null; }
10220
- if (isEditMode === void 0) { isEditMode = true; }
10221
- this.pixAccountList = pixAccountList && pixAccountList.length ? __spread(pixAccountList) : [];
10222
- var percentageIncluded = [];
10223
- if (this.pixAccountList && this.pixAccountList.length) {
10224
- this.pixAccountList.filter(function (field, key) {
10225
- if (field["percentage"] && key != index) {
10226
- percentageIncluded.push(field["percentage"]);
10227
- }
10228
- });
10229
- }
10230
- this.beforeSetPixKeyTypeValidator();
10231
- this.setPixKeyValidators(isEditMode);
10232
- this.validatePercentageValid(percentageIncluded);
10233
- };
10234
- /**
10235
- * Antes de setar o validator prepara as variáveis necessária para que seja feita a validação do campo.
10236
- */
10237
- HistoricalPixAccountFormComponent.prototype.setPixKeyValidators = function (isEditMode) {
10238
- var genericPixKey = this.pixAccountFormGroup.get("pixKey");
10239
- if (this.pixKeyType) {
10240
- switch (this.pixKeyType) {
10241
- case "TELEPHONE":
10242
- genericPixKey.setValidators(forms.Validators.compose([
10243
- forms.Validators.required, GenericValidator.isValidPhoneNumber,
10244
- ]));
10245
- break;
10246
- case "EMAIL":
10247
- genericPixKey.setValidators(forms.Validators.compose([
10248
- forms.Validators.required, GenericValidator.isValidEmail,
10249
- ]));
10250
- break;
10251
- case "CPF":
10252
- genericPixKey.setValidators(forms.Validators.compose([
10253
- forms.Validators.required, GenericValidator.isValidCpf,
10254
- ]));
10255
- break;
10256
- case "CNPJ":
10257
- genericPixKey.setValidators(forms.Validators.compose([
10258
- forms.Validators.required, GenericValidator.isValidCnpj,
10259
- ]));
10260
- break;
10261
- case "RANDOM_KEY":
10262
- genericPixKey.setValidators(forms.Validators.required);
10263
- break;
10264
- default:
10265
- genericPixKey.setValidators(null);
10266
- break;
10267
- }
10268
- if (isEditMode) {
10269
- genericPixKey.enable();
10270
- }
10271
- genericPixKey.updateValueAndValidity();
10272
- }
10273
- };
10274
- /**
10275
- * Este método calcula as parcentagens que já foram inseridas, e seta a diferença para chegar em
10276
- * 100% na validação do campo "percentage" como um novo maxValue;
10277
- * @param listValue
10278
- */
10279
- HistoricalPixAccountFormComponent.prototype.validatePercentageValid = function (listValue) {
10280
- var percentage = this.pixAccountFormGroup.get("percentage");
10281
- this.maxValuePercentage = listValue
10282
- .reduce(function (currentValue, total) { return currentValue - total; }, 100.00);
10283
- percentage
10284
- .setValidators(forms.Validators.compose(__spread(this.initialValidatorOfPercentage, [
10285
- forms.Validators.max(this.maxValuePercentage),
10286
- ])));
10287
- percentage.updateValueAndValidity();
10288
- };
10289
10459
  Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "isViewMode", {
10290
10460
  set: function (condition) {
10291
10461
  this.isView = !!(condition && !this.withSideBar);
@@ -10296,58 +10466,24 @@
10296
10466
  enumerable: true,
10297
10467
  configurable: true
10298
10468
  });
10299
- HistoricalPixAccountFormComponent.prototype.phoneMask = function (event) {
10300
- FormatUtilsService.formatTelephoneInputEvent(event);
10301
- };
10302
- HistoricalPixAccountFormComponent.prototype.setDefaultCpfPixKey = function () {
10303
- if (this.defaultCpfNumber) {
10304
- this.pixAccountFormGroup.get("pixKey").setValue(this.defaultCpfNumber);
10305
- }
10306
- else {
10307
- var sheetDocument = this.paramsForm.get("sheetDocument");
10308
- if (sheetDocument) {
10309
- var cpf = sheetDocument.get("cpfNumber").value;
10310
- if (cpf) {
10311
- this.pixAccountFormGroup.get("pixKey").setValue(cpf);
10312
- }
10313
- }
10314
- }
10315
- };
10316
- HistoricalPixAccountFormComponent.prototype.beforeSetPixKeyTypeValidator = function () {
10317
- var pixKeyType = this.pixAccountFormGroup.get("pixKeyType");
10318
- if (this.pixAccountList && this.pixAccountList.length && pixKeyType) {
10319
- pixKeyType
10320
- .setValidators(forms.Validators.compose([
10321
- forms.Validators.required,
10322
- this.validateDuplicatePixKeyTypeBankAccount(this.pixAccountList),
10323
- ]));
10324
- }
10325
- else {
10326
- pixKeyType.setValidators(forms.Validators.required);
10327
- }
10328
- };
10329
- HistoricalPixAccountFormComponent.prototype.validateDuplicatePixKeyTypeBankAccount = function (listCompare) {
10330
- return function (control) {
10331
- var value = control && control.value;
10332
- var condition = false;
10333
- listCompare.filter(function (field) {
10334
- if (value) {
10335
- if (field["pixKeyType"].key === 'BANK_ACCOUNT' && value.key === field["pixKeyType"].key) {
10336
- return condition = true;
10337
- }
10338
- }
10339
- });
10340
- if (condition) {
10341
- return { pixKeyTypeBankAccountDuplicate: true };
10342
- }
10343
- else {
10344
- return null;
10345
- }
10346
- };
10347
- };
10469
+ Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "paramsForm", {
10470
+ set: function (value) {
10471
+ this._paramsForm = value;
10472
+ },
10473
+ enumerable: true,
10474
+ configurable: true
10475
+ });
10476
+ Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "defaultCpfNumber", {
10477
+ set: function (value) {
10478
+ this._defaultCpfNumber = value;
10479
+ },
10480
+ enumerable: true,
10481
+ configurable: true
10482
+ });
10348
10483
  HistoricalPixAccountFormComponent.ctorParameters = function () { return [
10349
10484
  { type: forms.FormBuilder },
10350
- { type: core.ChangeDetectorRef }
10485
+ { type: core.ChangeDetectorRef },
10486
+ { type: SharedStateService }
10351
10487
  ]; };
10352
10488
  __decorate([
10353
10489
  core.ViewChild(angularComponents.CustomFieldsComponent, { static: true })
@@ -10367,12 +10503,6 @@
10367
10503
  __decorate([
10368
10504
  core.Input()
10369
10505
  ], HistoricalPixAccountFormComponent.prototype, "isEditMode", void 0);
10370
- __decorate([
10371
- core.Input()
10372
- ], HistoricalPixAccountFormComponent.prototype, "paramsForm", void 0);
10373
- __decorate([
10374
- core.Input()
10375
- ], HistoricalPixAccountFormComponent.prototype, "defaultCpfNumber", void 0);
10376
10506
  __decorate([
10377
10507
  core.Output()
10378
10508
  ], HistoricalPixAccountFormComponent.prototype, "visibleChange", void 0);
@@ -10391,32 +10521,21 @@
10391
10521
  __decorate([
10392
10522
  core.Input()
10393
10523
  ], HistoricalPixAccountFormComponent.prototype, "isViewMode", null);
10524
+ __decorate([
10525
+ core.Input()
10526
+ ], HistoricalPixAccountFormComponent.prototype, "paramsForm", null);
10527
+ __decorate([
10528
+ core.Input()
10529
+ ], HistoricalPixAccountFormComponent.prototype, "defaultCpfNumber", null);
10394
10530
  HistoricalPixAccountFormComponent = __decorate([
10395
10531
  core.Component({
10396
10532
  selector: "pix-account",
10397
- 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",
10533
+ template: "<div id=\"main\">\n <form *ngIf=\"!(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",
10398
10534
  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}"]
10399
10535
  })
10400
10536
  ], HistoricalPixAccountFormComponent);
10401
10537
  return HistoricalPixAccountFormComponent;
10402
- }());
10403
-
10404
- var HistoricalPixAccountService = /** @class */ (function () {
10405
- function HistoricalPixAccountService(http) {
10406
- this.http = http;
10407
- }
10408
- HistoricalPixAccountService.prototype.query = function (path, body, service) {
10409
- if (service === void 0) { service = exports.ServiceType.PAYROLL; }
10410
- return this.http.query(path, body, service);
10411
- };
10412
- HistoricalPixAccountService.ctorParameters = function () { return [
10413
- { type: HttpClientService }
10414
- ]; };
10415
- HistoricalPixAccountService = __decorate([
10416
- core.Injectable()
10417
- ], HistoricalPixAccountService);
10418
- return HistoricalPixAccountService;
10419
- }());
10538
+ }(HistoricakPixAccountBase));
10420
10539
 
10421
10540
  var HistoricalPixAccountModule = /** @class */ (function () {
10422
10541
  function HistoricalPixAccountModule() {
@@ -10446,6 +10565,8 @@
10446
10565
  angularComponents.CustomFieldsModule,
10447
10566
  panel.PanelModule,
10448
10567
  inputmask.InputMaskModule,
10568
+ dropdown.DropdownModule,
10569
+ tabview.TabViewModule,
10449
10570
  ],
10450
10571
  declarations: [HistoricalPixAccountComponent, HistoricalPixAccountFormComponent],
10451
10572
  providers: [HistoricalPixAccountService, api.ConfirmationService],
@@ -10488,7 +10609,7 @@
10488
10609
 
10489
10610
  var moment$e = moment_;
10490
10611
  var HistoricalPixAccountListComponent = /** @class */ (function () {
10491
- function HistoricalPixAccountListComponent(confirmationService, translateService, activatedRoute, cd, router, messageService, historicalPixAccountListService) {
10612
+ function HistoricalPixAccountListComponent(confirmationService, translateService, activatedRoute, cd, router, messageService, historicalPixAccountListService, sharedStateService) {
10492
10613
  this.confirmationService = confirmationService;
10493
10614
  this.translateService = translateService;
10494
10615
  this.activatedRoute = activatedRoute;
@@ -10496,11 +10617,14 @@
10496
10617
  this.router = router;
10497
10618
  this.messageService = messageService;
10498
10619
  this.historicalPixAccountListService = historicalPixAccountListService;
10620
+ this.sharedStateService = sharedStateService;
10499
10621
  this.endPoint = "hcm/payroll/queries/historicalEmployeePixQuery";
10500
10622
  this.keyPayload = "historicalEmployeePix";
10501
10623
  this.withSidebar = true;
10502
10624
  this.isOnlyView = new core.EventEmitter();
10625
+ this.isOnlyEdit = new core.EventEmitter();
10503
10626
  this.enableView = new core.EventEmitter();
10627
+ this.isEditJudicialDependentPix = new core.EventEmitter();
10504
10628
  this.ngUnsubscribe = new rxjs.Subject();
10505
10629
  this.loading = true;
10506
10630
  this.columns = [
@@ -10508,18 +10632,6 @@
10508
10632
  label: this.translateService.instant("hcm.payroll.historical_pix_account_label_date_change"),
10509
10633
  field: "dateChange",
10510
10634
  },
10511
- {
10512
- label: this.translateService.instant("hcm.payroll.historical_pix_account_label_pix_key_type"),
10513
- field: "pixKeyType.value",
10514
- },
10515
- {
10516
- label: this.translateService.instant("hcm.payroll.historical_pix_account_label_pix_key"),
10517
- field: "pixKey",
10518
- },
10519
- {
10520
- label: this.translateService.instant("hcm.payroll.historical_pix_account_label_percentage"),
10521
- field: "percentage",
10522
- },
10523
10635
  {
10524
10636
  label: this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_label_qtd_account"),
10525
10637
  field: "numberOfPixAccount",
@@ -10532,6 +10644,7 @@
10532
10644
  HistoricalPixAccountListComponent.prototype.ngOnDestroy = function () {
10533
10645
  this.ngUnsubscribe.next();
10534
10646
  this.ngUnsubscribe.complete();
10647
+ this.unsubscribe();
10535
10648
  };
10536
10649
  HistoricalPixAccountListComponent.prototype.ngAfterViewInit = function () {
10537
10650
  this.cd.detectChanges();
@@ -10540,27 +10653,10 @@
10540
10653
  var _this = this;
10541
10654
  payload.forEach(function (value) {
10542
10655
  value.dateChange = moment$e(value.dateChange).format(_this.dateFormat);
10543
- value.pixKey = _this.formatPixKeyByType(value.pixKeyType, value.pixKey);
10544
- value.percentage = FormatUtilsService.getFormattedPercentage(value.percentage);
10545
10656
  });
10546
10657
  this.onGridLoad(payload);
10547
10658
  this.loading = false;
10548
10659
  };
10549
- HistoricalPixAccountListComponent.prototype.formatPixKeyByType = function (pixKeyType, pixKey) {
10550
- var keyType = pixKeyType ? pixKeyType.key.toUpperCase() : "";
10551
- if (keyType === "TELEPHONE") {
10552
- return FormatUtilsService.getFormattedTelephoneNumber(pixKey);
10553
- }
10554
- else if (keyType === "CPF") {
10555
- return FormatUtilsService.getFormattedCpf(pixKey);
10556
- }
10557
- else if (keyType === "CNPJ") {
10558
- return FormatUtilsService.getFormattedCnpj(pixKey);
10559
- }
10560
- else {
10561
- return pixKey;
10562
- }
10563
- };
10564
10660
  HistoricalPixAccountListComponent.prototype.getMenuActions = function (rowData) {
10565
10661
  var _this = this;
10566
10662
  return [
@@ -10568,6 +10664,9 @@
10568
10664
  label: this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
10569
10665
  command: function () {
10570
10666
  if (_this.isAllowToViewHistorical) {
10667
+ _this.sharedStateService.setHideField(true);
10668
+ _this.sharedStateService.setShowButton(false);
10669
+ _this.sharedStateService.setShowEditMode(false);
10571
10670
  var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
10572
10671
  if (_this.withSidebar) {
10573
10672
  _this.isOnlyView.emit(true);
@@ -10576,6 +10675,30 @@
10576
10675
  });
10577
10676
  }
10578
10677
  else {
10678
+ _this.sharedStateService.setSaveButton(false);
10679
+ _this.enableView.emit(dateChange);
10680
+ }
10681
+ }
10682
+ else {
10683
+ _this.isNotAllowMessage();
10684
+ }
10685
+ },
10686
+ },
10687
+ {
10688
+ label: this.translateService.instant("hcm.payroll.edit"),
10689
+ command: function () {
10690
+ if (_this.isAllowToEditHistorical) {
10691
+ _this.sharedStateService.setHideField(true);
10692
+ _this.sharedStateService.setShowButton(false);
10693
+ _this.sharedStateService.setShowEditMode(true);
10694
+ var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
10695
+ if (_this.withSidebar) {
10696
+ _this.router.navigate(["historical-pix-account/" + dateChange], {
10697
+ relativeTo: _this.activatedRoute,
10698
+ });
10699
+ }
10700
+ else {
10701
+ _this.sharedStateService.setSaveButton(true);
10579
10702
  _this.enableView.emit(dateChange);
10580
10703
  }
10581
10704
  }
@@ -10594,7 +10717,7 @@
10594
10717
  _this.isNotAllowMessage();
10595
10718
  }
10596
10719
  },
10597
- },
10720
+ }
10598
10721
  ];
10599
10722
  };
10600
10723
  HistoricalPixAccountListComponent.prototype.delete = function (id, dateChange) {
@@ -10661,6 +10784,24 @@
10661
10784
  this.lastRecord = payload[0];
10662
10785
  }
10663
10786
  };
10787
+ HistoricalPixAccountListComponent.prototype.unsubscribe = function () {
10788
+ if (this._subscription) {
10789
+ this._subscription.unsubscribe();
10790
+ }
10791
+ };
10792
+ Object.defineProperty(HistoricalPixAccountListComponent.prototype, "hideFieldsOnAdd$", {
10793
+ set: function (subject) {
10794
+ var _this = this;
10795
+ this.unsubscribe();
10796
+ if (subject) {
10797
+ this._subscription = subject.subscribe(function (value) {
10798
+ _this.sharedStateService.setHideField(value);
10799
+ });
10800
+ }
10801
+ },
10802
+ enumerable: true,
10803
+ configurable: true
10804
+ });
10664
10805
  Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToAddHistorical", {
10665
10806
  get: function () {
10666
10807
  return (this.permission["incluir"]);
@@ -10682,6 +10823,13 @@
10682
10823
  enumerable: true,
10683
10824
  configurable: true
10684
10825
  });
10826
+ Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToEditHistorical", {
10827
+ get: function () {
10828
+ return (this.permission["editar"]);
10829
+ },
10830
+ enumerable: true,
10831
+ configurable: true
10832
+ });
10685
10833
  Object.defineProperty(HistoricalPixAccountListComponent.prototype, "scopedActions", {
10686
10834
  get: function () {
10687
10835
  return this.getMenuActions.bind(this);
@@ -10706,7 +10854,8 @@
10706
10854
  { type: core.ChangeDetectorRef },
10707
10855
  { type: router.Router },
10708
10856
  { type: api.MessageService },
10709
- { type: HistoricalPixAccountListService }
10857
+ { type: HistoricalPixAccountListService },
10858
+ { type: SharedStateService }
10710
10859
  ]; };
10711
10860
  __decorate([
10712
10861
  core.ViewChild(angularComponents.CustomFieldsComponent, { static: false })
@@ -10732,12 +10881,24 @@
10732
10881
  __decorate([
10733
10882
  core.Input()
10734
10883
  ], HistoricalPixAccountListComponent.prototype, "withSidebar", void 0);
10884
+ __decorate([
10885
+ core.Input()
10886
+ ], HistoricalPixAccountListComponent.prototype, "hideField", void 0);
10735
10887
  __decorate([
10736
10888
  core.Output()
10737
10889
  ], HistoricalPixAccountListComponent.prototype, "isOnlyView", void 0);
10890
+ __decorate([
10891
+ core.Output()
10892
+ ], HistoricalPixAccountListComponent.prototype, "isOnlyEdit", void 0);
10738
10893
  __decorate([
10739
10894
  core.Output()
10740
10895
  ], HistoricalPixAccountListComponent.prototype, "enableView", void 0);
10896
+ __decorate([
10897
+ core.Output()
10898
+ ], HistoricalPixAccountListComponent.prototype, "isEditJudicialDependentPix", void 0);
10899
+ __decorate([
10900
+ core.Input()
10901
+ ], HistoricalPixAccountListComponent.prototype, "hideFieldsOnAdd$", null);
10741
10902
  __decorate([
10742
10903
  core.Input()
10743
10904
  ], HistoricalPixAccountListComponent.prototype, "reloadList", null);
@@ -10860,6 +11021,7 @@
10860
11021
  exports.PermissionService = PermissionService;
10861
11022
  exports.ReportService = ReportService;
10862
11023
  exports.ServicesModule = ServicesModule;
11024
+ exports.SharedStateService = SharedStateService;
10863
11025
  exports.SpinnerLoaderComponent = SpinnerLoaderComponent;
10864
11026
  exports.SpinnerLoaderModule = SpinnerLoaderModule;
10865
11027
  exports.StringMethods = StringMethods;
@@ -10955,7 +11117,8 @@
10955
11117
  exports.ɵo = AutocompleteService;
10956
11118
  exports.ɵp = LookupService$1;
10957
11119
  exports.ɵq = HistoricalBankAccountFormComponent;
10958
- exports.ɵr = HistoricalPixAccountFormComponent;
11120
+ exports.ɵr = HistoricakPixAccountBase;
11121
+ exports.ɵs = HistoricalPixAccountFormComponent;
10959
11122
 
10960
11123
  Object.defineProperty(exports, '__esModule', { value: true });
10961
11124