@senior-gestao-pessoas/payroll-core 9.5.0-71c63479-42df-4b8e-8295-7f214bdd37f5 → 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 (26) hide show
  1. package/bundles/senior-gestao-pessoas-payroll-core.umd.js +542 -85
  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 -11
  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 +478 -80
  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 +488 -80
  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 +532 -85
  22. package/fesm2015/senior-gestao-pessoas-payroll-core.js.map +1 -1
  23. package/fesm5/senior-gestao-pessoas-payroll-core.js +542 -85
  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,13 +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
- this.maxValuePercentage = 100.00;
9037
9063
  this.hideFields = this.sharedStateService.hideField$;
9038
9064
  this.suggestions = [];
9039
9065
  this.formGroupByRow = {};
9066
+ this.isSyncingPercentage = false;
9040
9067
  this.cols = [
9041
9068
  {
9042
9069
  label: this.translateService.instant("hcm.payroll.employees_addition_pix_key_type"),
@@ -9112,14 +9139,17 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9112
9139
  this.createFormGroup();
9113
9140
  }
9114
9141
  ngOnInit() {
9142
+ this.showFields = this.showField;
9115
9143
  this.formGroup.setControl(this.fieldFormGroup, this.historicalPixAccountList);
9116
- this.sharedStateService.showButton$.subscribe((value) => {
9117
- this.showButtonView = value;
9118
- });
9119
9144
  this.sharedStateService.showEditMode$.subscribe((value) => {
9120
9145
  this.showEditMode = value;
9121
9146
  this.isEditModeForSave = value;
9122
9147
  });
9148
+ this.sharedStateService.activeHideOptionsOnView$.subscribe((value) => {
9149
+ if (value) {
9150
+ this.showButtonView = false;
9151
+ }
9152
+ });
9123
9153
  this.sharedStateService.activeValidatorsOnEditModalOpen$
9124
9154
  .subscribe(() => {
9125
9155
  Object.values(this.formGroupByRow).forEach(fg => {
@@ -9130,6 +9160,7 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9130
9160
  });
9131
9161
  this.emitFormValidity();
9132
9162
  });
9163
+ this.resetFormState();
9133
9164
  }
9134
9165
  ngOnChanges(changes) {
9135
9166
  if (changes['listDataReciever'] && changes['listDataReciever'].currentValue) {
@@ -9142,6 +9173,10 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9142
9173
  const newData = changes['addExistentHistoricData'].currentValue;
9143
9174
  this.rebuildFormGroupMap(newData);
9144
9175
  }
9176
+ if (changes['isEditMode']) {
9177
+ this.isEditMode = changes['isEditMode'].currentValue;
9178
+ this.cd.detectChanges();
9179
+ }
9145
9180
  }
9146
9181
  createFormGroup() {
9147
9182
  this.historicalPixAccountList = this.formBuilder.group({
@@ -9156,9 +9191,31 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9156
9191
  this.cd.detectChanges();
9157
9192
  }
9158
9193
  emitFormValidity() {
9159
- 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
+ });
9160
9215
  fg.updateValueAndValidity();
9161
- return fg.valid;
9216
+ if (!fg.valid) {
9217
+ allValid = false;
9218
+ }
9162
9219
  });
9163
9220
  this.isValidChangeForm.emit(allValid);
9164
9221
  }
@@ -9176,66 +9233,28 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9176
9233
  }
9177
9234
  createPixRowFormGroup() {
9178
9235
  return this.formBuilder.group({
9236
+ id: [null],
9179
9237
  pixKeyType: [null, Validators.required],
9180
9238
  pixKey: [null],
9181
9239
  percentage: [0, Validators.compose([
9182
9240
  ...this.initialValidatorOfPercentage,
9183
9241
  Validators.max(this.maxValuePercentage),
9184
- ])]
9242
+ ])],
9243
+ externalId: [null],
9185
9244
  });
9186
9245
  }
9187
- onPixKeyInput(event, index) {
9188
- const inputValue = event.target.value;
9189
- const inputRawValue = inputValue.replace(/\D/g, '');
9190
- const form = this.formGroupByRow[index];
9191
- const pixKeyControl = form.get('pixKey');
9192
- if (pixKeyControl) {
9193
- pixKeyControl.setValue(inputRawValue, { emitEvent: false });
9194
- pixKeyControl.markAsDirty();
9195
- pixKeyControl.updateValueAndValidity();
9196
- }
9197
- this.setPixKeyValidators(true, form);
9198
- this.emitFormValidity();
9199
- }
9200
- onBlurPixCpfAndCnpj(index) {
9201
- const form = this.formGroupByRow[index];
9202
- const pixKeyControl = form.get('pixKey');
9203
- const pixKeyTypeControl = form.get('pixKeyType');
9204
- if (!pixKeyControl || !pixKeyTypeControl)
9205
- return;
9206
- const currentValue = pixKeyControl.value;
9207
- const pixKeyType = pixKeyTypeControl.value.key;
9208
- const rawValue = (currentValue || '').replace(/\D/g, '');
9209
- pixKeyControl.setValue(rawValue, { emitEvent: false });
9210
- if (pixKeyControl.valid) {
9211
- form.patchValue({
9212
- 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
9213
9256
  });
9214
9257
  }
9215
- this.emitFormValidity();
9216
- }
9217
- getFormattedPixKey(type, value) {
9218
- return FormatUtilsService.getFormattedSubscriptionNumber(value, type);
9219
- }
9220
- syncPixDataToParentForm() {
9221
- if (!this.isEditModeForSave)
9222
- return;
9223
- const values = Object.values(this.formGroupByRow).map(fg => {
9224
- const value = fg.getRawValue();
9225
- const pixKeyType = value.pixKeyType.key;
9226
- if (pixKeyType === 'CPF' || pixKeyType === 'CNPJ') {
9227
- value.pixKey = (value.pixKey || '').replace(/[.\-\/]/g, '');
9228
- }
9229
- else if (pixKeyType === 'TELEPHONE') {
9230
- value.pixKey = (value.pixKey || '').replace(/[()\s\-]/g, '');
9231
- }
9232
- return value;
9233
- });
9234
- this.formGroup
9235
- .get(this.fieldFormGroup)
9236
- .get('historicalPixAccountList')
9237
- .setValue(values);
9238
- this.emitFormValidity();
9239
9258
  }
9240
9259
  syncResetPixFormToParent() {
9241
9260
  this.formGroupByRow = {};
@@ -9245,6 +9264,45 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9245
9264
  this.rebuildFormGroupMap(this.addExistentHistoricData);
9246
9265
  }
9247
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
+ }
9248
9306
  onLazyLoad(event) {
9249
9307
  const first = event && event.first ? event.first : 0;
9250
9308
  const rows = event && event.rows ? event.rows : this.recordByRow;
@@ -9291,9 +9349,11 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9291
9349
  }
9292
9350
  addPix() {
9293
9351
  const newItem = {
9352
+ id: null,
9294
9353
  pixKeyType: {},
9295
9354
  pixKey: '',
9296
- percentage: 0
9355
+ percentage: '',
9356
+ externalId: '',
9297
9357
  };
9298
9358
  const index = this.addExistentHistoricData.length;
9299
9359
  this.addExistentHistoricData = [
@@ -9305,8 +9365,26 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9305
9365
  this.emitFormValidity();
9306
9366
  }
9307
9367
  deletePix(index) {
9368
+ if (this.dataListPix.editingCell) {
9369
+ this.dataListPix.editingCell = null;
9370
+ }
9308
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
+ }
9309
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
+ });
9310
9388
  this.emitFormValidity();
9311
9389
  }
9312
9390
  rebuildFormGroupMap(data) {
@@ -9326,6 +9404,10 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9326
9404
  this.pixKeyType = pixKeyType;
9327
9405
  this.setPixKeyValidators(true, form);
9328
9406
  this.setValidatorsAccordingList(data, index, this.isEditMode);
9407
+ const listValues = data
9408
+ .filter((_, i) => i !== index)
9409
+ .map(row => row.percentage ? parseFloat(row.percentage) : 0);
9410
+ this.validatePercentageValid(listValues, form);
9329
9411
  });
9330
9412
  this.emitFormValidity();
9331
9413
  }
@@ -9404,20 +9486,366 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9404
9486
  this.msgTotalLimitByPercentage = null;
9405
9487
  }
9406
9488
  }
9489
+ formatPercentage(value) {
9490
+ if (value == null || value === '' || isNaN(Number(value))) {
9491
+ return '0.00';
9492
+ }
9493
+ return Number(value).toFixed(2);
9494
+ }
9407
9495
  onSyncValue(field, index) {
9408
9496
  if (this.formGroupByRow &&
9409
9497
  this.formGroupByRow[index] &&
9410
9498
  this.formGroupByRow[index].get(field)) {
9411
- const value = this.formGroupByRow[index].get(field).value;
9499
+ const control = this.formGroupByRow[index].get(field);
9500
+ const value = control.value;
9412
9501
  this.addExistentHistoricData[index][field] = value;
9502
+ control.markAsDirty();
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
+ }
9516
+ control.updateValueAndValidity();
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
+ }
9553
+ });
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();
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 });
9413
9692
  }
9693
+ form.updateValueAndValidity();
9414
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;
9838
+ }
9839
+ const totalPercentage = this.addExistentHistoricData
9840
+ .reduce((sum, item) => sum + (parseFloat(item.percentage) || 0), 0);
9841
+ return totalPercentage >= 100;
9415
9842
  }
9416
9843
  get scopedActions() {
9417
9844
  return this.actions.bind(this);
9418
9845
  }
9419
9846
  get recordsMessage() {
9420
- 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")}`;
9421
9849
  }
9422
9850
  get getTooltipAndDisableButtonAdd() {
9423
9851
  return this.dateChange ? null : this.msgTooltipAdd;
@@ -9459,21 +9887,6 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends
9459
9887
  this._visible = value;
9460
9888
  this.visibleChange.emit(this.visible);
9461
9889
  }
9462
- close() {
9463
- this.visible = false;
9464
- }
9465
- getFormattedTelephoneNumber(telephoneNumber) {
9466
- return FormatUtilsService.getFormattedTelephoneNumber(telephoneNumber);
9467
- }
9468
- getFormattedCpf(cpf) {
9469
- return FormatUtilsService.getFormattedCpf(cpf);
9470
- }
9471
- getFormattedCnpj(cnpj) {
9472
- return FormatUtilsService.getFormattedCnpj(cnpj);
9473
- }
9474
- getFormattedPercentage(value) {
9475
- return FormatUtilsService.getFormattedPercentage(value);
9476
- }
9477
9890
  get isAllowToAddHistorical() {
9478
9891
  return (this.permission["incluir"]);
9479
9892
  }
@@ -9554,6 +9967,15 @@ __decorate([
9554
9967
  __decorate([
9555
9968
  Input()
9556
9969
  ], HistoricalPixAccountComponent.prototype, "isEditModeForSave", void 0);
9970
+ __decorate([
9971
+ Input()
9972
+ ], HistoricalPixAccountComponent.prototype, "showField", void 0);
9973
+ __decorate([
9974
+ Input()
9975
+ ], HistoricalPixAccountComponent.prototype, "hideBtnAddForViewMode", void 0);
9976
+ __decorate([
9977
+ Input()
9978
+ ], HistoricalPixAccountComponent.prototype, "showButtonView", void 0);
9557
9979
  __decorate([
9558
9980
  Output()
9559
9981
  ], HistoricalPixAccountComponent.prototype, "isViewModeActive", void 0);
@@ -9588,8 +10010,8 @@ HistoricalPixAccountComponent = __decorate([
9588
10010
  Component({
9589
10011
  // tslint:disable-next-line:component-selector
9590
10012
  selector: "c-historical-pix-account",
9591
- 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 <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",
9592
- 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}"]
9593
10015
  })
9594
10016
  ], HistoricalPixAccountComponent);
9595
10017
 
@@ -9600,6 +10022,7 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
9600
10022
  this.sharedStateService = sharedStateService;
9601
10023
  this.withSideBar = true;
9602
10024
  this.isEditMode = false;
10025
+ this.showField = false;
9603
10026
  this.visibleChange = new EventEmitter();
9604
10027
  this.pixAccountItemToList = new EventEmitter();
9605
10028
  this.ngUnsubscribe = new Subject();
@@ -9677,8 +10100,6 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
9677
10100
  this.visible = false;
9678
10101
  }
9679
10102
  addItem() {
9680
- this.pixAccountFormGroup.updateValueAndValidity();
9681
- verifyValidationsForm.call(this.pixAccountFormGroup);
9682
10103
  if (this.pixAccountFormGroup.valid) {
9683
10104
  if (this.employeeId) {
9684
10105
  this.pixAccountFormGroup.get("employee").setValue({
@@ -9754,6 +10175,9 @@ __decorate([
9754
10175
  __decorate([
9755
10176
  Input()
9756
10177
  ], HistoricalPixAccountFormComponent.prototype, "isEditMode", void 0);
10178
+ __decorate([
10179
+ Input()
10180
+ ], HistoricalPixAccountFormComponent.prototype, "showField", void 0);
9757
10181
  __decorate([
9758
10182
  Output()
9759
10183
  ], HistoricalPixAccountFormComponent.prototype, "visibleChange", void 0);
@@ -9781,8 +10205,8 @@ __decorate([
9781
10205
  HistoricalPixAccountFormComponent = __decorate([
9782
10206
  Component({
9783
10207
  selector: "pix-account",
9784
- 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",
9785
- 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}"]
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",
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}"]
9786
10210
  })
9787
10211
  ], HistoricalPixAccountFormComponent);
9788
10212
 
@@ -9865,10 +10289,13 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
9865
10289
  this.endPoint = "hcm/payroll/queries/historicalEmployeePixQuery";
9866
10290
  this.keyPayload = "historicalEmployeePix";
9867
10291
  this.withSidebar = true;
10292
+ this.showActionsButtonOnAdd = false;
9868
10293
  this.isOnlyView = new EventEmitter();
9869
10294
  this.isOnlyEdit = new EventEmitter();
9870
10295
  this.enableView = new EventEmitter();
9871
10296
  this.isEditJudicialDependentPix = new EventEmitter();
10297
+ this.isHideBtnAddForViewMode = new EventEmitter();
10298
+ this.isShowActionsButton = new EventEmitter();
9872
10299
  this.ngUnsubscribe = new Subject();
9873
10300
  this.loading = true;
9874
10301
  this.columns = [
@@ -9907,16 +10334,21 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
9907
10334
  command: () => {
9908
10335
  if (this.isAllowToViewHistorical) {
9909
10336
  this.sharedStateService.setHideField(true);
9910
- this.sharedStateService.setShowButton(false);
10337
+ this.isShowActionsButton.emit(false);
9911
10338
  this.sharedStateService.setShowEditMode(false);
9912
10339
  const dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, this.dateFormat).format("YYYY-MM-DD");
9913
10340
  if (this.withSidebar) {
9914
10341
  this.isOnlyView.emit(true);
10342
+ this.isOnlyEdit.emit(false);
10343
+ this.isHideBtnAddForViewMode.emit(true);
10344
+ this.sharedStateService.setHideBtnAddForViewMode(true);
10345
+ this.sharedStateService.setActiveHideOptionsOnView(true);
9915
10346
  this.router.navigate([`historical-pix-account/${dateChange}`], {
9916
10347
  relativeTo: this.activatedRoute,
9917
10348
  });
9918
10349
  }
9919
10350
  else {
10351
+ this.sharedStateService.setActiveHideOptionsOnView(true);
9920
10352
  this.sharedStateService.setSaveButton(false);
9921
10353
  this.enableView.emit(dateChange);
9922
10354
  }
@@ -9931,15 +10363,21 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
9931
10363
  command: () => {
9932
10364
  if (this.isAllowToEditHistorical) {
9933
10365
  this.sharedStateService.setHideField(true);
9934
- this.sharedStateService.setShowButton(false);
10366
+ this.isShowActionsButton.emit(true);
9935
10367
  this.sharedStateService.setShowEditMode(true);
9936
10368
  const dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, this.dateFormat).format("YYYY-MM-DD");
9937
10369
  if (this.withSidebar) {
10370
+ this.isOnlyView.emit(false);
10371
+ this.isOnlyEdit.emit(true);
10372
+ this.isHideBtnAddForViewMode.emit(false);
10373
+ this.sharedStateService.setHideBtnAddForViewMode(false);
10374
+ this.sharedStateService.setActiveHideOptionsOnView(false);
9938
10375
  this.router.navigate([`historical-pix-account/${dateChange}`], {
9939
10376
  relativeTo: this.activatedRoute,
9940
10377
  });
9941
10378
  }
9942
10379
  else {
10380
+ this.sharedStateService.setActiveHideOptionsOnView(false);
9943
10381
  setTimeout(() => {
9944
10382
  this.sharedStateService.triggerActiveValidatorsOnEditModalOpen();
9945
10383
  });
@@ -10100,6 +10538,9 @@ __decorate([
10100
10538
  __decorate([
10101
10539
  Input()
10102
10540
  ], HistoricalPixAccountListComponent.prototype, "hideField", void 0);
10541
+ __decorate([
10542
+ Input()
10543
+ ], HistoricalPixAccountListComponent.prototype, "showActionsButtonOnAdd", void 0);
10103
10544
  __decorate([
10104
10545
  Output()
10105
10546
  ], HistoricalPixAccountListComponent.prototype, "isOnlyView", void 0);
@@ -10112,6 +10553,12 @@ __decorate([
10112
10553
  __decorate([
10113
10554
  Output()
10114
10555
  ], HistoricalPixAccountListComponent.prototype, "isEditJudicialDependentPix", void 0);
10556
+ __decorate([
10557
+ Output()
10558
+ ], HistoricalPixAccountListComponent.prototype, "isHideBtnAddForViewMode", void 0);
10559
+ __decorate([
10560
+ Output()
10561
+ ], HistoricalPixAccountListComponent.prototype, "isShowActionsButton", void 0);
10115
10562
  __decorate([
10116
10563
  Input()
10117
10564
  ], HistoricalPixAccountListComponent.prototype, "hideFieldsOnAdd$", null);