@senior-gestao-pessoas/payroll-core 9.5.0-01923a3e-20f4-4cb3-9565-a0584abd00d1 → 9.5.0-32c4c8b1-bb0c-491c-8ec0-0eef83fe1088

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 (26) hide show
  1. package/bundles/senior-gestao-pessoas-payroll-core.umd.js +530 -86
  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-form/historical-pix-account-form.component.d.ts +1 -0
  6. package/components/historical-pix-account/historical-pix-account.component.d.ts +71 -10
  7. package/components/historical-pix-account-list/historical-pix-account-list.component.d.ts +3 -0
  8. package/components/shared/shared-state.service.d.ts +8 -0
  9. package/esm2015/components/historical-pix-account/historical-pix-account-base.js +9 -2
  10. package/esm2015/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.js +9 -7
  11. package/esm2015/components/historical-pix-account/historical-pix-account.component.js +466 -81
  12. package/esm2015/components/historical-pix-account-list/historical-pix-account-list.component.js +26 -3
  13. package/esm2015/components/shared/shared-state.service.js +17 -1
  14. package/esm2015/components/utils/format-utils/format-utils.service.js +3 -1
  15. package/esm5/components/historical-pix-account/historical-pix-account-base.js +9 -2
  16. package/esm5/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.js +9 -7
  17. package/esm5/components/historical-pix-account/historical-pix-account.component.js +476 -81
  18. package/esm5/components/historical-pix-account-list/historical-pix-account-list.component.js +26 -3
  19. package/esm5/components/shared/shared-state.service.js +17 -1
  20. package/esm5/components/utils/format-utils/format-utils.service.js +3 -1
  21. package/fesm2015/senior-gestao-pessoas-payroll-core.js +520 -86
  22. package/fesm2015/senior-gestao-pessoas-payroll-core.js.map +1 -1
  23. package/fesm5/senior-gestao-pessoas-payroll-core.js +530 -86
  24. package/fesm5/senior-gestao-pessoas-payroll-core.js.map +1 -1
  25. package/package.json +1 -1
  26. 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;
@@ -8617,6 +8619,10 @@ let SharedStateService = class SharedStateService {
8617
8619
  this.showEditMode$ = this.showEditMode.asObservable();
8618
8620
  this.activeValidatorsOnEditModalOpen = new Subject();
8619
8621
  this.activeValidatorsOnEditModalOpen$ = this.activeValidatorsOnEditModalOpen.asObservable();
8622
+ this.hideBtnAddForViewMode = new BehaviorSubject(false);
8623
+ this.hideBtnAddForViewMode$ = this.hideBtnAddForViewMode.asObservable();
8624
+ this.activeHideOptionsOnView = new BehaviorSubject(true);
8625
+ this.activeHideOptionsOnView$ = this.activeHideOptionsOnView.asObservable();
8620
8626
  }
8621
8627
  setHideField(value) {
8622
8628
  this.hideFieldSubject.next(value);
@@ -8633,6 +8639,18 @@ let SharedStateService = class SharedStateService {
8633
8639
  triggerActiveValidatorsOnEditModalOpen() {
8634
8640
  this.activeValidatorsOnEditModalOpen.next();
8635
8641
  }
8642
+ setHideBtnAddForViewMode(value) {
8643
+ this.hideBtnAddForViewMode.next(value);
8644
+ }
8645
+ resetHideField() {
8646
+ this.hideFieldSubject.next(true);
8647
+ }
8648
+ setActiveHideOptionsOnView(value) {
8649
+ this.activeHideOptionsOnView.next(value);
8650
+ }
8651
+ getActiveHideOptionsOnView() {
8652
+ return this.activeHideOptionsOnView.getValue();
8653
+ }
8636
8654
  };
8637
8655
  SharedStateService.ngInjectableDef = ɵɵdefineInjectable({ factory: function SharedStateService_Factory() { return new SharedStateService(); }, token: SharedStateService, providedIn: "root" });
8638
8656
  SharedStateService = __decorate([
@@ -8935,10 +8953,17 @@ class HistoricakPixAccountBase {
8935
8953
  case "RANDOM_KEY":
8936
8954
  pixKey.setValidators(Validators.required);
8937
8955
  break;
8956
+ case "BANK_ACCOUNT":
8957
+ pixKey.clearValidators();
8958
+ pixKey.setValue('');
8959
+ break;
8938
8960
  default:
8939
8961
  pixKey.clearValidators();
8940
8962
  }
8941
- if (isEditMode) {
8963
+ if (this.pixKeyType === "BANK_ACCOUNT") {
8964
+ pixKey.disable();
8965
+ }
8966
+ else if (isEditMode) {
8942
8967
  pixKey.enable();
8943
8968
  }
8944
8969
  pixKey.updateValueAndValidity();
@@ -9013,6 +9038,9 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9013
9038
  this.addExistentHistoricData = [];
9014
9039
  this.getListPixAccount = [];
9015
9040
  this.isEditModeForSave = false;
9041
+ this.showField = false;
9042
+ this.hideBtnAddForViewMode = false;
9043
+ this.showButtonView = true;
9016
9044
  this.isViewModeActive = new EventEmitter();
9017
9045
  this.isEditModeActive = new EventEmitter();
9018
9046
  this.isDeleteModeActive = new EventEmitter();
@@ -9030,12 +9058,12 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9030
9058
  this.loading = true;
9031
9059
  this.listData = [];
9032
9060
  this.listDataNoPage = [];
9033
- this.showButtonView = true;
9034
9061
  this.showEditMode = false;
9035
9062
  this.hasRecordsPix = true;
9036
9063
  this.hideFields = this.sharedStateService.hideField$;
9037
9064
  this.suggestions = [];
9038
9065
  this.formGroupByRow = {};
9066
+ this.isSyncingPercentage = false;
9039
9067
  this.cols = [
9040
9068
  {
9041
9069
  label: this.translateService.instant("hcm.payroll.employees_addition_pix_key_type"),
@@ -9111,14 +9139,17 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9111
9139
  this.createFormGroup();
9112
9140
  }
9113
9141
  ngOnInit() {
9142
+ this.showFields = this.showField;
9114
9143
  this.formGroup.setControl(this.fieldFormGroup, this.historicalPixAccountList);
9115
- this.sharedStateService.showButton$.subscribe((value) => {
9116
- this.showButtonView = value;
9117
- });
9118
9144
  this.sharedStateService.showEditMode$.subscribe((value) => {
9119
9145
  this.showEditMode = value;
9120
9146
  this.isEditModeForSave = value;
9121
9147
  });
9148
+ this.sharedStateService.activeHideOptionsOnView$.subscribe((value) => {
9149
+ if (value) {
9150
+ this.showButtonView = false;
9151
+ }
9152
+ });
9122
9153
  this.sharedStateService.activeValidatorsOnEditModalOpen$
9123
9154
  .subscribe(() => {
9124
9155
  Object.values(this.formGroupByRow).forEach(fg => {
@@ -9129,6 +9160,7 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9129
9160
  });
9130
9161
  this.emitFormValidity();
9131
9162
  });
9163
+ this.resetFormState();
9132
9164
  }
9133
9165
  ngOnChanges(changes) {
9134
9166
  if (changes['listDataReciever'] && changes['listDataReciever'].currentValue) {
@@ -9141,6 +9173,10 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9141
9173
  const newData = changes['addExistentHistoricData'].currentValue;
9142
9174
  this.rebuildFormGroupMap(newData);
9143
9175
  }
9176
+ if (changes['isEditMode']) {
9177
+ this.isEditMode = changes['isEditMode'].currentValue;
9178
+ this.cd.detectChanges();
9179
+ }
9144
9180
  }
9145
9181
  createFormGroup() {
9146
9182
  this.historicalPixAccountList = this.formBuilder.group({
@@ -9155,9 +9191,31 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9155
9191
  this.cd.detectChanges();
9156
9192
  }
9157
9193
  emitFormValidity() {
9158
- 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
+ });
9159
9215
  fg.updateValueAndValidity();
9160
- return fg.valid;
9216
+ if (!fg.valid) {
9217
+ allValid = false;
9218
+ }
9161
9219
  });
9162
9220
  this.isValidChangeForm.emit(allValid);
9163
9221
  }
@@ -9175,66 +9233,28 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9175
9233
  }
9176
9234
  createPixRowFormGroup() {
9177
9235
  return this.formBuilder.group({
9236
+ id: [null],
9178
9237
  pixKeyType: [null, Validators.required],
9179
9238
  pixKey: [null],
9180
9239
  percentage: [0, Validators.compose([
9181
9240
  ...this.initialValidatorOfPercentage,
9182
9241
  Validators.max(this.maxValuePercentage),
9183
- ])]
9242
+ ])],
9243
+ externalId: [null],
9184
9244
  });
9185
9245
  }
9186
- onPixKeyInput(event, index) {
9187
- const inputValue = event.target.value;
9188
- const inputRawValue = inputValue.replace(/\D/g, '');
9189
- const form = this.formGroupByRow[index];
9190
- const pixKeyControl = form.get('pixKey');
9191
- if (pixKeyControl) {
9192
- pixKeyControl.setValue(inputRawValue, { emitEvent: false });
9193
- pixKeyControl.markAsDirty();
9194
- pixKeyControl.updateValueAndValidity();
9195
- }
9196
- this.setPixKeyValidators(true, form);
9197
- this.emitFormValidity();
9198
- }
9199
- onBlurPixCpfAndCnpj(index) {
9200
- const form = this.formGroupByRow[index];
9201
- const pixKeyControl = form.get('pixKey');
9202
- const pixKeyTypeControl = form.get('pixKeyType');
9203
- if (!pixKeyControl || !pixKeyTypeControl)
9204
- return;
9205
- const currentValue = pixKeyControl.value;
9206
- const pixKeyType = pixKeyTypeControl.value.key;
9207
- const rawValue = (currentValue || '').replace(/\D/g, '');
9208
- pixKeyControl.setValue(rawValue, { emitEvent: false });
9209
- if (pixKeyControl.valid) {
9210
- form.patchValue({
9211
- 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
9212
9256
  });
9213
9257
  }
9214
- this.emitFormValidity();
9215
- }
9216
- getFormattedPixKey(type, value) {
9217
- return FormatUtilsService.getFormattedSubscriptionNumber(value, type);
9218
- }
9219
- syncPixDataToParentForm() {
9220
- if (!this.isEditModeForSave)
9221
- return;
9222
- const values = Object.values(this.formGroupByRow).map(fg => {
9223
- const value = fg.getRawValue();
9224
- const pixKeyType = value.pixKeyType.key;
9225
- if (pixKeyType === 'CPF' || pixKeyType === 'CNPJ') {
9226
- value.pixKey = (value.pixKey || '').replace(/[.\-\/]/g, '');
9227
- }
9228
- else if (pixKeyType === 'TELEPHONE') {
9229
- value.pixKey = (value.pixKey || '').replace(/[()\s\-]/g, '');
9230
- }
9231
- return value;
9232
- });
9233
- this.formGroup
9234
- .get(this.fieldFormGroup)
9235
- .get('historicalPixAccountList')
9236
- .setValue(values);
9237
- this.emitFormValidity();
9238
9258
  }
9239
9259
  syncResetPixFormToParent() {
9240
9260
  this.formGroupByRow = {};
@@ -9244,6 +9264,45 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9244
9264
  this.rebuildFormGroupMap(this.addExistentHistoricData);
9245
9265
  }
9246
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
+ }
9247
9306
  onLazyLoad(event) {
9248
9307
  const first = event && event.first ? event.first : 0;
9249
9308
  const rows = event && event.rows ? event.rows : this.recordByRow;
@@ -9290,9 +9349,11 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9290
9349
  }
9291
9350
  addPix() {
9292
9351
  const newItem = {
9352
+ id: null,
9293
9353
  pixKeyType: {},
9294
9354
  pixKey: '',
9295
- percentage: 0
9355
+ percentage: '',
9356
+ externalId: '',
9296
9357
  };
9297
9358
  const index = this.addExistentHistoricData.length;
9298
9359
  this.addExistentHistoricData = [
@@ -9308,7 +9369,22 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9308
9369
  this.dataListPix.editingCell = null;
9309
9370
  }
9310
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
+ }
9311
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
+ });
9312
9388
  this.emitFormValidity();
9313
9389
  }
9314
9390
  rebuildFormGroupMap(data) {
@@ -9381,6 +9457,7 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9381
9457
  }
9382
9458
  $event["dateChange"] = this.dateChange;
9383
9459
  newDataList.push($event);
9460
+ this.addExistentHistoricData.push(Object.assign({}, $event));
9384
9461
  }
9385
9462
  this.historicalPixAccountList.get("historicalPixAccountList").setValue(newDataList);
9386
9463
  this.verifyTotalPercentage();
@@ -9410,6 +9487,12 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9410
9487
  this.msgTotalLimitByPercentage = null;
9411
9488
  }
9412
9489
  }
9490
+ formatPercentage(value) {
9491
+ if (value == null || value === '' || isNaN(Number(value))) {
9492
+ return '0.00';
9493
+ }
9494
+ return Number(value).toFixed(2);
9495
+ }
9413
9496
  onSyncValue(field, index) {
9414
9497
  if (this.formGroupByRow &&
9415
9498
  this.formGroupByRow[index] &&
@@ -9419,19 +9502,351 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9419
9502
  this.addExistentHistoricData[index][field] = value;
9420
9503
  control.markAsDirty();
9421
9504
  control.markAsTouched();
9505
+ if (field === 'percentage') {
9506
+ const currentList = this.addExistentHistoricData
9507
+ .map((item, i) => i === index ? 0 : (parseFloat(item.percentage) || 0));
9508
+ this.validatePercentageValid(currentList, this.formGroupByRow[index]);
9509
+ if (!this.isSyncingPercentage) {
9510
+ this.isSyncingPercentage = true;
9511
+ setTimeout(() => {
9512
+ this.syncPixDataToParentForm();
9513
+ this.isSyncingPercentage = false;
9514
+ }, 0);
9515
+ }
9516
+ }
9422
9517
  control.updateValueAndValidity();
9423
- const currentList = this.addExistentHistoricData.map((item, i) => {
9424
- return i === index ? 0 : item.percentage;
9518
+ this.formGroupByRow[index].updateValueAndValidity();
9519
+ this.emitFormValidity();
9520
+ }
9521
+ }
9522
+ close() {
9523
+ this.visible = false;
9524
+ }
9525
+ getFormattedTelephoneNumber(telephoneNumber) {
9526
+ return FormatUtilsService.getFormattedTelephoneNumber(telephoneNumber);
9527
+ }
9528
+ getFormattedCpf(cpf) {
9529
+ return FormatUtilsService.getFormattedCpf(cpf);
9530
+ }
9531
+ getFormattedCnpj(cnpj) {
9532
+ return FormatUtilsService.getFormattedCnpj(cnpj);
9533
+ }
9534
+ getFormattedPercentage(value) {
9535
+ return FormatUtilsService.getFormattedPercentage(value);
9536
+ }
9537
+ /**
9538
+ * Reseta completamente o estado do formulário e controles
9539
+ */
9540
+ resetFormState() {
9541
+ if (this.formGroupByRow) {
9542
+ Object.values(this.formGroupByRow).forEach(form => {
9543
+ if (form) {
9544
+ Object.keys(form.controls).forEach(controlName => {
9545
+ const control = form.get(controlName);
9546
+ if (control) {
9547
+ control.setErrors(null);
9548
+ control.markAsUntouched();
9549
+ control.markAsPristine();
9550
+ }
9551
+ });
9552
+ form.updateValueAndValidity();
9553
+ }
9425
9554
  });
9426
- this.validatePercentageValid(currentList, this.formGroupByRow[index]);
9555
+ }
9556
+ if (this.dataListPix) {
9557
+ if (typeof this.dataListPix.closeAllCellEditors === 'function') {
9558
+ try {
9559
+ this.dataListPix.closeAllCellEditors();
9560
+ }
9561
+ catch (e) {
9562
+ console.error('Erro ao tentar fechar cell editors:', e);
9563
+ }
9564
+ }
9565
+ else if (this.dataListPix.editingCell) {
9566
+ this.dataListPix.editingCell = null;
9567
+ }
9568
+ if (this.dataListPix.editing !== undefined) {
9569
+ this.dataListPix.editing = false;
9570
+ }
9571
+ }
9572
+ this.cd.detectChanges();
9573
+ }
9574
+ /**
9575
+ * Formata a chave PIX para exibição baseada no tipo
9576
+ */
9577
+ getFormattedPixKey(pixKeyType, pixKey) {
9578
+ if (!pixKey)
9579
+ return '';
9580
+ switch (pixKeyType) {
9581
+ case 'CPF':
9582
+ return FormatUtilsService.getFormattedCpf(pixKey);
9583
+ case 'CNPJ':
9584
+ return FormatUtilsService.getFormattedCnpj(pixKey);
9585
+ case 'TELEPHONE':
9586
+ return FormatUtilsService.getFormattedTelephoneNumber(pixKey);
9587
+ case 'EMAIL':
9588
+ case 'RANDOM_KEY':
9589
+ default:
9590
+ return pixKey;
9591
+ }
9592
+ }
9593
+ /**
9594
+ * Obtém o tipo de chave PIX do item atual
9595
+ */
9596
+ getPixKeyType(item) {
9597
+ return item && item.pixKeyType && item.pixKeyType.key || '';
9598
+ }
9599
+ /**
9600
+ * Verifica se um controle está inválido para os campos editáveis
9601
+ */
9602
+ isInvalid(index, controlName) {
9603
+ const form = this.formGroupByRow[index];
9604
+ if (!form)
9605
+ return false;
9606
+ const control = form.get(controlName);
9607
+ if (!control)
9608
+ return false;
9609
+ return control.invalid && (control.touched || control.dirty);
9610
+ }
9611
+ /**
9612
+ * Método chamado quando uma célula entra no modo de edição
9613
+ */
9614
+ onCellEditInit(event) {
9615
+ const rowIndex = this.addExistentHistoricData.findIndex(item => item === event.data);
9616
+ if (rowIndex < 0)
9617
+ return;
9618
+ const form = this.formGroupByRow[rowIndex];
9619
+ if (form && form.get('pixKey')) {
9620
+ const pixKeyControl = form.get('pixKey');
9621
+ const currentValue = this.addExistentHistoricData[rowIndex].pixKey;
9622
+ pixKeyControl.setValue(currentValue);
9623
+ }
9624
+ }
9625
+ /**
9626
+ * Recupera o FormControl específico para um campo em determinado índice
9627
+ */
9628
+ getFormControl(index, controlName) {
9629
+ const form = this.formGroupByRow[index];
9630
+ if (!form)
9631
+ return null;
9632
+ return form.get(controlName);
9633
+ }
9634
+ /**
9635
+ * Valida campos de documento (CPF, CNPJ) quando o usuário termina de digitar no form de edição
9636
+ */
9637
+ validateDocumentField(index, fieldType) {
9638
+ const form = this.formGroupByRow[index];
9639
+ const item = this.addExistentHistoricData[index];
9640
+ if (!form || !item)
9641
+ return;
9642
+ const pixKeyControl = form.get('pixKey');
9643
+ if (!pixKeyControl)
9644
+ return;
9645
+ let value = item.pixKey;
9646
+ pixKeyControl.setValue(value);
9647
+ if (fieldType === 'CPF' || fieldType === 'CNPJ' || fieldType === 'TELEPHONE') {
9648
+ value = value ? value.toString().replace(/\D/g, '') : '';
9649
+ item.pixKey = value;
9650
+ pixKeyControl.setValue(value);
9651
+ }
9652
+ if (!value || value.toString().trim() === '') {
9653
+ pixKeyControl.setErrors({ required: true });
9654
+ pixKeyControl.markAsTouched();
9655
+ form.updateValueAndValidity();
9427
9656
  this.emitFormValidity();
9657
+ return;
9428
9658
  }
9659
+ let cleanValue = value;
9660
+ if (fieldType === 'CPF' || fieldType === 'CNPJ') {
9661
+ cleanValue = value.toString().replace(/\D/g, '');
9662
+ item.pixKey = cleanValue;
9663
+ pixKeyControl.setValue(cleanValue);
9664
+ }
9665
+ let isValid = false;
9666
+ switch (fieldType) {
9667
+ case 'CPF':
9668
+ isValid = cleanValue.length === 11 && GenericValidator.isValidCpf({ value: cleanValue }) === null;
9669
+ break;
9670
+ case 'CNPJ':
9671
+ isValid = cleanValue.length === 14 && GenericValidator.isValidCnpj({ value: cleanValue }) === null;
9672
+ break;
9673
+ case 'TELEPHONE':
9674
+ cleanValue = value.toString().replace(/\D/g, '');
9675
+ isValid = GenericValidator.isValidPhoneNumber({ value: cleanValue }) === null;
9676
+ break;
9677
+ case 'EMAIL':
9678
+ isValid = GenericValidator.isValidEmail({ value }) === null;
9679
+ break;
9680
+ case 'RANDOM_KEY':
9681
+ isValid = true;
9682
+ break;
9683
+ default:
9684
+ isValid = true;
9685
+ }
9686
+ pixKeyControl.markAsTouched();
9687
+ if (isValid) {
9688
+ pixKeyControl.setErrors(null);
9689
+ }
9690
+ else {
9691
+ const errorType = this.getErrorTypeForField(fieldType);
9692
+ pixKeyControl.setErrors({ [errorType]: true });
9693
+ }
9694
+ form.updateValueAndValidity();
9695
+ this.emitFormValidity();
9696
+ this.cd.detectChanges();
9697
+ }
9698
+ /**
9699
+ * Obtém o tipo de erro para cada tipo de campo editável
9700
+ */
9701
+ getErrorTypeForField(fieldType) {
9702
+ switch (fieldType) {
9703
+ case 'CPF': return 'invalidCpf';
9704
+ case 'CNPJ': return 'invalidCnpj';
9705
+ case 'TELEPHONE': return 'invalidPhoneNumber';
9706
+ case 'EMAIL': return 'invalidEmail';
9707
+ default: return 'required';
9708
+ }
9709
+ }
9710
+ /**
9711
+ * Retorna a mensagem de erro apropriada para um campo
9712
+ */
9713
+ getErrorMessage(index, controlName) {
9714
+ const form = this.formGroupByRow[index];
9715
+ if (!form)
9716
+ return '';
9717
+ const control = form.get(controlName);
9718
+ if (!control || !control.errors)
9719
+ return '';
9720
+ const fieldValue = control.value || '';
9721
+ if (control.hasError('required')) {
9722
+ return this.translateService.instant('hcm.payroll.required');
9723
+ }
9724
+ if (control.hasError('invalidCpf')) {
9725
+ return this.translateService.instant('hcm.payroll.employees_addition_cpf_error');
9726
+ }
9727
+ else if (control.hasError('invalidCnpj')) {
9728
+ return this.translateService.instant('hcm.payroll.employees_addition_cnpj_error');
9729
+ }
9730
+ else if (control.hasError('invalidEmail')) {
9731
+ return this.translateService.instant('hcm.payroll.employees_addition_email_invalid');
9732
+ }
9733
+ else if (control.hasError('invalidPhoneNumber')) {
9734
+ return this.translateService.instant('hcm.payroll.employees_addition_invalid_phone_number', { value: fieldValue });
9735
+ }
9736
+ return '';
9737
+ }
9738
+ /**
9739
+ * Tratamento ao perder o foco em campos de documento
9740
+ */
9741
+ onDocumentBlur(index) {
9742
+ const form = this.formGroupByRow[index];
9743
+ const item = this.addExistentHistoricData[index];
9744
+ if (!form || !item)
9745
+ return;
9746
+ const pixKeyControl = form.get('pixKey');
9747
+ const pixKeyTypeControl = form.get('pixKeyType');
9748
+ if (!pixKeyControl || !pixKeyTypeControl.value)
9749
+ return;
9750
+ const pixKeyType = pixKeyTypeControl.value.key;
9751
+ let value = item.pixKey;
9752
+ if (pixKeyType === 'CPF' || pixKeyType === 'CNPJ' || pixKeyType === 'TELEPHONE') {
9753
+ value = value ? value.toString().replace(/\D/g, '') : '';
9754
+ item.pixKey = value;
9755
+ }
9756
+ pixKeyControl.setValue(value);
9757
+ this.validateDocumentField(index, pixKeyType);
9758
+ if (value) {
9759
+ if (pixKeyType === 'CPF') {
9760
+ item.pixKeyFormatted = FormatUtilsService.getFormattedCpf(value);
9761
+ }
9762
+ else if (pixKeyType === 'CNPJ') {
9763
+ item.pixKeyFormatted = FormatUtilsService.getFormattedCnpj(value);
9764
+ }
9765
+ else if (pixKeyType === 'TELEPHONE') {
9766
+ item.pixKeyFormatted = FormatUtilsService.getFormattedTelephoneNumber(value);
9767
+ }
9768
+ else {
9769
+ item.pixKeyFormatted = value;
9770
+ }
9771
+ }
9772
+ this.finishEditing();
9773
+ }
9774
+ finishEditing() {
9775
+ this.syncAllModelToForm();
9776
+ this.cd.detectChanges();
9777
+ }
9778
+ clearErrorsTemporarily(rowIndex) {
9779
+ const form = this.formGroupByRow[rowIndex];
9780
+ if (form && form.get('pixKey')) {
9781
+ const currentValue = form.get('pixKey').value;
9782
+ form.get('pixKey').setErrors(null);
9783
+ form.get('pixKey').setValue(currentValue);
9784
+ }
9785
+ }
9786
+ closeEditModeManually() {
9787
+ setTimeout(() => {
9788
+ if (this.dataListPix) {
9789
+ if (typeof this.dataListPix.closeAllCellEditors === 'function') {
9790
+ this.dataListPix.closeAllCellEditors();
9791
+ }
9792
+ else if (this.dataListPix.editingCell) {
9793
+ this.dataListPix.editingCell = null;
9794
+ }
9795
+ this.cd.detectChanges();
9796
+ }
9797
+ }, 100);
9798
+ }
9799
+ syncAllModelToForm() {
9800
+ if (!this.addExistentHistoricData || !this.formGroupByRow)
9801
+ return;
9802
+ this.addExistentHistoricData.forEach((item, index) => {
9803
+ const form = this.formGroupByRow[index];
9804
+ if (form) {
9805
+ Object.keys(form.controls).forEach(controlName => {
9806
+ const control = form.get(controlName);
9807
+ if (control && item[controlName] !== undefined) {
9808
+ control.setValue(item[controlName]);
9809
+ }
9810
+ });
9811
+ const pixKeyTypeControl = form.get('pixKeyType');
9812
+ if (pixKeyTypeControl.value) {
9813
+ this.validateDocumentField(index, pixKeyTypeControl.value.key);
9814
+ }
9815
+ }
9816
+ });
9817
+ }
9818
+ /**
9819
+ * Método para forçar o fechamento de todas as células em edição
9820
+ */
9821
+ forceCloseAllCellEditors() {
9822
+ this.finishEditing();
9823
+ this.syncAllModelToForm();
9824
+ }
9825
+ isPixKeyType(item, type) {
9826
+ return item && item.pixKeyType && item.pixKeyType.key === type;
9827
+ }
9828
+ getPixKey(rowData) {
9829
+ return rowData ? rowData.pixKey : null;
9830
+ }
9831
+ setPixKey(rowData, value) {
9832
+ if (rowData) {
9833
+ rowData.pixKey = value;
9834
+ }
9835
+ }
9836
+ get isTotalPercentage100() {
9837
+ if (!this.addExistentHistoricData || this.addExistentHistoricData.length === 0) {
9838
+ return false;
9839
+ }
9840
+ const totalPercentage = this.addExistentHistoricData
9841
+ .reduce((sum, item) => sum + (parseFloat(item.percentage) || 0), 0);
9842
+ return totalPercentage >= 100;
9429
9843
  }
9430
9844
  get scopedActions() {
9431
9845
  return this.actions.bind(this);
9432
9846
  }
9433
9847
  get recordsMessage() {
9434
- return `${this.totalRecords || 0} ${this.totalRecords === 1 ? this.translateService.instant("hcm.payroll.admission_register") : this.translateService.instant("hcm.payroll.admission_registers")}`;
9848
+ return `${this.totalRecords || 0} ${this.totalRecords === 1 ?
9849
+ this.translateService.instant("hcm.payroll.admission_register") : this.translateService.instant("hcm.payroll.admission_registers")}`;
9435
9850
  }
9436
9851
  get getTooltipAndDisableButtonAdd() {
9437
9852
  return this.dateChange ? null : this.msgTooltipAdd;
@@ -9473,21 +9888,6 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9473
9888
  this._visible = value;
9474
9889
  this.visibleChange.emit(this.visible);
9475
9890
  }
9476
- close() {
9477
- this.visible = false;
9478
- }
9479
- getFormattedTelephoneNumber(telephoneNumber) {
9480
- return FormatUtilsService.getFormattedTelephoneNumber(telephoneNumber);
9481
- }
9482
- getFormattedCpf(cpf) {
9483
- return FormatUtilsService.getFormattedCpf(cpf);
9484
- }
9485
- getFormattedCnpj(cnpj) {
9486
- return FormatUtilsService.getFormattedCnpj(cnpj);
9487
- }
9488
- getFormattedPercentage(value) {
9489
- return FormatUtilsService.getFormattedPercentage(value);
9490
- }
9491
9891
  get isAllowToAddHistorical() {
9492
9892
  return (this.permission["incluir"]);
9493
9893
  }
@@ -9568,6 +9968,15 @@ __decorate([
9568
9968
  __decorate([
9569
9969
  Input()
9570
9970
  ], HistoricalPixAccountComponent.prototype, "isEditModeForSave", void 0);
9971
+ __decorate([
9972
+ Input()
9973
+ ], HistoricalPixAccountComponent.prototype, "showField", void 0);
9974
+ __decorate([
9975
+ Input()
9976
+ ], HistoricalPixAccountComponent.prototype, "hideBtnAddForViewMode", void 0);
9977
+ __decorate([
9978
+ Input()
9979
+ ], HistoricalPixAccountComponent.prototype, "showButtonView", void 0);
9571
9980
  __decorate([
9572
9981
  Output()
9573
9982
  ], HistoricalPixAccountComponent.prototype, "isViewModeActive", void 0);
@@ -9602,8 +10011,8 @@ HistoricalPixAccountComponent = __decorate([
9602
10011
  Component({
9603
10012
  // tslint:disable-next-line:component-selector
9604
10013
  selector: "c-historical-pix-account",
9605
- 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<!-- Template exlusivo para edi\u00E7\u00E3o de pix via modal-->\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\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",
9606
- 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}"]
10014
+ 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",
10015
+ 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}"]
9607
10016
  })
9608
10017
  ], HistoricalPixAccountComponent);
9609
10018
 
@@ -9614,6 +10023,7 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
9614
10023
  this.sharedStateService = sharedStateService;
9615
10024
  this.withSideBar = true;
9616
10025
  this.isEditMode = false;
10026
+ this.showField = false;
9617
10027
  this.visibleChange = new EventEmitter();
9618
10028
  this.pixAccountItemToList = new EventEmitter();
9619
10029
  this.ngUnsubscribe = new Subject();
@@ -9691,8 +10101,6 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
9691
10101
  this.visible = false;
9692
10102
  }
9693
10103
  addItem() {
9694
- this.pixAccountFormGroup.updateValueAndValidity();
9695
- verifyValidationsForm.call(this.pixAccountFormGroup);
9696
10104
  if (this.pixAccountFormGroup.valid) {
9697
10105
  if (this.employeeId) {
9698
10106
  this.pixAccountFormGroup.get("employee").setValue({
@@ -9768,6 +10176,9 @@ __decorate([
9768
10176
  __decorate([
9769
10177
  Input()
9770
10178
  ], HistoricalPixAccountFormComponent.prototype, "isEditMode", void 0);
10179
+ __decorate([
10180
+ Input()
10181
+ ], HistoricalPixAccountFormComponent.prototype, "showField", void 0);
9771
10182
  __decorate([
9772
10183
  Output()
9773
10184
  ], HistoricalPixAccountFormComponent.prototype, "visibleChange", void 0);
@@ -9795,8 +10206,8 @@ __decorate([
9795
10206
  HistoricalPixAccountFormComponent = __decorate([
9796
10207
  Component({
9797
10208
  selector: "pix-account",
9798
- 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",
9799
- 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
+ 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",
10210
+ 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}"]
9800
10211
  })
9801
10212
  ], HistoricalPixAccountFormComponent);
9802
10213
 
@@ -9879,10 +10290,13 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
9879
10290
  this.endPoint = "hcm/payroll/queries/historicalEmployeePixQuery";
9880
10291
  this.keyPayload = "historicalEmployeePix";
9881
10292
  this.withSidebar = true;
10293
+ this.showActionsButtonOnAdd = false;
9882
10294
  this.isOnlyView = new EventEmitter();
9883
10295
  this.isOnlyEdit = new EventEmitter();
9884
10296
  this.enableView = new EventEmitter();
9885
10297
  this.isEditJudicialDependentPix = new EventEmitter();
10298
+ this.isHideBtnAddForViewMode = new EventEmitter();
10299
+ this.isShowActionsButton = new EventEmitter();
9886
10300
  this.ngUnsubscribe = new Subject();
9887
10301
  this.loading = true;
9888
10302
  this.columns = [
@@ -9921,16 +10335,21 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
9921
10335
  command: () => {
9922
10336
  if (this.isAllowToViewHistorical) {
9923
10337
  this.sharedStateService.setHideField(true);
9924
- this.sharedStateService.setShowButton(false);
10338
+ this.isShowActionsButton.emit(false);
9925
10339
  this.sharedStateService.setShowEditMode(false);
9926
10340
  const dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, this.dateFormat).format("YYYY-MM-DD");
9927
10341
  if (this.withSidebar) {
9928
10342
  this.isOnlyView.emit(true);
10343
+ this.isOnlyEdit.emit(false);
10344
+ this.isHideBtnAddForViewMode.emit(true);
10345
+ this.sharedStateService.setHideBtnAddForViewMode(true);
10346
+ this.sharedStateService.setActiveHideOptionsOnView(true);
9929
10347
  this.router.navigate([`historical-pix-account/${dateChange}`], {
9930
10348
  relativeTo: this.activatedRoute,
9931
10349
  });
9932
10350
  }
9933
10351
  else {
10352
+ this.sharedStateService.setActiveHideOptionsOnView(true);
9934
10353
  this.sharedStateService.setSaveButton(false);
9935
10354
  this.enableView.emit(dateChange);
9936
10355
  }
@@ -9945,15 +10364,21 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
9945
10364
  command: () => {
9946
10365
  if (this.isAllowToEditHistorical) {
9947
10366
  this.sharedStateService.setHideField(true);
9948
- this.sharedStateService.setShowButton(false);
10367
+ this.isShowActionsButton.emit(true);
9949
10368
  this.sharedStateService.setShowEditMode(true);
9950
10369
  const dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, this.dateFormat).format("YYYY-MM-DD");
9951
10370
  if (this.withSidebar) {
10371
+ this.isOnlyView.emit(false);
10372
+ this.isOnlyEdit.emit(true);
10373
+ this.isHideBtnAddForViewMode.emit(false);
10374
+ this.sharedStateService.setHideBtnAddForViewMode(false);
10375
+ this.sharedStateService.setActiveHideOptionsOnView(false);
9952
10376
  this.router.navigate([`historical-pix-account/${dateChange}`], {
9953
10377
  relativeTo: this.activatedRoute,
9954
10378
  });
9955
10379
  }
9956
10380
  else {
10381
+ this.sharedStateService.setActiveHideOptionsOnView(false);
9957
10382
  setTimeout(() => {
9958
10383
  this.sharedStateService.triggerActiveValidatorsOnEditModalOpen();
9959
10384
  });
@@ -10114,6 +10539,9 @@ __decorate([
10114
10539
  __decorate([
10115
10540
  Input()
10116
10541
  ], HistoricalPixAccountListComponent.prototype, "hideField", void 0);
10542
+ __decorate([
10543
+ Input()
10544
+ ], HistoricalPixAccountListComponent.prototype, "showActionsButtonOnAdd", void 0);
10117
10545
  __decorate([
10118
10546
  Output()
10119
10547
  ], HistoricalPixAccountListComponent.prototype, "isOnlyView", void 0);
@@ -10126,6 +10554,12 @@ __decorate([
10126
10554
  __decorate([
10127
10555
  Output()
10128
10556
  ], HistoricalPixAccountListComponent.prototype, "isEditJudicialDependentPix", void 0);
10557
+ __decorate([
10558
+ Output()
10559
+ ], HistoricalPixAccountListComponent.prototype, "isHideBtnAddForViewMode", void 0);
10560
+ __decorate([
10561
+ Output()
10562
+ ], HistoricalPixAccountListComponent.prototype, "isShowActionsButton", void 0);
10129
10563
  __decorate([
10130
10564
  Input()
10131
10565
  ], HistoricalPixAccountListComponent.prototype, "hideFieldsOnAdd$", null);