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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/bundles/senior-gestao-pessoas-payroll-core.umd.js +480 -77
  2. package/bundles/senior-gestao-pessoas-payroll-core.umd.js.map +1 -1
  3. package/bundles/senior-gestao-pessoas-payroll-core.umd.min.js +2 -2
  4. package/bundles/senior-gestao-pessoas-payroll-core.umd.min.js.map +1 -1
  5. package/components/historical-pix-account/historical-pix-account.component.d.ts +67 -9
  6. package/components/historical-pix-account-list/historical-pix-account-list.component.d.ts +1 -0
  7. package/components/shared/shared-state.service.d.ts +4 -0
  8. package/esm2015/components/historical-pix-account/historical-pix-account-base.js +9 -2
  9. package/esm2015/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.js +1 -1
  10. package/esm2015/components/historical-pix-account/historical-pix-account.component.js +446 -77
  11. package/esm2015/components/historical-pix-account-list/historical-pix-account-list.component.js +9 -1
  12. package/esm2015/components/shared/shared-state.service.js +9 -1
  13. package/esm2015/components/utils/format-utils/format-utils.service.js +3 -1
  14. package/esm5/components/historical-pix-account/historical-pix-account-base.js +9 -2
  15. package/esm5/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.js +1 -1
  16. package/esm5/components/historical-pix-account/historical-pix-account.component.js +456 -77
  17. package/esm5/components/historical-pix-account-list/historical-pix-account-list.component.js +9 -1
  18. package/esm5/components/shared/shared-state.service.js +9 -1
  19. package/esm5/components/utils/format-utils/format-utils.service.js +3 -1
  20. package/fesm2015/senior-gestao-pessoas-payroll-core.js +470 -77
  21. package/fesm2015/senior-gestao-pessoas-payroll-core.js.map +1 -1
  22. package/fesm5/senior-gestao-pessoas-payroll-core.js +480 -77
  23. package/fesm5/senior-gestao-pessoas-payroll-core.js.map +1 -1
  24. package/package.json +1 -1
  25. package/senior-gestao-pessoas-payroll-core.metadata.json +1 -1
@@ -9318,6 +9318,7 @@ var FormatUtilsService = /** @class */ (function () {
9318
9318
  */
9319
9319
  FormatUtilsService.formatCpfInputEvent = function (event) {
9320
9320
  var cpf = event.target.value;
9321
+ console.log("FormatUtilsService.formatCpfInputEvent.cpf: " + cpf);
9321
9322
  // Permite apagar nos pontos sensíveis
9322
9323
  if (event.keyCode === 8 && (cpf.length === 4 || cpf.length === 8 || cpf.length === 12)) {
9323
9324
  return;
@@ -9330,6 +9331,7 @@ var FormatUtilsService = /** @class */ (function () {
9330
9331
  */
9331
9332
  FormatUtilsService.formatCnpjInputEvent = function (event) {
9332
9333
  var cnpj = event.target.value;
9334
+ console.log("FormatUtilsService.formatCnpjInputEvent.cnpj: " + cnpj);
9333
9335
  // Permite apagar nos pontos sensíveis
9334
9336
  if (event.keyCode === 8 && (cnpj.length === 3 || cnpj.length === 7 || cnpj.length === 11 || cnpj.length === 16)) {
9335
9337
  return;
@@ -9353,6 +9355,8 @@ var SharedStateService = /** @class */ (function () {
9353
9355
  this.activeValidatorsOnEditModalOpen$ = this.activeValidatorsOnEditModalOpen.asObservable();
9354
9356
  this.hideBtnAddForViewMode = new BehaviorSubject(false);
9355
9357
  this.hideBtnAddForViewMode$ = this.hideBtnAddForViewMode.asObservable();
9358
+ this.activeHideOptionsOnView = new BehaviorSubject(true);
9359
+ this.activeHideOptionsOnView$ = this.activeHideOptionsOnView.asObservable();
9356
9360
  }
9357
9361
  SharedStateService.prototype.setHideField = function (value) {
9358
9362
  this.hideFieldSubject.next(value);
@@ -9375,6 +9379,12 @@ var SharedStateService = /** @class */ (function () {
9375
9379
  SharedStateService.prototype.resetHideField = function () {
9376
9380
  this.hideFieldSubject.next(true);
9377
9381
  };
9382
+ SharedStateService.prototype.setActiveHideOptionsOnView = function (value) {
9383
+ this.activeHideOptionsOnView.next(value);
9384
+ };
9385
+ SharedStateService.prototype.getActiveHideOptionsOnView = function () {
9386
+ return this.activeHideOptionsOnView.getValue();
9387
+ };
9378
9388
  SharedStateService.ngInjectableDef = ɵɵdefineInjectable({ factory: function SharedStateService_Factory() { return new SharedStateService(); }, token: SharedStateService, providedIn: "root" });
9379
9389
  SharedStateService = __decorate([
9380
9390
  Injectable({
@@ -9681,10 +9691,17 @@ var HistoricakPixAccountBase = /** @class */ (function () {
9681
9691
  case "RANDOM_KEY":
9682
9692
  pixKey.setValidators(Validators.required);
9683
9693
  break;
9694
+ case "BANK_ACCOUNT":
9695
+ pixKey.clearValidators();
9696
+ pixKey.setValue('');
9697
+ break;
9684
9698
  default:
9685
9699
  pixKey.clearValidators();
9686
9700
  }
9687
- if (isEditMode) {
9701
+ if (this.pixKeyType === "BANK_ACCOUNT") {
9702
+ pixKey.disable();
9703
+ }
9704
+ else if (isEditMode) {
9688
9705
  pixKey.enable();
9689
9706
  }
9690
9707
  pixKey.updateValueAndValidity();
@@ -9797,6 +9814,7 @@ var HistoricalPixAccountComponent = /** @class */ (function (_super) {
9797
9814
  _this.hideFields = _this.sharedStateService.hideField$;
9798
9815
  _this.suggestions = [];
9799
9816
  _this.formGroupByRow = {};
9817
+ _this.isSyncingPercentage = false;
9800
9818
  _this.cols = [
9801
9819
  {
9802
9820
  label: _this.translateService.instant("hcm.payroll.employees_addition_pix_key_type"),
@@ -9881,6 +9899,11 @@ var HistoricalPixAccountComponent = /** @class */ (function (_super) {
9881
9899
  _this.showEditMode = value;
9882
9900
  _this.isEditModeForSave = value;
9883
9901
  });
9902
+ this.sharedStateService.activeHideOptionsOnView$.subscribe(function (value) {
9903
+ if (value) {
9904
+ _this.showButtonView = false;
9905
+ }
9906
+ });
9884
9907
  this.sharedStateService.activeValidatorsOnEditModalOpen$
9885
9908
  .subscribe(function () {
9886
9909
  Object.values(_this.formGroupByRow).forEach(function (fg) {
@@ -9891,6 +9914,7 @@ var HistoricalPixAccountComponent = /** @class */ (function (_super) {
9891
9914
  });
9892
9915
  _this.emitFormValidity();
9893
9916
  });
9917
+ this.resetFormState();
9894
9918
  };
9895
9919
  HistoricalPixAccountComponent.prototype.ngOnChanges = function (changes) {
9896
9920
  if (changes['listDataReciever'] && changes['listDataReciever'].currentValue) {
@@ -9921,9 +9945,31 @@ var HistoricalPixAccountComponent = /** @class */ (function (_super) {
9921
9945
  this.cd.detectChanges();
9922
9946
  };
9923
9947
  HistoricalPixAccountComponent.prototype.emitFormValidity = function () {
9924
- var allValid = Object.values(this.formGroupByRow).every(function (fg) {
9948
+ if (!this.formGroupByRow || Object.keys(this.formGroupByRow).length === 0) {
9949
+ this.isValidChangeForm.emit(false);
9950
+ return;
9951
+ }
9952
+ var allValid = true;
9953
+ Object.values(this.formGroupByRow).forEach(function (fg) {
9954
+ // Verifica cada controle individualmente
9955
+ Object.keys(fg.controls).forEach(function (key) {
9956
+ var control = fg.get(key);
9957
+ // Verifica se o controle é obrigatório e está vazio
9958
+ if (control.validator && control.validator({})) {
9959
+ var validatorFn = control.validator({});
9960
+ if (validatorFn && validatorFn.required && !control.value) {
9961
+ allValid = false;
9962
+ }
9963
+ }
9964
+ // Verifica se o controle tem erros
9965
+ if (control.errors) {
9966
+ allValid = false;
9967
+ }
9968
+ });
9925
9969
  fg.updateValueAndValidity();
9926
- return fg.valid;
9970
+ if (!fg.valid) {
9971
+ allValid = false;
9972
+ }
9927
9973
  });
9928
9974
  this.isValidChangeForm.emit(allValid);
9929
9975
  };
@@ -9949,61 +9995,22 @@ var HistoricalPixAccountComponent = /** @class */ (function (_super) {
9949
9995
  pixKey: [null],
9950
9996
  percentage: [0, Validators.compose(__spread(this.initialValidatorOfPercentage, [
9951
9997
  Validators.max(this.maxValuePercentage),
9952
- ]))]
9998
+ ]))],
9999
+ externalId: [null],
9953
10000
  });
9954
10001
  };
9955
- HistoricalPixAccountComponent.prototype.onPixKeyInput = function (event, index) {
9956
- var inputValue = event.target.value;
9957
- var inputRawValue = inputValue.replace(/\D/g, '');
9958
- var form = this.formGroupByRow[index];
9959
- var pixKeyControl = form.get('pixKey');
9960
- if (pixKeyControl) {
9961
- pixKeyControl.setValue(inputRawValue, { emitEvent: false });
9962
- pixKeyControl.markAsDirty();
9963
- pixKeyControl.updateValueAndValidity();
9964
- }
9965
- this.setPixKeyValidators(true, form);
9966
- this.emitFormValidity();
9967
- };
9968
- HistoricalPixAccountComponent.prototype.onBlurPixCpfAndCnpj = function (index) {
9969
- var form = this.formGroupByRow[index];
9970
- var pixKeyControl = form.get('pixKey');
9971
- var pixKeyTypeControl = form.get('pixKeyType');
9972
- if (!pixKeyControl || !pixKeyTypeControl)
9973
- return;
9974
- var currentValue = pixKeyControl.value;
9975
- var pixKeyType = pixKeyTypeControl.value.key;
9976
- var rawValue = (currentValue || '').replace(/\D/g, '');
9977
- pixKeyControl.setValue(rawValue, { emitEvent: false });
9978
- if (pixKeyControl.valid) {
9979
- form.patchValue({
9980
- pixKeyFormatted: FormatUtilsService.getFormattedSubscriptionNumber(rawValue, pixKeyType)
10002
+ /**
10003
+ * Sincroniza todos os dados do NgModel para os FormGroups antes de enviar ao componente pai
10004
+ */
10005
+ HistoricalPixAccountComponent.prototype.syncPixDataToParentForm = function () {
10006
+ this.syncAllModelToForm();
10007
+ var historicalPix = __spread(this.addExistentHistoricData);
10008
+ this.historicalPixAccountList.get("historicalPixAccountList").setValue(historicalPix);
10009
+ if (this.formGroup) {
10010
+ this.formGroup.get(this.fieldFormGroup).patchValue({
10011
+ historicalPixAccountList: historicalPix
9981
10012
  });
9982
10013
  }
9983
- this.emitFormValidity();
9984
- };
9985
- HistoricalPixAccountComponent.prototype.getFormattedPixKey = function (type, value) {
9986
- return FormatUtilsService.getFormattedSubscriptionNumber(value, type);
9987
- };
9988
- HistoricalPixAccountComponent.prototype.syncPixDataToParentForm = function () {
9989
- if (!this.isEditModeForSave)
9990
- return;
9991
- var values = Object.values(this.formGroupByRow).map(function (fg) {
9992
- var value = fg.getRawValue();
9993
- var pixKeyType = value.pixKeyType.key;
9994
- if (pixKeyType === 'CPF' || pixKeyType === 'CNPJ') {
9995
- value.pixKey = (value.pixKey || '').replace(/[.\-\/]/g, '');
9996
- }
9997
- else if (pixKeyType === 'TELEPHONE') {
9998
- value.pixKey = (value.pixKey || '').replace(/[()\s\-]/g, '');
9999
- }
10000
- return value;
10001
- });
10002
- this.formGroup
10003
- .get(this.fieldFormGroup)
10004
- .get('historicalPixAccountList')
10005
- .setValue(values);
10006
- this.emitFormValidity();
10007
10014
  };
10008
10015
  HistoricalPixAccountComponent.prototype.syncResetPixFormToParent = function () {
10009
10016
  this.formGroupByRow = {};
@@ -10013,6 +10020,46 @@ var HistoricalPixAccountComponent = /** @class */ (function (_super) {
10013
10020
  this.rebuildFormGroupMap(this.addExistentHistoricData);
10014
10021
  }
10015
10022
  };
10023
+ /**
10024
+ * Valida todos os formulários
10025
+ */
10026
+ HistoricalPixAccountComponent.prototype.validateAllForms = function () {
10027
+ var _this = this;
10028
+ this.forceCloseAllCellEditors();
10029
+ this.syncAllModelToForm();
10030
+ if (!this.formGroupByRow || Object.keys(this.formGroupByRow).length === 0) {
10031
+ return true;
10032
+ }
10033
+ var isAllValid = true;
10034
+ Object.keys(this.formGroupByRow).forEach(function (indexKey) {
10035
+ var index = Number(indexKey);
10036
+ var form = _this.formGroupByRow[index];
10037
+ if (form) {
10038
+ Object.keys(form.controls).forEach(function (controlName) {
10039
+ var control = form.get(controlName);
10040
+ control.markAsTouched();
10041
+ if (controlName === 'pixKey') {
10042
+ var pixKeyTypeControl = form.get('pixKeyType');
10043
+ if (pixKeyTypeControl.value) {
10044
+ _this.validateDocumentField(index, pixKeyTypeControl.value.key);
10045
+ }
10046
+ }
10047
+ });
10048
+ form.updateValueAndValidity();
10049
+ if (form.invalid) {
10050
+ isAllValid = false;
10051
+ }
10052
+ }
10053
+ });
10054
+ if (isAllValid && this.addExistentHistoricData && this.addExistentHistoricData.length > 0) {
10055
+ var totalPercentage = this.addExistentHistoricData.reduce(function (sum, item) { return sum + (parseFloat(item.percentage) || 0); }, 0);
10056
+ if (Math.abs(totalPercentage - 100) > 0.01) {
10057
+ isAllValid = false;
10058
+ }
10059
+ }
10060
+ this.isValidChangeForm.emit(isAllValid);
10061
+ return isAllValid;
10062
+ };
10016
10063
  HistoricalPixAccountComponent.prototype.onLazyLoad = function (event) {
10017
10064
  var _this = this;
10018
10065
  var first = event && event.first ? event.first : 0;
@@ -10063,7 +10110,8 @@ var HistoricalPixAccountComponent = /** @class */ (function (_super) {
10063
10110
  id: null,
10064
10111
  pixKeyType: {},
10065
10112
  pixKey: '',
10066
- percentage: 0
10113
+ percentage: '',
10114
+ externalId: '',
10067
10115
  };
10068
10116
  var index = this.addExistentHistoricData.length;
10069
10117
  this.addExistentHistoricData = __spread(this.addExistentHistoricData, [
@@ -10074,11 +10122,27 @@ var HistoricalPixAccountComponent = /** @class */ (function (_super) {
10074
10122
  this.emitFormValidity();
10075
10123
  };
10076
10124
  HistoricalPixAccountComponent.prototype.deletePix = function (index) {
10125
+ var _this = this;
10077
10126
  if (this.dataListPix.editingCell) {
10078
10127
  this.dataListPix.editingCell = null;
10079
10128
  }
10080
10129
  this.addExistentHistoricData = this.addExistentHistoricData.filter(function (_, i) { return i !== index; });
10130
+ var currentList = this.historicalPixAccountList.get("historicalPixAccountList").value || [];
10131
+ var updatedList = currentList.filter(function (_, i) { return i !== index; });
10132
+ this.historicalPixAccountList.get("historicalPixAccountList").setValue(updatedList);
10133
+ if (this.formGroup) {
10134
+ this.formGroup.get(this.fieldFormGroup).patchValue({
10135
+ historicalPixAccountList: updatedList
10136
+ });
10137
+ }
10081
10138
  this.rebuildFormGroupMap(this.addExistentHistoricData);
10139
+ this.addExistentHistoricData.forEach(function (_, i) {
10140
+ if (_this.formGroupByRow[i]) {
10141
+ var allValues = _this.addExistentHistoricData
10142
+ .map(function (item, idx) { return idx === i ? 0 : (parseFloat(item.percentage) || 0); });
10143
+ _this.validatePercentageValid(allValues, _this.formGroupByRow[i]);
10144
+ }
10145
+ });
10082
10146
  this.emitFormValidity();
10083
10147
  };
10084
10148
  HistoricalPixAccountComponent.prototype.rebuildFormGroupMap = function (data) {
@@ -10182,7 +10246,14 @@ var HistoricalPixAccountComponent = /** @class */ (function (_super) {
10182
10246
  this.msgTotalLimitByPercentage = null;
10183
10247
  }
10184
10248
  };
10249
+ HistoricalPixAccountComponent.prototype.formatPercentage = function (value) {
10250
+ if (value == null || value === '' || isNaN(Number(value))) {
10251
+ return '0.00';
10252
+ }
10253
+ return Number(value).toFixed(2);
10254
+ };
10185
10255
  HistoricalPixAccountComponent.prototype.onSyncValue = function (field, index) {
10256
+ var _this = this;
10186
10257
  if (this.formGroupByRow &&
10187
10258
  this.formGroupByRow[index] &&
10188
10259
  this.formGroupByRow[index].get(field)) {
@@ -10191,14 +10262,352 @@ var HistoricalPixAccountComponent = /** @class */ (function (_super) {
10191
10262
  this.addExistentHistoricData[index][field] = value;
10192
10263
  control.markAsDirty();
10193
10264
  control.markAsTouched();
10265
+ if (field === 'percentage') {
10266
+ var currentList = this.addExistentHistoricData
10267
+ .map(function (item, i) { return i === index ? 0 : (parseFloat(item.percentage) || 0); });
10268
+ this.validatePercentageValid(currentList, this.formGroupByRow[index]);
10269
+ if (!this.isSyncingPercentage) {
10270
+ this.isSyncingPercentage = true;
10271
+ setTimeout(function () {
10272
+ _this.syncPixDataToParentForm();
10273
+ _this.isSyncingPercentage = false;
10274
+ }, 0);
10275
+ }
10276
+ }
10194
10277
  control.updateValueAndValidity();
10195
- var currentList = this.addExistentHistoricData.map(function (item, i) {
10196
- return i === index ? 0 : item.percentage;
10278
+ this.formGroupByRow[index].updateValueAndValidity();
10279
+ this.emitFormValidity();
10280
+ }
10281
+ };
10282
+ HistoricalPixAccountComponent.prototype.close = function () {
10283
+ this.visible = false;
10284
+ };
10285
+ HistoricalPixAccountComponent.prototype.getFormattedTelephoneNumber = function (telephoneNumber) {
10286
+ return FormatUtilsService.getFormattedTelephoneNumber(telephoneNumber);
10287
+ };
10288
+ HistoricalPixAccountComponent.prototype.getFormattedCpf = function (cpf) {
10289
+ return FormatUtilsService.getFormattedCpf(cpf);
10290
+ };
10291
+ HistoricalPixAccountComponent.prototype.getFormattedCnpj = function (cnpj) {
10292
+ return FormatUtilsService.getFormattedCnpj(cnpj);
10293
+ };
10294
+ HistoricalPixAccountComponent.prototype.getFormattedPercentage = function (value) {
10295
+ return FormatUtilsService.getFormattedPercentage(value);
10296
+ };
10297
+ /**
10298
+ * Reseta completamente o estado do formulário e controles
10299
+ */
10300
+ HistoricalPixAccountComponent.prototype.resetFormState = function () {
10301
+ if (this.formGroupByRow) {
10302
+ Object.values(this.formGroupByRow).forEach(function (form) {
10303
+ if (form) {
10304
+ Object.keys(form.controls).forEach(function (controlName) {
10305
+ var control = form.get(controlName);
10306
+ if (control) {
10307
+ control.setErrors(null);
10308
+ control.markAsUntouched();
10309
+ control.markAsPristine();
10310
+ }
10311
+ });
10312
+ form.updateValueAndValidity();
10313
+ }
10197
10314
  });
10198
- this.validatePercentageValid(currentList, this.formGroupByRow[index]);
10315
+ }
10316
+ if (this.dataListPix) {
10317
+ if (typeof this.dataListPix.closeAllCellEditors === 'function') {
10318
+ try {
10319
+ this.dataListPix.closeAllCellEditors();
10320
+ }
10321
+ catch (e) {
10322
+ console.error('Erro ao tentar fechar cell editors:', e);
10323
+ }
10324
+ }
10325
+ else if (this.dataListPix.editingCell) {
10326
+ this.dataListPix.editingCell = null;
10327
+ }
10328
+ if (this.dataListPix.editing !== undefined) {
10329
+ this.dataListPix.editing = false;
10330
+ }
10331
+ }
10332
+ this.cd.detectChanges();
10333
+ };
10334
+ /**
10335
+ * Formata a chave PIX para exibição baseada no tipo
10336
+ */
10337
+ HistoricalPixAccountComponent.prototype.getFormattedPixKey = function (pixKeyType, pixKey) {
10338
+ if (!pixKey)
10339
+ return '';
10340
+ switch (pixKeyType) {
10341
+ case 'CPF':
10342
+ return FormatUtilsService.getFormattedCpf(pixKey);
10343
+ case 'CNPJ':
10344
+ return FormatUtilsService.getFormattedCnpj(pixKey);
10345
+ case 'TELEPHONE':
10346
+ return FormatUtilsService.getFormattedTelephoneNumber(pixKey);
10347
+ case 'EMAIL':
10348
+ case 'RANDOM_KEY':
10349
+ default:
10350
+ return pixKey;
10351
+ }
10352
+ };
10353
+ /**
10354
+ * Obtém o tipo de chave PIX do item atual
10355
+ */
10356
+ HistoricalPixAccountComponent.prototype.getPixKeyType = function (item) {
10357
+ return item && item.pixKeyType && item.pixKeyType.key || '';
10358
+ };
10359
+ /**
10360
+ * Verifica se um controle está inválido para os campos editáveis
10361
+ */
10362
+ HistoricalPixAccountComponent.prototype.isInvalid = function (index, controlName) {
10363
+ var form = this.formGroupByRow[index];
10364
+ if (!form)
10365
+ return false;
10366
+ var control = form.get(controlName);
10367
+ if (!control)
10368
+ return false;
10369
+ return control.invalid && (control.touched || control.dirty);
10370
+ };
10371
+ /**
10372
+ * Método chamado quando uma célula entra no modo de edição
10373
+ */
10374
+ HistoricalPixAccountComponent.prototype.onCellEditInit = function (event) {
10375
+ var rowIndex = this.addExistentHistoricData.findIndex(function (item) { return item === event.data; });
10376
+ if (rowIndex < 0)
10377
+ return;
10378
+ var form = this.formGroupByRow[rowIndex];
10379
+ if (form && form.get('pixKey')) {
10380
+ var pixKeyControl = form.get('pixKey');
10381
+ var currentValue = this.addExistentHistoricData[rowIndex].pixKey;
10382
+ pixKeyControl.setValue(currentValue);
10383
+ }
10384
+ };
10385
+ /**
10386
+ * Recupera o FormControl específico para um campo em determinado índice
10387
+ */
10388
+ HistoricalPixAccountComponent.prototype.getFormControl = function (index, controlName) {
10389
+ var form = this.formGroupByRow[index];
10390
+ if (!form)
10391
+ return null;
10392
+ return form.get(controlName);
10393
+ };
10394
+ /**
10395
+ * Valida campos de documento (CPF, CNPJ) quando o usuário termina de digitar no form de edição
10396
+ */
10397
+ HistoricalPixAccountComponent.prototype.validateDocumentField = function (index, fieldType) {
10398
+ var _a;
10399
+ var form = this.formGroupByRow[index];
10400
+ var item = this.addExistentHistoricData[index];
10401
+ if (!form || !item)
10402
+ return;
10403
+ var pixKeyControl = form.get('pixKey');
10404
+ if (!pixKeyControl)
10405
+ return;
10406
+ var value = item.pixKey;
10407
+ pixKeyControl.setValue(value);
10408
+ if (fieldType === 'CPF' || fieldType === 'CNPJ' || fieldType === 'TELEPHONE') {
10409
+ value = value ? value.toString().replace(/\D/g, '') : '';
10410
+ item.pixKey = value;
10411
+ pixKeyControl.setValue(value);
10412
+ }
10413
+ if (!value || value.toString().trim() === '') {
10414
+ pixKeyControl.setErrors({ required: true });
10415
+ pixKeyControl.markAsTouched();
10416
+ form.updateValueAndValidity();
10199
10417
  this.emitFormValidity();
10418
+ return;
10419
+ }
10420
+ var cleanValue = value;
10421
+ if (fieldType === 'CPF' || fieldType === 'CNPJ') {
10422
+ cleanValue = value.toString().replace(/\D/g, '');
10423
+ item.pixKey = cleanValue;
10424
+ pixKeyControl.setValue(cleanValue);
10425
+ }
10426
+ var isValid = false;
10427
+ switch (fieldType) {
10428
+ case 'CPF':
10429
+ isValid = cleanValue.length === 11 && GenericValidator.isValidCpf({ value: cleanValue }) === null;
10430
+ break;
10431
+ case 'CNPJ':
10432
+ isValid = cleanValue.length === 14 && GenericValidator.isValidCnpj({ value: cleanValue }) === null;
10433
+ break;
10434
+ case 'TELEPHONE':
10435
+ cleanValue = value.toString().replace(/\D/g, '');
10436
+ isValid = GenericValidator.isValidPhoneNumber({ value: cleanValue }) === null;
10437
+ break;
10438
+ case 'EMAIL':
10439
+ isValid = GenericValidator.isValidEmail({ value: value }) === null;
10440
+ break;
10441
+ case 'RANDOM_KEY':
10442
+ isValid = true;
10443
+ break;
10444
+ default:
10445
+ isValid = true;
10446
+ }
10447
+ pixKeyControl.markAsTouched();
10448
+ if (isValid) {
10449
+ pixKeyControl.setErrors(null);
10450
+ }
10451
+ else {
10452
+ var errorType = this.getErrorTypeForField(fieldType);
10453
+ pixKeyControl.setErrors((_a = {}, _a[errorType] = true, _a));
10454
+ }
10455
+ form.updateValueAndValidity();
10456
+ this.emitFormValidity();
10457
+ this.cd.detectChanges();
10458
+ };
10459
+ /**
10460
+ * Obtém o tipo de erro para cada tipo de campo editável
10461
+ */
10462
+ HistoricalPixAccountComponent.prototype.getErrorTypeForField = function (fieldType) {
10463
+ switch (fieldType) {
10464
+ case 'CPF': return 'invalidCpf';
10465
+ case 'CNPJ': return 'invalidCnpj';
10466
+ case 'TELEPHONE': return 'invalidPhoneNumber';
10467
+ case 'EMAIL': return 'invalidEmail';
10468
+ default: return 'required';
10469
+ }
10470
+ };
10471
+ /**
10472
+ * Retorna a mensagem de erro apropriada para um campo
10473
+ */
10474
+ HistoricalPixAccountComponent.prototype.getErrorMessage = function (index, controlName) {
10475
+ var form = this.formGroupByRow[index];
10476
+ if (!form)
10477
+ return '';
10478
+ var control = form.get(controlName);
10479
+ if (!control || !control.errors)
10480
+ return '';
10481
+ var fieldValue = control.value || '';
10482
+ if (control.hasError('required')) {
10483
+ return this.translateService.instant('hcm.payroll.required');
10484
+ }
10485
+ if (control.hasError('invalidCpf')) {
10486
+ return this.translateService.instant('hcm.payroll.employees_addition_cpf_error');
10487
+ }
10488
+ else if (control.hasError('invalidCnpj')) {
10489
+ return this.translateService.instant('hcm.payroll.employees_addition_cnpj_error');
10490
+ }
10491
+ else if (control.hasError('invalidEmail')) {
10492
+ return this.translateService.instant('hcm.payroll.employees_addition_email_invalid');
10493
+ }
10494
+ else if (control.hasError('invalidPhoneNumber')) {
10495
+ return this.translateService.instant('hcm.payroll.employees_addition_invalid_phone_number', { value: fieldValue });
10496
+ }
10497
+ return '';
10498
+ };
10499
+ /**
10500
+ * Tratamento ao perder o foco em campos de documento
10501
+ */
10502
+ HistoricalPixAccountComponent.prototype.onDocumentBlur = function (index) {
10503
+ var form = this.formGroupByRow[index];
10504
+ var item = this.addExistentHistoricData[index];
10505
+ if (!form || !item)
10506
+ return;
10507
+ var pixKeyControl = form.get('pixKey');
10508
+ var pixKeyTypeControl = form.get('pixKeyType');
10509
+ if (!pixKeyControl || !pixKeyTypeControl.value)
10510
+ return;
10511
+ var pixKeyType = pixKeyTypeControl.value.key;
10512
+ var value = item.pixKey;
10513
+ if (pixKeyType === 'CPF' || pixKeyType === 'CNPJ' || pixKeyType === 'TELEPHONE') {
10514
+ value = value ? value.toString().replace(/\D/g, '') : '';
10515
+ item.pixKey = value;
10516
+ }
10517
+ pixKeyControl.setValue(value);
10518
+ this.validateDocumentField(index, pixKeyType);
10519
+ if (value) {
10520
+ if (pixKeyType === 'CPF') {
10521
+ item.pixKeyFormatted = FormatUtilsService.getFormattedCpf(value);
10522
+ }
10523
+ else if (pixKeyType === 'CNPJ') {
10524
+ item.pixKeyFormatted = FormatUtilsService.getFormattedCnpj(value);
10525
+ }
10526
+ else if (pixKeyType === 'TELEPHONE') {
10527
+ item.pixKeyFormatted = FormatUtilsService.getFormattedTelephoneNumber(value);
10528
+ }
10529
+ else {
10530
+ item.pixKeyFormatted = value;
10531
+ }
10532
+ }
10533
+ this.finishEditing();
10534
+ };
10535
+ HistoricalPixAccountComponent.prototype.finishEditing = function () {
10536
+ this.syncAllModelToForm();
10537
+ this.cd.detectChanges();
10538
+ };
10539
+ HistoricalPixAccountComponent.prototype.clearErrorsTemporarily = function (rowIndex) {
10540
+ var form = this.formGroupByRow[rowIndex];
10541
+ if (form && form.get('pixKey')) {
10542
+ var currentValue = form.get('pixKey').value;
10543
+ form.get('pixKey').setErrors(null);
10544
+ form.get('pixKey').setValue(currentValue);
10545
+ }
10546
+ };
10547
+ HistoricalPixAccountComponent.prototype.closeEditModeManually = function () {
10548
+ var _this = this;
10549
+ setTimeout(function () {
10550
+ if (_this.dataListPix) {
10551
+ if (typeof _this.dataListPix.closeAllCellEditors === 'function') {
10552
+ _this.dataListPix.closeAllCellEditors();
10553
+ }
10554
+ else if (_this.dataListPix.editingCell) {
10555
+ _this.dataListPix.editingCell = null;
10556
+ }
10557
+ _this.cd.detectChanges();
10558
+ }
10559
+ }, 100);
10560
+ };
10561
+ HistoricalPixAccountComponent.prototype.syncAllModelToForm = function () {
10562
+ var _this = this;
10563
+ if (!this.addExistentHistoricData || !this.formGroupByRow)
10564
+ return;
10565
+ this.addExistentHistoricData.forEach(function (item, index) {
10566
+ var form = _this.formGroupByRow[index];
10567
+ if (form) {
10568
+ Object.keys(form.controls).forEach(function (controlName) {
10569
+ var control = form.get(controlName);
10570
+ if (control && item[controlName] !== undefined) {
10571
+ control.setValue(item[controlName]);
10572
+ }
10573
+ });
10574
+ var pixKeyTypeControl = form.get('pixKeyType');
10575
+ if (pixKeyTypeControl.value) {
10576
+ _this.validateDocumentField(index, pixKeyTypeControl.value.key);
10577
+ }
10578
+ }
10579
+ });
10580
+ };
10581
+ /**
10582
+ * Método para forçar o fechamento de todas as células em edição
10583
+ */
10584
+ HistoricalPixAccountComponent.prototype.forceCloseAllCellEditors = function () {
10585
+ this.finishEditing();
10586
+ this.syncAllModelToForm();
10587
+ };
10588
+ HistoricalPixAccountComponent.prototype.isPixKeyType = function (item, type) {
10589
+ return item && item.pixKeyType && item.pixKeyType.key === type;
10590
+ };
10591
+ HistoricalPixAccountComponent.prototype.getPixKey = function (rowData) {
10592
+ return rowData ? rowData.pixKey : null;
10593
+ };
10594
+ HistoricalPixAccountComponent.prototype.setPixKey = function (rowData, value) {
10595
+ if (rowData) {
10596
+ rowData.pixKey = value;
10200
10597
  }
10201
10598
  };
10599
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isTotalPercentage100", {
10600
+ get: function () {
10601
+ if (!this.addExistentHistoricData || this.addExistentHistoricData.length === 0) {
10602
+ return false;
10603
+ }
10604
+ var totalPercentage = this.addExistentHistoricData
10605
+ .reduce(function (sum, item) { return sum + (parseFloat(item.percentage) || 0); }, 0);
10606
+ return totalPercentage >= 100;
10607
+ },
10608
+ enumerable: true,
10609
+ configurable: true
10610
+ });
10202
10611
  Object.defineProperty(HistoricalPixAccountComponent.prototype, "scopedActions", {
10203
10612
  get: function () {
10204
10613
  return this.actions.bind(this);
@@ -10208,7 +10617,8 @@ var HistoricalPixAccountComponent = /** @class */ (function (_super) {
10208
10617
  });
10209
10618
  Object.defineProperty(HistoricalPixAccountComponent.prototype, "recordsMessage", {
10210
10619
  get: function () {
10211
- return (this.totalRecords || 0) + " " + (this.totalRecords === 1 ? this.translateService.instant("hcm.payroll.admission_register") : this.translateService.instant("hcm.payroll.admission_registers"));
10620
+ return (this.totalRecords || 0) + " " + (this.totalRecords === 1 ?
10621
+ this.translateService.instant("hcm.payroll.admission_register") : this.translateService.instant("hcm.payroll.admission_registers"));
10212
10622
  },
10213
10623
  enumerable: true,
10214
10624
  configurable: true
@@ -10283,21 +10693,6 @@ var HistoricalPixAccountComponent = /** @class */ (function (_super) {
10283
10693
  enumerable: true,
10284
10694
  configurable: true
10285
10695
  });
10286
- HistoricalPixAccountComponent.prototype.close = function () {
10287
- this.visible = false;
10288
- };
10289
- HistoricalPixAccountComponent.prototype.getFormattedTelephoneNumber = function (telephoneNumber) {
10290
- return FormatUtilsService.getFormattedTelephoneNumber(telephoneNumber);
10291
- };
10292
- HistoricalPixAccountComponent.prototype.getFormattedCpf = function (cpf) {
10293
- return FormatUtilsService.getFormattedCpf(cpf);
10294
- };
10295
- HistoricalPixAccountComponent.prototype.getFormattedCnpj = function (cnpj) {
10296
- return FormatUtilsService.getFormattedCnpj(cnpj);
10297
- };
10298
- HistoricalPixAccountComponent.prototype.getFormattedPercentage = function (value) {
10299
- return FormatUtilsService.getFormattedPercentage(value);
10300
- };
10301
10696
  Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToAddHistorical", {
10302
10697
  get: function () {
10303
10698
  return (this.permission["incluir"]);
@@ -10436,8 +10831,8 @@ var HistoricalPixAccountComponent = /** @class */ (function (_super) {
10436
10831
  Component({
10437
10832
  // tslint:disable-next-line:component-selector
10438
10833
  selector: "c-historical-pix-account",
10439
- template: "<s-sidebar *ngIf=\"withSideBar\" [visible]=\"visible\" (visibleChange)=\"close()\"\n header=\"{{'hcm.payroll.historical_pix_account_title_form'|translate}}\">\n<pix-account [(visible)]=\"visible\"\n [isEditAndViewValue]=\"pixAccountItemInput\"\n [currency]=\"currency\"\n [customEntity]=\"customEntity\"\n [customService]=\"customService\"\n [getListPixAccount]=\"listDataNoPage\"\n [paramsForm]=\"paramsForm\"\n [showField]=\"showFields\"\n (pixAccountItemToList)=\"addItemInList($event)\"\n [defaultCpfNumber]=\"defaultCpfNumber\"></pix-account>\n</s-sidebar>\n\n<div *ngIf=\"!withSideBar\">\n <pix-account [(visible)]=\"visible\"\n [isEditAndViewValue]=\"pixAccountItemInput\"\n [currency]=\"currency\"\n [customEntity]=\"customEntity\"\n [customService]=\"customService\"\n [getListPixAccount]=\"listDataNoPage\"\n [withSideBar]=\"false\"\n [isViewMode]=\"isViewMode\"\n [paramsForm]=\"paramsForm\"\n (pixAccountItemToList)=\"addItemInList($event)\"\n [defaultCpfNumber]=\"defaultCpfNumber\"></pix-account>\n</div>\n<div class=\"ui-g-1\" *ngIf=\"withSideBar && !isEditMode && !hideBtnAddForViewMode\">\n <div class=\"form-group \">\n <s-button id=\"ta-addPayAnnuity\"\n [disabled]=\"getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage\"\n (onClick)=\"add()\"\n [pTooltip]=\"getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage\"\n tooltipPosition=\"top\"\n label=\"{{'hcm.payroll.historical_pix_account_add'|translate}}\"></s-button>\n </div>\n</div>\n<div *ngIf=\"showFields || !showEditMode || !(hideFields | async)\" class=\"ui-g-12\">\n <p-table\n id=\"table-annuity\"\n [value]=\"listData\"\n [columns]=\"cols\"\n (onLazyLoad)=\"onLazyLoad($event)\"\n [lazy]=\"true\"\n [scrollable]=\"true\"\n [paginator]=\"true\"\n [totalRecords]=\"totalRecords\"\n [sortMode]=\"'multiple'\"\n *sLoadingState=\"loading\"\n [rows]=\"recordByRow\"\n dataKey=\"id\">\n <ng-template pTemplate=\"colgroup\" let-coumns>\n <colgroup>\n <col [ngClass]=\"'col-default-m'\">\n <col [ngClass]=\"'col-default-m'\">\n <col [ngClass]=\"'col-default-s'\">\n <col *ngIf=\"showButtonView\" [ngClass]=\"'col-action'\">\n </colgroup>\n </ng-template>\n <ng-template pTemplate=\"header\" let-columns>\n <!-- Cabe\u00E7alhos quando da table \u00E9 permitido ordenar as colunas -->\n <tr>\n <!-- Cabe\u00E7alhos das colunas da tabela -->\n <th\n [pSortableColumn]=\"'pixKeyType'\"\n [pTooltip]=\"'hcm.payroll.employees_addition_pix_key_type' | translate\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >\n <div class=\"senior-header\" id=\"table-0\">\n <span\n id=\"table-annuity-s-0\">{{ 'hcm.payroll.employees_addition_pix_key_type' | translate }}</span>\n <p-sortIcon class=\"p-sorticon-status\"\n [field]=\"'hcm.payroll.employees_addition_pix_key_type' | translate\"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]=\"'pixKey'\"\n [pTooltip]=\"'hcm.payroll.employees_addition_pix_key' | translate\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >\n <div class=\"senior-header\">\n <span>{{ 'hcm.payroll.employees_addition_pix_key' | translate }}</span>\n <p-sortIcon class=\"p-sorticon-status\"\n [field]=\"'hcm.payroll.employees_addition_pix_key' | translate\"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]=\"'percentage'\"\n [pTooltip]=\"'hcm.payroll.historical_pix_account_label_percentage' | translate\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >\n <div class=\"senior-header\">\n <span>{{ 'hcm.payroll.historical_pix_account_label_percentage' | translate }}</span>\n <p-sortIcon class=\"p-sorticon-status\"\n [field]=\"'hcm.payroll.historical_pix_account_label_percentage' | translate\"></p-sortIcon>\n </div>\n </th>\n <!-- Cabe\u00E7alho da coluna de a\u00E7\u00F5es -->\n <th *ngIf=\"showButtonView\" id=\"col-actions\"></th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowData let-key=\"rowIndex\">\n\n <tr [ngClass]=\"'row'+key\" [pSelectableRow]=\"rowData\">\n <td [pTooltip]=\"rowData?.pixKeyType.value\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ rowData?.pixKeyType.value }}</span>\n </td>\n\n <ng-container [ngSwitch]=\"rowData?.pixKeyType.key\">\n <td *ngSwitchCase=\"'TELEPHONE'\"\n [pTooltip]=\"getFormattedTelephoneNumber(rowData?.pixKey)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedTelephoneNumber(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchCase=\"'CPF'\"\n [pTooltip]=\"getFormattedCpf(rowData?.pixKey)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedCpf(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchCase=\"'CNPJ'\"\n [pTooltip]=\"getFormattedCnpj(rowData?.pixKey)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedCnpj(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchDefault\n [pTooltip]=\"rowData?.pixKey\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ rowData?.pixKey }}</span>\n </td>\n </ng-container>\n <td [pTooltip]=\"getFormattedPercentage(rowData?.percentage)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedPercentage(rowData?.percentage) }}</span>\n </td>\n <td id=\"col-actions-{{key}}\" class=\"col-actions \"\n *ngIf=\"actions && actions(rowData, key)?.length && showButtonView\">\n <s-button id=\"table-admission-btn-actions-{{key}}\"\n *ngIf=\"!isViewMode && actions(rowData, key).length > 1\" [label]=\"actionLabel\"\n priority=\"default\" [model]=\"scopedActions(rowData, key)\"\n [disabled]=\"false\" [auxiliary]=\"true\"></s-button>\n\n <s-button id=\"table-admission-btn-action-{{key}}\"\n *ngIf=\"!isViewMode && actions(rowData, key).length <= 1\"\n [label]=\"scopedActions(rowData, key)[0].label\"\n priority=\"default\"\n (click)=\"scopedActions(rowData, key)[0].command()\"\n [disabled]=\"false\" [auxiliary]=\"true\"></s-button>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"emptymessage\" let-columns>\n <tr>\n <td [attr.colspan]=\"columns.length +2\">\n {{'hcm.payroll.admission_empty_message'|translate}}\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"paginatorright\">\n <span *ngIf=\"totalRecords\">{{recordsMessage}}</span>\n </ng-template>\n </p-table>\n</div>\n\n<!-- Template exlusivo para edi\u00E7\u00E3o de pix via modal-->\n<div *ngIf=\"!withSideBar && showEditMode && (hideFields | async)\" class=\"ui-g-12\">\n <!-- Bot\u00E3o Adicionar -->\n <div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <s-button\n id=\"btn-save\"\n label=\"{{ 'hcm.payroll.historical_pix_account_add' | translate}}\"\n priority=\"primary\"\n (onClick)=\"addPix()\">\n </s-button>\n </div>\n </div>\n\n <!-- Tabela -->\n <p-table #dataListPix sortField=\"percentage\"\n [columns]=\"cols\"\n [value]=\"addExistentHistoricData\"\n [pageLinks]=\"3\"\n [paginator]=\"true\"\n [responsive]=\"true\"\n [rows]=\"10\"\n [resetPageOnSort]=\"false\"\n [tableStyle]=\"{'margin-top': '2rem'}\"\n [customSort]=\"true\">\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th *ngFor=\"let col of cols\">\n {{ col.label }}\n </th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-item let-rowIndex=\"rowIndex\">\n <ng-container *ngIf=\"formGroupByRow[rowIndex]\" [formGroup]=\"formGroupByRow[rowIndex]\">\n <tr>\n <!-- Tipo de Chave -->\n <td class=\"ui-md-6 ui-sm-12 required\"\n [pEditableColumn]=\"item.pixKeyType\" pEditableColumnField=\"pixKeyType\">\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <div style=\"width: 100%; position: relative;\">\n <p-autoComplete\n [suggestions]=\"suggestions\"\n (completeMethod)=\"filterPixKeyType($event)\"\n formControlName=\"pixKeyType\"\n [dropdown]=\"true\"\n (onSelect)=\"onPixKeyTypeChange($event, rowIndex)\"\n (onClear)=\"onPixKeyTypeClear(rowIndex)\"\n (ngModelChange)=\"onSyncValue('pixKeyType', rowIndex)\"\n field=\"value\"\n placeholder=\"{{'hcm.payroll.select' | translate}}\"\n appendTo=\"body\"\n [panelStyle]=\"{ maxWidth: '300px', width: '100%' }\"\n [inputStyle]=\"{ width: '100%' }\"\n ></p-autoComplete>\n\n <s-control-errors [control]=\"formGroupByRow[rowIndex]?.get('pixKeyType')\"\n [errorMessages]=\"{\n required: 'hcm.payroll.required' | translate,\n pixKeyTypeBankAccountDuplicate: 'hcm.payroll.historical_pix_key_type_bank_account_duplicate' | translate\n }\">\n </s-control-errors>\n </div>\n </ng-template>\n <ng-template pTemplate=\"output\">\n {{ item.pixKeyType?.value }}\n </ng-template>\n </p-cellEditor>\n </td>\n\n <!-- Chave Pix -->\n <td class=\"ui-md-6 ui-sm-12 required\"\n [pEditableColumn]=\"item.pixKey\" pEditableColumnField=\"pixKey\"\n [ngClass]=\"{'required': item.pixKeyType.key !== 'BANK_ACCOUNT',\n 'disabled': item.pixKeyType && item.pixKeyType.key === 'BANK_ACCOUNT'\n }\">\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <ng-container [ngSwitch]=\"item.pixKeyType.key\">\n <input *ngSwitchCase=\"'TELEPHONE'\"\n only-number\n pInputText\n type=\"text\"\n formControlName=\"pixKey\"\n (keyup)=\"phoneMask($event)\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\"\n maxlength=\"15\"\n placeholder=\"(__) ____-____\" />\n\n <input *ngSwitchCase=\"'CPF'\"\n type=\"text\"\n pInputText\n formControlName=\"pixKey\"\n maxlength=\"14\"\n placeholder=\"___.___.___-__\"\n (input)=\"onPixKeyInput($event, rowIndex)\"\n (blur)=\"onBlurPixCpfAndCnpj(rowIndex)\"\n (keyup)=\"cpfMask($event)\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\" />\n\n <input *ngSwitchCase=\"'CNPJ'\"\n type=\"text\"\n pInputText\n formControlName=\"pixKey\"\n maxlength=\"18\"\n placeholder=\"___.___.___/____-__\"\n (input)=\"onPixKeyInput($event, rowIndex)\"\n (blur)=\"onBlurPixCpfAndCnpj(rowIndex)\"\n (keyup)=\"cnpjMask($event)\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\" />\n\n <input *ngSwitchCase=\"'EMAIL'\"\n pInputText\n type=\"email\"\n formControlName=\"pixKey\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\"\n placeholder=\"{{ 'hcm.payroll.employees_addition_email' | translate }}\" />\n\n <input *ngSwitchCase=\"'BANK_ACCOUNT'\"\n pInputText\n formControlName=\"pixKey\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\"\n [disabled]=\"true\" />\n\n <input *ngSwitchDefault\n pInputText\n type=\"text\"\n formControlName=\"pixKey\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\"\n maxlength=\"100\" />\n </ng-container>\n\n <s-control-errors *ngIf=\"isShowPixKeyFieldValidatorMessage\"\n [control]=\"formGroupByRow[rowIndex]?.get('pixKey')\"\n [errorMessages]=\"{\n required: 'hcm.payroll.required' | translate,\n invalidPhoneNumber: 'hcm.payroll.employees_addition_invalid_phone_number' | translate: { value: formGroupByRow[rowIndex]?.get('pixKey').value },\n invalidEmail: 'hcm.payroll.employees_addition_email_invalid' | translate,\n cpfNotValid: 'hcm.payroll.employees_addition_cpf_error' | translate,\n cnpjNotValid: 'hcm.payroll.employees_addition_cnpj_error' | translate\n }\">\n </s-control-errors>\n </ng-template>\n <ng-template pTemplate=\"output\">\n {{ getFormattedPixKey(item.pixKeyType?.key, item.pixKey) }}\n </ng-template>\n </p-cellEditor>\n </td>\n\n <!-- Percentual -->\n <td class=\"ui-md-6 ui-sm-12 required\"\n [pEditableColumn]=\"item.percentage\" pEditableColumnField=\"percentage\">\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <input\n pInputText type=\"number\"\n formControlName=\"percentage\"\n (ngModelChange)=\"onSyncValue('percentage', rowIndex)\"\n >\n <s-control-errors\n [control]=\"formGroupByRow[rowIndex]?.get('percentage')\"\n [errorMessages]=\"{\n required: 'hcm.payroll.required' | translate,\n maxlength: 'hcm.payroll.error_max_length' | translate: { value: '6' },\n max: 'hcm.payroll.error_max_value_number' | translate: { value: maxValuePercentage },\n min: 'hcm.payroll.error_min_value_number' | translate: { value: '0,01' }\n }\">\n </s-control-errors>\n </ng-template>\n <ng-template pTemplate=\"output\">\n {{ item.percentage?.toFixed(2).replace('.', ',') }}%\n </ng-template>\n </p-cellEditor>\n </td>\n\n <!-- Bot\u00E3o de excluir -->\n <td>\n <s-button\n id=\"btn-delete\"\n label=\"{{ 'hcm.payroll.delete' | translate }}\"\n priority=\"default\"\n (onClick)=\"deletePix(rowIndex)\">\n </s-button>\n </td>\n </tr>\n </ng-container>\n </ng-template>\n </p-table>\n</div>\n",
10440
- 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}"]
10834
+ 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",
10835
+ 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}"]
10441
10836
  })
10442
10837
  ], HistoricalPixAccountComponent);
10443
10838
  return HistoricalPixAccountComponent;
@@ -10667,7 +11062,7 @@ var HistoricalPixAccountFormComponent = /** @class */ (function (_super) {
10667
11062
  Component({
10668
11063
  selector: "pix-account",
10669
11064
  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",
10670
- 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}"]
11065
+ 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}"]
10671
11066
  })
10672
11067
  ], HistoricalPixAccountFormComponent);
10673
11068
  return HistoricalPixAccountFormComponent;
@@ -10757,6 +11152,7 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10757
11152
  this.endPoint = "hcm/payroll/queries/historicalEmployeePixQuery";
10758
11153
  this.keyPayload = "historicalEmployeePix";
10759
11154
  this.withSidebar = true;
11155
+ this.showActionsButtonOnAdd = false;
10760
11156
  this.isOnlyView = new EventEmitter();
10761
11157
  this.isOnlyEdit = new EventEmitter();
10762
11158
  this.enableView = new EventEmitter();
@@ -10811,11 +11207,13 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10811
11207
  _this.isOnlyEdit.emit(false);
10812
11208
  _this.isHideBtnAddForViewMode.emit(true);
10813
11209
  _this.sharedStateService.setHideBtnAddForViewMode(true);
11210
+ _this.sharedStateService.setActiveHideOptionsOnView(true);
10814
11211
  _this.router.navigate(["historical-pix-account/" + dateChange], {
10815
11212
  relativeTo: _this.activatedRoute,
10816
11213
  });
10817
11214
  }
10818
11215
  else {
11216
+ _this.sharedStateService.setActiveHideOptionsOnView(true);
10819
11217
  _this.sharedStateService.setSaveButton(false);
10820
11218
  _this.enableView.emit(dateChange);
10821
11219
  }
@@ -10838,11 +11236,13 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10838
11236
  _this.isOnlyEdit.emit(true);
10839
11237
  _this.isHideBtnAddForViewMode.emit(false);
10840
11238
  _this.sharedStateService.setHideBtnAddForViewMode(false);
11239
+ _this.sharedStateService.setActiveHideOptionsOnView(false);
10841
11240
  _this.router.navigate(["historical-pix-account/" + dateChange], {
10842
11241
  relativeTo: _this.activatedRoute,
10843
11242
  });
10844
11243
  }
10845
11244
  else {
11245
+ _this.sharedStateService.setActiveHideOptionsOnView(false);
10846
11246
  setTimeout(function () {
10847
11247
  _this.sharedStateService.triggerActiveValidatorsOnEditModalOpen();
10848
11248
  });
@@ -11032,6 +11432,9 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
11032
11432
  __decorate([
11033
11433
  Input()
11034
11434
  ], HistoricalPixAccountListComponent.prototype, "hideField", void 0);
11435
+ __decorate([
11436
+ Input()
11437
+ ], HistoricalPixAccountListComponent.prototype, "showActionsButtonOnAdd", void 0);
11035
11438
  __decorate([
11036
11439
  Output()
11037
11440
  ], HistoricalPixAccountListComponent.prototype, "isOnlyView", void 0);