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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/bundles/senior-gestao-pessoas-payroll-core.umd.js +530 -86
  2. package/bundles/senior-gestao-pessoas-payroll-core.umd.js.map +1 -1
  3. package/bundles/senior-gestao-pessoas-payroll-core.umd.min.js +2 -2
  4. package/bundles/senior-gestao-pessoas-payroll-core.umd.min.js.map +1 -1
  5. package/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.d.ts +1 -0
  6. package/components/historical-pix-account/historical-pix-account.component.d.ts +71 -10
  7. package/components/historical-pix-account-list/historical-pix-account-list.component.d.ts +3 -0
  8. package/components/shared/shared-state.service.d.ts +8 -0
  9. package/esm2015/components/historical-pix-account/historical-pix-account-base.js +9 -2
  10. package/esm2015/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.js +9 -7
  11. package/esm2015/components/historical-pix-account/historical-pix-account.component.js +466 -81
  12. package/esm2015/components/historical-pix-account-list/historical-pix-account-list.component.js +26 -3
  13. package/esm2015/components/shared/shared-state.service.js +17 -1
  14. package/esm2015/components/utils/format-utils/format-utils.service.js +3 -1
  15. package/esm5/components/historical-pix-account/historical-pix-account-base.js +9 -2
  16. package/esm5/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.js +9 -7
  17. package/esm5/components/historical-pix-account/historical-pix-account.component.js +476 -81
  18. package/esm5/components/historical-pix-account-list/historical-pix-account-list.component.js +26 -3
  19. package/esm5/components/shared/shared-state.service.js +17 -1
  20. package/esm5/components/utils/format-utils/format-utils.service.js +3 -1
  21. package/fesm2015/senior-gestao-pessoas-payroll-core.js +520 -86
  22. package/fesm2015/senior-gestao-pessoas-payroll-core.js.map +1 -1
  23. package/fesm5/senior-gestao-pessoas-payroll-core.js +530 -86
  24. package/fesm5/senior-gestao-pessoas-payroll-core.js.map +1 -1
  25. package/package.json +1 -1
  26. package/senior-gestao-pessoas-payroll-core.metadata.json +1 -1
@@ -9483,6 +9483,7 @@
9483
9483
  */
9484
9484
  FormatUtilsService.formatCpfInputEvent = function (event) {
9485
9485
  var cpf = event.target.value;
9486
+ console.log("FormatUtilsService.formatCpfInputEvent.cpf: " + cpf);
9486
9487
  // Permite apagar nos pontos sensíveis
9487
9488
  if (event.keyCode === 8 && (cpf.length === 4 || cpf.length === 8 || cpf.length === 12)) {
9488
9489
  return;
@@ -9495,6 +9496,7 @@
9495
9496
  */
9496
9497
  FormatUtilsService.formatCnpjInputEvent = function (event) {
9497
9498
  var cnpj = event.target.value;
9499
+ console.log("FormatUtilsService.formatCnpjInputEvent.cnpj: " + cnpj);
9498
9500
  // Permite apagar nos pontos sensíveis
9499
9501
  if (event.keyCode === 8 && (cnpj.length === 3 || cnpj.length === 7 || cnpj.length === 11 || cnpj.length === 16)) {
9500
9502
  return;
@@ -9516,6 +9518,10 @@
9516
9518
  this.showEditMode$ = this.showEditMode.asObservable();
9517
9519
  this.activeValidatorsOnEditModalOpen = new rxjs.Subject();
9518
9520
  this.activeValidatorsOnEditModalOpen$ = this.activeValidatorsOnEditModalOpen.asObservable();
9521
+ this.hideBtnAddForViewMode = new rxjs.BehaviorSubject(false);
9522
+ this.hideBtnAddForViewMode$ = this.hideBtnAddForViewMode.asObservable();
9523
+ this.activeHideOptionsOnView = new rxjs.BehaviorSubject(true);
9524
+ this.activeHideOptionsOnView$ = this.activeHideOptionsOnView.asObservable();
9519
9525
  }
9520
9526
  SharedStateService.prototype.setHideField = function (value) {
9521
9527
  this.hideFieldSubject.next(value);
@@ -9532,6 +9538,18 @@
9532
9538
  SharedStateService.prototype.triggerActiveValidatorsOnEditModalOpen = function () {
9533
9539
  this.activeValidatorsOnEditModalOpen.next();
9534
9540
  };
9541
+ SharedStateService.prototype.setHideBtnAddForViewMode = function (value) {
9542
+ this.hideBtnAddForViewMode.next(value);
9543
+ };
9544
+ SharedStateService.prototype.resetHideField = function () {
9545
+ this.hideFieldSubject.next(true);
9546
+ };
9547
+ SharedStateService.prototype.setActiveHideOptionsOnView = function (value) {
9548
+ this.activeHideOptionsOnView.next(value);
9549
+ };
9550
+ SharedStateService.prototype.getActiveHideOptionsOnView = function () {
9551
+ return this.activeHideOptionsOnView.getValue();
9552
+ };
9535
9553
  SharedStateService.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function SharedStateService_Factory() { return new SharedStateService(); }, token: SharedStateService, providedIn: "root" });
9536
9554
  SharedStateService = __decorate([
9537
9555
  core.Injectable({
@@ -9838,10 +9856,17 @@
9838
9856
  case "RANDOM_KEY":
9839
9857
  pixKey.setValidators(forms.Validators.required);
9840
9858
  break;
9859
+ case "BANK_ACCOUNT":
9860
+ pixKey.clearValidators();
9861
+ pixKey.setValue('');
9862
+ break;
9841
9863
  default:
9842
9864
  pixKey.clearValidators();
9843
9865
  }
9844
- if (isEditMode) {
9866
+ if (this.pixKeyType === "BANK_ACCOUNT") {
9867
+ pixKey.disable();
9868
+ }
9869
+ else if (isEditMode) {
9845
9870
  pixKey.enable();
9846
9871
  }
9847
9872
  pixKey.updateValueAndValidity();
@@ -9929,6 +9954,9 @@
9929
9954
  _this.addExistentHistoricData = [];
9930
9955
  _this.getListPixAccount = [];
9931
9956
  _this.isEditModeForSave = false;
9957
+ _this.showField = false;
9958
+ _this.hideBtnAddForViewMode = false;
9959
+ _this.showButtonView = true;
9932
9960
  _this.isViewModeActive = new core.EventEmitter();
9933
9961
  _this.isEditModeActive = new core.EventEmitter();
9934
9962
  _this.isDeleteModeActive = new core.EventEmitter();
@@ -9946,12 +9974,12 @@
9946
9974
  _this.loading = true;
9947
9975
  _this.listData = [];
9948
9976
  _this.listDataNoPage = [];
9949
- _this.showButtonView = true;
9950
9977
  _this.showEditMode = false;
9951
9978
  _this.hasRecordsPix = true;
9952
9979
  _this.hideFields = _this.sharedStateService.hideField$;
9953
9980
  _this.suggestions = [];
9954
9981
  _this.formGroupByRow = {};
9982
+ _this.isSyncingPercentage = false;
9955
9983
  _this.cols = [
9956
9984
  {
9957
9985
  label: _this.translateService.instant("hcm.payroll.employees_addition_pix_key_type"),
@@ -10030,14 +10058,17 @@
10030
10058
  }
10031
10059
  HistoricalPixAccountComponent.prototype.ngOnInit = function () {
10032
10060
  var _this = this;
10061
+ this.showFields = this.showField;
10033
10062
  this.formGroup.setControl(this.fieldFormGroup, this.historicalPixAccountList);
10034
- this.sharedStateService.showButton$.subscribe(function (value) {
10035
- _this.showButtonView = value;
10036
- });
10037
10063
  this.sharedStateService.showEditMode$.subscribe(function (value) {
10038
10064
  _this.showEditMode = value;
10039
10065
  _this.isEditModeForSave = value;
10040
10066
  });
10067
+ this.sharedStateService.activeHideOptionsOnView$.subscribe(function (value) {
10068
+ if (value) {
10069
+ _this.showButtonView = false;
10070
+ }
10071
+ });
10041
10072
  this.sharedStateService.activeValidatorsOnEditModalOpen$
10042
10073
  .subscribe(function () {
10043
10074
  Object.values(_this.formGroupByRow).forEach(function (fg) {
@@ -10048,6 +10079,7 @@
10048
10079
  });
10049
10080
  _this.emitFormValidity();
10050
10081
  });
10082
+ this.resetFormState();
10051
10083
  };
10052
10084
  HistoricalPixAccountComponent.prototype.ngOnChanges = function (changes) {
10053
10085
  if (changes['listDataReciever'] && changes['listDataReciever'].currentValue) {
@@ -10060,6 +10092,10 @@
10060
10092
  var newData = changes['addExistentHistoricData'].currentValue;
10061
10093
  this.rebuildFormGroupMap(newData);
10062
10094
  }
10095
+ if (changes['isEditMode']) {
10096
+ this.isEditMode = changes['isEditMode'].currentValue;
10097
+ this.cd.detectChanges();
10098
+ }
10063
10099
  };
10064
10100
  HistoricalPixAccountComponent.prototype.createFormGroup = function () {
10065
10101
  this.historicalPixAccountList = this.formBuilder.group({
@@ -10074,9 +10110,31 @@
10074
10110
  this.cd.detectChanges();
10075
10111
  };
10076
10112
  HistoricalPixAccountComponent.prototype.emitFormValidity = function () {
10077
- var allValid = Object.values(this.formGroupByRow).every(function (fg) {
10113
+ if (!this.formGroupByRow || Object.keys(this.formGroupByRow).length === 0) {
10114
+ this.isValidChangeForm.emit(false);
10115
+ return;
10116
+ }
10117
+ var allValid = true;
10118
+ Object.values(this.formGroupByRow).forEach(function (fg) {
10119
+ // Verifica cada controle individualmente
10120
+ Object.keys(fg.controls).forEach(function (key) {
10121
+ var control = fg.get(key);
10122
+ // Verifica se o controle é obrigatório e está vazio
10123
+ if (control.validator && control.validator({})) {
10124
+ var validatorFn = control.validator({});
10125
+ if (validatorFn && validatorFn.required && !control.value) {
10126
+ allValid = false;
10127
+ }
10128
+ }
10129
+ // Verifica se o controle tem erros
10130
+ if (control.errors) {
10131
+ allValid = false;
10132
+ }
10133
+ });
10078
10134
  fg.updateValueAndValidity();
10079
- return fg.valid;
10135
+ if (!fg.valid) {
10136
+ allValid = false;
10137
+ }
10080
10138
  });
10081
10139
  this.isValidChangeForm.emit(allValid);
10082
10140
  };
@@ -10097,65 +10155,27 @@
10097
10155
  };
10098
10156
  HistoricalPixAccountComponent.prototype.createPixRowFormGroup = function () {
10099
10157
  return this.formBuilder.group({
10158
+ id: [null],
10100
10159
  pixKeyType: [null, forms.Validators.required],
10101
10160
  pixKey: [null],
10102
10161
  percentage: [0, forms.Validators.compose(__spread(this.initialValidatorOfPercentage, [
10103
10162
  forms.Validators.max(this.maxValuePercentage),
10104
- ]))]
10163
+ ]))],
10164
+ externalId: [null],
10105
10165
  });
10106
10166
  };
10107
- HistoricalPixAccountComponent.prototype.onPixKeyInput = function (event, index) {
10108
- var inputValue = event.target.value;
10109
- var inputRawValue = inputValue.replace(/\D/g, '');
10110
- var form = this.formGroupByRow[index];
10111
- var pixKeyControl = form.get('pixKey');
10112
- if (pixKeyControl) {
10113
- pixKeyControl.setValue(inputRawValue, { emitEvent: false });
10114
- pixKeyControl.markAsDirty();
10115
- pixKeyControl.updateValueAndValidity();
10116
- }
10117
- this.setPixKeyValidators(true, form);
10118
- this.emitFormValidity();
10119
- };
10120
- HistoricalPixAccountComponent.prototype.onBlurPixCpfAndCnpj = function (index) {
10121
- var form = this.formGroupByRow[index];
10122
- var pixKeyControl = form.get('pixKey');
10123
- var pixKeyTypeControl = form.get('pixKeyType');
10124
- if (!pixKeyControl || !pixKeyTypeControl)
10125
- return;
10126
- var currentValue = pixKeyControl.value;
10127
- var pixKeyType = pixKeyTypeControl.value.key;
10128
- var rawValue = (currentValue || '').replace(/\D/g, '');
10129
- pixKeyControl.setValue(rawValue, { emitEvent: false });
10130
- if (pixKeyControl.valid) {
10131
- form.patchValue({
10132
- pixKeyFormatted: FormatUtilsService.getFormattedSubscriptionNumber(rawValue, pixKeyType)
10167
+ /**
10168
+ * Sincroniza todos os dados do NgModel para os FormGroups antes de enviar ao componente pai
10169
+ */
10170
+ HistoricalPixAccountComponent.prototype.syncPixDataToParentForm = function () {
10171
+ this.syncAllModelToForm();
10172
+ var historicalPix = __spread(this.addExistentHistoricData);
10173
+ this.historicalPixAccountList.get("historicalPixAccountList").setValue(historicalPix);
10174
+ if (this.formGroup) {
10175
+ this.formGroup.get(this.fieldFormGroup).patchValue({
10176
+ historicalPixAccountList: historicalPix
10133
10177
  });
10134
10178
  }
10135
- this.emitFormValidity();
10136
- };
10137
- HistoricalPixAccountComponent.prototype.getFormattedPixKey = function (type, value) {
10138
- return FormatUtilsService.getFormattedSubscriptionNumber(value, type);
10139
- };
10140
- HistoricalPixAccountComponent.prototype.syncPixDataToParentForm = function () {
10141
- if (!this.isEditModeForSave)
10142
- return;
10143
- var values = Object.values(this.formGroupByRow).map(function (fg) {
10144
- var value = fg.getRawValue();
10145
- var pixKeyType = value.pixKeyType.key;
10146
- if (pixKeyType === 'CPF' || pixKeyType === 'CNPJ') {
10147
- value.pixKey = (value.pixKey || '').replace(/[.\-\/]/g, '');
10148
- }
10149
- else if (pixKeyType === 'TELEPHONE') {
10150
- value.pixKey = (value.pixKey || '').replace(/[()\s\-]/g, '');
10151
- }
10152
- return value;
10153
- });
10154
- this.formGroup
10155
- .get(this.fieldFormGroup)
10156
- .get('historicalPixAccountList')
10157
- .setValue(values);
10158
- this.emitFormValidity();
10159
10179
  };
10160
10180
  HistoricalPixAccountComponent.prototype.syncResetPixFormToParent = function () {
10161
10181
  this.formGroupByRow = {};
@@ -10165,6 +10185,46 @@
10165
10185
  this.rebuildFormGroupMap(this.addExistentHistoricData);
10166
10186
  }
10167
10187
  };
10188
+ /**
10189
+ * Valida todos os formulários
10190
+ */
10191
+ HistoricalPixAccountComponent.prototype.validateAllForms = function () {
10192
+ var _this = this;
10193
+ this.forceCloseAllCellEditors();
10194
+ this.syncAllModelToForm();
10195
+ if (!this.formGroupByRow || Object.keys(this.formGroupByRow).length === 0) {
10196
+ return true;
10197
+ }
10198
+ var isAllValid = true;
10199
+ Object.keys(this.formGroupByRow).forEach(function (indexKey) {
10200
+ var index = Number(indexKey);
10201
+ var form = _this.formGroupByRow[index];
10202
+ if (form) {
10203
+ Object.keys(form.controls).forEach(function (controlName) {
10204
+ var control = form.get(controlName);
10205
+ control.markAsTouched();
10206
+ if (controlName === 'pixKey') {
10207
+ var pixKeyTypeControl = form.get('pixKeyType');
10208
+ if (pixKeyTypeControl.value) {
10209
+ _this.validateDocumentField(index, pixKeyTypeControl.value.key);
10210
+ }
10211
+ }
10212
+ });
10213
+ form.updateValueAndValidity();
10214
+ if (form.invalid) {
10215
+ isAllValid = false;
10216
+ }
10217
+ }
10218
+ });
10219
+ if (isAllValid && this.addExistentHistoricData && this.addExistentHistoricData.length > 0) {
10220
+ var totalPercentage = this.addExistentHistoricData.reduce(function (sum, item) { return sum + (parseFloat(item.percentage) || 0); }, 0);
10221
+ if (Math.abs(totalPercentage - 100) > 0.01) {
10222
+ isAllValid = false;
10223
+ }
10224
+ }
10225
+ this.isValidChangeForm.emit(isAllValid);
10226
+ return isAllValid;
10227
+ };
10168
10228
  HistoricalPixAccountComponent.prototype.onLazyLoad = function (event) {
10169
10229
  var _this = this;
10170
10230
  var first = event && event.first ? event.first : 0;
@@ -10212,9 +10272,11 @@
10212
10272
  };
10213
10273
  HistoricalPixAccountComponent.prototype.addPix = function () {
10214
10274
  var newItem = {
10275
+ id: null,
10215
10276
  pixKeyType: {},
10216
10277
  pixKey: '',
10217
- percentage: 0
10278
+ percentage: '',
10279
+ externalId: '',
10218
10280
  };
10219
10281
  var index = this.addExistentHistoricData.length;
10220
10282
  this.addExistentHistoricData = __spread(this.addExistentHistoricData, [
@@ -10225,11 +10287,27 @@
10225
10287
  this.emitFormValidity();
10226
10288
  };
10227
10289
  HistoricalPixAccountComponent.prototype.deletePix = function (index) {
10290
+ var _this = this;
10228
10291
  if (this.dataListPix.editingCell) {
10229
10292
  this.dataListPix.editingCell = null;
10230
10293
  }
10231
10294
  this.addExistentHistoricData = this.addExistentHistoricData.filter(function (_, i) { return i !== index; });
10295
+ var currentList = this.historicalPixAccountList.get("historicalPixAccountList").value || [];
10296
+ var updatedList = currentList.filter(function (_, i) { return i !== index; });
10297
+ this.historicalPixAccountList.get("historicalPixAccountList").setValue(updatedList);
10298
+ if (this.formGroup) {
10299
+ this.formGroup.get(this.fieldFormGroup).patchValue({
10300
+ historicalPixAccountList: updatedList
10301
+ });
10302
+ }
10232
10303
  this.rebuildFormGroupMap(this.addExistentHistoricData);
10304
+ this.addExistentHistoricData.forEach(function (_, i) {
10305
+ if (_this.formGroupByRow[i]) {
10306
+ var allValues = _this.addExistentHistoricData
10307
+ .map(function (item, idx) { return idx === i ? 0 : (parseFloat(item.percentage) || 0); });
10308
+ _this.validatePercentageValid(allValues, _this.formGroupByRow[i]);
10309
+ }
10310
+ });
10233
10311
  this.emitFormValidity();
10234
10312
  };
10235
10313
  HistoricalPixAccountComponent.prototype.rebuildFormGroupMap = function (data) {
@@ -10304,6 +10382,7 @@
10304
10382
  }
10305
10383
  $event["dateChange"] = this.dateChange;
10306
10384
  newDataList.push($event);
10385
+ this.addExistentHistoricData.push(__assign({}, $event));
10307
10386
  }
10308
10387
  this.historicalPixAccountList.get("historicalPixAccountList").setValue(newDataList);
10309
10388
  this.verifyTotalPercentage();
@@ -10333,7 +10412,14 @@
10333
10412
  this.msgTotalLimitByPercentage = null;
10334
10413
  }
10335
10414
  };
10415
+ HistoricalPixAccountComponent.prototype.formatPercentage = function (value) {
10416
+ if (value == null || value === '' || isNaN(Number(value))) {
10417
+ return '0.00';
10418
+ }
10419
+ return Number(value).toFixed(2);
10420
+ };
10336
10421
  HistoricalPixAccountComponent.prototype.onSyncValue = function (field, index) {
10422
+ var _this = this;
10337
10423
  if (this.formGroupByRow &&
10338
10424
  this.formGroupByRow[index] &&
10339
10425
  this.formGroupByRow[index].get(field)) {
@@ -10342,14 +10428,352 @@
10342
10428
  this.addExistentHistoricData[index][field] = value;
10343
10429
  control.markAsDirty();
10344
10430
  control.markAsTouched();
10431
+ if (field === 'percentage') {
10432
+ var currentList = this.addExistentHistoricData
10433
+ .map(function (item, i) { return i === index ? 0 : (parseFloat(item.percentage) || 0); });
10434
+ this.validatePercentageValid(currentList, this.formGroupByRow[index]);
10435
+ if (!this.isSyncingPercentage) {
10436
+ this.isSyncingPercentage = true;
10437
+ setTimeout(function () {
10438
+ _this.syncPixDataToParentForm();
10439
+ _this.isSyncingPercentage = false;
10440
+ }, 0);
10441
+ }
10442
+ }
10345
10443
  control.updateValueAndValidity();
10346
- var currentList = this.addExistentHistoricData.map(function (item, i) {
10347
- return i === index ? 0 : item.percentage;
10444
+ this.formGroupByRow[index].updateValueAndValidity();
10445
+ this.emitFormValidity();
10446
+ }
10447
+ };
10448
+ HistoricalPixAccountComponent.prototype.close = function () {
10449
+ this.visible = false;
10450
+ };
10451
+ HistoricalPixAccountComponent.prototype.getFormattedTelephoneNumber = function (telephoneNumber) {
10452
+ return FormatUtilsService.getFormattedTelephoneNumber(telephoneNumber);
10453
+ };
10454
+ HistoricalPixAccountComponent.prototype.getFormattedCpf = function (cpf) {
10455
+ return FormatUtilsService.getFormattedCpf(cpf);
10456
+ };
10457
+ HistoricalPixAccountComponent.prototype.getFormattedCnpj = function (cnpj) {
10458
+ return FormatUtilsService.getFormattedCnpj(cnpj);
10459
+ };
10460
+ HistoricalPixAccountComponent.prototype.getFormattedPercentage = function (value) {
10461
+ return FormatUtilsService.getFormattedPercentage(value);
10462
+ };
10463
+ /**
10464
+ * Reseta completamente o estado do formulário e controles
10465
+ */
10466
+ HistoricalPixAccountComponent.prototype.resetFormState = function () {
10467
+ if (this.formGroupByRow) {
10468
+ Object.values(this.formGroupByRow).forEach(function (form) {
10469
+ if (form) {
10470
+ Object.keys(form.controls).forEach(function (controlName) {
10471
+ var control = form.get(controlName);
10472
+ if (control) {
10473
+ control.setErrors(null);
10474
+ control.markAsUntouched();
10475
+ control.markAsPristine();
10476
+ }
10477
+ });
10478
+ form.updateValueAndValidity();
10479
+ }
10348
10480
  });
10349
- this.validatePercentageValid(currentList, this.formGroupByRow[index]);
10481
+ }
10482
+ if (this.dataListPix) {
10483
+ if (typeof this.dataListPix.closeAllCellEditors === 'function') {
10484
+ try {
10485
+ this.dataListPix.closeAllCellEditors();
10486
+ }
10487
+ catch (e) {
10488
+ console.error('Erro ao tentar fechar cell editors:', e);
10489
+ }
10490
+ }
10491
+ else if (this.dataListPix.editingCell) {
10492
+ this.dataListPix.editingCell = null;
10493
+ }
10494
+ if (this.dataListPix.editing !== undefined) {
10495
+ this.dataListPix.editing = false;
10496
+ }
10497
+ }
10498
+ this.cd.detectChanges();
10499
+ };
10500
+ /**
10501
+ * Formata a chave PIX para exibição baseada no tipo
10502
+ */
10503
+ HistoricalPixAccountComponent.prototype.getFormattedPixKey = function (pixKeyType, pixKey) {
10504
+ if (!pixKey)
10505
+ return '';
10506
+ switch (pixKeyType) {
10507
+ case 'CPF':
10508
+ return FormatUtilsService.getFormattedCpf(pixKey);
10509
+ case 'CNPJ':
10510
+ return FormatUtilsService.getFormattedCnpj(pixKey);
10511
+ case 'TELEPHONE':
10512
+ return FormatUtilsService.getFormattedTelephoneNumber(pixKey);
10513
+ case 'EMAIL':
10514
+ case 'RANDOM_KEY':
10515
+ default:
10516
+ return pixKey;
10517
+ }
10518
+ };
10519
+ /**
10520
+ * Obtém o tipo de chave PIX do item atual
10521
+ */
10522
+ HistoricalPixAccountComponent.prototype.getPixKeyType = function (item) {
10523
+ return item && item.pixKeyType && item.pixKeyType.key || '';
10524
+ };
10525
+ /**
10526
+ * Verifica se um controle está inválido para os campos editáveis
10527
+ */
10528
+ HistoricalPixAccountComponent.prototype.isInvalid = function (index, controlName) {
10529
+ var form = this.formGroupByRow[index];
10530
+ if (!form)
10531
+ return false;
10532
+ var control = form.get(controlName);
10533
+ if (!control)
10534
+ return false;
10535
+ return control.invalid && (control.touched || control.dirty);
10536
+ };
10537
+ /**
10538
+ * Método chamado quando uma célula entra no modo de edição
10539
+ */
10540
+ HistoricalPixAccountComponent.prototype.onCellEditInit = function (event) {
10541
+ var rowIndex = this.addExistentHistoricData.findIndex(function (item) { return item === event.data; });
10542
+ if (rowIndex < 0)
10543
+ return;
10544
+ var form = this.formGroupByRow[rowIndex];
10545
+ if (form && form.get('pixKey')) {
10546
+ var pixKeyControl = form.get('pixKey');
10547
+ var currentValue = this.addExistentHistoricData[rowIndex].pixKey;
10548
+ pixKeyControl.setValue(currentValue);
10549
+ }
10550
+ };
10551
+ /**
10552
+ * Recupera o FormControl específico para um campo em determinado índice
10553
+ */
10554
+ HistoricalPixAccountComponent.prototype.getFormControl = function (index, controlName) {
10555
+ var form = this.formGroupByRow[index];
10556
+ if (!form)
10557
+ return null;
10558
+ return form.get(controlName);
10559
+ };
10560
+ /**
10561
+ * Valida campos de documento (CPF, CNPJ) quando o usuário termina de digitar no form de edição
10562
+ */
10563
+ HistoricalPixAccountComponent.prototype.validateDocumentField = function (index, fieldType) {
10564
+ var _a;
10565
+ var form = this.formGroupByRow[index];
10566
+ var item = this.addExistentHistoricData[index];
10567
+ if (!form || !item)
10568
+ return;
10569
+ var pixKeyControl = form.get('pixKey');
10570
+ if (!pixKeyControl)
10571
+ return;
10572
+ var value = item.pixKey;
10573
+ pixKeyControl.setValue(value);
10574
+ if (fieldType === 'CPF' || fieldType === 'CNPJ' || fieldType === 'TELEPHONE') {
10575
+ value = value ? value.toString().replace(/\D/g, '') : '';
10576
+ item.pixKey = value;
10577
+ pixKeyControl.setValue(value);
10578
+ }
10579
+ if (!value || value.toString().trim() === '') {
10580
+ pixKeyControl.setErrors({ required: true });
10581
+ pixKeyControl.markAsTouched();
10582
+ form.updateValueAndValidity();
10350
10583
  this.emitFormValidity();
10584
+ return;
10585
+ }
10586
+ var cleanValue = value;
10587
+ if (fieldType === 'CPF' || fieldType === 'CNPJ') {
10588
+ cleanValue = value.toString().replace(/\D/g, '');
10589
+ item.pixKey = cleanValue;
10590
+ pixKeyControl.setValue(cleanValue);
10591
+ }
10592
+ var isValid = false;
10593
+ switch (fieldType) {
10594
+ case 'CPF':
10595
+ isValid = cleanValue.length === 11 && GenericValidator.isValidCpf({ value: cleanValue }) === null;
10596
+ break;
10597
+ case 'CNPJ':
10598
+ isValid = cleanValue.length === 14 && GenericValidator.isValidCnpj({ value: cleanValue }) === null;
10599
+ break;
10600
+ case 'TELEPHONE':
10601
+ cleanValue = value.toString().replace(/\D/g, '');
10602
+ isValid = GenericValidator.isValidPhoneNumber({ value: cleanValue }) === null;
10603
+ break;
10604
+ case 'EMAIL':
10605
+ isValid = GenericValidator.isValidEmail({ value: value }) === null;
10606
+ break;
10607
+ case 'RANDOM_KEY':
10608
+ isValid = true;
10609
+ break;
10610
+ default:
10611
+ isValid = true;
10351
10612
  }
10613
+ pixKeyControl.markAsTouched();
10614
+ if (isValid) {
10615
+ pixKeyControl.setErrors(null);
10616
+ }
10617
+ else {
10618
+ var errorType = this.getErrorTypeForField(fieldType);
10619
+ pixKeyControl.setErrors((_a = {}, _a[errorType] = true, _a));
10620
+ }
10621
+ form.updateValueAndValidity();
10622
+ this.emitFormValidity();
10623
+ this.cd.detectChanges();
10624
+ };
10625
+ /**
10626
+ * Obtém o tipo de erro para cada tipo de campo editável
10627
+ */
10628
+ HistoricalPixAccountComponent.prototype.getErrorTypeForField = function (fieldType) {
10629
+ switch (fieldType) {
10630
+ case 'CPF': return 'invalidCpf';
10631
+ case 'CNPJ': return 'invalidCnpj';
10632
+ case 'TELEPHONE': return 'invalidPhoneNumber';
10633
+ case 'EMAIL': return 'invalidEmail';
10634
+ default: return 'required';
10635
+ }
10636
+ };
10637
+ /**
10638
+ * Retorna a mensagem de erro apropriada para um campo
10639
+ */
10640
+ HistoricalPixAccountComponent.prototype.getErrorMessage = function (index, controlName) {
10641
+ var form = this.formGroupByRow[index];
10642
+ if (!form)
10643
+ return '';
10644
+ var control = form.get(controlName);
10645
+ if (!control || !control.errors)
10646
+ return '';
10647
+ var fieldValue = control.value || '';
10648
+ if (control.hasError('required')) {
10649
+ return this.translateService.instant('hcm.payroll.required');
10650
+ }
10651
+ if (control.hasError('invalidCpf')) {
10652
+ return this.translateService.instant('hcm.payroll.employees_addition_cpf_error');
10653
+ }
10654
+ else if (control.hasError('invalidCnpj')) {
10655
+ return this.translateService.instant('hcm.payroll.employees_addition_cnpj_error');
10656
+ }
10657
+ else if (control.hasError('invalidEmail')) {
10658
+ return this.translateService.instant('hcm.payroll.employees_addition_email_invalid');
10659
+ }
10660
+ else if (control.hasError('invalidPhoneNumber')) {
10661
+ return this.translateService.instant('hcm.payroll.employees_addition_invalid_phone_number', { value: fieldValue });
10662
+ }
10663
+ return '';
10664
+ };
10665
+ /**
10666
+ * Tratamento ao perder o foco em campos de documento
10667
+ */
10668
+ HistoricalPixAccountComponent.prototype.onDocumentBlur = function (index) {
10669
+ var form = this.formGroupByRow[index];
10670
+ var item = this.addExistentHistoricData[index];
10671
+ if (!form || !item)
10672
+ return;
10673
+ var pixKeyControl = form.get('pixKey');
10674
+ var pixKeyTypeControl = form.get('pixKeyType');
10675
+ if (!pixKeyControl || !pixKeyTypeControl.value)
10676
+ return;
10677
+ var pixKeyType = pixKeyTypeControl.value.key;
10678
+ var value = item.pixKey;
10679
+ if (pixKeyType === 'CPF' || pixKeyType === 'CNPJ' || pixKeyType === 'TELEPHONE') {
10680
+ value = value ? value.toString().replace(/\D/g, '') : '';
10681
+ item.pixKey = value;
10682
+ }
10683
+ pixKeyControl.setValue(value);
10684
+ this.validateDocumentField(index, pixKeyType);
10685
+ if (value) {
10686
+ if (pixKeyType === 'CPF') {
10687
+ item.pixKeyFormatted = FormatUtilsService.getFormattedCpf(value);
10688
+ }
10689
+ else if (pixKeyType === 'CNPJ') {
10690
+ item.pixKeyFormatted = FormatUtilsService.getFormattedCnpj(value);
10691
+ }
10692
+ else if (pixKeyType === 'TELEPHONE') {
10693
+ item.pixKeyFormatted = FormatUtilsService.getFormattedTelephoneNumber(value);
10694
+ }
10695
+ else {
10696
+ item.pixKeyFormatted = value;
10697
+ }
10698
+ }
10699
+ this.finishEditing();
10700
+ };
10701
+ HistoricalPixAccountComponent.prototype.finishEditing = function () {
10702
+ this.syncAllModelToForm();
10703
+ this.cd.detectChanges();
10352
10704
  };
10705
+ HistoricalPixAccountComponent.prototype.clearErrorsTemporarily = function (rowIndex) {
10706
+ var form = this.formGroupByRow[rowIndex];
10707
+ if (form && form.get('pixKey')) {
10708
+ var currentValue = form.get('pixKey').value;
10709
+ form.get('pixKey').setErrors(null);
10710
+ form.get('pixKey').setValue(currentValue);
10711
+ }
10712
+ };
10713
+ HistoricalPixAccountComponent.prototype.closeEditModeManually = function () {
10714
+ var _this = this;
10715
+ setTimeout(function () {
10716
+ if (_this.dataListPix) {
10717
+ if (typeof _this.dataListPix.closeAllCellEditors === 'function') {
10718
+ _this.dataListPix.closeAllCellEditors();
10719
+ }
10720
+ else if (_this.dataListPix.editingCell) {
10721
+ _this.dataListPix.editingCell = null;
10722
+ }
10723
+ _this.cd.detectChanges();
10724
+ }
10725
+ }, 100);
10726
+ };
10727
+ HistoricalPixAccountComponent.prototype.syncAllModelToForm = function () {
10728
+ var _this = this;
10729
+ if (!this.addExistentHistoricData || !this.formGroupByRow)
10730
+ return;
10731
+ this.addExistentHistoricData.forEach(function (item, index) {
10732
+ var form = _this.formGroupByRow[index];
10733
+ if (form) {
10734
+ Object.keys(form.controls).forEach(function (controlName) {
10735
+ var control = form.get(controlName);
10736
+ if (control && item[controlName] !== undefined) {
10737
+ control.setValue(item[controlName]);
10738
+ }
10739
+ });
10740
+ var pixKeyTypeControl = form.get('pixKeyType');
10741
+ if (pixKeyTypeControl.value) {
10742
+ _this.validateDocumentField(index, pixKeyTypeControl.value.key);
10743
+ }
10744
+ }
10745
+ });
10746
+ };
10747
+ /**
10748
+ * Método para forçar o fechamento de todas as células em edição
10749
+ */
10750
+ HistoricalPixAccountComponent.prototype.forceCloseAllCellEditors = function () {
10751
+ this.finishEditing();
10752
+ this.syncAllModelToForm();
10753
+ };
10754
+ HistoricalPixAccountComponent.prototype.isPixKeyType = function (item, type) {
10755
+ return item && item.pixKeyType && item.pixKeyType.key === type;
10756
+ };
10757
+ HistoricalPixAccountComponent.prototype.getPixKey = function (rowData) {
10758
+ return rowData ? rowData.pixKey : null;
10759
+ };
10760
+ HistoricalPixAccountComponent.prototype.setPixKey = function (rowData, value) {
10761
+ if (rowData) {
10762
+ rowData.pixKey = value;
10763
+ }
10764
+ };
10765
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isTotalPercentage100", {
10766
+ get: function () {
10767
+ if (!this.addExistentHistoricData || this.addExistentHistoricData.length === 0) {
10768
+ return false;
10769
+ }
10770
+ var totalPercentage = this.addExistentHistoricData
10771
+ .reduce(function (sum, item) { return sum + (parseFloat(item.percentage) || 0); }, 0);
10772
+ return totalPercentage >= 100;
10773
+ },
10774
+ enumerable: true,
10775
+ configurable: true
10776
+ });
10353
10777
  Object.defineProperty(HistoricalPixAccountComponent.prototype, "scopedActions", {
10354
10778
  get: function () {
10355
10779
  return this.actions.bind(this);
@@ -10359,7 +10783,8 @@
10359
10783
  });
10360
10784
  Object.defineProperty(HistoricalPixAccountComponent.prototype, "recordsMessage", {
10361
10785
  get: function () {
10362
- return (this.totalRecords || 0) + " " + (this.totalRecords === 1 ? this.translateService.instant("hcm.payroll.admission_register") : this.translateService.instant("hcm.payroll.admission_registers"));
10786
+ return (this.totalRecords || 0) + " " + (this.totalRecords === 1 ?
10787
+ this.translateService.instant("hcm.payroll.admission_register") : this.translateService.instant("hcm.payroll.admission_registers"));
10363
10788
  },
10364
10789
  enumerable: true,
10365
10790
  configurable: true
@@ -10434,21 +10859,6 @@
10434
10859
  enumerable: true,
10435
10860
  configurable: true
10436
10861
  });
10437
- HistoricalPixAccountComponent.prototype.close = function () {
10438
- this.visible = false;
10439
- };
10440
- HistoricalPixAccountComponent.prototype.getFormattedTelephoneNumber = function (telephoneNumber) {
10441
- return FormatUtilsService.getFormattedTelephoneNumber(telephoneNumber);
10442
- };
10443
- HistoricalPixAccountComponent.prototype.getFormattedCpf = function (cpf) {
10444
- return FormatUtilsService.getFormattedCpf(cpf);
10445
- };
10446
- HistoricalPixAccountComponent.prototype.getFormattedCnpj = function (cnpj) {
10447
- return FormatUtilsService.getFormattedCnpj(cnpj);
10448
- };
10449
- HistoricalPixAccountComponent.prototype.getFormattedPercentage = function (value) {
10450
- return FormatUtilsService.getFormattedPercentage(value);
10451
- };
10452
10862
  Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToAddHistorical", {
10453
10863
  get: function () {
10454
10864
  return (this.permission["incluir"]);
@@ -10544,6 +10954,15 @@
10544
10954
  __decorate([
10545
10955
  core.Input()
10546
10956
  ], HistoricalPixAccountComponent.prototype, "isEditModeForSave", void 0);
10957
+ __decorate([
10958
+ core.Input()
10959
+ ], HistoricalPixAccountComponent.prototype, "showField", void 0);
10960
+ __decorate([
10961
+ core.Input()
10962
+ ], HistoricalPixAccountComponent.prototype, "hideBtnAddForViewMode", void 0);
10963
+ __decorate([
10964
+ core.Input()
10965
+ ], HistoricalPixAccountComponent.prototype, "showButtonView", void 0);
10547
10966
  __decorate([
10548
10967
  core.Output()
10549
10968
  ], HistoricalPixAccountComponent.prototype, "isViewModeActive", void 0);
@@ -10578,8 +10997,8 @@
10578
10997
  core.Component({
10579
10998
  // tslint:disable-next-line:component-selector
10580
10999
  selector: "c-historical-pix-account",
10581
- template: "<s-sidebar *ngIf=\"withSideBar\" [visible]=\"visible\" (visibleChange)=\"close()\"\n header=\"{{'hcm.payroll.historical_pix_account_title_form'|translate}}\">\n<pix-account [(visible)]=\"visible\"\n [isEditAndViewValue]=\"pixAccountItemInput\"\n [currency]=\"currency\"\n [customEntity]=\"customEntity\"\n [customService]=\"customService\"\n [getListPixAccount]=\"listDataNoPage\"\n [paramsForm]=\"paramsForm\"\n (pixAccountItemToList)=\"addItemInList($event)\"\n [defaultCpfNumber]=\"defaultCpfNumber\"></pix-account>\n</s-sidebar>\n\n<div *ngIf=\"!withSideBar\">\n <pix-account [(visible)]=\"visible\"\n [isEditAndViewValue]=\"pixAccountItemInput\"\n [currency]=\"currency\"\n [customEntity]=\"customEntity\"\n [customService]=\"customService\"\n [getListPixAccount]=\"listDataNoPage\"\n [withSideBar]=\"false\"\n [isViewMode]=\"isViewMode\"\n [paramsForm]=\"paramsForm\"\n (pixAccountItemToList)=\"addItemInList($event)\"\n [defaultCpfNumber]=\"defaultCpfNumber\"></pix-account>\n</div>\n\n<div class=\"ui-g-1\" *ngIf=\"withSideBar && !isEditMode\">\n <div class=\"form-group \">\n <s-button id=\"ta-addPayAnnuity\"\n [disabled]=\"getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage\"\n (onClick)=\"add()\"\n [pTooltip]=\"getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage\"\n tooltipPosition=\"top\"\n label=\"{{'hcm.payroll.historical_pix_account_add'|translate}}\"></s-button>\n </div>\n</div>\n<div *ngIf=\"!showEditMode || !(hideFields | async)\" class=\"ui-g-12\">\n <p-table\n id=\"table-annuity\"\n [value]=\"listData\"\n [columns]=\"cols\"\n (onLazyLoad)=\"onLazyLoad($event)\"\n [lazy]=\"true\"\n [scrollable]=\"true\"\n [paginator]=\"true\"\n [totalRecords]=\"totalRecords\"\n [sortMode]=\"'multiple'\"\n *sLoadingState=\"loading\"\n [rows]=\"recordByRow\"\n dataKey=\"id\">\n <ng-template pTemplate=\"colgroup\" let-coumns>\n <colgroup>\n <col [ngClass]=\"'col-default-m'\">\n <col [ngClass]=\"'col-default-m'\">\n <col [ngClass]=\"'col-default-s'\">\n <col *ngIf=\"showButtonView\" [ngClass]=\"'col-action'\">\n </colgroup>\n </ng-template>\n <ng-template pTemplate=\"header\" let-columns>\n <!-- Cabe\u00E7alhos quando da table \u00E9 permitido ordenar as colunas -->\n <tr>\n <!-- Cabe\u00E7alhos das colunas da tabela -->\n <th\n [pSortableColumn]=\"'pixKeyType'\"\n [pTooltip]=\"'hcm.payroll.employees_addition_pix_key_type' | translate\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >\n <div class=\"senior-header\" id=\"table-0\">\n <span\n id=\"table-annuity-s-0\">{{ 'hcm.payroll.employees_addition_pix_key_type' | translate }}</span>\n <p-sortIcon class=\"p-sorticon-status\"\n [field]=\"'hcm.payroll.employees_addition_pix_key_type' | translate\"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]=\"'pixKey'\"\n [pTooltip]=\"'hcm.payroll.employees_addition_pix_key' | translate\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >\n <div class=\"senior-header\">\n <span>{{ 'hcm.payroll.employees_addition_pix_key' | translate }}</span>\n <p-sortIcon class=\"p-sorticon-status\"\n [field]=\"'hcm.payroll.employees_addition_pix_key' | translate\"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]=\"'percentage'\"\n [pTooltip]=\"'hcm.payroll.historical_pix_account_label_percentage' | translate\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >\n <div class=\"senior-header\">\n <span>{{ 'hcm.payroll.historical_pix_account_label_percentage' | translate }}</span>\n <p-sortIcon class=\"p-sorticon-status\"\n [field]=\"'hcm.payroll.historical_pix_account_label_percentage' | translate\"></p-sortIcon>\n </div>\n </th>\n <!-- Cabe\u00E7alho da coluna de a\u00E7\u00F5es -->\n <th *ngIf=\"showButtonView\" id=\"col-actions\"></th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowData let-key=\"rowIndex\">\n\n <tr [ngClass]=\"'row'+key\" [pSelectableRow]=\"rowData\">\n <td [pTooltip]=\"rowData?.pixKeyType.value\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ rowData?.pixKeyType.value }}</span>\n </td>\n\n <ng-container [ngSwitch]=\"rowData?.pixKeyType.key\">\n <td *ngSwitchCase=\"'TELEPHONE'\"\n [pTooltip]=\"getFormattedTelephoneNumber(rowData?.pixKey)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedTelephoneNumber(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchCase=\"'CPF'\"\n [pTooltip]=\"getFormattedCpf(rowData?.pixKey)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedCpf(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchCase=\"'CNPJ'\"\n [pTooltip]=\"getFormattedCnpj(rowData?.pixKey)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedCnpj(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchDefault\n [pTooltip]=\"rowData?.pixKey\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ rowData?.pixKey }}</span>\n </td>\n </ng-container>\n <td [pTooltip]=\"getFormattedPercentage(rowData?.percentage)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedPercentage(rowData?.percentage) }}</span>\n </td>\n <td id=\"col-actions-{{key}}\" class=\"col-actions \"\n *ngIf=\"actions && actions(rowData, key)?.length && showButtonView\">\n <s-button id=\"table-admission-btn-actions-{{key}}\"\n *ngIf=\"!isViewMode && actions(rowData, key).length > 1\" [label]=\"actionLabel\"\n priority=\"default\" [model]=\"scopedActions(rowData, key)\"\n [disabled]=\"false\" [auxiliary]=\"true\"></s-button>\n\n <s-button id=\"table-admission-btn-action-{{key}}\"\n *ngIf=\"!isViewMode && actions(rowData, key).length <= 1\"\n [label]=\"scopedActions(rowData, key)[0].label\"\n priority=\"default\"\n (click)=\"scopedActions(rowData, key)[0].command()\"\n [disabled]=\"false\" [auxiliary]=\"true\"></s-button>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"emptymessage\" let-columns>\n <tr>\n <td [attr.colspan]=\"columns.length +2\">\n {{'hcm.payroll.admission_empty_message'|translate}}\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"paginatorright\">\n <span *ngIf=\"totalRecords\">{{recordsMessage}}</span>\n </ng-template>\n </p-table>\n</div>\n\n<!-- Template exlusivo para edi\u00E7\u00E3o de pix via modal-->\n<div *ngIf=\"showEditMode && (hideFields | async)\" class=\"ui-g-12\">\n <!-- Bot\u00E3o Adicionar -->\n <div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <s-button\n id=\"btn-save\"\n label=\"{{ 'hcm.payroll.historical_pix_account_add' | translate}}\"\n priority=\"primary\"\n (onClick)=\"addPix()\">\n </s-button>\n </div>\n </div>\n\n <!-- Tabela -->\n <p-table #dataListPix sortField=\"percentage\"\n [columns]=\"cols\"\n [value]=\"addExistentHistoricData\"\n [pageLinks]=\"3\"\n [paginator]=\"true\"\n [responsive]=\"true\"\n [rows]=\"10\"\n [resetPageOnSort]=\"false\"\n [tableStyle]=\"{'margin-top': '2rem'}\"\n [customSort]=\"true\">\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th *ngFor=\"let col of cols\">\n {{ col.label }}\n </th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-item let-rowIndex=\"rowIndex\">\n <ng-container *ngIf=\"formGroupByRow[rowIndex]\" [formGroup]=\"formGroupByRow[rowIndex]\">\n <tr>\n <!-- Tipo de Chave -->\n <td class=\"ui-md-6 ui-sm-12 required\"\n [pEditableColumn]=\"item.pixKeyType\" pEditableColumnField=\"pixKeyType\">\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <div style=\"width: 100%; position: relative;\">\n <p-autoComplete\n [suggestions]=\"suggestions\"\n (completeMethod)=\"filterPixKeyType($event)\"\n formControlName=\"pixKeyType\"\n [dropdown]=\"true\"\n (onSelect)=\"onPixKeyTypeChange($event, rowIndex)\"\n (onClear)=\"onPixKeyTypeClear(rowIndex)\"\n (ngModelChange)=\"onSyncValue('pixKeyType', rowIndex)\"\n field=\"value\"\n placeholder=\"{{'hcm.payroll.select' | translate}}\"\n appendTo=\"body\"\n [panelStyle]=\"{ maxWidth: '300px', width: '100%' }\"\n [inputStyle]=\"{ width: '100%' }\"\n ></p-autoComplete>\n\n <s-control-errors [control]=\"formGroupByRow[rowIndex]?.get('pixKeyType')\"\n [errorMessages]=\"{\n required: 'hcm.payroll.required' | translate,\n pixKeyTypeBankAccountDuplicate: 'hcm.payroll.historical_pix_key_type_bank_account_duplicate' | translate\n }\">\n </s-control-errors>\n </div>\n </ng-template>\n <ng-template pTemplate=\"output\">\n {{ item.pixKeyType?.value }}\n </ng-template>\n </p-cellEditor>\n </td>\n\n <!-- Chave Pix -->\n <td class=\"ui-md-6 ui-sm-12 required\"\n [pEditableColumn]=\"item.pixKey\" pEditableColumnField=\"pixKey\"\n [ngClass]=\"{'required': item.pixKeyType.key !== 'BANK_ACCOUNT',\n 'disabled': item.pixKeyType && item.pixKeyType.key === 'BANK_ACCOUNT'\n }\">\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <ng-container [ngSwitch]=\"item.pixKeyType.key\">\n <input *ngSwitchCase=\"'TELEPHONE'\"\n only-number\n pInputText\n type=\"text\"\n formControlName=\"pixKey\"\n (keyup)=\"phoneMask($event)\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\"\n maxlength=\"15\"\n placeholder=\"(__) ____-____\" />\n\n <input *ngSwitchCase=\"'CPF'\"\n type=\"text\"\n pInputText\n formControlName=\"pixKey\"\n maxlength=\"14\"\n placeholder=\"___.___.___-__\"\n (input)=\"onPixKeyInput($event, rowIndex)\"\n (blur)=\"onBlurPixCpfAndCnpj(rowIndex)\"\n (keyup)=\"cpfMask($event)\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\" />\n\n <input *ngSwitchCase=\"'CNPJ'\"\n type=\"text\"\n pInputText\n formControlName=\"pixKey\"\n maxlength=\"18\"\n placeholder=\"___.___.___/____-__\"\n (input)=\"onPixKeyInput($event, rowIndex)\"\n (blur)=\"onBlurPixCpfAndCnpj(rowIndex)\"\n (keyup)=\"cnpjMask($event)\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\" />\n\n <input *ngSwitchCase=\"'EMAIL'\"\n pInputText\n type=\"email\"\n formControlName=\"pixKey\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\"\n placeholder=\"{{ 'hcm.payroll.employees_addition_email' | translate }}\" />\n\n <input *ngSwitchCase=\"'BANK_ACCOUNT'\"\n pInputText\n formControlName=\"pixKey\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\"\n [disabled]=\"true\" />\n\n <input *ngSwitchDefault\n pInputText\n type=\"text\"\n formControlName=\"pixKey\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\"\n maxlength=\"100\" />\n </ng-container>\n\n <s-control-errors *ngIf=\"isShowPixKeyFieldValidatorMessage\"\n [control]=\"formGroupByRow[rowIndex]?.get('pixKey')\"\n [errorMessages]=\"{\n required: 'hcm.payroll.required' | translate,\n invalidPhoneNumber: 'hcm.payroll.employees_addition_invalid_phone_number' | translate: { value: formGroupByRow[rowIndex]?.get('pixKey').value },\n invalidEmail: 'hcm.payroll.employees_addition_email_invalid' | translate,\n cpfNotValid: 'hcm.payroll.employees_addition_cpf_error' | translate,\n cnpjNotValid: 'hcm.payroll.employees_addition_cnpj_error' | translate\n }\">\n </s-control-errors>\n </ng-template>\n <ng-template pTemplate=\"output\">\n {{ getFormattedPixKey(item.pixKeyType?.key, item.pixKey) }}\n </ng-template>\n </p-cellEditor>\n </td>\n\n <!-- Percentual -->\n <td class=\"ui-md-6 ui-sm-12 required\"\n [pEditableColumn]=\"item.percentage\" pEditableColumnField=\"percentage\">\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <input\n pInputText type=\"number\"\n formControlName=\"percentage\"\n (ngModelChange)=\"onSyncValue('percentage', rowIndex)\"\n >\n <s-control-errors\n [control]=\"formGroupByRow[rowIndex]?.get('percentage')\"\n [errorMessages]=\"{\n required: 'hcm.payroll.required' | translate,\n maxlength: 'hcm.payroll.error_max_length' | translate: { value: '6' },\n max: 'hcm.payroll.error_max_value_number' | translate: { value: maxValuePercentage },\n min: 'hcm.payroll.error_min_value_number' | translate: { value: '0,01' }\n }\">\n </s-control-errors>\n </ng-template>\n <ng-template pTemplate=\"output\">\n {{ item.percentage?.toFixed(2).replace('.', ',') }}%\n </ng-template>\n </p-cellEditor>\n </td>\n\n <!-- Bot\u00E3o de excluir -->\n <td>\n <s-button\n id=\"btn-delete\"\n label=\"{{ 'hcm.payroll.delete' | translate }}\"\n priority=\"default\"\n (onClick)=\"deletePix(rowIndex)\">\n </s-button>\n </td>\n </tr>\n </ng-container>\n </ng-template>\n </p-table>\n</div>\n",
10582
- 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}"]
11000
+ 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",
11001
+ 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}"]
10583
11002
  })
10584
11003
  ], HistoricalPixAccountComponent);
10585
11004
  return HistoricalPixAccountComponent;
@@ -10593,6 +11012,7 @@
10593
11012
  _this.sharedStateService = sharedStateService;
10594
11013
  _this.withSideBar = true;
10595
11014
  _this.isEditMode = false;
11015
+ _this.showField = false;
10596
11016
  _this.visibleChange = new core.EventEmitter();
10597
11017
  _this.pixAccountItemToList = new core.EventEmitter();
10598
11018
  _this.ngUnsubscribe = new rxjs.Subject();
@@ -10679,8 +11099,6 @@
10679
11099
  this.visible = false;
10680
11100
  };
10681
11101
  HistoricalPixAccountFormComponent.prototype.addItem = function () {
10682
- this.pixAccountFormGroup.updateValueAndValidity();
10683
- verifyValidationsForm.call(this.pixAccountFormGroup);
10684
11102
  if (this.pixAccountFormGroup.valid) {
10685
11103
  if (this.employeeId) {
10686
11104
  this.pixAccountFormGroup.get("employee").setValue({
@@ -10779,6 +11197,9 @@
10779
11197
  __decorate([
10780
11198
  core.Input()
10781
11199
  ], HistoricalPixAccountFormComponent.prototype, "isEditMode", void 0);
11200
+ __decorate([
11201
+ core.Input()
11202
+ ], HistoricalPixAccountFormComponent.prototype, "showField", void 0);
10782
11203
  __decorate([
10783
11204
  core.Output()
10784
11205
  ], HistoricalPixAccountFormComponent.prototype, "visibleChange", void 0);
@@ -10806,8 +11227,8 @@
10806
11227
  HistoricalPixAccountFormComponent = __decorate([
10807
11228
  core.Component({
10808
11229
  selector: "pix-account",
10809
- 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",
10810
- 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}"]
11230
+ 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",
11231
+ 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}"]
10811
11232
  })
10812
11233
  ], HistoricalPixAccountFormComponent);
10813
11234
  return HistoricalPixAccountFormComponent;
@@ -10897,10 +11318,13 @@
10897
11318
  this.endPoint = "hcm/payroll/queries/historicalEmployeePixQuery";
10898
11319
  this.keyPayload = "historicalEmployeePix";
10899
11320
  this.withSidebar = true;
11321
+ this.showActionsButtonOnAdd = false;
10900
11322
  this.isOnlyView = new core.EventEmitter();
10901
11323
  this.isOnlyEdit = new core.EventEmitter();
10902
11324
  this.enableView = new core.EventEmitter();
10903
11325
  this.isEditJudicialDependentPix = new core.EventEmitter();
11326
+ this.isHideBtnAddForViewMode = new core.EventEmitter();
11327
+ this.isShowActionsButton = new core.EventEmitter();
10904
11328
  this.ngUnsubscribe = new rxjs.Subject();
10905
11329
  this.loading = true;
10906
11330
  this.columns = [
@@ -10941,16 +11365,21 @@
10941
11365
  command: function () {
10942
11366
  if (_this.isAllowToViewHistorical) {
10943
11367
  _this.sharedStateService.setHideField(true);
10944
- _this.sharedStateService.setShowButton(false);
11368
+ _this.isShowActionsButton.emit(false);
10945
11369
  _this.sharedStateService.setShowEditMode(false);
10946
11370
  var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
10947
11371
  if (_this.withSidebar) {
10948
11372
  _this.isOnlyView.emit(true);
11373
+ _this.isOnlyEdit.emit(false);
11374
+ _this.isHideBtnAddForViewMode.emit(true);
11375
+ _this.sharedStateService.setHideBtnAddForViewMode(true);
11376
+ _this.sharedStateService.setActiveHideOptionsOnView(true);
10949
11377
  _this.router.navigate(["historical-pix-account/" + dateChange], {
10950
11378
  relativeTo: _this.activatedRoute,
10951
11379
  });
10952
11380
  }
10953
11381
  else {
11382
+ _this.sharedStateService.setActiveHideOptionsOnView(true);
10954
11383
  _this.sharedStateService.setSaveButton(false);
10955
11384
  _this.enableView.emit(dateChange);
10956
11385
  }
@@ -10965,15 +11394,21 @@
10965
11394
  command: function () {
10966
11395
  if (_this.isAllowToEditHistorical) {
10967
11396
  _this.sharedStateService.setHideField(true);
10968
- _this.sharedStateService.setShowButton(false);
11397
+ _this.isShowActionsButton.emit(true);
10969
11398
  _this.sharedStateService.setShowEditMode(true);
10970
11399
  var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
10971
11400
  if (_this.withSidebar) {
11401
+ _this.isOnlyView.emit(false);
11402
+ _this.isOnlyEdit.emit(true);
11403
+ _this.isHideBtnAddForViewMode.emit(false);
11404
+ _this.sharedStateService.setHideBtnAddForViewMode(false);
11405
+ _this.sharedStateService.setActiveHideOptionsOnView(false);
10972
11406
  _this.router.navigate(["historical-pix-account/" + dateChange], {
10973
11407
  relativeTo: _this.activatedRoute,
10974
11408
  });
10975
11409
  }
10976
11410
  else {
11411
+ _this.sharedStateService.setActiveHideOptionsOnView(false);
10977
11412
  setTimeout(function () {
10978
11413
  _this.sharedStateService.triggerActiveValidatorsOnEditModalOpen();
10979
11414
  });
@@ -11163,6 +11598,9 @@
11163
11598
  __decorate([
11164
11599
  core.Input()
11165
11600
  ], HistoricalPixAccountListComponent.prototype, "hideField", void 0);
11601
+ __decorate([
11602
+ core.Input()
11603
+ ], HistoricalPixAccountListComponent.prototype, "showActionsButtonOnAdd", void 0);
11166
11604
  __decorate([
11167
11605
  core.Output()
11168
11606
  ], HistoricalPixAccountListComponent.prototype, "isOnlyView", void 0);
@@ -11175,6 +11613,12 @@
11175
11613
  __decorate([
11176
11614
  core.Output()
11177
11615
  ], HistoricalPixAccountListComponent.prototype, "isEditJudicialDependentPix", void 0);
11616
+ __decorate([
11617
+ core.Output()
11618
+ ], HistoricalPixAccountListComponent.prototype, "isHideBtnAddForViewMode", void 0);
11619
+ __decorate([
11620
+ core.Output()
11621
+ ], HistoricalPixAccountListComponent.prototype, "isShowActionsButton", void 0);
11178
11622
  __decorate([
11179
11623
  core.Input()
11180
11624
  ], HistoricalPixAccountListComponent.prototype, "hideFieldsOnAdd$", null);