@senior-gestao-pessoas/payroll-core 9.5.0-3888ac21-edb9-4553-82f4-3a69943e1d42 → 9.5.0-77209b41-a4ab-43cd-89d7-40623b664fa9

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 (25) hide show
  1. package/bundles/senior-gestao-pessoas-payroll-core.umd.js +480 -77
  2. package/bundles/senior-gestao-pessoas-payroll-core.umd.js.map +1 -1
  3. package/bundles/senior-gestao-pessoas-payroll-core.umd.min.js +2 -2
  4. package/bundles/senior-gestao-pessoas-payroll-core.umd.min.js.map +1 -1
  5. package/components/historical-pix-account/historical-pix-account.component.d.ts +67 -9
  6. package/components/historical-pix-account-list/historical-pix-account-list.component.d.ts +1 -0
  7. package/components/shared/shared-state.service.d.ts +4 -0
  8. package/esm2015/components/historical-pix-account/historical-pix-account-base.js +9 -2
  9. package/esm2015/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.js +1 -1
  10. package/esm2015/components/historical-pix-account/historical-pix-account.component.js +446 -77
  11. package/esm2015/components/historical-pix-account-list/historical-pix-account-list.component.js +9 -1
  12. package/esm2015/components/shared/shared-state.service.js +9 -1
  13. package/esm2015/components/utils/format-utils/format-utils.service.js +3 -1
  14. package/esm5/components/historical-pix-account/historical-pix-account-base.js +9 -2
  15. package/esm5/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.js +1 -1
  16. package/esm5/components/historical-pix-account/historical-pix-account.component.js +456 -77
  17. package/esm5/components/historical-pix-account-list/historical-pix-account-list.component.js +9 -1
  18. package/esm5/components/shared/shared-state.service.js +9 -1
  19. package/esm5/components/utils/format-utils/format-utils.service.js +3 -1
  20. package/fesm2015/senior-gestao-pessoas-payroll-core.js +470 -77
  21. package/fesm2015/senior-gestao-pessoas-payroll-core.js.map +1 -1
  22. package/fesm5/senior-gestao-pessoas-payroll-core.js +480 -77
  23. package/fesm5/senior-gestao-pessoas-payroll-core.js.map +1 -1
  24. package/package.json +1 -1
  25. package/senior-gestao-pessoas-payroll-core.metadata.json +1 -1
@@ -8585,6 +8585,7 @@ class FormatUtilsService {
8585
8585
  */
8586
8586
  static formatCpfInputEvent(event) {
8587
8587
  let cpf = event.target.value;
8588
+ console.log("FormatUtilsService.formatCpfInputEvent.cpf: " + cpf);
8588
8589
  // Permite apagar nos pontos sensíveis
8589
8590
  if (event.keyCode === 8 && (cpf.length === 4 || cpf.length === 8 || cpf.length === 12)) {
8590
8591
  return;
@@ -8597,6 +8598,7 @@ class FormatUtilsService {
8597
8598
  */
8598
8599
  static formatCnpjInputEvent(event) {
8599
8600
  let cnpj = event.target.value;
8601
+ console.log("FormatUtilsService.formatCnpjInputEvent.cnpj: " + cnpj);
8600
8602
  // Permite apagar nos pontos sensíveis
8601
8603
  if (event.keyCode === 8 && (cnpj.length === 3 || cnpj.length === 7 || cnpj.length === 11 || cnpj.length === 16)) {
8602
8604
  return;
@@ -8619,6 +8621,8 @@ let SharedStateService = class SharedStateService {
8619
8621
  this.activeValidatorsOnEditModalOpen$ = this.activeValidatorsOnEditModalOpen.asObservable();
8620
8622
  this.hideBtnAddForViewMode = new BehaviorSubject(false);
8621
8623
  this.hideBtnAddForViewMode$ = this.hideBtnAddForViewMode.asObservable();
8624
+ this.activeHideOptionsOnView = new BehaviorSubject(true);
8625
+ this.activeHideOptionsOnView$ = this.activeHideOptionsOnView.asObservable();
8622
8626
  }
8623
8627
  setHideField(value) {
8624
8628
  this.hideFieldSubject.next(value);
@@ -8641,6 +8645,12 @@ let SharedStateService = class SharedStateService {
8641
8645
  resetHideField() {
8642
8646
  this.hideFieldSubject.next(true);
8643
8647
  }
8648
+ setActiveHideOptionsOnView(value) {
8649
+ this.activeHideOptionsOnView.next(value);
8650
+ }
8651
+ getActiveHideOptionsOnView() {
8652
+ return this.activeHideOptionsOnView.getValue();
8653
+ }
8644
8654
  };
8645
8655
  SharedStateService.ngInjectableDef = ɵɵdefineInjectable({ factory: function SharedStateService_Factory() { return new SharedStateService(); }, token: SharedStateService, providedIn: "root" });
8646
8656
  SharedStateService = __decorate([
@@ -8943,10 +8953,17 @@ class HistoricakPixAccountBase {
8943
8953
  case "RANDOM_KEY":
8944
8954
  pixKey.setValidators(Validators.required);
8945
8955
  break;
8956
+ case "BANK_ACCOUNT":
8957
+ pixKey.clearValidators();
8958
+ pixKey.setValue('');
8959
+ break;
8946
8960
  default:
8947
8961
  pixKey.clearValidators();
8948
8962
  }
8949
- if (isEditMode) {
8963
+ if (this.pixKeyType === "BANK_ACCOUNT") {
8964
+ pixKey.disable();
8965
+ }
8966
+ else if (isEditMode) {
8950
8967
  pixKey.enable();
8951
8968
  }
8952
8969
  pixKey.updateValueAndValidity();
@@ -9046,6 +9063,7 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9046
9063
  this.hideFields = this.sharedStateService.hideField$;
9047
9064
  this.suggestions = [];
9048
9065
  this.formGroupByRow = {};
9066
+ this.isSyncingPercentage = false;
9049
9067
  this.cols = [
9050
9068
  {
9051
9069
  label: this.translateService.instant("hcm.payroll.employees_addition_pix_key_type"),
@@ -9127,6 +9145,11 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9127
9145
  this.showEditMode = value;
9128
9146
  this.isEditModeForSave = value;
9129
9147
  });
9148
+ this.sharedStateService.activeHideOptionsOnView$.subscribe((value) => {
9149
+ if (value) {
9150
+ this.showButtonView = false;
9151
+ }
9152
+ });
9130
9153
  this.sharedStateService.activeValidatorsOnEditModalOpen$
9131
9154
  .subscribe(() => {
9132
9155
  Object.values(this.formGroupByRow).forEach(fg => {
@@ -9137,6 +9160,7 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9137
9160
  });
9138
9161
  this.emitFormValidity();
9139
9162
  });
9163
+ this.resetFormState();
9140
9164
  }
9141
9165
  ngOnChanges(changes) {
9142
9166
  if (changes['listDataReciever'] && changes['listDataReciever'].currentValue) {
@@ -9167,9 +9191,31 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9167
9191
  this.cd.detectChanges();
9168
9192
  }
9169
9193
  emitFormValidity() {
9170
- const allValid = Object.values(this.formGroupByRow).every(fg => {
9194
+ if (!this.formGroupByRow || Object.keys(this.formGroupByRow).length === 0) {
9195
+ this.isValidChangeForm.emit(false);
9196
+ return;
9197
+ }
9198
+ let allValid = true;
9199
+ Object.values(this.formGroupByRow).forEach(fg => {
9200
+ // Verifica cada controle individualmente
9201
+ Object.keys(fg.controls).forEach(key => {
9202
+ const control = fg.get(key);
9203
+ // Verifica se o controle é obrigatório e está vazio
9204
+ if (control.validator && control.validator({})) {
9205
+ const validatorFn = control.validator({});
9206
+ if (validatorFn && validatorFn.required && !control.value) {
9207
+ allValid = false;
9208
+ }
9209
+ }
9210
+ // Verifica se o controle tem erros
9211
+ if (control.errors) {
9212
+ allValid = false;
9213
+ }
9214
+ });
9171
9215
  fg.updateValueAndValidity();
9172
- return fg.valid;
9216
+ if (!fg.valid) {
9217
+ allValid = false;
9218
+ }
9173
9219
  });
9174
9220
  this.isValidChangeForm.emit(allValid);
9175
9221
  }
@@ -9193,61 +9239,22 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9193
9239
  percentage: [0, Validators.compose([
9194
9240
  ...this.initialValidatorOfPercentage,
9195
9241
  Validators.max(this.maxValuePercentage),
9196
- ])]
9242
+ ])],
9243
+ externalId: [null],
9197
9244
  });
9198
9245
  }
9199
- onPixKeyInput(event, index) {
9200
- const inputValue = event.target.value;
9201
- const inputRawValue = inputValue.replace(/\D/g, '');
9202
- const form = this.formGroupByRow[index];
9203
- const pixKeyControl = form.get('pixKey');
9204
- if (pixKeyControl) {
9205
- pixKeyControl.setValue(inputRawValue, { emitEvent: false });
9206
- pixKeyControl.markAsDirty();
9207
- pixKeyControl.updateValueAndValidity();
9208
- }
9209
- this.setPixKeyValidators(true, form);
9210
- this.emitFormValidity();
9211
- }
9212
- onBlurPixCpfAndCnpj(index) {
9213
- const form = this.formGroupByRow[index];
9214
- const pixKeyControl = form.get('pixKey');
9215
- const pixKeyTypeControl = form.get('pixKeyType');
9216
- if (!pixKeyControl || !pixKeyTypeControl)
9217
- return;
9218
- const currentValue = pixKeyControl.value;
9219
- const pixKeyType = pixKeyTypeControl.value.key;
9220
- const rawValue = (currentValue || '').replace(/\D/g, '');
9221
- pixKeyControl.setValue(rawValue, { emitEvent: false });
9222
- if (pixKeyControl.valid) {
9223
- form.patchValue({
9224
- pixKeyFormatted: FormatUtilsService.getFormattedSubscriptionNumber(rawValue, pixKeyType)
9246
+ /**
9247
+ * Sincroniza todos os dados do NgModel para os FormGroups antes de enviar ao componente pai
9248
+ */
9249
+ syncPixDataToParentForm() {
9250
+ this.syncAllModelToForm();
9251
+ const historicalPix = [...this.addExistentHistoricData];
9252
+ this.historicalPixAccountList.get("historicalPixAccountList").setValue(historicalPix);
9253
+ if (this.formGroup) {
9254
+ this.formGroup.get(this.fieldFormGroup).patchValue({
9255
+ historicalPixAccountList: historicalPix
9225
9256
  });
9226
9257
  }
9227
- this.emitFormValidity();
9228
- }
9229
- getFormattedPixKey(type, value) {
9230
- return FormatUtilsService.getFormattedSubscriptionNumber(value, type);
9231
- }
9232
- syncPixDataToParentForm() {
9233
- if (!this.isEditModeForSave)
9234
- return;
9235
- const values = Object.values(this.formGroupByRow).map(fg => {
9236
- const value = fg.getRawValue();
9237
- const pixKeyType = value.pixKeyType.key;
9238
- if (pixKeyType === 'CPF' || pixKeyType === 'CNPJ') {
9239
- value.pixKey = (value.pixKey || '').replace(/[.\-\/]/g, '');
9240
- }
9241
- else if (pixKeyType === 'TELEPHONE') {
9242
- value.pixKey = (value.pixKey || '').replace(/[()\s\-]/g, '');
9243
- }
9244
- return value;
9245
- });
9246
- this.formGroup
9247
- .get(this.fieldFormGroup)
9248
- .get('historicalPixAccountList')
9249
- .setValue(values);
9250
- this.emitFormValidity();
9251
9258
  }
9252
9259
  syncResetPixFormToParent() {
9253
9260
  this.formGroupByRow = {};
@@ -9257,6 +9264,45 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9257
9264
  this.rebuildFormGroupMap(this.addExistentHistoricData);
9258
9265
  }
9259
9266
  }
9267
+ /**
9268
+ * Valida todos os formulários
9269
+ */
9270
+ validateAllForms() {
9271
+ this.forceCloseAllCellEditors();
9272
+ this.syncAllModelToForm();
9273
+ if (!this.formGroupByRow || Object.keys(this.formGroupByRow).length === 0) {
9274
+ return true;
9275
+ }
9276
+ let isAllValid = true;
9277
+ Object.keys(this.formGroupByRow).forEach(indexKey => {
9278
+ const index = Number(indexKey);
9279
+ const form = this.formGroupByRow[index];
9280
+ if (form) {
9281
+ Object.keys(form.controls).forEach(controlName => {
9282
+ const control = form.get(controlName);
9283
+ control.markAsTouched();
9284
+ if (controlName === 'pixKey') {
9285
+ const pixKeyTypeControl = form.get('pixKeyType');
9286
+ if (pixKeyTypeControl.value) {
9287
+ this.validateDocumentField(index, pixKeyTypeControl.value.key);
9288
+ }
9289
+ }
9290
+ });
9291
+ form.updateValueAndValidity();
9292
+ if (form.invalid) {
9293
+ isAllValid = false;
9294
+ }
9295
+ }
9296
+ });
9297
+ if (isAllValid && this.addExistentHistoricData && this.addExistentHistoricData.length > 0) {
9298
+ const totalPercentage = this.addExistentHistoricData.reduce((sum, item) => sum + (parseFloat(item.percentage) || 0), 0);
9299
+ if (Math.abs(totalPercentage - 100) > 0.01) {
9300
+ isAllValid = false;
9301
+ }
9302
+ }
9303
+ this.isValidChangeForm.emit(isAllValid);
9304
+ return isAllValid;
9305
+ }
9260
9306
  onLazyLoad(event) {
9261
9307
  const first = event && event.first ? event.first : 0;
9262
9308
  const rows = event && event.rows ? event.rows : this.recordByRow;
@@ -9306,7 +9352,8 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9306
9352
  id: null,
9307
9353
  pixKeyType: {},
9308
9354
  pixKey: '',
9309
- percentage: 0
9355
+ percentage: '',
9356
+ externalId: '',
9310
9357
  };
9311
9358
  const index = this.addExistentHistoricData.length;
9312
9359
  this.addExistentHistoricData = [
@@ -9322,7 +9369,22 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9322
9369
  this.dataListPix.editingCell = null;
9323
9370
  }
9324
9371
  this.addExistentHistoricData = this.addExistentHistoricData.filter((_, i) => i !== index);
9372
+ const currentList = this.historicalPixAccountList.get("historicalPixAccountList").value || [];
9373
+ const updatedList = currentList.filter((_, i) => i !== index);
9374
+ this.historicalPixAccountList.get("historicalPixAccountList").setValue(updatedList);
9375
+ if (this.formGroup) {
9376
+ this.formGroup.get(this.fieldFormGroup).patchValue({
9377
+ historicalPixAccountList: updatedList
9378
+ });
9379
+ }
9325
9380
  this.rebuildFormGroupMap(this.addExistentHistoricData);
9381
+ this.addExistentHistoricData.forEach((_, i) => {
9382
+ if (this.formGroupByRow[i]) {
9383
+ const allValues = this.addExistentHistoricData
9384
+ .map((item, idx) => idx === i ? 0 : (parseFloat(item.percentage) || 0));
9385
+ this.validatePercentageValid(allValues, this.formGroupByRow[i]);
9386
+ }
9387
+ });
9326
9388
  this.emitFormValidity();
9327
9389
  }
9328
9390
  rebuildFormGroupMap(data) {
@@ -9424,6 +9486,12 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9424
9486
  this.msgTotalLimitByPercentage = null;
9425
9487
  }
9426
9488
  }
9489
+ formatPercentage(value) {
9490
+ if (value == null || value === '' || isNaN(Number(value))) {
9491
+ return '0.00';
9492
+ }
9493
+ return Number(value).toFixed(2);
9494
+ }
9427
9495
  onSyncValue(field, index) {
9428
9496
  if (this.formGroupByRow &&
9429
9497
  this.formGroupByRow[index] &&
@@ -9433,19 +9501,351 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9433
9501
  this.addExistentHistoricData[index][field] = value;
9434
9502
  control.markAsDirty();
9435
9503
  control.markAsTouched();
9504
+ if (field === 'percentage') {
9505
+ const currentList = this.addExistentHistoricData
9506
+ .map((item, i) => i === index ? 0 : (parseFloat(item.percentage) || 0));
9507
+ this.validatePercentageValid(currentList, this.formGroupByRow[index]);
9508
+ if (!this.isSyncingPercentage) {
9509
+ this.isSyncingPercentage = true;
9510
+ setTimeout(() => {
9511
+ this.syncPixDataToParentForm();
9512
+ this.isSyncingPercentage = false;
9513
+ }, 0);
9514
+ }
9515
+ }
9436
9516
  control.updateValueAndValidity();
9437
- const currentList = this.addExistentHistoricData.map((item, i) => {
9438
- return i === index ? 0 : item.percentage;
9517
+ this.formGroupByRow[index].updateValueAndValidity();
9518
+ this.emitFormValidity();
9519
+ }
9520
+ }
9521
+ close() {
9522
+ this.visible = false;
9523
+ }
9524
+ getFormattedTelephoneNumber(telephoneNumber) {
9525
+ return FormatUtilsService.getFormattedTelephoneNumber(telephoneNumber);
9526
+ }
9527
+ getFormattedCpf(cpf) {
9528
+ return FormatUtilsService.getFormattedCpf(cpf);
9529
+ }
9530
+ getFormattedCnpj(cnpj) {
9531
+ return FormatUtilsService.getFormattedCnpj(cnpj);
9532
+ }
9533
+ getFormattedPercentage(value) {
9534
+ return FormatUtilsService.getFormattedPercentage(value);
9535
+ }
9536
+ /**
9537
+ * Reseta completamente o estado do formulário e controles
9538
+ */
9539
+ resetFormState() {
9540
+ if (this.formGroupByRow) {
9541
+ Object.values(this.formGroupByRow).forEach(form => {
9542
+ if (form) {
9543
+ Object.keys(form.controls).forEach(controlName => {
9544
+ const control = form.get(controlName);
9545
+ if (control) {
9546
+ control.setErrors(null);
9547
+ control.markAsUntouched();
9548
+ control.markAsPristine();
9549
+ }
9550
+ });
9551
+ form.updateValueAndValidity();
9552
+ }
9439
9553
  });
9440
- this.validatePercentageValid(currentList, this.formGroupByRow[index]);
9554
+ }
9555
+ if (this.dataListPix) {
9556
+ if (typeof this.dataListPix.closeAllCellEditors === 'function') {
9557
+ try {
9558
+ this.dataListPix.closeAllCellEditors();
9559
+ }
9560
+ catch (e) {
9561
+ console.error('Erro ao tentar fechar cell editors:', e);
9562
+ }
9563
+ }
9564
+ else if (this.dataListPix.editingCell) {
9565
+ this.dataListPix.editingCell = null;
9566
+ }
9567
+ if (this.dataListPix.editing !== undefined) {
9568
+ this.dataListPix.editing = false;
9569
+ }
9570
+ }
9571
+ this.cd.detectChanges();
9572
+ }
9573
+ /**
9574
+ * Formata a chave PIX para exibição baseada no tipo
9575
+ */
9576
+ getFormattedPixKey(pixKeyType, pixKey) {
9577
+ if (!pixKey)
9578
+ return '';
9579
+ switch (pixKeyType) {
9580
+ case 'CPF':
9581
+ return FormatUtilsService.getFormattedCpf(pixKey);
9582
+ case 'CNPJ':
9583
+ return FormatUtilsService.getFormattedCnpj(pixKey);
9584
+ case 'TELEPHONE':
9585
+ return FormatUtilsService.getFormattedTelephoneNumber(pixKey);
9586
+ case 'EMAIL':
9587
+ case 'RANDOM_KEY':
9588
+ default:
9589
+ return pixKey;
9590
+ }
9591
+ }
9592
+ /**
9593
+ * Obtém o tipo de chave PIX do item atual
9594
+ */
9595
+ getPixKeyType(item) {
9596
+ return item && item.pixKeyType && item.pixKeyType.key || '';
9597
+ }
9598
+ /**
9599
+ * Verifica se um controle está inválido para os campos editáveis
9600
+ */
9601
+ isInvalid(index, controlName) {
9602
+ const form = this.formGroupByRow[index];
9603
+ if (!form)
9604
+ return false;
9605
+ const control = form.get(controlName);
9606
+ if (!control)
9607
+ return false;
9608
+ return control.invalid && (control.touched || control.dirty);
9609
+ }
9610
+ /**
9611
+ * Método chamado quando uma célula entra no modo de edição
9612
+ */
9613
+ onCellEditInit(event) {
9614
+ const rowIndex = this.addExistentHistoricData.findIndex(item => item === event.data);
9615
+ if (rowIndex < 0)
9616
+ return;
9617
+ const form = this.formGroupByRow[rowIndex];
9618
+ if (form && form.get('pixKey')) {
9619
+ const pixKeyControl = form.get('pixKey');
9620
+ const currentValue = this.addExistentHistoricData[rowIndex].pixKey;
9621
+ pixKeyControl.setValue(currentValue);
9622
+ }
9623
+ }
9624
+ /**
9625
+ * Recupera o FormControl específico para um campo em determinado índice
9626
+ */
9627
+ getFormControl(index, controlName) {
9628
+ const form = this.formGroupByRow[index];
9629
+ if (!form)
9630
+ return null;
9631
+ return form.get(controlName);
9632
+ }
9633
+ /**
9634
+ * Valida campos de documento (CPF, CNPJ) quando o usuário termina de digitar no form de edição
9635
+ */
9636
+ validateDocumentField(index, fieldType) {
9637
+ const form = this.formGroupByRow[index];
9638
+ const item = this.addExistentHistoricData[index];
9639
+ if (!form || !item)
9640
+ return;
9641
+ const pixKeyControl = form.get('pixKey');
9642
+ if (!pixKeyControl)
9643
+ return;
9644
+ let value = item.pixKey;
9645
+ pixKeyControl.setValue(value);
9646
+ if (fieldType === 'CPF' || fieldType === 'CNPJ' || fieldType === 'TELEPHONE') {
9647
+ value = value ? value.toString().replace(/\D/g, '') : '';
9648
+ item.pixKey = value;
9649
+ pixKeyControl.setValue(value);
9650
+ }
9651
+ if (!value || value.toString().trim() === '') {
9652
+ pixKeyControl.setErrors({ required: true });
9653
+ pixKeyControl.markAsTouched();
9654
+ form.updateValueAndValidity();
9441
9655
  this.emitFormValidity();
9656
+ return;
9657
+ }
9658
+ let cleanValue = value;
9659
+ if (fieldType === 'CPF' || fieldType === 'CNPJ') {
9660
+ cleanValue = value.toString().replace(/\D/g, '');
9661
+ item.pixKey = cleanValue;
9662
+ pixKeyControl.setValue(cleanValue);
9663
+ }
9664
+ let isValid = false;
9665
+ switch (fieldType) {
9666
+ case 'CPF':
9667
+ isValid = cleanValue.length === 11 && GenericValidator.isValidCpf({ value: cleanValue }) === null;
9668
+ break;
9669
+ case 'CNPJ':
9670
+ isValid = cleanValue.length === 14 && GenericValidator.isValidCnpj({ value: cleanValue }) === null;
9671
+ break;
9672
+ case 'TELEPHONE':
9673
+ cleanValue = value.toString().replace(/\D/g, '');
9674
+ isValid = GenericValidator.isValidPhoneNumber({ value: cleanValue }) === null;
9675
+ break;
9676
+ case 'EMAIL':
9677
+ isValid = GenericValidator.isValidEmail({ value }) === null;
9678
+ break;
9679
+ case 'RANDOM_KEY':
9680
+ isValid = true;
9681
+ break;
9682
+ default:
9683
+ isValid = true;
9684
+ }
9685
+ pixKeyControl.markAsTouched();
9686
+ if (isValid) {
9687
+ pixKeyControl.setErrors(null);
9688
+ }
9689
+ else {
9690
+ const errorType = this.getErrorTypeForField(fieldType);
9691
+ pixKeyControl.setErrors({ [errorType]: true });
9692
+ }
9693
+ form.updateValueAndValidity();
9694
+ this.emitFormValidity();
9695
+ this.cd.detectChanges();
9696
+ }
9697
+ /**
9698
+ * Obtém o tipo de erro para cada tipo de campo editável
9699
+ */
9700
+ getErrorTypeForField(fieldType) {
9701
+ switch (fieldType) {
9702
+ case 'CPF': return 'invalidCpf';
9703
+ case 'CNPJ': return 'invalidCnpj';
9704
+ case 'TELEPHONE': return 'invalidPhoneNumber';
9705
+ case 'EMAIL': return 'invalidEmail';
9706
+ default: return 'required';
9707
+ }
9708
+ }
9709
+ /**
9710
+ * Retorna a mensagem de erro apropriada para um campo
9711
+ */
9712
+ getErrorMessage(index, controlName) {
9713
+ const form = this.formGroupByRow[index];
9714
+ if (!form)
9715
+ return '';
9716
+ const control = form.get(controlName);
9717
+ if (!control || !control.errors)
9718
+ return '';
9719
+ const fieldValue = control.value || '';
9720
+ if (control.hasError('required')) {
9721
+ return this.translateService.instant('hcm.payroll.required');
9722
+ }
9723
+ if (control.hasError('invalidCpf')) {
9724
+ return this.translateService.instant('hcm.payroll.employees_addition_cpf_error');
9725
+ }
9726
+ else if (control.hasError('invalidCnpj')) {
9727
+ return this.translateService.instant('hcm.payroll.employees_addition_cnpj_error');
9728
+ }
9729
+ else if (control.hasError('invalidEmail')) {
9730
+ return this.translateService.instant('hcm.payroll.employees_addition_email_invalid');
9731
+ }
9732
+ else if (control.hasError('invalidPhoneNumber')) {
9733
+ return this.translateService.instant('hcm.payroll.employees_addition_invalid_phone_number', { value: fieldValue });
9734
+ }
9735
+ return '';
9736
+ }
9737
+ /**
9738
+ * Tratamento ao perder o foco em campos de documento
9739
+ */
9740
+ onDocumentBlur(index) {
9741
+ const form = this.formGroupByRow[index];
9742
+ const item = this.addExistentHistoricData[index];
9743
+ if (!form || !item)
9744
+ return;
9745
+ const pixKeyControl = form.get('pixKey');
9746
+ const pixKeyTypeControl = form.get('pixKeyType');
9747
+ if (!pixKeyControl || !pixKeyTypeControl.value)
9748
+ return;
9749
+ const pixKeyType = pixKeyTypeControl.value.key;
9750
+ let value = item.pixKey;
9751
+ if (pixKeyType === 'CPF' || pixKeyType === 'CNPJ' || pixKeyType === 'TELEPHONE') {
9752
+ value = value ? value.toString().replace(/\D/g, '') : '';
9753
+ item.pixKey = value;
9754
+ }
9755
+ pixKeyControl.setValue(value);
9756
+ this.validateDocumentField(index, pixKeyType);
9757
+ if (value) {
9758
+ if (pixKeyType === 'CPF') {
9759
+ item.pixKeyFormatted = FormatUtilsService.getFormattedCpf(value);
9760
+ }
9761
+ else if (pixKeyType === 'CNPJ') {
9762
+ item.pixKeyFormatted = FormatUtilsService.getFormattedCnpj(value);
9763
+ }
9764
+ else if (pixKeyType === 'TELEPHONE') {
9765
+ item.pixKeyFormatted = FormatUtilsService.getFormattedTelephoneNumber(value);
9766
+ }
9767
+ else {
9768
+ item.pixKeyFormatted = value;
9769
+ }
9770
+ }
9771
+ this.finishEditing();
9772
+ }
9773
+ finishEditing() {
9774
+ this.syncAllModelToForm();
9775
+ this.cd.detectChanges();
9776
+ }
9777
+ clearErrorsTemporarily(rowIndex) {
9778
+ const form = this.formGroupByRow[rowIndex];
9779
+ if (form && form.get('pixKey')) {
9780
+ const currentValue = form.get('pixKey').value;
9781
+ form.get('pixKey').setErrors(null);
9782
+ form.get('pixKey').setValue(currentValue);
9783
+ }
9784
+ }
9785
+ closeEditModeManually() {
9786
+ setTimeout(() => {
9787
+ if (this.dataListPix) {
9788
+ if (typeof this.dataListPix.closeAllCellEditors === 'function') {
9789
+ this.dataListPix.closeAllCellEditors();
9790
+ }
9791
+ else if (this.dataListPix.editingCell) {
9792
+ this.dataListPix.editingCell = null;
9793
+ }
9794
+ this.cd.detectChanges();
9795
+ }
9796
+ }, 100);
9797
+ }
9798
+ syncAllModelToForm() {
9799
+ if (!this.addExistentHistoricData || !this.formGroupByRow)
9800
+ return;
9801
+ this.addExistentHistoricData.forEach((item, index) => {
9802
+ const form = this.formGroupByRow[index];
9803
+ if (form) {
9804
+ Object.keys(form.controls).forEach(controlName => {
9805
+ const control = form.get(controlName);
9806
+ if (control && item[controlName] !== undefined) {
9807
+ control.setValue(item[controlName]);
9808
+ }
9809
+ });
9810
+ const pixKeyTypeControl = form.get('pixKeyType');
9811
+ if (pixKeyTypeControl.value) {
9812
+ this.validateDocumentField(index, pixKeyTypeControl.value.key);
9813
+ }
9814
+ }
9815
+ });
9816
+ }
9817
+ /**
9818
+ * Método para forçar o fechamento de todas as células em edição
9819
+ */
9820
+ forceCloseAllCellEditors() {
9821
+ this.finishEditing();
9822
+ this.syncAllModelToForm();
9823
+ }
9824
+ isPixKeyType(item, type) {
9825
+ return item && item.pixKeyType && item.pixKeyType.key === type;
9826
+ }
9827
+ getPixKey(rowData) {
9828
+ return rowData ? rowData.pixKey : null;
9829
+ }
9830
+ setPixKey(rowData, value) {
9831
+ if (rowData) {
9832
+ rowData.pixKey = value;
9833
+ }
9834
+ }
9835
+ get isTotalPercentage100() {
9836
+ if (!this.addExistentHistoricData || this.addExistentHistoricData.length === 0) {
9837
+ return false;
9442
9838
  }
9839
+ const totalPercentage = this.addExistentHistoricData
9840
+ .reduce((sum, item) => sum + (parseFloat(item.percentage) || 0), 0);
9841
+ return totalPercentage >= 100;
9443
9842
  }
9444
9843
  get scopedActions() {
9445
9844
  return this.actions.bind(this);
9446
9845
  }
9447
9846
  get recordsMessage() {
9448
- return `${this.totalRecords || 0} ${this.totalRecords === 1 ? this.translateService.instant("hcm.payroll.admission_register") : this.translateService.instant("hcm.payroll.admission_registers")}`;
9847
+ return `${this.totalRecords || 0} ${this.totalRecords === 1 ?
9848
+ this.translateService.instant("hcm.payroll.admission_register") : this.translateService.instant("hcm.payroll.admission_registers")}`;
9449
9849
  }
9450
9850
  get getTooltipAndDisableButtonAdd() {
9451
9851
  return this.dateChange ? null : this.msgTooltipAdd;
@@ -9487,21 +9887,6 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9487
9887
  this._visible = value;
9488
9888
  this.visibleChange.emit(this.visible);
9489
9889
  }
9490
- close() {
9491
- this.visible = false;
9492
- }
9493
- getFormattedTelephoneNumber(telephoneNumber) {
9494
- return FormatUtilsService.getFormattedTelephoneNumber(telephoneNumber);
9495
- }
9496
- getFormattedCpf(cpf) {
9497
- return FormatUtilsService.getFormattedCpf(cpf);
9498
- }
9499
- getFormattedCnpj(cnpj) {
9500
- return FormatUtilsService.getFormattedCnpj(cnpj);
9501
- }
9502
- getFormattedPercentage(value) {
9503
- return FormatUtilsService.getFormattedPercentage(value);
9504
- }
9505
9890
  get isAllowToAddHistorical() {
9506
9891
  return (this.permission["incluir"]);
9507
9892
  }
@@ -9625,8 +10010,8 @@ HistoricalPixAccountComponent = __decorate([
9625
10010
  Component({
9626
10011
  // tslint:disable-next-line:component-selector
9627
10012
  selector: "c-historical-pix-account",
9628
- template: "<s-sidebar *ngIf=\"withSideBar\" [visible]=\"visible\" (visibleChange)=\"close()\"\n header=\"{{'hcm.payroll.historical_pix_account_title_form'|translate}}\">\n<pix-account [(visible)]=\"visible\"\n [isEditAndViewValue]=\"pixAccountItemInput\"\n [currency]=\"currency\"\n [customEntity]=\"customEntity\"\n [customService]=\"customService\"\n [getListPixAccount]=\"listDataNoPage\"\n [paramsForm]=\"paramsForm\"\n [showField]=\"showFields\"\n (pixAccountItemToList)=\"addItemInList($event)\"\n [defaultCpfNumber]=\"defaultCpfNumber\"></pix-account>\n</s-sidebar>\n\n<div *ngIf=\"!withSideBar\">\n <pix-account [(visible)]=\"visible\"\n [isEditAndViewValue]=\"pixAccountItemInput\"\n [currency]=\"currency\"\n [customEntity]=\"customEntity\"\n [customService]=\"customService\"\n [getListPixAccount]=\"listDataNoPage\"\n [withSideBar]=\"false\"\n [isViewMode]=\"isViewMode\"\n [paramsForm]=\"paramsForm\"\n (pixAccountItemToList)=\"addItemInList($event)\"\n [defaultCpfNumber]=\"defaultCpfNumber\"></pix-account>\n</div>\n<div class=\"ui-g-1\" *ngIf=\"withSideBar && !isEditMode && !hideBtnAddForViewMode\">\n <div class=\"form-group \">\n <s-button id=\"ta-addPayAnnuity\"\n [disabled]=\"getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage\"\n (onClick)=\"add()\"\n [pTooltip]=\"getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage\"\n tooltipPosition=\"top\"\n label=\"{{'hcm.payroll.historical_pix_account_add'|translate}}\"></s-button>\n </div>\n</div>\n<div *ngIf=\"showFields || !showEditMode || !(hideFields | async)\" class=\"ui-g-12\">\n <p-table\n id=\"table-annuity\"\n [value]=\"listData\"\n [columns]=\"cols\"\n (onLazyLoad)=\"onLazyLoad($event)\"\n [lazy]=\"true\"\n [scrollable]=\"true\"\n [paginator]=\"true\"\n [totalRecords]=\"totalRecords\"\n [sortMode]=\"'multiple'\"\n *sLoadingState=\"loading\"\n [rows]=\"recordByRow\"\n dataKey=\"id\">\n <ng-template pTemplate=\"colgroup\" let-coumns>\n <colgroup>\n <col [ngClass]=\"'col-default-m'\">\n <col [ngClass]=\"'col-default-m'\">\n <col [ngClass]=\"'col-default-s'\">\n <col *ngIf=\"showButtonView\" [ngClass]=\"'col-action'\">\n </colgroup>\n </ng-template>\n <ng-template pTemplate=\"header\" let-columns>\n <!-- Cabe\u00E7alhos quando da table \u00E9 permitido ordenar as colunas -->\n <tr>\n <!-- Cabe\u00E7alhos das colunas da tabela -->\n <th\n [pSortableColumn]=\"'pixKeyType'\"\n [pTooltip]=\"'hcm.payroll.employees_addition_pix_key_type' | translate\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >\n <div class=\"senior-header\" id=\"table-0\">\n <span\n id=\"table-annuity-s-0\">{{ 'hcm.payroll.employees_addition_pix_key_type' | translate }}</span>\n <p-sortIcon class=\"p-sorticon-status\"\n [field]=\"'hcm.payroll.employees_addition_pix_key_type' | translate\"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]=\"'pixKey'\"\n [pTooltip]=\"'hcm.payroll.employees_addition_pix_key' | translate\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >\n <div class=\"senior-header\">\n <span>{{ 'hcm.payroll.employees_addition_pix_key' | translate }}</span>\n <p-sortIcon class=\"p-sorticon-status\"\n [field]=\"'hcm.payroll.employees_addition_pix_key' | translate\"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]=\"'percentage'\"\n [pTooltip]=\"'hcm.payroll.historical_pix_account_label_percentage' | translate\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >\n <div class=\"senior-header\">\n <span>{{ 'hcm.payroll.historical_pix_account_label_percentage' | translate }}</span>\n <p-sortIcon class=\"p-sorticon-status\"\n [field]=\"'hcm.payroll.historical_pix_account_label_percentage' | translate\"></p-sortIcon>\n </div>\n </th>\n <!-- Cabe\u00E7alho da coluna de a\u00E7\u00F5es -->\n <th *ngIf=\"showButtonView\" id=\"col-actions\"></th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowData let-key=\"rowIndex\">\n\n <tr [ngClass]=\"'row'+key\" [pSelectableRow]=\"rowData\">\n <td [pTooltip]=\"rowData?.pixKeyType.value\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ rowData?.pixKeyType.value }}</span>\n </td>\n\n <ng-container [ngSwitch]=\"rowData?.pixKeyType.key\">\n <td *ngSwitchCase=\"'TELEPHONE'\"\n [pTooltip]=\"getFormattedTelephoneNumber(rowData?.pixKey)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedTelephoneNumber(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchCase=\"'CPF'\"\n [pTooltip]=\"getFormattedCpf(rowData?.pixKey)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedCpf(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchCase=\"'CNPJ'\"\n [pTooltip]=\"getFormattedCnpj(rowData?.pixKey)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedCnpj(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchDefault\n [pTooltip]=\"rowData?.pixKey\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ rowData?.pixKey }}</span>\n </td>\n </ng-container>\n <td [pTooltip]=\"getFormattedPercentage(rowData?.percentage)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedPercentage(rowData?.percentage) }}</span>\n </td>\n <td id=\"col-actions-{{key}}\" class=\"col-actions \"\n *ngIf=\"actions && actions(rowData, key)?.length && showButtonView\">\n <s-button id=\"table-admission-btn-actions-{{key}}\"\n *ngIf=\"!isViewMode && actions(rowData, key).length > 1\" [label]=\"actionLabel\"\n priority=\"default\" [model]=\"scopedActions(rowData, key)\"\n [disabled]=\"false\" [auxiliary]=\"true\"></s-button>\n\n <s-button id=\"table-admission-btn-action-{{key}}\"\n *ngIf=\"!isViewMode && actions(rowData, key).length <= 1\"\n [label]=\"scopedActions(rowData, key)[0].label\"\n priority=\"default\"\n (click)=\"scopedActions(rowData, key)[0].command()\"\n [disabled]=\"false\" [auxiliary]=\"true\"></s-button>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"emptymessage\" let-columns>\n <tr>\n <td [attr.colspan]=\"columns.length +2\">\n {{'hcm.payroll.admission_empty_message'|translate}}\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"paginatorright\">\n <span *ngIf=\"totalRecords\">{{recordsMessage}}</span>\n </ng-template>\n </p-table>\n</div>\n\n<!-- Template exlusivo para edi\u00E7\u00E3o de pix via modal-->\n<div *ngIf=\"!withSideBar && showEditMode && (hideFields | async)\" class=\"ui-g-12\">\n <!-- Bot\u00E3o Adicionar -->\n <div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <s-button\n id=\"btn-save\"\n label=\"{{ 'hcm.payroll.historical_pix_account_add' | translate}}\"\n priority=\"primary\"\n (onClick)=\"addPix()\">\n </s-button>\n </div>\n </div>\n\n <!-- Tabela -->\n <p-table #dataListPix sortField=\"percentage\"\n [columns]=\"cols\"\n [value]=\"addExistentHistoricData\"\n [pageLinks]=\"3\"\n [paginator]=\"true\"\n [responsive]=\"true\"\n [rows]=\"10\"\n [resetPageOnSort]=\"false\"\n [tableStyle]=\"{'margin-top': '2rem'}\"\n [customSort]=\"true\">\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th *ngFor=\"let col of cols\">\n {{ col.label }}\n </th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-item let-rowIndex=\"rowIndex\">\n <ng-container *ngIf=\"formGroupByRow[rowIndex]\" [formGroup]=\"formGroupByRow[rowIndex]\">\n <tr>\n <!-- Tipo de Chave -->\n <td class=\"ui-md-6 ui-sm-12 required\"\n [pEditableColumn]=\"item.pixKeyType\" pEditableColumnField=\"pixKeyType\">\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <div style=\"width: 100%; position: relative;\">\n <p-autoComplete\n [suggestions]=\"suggestions\"\n (completeMethod)=\"filterPixKeyType($event)\"\n formControlName=\"pixKeyType\"\n [dropdown]=\"true\"\n (onSelect)=\"onPixKeyTypeChange($event, rowIndex)\"\n (onClear)=\"onPixKeyTypeClear(rowIndex)\"\n (ngModelChange)=\"onSyncValue('pixKeyType', rowIndex)\"\n field=\"value\"\n placeholder=\"{{'hcm.payroll.select' | translate}}\"\n appendTo=\"body\"\n [panelStyle]=\"{ maxWidth: '300px', width: '100%' }\"\n [inputStyle]=\"{ width: '100%' }\"\n ></p-autoComplete>\n\n <s-control-errors [control]=\"formGroupByRow[rowIndex]?.get('pixKeyType')\"\n [errorMessages]=\"{\n required: 'hcm.payroll.required' | translate,\n pixKeyTypeBankAccountDuplicate: 'hcm.payroll.historical_pix_key_type_bank_account_duplicate' | translate\n }\">\n </s-control-errors>\n </div>\n </ng-template>\n <ng-template pTemplate=\"output\">\n {{ item.pixKeyType?.value }}\n </ng-template>\n </p-cellEditor>\n </td>\n\n <!-- Chave Pix -->\n <td class=\"ui-md-6 ui-sm-12 required\"\n [pEditableColumn]=\"item.pixKey\" pEditableColumnField=\"pixKey\"\n [ngClass]=\"{'required': item.pixKeyType.key !== 'BANK_ACCOUNT',\n 'disabled': item.pixKeyType && item.pixKeyType.key === 'BANK_ACCOUNT'\n }\">\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <ng-container [ngSwitch]=\"item.pixKeyType.key\">\n <input *ngSwitchCase=\"'TELEPHONE'\"\n only-number\n pInputText\n type=\"text\"\n formControlName=\"pixKey\"\n (keyup)=\"phoneMask($event)\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\"\n maxlength=\"15\"\n placeholder=\"(__) ____-____\" />\n\n <input *ngSwitchCase=\"'CPF'\"\n type=\"text\"\n pInputText\n formControlName=\"pixKey\"\n maxlength=\"14\"\n placeholder=\"___.___.___-__\"\n (input)=\"onPixKeyInput($event, rowIndex)\"\n (blur)=\"onBlurPixCpfAndCnpj(rowIndex)\"\n (keyup)=\"cpfMask($event)\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\" />\n\n <input *ngSwitchCase=\"'CNPJ'\"\n type=\"text\"\n pInputText\n formControlName=\"pixKey\"\n maxlength=\"18\"\n placeholder=\"___.___.___/____-__\"\n (input)=\"onPixKeyInput($event, rowIndex)\"\n (blur)=\"onBlurPixCpfAndCnpj(rowIndex)\"\n (keyup)=\"cnpjMask($event)\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\" />\n\n <input *ngSwitchCase=\"'EMAIL'\"\n pInputText\n type=\"email\"\n formControlName=\"pixKey\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\"\n placeholder=\"{{ 'hcm.payroll.employees_addition_email' | translate }}\" />\n\n <input *ngSwitchCase=\"'BANK_ACCOUNT'\"\n pInputText\n formControlName=\"pixKey\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\"\n [disabled]=\"true\" />\n\n <input *ngSwitchDefault\n pInputText\n type=\"text\"\n formControlName=\"pixKey\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\"\n maxlength=\"100\" />\n </ng-container>\n\n <s-control-errors *ngIf=\"isShowPixKeyFieldValidatorMessage\"\n [control]=\"formGroupByRow[rowIndex]?.get('pixKey')\"\n [errorMessages]=\"{\n required: 'hcm.payroll.required' | translate,\n invalidPhoneNumber: 'hcm.payroll.employees_addition_invalid_phone_number' | translate: { value: formGroupByRow[rowIndex]?.get('pixKey').value },\n invalidEmail: 'hcm.payroll.employees_addition_email_invalid' | translate,\n cpfNotValid: 'hcm.payroll.employees_addition_cpf_error' | translate,\n cnpjNotValid: 'hcm.payroll.employees_addition_cnpj_error' | translate\n }\">\n </s-control-errors>\n </ng-template>\n <ng-template pTemplate=\"output\">\n {{ getFormattedPixKey(item.pixKeyType?.key, item.pixKey) }}\n </ng-template>\n </p-cellEditor>\n </td>\n\n <!-- Percentual -->\n <td class=\"ui-md-6 ui-sm-12 required\"\n [pEditableColumn]=\"item.percentage\" pEditableColumnField=\"percentage\">\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <input\n pInputText type=\"number\"\n formControlName=\"percentage\"\n (ngModelChange)=\"onSyncValue('percentage', rowIndex)\"\n >\n <s-control-errors\n [control]=\"formGroupByRow[rowIndex]?.get('percentage')\"\n [errorMessages]=\"{\n required: 'hcm.payroll.required' | translate,\n maxlength: 'hcm.payroll.error_max_length' | translate: { value: '6' },\n max: 'hcm.payroll.error_max_value_number' | translate: { value: maxValuePercentage },\n min: 'hcm.payroll.error_min_value_number' | translate: { value: '0,01' }\n }\">\n </s-control-errors>\n </ng-template>\n <ng-template pTemplate=\"output\">\n {{ item.percentage?.toFixed(2).replace('.', ',') }}%\n </ng-template>\n </p-cellEditor>\n </td>\n\n <!-- Bot\u00E3o de excluir -->\n <td>\n <s-button\n id=\"btn-delete\"\n label=\"{{ 'hcm.payroll.delete' | translate }}\"\n priority=\"default\"\n (onClick)=\"deletePix(rowIndex)\">\n </s-button>\n </td>\n </tr>\n </ng-container>\n </ng-template>\n </p-table>\n</div>\n",
9629
- 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}"]
10013
+ template: "<s-sidebar *ngIf=\"withSideBar\" [visible]=\"visible\" (visibleChange)=\"close()\"\n header=\"{{'hcm.payroll.historical_pix_account_title_form'|translate}}\">\n<pix-account [(visible)]=\"visible\"\n [isEditAndViewValue]=\"pixAccountItemInput\"\n [currency]=\"currency\"\n [customEntity]=\"customEntity\"\n [customService]=\"customService\"\n [getListPixAccount]=\"listDataNoPage\"\n [paramsForm]=\"paramsForm\"\n [showField]=\"showFields\"\n (pixAccountItemToList)=\"addItemInList($event)\"\n [defaultCpfNumber]=\"defaultCpfNumber\"></pix-account>\n</s-sidebar>\n\n<div *ngIf=\"!withSideBar\">\n <pix-account [(visible)]=\"visible\"\n [isEditAndViewValue]=\"pixAccountItemInput\"\n [currency]=\"currency\"\n [customEntity]=\"customEntity\"\n [customService]=\"customService\"\n [getListPixAccount]=\"listDataNoPage\"\n [withSideBar]=\"false\"\n [isViewMode]=\"isViewMode\"\n [paramsForm]=\"paramsForm\"\n (pixAccountItemToList)=\"addItemInList($event)\"\n [defaultCpfNumber]=\"defaultCpfNumber\"></pix-account>\n</div>\n<div class=\"ui-g-1\" *ngIf=\"withSideBar && !isEditMode && !hideBtnAddForViewMode\">\n <div class=\"form-group \">\n <s-button id=\"ta-addPayAnnuity\"\n [disabled]=\"getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage\"\n (onClick)=\"add()\"\n [pTooltip]=\"getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage\"\n tooltipPosition=\"top\"\n label=\"{{'hcm.payroll.historical_pix_account_add'|translate}}\"></s-button>\n </div>\n</div>\n<div *ngIf=\"showFields || !showEditMode || !(hideFields | async)\" class=\"ui-g-12\">\n <p-table\n id=\"table-annuity\"\n [value]=\"listData\"\n [columns]=\"cols\"\n (onLazyLoad)=\"onLazyLoad($event)\"\n [lazy]=\"true\"\n [scrollable]=\"true\"\n [paginator]=\"true\"\n [totalRecords]=\"totalRecords\"\n [sortMode]=\"'multiple'\"\n *sLoadingState=\"loading\"\n [rows]=\"recordByRow\"\n dataKey=\"id\">\n <ng-template pTemplate=\"colgroup\" let-coumns>\n <colgroup>\n <col [ngClass]=\"'col-default-m'\">\n <col [ngClass]=\"'col-default-m'\">\n <col [ngClass]=\"'col-default-s'\">\n <col *ngIf=\"showButtonView\" [ngClass]=\"'col-action'\">\n </colgroup>\n </ng-template>\n <ng-template pTemplate=\"header\" let-columns>\n <!-- Cabe\u00E7alhos quando da table \u00E9 permitido ordenar as colunas -->\n <tr>\n <!-- Cabe\u00E7alhos das colunas da tabela -->\n <th\n [pSortableColumn]=\"'pixKeyType'\"\n [pTooltip]=\"'hcm.payroll.employees_addition_pix_key_type' | translate\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >\n <div class=\"senior-header\" id=\"table-0\">\n <span\n id=\"table-annuity-s-0\">{{ 'hcm.payroll.employees_addition_pix_key_type' | translate }}</span>\n <p-sortIcon class=\"p-sorticon-status\"\n [field]=\"'hcm.payroll.employees_addition_pix_key_type' | translate\"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]=\"'pixKey'\"\n [pTooltip]=\"'hcm.payroll.employees_addition_pix_key' | translate\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >\n <div class=\"senior-header\">\n <span>{{ 'hcm.payroll.employees_addition_pix_key' | translate }}</span>\n <p-sortIcon class=\"p-sorticon-status\"\n [field]=\"'hcm.payroll.employees_addition_pix_key' | translate\"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]=\"'percentage'\"\n [pTooltip]=\"'hcm.payroll.historical_pix_account_label_percentage' | translate\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >\n <div class=\"senior-header\">\n <span>{{ 'hcm.payroll.historical_pix_account_label_percentage' | translate }}</span>\n <p-sortIcon class=\"p-sorticon-status\"\n [field]=\"'hcm.payroll.historical_pix_account_label_percentage' | translate\"></p-sortIcon>\n </div>\n </th>\n <!-- Cabe\u00E7alho da coluna de a\u00E7\u00F5es -->\n <th *ngIf=\"showButtonView\" id=\"col-actions\"></th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowData let-key=\"rowIndex\">\n\n <tr [ngClass]=\"'row'+key\" [pSelectableRow]=\"rowData\">\n <td [pTooltip]=\"rowData?.pixKeyType.value\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ rowData?.pixKeyType.value }}</span>\n </td>\n\n <ng-container [ngSwitch]=\"rowData?.pixKeyType.key\">\n <td *ngSwitchCase=\"'TELEPHONE'\"\n [pTooltip]=\"getFormattedTelephoneNumber(rowData?.pixKey)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedTelephoneNumber(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchCase=\"'CPF'\"\n [pTooltip]=\"getFormattedCpf(rowData?.pixKey)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedCpf(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchCase=\"'CNPJ'\"\n [pTooltip]=\"getFormattedCnpj(rowData?.pixKey)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedCnpj(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchDefault\n [pTooltip]=\"rowData?.pixKey\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ rowData?.pixKey }}</span>\n </td>\n </ng-container>\n <td [pTooltip]=\"getFormattedPercentage(rowData?.percentage)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedPercentage(rowData?.percentage) }}</span>\n </td>\n <td id=\"col-actions-{{key}}\" class=\"col-actions \"\n *ngIf=\"actions && actions(rowData, key)?.length && showButtonView\">\n <s-button id=\"table-admission-btn-actions-{{key}}\"\n *ngIf=\"!isViewMode && actions(rowData, key).length > 1\" [label]=\"actionLabel\"\n priority=\"default\" [model]=\"scopedActions(rowData, key)\"\n [disabled]=\"false\" [auxiliary]=\"true\"></s-button>\n\n <s-button id=\"table-admission-btn-action-{{key}}\"\n *ngIf=\"!isViewMode && actions(rowData, key).length <= 1\"\n [label]=\"scopedActions(rowData, key)[0].label\"\n priority=\"default\"\n (click)=\"scopedActions(rowData, key)[0].command()\"\n [disabled]=\"false\" [auxiliary]=\"true\"></s-button>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"emptymessage\" let-columns>\n <tr>\n <td [attr.colspan]=\"columns.length +2\">\n {{'hcm.payroll.admission_empty_message'|translate}}\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"paginatorright\">\n <span *ngIf=\"totalRecords\">{{recordsMessage}}</span>\n </ng-template>\n </p-table>\n</div>\n\n<!-- Template exlusivo para edi\u00E7\u00E3o de pix via modal-->\n<div *ngIf=\"!withSideBar && showEditMode && (hideFields | async)\" class=\"ui-g-12\">\n <!-- Bot\u00E3o Adicionar -->\n <div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <s-button\n id=\"btn-save\"\n label=\"{{ 'hcm.payroll.historical_pix_account_add' | translate}}\"\n priority=\"primary\"\n [disabled]=\"isTotalPercentage100\"\n [pTooltip]=\"isTotalPercentage100 ? ('hcm.payroll.historical_pix_account_msg_limit_total_by_percentage' | translate) : ''\"\n tooltipPosition=\"top\"\n (onClick)=\"addPix()\">\n </s-button>\n </div>\n </div>\n\n <!-- Tabela -->\n <p-table #dataListPix sortField=\"percentage\"\n [columns]=\"cols\"\n [value]=\"addExistentHistoricData\"\n [pageLinks]=\"3\"\n [paginator]=\"true\"\n [responsive]=\"true\"\n [rows]=\"10\"\n [resetPageOnSort]=\"false\"\n [tableStyle]=\"{'margin-top': '2rem'}\"\n [customSort]=\"true\"\n (onEditInit)=\"onCellEditInit($event)\">\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th *ngFor=\"let col of cols\">\n {{ col.label }}\n </th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-item let-rowIndex=\"rowIndex\">\n <ng-container *ngIf=\"formGroupByRow[rowIndex]\" [formGroup]=\"formGroupByRow[rowIndex]\">\n <tr>\n <!-- Tipo de Chave -->\n <td class=\"ui-md-6 ui-sm-12 required\"\n [pEditableColumn]=\"item.pixKeyType\" pEditableColumnField=\"pixKeyType\">\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <div style=\"width: 100%; position: relative;\">\n <p-autoComplete\n [suggestions]=\"suggestions\"\n (completeMethod)=\"filterPixKeyType($event)\"\n formControlName=\"pixKeyType\"\n [dropdown]=\"true\"\n (onSelect)=\"onPixKeyTypeChange($event, rowIndex)\"\n (onClear)=\"onPixKeyTypeClear(rowIndex)\"\n (ngModelChange)=\"onSyncValue('pixKeyType', rowIndex)\"\n field=\"value\"\n placeholder=\"{{'hcm.payroll.select' | translate}}\"\n appendTo=\"body\"\n [panelStyle]=\"{ maxWidth: '300px', width: '100%' }\"\n [inputStyle]=\"{ width: '100%' }\"\n ></p-autoComplete>\n\n <s-control-errors [control]=\"formGroupByRow[rowIndex]?.get('pixKeyType')\"\n [errorMessages]=\"{\n required: 'hcm.payroll.required' | translate,\n pixKeyTypeBankAccountDuplicate: 'hcm.payroll.historical_pix_key_type_bank_account_duplicate' | translate\n }\">\n </s-control-errors>\n </div>\n </ng-template>\n <ng-template pTemplate=\"output\">\n {{ item.pixKeyType?.value }}\n </ng-template>\n </p-cellEditor>\n </td>\n\n <!-- Chave Pix -->\n <td class=\"ui-md-6 ui-sm-12 required\"\n [pEditableColumn]=\"item.pixKey\" pEditableColumnField=\"pixKey\">\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <div class=\"ui-fluid\">\n <!-- \u00C1rea de inputs din\u00E2micos -->\n <div [ngSwitch]=\"getPixKeyType(item)\" class=\"ui-fluid\">\n <!-- CPF -->\n <p-inputMask *ngSwitchCase=\"'CPF'\"\n mask=\"999.999.999-99\"\n unmask=\"true\"\n [(ngModel)]=\"item.pixKey\"\n [ngModelOptions]=\"{standalone: true}\"\n styleClass=\"full-width-input\"\n [ngClass]=\"{'ng-invalid': isInvalid(rowIndex, 'pixKey')}\"\n (onComplete)=\"validateDocumentField(rowIndex, 'CPF')\"\n (onBlur)=\"onDocumentBlur(rowIndex)\"\n (keydown.tab)=\"onDocumentBlur(rowIndex)\"\n (keydown.shift.tab)=\"onDocumentBlur(rowIndex)\"\n (keydown.enter)=\"onDocumentBlur(rowIndex)\"\n (keydown.esc)=\"onDocumentBlur(rowIndex)\"\n (keydown.shift.esc)=\"onDocumentBlur(rowIndex)\">\n </p-inputMask>\n\n <!-- CNPJ -->\n <p-inputMask *ngSwitchCase=\"'CNPJ'\"\n mask=\"99.999.999/9999-99\"\n unmask=\"true\"\n [(ngModel)]=\"item.pixKey\"\n [ngModelOptions]=\"{standalone: true}\"\n styleClass=\"full-width-input\"\n [ngClass]=\"{'ng-invalid': isInvalid(rowIndex, 'pixKey')}\"\n (onComplete)=\"validateDocumentField(rowIndex, 'CNPJ')\"\n (onBlur)=\"onDocumentBlur(rowIndex)\"\n (keydown.tab)=\"onDocumentBlur(rowIndex)\"\n (keydown.shift.tab)=\"onDocumentBlur(rowIndex)\"\n (keydown.enter)=\"onDocumentBlur(rowIndex)\"\n (keydown.esc)=\"onDocumentBlur(rowIndex)\"\n (keydown.shift.esc)=\"onDocumentBlur(rowIndex)\">\n </p-inputMask>\n\n <!-- TELEPHONE -->\n <p-inputMask *ngSwitchCase=\"'TELEPHONE'\"\n mask=\"(99) 99999-9999\"\n unmask=\"true\"\n [(ngModel)]=\"item.pixKey\"\n [ngModelOptions]=\"{standalone: true}\"\n styleClass=\"full-width-input\"\n [ngClass]=\"{'ng-invalid': isInvalid(rowIndex, 'pixKey')}\"\n (onComplete)=\"validateDocumentField(rowIndex, 'TELEPHONE')\"\n (onBlur)=\"onDocumentBlur(rowIndex)\"\n (keydown.tab)=\"onDocumentBlur(rowIndex)\"\n (keydown.shift.tab)=\"onDocumentBlur(rowIndex)\"\n (keydown.enter)=\"onDocumentBlur(rowIndex)\"\n (keydown.esc)=\"onDocumentBlur(rowIndex)\"\n (keydown.shift.esc)=\"onDocumentBlur(rowIndex)\">\n </p-inputMask>\n\n <!-- EMAIL -->\n <input *ngSwitchCase=\"'EMAIL'\"\n type=\"email\"\n pInputText\n class=\"p-inputtext p-component full-width-input\"\n [(ngModel)]=\"item.pixKey\"\n [ngModelOptions]=\"{standalone: true}\"\n [ngClass]=\"{'ng-invalid': isInvalid(rowIndex, 'pixKey')}\"\n (blur)=\"validateDocumentField(rowIndex, 'EMAIL'); onDocumentBlur(rowIndex)\"\n (keydown.tab)=\"onDocumentBlur(rowIndex)\"\n (keydown.shift.tab)=\"onDocumentBlur(rowIndex)\"\n (keydown.enter)=\"onDocumentBlur(rowIndex)\"\n (keydown.esc)=\"onDocumentBlur(rowIndex)\"\n (keydown.shift.esc)=\"onDocumentBlur(rowIndex)\">\n\n <!-- RANDOM_KEY -->\n <input *ngSwitchCase=\"'RANDOM_KEY'\"\n type=\"text\"\n pInputText\n class=\"p-inputtext p-component full-width-input\"\n [(ngModel)]=\"item.pixKey\"\n [ngModelOptions]=\"{standalone: true}\"\n [ngClass]=\"{'ng-invalid': isInvalid(rowIndex, 'pixKey')}\"\n (blur)=\"validateDocumentField(rowIndex, 'RANDOM_KEY'); onDocumentBlur(rowIndex)\"\n (keydown.tab)=\"onDocumentBlur(rowIndex)\"\n (keydown.shift.tab)=\"onDocumentBlur(rowIndex)\"\n (keydown.enter)=\"onDocumentBlur(rowIndex)\"\n (keydown.esc)=\"onDocumentBlur(rowIndex)\"\n (keydown.shift.esc)=\"onDocumentBlur(rowIndex)\">\n\n <!-- BANK_ACCOUNT -->\n <input *ngSwitchCase=\"'BANK_ACCOUNT'\"\n type=\"text\"\n pInputText\n class=\"p-inputtext p-component full-width-input\"\n [disabled]=\"true\">\n </div>\n\n <!-- \u00DAnico s-control-errors para todos os tipos -->\n <small *ngIf=\"isInvalid(rowIndex, 'pixKey')\" class=\"p-error error-text\">\n {{getErrorMessage(rowIndex, 'pixKey')}}\n </small>\n </div>\n </ng-template>\n <ng-template pTemplate=\"output\">\n {{getFormattedPixKey(getPixKeyType(item), item.pixKey)}}\n </ng-template>\n </p-cellEditor>\n </td>\n\n <!-- Percentual -->\n <td class=\"ui-md-6 ui-sm-12 required\"\n [pEditableColumn]=\"item.percentage\" pEditableColumnField=\"percentage\">\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <input\n pInputText type=\"number\"\n formControlName=\"percentage\"\n (ngModelChange)=\"onSyncValue('percentage', rowIndex)\"\n >\n <s-control-errors\n [control]=\"formGroupByRow[rowIndex]?.get('percentage')\"\n [errorMessages]=\"{\n required: 'hcm.payroll.required' | translate,\n maxlength: 'hcm.payroll.error_max_length' | translate: { value: '6' },\n max: 'hcm.payroll.error_max_value_number' | translate: { value: maxValuePercentage },\n min: 'hcm.payroll.error_min_value_number' | translate: { value: '0,01' }\n }\">\n </s-control-errors>\n </ng-template>\n <ng-template pTemplate=\"output\">\n {{ formatPercentage(item.percentage) }}%\n </ng-template>\n </p-cellEditor>\n </td>\n\n <!-- Bot\u00E3o de excluir -->\n <td>\n <s-button\n id=\"btn-delete\"\n label=\"{{ 'hcm.payroll.delete' | translate }}\"\n priority=\"default\"\n (onClick)=\"deletePix(rowIndex)\">\n </s-button>\n </td>\n </tr>\n </ng-container>\n </ng-template>\n </p-table>\n</div>\n",
10014
+ 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}:host ::ng-deep .p-cell-editing{padding:0!important}:host ::ng-deep .full-width-input{width:100%!important;min-height:34px!important;padding:6px 12px!important}:host ::ng-deep .p-inputtext{width:100%;min-height:34px;padding:6px 12px}:host ::ng-deep .p-inputmask{width:100%;display:block}:host ::ng-deep .p-inputmask .p-inputmask-input{width:100%!important;min-height:34px!important;padding:6px 12px!important}:host ::ng-deep p-celleditor{width:100%}:host ::ng-deep p-celleditor .ui-fluid{width:100%;display:block;padding:0}:host ::ng-deep .p-error{margin-top:4px;font-size:12px}:host ::ng-deep .error-text{color:#f44336;display:block;margin-top:4px;font-size:.875em}"]
9630
10015
  })
9631
10016
  ], HistoricalPixAccountComponent);
9632
10017
 
@@ -9821,7 +10206,7 @@ HistoricalPixAccountFormComponent = __decorate([
9821
10206
  Component({
9822
10207
  selector: "pix-account",
9823
10208
  template: "<div id=\"main\">\n <form *ngIf=\"showField || !(hideFields | async)\" [formGroup]=\"pixAccountFormGroup\" autocomplete=\"off\">\n <div class=\"ui-fluid\">\n <div class=\"ui-g\">\n <!-- Tipo de chave -->\n <div class=\"ui-md-6 ui-sm-12 required\">\n <label>{{'hcm.payroll.employees_addition_pix_key_type'|translate}}</label>\n <input-rest-auto-complete-enum [dropdown]=\"true\" server=\"payroll\"\n enumeration=\"PixKeyType\"\n placeholder=\"{{'hcm.payroll.select' | translate}}\"\n name=\"pixKeyType\" [form]=\"pixAccountFormGroup\"\n (onSelect)=\"onChangePixKeyType($event)\"\n (onClear)=\"onClearPixKeyType()\"\n id=\"ta-pixKeyType\"></input-rest-auto-complete-enum>\n <s-control-errors [control]=\"pixAccountFormGroup.get('pixKeyType')\"\n [errorMessages]=\"{\n required: 'hcm.payroll.required' | translate,\n pixKeyTypeBankAccountDuplicate: 'hcm.payroll.historical_pix_key_type_bank_account_duplicate' | translate\n }\">\n </s-control-errors>\n </div>\n <!--Chave Pix-->\n <div class=\"ui-md-6 ui-sm-12\" [ngClass]=\"{'required': pixKeyType !== 'BANK_ACCOUNT'}\">\n <label>{{'hcm.payroll.employees_addition_pix_key' | translate}}</label>\n <ng-container [ngSwitch]=\"pixKeyType\">\n <input *ngSwitchCase=\"'TELEPHONE'\" only-number\n pInputText id=\"ta-pixKey\" name=\"pixKey\" formControlName=\"pixKey\"\n (keyup)=\"phoneMask($event)\" maxlength=\"15\"\n placeholder=\"(__) ____-____\">\n <p-inputMask *ngSwitchCase=\"'CPF'\"\n id=\"ta-pixKey\" name=\"pixKey\" formControlName=\"pixKey\"\n placeholder=\"___.___.___-__\"\n mask=\"999.999.999-99\" [unmask]=\"true\"></p-inputMask>\n <p-inputMask *ngSwitchCase=\"'CNPJ'\"\n id=\"ta-pixKey\" name=\"pixKey\" formControlName=\"pixKey\"\n placeholder=\"__.___.___/____-__\"\n mask=\"99.999.999/9999-99\" [unmask]=\"true\"></p-inputMask>\n <input *ngSwitchCase=\"'EMAIL'\"\n pInputText id=\"ta-pixKey\" name=\"pixKey\" formControlName=\"pixKey\"\n placeholder=\"{{'hcm.payroll.employees_addition_email'|translate}}\"/>\n <input *ngSwitchCase=\"'BANK_ACCOUNT'\" disabled\n pInputText id=\"ta-pixKey\" name=\"pixKey\" formControlName=\"pixKey\"/>\n <input *ngSwitchDefault\n pInputText id=\"ta-pixKey\" name=\"pixKey\" formControlName=\"pixKey\" maxlength=\"100\" />\n </ng-container>\n <s-control-errors *ngIf=\"isShowPixKeyFieldValidatorMessage\" id=\"er-pix-key\"\n [control]=\"pixAccountFormGroup.get('pixKey')\"\n [errorMessages]=\"{\n required: 'hcm.payroll.required' | translate,\n invalidPhoneNumber: 'hcm.payroll.employees_addition_invalid_phone_number' | translate: { value: pixAccountFormGroup.get('pixKey').value },\n invalidEmail: 'hcm.payroll.employees_addition_email_invalid' | translate,\n cpfNotValid: 'hcm.payroll.employees_addition_cpf_error' | translate,\n cnpjNotValid: 'hcm.payroll.employees_addition_cnpj_error' | translate\n }\">\n </s-control-errors>\n </div>\n <!--Percentual-->\n <div class=\"ui-md-6 ui-sm-12 required\">\n <label id=\"lb-percentage\"\n for=\"ff-percentage\">{{ 'hcm.payroll.historical_bank_account_label_percentage' | translate }}</label>\n <div class=\"ui-inputgroup\">\n <span class=\"ui-inputgroup-addon\">%</span>\n <input pInputText id=\"ff-percentage\" name=\"percentage\"\n formControlName=\"percentage\"\n currencyMask\n [options]=\"optionsPercentage\"\n [placeholder]=\"percentagePlaceholder\"/>\n </div>\n <s-control-errors [control]=\"pixAccountFormGroup.get('percentage')\"\n [errorMessages]=\"{\n required: 'hcm.payroll.required' | translate,\n maxlength: 'hcm.payroll.error_max_length' | translate: { value: '6' },\n max: 'hcm.payroll.error_max_value_number' | translate: { value: maxValuePercentage },\n min: 'hcm.payroll.error_min_value_number' | translate: { value: '0,01' }\n }\">\n </s-control-errors>\n </div>\n <div class=\"ui-g-12\">\n <p-fieldset\n legend=\"{{ 'hcm.payroll.custom_fields' | translate }}\"\n [attr.data-hidden]=\"!customFields || !customFields.fields.length\"\n >\n <s-custom-fields\n domain=\"hcm\"\n service=\"{{customService}}\"\n entity=\"{{customEntity}}\"\n formControlName=\"customFields\"\n [invalidErrorLabel]=\"'hcm.payroll.employees_invalid_field' | translate\"\n >\n </s-custom-fields>\n </p-fieldset>\n </div>\n </div>\n </div>\n </form>\n\n <div [ngClass]=\"withSideBar ? 'footer' : 'footer-s-border'\">\n <div class=\"form-group\">\n <s-button id=\"btn-save\" label=\"{{ labelBtnAdd | translate}}\" priority=\"primary\"\n (onClick)=\"addItem()\" *ngIf=\"visibleBtnSave && !this.isView\"></s-button>\n <s-button *ngIf=\"withSideBar\" id=\"btn-close\" label=\"{{'hcm.payroll.cancel'|translate}}\" priority=\"secondary\"\n priority=\"link\" (onClick)=\"close()\"></s-button>\n </div>\n </div>\n</div>\n",
9824
- 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}"]
10209
+ 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}:host ::ng-deep .p-cell-editing{padding:0!important}:host ::ng-deep .full-width-input{width:100%!important;min-height:34px!important;padding:6px 12px!important}:host ::ng-deep .p-inputtext{width:100%;min-height:34px;padding:6px 12px}:host ::ng-deep .p-inputmask{width:100%;display:block}:host ::ng-deep .p-inputmask .p-inputmask-input{width:100%!important;min-height:34px!important;padding:6px 12px!important}:host ::ng-deep p-celleditor{width:100%}:host ::ng-deep p-celleditor .ui-fluid{width:100%;display:block;padding:0}:host ::ng-deep .p-error{margin-top:4px;font-size:12px}:host ::ng-deep .error-text{color:#f44336;display:block;margin-top:4px;font-size:.875em}"]
9825
10210
  })
9826
10211
  ], HistoricalPixAccountFormComponent);
9827
10212
 
@@ -9904,6 +10289,7 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
9904
10289
  this.endPoint = "hcm/payroll/queries/historicalEmployeePixQuery";
9905
10290
  this.keyPayload = "historicalEmployeePix";
9906
10291
  this.withSidebar = true;
10292
+ this.showActionsButtonOnAdd = false;
9907
10293
  this.isOnlyView = new EventEmitter();
9908
10294
  this.isOnlyEdit = new EventEmitter();
9909
10295
  this.enableView = new EventEmitter();
@@ -9956,11 +10342,13 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
9956
10342
  this.isOnlyEdit.emit(false);
9957
10343
  this.isHideBtnAddForViewMode.emit(true);
9958
10344
  this.sharedStateService.setHideBtnAddForViewMode(true);
10345
+ this.sharedStateService.setActiveHideOptionsOnView(true);
9959
10346
  this.router.navigate([`historical-pix-account/${dateChange}`], {
9960
10347
  relativeTo: this.activatedRoute,
9961
10348
  });
9962
10349
  }
9963
10350
  else {
10351
+ this.sharedStateService.setActiveHideOptionsOnView(true);
9964
10352
  this.sharedStateService.setSaveButton(false);
9965
10353
  this.enableView.emit(dateChange);
9966
10354
  }
@@ -9983,11 +10371,13 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
9983
10371
  this.isOnlyEdit.emit(true);
9984
10372
  this.isHideBtnAddForViewMode.emit(false);
9985
10373
  this.sharedStateService.setHideBtnAddForViewMode(false);
10374
+ this.sharedStateService.setActiveHideOptionsOnView(false);
9986
10375
  this.router.navigate([`historical-pix-account/${dateChange}`], {
9987
10376
  relativeTo: this.activatedRoute,
9988
10377
  });
9989
10378
  }
9990
10379
  else {
10380
+ this.sharedStateService.setActiveHideOptionsOnView(false);
9991
10381
  setTimeout(() => {
9992
10382
  this.sharedStateService.triggerActiveValidatorsOnEditModalOpen();
9993
10383
  });
@@ -10148,6 +10538,9 @@ __decorate([
10148
10538
  __decorate([
10149
10539
  Input()
10150
10540
  ], HistoricalPixAccountListComponent.prototype, "hideField", void 0);
10541
+ __decorate([
10542
+ Input()
10543
+ ], HistoricalPixAccountListComponent.prototype, "showActionsButtonOnAdd", void 0);
10151
10544
  __decorate([
10152
10545
  Output()
10153
10546
  ], HistoricalPixAccountListComponent.prototype, "isOnlyView", void 0);