@senior-gestao-pessoas/payroll-core 9.4.0-beccc0e0-72b8-4a99-8127-32ad8ca6ee41 → 9.4.0-db1d034b-8b09-472f-9726-7fd71af961f4

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 (39) hide show
  1. package/bundles/senior-gestao-pessoas-payroll-core.umd.js +921 -761
  2. package/bundles/senior-gestao-pessoas-payroll-core.umd.js.map +1 -1
  3. package/bundles/senior-gestao-pessoas-payroll-core.umd.min.js +16 -1
  4. package/bundles/senior-gestao-pessoas-payroll-core.umd.min.js.map +1 -1
  5. package/components/historical-pix-account/historical-pix-account-base.d.ts +25 -0
  6. package/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.d.ts +8 -40
  7. package/components/historical-pix-account/historical-pix-account.component.d.ts +23 -6
  8. package/components/historical-pix-account/historical-pix-account.service.d.ts +1 -0
  9. package/components/historical-pix-account-list/historical-pix-account-list.component.d.ts +9 -1
  10. package/components/shared/index.d.ts +1 -0
  11. package/components/shared/shared-state.service.d.ts +14 -0
  12. package/esm2015/components/historical-pix-account/historical-pix-account-base.js +150 -0
  13. package/esm2015/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.js +29 -187
  14. package/esm2015/components/historical-pix-account/historical-pix-account.component.js +79 -18
  15. package/esm2015/components/historical-pix-account/historical-pix-account.module.js +5 -1
  16. package/esm2015/components/historical-pix-account/historical-pix-account.service.js +8 -1
  17. package/esm2015/components/historical-pix-account-list/historical-pix-account-list.component.js +38 -5
  18. package/esm2015/components/shared/index.js +2 -0
  19. package/esm2015/components/shared/shared-state.service.js +36 -0
  20. package/esm2015/public_api.js +2 -1
  21. package/esm2015/senior-gestao-pessoas-payroll-core.js +3 -2
  22. package/esm5/components/historical-pix-account/historical-pix-account-base.js +163 -0
  23. package/esm5/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.js +53 -201
  24. package/esm5/components/historical-pix-account/historical-pix-account.component.js +122 -48
  25. package/esm5/components/historical-pix-account/historical-pix-account.module.js +5 -1
  26. package/esm5/components/historical-pix-account/historical-pix-account.service.js +8 -1
  27. package/esm5/components/historical-pix-account-list/historical-pix-account-list.component.js +43 -5
  28. package/esm5/components/shared/index.js +2 -0
  29. package/esm5/components/shared/shared-state.service.js +37 -0
  30. package/esm5/public_api.js +2 -1
  31. package/esm5/senior-gestao-pessoas-payroll-core.js +3 -2
  32. package/fesm2015/senior-gestao-pessoas-payroll-core.js +576 -457
  33. package/fesm2015/senior-gestao-pessoas-payroll-core.js.map +1 -1
  34. package/fesm5/senior-gestao-pessoas-payroll-core.js +917 -758
  35. package/fesm5/senior-gestao-pessoas-payroll-core.js.map +1 -1
  36. package/package.json +1 -1
  37. package/public_api.d.ts +1 -0
  38. package/senior-gestao-pessoas-payroll-core.d.ts +2 -1
  39. package/senior-gestao-pessoas-payroll-core.metadata.json +1 -1
@@ -1,4 +1,4 @@
1
- import { __decorate, __assign, __spread, __awaiter, __generator, __read, __values } from 'tslib';
1
+ import { __decorate, __assign, __spread, __awaiter, __generator, __read, __values, __extends } from 'tslib';
2
2
  import { Input, Component, NgModule, EventEmitter, ViewChild, Output, ElementRef, HostListener, Directive, Injectable, ViewEncapsulation, ɵɵdefineInjectable, ɵɵinject, ChangeDetectorRef } from '@angular/core';
3
3
  import { FormsModule, ReactiveFormsModule, FormGroup, FormArray, FormControl, Validators, FormBuilder } from '@angular/forms';
4
4
  import { BlockUIModule } from 'primeng/blockui';
@@ -36,6 +36,7 @@ import { CurrencyMaskModule } from 'ng2-currency-mask';
36
36
  import { FieldsetModule } from 'primeng/fieldset';
37
37
  import { PanelModule } from 'primeng/panel';
38
38
  import { ConfirmDialogModule } from 'primeng/confirmdialog';
39
+ import { TabViewModule } from 'primeng/tabview';
39
40
 
40
41
  /**
41
42
  * Created by Bruno.Curioletti on 30/05/2017.
@@ -9255,631 +9256,914 @@ var FormatUtilsService = /** @class */ (function () {
9255
9256
  return FormatUtilsService;
9256
9257
  }());
9257
9258
 
9258
- var HistoricalPixAccountComponent = /** @class */ (function () {
9259
- function HistoricalPixAccountComponent(translateService, cd, formBuilder, messageService) {
9260
- var _this = this;
9261
- this.translateService = translateService;
9262
- this.cd = cd;
9263
- this.formBuilder = formBuilder;
9264
- this.messageService = messageService;
9265
- this.recordByRow = 1;
9266
- this.showDateChange = false;
9267
- this.isEditMode = false;
9268
- this.isViewMode = false;
9269
- this.withSideBar = true;
9270
- this.defaultCpfNumber = null;
9271
- this.listDataReciever = [];
9272
- this.isViewModeActive = new EventEmitter();
9273
- this.isEditModeActive = new EventEmitter();
9274
- this.isDeleteModeActive = new EventEmitter();
9275
- this.listFromApp = [];
9276
- this.visibleChange = new EventEmitter();
9277
- this.ngUnsubscribe = new Subject();
9278
- this.orderBy = {
9279
- field: "dateChange",
9280
- direction: DirectionEnumeration.DESC,
9281
- };
9282
- this.pixAccountItemInput = {};
9283
- this.totalRecords = 0;
9284
- this.actionLabel = this.translateService.instant("hcm.payroll.entries_query_actions_total_title");
9285
- this.loading = true;
9286
- this.listData = [];
9287
- this.listDataNoPage = [];
9288
- this.cols = [
9289
- {
9290
- label: this.translateService.instant("hcm.payroll.employees_addition_pix_key_type"),
9291
- field: "pixKeyType",
9292
- },
9293
- {
9294
- label: this.translateService.instant("hcm.payroll.employees_addition_pix_key"),
9295
- field: "pixKey",
9296
- },
9297
- {
9298
- label: this.translateService.instant("hcm.payroll.historical_pix_account_label_percentage"),
9299
- field: "percentage",
9300
- },
9301
- ];
9302
- this.actions = function (rowData, key) {
9303
- if (rowData === void 0) { rowData = {}; }
9304
- return [
9305
- {
9306
- visible: _this.isEditMode,
9307
- label: _this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
9308
- command: function () {
9309
- if (_this.isAllowToViewHistorical) {
9310
- rowData["index"] = key;
9311
- _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: false };
9312
- _this.visible = true;
9313
- }
9314
- else {
9315
- _this.isViewModeActive.emit(true);
9316
- }
9317
- },
9318
- },
9319
- {
9320
- visible: !!(!_this.isEditMode && _this.withSideBar),
9321
- label: _this.translateService.instant("hcm.payroll.edit"),
9322
- command: function () {
9323
- if (_this.isAllowToEditHistorical) {
9324
- rowData["index"] = key;
9325
- _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true };
9326
- _this.visible = true;
9327
- }
9328
- else {
9329
- _this.isEditModeActive.emit(true);
9330
- if (_this.listFromApp.length == 0) {
9331
- rowData["index"] = key;
9332
- _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true };
9333
- _this.visible = true;
9334
- }
9335
- }
9336
- },
9337
- },
9338
- {
9339
- visible: !_this.isEditMode,
9340
- label: _this.translateService.instant("hcm.payroll.delete"),
9341
- command: function () {
9342
- if (_this.isAllowToDeleteHistorical) {
9343
- _this.loading = true;
9344
- _this.deleteAnnuityItem(key);
9345
- }
9346
- else {
9347
- _this.isDeleteModeActive.emit(true);
9348
- if (_this.listFromApp.length == 0) {
9349
- _this.loading = true;
9350
- _this.deleteAnnuityItem(key);
9351
- }
9352
- }
9353
- },
9354
- },
9355
- ];
9356
- };
9357
- this.createFormGroup();
9259
+ var SharedStateService = /** @class */ (function () {
9260
+ function SharedStateService() {
9261
+ this.hideFieldSubject = new BehaviorSubject(true);
9262
+ this.hideField$ = this.hideFieldSubject.asObservable();
9263
+ this.showButtonSubject = new BehaviorSubject(true);
9264
+ this.showButton$ = this.showButtonSubject.asObservable();
9265
+ this.saveButtonSubject = new BehaviorSubject(true);
9266
+ this.saveButton$ = this.saveButtonSubject.asObservable();
9267
+ this.showEditMode = new BehaviorSubject(true);
9268
+ this.showEditMode$ = this.showEditMode.asObservable();
9358
9269
  }
9359
- HistoricalPixAccountComponent.prototype.ngOnInit = function () {
9360
- this.formGroup.setControl(this.fieldFormGroup, this.historicalPixAccountList);
9361
- };
9362
- HistoricalPixAccountComponent.prototype.ngOnChanges = function (changes) {
9363
- if (changes['listDataReciever'] && changes['listDataReciever'].currentValue) {
9364
- this.listFromApp = changes['listDataReciever'].currentValue;
9365
- }
9270
+ SharedStateService.prototype.setHideField = function (value) {
9271
+ this.hideFieldSubject.next(value);
9366
9272
  };
9367
- HistoricalPixAccountComponent.prototype.createFormGroup = function () {
9368
- this.historicalPixAccountList = this.formBuilder.group({
9369
- historicalPixAccountList: this.formBuilder.control(null),
9370
- });
9273
+ SharedStateService.prototype.setShowButton = function (value) {
9274
+ this.showButtonSubject.next(value);
9371
9275
  };
9372
- HistoricalPixAccountComponent.prototype.ngOnDestroy = function () {
9373
- this.ngUnsubscribe.next();
9374
- this.ngUnsubscribe.complete();
9276
+ SharedStateService.prototype.setSaveButton = function (value) {
9277
+ this.saveButtonSubject.next(value);
9375
9278
  };
9376
- HistoricalPixAccountComponent.prototype.ngAfterViewInit = function () {
9377
- this.cd.detectChanges();
9279
+ SharedStateService.prototype.setShowEditMode = function (value) {
9280
+ this.showEditMode.next(value);
9378
9281
  };
9379
- HistoricalPixAccountComponent.prototype.onLazyLoad = function (event) {
9380
- var _this = this;
9381
- var first = event && event.first ? event.first : 0;
9382
- var rows = event && event.rows ? event.rows : this.recordByRow;
9383
- var arrList = this.getHistoricalPixAccountList();
9384
- this.listData = [];
9385
- this.totalRecords = null;
9386
- if (event && event.multiSortMeta && event.multiSortMeta.length) {
9387
- event.multiSortMeta.map(function (value) {
9388
- _this.orderBy.field = value.field;
9389
- _this.orderBy.direction = value.order === 1 ? DirectionEnumeration.ASC : DirectionEnumeration.DESC;
9390
- });
9391
- }
9392
- if (arrList && arrList.length) {
9393
- this.totalRecords = arrList.length;
9394
- this.listData = arrList;
9395
- this.listDataNoPage = __spread(arrList);
9396
- this.listData.sort(compareValues(this.orderBy.field, this.orderBy.direction));
9397
- this.listData = this.listData.slice(first, (first + rows));
9398
- }
9282
+ SharedStateService.ngInjectableDef = ɵɵdefineInjectable({ factory: function SharedStateService_Factory() { return new SharedStateService(); }, token: SharedStateService, providedIn: "root" });
9283
+ SharedStateService = __decorate([
9284
+ Injectable({
9285
+ providedIn: 'root',
9286
+ })
9287
+ ], SharedStateService);
9288
+ return SharedStateService;
9289
+ }());
9290
+
9291
+ var GenericValidator = /** @class */ (function () {
9292
+ function GenericValidator() {
9293
+ }
9294
+ /**
9295
+ * Valida o CEI (Cadastro específico de INSS) digitado.
9296
+ */
9297
+ GenericValidator.isValidCei = function (control) {
9298
+ var cei = control.value;
9299
+ if (!cei)
9300
+ return null;
9301
+ else if (cei.length != 11)
9302
+ return null;
9303
+ var multiplicadorBase = "3298765432";
9304
+ var total = 0;
9305
+ var resto = 0;
9306
+ var multiplicando = 0;
9307
+ var multiplicador = 0;
9308
+ if (cei.length !== 11 ||
9309
+ cei === "00000000000" ||
9310
+ cei === "11111111111" ||
9311
+ cei === "22222222222" ||
9312
+ cei === "33333333333" ||
9313
+ cei === "44444444444" ||
9314
+ cei === "55555555555" ||
9315
+ cei === "66666666666" ||
9316
+ cei === "77777777777" ||
9317
+ cei === "88888888888" ||
9318
+ cei === "99999999999")
9319
+ return { invalidCei: true };
9399
9320
  else {
9400
- this.listDataNoPage = [];
9401
- }
9402
- if (this.isEditMode || arrList && arrList.length === 1) {
9403
- this.refreshCssInIE11();
9321
+ for (var i = 0; i < 10; i++) {
9322
+ multiplicando = parseInt(cei.substring(i, i + 1), 10);
9323
+ multiplicador = parseInt(multiplicadorBase.substring(i, i + 1), 10);
9324
+ total += multiplicando * multiplicador;
9325
+ }
9326
+ resto = 11 - (total % 11);
9327
+ resto = resto === 10 || resto === 11 ? 0 : resto;
9328
+ var digito = parseInt("" + cei.charAt(10), 10);
9329
+ return resto === digito ? null : { invalidCei: true };
9404
9330
  }
9405
- this.loading = false;
9406
9331
  };
9407
9332
  /**
9408
- * Um Bug de CSS que acontece nas linhas da tabela, que resolve só atualizando qualquer parte do CSS da pagina.
9333
+ * Valida se o CPF é valido. Deve-se ser informado o cpf sem máscara.
9409
9334
  */
9410
- HistoricalPixAccountComponent.prototype.refreshCssInIE11 = function () {
9411
- if (/msie\s|trident\/|edge\//i.test(window.navigator.userAgent)) {
9412
- setTimeout(function () {
9413
- var row = document.getElementsByClassName("row0");
9414
- if (row && row[0])
9415
- row[0].className = 'refresh';
9416
- }, 1);
9335
+ GenericValidator.isValidCpf = function (control) {
9336
+ var cpf = control.value;
9337
+ if (cpf) {
9338
+ var numbers = void 0, digits = void 0, sum = void 0, i = void 0, result = void 0, equalDigits = void 0;
9339
+ equalDigits = 1;
9340
+ if (cpf.length < 11) {
9341
+ return null;
9342
+ }
9343
+ for (i = 0; i < cpf.length - 1; i++) {
9344
+ if (cpf.charAt(i) !== cpf.charAt(i + 1)) {
9345
+ equalDigits = 0;
9346
+ break;
9347
+ }
9348
+ }
9349
+ if (!equalDigits) {
9350
+ numbers = cpf.substring(0, 9);
9351
+ digits = cpf.substring(9);
9352
+ sum = 0;
9353
+ for (i = 10; i > 1; i--) {
9354
+ sum += numbers.charAt(10 - i) * i;
9355
+ }
9356
+ result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9357
+ if (result !== Number(digits.charAt(0))) {
9358
+ return { cpfNotValid: true };
9359
+ }
9360
+ numbers = cpf.substring(0, 10);
9361
+ sum = 0;
9362
+ for (i = 11; i > 1; i--) {
9363
+ sum += numbers.charAt(11 - i) * i;
9364
+ }
9365
+ result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9366
+ if (result !== Number(digits.charAt(1))) {
9367
+ return { cpfNotValid: true };
9368
+ }
9369
+ return null;
9370
+ }
9371
+ else {
9372
+ return { cpfNotValid: true };
9373
+ }
9417
9374
  }
9375
+ return null;
9418
9376
  };
9419
- HistoricalPixAccountComponent.prototype.add = function () {
9420
- this.pixAccountItemInput = {};
9421
- this.visible = true;
9422
- };
9423
- HistoricalPixAccountComponent.prototype.isNotAllowMessage = function () {
9424
- this.messageService.add({
9425
- severity: "error",
9426
- summary: this.translateService.instant("hcm.payroll.error"),
9427
- detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
9428
- });
9429
- };
9430
- HistoricalPixAccountComponent.prototype.deleteAnnuityItem = function (index) {
9431
- var newlist = __spread(this.getHistoricalPixAccountList());
9432
- newlist.sort(compareValues(this.orderBy.field, this.orderBy.direction));
9433
- delete newlist[index];
9434
- newlist = newlist.filter(function (val) { return val; });
9435
- this.historicalPixAccountList.get("historicalPixAccountList").setValue(newlist);
9436
- this.verifyTotalPercentage();
9437
- this.onLazyLoad();
9438
- };
9439
- HistoricalPixAccountComponent.prototype.getHistoricalPixAccountList = function () {
9440
- if (this.historicalPixAccountList.get("historicalPixAccountList") &&
9441
- this.historicalPixAccountList.get("historicalPixAccountList").value &&
9442
- this.historicalPixAccountList.get("historicalPixAccountList").value.length)
9443
- return this.historicalPixAccountList.get("historicalPixAccountList") && this.historicalPixAccountList.get("historicalPixAccountList").value;
9444
- else
9445
- return [];
9446
- };
9447
- HistoricalPixAccountComponent.prototype.addItemInList = function ($event) {
9448
- var index = $event && $event.index >= 0 ? $event.index : null;
9449
- var newDataList = this.getHistoricalPixAccountList() ? this.getHistoricalPixAccountList() : [];
9450
- if (index != null) {
9451
- newDataList[index] = $event;
9452
- delete $event.index;
9453
- }
9454
- else {
9455
- if (isValid($event["customFields"]) && Object.keys($event["customFields"]).length) {
9456
- var customValue = mountCustomToSave($event["customFields"]);
9457
- $event["customFields"] = __spread(customValue);
9377
+ /**
9378
+ * Valida se o CNPJ é valido. Deve-se ser informado o cpf sem máscara.
9379
+ */
9380
+ GenericValidator.isValidCnpj = function (control) {
9381
+ var cnpj = control.value;
9382
+ if (cnpj) {
9383
+ var size = void 0, numbers = void 0, digits = void 0, sum = void 0, pos = void 0, result = void 0;
9384
+ cnpj = cnpj.replace(/[^\d]+/g, '');
9385
+ if (cnpj.length !== 14) {
9386
+ return null;
9458
9387
  }
9459
- $event["dateChange"] = this.dateChange;
9460
- newDataList.push($event);
9388
+ // Elimina CNPJs invalidos conhecidos
9389
+ if (cnpj === '00000000000000' ||
9390
+ cnpj === '11111111111111' ||
9391
+ cnpj === '22222222222222' ||
9392
+ cnpj === '33333333333333' ||
9393
+ cnpj === '44444444444444' ||
9394
+ cnpj === '55555555555555' ||
9395
+ cnpj === '66666666666666' ||
9396
+ cnpj === '77777777777777' ||
9397
+ cnpj === '88888888888888' ||
9398
+ cnpj === '99999999999999') {
9399
+ return { cnpjNotValid: true };
9400
+ }
9401
+ // Valida DVs
9402
+ size = cnpj.length - 2;
9403
+ numbers = cnpj.substring(0, size);
9404
+ digits = cnpj.substring(size);
9405
+ sum = 0;
9406
+ pos = size - 7;
9407
+ for (var i = size; i >= 1; i--) {
9408
+ sum += numbers.charAt(size - i) * pos--;
9409
+ if (pos < 2) {
9410
+ pos = 9;
9411
+ }
9412
+ }
9413
+ result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9414
+ if (result !== Number(digits.charAt(0))) {
9415
+ return { cnpjNotValid: true };
9416
+ }
9417
+ size = size + 1;
9418
+ numbers = cnpj.substring(0, size);
9419
+ sum = 0;
9420
+ pos = size - 7;
9421
+ for (var i = size; i >= 1; i--) {
9422
+ sum += numbers.charAt(size - i) * pos--;
9423
+ if (pos < 2) {
9424
+ pos = 9;
9425
+ }
9426
+ }
9427
+ result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9428
+ if (result !== Number(digits.charAt(1))) {
9429
+ return { cnpjNotValid: true };
9430
+ }
9431
+ return null;
9461
9432
  }
9462
- this.historicalPixAccountList.get("historicalPixAccountList").setValue(newDataList);
9463
- this.verifyTotalPercentage();
9464
- this.onLazyLoad({ first: this.getNumberPageByIndex(index, newDataList) });
9433
+ return null;
9465
9434
  };
9466
- HistoricalPixAccountComponent.prototype.getNumberPageByIndex = function (index, list) {
9467
- if (index) {
9468
- var total = list.length;
9469
- var sub = this.recordByRow - 1;
9470
- return Math.ceil(total / this.recordByRow) * this.recordByRow - sub - 1;
9435
+ /**
9436
+ * Válida o número de telefone da chave PIX.
9437
+ */
9438
+ GenericValidator.isValidPhoneNumber = function (control) {
9439
+ var cellPhoneKey = control.value || '';
9440
+ cellPhoneKey = cellPhoneKey.replace(/[\s()-]/g, '');
9441
+ var regexNumberTelephone = /^[1-9][\d]{1,2}\d{8,10}$/;
9442
+ var isValidNumberTelephone = regexNumberTelephone.test(cellPhoneKey);
9443
+ return isValidNumberTelephone ? null : { invalidPhoneNumber: true };
9444
+ };
9445
+ /**
9446
+ * Valida o email da chave PIX.
9447
+ */
9448
+ GenericValidator.isValidEmail = function (control) {
9449
+ var emailKey = control.value;
9450
+ var regexValidEmail = /^[\w-\.]+@[\w-]+(\.[\w-]{2,4}){1,2}$/;
9451
+ var isValidEmail = regexValidEmail.test(emailKey);
9452
+ return isValidEmail ? null : { invalidEmail: true };
9453
+ };
9454
+ return GenericValidator;
9455
+ }());
9456
+
9457
+ var HistoricakPixAccountBase = /** @class */ (function () {
9458
+ function HistoricakPixAccountBase(formBuilder) {
9459
+ this._paramsForm = new FormGroup({});
9460
+ this._defaultCpfNumber = null;
9461
+ this.initialValidatorOfPercentage = [Validators.required, Validators.min(0.01)];
9462
+ this.pixAccountList = [];
9463
+ this.maxValuePercentage = 100.00;
9464
+ this.isShowPixKeyFieldValidatorMessage = false;
9465
+ this.formBuilder = formBuilder;
9466
+ this.createFormGroupBase();
9467
+ }
9468
+ HistoricakPixAccountBase.prototype.phoneMask = function (event) {
9469
+ console.log("phoneMaskEvent", event);
9470
+ FormatUtilsService.formatTelephoneInputEvent(event);
9471
+ };
9472
+ HistoricakPixAccountBase.prototype.onChangePixKeyType = function (item) {
9473
+ console.log("onChangePixKeyType", item);
9474
+ if (item.key) {
9475
+ this.pixKeyType = item.key;
9476
+ this.isShowPixKeyFieldValidatorMessage = true;
9477
+ this.pixAccountFormGroup.get("pixKey").reset();
9478
+ this.setPixKeyValidators(true);
9479
+ if (item.key === "CPF") {
9480
+ this.setDefaultCpfPixKey();
9481
+ }
9471
9482
  }
9472
- return null;
9473
9483
  };
9474
- HistoricalPixAccountComponent.prototype.verifyTotalPercentage = function () {
9475
- var list = this.getHistoricalPixAccountList() ? this.getHistoricalPixAccountList() : [];
9476
- var arrayPercentage = [];
9477
- if (!list.length)
9478
- return this.msgTotalLimitByPercentage = null;
9479
- list.filter(function (item) { return arrayPercentage.push(item && item["percentage"]); });
9480
- var sumPercentage = arrayPercentage.reduce(function (total, percentage) {
9481
- return total + percentage;
9482
- }, 0);
9483
- if (sumPercentage === 100) {
9484
- this.msgTotalLimitByPercentage = this.translateService.instant("hcm.payroll.historical_pix_account_msg_limit_total_by_percentage");
9484
+ HistoricakPixAccountBase.prototype.onClearPixKeyType = function () {
9485
+ this.isShowPixKeyFieldValidatorMessage = false;
9486
+ this.pixAccountFormGroup.get("pixKey").reset();
9487
+ };
9488
+ HistoricakPixAccountBase.prototype.setDefaultCpfPixKey = function () {
9489
+ if (this._defaultCpfNumber) {
9490
+ this.pixAccountFormGroup.get("pixKey").setValue(this._defaultCpfNumber);
9485
9491
  }
9486
9492
  else {
9487
- this.msgTotalLimitByPercentage = null;
9493
+ var sheetDocument = this._paramsForm.get("sheetDocument");
9494
+ if (sheetDocument) {
9495
+ var cpf = sheetDocument.get("cpfNumber").value;
9496
+ if (cpf) {
9497
+ this.pixAccountFormGroup.get("pixKey").setValue(cpf);
9498
+ }
9499
+ }
9488
9500
  }
9489
9501
  };
9490
- Object.defineProperty(HistoricalPixAccountComponent.prototype, "scopedActions", {
9491
- get: function () {
9492
- return this.actions.bind(this);
9493
- },
9494
- enumerable: true,
9495
- configurable: true
9496
- });
9497
- Object.defineProperty(HistoricalPixAccountComponent.prototype, "recordsMessage", {
9498
- get: function () {
9499
- return (this.totalRecords || 0) + " " + (this.totalRecords === 1 ? this.translateService.instant("hcm.payroll.admission_register") : this.translateService.instant("hcm.payroll.admission_registers"));
9500
- },
9501
- enumerable: true,
9502
- configurable: true
9503
- });
9504
- Object.defineProperty(HistoricalPixAccountComponent.prototype, "getTooltipAndDisableButtonAdd", {
9505
- get: function () {
9506
- return this.dateChange ? null : this.msgTooltipAdd;
9507
- },
9508
- enumerable: true,
9509
- configurable: true
9510
- });
9511
- Object.defineProperty(HistoricalPixAccountComponent.prototype, "dateChange", {
9512
- get: function () {
9513
- return this._dateChange;
9514
- },
9515
- set: function (value) {
9516
- var _this = this;
9517
- this._dateChange = value;
9518
- if (this._dateChange) {
9519
- this.listData.filter(function (row) { return row["dateChange"] = _this._dateChange; });
9502
+ HistoricakPixAccountBase.prototype.createFormGroupBase = function () {
9503
+ this.pixAccountFormGroup = this.formBuilder.group({
9504
+ id: this.formBuilder.control(null),
9505
+ index: this.formBuilder.control(null),
9506
+ employee: this.formBuilder.control({ value: { tableId: null }, disabled: true }),
9507
+ dateChange: this.formBuilder.control(null),
9508
+ pixKeyType: this.formBuilder.control(null, Validators.required),
9509
+ pixKey: this.formBuilder.control(null),
9510
+ percentage: this.formBuilder.control(null, Validators.compose(__spread(this.initialValidatorOfPercentage, [
9511
+ Validators.max(this.maxValuePercentage),
9512
+ ]))),
9513
+ externalId: this.formBuilder.control(null),
9514
+ customFields: this.formBuilder.control(null),
9515
+ });
9516
+ };
9517
+ HistoricakPixAccountBase.prototype.setValidatorsAccordingList = function (pixAccountList, index, isEditMode) {
9518
+ if (index === void 0) { index = null; }
9519
+ if (isEditMode === void 0) { isEditMode = true; }
9520
+ console.log("setValidatorsAccordingList", pixAccountList, index, isEditMode);
9521
+ this.pixAccountList = pixAccountList && pixAccountList.length ? __spread(pixAccountList) : [];
9522
+ var percentageIncluded = [];
9523
+ this.pixAccountList.forEach(function (field, key) {
9524
+ if (field["percentage"] && key !== index) {
9525
+ percentageIncluded.push(field["percentage"]);
9520
9526
  }
9521
- },
9522
- enumerable: true,
9523
- configurable: true
9524
- });
9525
- Object.defineProperty(HistoricalPixAccountComponent.prototype, "displayDateChange", {
9527
+ });
9528
+ this.beforeSetPixKeyTypeValidator();
9529
+ this.setPixKeyValidators(isEditMode);
9530
+ this.validatePercentageValid(percentageIncluded);
9531
+ };
9532
+ HistoricakPixAccountBase.prototype.beforeSetPixKeyTypeValidator = function () {
9533
+ var pixKeyType = this.pixAccountFormGroup.get("pixKeyType");
9534
+ console.log("beforeSetPixKeyTypeValidator", this.pixAccountList, pixKeyType);
9535
+ if (this.pixAccountList && this.pixAccountList.length && pixKeyType) {
9536
+ pixKeyType.setValidators(Validators.compose([
9537
+ Validators.required,
9538
+ this.validateDuplicatePixKeyTypeBankAccount(this.pixAccountList),
9539
+ ]));
9540
+ }
9541
+ else {
9542
+ pixKeyType.setValidators(Validators.required);
9543
+ }
9544
+ };
9545
+ HistoricakPixAccountBase.prototype.setPixKeyValidators = function (isEditMode) {
9546
+ var pixKey = this.pixAccountFormGroup.get("pixKey");
9547
+ console.log("setPixKeyValidators", this.pixKeyType, isEditMode);
9548
+ if (this.pixKeyType) {
9549
+ switch (this.pixKeyType) {
9550
+ case "TELEPHONE":
9551
+ pixKey.setValidators(Validators.compose([Validators.required, GenericValidator.isValidPhoneNumber]));
9552
+ break;
9553
+ case "EMAIL":
9554
+ pixKey.setValidators(Validators.compose([Validators.required, GenericValidator.isValidEmail]));
9555
+ break;
9556
+ case "CPF":
9557
+ pixKey.setValidators(Validators.compose([Validators.required, GenericValidator.isValidCpf]));
9558
+ break;
9559
+ case "CNPJ":
9560
+ pixKey.setValidators(Validators.compose([Validators.required, GenericValidator.isValidCnpj]));
9561
+ break;
9562
+ case "RANDOM_KEY":
9563
+ pixKey.setValidators(Validators.required);
9564
+ break;
9565
+ default:
9566
+ pixKey.setValidators(null);
9567
+ }
9568
+ if (isEditMode) {
9569
+ pixKey.enable();
9570
+ }
9571
+ pixKey.updateValueAndValidity();
9572
+ }
9573
+ };
9574
+ HistoricakPixAccountBase.prototype.validatePercentageValid = function (listValue) {
9575
+ var percentage = this.pixAccountFormGroup.get("percentage");
9576
+ this.maxValuePercentage = listValue.reduce(function (acc, val) { return acc - val; }, 100.00);
9577
+ console.log("validatePercentageValid", this.maxValuePercentage);
9578
+ percentage.setValidators(Validators.compose(__spread(this.initialValidatorOfPercentage, [
9579
+ Validators.max(this.maxValuePercentage),
9580
+ ])));
9581
+ percentage.updateValueAndValidity();
9582
+ };
9583
+ HistoricakPixAccountBase.prototype.validateDuplicatePixKeyTypeBankAccount = function (listCompare) {
9584
+ return function (control) {
9585
+ var value = control && control.value;
9586
+ var isDuplicate = listCompare.some(function (field) {
9587
+ return value && field["pixKeyType"].key === 'BANK_ACCOUNT' && value.key === 'BANK_ACCOUNT';
9588
+ });
9589
+ return isDuplicate ? { pixKeyTypeBankAccountDuplicate: true } : null;
9590
+ };
9591
+ };
9592
+ Object.defineProperty(HistoricakPixAccountBase.prototype, "paramsForm", {
9526
9593
  get: function () {
9527
- return this._displayDateChange;
9594
+ return this._paramsForm;
9528
9595
  },
9529
9596
  set: function (value) {
9530
- var _this = this;
9531
- this._displayDateChange = value;
9532
- if (this._displayDateChange) {
9533
- this.listData.filter(function (row) { return row["displayDateChange"] = _this._displayDateChange; });
9534
- }
9535
- },
9536
- enumerable: true,
9537
- configurable: true
9538
- });
9539
- Object.defineProperty(HistoricalPixAccountComponent.prototype, "addListData", {
9540
- set: function (list) {
9541
- this.loading = true;
9542
- this.historicalPixAccountList.get("historicalPixAccountList").patchValue(list);
9543
- this.verifyTotalPercentage();
9544
- this.onLazyLoad();
9597
+ this._paramsForm = value;
9545
9598
  },
9546
9599
  enumerable: true,
9547
9600
  configurable: true
9548
9601
  });
9549
- Object.defineProperty(HistoricalPixAccountComponent.prototype, "visible", {
9602
+ Object.defineProperty(HistoricakPixAccountBase.prototype, "defaultCpfNumber", {
9550
9603
  get: function () {
9551
- return this._visible;
9604
+ return this._defaultCpfNumber;
9552
9605
  },
9553
9606
  set: function (value) {
9554
- this._visible = value;
9555
- this.visibleChange.emit(this.visible);
9607
+ this._defaultCpfNumber = value;
9556
9608
  },
9557
9609
  enumerable: true,
9558
9610
  configurable: true
9559
9611
  });
9560
- HistoricalPixAccountComponent.prototype.close = function () {
9561
- this.visible = false;
9612
+ return HistoricakPixAccountBase;
9613
+ }());
9614
+
9615
+ var HistoricalPixAccountService = /** @class */ (function () {
9616
+ function HistoricalPixAccountService(http) {
9617
+ this.http = http;
9618
+ }
9619
+ HistoricalPixAccountService.prototype.query = function (path, body, service) {
9620
+ if (service === void 0) { service = ServiceType.PAYROLL; }
9621
+ return this.http.query(path, body, service);
9562
9622
  };
9563
- HistoricalPixAccountComponent.prototype.getFormattedTelephoneNumber = function (telephoneNumber) {
9564
- return FormatUtilsService.getFormattedTelephoneNumber(telephoneNumber);
9623
+ HistoricalPixAccountService.prototype.enumQuery = function () {
9624
+ var path = 'enumQuery';
9625
+ var body = {
9626
+ names: ['PixKeyType']
9627
+ };
9628
+ return this.http.query(path, body, ServiceType.PAYROLL);
9565
9629
  };
9566
- HistoricalPixAccountComponent.prototype.getFormattedCpf = function (cpf) {
9567
- return FormatUtilsService.getFormattedCpf(cpf);
9630
+ HistoricalPixAccountService.ctorParameters = function () { return [
9631
+ { type: HttpClientService }
9632
+ ]; };
9633
+ HistoricalPixAccountService = __decorate([
9634
+ Injectable()
9635
+ ], HistoricalPixAccountService);
9636
+ return HistoricalPixAccountService;
9637
+ }());
9638
+
9639
+ var HistoricalPixAccountComponent = /** @class */ (function (_super) {
9640
+ __extends(HistoricalPixAccountComponent, _super);
9641
+ function HistoricalPixAccountComponent(translateService, cd, formBuilder, messageService, sharedStateService, service) {
9642
+ var _this = _super.call(this, formBuilder) || this;
9643
+ _this.translateService = translateService;
9644
+ _this.cd = cd;
9645
+ _this.messageService = messageService;
9646
+ _this.sharedStateService = sharedStateService;
9647
+ _this.service = service;
9648
+ _this.recordByRow = 1;
9649
+ _this.showDateChange = false;
9650
+ _this.isEditMode = false;
9651
+ _this.isViewMode = false;
9652
+ _this.withSideBar = true;
9653
+ _this.listDataReciever = [];
9654
+ _this.addExistentHistoricData = [];
9655
+ _this.getListPixAccount = [];
9656
+ _this.isViewModeActive = new EventEmitter();
9657
+ _this.isEditModeActive = new EventEmitter();
9658
+ _this.isDeleteModeActive = new EventEmitter();
9659
+ _this.listFromApp = [];
9660
+ _this.visibleChange = new EventEmitter();
9661
+ _this.ngUnsubscribe = new Subject();
9662
+ _this.orderBy = {
9663
+ field: "dateChange",
9664
+ direction: DirectionEnumeration.DESC,
9665
+ };
9666
+ _this.pixAccountItemInput = {};
9667
+ _this.totalRecords = 0;
9668
+ _this.actionLabel = _this.translateService.instant("hcm.payroll.entries_query_actions_total_title");
9669
+ _this.loading = true;
9670
+ _this.listData = [];
9671
+ _this.listDataNoPage = [];
9672
+ _this.showButtonView = true;
9673
+ _this.showEditMode = false;
9674
+ _this.activeIndex = 0;
9675
+ _this.hasRecordsPix = true;
9676
+ _this.firstPix = 0;
9677
+ _this.maxValuePercentage = 100.00;
9678
+ _this.hideFields = _this.sharedStateService.hideField$;
9679
+ _this.suggestions = [];
9680
+ _this.cols = [
9681
+ {
9682
+ label: _this.translateService.instant("hcm.payroll.employees_addition_pix_key_type"),
9683
+ field: "pixKeyType",
9684
+ orderBy: 'pixKeyType.key',
9685
+ },
9686
+ {
9687
+ label: _this.translateService.instant("hcm.payroll.employees_addition_pix_key"),
9688
+ field: "pixKey",
9689
+ orderBy: 'pixKey',
9690
+ },
9691
+ {
9692
+ label: _this.translateService.instant("hcm.payroll.historical_pix_account_label_percentage"),
9693
+ field: "percentage",
9694
+ orderBy: 'percentage',
9695
+ },
9696
+ {
9697
+ label: _this.translateService.instant("hcm.payroll.movimentation_generic_action"),
9698
+ field: "actions",
9699
+ orderBy: null,
9700
+ }
9701
+ ];
9702
+ _this.actions = function (rowData, key) {
9703
+ if (rowData === void 0) { rowData = {}; }
9704
+ return [
9705
+ {
9706
+ visible: _this.isEditMode,
9707
+ label: _this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
9708
+ command: function () {
9709
+ if (_this.isAllowToViewHistorical) {
9710
+ rowData["index"] = key;
9711
+ _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: false };
9712
+ _this.visible = true;
9713
+ }
9714
+ else {
9715
+ _this.isViewModeActive.emit(true);
9716
+ }
9717
+ },
9718
+ },
9719
+ {
9720
+ visible: !!(!_this.isEditMode && _this.withSideBar),
9721
+ label: _this.translateService.instant("hcm.payroll.edit"),
9722
+ command: function () {
9723
+ if (_this.isAllowToEditHistorical) {
9724
+ rowData["index"] = key;
9725
+ _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true };
9726
+ _this.visible = true;
9727
+ }
9728
+ else {
9729
+ _this.isEditModeActive.emit(true);
9730
+ if (_this.listFromApp.length == 0) {
9731
+ rowData["index"] = key;
9732
+ _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true };
9733
+ _this.visible = true;
9734
+ }
9735
+ }
9736
+ },
9737
+ },
9738
+ {
9739
+ visible: !_this.isEditMode || _this.showEditMode,
9740
+ label: _this.translateService.instant("hcm.payroll.delete"),
9741
+ command: function () {
9742
+ if (_this.isAllowToDeleteHistorical) {
9743
+ _this.loading = true;
9744
+ _this.deleteAnnuityItem(key);
9745
+ }
9746
+ else {
9747
+ _this.isDeleteModeActive.emit(true);
9748
+ if (_this.listFromApp.length == 0) {
9749
+ _this.loading = true;
9750
+ _this.deleteAnnuityItem(key);
9751
+ }
9752
+ }
9753
+ },
9754
+ },
9755
+ ];
9756
+ };
9757
+ _this.createFormGroup();
9758
+ return _this;
9759
+ }
9760
+ HistoricalPixAccountComponent.prototype.ngOnInit = function () {
9761
+ var _this = this;
9762
+ this.formGroup.setControl(this.fieldFormGroup, this.historicalPixAccountList);
9763
+ this.sharedStateService.showButton$.subscribe(function (value) {
9764
+ _this.showButtonView = value;
9765
+ });
9766
+ this.sharedStateService.showEditMode$.subscribe(function (value) {
9767
+ _this.showEditMode = value;
9768
+ });
9568
9769
  };
9569
- HistoricalPixAccountComponent.prototype.getFormattedCnpj = function (cnpj) {
9570
- return FormatUtilsService.getFormattedCnpj(cnpj);
9770
+ HistoricalPixAccountComponent.prototype.ngOnChanges = function (changes) {
9771
+ if (changes['listDataReciever'] && changes['listDataReciever'].currentValue) {
9772
+ this.listFromApp = changes['listDataReciever'].currentValue;
9773
+ }
9774
+ if (changes['addExistentHistoricData'] && changes['addExistentHistoricData'].currentValue) {
9775
+ this.getHistoricalPixAccountList();
9776
+ }
9571
9777
  };
9572
- HistoricalPixAccountComponent.prototype.getFormattedPercentage = function (value) {
9573
- return FormatUtilsService.getFormattedPercentage(value);
9778
+ HistoricalPixAccountComponent.prototype.createFormGroup = function () {
9779
+ this.historicalPixAccountList = this.formBuilder.group({
9780
+ historicalPixAccountList: this.formBuilder.control(null),
9781
+ });
9574
9782
  };
9575
- Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToAddHistorical", {
9783
+ HistoricalPixAccountComponent.prototype.ngOnDestroy = function () {
9784
+ this.ngUnsubscribe.next();
9785
+ this.ngUnsubscribe.complete();
9786
+ };
9787
+ HistoricalPixAccountComponent.prototype.ngAfterViewInit = function () {
9788
+ this.cd.detectChanges();
9789
+ };
9790
+ HistoricalPixAccountComponent.prototype.filterPixKeyType = function (event) {
9791
+ var _this = this;
9792
+ var query = event.query;
9793
+ this.service.enumQuery().subscribe(function (response) {
9794
+ var pixKeyTypeEnum = response.results.find(function (result) { return result.enumName === 'PixKeyType'; });
9795
+ if (pixKeyTypeEnum) {
9796
+ _this.suggestions = pixKeyTypeEnum.items.filter(function (item) {
9797
+ return item.value.toLowerCase().includes(query.toLowerCase());
9798
+ });
9799
+ }
9800
+ else {
9801
+ _this.suggestions = [];
9802
+ }
9803
+ });
9804
+ };
9805
+ HistoricalPixAccountComponent.prototype.onLazyLoad = function (event) {
9806
+ var _this = this;
9807
+ var first = event && event.first ? event.first : 0;
9808
+ var rows = event && event.rows ? event.rows : this.recordByRow;
9809
+ var arrList = this.getHistoricalPixAccountList();
9810
+ this.listData = [];
9811
+ this.totalRecords = null;
9812
+ if (event && event.multiSortMeta && event.multiSortMeta.length) {
9813
+ event.multiSortMeta.map(function (value) {
9814
+ _this.orderBy.field = value.field;
9815
+ _this.orderBy.direction = value.order === 1 ? DirectionEnumeration.ASC : DirectionEnumeration.DESC;
9816
+ });
9817
+ }
9818
+ if (arrList && arrList.length) {
9819
+ this.totalRecords = arrList.length;
9820
+ this.listData = arrList;
9821
+ this.listDataNoPage = __spread(arrList);
9822
+ this.listData.sort(compareValues(this.orderBy.field, this.orderBy.direction));
9823
+ this.listData = this.listData.slice(first, (first + rows));
9824
+ }
9825
+ else {
9826
+ this.listDataNoPage = [];
9827
+ }
9828
+ if (this.isEditMode || arrList && arrList.length === 1) {
9829
+ this.refreshCssInIE11();
9830
+ }
9831
+ this.loading = false;
9832
+ };
9833
+ /**
9834
+ * Um Bug de CSS que acontece nas linhas da tabela, que resolve só atualizando qualquer parte do CSS da pagina.
9835
+ */
9836
+ HistoricalPixAccountComponent.prototype.refreshCssInIE11 = function () {
9837
+ if (/msie\s|trident\/|edge\//i.test(window.navigator.userAgent)) {
9838
+ setTimeout(function () {
9839
+ var row = document.getElementsByClassName("row0");
9840
+ if (row && row[0])
9841
+ row[0].className = 'refresh';
9842
+ }, 1);
9843
+ }
9844
+ };
9845
+ HistoricalPixAccountComponent.prototype.add = function () {
9846
+ this.pixAccountItemInput = {};
9847
+ this.visible = true;
9848
+ };
9849
+ HistoricalPixAccountComponent.prototype.addPix = function () {
9850
+ var newItem = {
9851
+ pixKeyType: {},
9852
+ pixKey: '',
9853
+ percentage: 0
9854
+ };
9855
+ this.addExistentHistoricData = __spread(this.addExistentHistoricData, [newItem]);
9856
+ };
9857
+ HistoricalPixAccountComponent.prototype.deletePix = function (index) {
9858
+ this.addExistentHistoricData = this.addExistentHistoricData.filter(function (_, i) { return i !== index; });
9859
+ };
9860
+ HistoricalPixAccountComponent.prototype.deleteAnnuityItem = function (index) {
9861
+ var newlist = __spread(this.getHistoricalPixAccountList());
9862
+ newlist.sort(compareValues(this.orderBy.field, this.orderBy.direction));
9863
+ delete newlist[index];
9864
+ newlist = newlist.filter(function (val) { return val; });
9865
+ this.historicalPixAccountList.get("historicalPixAccountList").setValue(newlist);
9866
+ this.verifyTotalPercentage();
9867
+ this.onLazyLoad();
9868
+ };
9869
+ HistoricalPixAccountComponent.prototype.getHistoricalPixAccountList = function () {
9870
+ if (this.historicalPixAccountList.get("historicalPixAccountList") &&
9871
+ this.historicalPixAccountList.get("historicalPixAccountList").value &&
9872
+ this.historicalPixAccountList.get("historicalPixAccountList").value.length)
9873
+ return this.historicalPixAccountList.get("historicalPixAccountList") && this.historicalPixAccountList.get("historicalPixAccountList").value;
9874
+ else
9875
+ return [];
9876
+ };
9877
+ HistoricalPixAccountComponent.prototype.addItemInList = function ($event) {
9878
+ var index = $event && $event.index >= 0 ? $event.index : null;
9879
+ var newDataList = this.getHistoricalPixAccountList() ? this.getHistoricalPixAccountList() : [];
9880
+ if (index != null) {
9881
+ newDataList[index] = $event;
9882
+ delete $event.index;
9883
+ }
9884
+ else {
9885
+ if (isValid($event["customFields"]) && Object.keys($event["customFields"]).length) {
9886
+ var customValue = mountCustomToSave($event["customFields"]);
9887
+ $event["customFields"] = __spread(customValue);
9888
+ }
9889
+ $event["dateChange"] = this.dateChange;
9890
+ newDataList.push($event);
9891
+ }
9892
+ this.historicalPixAccountList.get("historicalPixAccountList").setValue(newDataList);
9893
+ this.verifyTotalPercentage();
9894
+ this.onLazyLoad({ first: this.getNumberPageByIndex(index, newDataList) });
9895
+ };
9896
+ HistoricalPixAccountComponent.prototype.getNumberPageByIndex = function (index, list) {
9897
+ if (index) {
9898
+ var total = list.length;
9899
+ var sub = this.recordByRow - 1;
9900
+ return Math.ceil(total / this.recordByRow) * this.recordByRow - sub - 1;
9901
+ }
9902
+ return null;
9903
+ };
9904
+ HistoricalPixAccountComponent.prototype.verifyTotalPercentage = function () {
9905
+ var list = this.getHistoricalPixAccountList() ? this.getHistoricalPixAccountList() : [];
9906
+ var arrayPercentage = [];
9907
+ if (!list.length)
9908
+ return this.msgTotalLimitByPercentage = null;
9909
+ list.filter(function (item) { return arrayPercentage.push(item && item["percentage"]); });
9910
+ var sumPercentage = arrayPercentage.reduce(function (total, percentage) {
9911
+ return total + percentage;
9912
+ }, 0);
9913
+ if (sumPercentage === 100) {
9914
+ this.msgTotalLimitByPercentage = this.translateService.instant("hcm.payroll.historical_pix_account_msg_limit_total_by_percentage");
9915
+ }
9916
+ else {
9917
+ this.msgTotalLimitByPercentage = null;
9918
+ }
9919
+ };
9920
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "scopedActions", {
9576
9921
  get: function () {
9577
- return (this.permission["incluir"]);
9922
+ return this.actions.bind(this);
9578
9923
  },
9579
9924
  enumerable: true,
9580
9925
  configurable: true
9581
9926
  });
9582
- Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToDeleteHistorical", {
9927
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "recordsMessage", {
9583
9928
  get: function () {
9584
- return (this.permission["excluir"]);
9929
+ return (this.totalRecords || 0) + " " + (this.totalRecords === 1 ? this.translateService.instant("hcm.payroll.admission_register") : this.translateService.instant("hcm.payroll.admission_registers"));
9585
9930
  },
9586
9931
  enumerable: true,
9587
9932
  configurable: true
9588
9933
  });
9589
- Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToEditHistorical", {
9934
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "getTooltipAndDisableButtonAdd", {
9590
9935
  get: function () {
9591
- return (this.permission["editar"]);
9936
+ return this.dateChange ? null : this.msgTooltipAdd;
9592
9937
  },
9593
9938
  enumerable: true,
9594
9939
  configurable: true
9595
9940
  });
9596
- Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToViewHistorical", {
9941
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "dateChange", {
9597
9942
  get: function () {
9598
- return (this.permission["visualizar"]);
9943
+ return this._dateChange;
9944
+ },
9945
+ set: function (value) {
9946
+ var _this = this;
9947
+ this._dateChange = value;
9948
+ if (this._dateChange) {
9949
+ this.listData.filter(function (row) { return row["dateChange"] = _this._dateChange; });
9950
+ }
9599
9951
  },
9600
9952
  enumerable: true,
9601
9953
  configurable: true
9602
9954
  });
9603
- HistoricalPixAccountComponent.ctorParameters = function () { return [
9604
- { type: TranslateService },
9605
- { type: ChangeDetectorRef },
9606
- { type: FormBuilder },
9607
- { type: MessageService }
9608
- ]; };
9609
- __decorate([
9610
- ViewChild(CustomFieldsComponent$1, { static: false })
9611
- ], HistoricalPixAccountComponent.prototype, "customFields", void 0);
9612
- __decorate([
9613
- Input()
9614
- ], HistoricalPixAccountComponent.prototype, "formGroup", void 0);
9615
- __decorate([
9616
- Input()
9617
- ], HistoricalPixAccountComponent.prototype, "fieldFormGroup", void 0);
9618
- __decorate([
9619
- Input()
9620
- ], HistoricalPixAccountComponent.prototype, "_dateChange", void 0);
9621
- __decorate([
9622
- Input()
9623
- ], HistoricalPixAccountComponent.prototype, "_displayDateChange", void 0);
9624
- __decorate([
9625
- Input()
9626
- ], HistoricalPixAccountComponent.prototype, "recordByRow", void 0);
9627
- __decorate([
9628
- Input()
9629
- ], HistoricalPixAccountComponent.prototype, "showDateChange", void 0);
9630
- __decorate([
9631
- Input()
9632
- ], HistoricalPixAccountComponent.prototype, "msgTooltipAdd", void 0);
9633
- __decorate([
9634
- Input()
9635
- ], HistoricalPixAccountComponent.prototype, "isEditMode", void 0);
9636
- __decorate([
9637
- Input()
9638
- ], HistoricalPixAccountComponent.prototype, "isViewMode", void 0);
9639
- __decorate([
9640
- Input()
9641
- ], HistoricalPixAccountComponent.prototype, "currency", void 0);
9642
- __decorate([
9643
- Input()
9644
- ], HistoricalPixAccountComponent.prototype, "customEntity", void 0);
9645
- __decorate([
9646
- Input()
9647
- ], HistoricalPixAccountComponent.prototype, "customService", void 0);
9648
- __decorate([
9649
- Input()
9650
- ], HistoricalPixAccountComponent.prototype, "withSideBar", void 0);
9651
- __decorate([
9652
- Input()
9653
- ], HistoricalPixAccountComponent.prototype, "paramsForm", void 0);
9654
- __decorate([
9655
- Input()
9656
- ], HistoricalPixAccountComponent.prototype, "defaultCpfNumber", void 0);
9657
- __decorate([
9658
- Input()
9659
- ], HistoricalPixAccountComponent.prototype, "permission", void 0);
9660
- __decorate([
9661
- Input()
9662
- ], HistoricalPixAccountComponent.prototype, "listDataReciever", void 0);
9663
- __decorate([
9664
- Output()
9665
- ], HistoricalPixAccountComponent.prototype, "isViewModeActive", void 0);
9666
- __decorate([
9667
- Output()
9668
- ], HistoricalPixAccountComponent.prototype, "isEditModeActive", void 0);
9669
- __decorate([
9670
- Output()
9671
- ], HistoricalPixAccountComponent.prototype, "isDeleteModeActive", void 0);
9672
- __decorate([
9673
- Input()
9674
- ], HistoricalPixAccountComponent.prototype, "dateChange", null);
9675
- __decorate([
9676
- Input()
9677
- ], HistoricalPixAccountComponent.prototype, "displayDateChange", null);
9678
- __decorate([
9679
- Input()
9680
- ], HistoricalPixAccountComponent.prototype, "addListData", null);
9681
- __decorate([
9682
- Input()
9683
- ], HistoricalPixAccountComponent.prototype, "visible", null);
9684
- HistoricalPixAccountComponent = __decorate([
9685
- Component({
9686
- // tslint:disable-next-line:component-selector
9687
- selector: "c-historical-pix-account",
9688
- 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 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 [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 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\">\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",
9689
- 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}"]
9690
- })
9691
- ], HistoricalPixAccountComponent);
9692
- return HistoricalPixAccountComponent;
9693
- }());
9694
-
9695
- var GenericValidator = /** @class */ (function () {
9696
- function GenericValidator() {
9697
- }
9698
- /**
9699
- * Valida o CEI (Cadastro específico de INSS) digitado.
9700
- */
9701
- GenericValidator.isValidCei = function (control) {
9702
- var cei = control.value;
9703
- if (!cei)
9704
- return null;
9705
- else if (cei.length != 11)
9706
- return null;
9707
- var multiplicadorBase = "3298765432";
9708
- var total = 0;
9709
- var resto = 0;
9710
- var multiplicando = 0;
9711
- var multiplicador = 0;
9712
- if (cei.length !== 11 ||
9713
- cei === "00000000000" ||
9714
- cei === "11111111111" ||
9715
- cei === "22222222222" ||
9716
- cei === "33333333333" ||
9717
- cei === "44444444444" ||
9718
- cei === "55555555555" ||
9719
- cei === "66666666666" ||
9720
- cei === "77777777777" ||
9721
- cei === "88888888888" ||
9722
- cei === "99999999999")
9723
- return { invalidCei: true };
9724
- else {
9725
- for (var i = 0; i < 10; i++) {
9726
- multiplicando = parseInt(cei.substring(i, i + 1), 10);
9727
- multiplicador = parseInt(multiplicadorBase.substring(i, i + 1), 10);
9728
- total += multiplicando * multiplicador;
9729
- }
9730
- resto = 11 - (total % 11);
9731
- resto = resto === 10 || resto === 11 ? 0 : resto;
9732
- var digito = parseInt("" + cei.charAt(10), 10);
9733
- return resto === digito ? null : { invalidCei: true };
9734
- }
9735
- };
9736
- /**
9737
- * Valida se o CPF é valido. Deve-se ser informado o cpf sem máscara.
9738
- */
9739
- GenericValidator.isValidCpf = function (control) {
9740
- var cpf = control.value;
9741
- if (cpf) {
9742
- var numbers = void 0, digits = void 0, sum = void 0, i = void 0, result = void 0, equalDigits = void 0;
9743
- equalDigits = 1;
9744
- if (cpf.length < 11) {
9745
- return null;
9746
- }
9747
- for (i = 0; i < cpf.length - 1; i++) {
9748
- if (cpf.charAt(i) !== cpf.charAt(i + 1)) {
9749
- equalDigits = 0;
9750
- break;
9751
- }
9752
- }
9753
- if (!equalDigits) {
9754
- numbers = cpf.substring(0, 9);
9755
- digits = cpf.substring(9);
9756
- sum = 0;
9757
- for (i = 10; i > 1; i--) {
9758
- sum += numbers.charAt(10 - i) * i;
9759
- }
9760
- result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9761
- if (result !== Number(digits.charAt(0))) {
9762
- return { cpfNotValid: true };
9763
- }
9764
- numbers = cpf.substring(0, 10);
9765
- sum = 0;
9766
- for (i = 11; i > 1; i--) {
9767
- sum += numbers.charAt(11 - i) * i;
9768
- }
9769
- result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9770
- if (result !== Number(digits.charAt(1))) {
9771
- return { cpfNotValid: true };
9772
- }
9773
- return null;
9774
- }
9775
- else {
9776
- return { cpfNotValid: true };
9955
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "displayDateChange", {
9956
+ get: function () {
9957
+ return this._displayDateChange;
9958
+ },
9959
+ set: function (value) {
9960
+ var _this = this;
9961
+ this._displayDateChange = value;
9962
+ if (this._displayDateChange) {
9963
+ this.listData.filter(function (row) { return row["displayDateChange"] = _this._displayDateChange; });
9777
9964
  }
9778
- }
9779
- return null;
9965
+ },
9966
+ enumerable: true,
9967
+ configurable: true
9968
+ });
9969
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "addListData", {
9970
+ set: function (list) {
9971
+ this.loading = true;
9972
+ this.historicalPixAccountList.get("historicalPixAccountList").patchValue(list);
9973
+ this.verifyTotalPercentage();
9974
+ this.onLazyLoad();
9975
+ },
9976
+ enumerable: true,
9977
+ configurable: true
9978
+ });
9979
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "visible", {
9980
+ get: function () {
9981
+ return this._visible;
9982
+ },
9983
+ set: function (value) {
9984
+ this._visible = value;
9985
+ this.visibleChange.emit(this.visible);
9986
+ },
9987
+ enumerable: true,
9988
+ configurable: true
9989
+ });
9990
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "paramsForm", {
9991
+ set: function (value) {
9992
+ this._paramsForm = value;
9993
+ },
9994
+ enumerable: true,
9995
+ configurable: true
9996
+ });
9997
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "defaultCpfNumber", {
9998
+ set: function (value) {
9999
+ this._defaultCpfNumber = value;
10000
+ },
10001
+ enumerable: true,
10002
+ configurable: true
10003
+ });
10004
+ HistoricalPixAccountComponent.prototype.close = function () {
10005
+ this.visible = false;
9780
10006
  };
9781
- /**
9782
- * Valida se o CNPJ é valido. Deve-se ser informado o cpf sem máscara.
9783
- */
9784
- GenericValidator.isValidCnpj = function (control) {
9785
- var cnpj = control.value;
9786
- if (cnpj) {
9787
- var size = void 0, numbers = void 0, digits = void 0, sum = void 0, pos = void 0, result = void 0;
9788
- cnpj = cnpj.replace(/[^\d]+/g, '');
9789
- if (cnpj.length !== 14) {
9790
- return null;
9791
- }
9792
- // Elimina CNPJs invalidos conhecidos
9793
- if (cnpj === '00000000000000' ||
9794
- cnpj === '11111111111111' ||
9795
- cnpj === '22222222222222' ||
9796
- cnpj === '33333333333333' ||
9797
- cnpj === '44444444444444' ||
9798
- cnpj === '55555555555555' ||
9799
- cnpj === '66666666666666' ||
9800
- cnpj === '77777777777777' ||
9801
- cnpj === '88888888888888' ||
9802
- cnpj === '99999999999999') {
9803
- return { cnpjNotValid: true };
9804
- }
9805
- // Valida DVs
9806
- size = cnpj.length - 2;
9807
- numbers = cnpj.substring(0, size);
9808
- digits = cnpj.substring(size);
9809
- sum = 0;
9810
- pos = size - 7;
9811
- for (var i = size; i >= 1; i--) {
9812
- sum += numbers.charAt(size - i) * pos--;
9813
- if (pos < 2) {
9814
- pos = 9;
9815
- }
9816
- }
9817
- result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9818
- if (result !== Number(digits.charAt(0))) {
9819
- return { cnpjNotValid: true };
9820
- }
9821
- size = size + 1;
9822
- numbers = cnpj.substring(0, size);
9823
- sum = 0;
9824
- pos = size - 7;
9825
- for (var i = size; i >= 1; i--) {
9826
- sum += numbers.charAt(size - i) * pos--;
9827
- if (pos < 2) {
9828
- pos = 9;
9829
- }
9830
- }
9831
- result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9832
- if (result !== Number(digits.charAt(1))) {
9833
- return { cnpjNotValid: true };
9834
- }
9835
- return null;
9836
- }
9837
- return null;
10007
+ HistoricalPixAccountComponent.prototype.getFormattedTelephoneNumber = function (telephoneNumber) {
10008
+ return FormatUtilsService.getFormattedTelephoneNumber(telephoneNumber);
9838
10009
  };
9839
- /**
9840
- * Válida o número de telefone da chave PIX.
9841
- */
9842
- GenericValidator.isValidPhoneNumber = function (control) {
9843
- var cellPhoneKey = control.value || '';
9844
- cellPhoneKey = cellPhoneKey.replace(/[\s()-]/g, '');
9845
- var regexNumberTelephone = /^[1-9][\d]{1,2}\d{8,10}$/;
9846
- var isValidNumberTelephone = regexNumberTelephone.test(cellPhoneKey);
9847
- return isValidNumberTelephone ? null : { invalidPhoneNumber: true };
10010
+ HistoricalPixAccountComponent.prototype.getFormattedCpf = function (cpf) {
10011
+ return FormatUtilsService.getFormattedCpf(cpf);
9848
10012
  };
9849
- /**
9850
- * Valida o email da chave PIX.
9851
- */
9852
- GenericValidator.isValidEmail = function (control) {
9853
- var emailKey = control.value;
9854
- var regexValidEmail = /^[\w-\.]+@[\w-]+(\.[\w-]{2,4}){1,2}$/;
9855
- var isValidEmail = regexValidEmail.test(emailKey);
9856
- return isValidEmail ? null : { invalidEmail: true };
10013
+ HistoricalPixAccountComponent.prototype.getFormattedCnpj = function (cnpj) {
10014
+ return FormatUtilsService.getFormattedCnpj(cnpj);
9857
10015
  };
9858
- return GenericValidator;
9859
- }());
9860
-
9861
- var HistoricalPixAccountFormComponent = /** @class */ (function () {
9862
- function HistoricalPixAccountFormComponent(formBuilder, cd) {
9863
- this.formBuilder = formBuilder;
9864
- this.cd = cd;
9865
- this.withSideBar = true;
9866
- this.isEditMode = false;
9867
- this.paramsForm = new FormGroup({});
9868
- this.defaultCpfNumber = null;
9869
- this.visibleChange = new EventEmitter();
9870
- this.pixAccountItemToList = new EventEmitter();
9871
- this.ngUnsubscribe = new Subject();
9872
- this.initialValidatorOfPercentage = [Validators.required, Validators.min(0.01)];
9873
- this.labelBtnAdd = "hcm.payroll.employees_add";
9874
- this.maxValuePercentage = 100.00;
9875
- this.visibleBtnSave = true;
9876
- this.isView = false;
9877
- this.isShowPixKeyFieldValidatorMessage = false;
9878
- this.createFormGroup();
9879
- this.registerSubjects();
9880
- }
9881
- HistoricalPixAccountFormComponent.prototype.ngOnInit = function () {
10016
+ HistoricalPixAccountComponent.prototype.getFormattedPercentage = function (value) {
10017
+ return FormatUtilsService.getFormattedPercentage(value);
9882
10018
  };
10019
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToAddHistorical", {
10020
+ get: function () {
10021
+ return (this.permission["incluir"]);
10022
+ },
10023
+ enumerable: true,
10024
+ configurable: true
10025
+ });
10026
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToDeleteHistorical", {
10027
+ get: function () {
10028
+ return (this.permission["excluir"]);
10029
+ },
10030
+ enumerable: true,
10031
+ configurable: true
10032
+ });
10033
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToEditHistorical", {
10034
+ get: function () {
10035
+ return (this.permission["editar"]);
10036
+ },
10037
+ enumerable: true,
10038
+ configurable: true
10039
+ });
10040
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToViewHistorical", {
10041
+ get: function () {
10042
+ return (this.permission["visualizar"]);
10043
+ },
10044
+ enumerable: true,
10045
+ configurable: true
10046
+ });
10047
+ HistoricalPixAccountComponent.ctorParameters = function () { return [
10048
+ { type: TranslateService },
10049
+ { type: ChangeDetectorRef },
10050
+ { type: FormBuilder },
10051
+ { type: MessageService },
10052
+ { type: SharedStateService },
10053
+ { type: HistoricalPixAccountService }
10054
+ ]; };
10055
+ __decorate([
10056
+ ViewChild(CustomFieldsComponent$1, { static: false })
10057
+ ], HistoricalPixAccountComponent.prototype, "customFields", void 0);
10058
+ __decorate([
10059
+ Input()
10060
+ ], HistoricalPixAccountComponent.prototype, "formGroup", void 0);
10061
+ __decorate([
10062
+ Input()
10063
+ ], HistoricalPixAccountComponent.prototype, "fieldFormGroup", void 0);
10064
+ __decorate([
10065
+ Input()
10066
+ ], HistoricalPixAccountComponent.prototype, "_dateChange", void 0);
10067
+ __decorate([
10068
+ Input()
10069
+ ], HistoricalPixAccountComponent.prototype, "_displayDateChange", void 0);
10070
+ __decorate([
10071
+ Input()
10072
+ ], HistoricalPixAccountComponent.prototype, "recordByRow", void 0);
10073
+ __decorate([
10074
+ Input()
10075
+ ], HistoricalPixAccountComponent.prototype, "showDateChange", void 0);
10076
+ __decorate([
10077
+ Input()
10078
+ ], HistoricalPixAccountComponent.prototype, "msgTooltipAdd", void 0);
10079
+ __decorate([
10080
+ Input()
10081
+ ], HistoricalPixAccountComponent.prototype, "isEditMode", void 0);
10082
+ __decorate([
10083
+ Input()
10084
+ ], HistoricalPixAccountComponent.prototype, "isViewMode", void 0);
10085
+ __decorate([
10086
+ Input()
10087
+ ], HistoricalPixAccountComponent.prototype, "currency", void 0);
10088
+ __decorate([
10089
+ Input()
10090
+ ], HistoricalPixAccountComponent.prototype, "customEntity", void 0);
10091
+ __decorate([
10092
+ Input()
10093
+ ], HistoricalPixAccountComponent.prototype, "customService", void 0);
10094
+ __decorate([
10095
+ Input()
10096
+ ], HistoricalPixAccountComponent.prototype, "withSideBar", void 0);
10097
+ __decorate([
10098
+ Input()
10099
+ ], HistoricalPixAccountComponent.prototype, "permission", void 0);
10100
+ __decorate([
10101
+ Input()
10102
+ ], HistoricalPixAccountComponent.prototype, "listDataReciever", void 0);
10103
+ __decorate([
10104
+ Input()
10105
+ ], HistoricalPixAccountComponent.prototype, "addExistentHistoricData", void 0);
10106
+ __decorate([
10107
+ Input()
10108
+ ], HistoricalPixAccountComponent.prototype, "getListPixAccount", void 0);
10109
+ __decorate([
10110
+ Output()
10111
+ ], HistoricalPixAccountComponent.prototype, "isViewModeActive", void 0);
10112
+ __decorate([
10113
+ Output()
10114
+ ], HistoricalPixAccountComponent.prototype, "isEditModeActive", void 0);
10115
+ __decorate([
10116
+ Output()
10117
+ ], HistoricalPixAccountComponent.prototype, "isDeleteModeActive", void 0);
10118
+ __decorate([
10119
+ Input()
10120
+ ], HistoricalPixAccountComponent.prototype, "dateChange", null);
10121
+ __decorate([
10122
+ Input()
10123
+ ], HistoricalPixAccountComponent.prototype, "displayDateChange", null);
10124
+ __decorate([
10125
+ Input()
10126
+ ], HistoricalPixAccountComponent.prototype, "addListData", null);
10127
+ __decorate([
10128
+ Input()
10129
+ ], HistoricalPixAccountComponent.prototype, "visible", null);
10130
+ __decorate([
10131
+ Input()
10132
+ ], HistoricalPixAccountComponent.prototype, "paramsForm", null);
10133
+ __decorate([
10134
+ Input()
10135
+ ], HistoricalPixAccountComponent.prototype, "defaultCpfNumber", null);
10136
+ HistoricalPixAccountComponent = __decorate([
10137
+ Component({
10138
+ // tslint:disable-next-line:component-selector
10139
+ selector: "c-historical-pix-account",
10140
+ 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<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 id=\"btn-save\" label=\"Adicionar\" priority=\"primary\" (onClick)=\"addPix()\"></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\" [pSortableColumn]=\"col.orderBy\">\n {{ col.label }}\n <p-sortIcon *ngIf=\"col.orderBy\" [field]=\"col.orderBy\"></p-sortIcon>\n </th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-item let-rowIndex=\"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 [(ngModel)]=\"item.pixKeyType\"\n [formControl]=\"pixAccountFormGroup.get('pixKeyType')\"\n [dropdown]=\"true\"\n field=\"value\"\n placeholder=\"Selecione o tipo de chave\"\n appendTo=\"body\"\n [panelStyle]=\"{ maxWidth: '300px', width: '100%' }\"\n [inputStyle]=\"{ width: '100%' }\"\n >\n </p-autoComplete>\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 </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\" [pEditableColumn]=\"item.pixKey\" pEditableColumnField=\"pixKey\"\n [ngClass]=\"{'required': item.pixKeyType.key !== 'BANK_ACCOUNT'}\">\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <ng-container [ngSwitch]=\"item.pixKeyType.key\">\n <!-- TELEPHONE -->\n <input *ngSwitchCase=\"'TELEPHONE'\"\n only-number\n pInputText\n type=\"text\"\n [(ngModel)]=\"item.pixKey\"\n [formControl]=\"pixAccountFormGroup.get('pixKey')\"\n (keyup)=\"phoneMask($event)\"\n maxlength=\"15\"\n placeholder=\"(__) ____-____\"/>\n\n <!-- CPF -->\n <p-inputMask *ngSwitchCase=\"'CPF'\"\n [(ngModel)]=\"item.pixKey\"\n [formControl]=\"pixAccountFormGroup.get('pixKey')\"\n placeholder=\"___.___.___-__\"\n mask=\"999.999.999-99\"\n [unmask]=\"true\">\n </p-inputMask>\n\n <!-- CNPJ -->\n <p-inputMask *ngSwitchCase=\"'CNPJ'\"\n [(ngModel)]=\"item.pixKey\"\n [formControl]=\"pixAccountFormGroup.get('pixKey')\"\n placeholder=\"__.___.___/____-__\"\n mask=\"99.999.999/9999-99\"\n [unmask]=\"true\">\n </p-inputMask>\n\n <!-- EMAIL -->\n <input *ngSwitchCase=\"'EMAIL'\"\n pInputText\n type=\"email\"\n [(ngModel)]=\"item.pixKey\"\n [formControl]=\"pixAccountFormGroup.get('pixKey')\"\n placeholder=\"{{'hcm.payroll.employees_addition_email' | translate}}\"/>\n\n <!-- BANK_ACCOUNT -->\n <input *ngSwitchCase=\"'BANK_ACCOUNT'\"\n pInputText\n [(ngModel)]=\"item.pixKey\"\n [formControl]=\"pixAccountFormGroup.get('pixKey')\"\n [disabled]=\"true\"/>\n\n <!-- DEFAULT -->\n <input *ngSwitchDefault\n pInputText\n type=\"text\"\n [(ngModel)]=\"item.pixKey\"\n [formControl]=\"pixAccountFormGroup.get('pixKey')\"\n maxlength=\"100\"/>\n </ng-container>\n\n <!-- Error messages -->\n <s-control-errors *ngIf=\"isShowPixKeyFieldValidatorMessage\"\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 </ng-template>\n\n <ng-template pTemplate=\"output\">\n {{ item.pixKey }}\n </ng-template>\n </p-cellEditor>\n </td>\n\n\n <!-- Percentual -->\n <td class=\"ui-md-6 ui-sm-12 required\" [pEditableColumn]=\"item.percentage\" pEditableColumnField=\"percentage\">\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <input pInputText type=\"number\" [(ngModel)]=\"item.percentage\" [formControl]=\"pixAccountFormGroup.get('percentage')\">\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 </ng-template>\n <ng-template pTemplate=\"output\">\n {{ item.percentage }}%\n </ng-template>\n </p-cellEditor>\n </td>\n\n <!-- Bot\u00E3o de excluir -->\n <td>\n <s-button id=\"btn-delete\" label=\"Excluir\" priority=\"default\" (onClick)=\"deletePix(rowIndex)\"></s-button>\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n",
10141
+ 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}"]
10142
+ })
10143
+ ], HistoricalPixAccountComponent);
10144
+ return HistoricalPixAccountComponent;
10145
+ }(HistoricakPixAccountBase));
10146
+
10147
+ var HistoricalPixAccountFormComponent = /** @class */ (function (_super) {
10148
+ __extends(HistoricalPixAccountFormComponent, _super);
10149
+ function HistoricalPixAccountFormComponent(formBuilder, cd, sharedStateService) {
10150
+ var _this = _super.call(this, formBuilder) || this;
10151
+ _this.cd = cd;
10152
+ _this.sharedStateService = sharedStateService;
10153
+ _this.withSideBar = true;
10154
+ _this.isEditMode = false;
10155
+ _this.visibleChange = new EventEmitter();
10156
+ _this.pixAccountItemToList = new EventEmitter();
10157
+ _this.ngUnsubscribe = new Subject();
10158
+ _this.labelBtnAdd = "hcm.payroll.employees_add";
10159
+ _this.visibleBtnSave = true;
10160
+ _this.isView = false;
10161
+ _this.isShowPixKeyFieldValidatorMessage = false;
10162
+ _this.hideFields = _this.sharedStateService.hideField$;
10163
+ _this.registerSubjects();
10164
+ return _this;
10165
+ }
10166
+ HistoricalPixAccountFormComponent.prototype.ngOnInit = function () { };
9883
10167
  HistoricalPixAccountFormComponent.prototype.ngAfterViewInit = function () {
9884
10168
  this.cd.detectChanges();
9885
10169
  };
@@ -9887,38 +10171,7 @@ var HistoricalPixAccountFormComponent = /** @class */ (function () {
9887
10171
  this.ngUnsubscribe.next(true);
9888
10172
  this.ngUnsubscribe.unsubscribe();
9889
10173
  };
9890
- HistoricalPixAccountFormComponent.prototype.registerSubjects = function () {
9891
- };
9892
- HistoricalPixAccountFormComponent.prototype.createFormGroup = function () {
9893
- this.pixAccountFormGroup = this.formBuilder.group({
9894
- id: this.formBuilder.control(null),
9895
- index: this.formBuilder.control(null),
9896
- employee: this.formBuilder.control({ value: { tableId: null }, disabled: true }),
9897
- dateChange: this.formBuilder.control(null),
9898
- pixKeyType: this.formBuilder.control(null, Validators.required),
9899
- pixKey: this.formBuilder.control(null),
9900
- percentage: this.formBuilder.control(null, Validators.compose(__spread(this.initialValidatorOfPercentage, [
9901
- Validators.max(this.maxValuePercentage),
9902
- ]))),
9903
- externalId: this.formBuilder.control(null),
9904
- customFields: this.formBuilder.control(null),
9905
- });
9906
- };
9907
- HistoricalPixAccountFormComponent.prototype.onChangePixKeyType = function (item) {
9908
- if (item.key) {
9909
- this.pixKeyType = item.key;
9910
- this.isShowPixKeyFieldValidatorMessage = true;
9911
- this.pixAccountFormGroup.get("pixKey").reset();
9912
- this.setPixKeyValidators(true);
9913
- if (item.key === "CPF") {
9914
- this.setDefaultCpfPixKey();
9915
- }
9916
- }
9917
- };
9918
- HistoricalPixAccountFormComponent.prototype.onClearPixKeyType = function () {
9919
- this.isShowPixKeyFieldValidatorMessage = false;
9920
- this.pixAccountFormGroup.get("pixKey").reset();
9921
- };
10174
+ HistoricalPixAccountFormComponent.prototype.registerSubjects = function () { };
9922
10175
  Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "visible", {
9923
10176
  get: function () {
9924
10177
  return this._visible;
@@ -9957,7 +10210,8 @@ var HistoricalPixAccountFormComponent = /** @class */ (function () {
9957
10210
  });
9958
10211
  HistoricalPixAccountFormComponent.prototype.formatPixKeyTelephoneNumber = function () {
9959
10212
  if (this.pixKeyType === "TELEPHONE") {
9960
- this.pixAccountFormGroup.get("pixKey").setValue(FormatUtilsService.getFormattedTelephoneNumber(this.pixAccountFormGroup.get("pixKey").value));
10213
+ var pixKeyCtrl = this.pixAccountFormGroup.get("pixKey");
10214
+ pixKeyCtrl.setValue(FormatUtilsService.getFormattedTelephoneNumber(pixKeyCtrl.value));
9961
10215
  }
9962
10216
  };
9963
10217
  HistoricalPixAccountFormComponent.prototype.convertDTOToShowWithCustomFields = function (data) {
@@ -9976,7 +10230,7 @@ var HistoricalPixAccountFormComponent = /** @class */ (function () {
9976
10230
  "pixKeyType",
9977
10231
  "pixKey",
9978
10232
  "percentage",
9979
- "customFields",
10233
+ "customFields"
9980
10234
  ], []);
9981
10235
  };
9982
10236
  HistoricalPixAccountFormComponent.prototype.close = function () {
@@ -9990,7 +10244,7 @@ var HistoricalPixAccountFormComponent = /** @class */ (function () {
9990
10244
  if (this.employeeId) {
9991
10245
  this.pixAccountFormGroup.get("employee").setValue({
9992
10246
  tableId: this.employeeId,
9993
- name: "",
10247
+ name: ""
9994
10248
  });
9995
10249
  }
9996
10250
  this.pixAccountItemToList.emit(this.pixAccountFormGroup.getRawValue());
@@ -10022,14 +10276,10 @@ var HistoricalPixAccountFormComponent = /** @class */ (function () {
10022
10276
  return {
10023
10277
  prefix: "",
10024
10278
  thousands: this.currency.thousandsSeparator,
10025
- decimal: this.currency.decimalSeparator,
10279
+ decimal: this.currency.decimalSeparator
10026
10280
  };
10027
10281
  };
10028
10282
  Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "getListPixAccount", {
10029
- /**
10030
- * O Input que recebe a lista do component pai e chama o método de validação passando a lista recebida.
10031
- * @param pixAccountList
10032
- */
10033
10283
  set: function (pixAccountList) {
10034
10284
  if (pixAccountList) {
10035
10285
  this.setValidatorsAccordingList(pixAccountList, null, false);
@@ -10041,85 +10291,6 @@ var HistoricalPixAccountFormComponent = /** @class */ (function () {
10041
10291
  enumerable: true,
10042
10292
  configurable: true
10043
10293
  });
10044
- /**
10045
- * Recebe a lista de registros já inseridos na tabela adiciona em uma variável os valores que serão usados para
10046
- * a validação dos campos "percentage" e "pixAccount".
10047
- * Quando tem index significa que está em uma edição, os valores na posição do registro da edição (index) não serão adicionados
10048
- * no array de comparação dos validators.
10049
- * @param pixAccountList
10050
- * @param index
10051
- */
10052
- HistoricalPixAccountFormComponent.prototype.setValidatorsAccordingList = function (pixAccountList, index, isEditMode) {
10053
- if (index === void 0) { index = null; }
10054
- if (isEditMode === void 0) { isEditMode = true; }
10055
- this.pixAccountList = pixAccountList && pixAccountList.length ? __spread(pixAccountList) : [];
10056
- var percentageIncluded = [];
10057
- if (this.pixAccountList && this.pixAccountList.length) {
10058
- this.pixAccountList.filter(function (field, key) {
10059
- if (field["percentage"] && key != index) {
10060
- percentageIncluded.push(field["percentage"]);
10061
- }
10062
- });
10063
- }
10064
- this.beforeSetPixKeyTypeValidator();
10065
- this.setPixKeyValidators(isEditMode);
10066
- this.validatePercentageValid(percentageIncluded);
10067
- };
10068
- /**
10069
- * Antes de setar o validator prepara as variáveis necessária para que seja feita a validação do campo.
10070
- */
10071
- HistoricalPixAccountFormComponent.prototype.setPixKeyValidators = function (isEditMode) {
10072
- var genericPixKey = this.pixAccountFormGroup.get("pixKey");
10073
- if (this.pixKeyType) {
10074
- switch (this.pixKeyType) {
10075
- case "TELEPHONE":
10076
- genericPixKey.setValidators(Validators.compose([
10077
- Validators.required, GenericValidator.isValidPhoneNumber,
10078
- ]));
10079
- break;
10080
- case "EMAIL":
10081
- genericPixKey.setValidators(Validators.compose([
10082
- Validators.required, GenericValidator.isValidEmail,
10083
- ]));
10084
- break;
10085
- case "CPF":
10086
- genericPixKey.setValidators(Validators.compose([
10087
- Validators.required, GenericValidator.isValidCpf,
10088
- ]));
10089
- break;
10090
- case "CNPJ":
10091
- genericPixKey.setValidators(Validators.compose([
10092
- Validators.required, GenericValidator.isValidCnpj,
10093
- ]));
10094
- break;
10095
- case "RANDOM_KEY":
10096
- genericPixKey.setValidators(Validators.required);
10097
- break;
10098
- default:
10099
- genericPixKey.setValidators(null);
10100
- break;
10101
- }
10102
- if (isEditMode) {
10103
- genericPixKey.enable();
10104
- }
10105
- genericPixKey.updateValueAndValidity();
10106
- }
10107
- };
10108
- /**
10109
- * Este método calcula as parcentagens que já foram inseridas, e seta a diferença para chegar em
10110
- * 100% na validação do campo "percentage" como um novo maxValue;
10111
- * @param listValue
10112
- */
10113
- HistoricalPixAccountFormComponent.prototype.validatePercentageValid = function (listValue) {
10114
- var percentage = this.pixAccountFormGroup.get("percentage");
10115
- this.maxValuePercentage = listValue
10116
- .reduce(function (currentValue, total) { return currentValue - total; }, 100.00);
10117
- percentage
10118
- .setValidators(Validators.compose(__spread(this.initialValidatorOfPercentage, [
10119
- Validators.max(this.maxValuePercentage),
10120
- ])));
10121
- percentage.updateValueAndValidity();
10122
- };
10123
10294
  Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "isViewMode", {
10124
10295
  set: function (condition) {
10125
10296
  this.isView = !!(condition && !this.withSideBar);
@@ -10130,58 +10301,24 @@ var HistoricalPixAccountFormComponent = /** @class */ (function () {
10130
10301
  enumerable: true,
10131
10302
  configurable: true
10132
10303
  });
10133
- HistoricalPixAccountFormComponent.prototype.phoneMask = function (event) {
10134
- FormatUtilsService.formatTelephoneInputEvent(event);
10135
- };
10136
- HistoricalPixAccountFormComponent.prototype.setDefaultCpfPixKey = function () {
10137
- if (this.defaultCpfNumber) {
10138
- this.pixAccountFormGroup.get("pixKey").setValue(this.defaultCpfNumber);
10139
- }
10140
- else {
10141
- var sheetDocument = this.paramsForm.get("sheetDocument");
10142
- if (sheetDocument) {
10143
- var cpf = sheetDocument.get("cpfNumber").value;
10144
- if (cpf) {
10145
- this.pixAccountFormGroup.get("pixKey").setValue(cpf);
10146
- }
10147
- }
10148
- }
10149
- };
10150
- HistoricalPixAccountFormComponent.prototype.beforeSetPixKeyTypeValidator = function () {
10151
- var pixKeyType = this.pixAccountFormGroup.get("pixKeyType");
10152
- if (this.pixAccountList && this.pixAccountList.length && pixKeyType) {
10153
- pixKeyType
10154
- .setValidators(Validators.compose([
10155
- Validators.required,
10156
- this.validateDuplicatePixKeyTypeBankAccount(this.pixAccountList),
10157
- ]));
10158
- }
10159
- else {
10160
- pixKeyType.setValidators(Validators.required);
10161
- }
10162
- };
10163
- HistoricalPixAccountFormComponent.prototype.validateDuplicatePixKeyTypeBankAccount = function (listCompare) {
10164
- return function (control) {
10165
- var value = control && control.value;
10166
- var condition = false;
10167
- listCompare.filter(function (field) {
10168
- if (value) {
10169
- if (field["pixKeyType"].key === 'BANK_ACCOUNT' && value.key === field["pixKeyType"].key) {
10170
- return condition = true;
10171
- }
10172
- }
10173
- });
10174
- if (condition) {
10175
- return { pixKeyTypeBankAccountDuplicate: true };
10176
- }
10177
- else {
10178
- return null;
10179
- }
10180
- };
10181
- };
10304
+ Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "paramsForm", {
10305
+ set: function (value) {
10306
+ this._paramsForm = value;
10307
+ },
10308
+ enumerable: true,
10309
+ configurable: true
10310
+ });
10311
+ Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "defaultCpfNumber", {
10312
+ set: function (value) {
10313
+ this._defaultCpfNumber = value;
10314
+ },
10315
+ enumerable: true,
10316
+ configurable: true
10317
+ });
10182
10318
  HistoricalPixAccountFormComponent.ctorParameters = function () { return [
10183
10319
  { type: FormBuilder },
10184
- { type: ChangeDetectorRef }
10320
+ { type: ChangeDetectorRef },
10321
+ { type: SharedStateService }
10185
10322
  ]; };
10186
10323
  __decorate([
10187
10324
  ViewChild(CustomFieldsComponent$1, { static: true })
@@ -10201,12 +10338,6 @@ var HistoricalPixAccountFormComponent = /** @class */ (function () {
10201
10338
  __decorate([
10202
10339
  Input()
10203
10340
  ], HistoricalPixAccountFormComponent.prototype, "isEditMode", void 0);
10204
- __decorate([
10205
- Input()
10206
- ], HistoricalPixAccountFormComponent.prototype, "paramsForm", void 0);
10207
- __decorate([
10208
- Input()
10209
- ], HistoricalPixAccountFormComponent.prototype, "defaultCpfNumber", void 0);
10210
10341
  __decorate([
10211
10342
  Output()
10212
10343
  ], HistoricalPixAccountFormComponent.prototype, "visibleChange", void 0);
@@ -10225,32 +10356,21 @@ var HistoricalPixAccountFormComponent = /** @class */ (function () {
10225
10356
  __decorate([
10226
10357
  Input()
10227
10358
  ], HistoricalPixAccountFormComponent.prototype, "isViewMode", null);
10359
+ __decorate([
10360
+ Input()
10361
+ ], HistoricalPixAccountFormComponent.prototype, "paramsForm", null);
10362
+ __decorate([
10363
+ Input()
10364
+ ], HistoricalPixAccountFormComponent.prototype, "defaultCpfNumber", null);
10228
10365
  HistoricalPixAccountFormComponent = __decorate([
10229
10366
  Component({
10230
10367
  selector: "pix-account",
10231
- template: "<div id=\"main\">\n <form [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",
10368
+ 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",
10232
10369
  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}"]
10233
10370
  })
10234
10371
  ], HistoricalPixAccountFormComponent);
10235
10372
  return HistoricalPixAccountFormComponent;
10236
- }());
10237
-
10238
- var HistoricalPixAccountService = /** @class */ (function () {
10239
- function HistoricalPixAccountService(http) {
10240
- this.http = http;
10241
- }
10242
- HistoricalPixAccountService.prototype.query = function (path, body, service) {
10243
- if (service === void 0) { service = ServiceType.PAYROLL; }
10244
- return this.http.query(path, body, service);
10245
- };
10246
- HistoricalPixAccountService.ctorParameters = function () { return [
10247
- { type: HttpClientService }
10248
- ]; };
10249
- HistoricalPixAccountService = __decorate([
10250
- Injectable()
10251
- ], HistoricalPixAccountService);
10252
- return HistoricalPixAccountService;
10253
- }());
10373
+ }(HistoricakPixAccountBase));
10254
10374
 
10255
10375
  var HistoricalPixAccountModule = /** @class */ (function () {
10256
10376
  function HistoricalPixAccountModule() {
@@ -10280,6 +10400,8 @@ var HistoricalPixAccountModule = /** @class */ (function () {
10280
10400
  CustomFieldsModule$1,
10281
10401
  PanelModule,
10282
10402
  InputMaskModule,
10403
+ DropdownModule,
10404
+ TabViewModule,
10283
10405
  ],
10284
10406
  declarations: [HistoricalPixAccountComponent, HistoricalPixAccountFormComponent],
10285
10407
  providers: [HistoricalPixAccountService, ConfirmationService],
@@ -10322,7 +10444,7 @@ var HistoricalPixAccountListService = /** @class */ (function () {
10322
10444
 
10323
10445
  var moment$e = moment_;
10324
10446
  var HistoricalPixAccountListComponent = /** @class */ (function () {
10325
- function HistoricalPixAccountListComponent(confirmationService, translateService, activatedRoute, cd, router, messageService, historicalPixAccountListService) {
10447
+ function HistoricalPixAccountListComponent(confirmationService, translateService, activatedRoute, cd, router, messageService, historicalPixAccountListService, sharedStateService) {
10326
10448
  this.confirmationService = confirmationService;
10327
10449
  this.translateService = translateService;
10328
10450
  this.activatedRoute = activatedRoute;
@@ -10330,12 +10452,14 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10330
10452
  this.router = router;
10331
10453
  this.messageService = messageService;
10332
10454
  this.historicalPixAccountListService = historicalPixAccountListService;
10455
+ this.sharedStateService = sharedStateService;
10333
10456
  this.endPoint = "hcm/payroll/queries/historicalEmployeePixQuery";
10334
10457
  this.keyPayload = "historicalEmployeePix";
10335
10458
  this.withSidebar = true;
10336
10459
  this.isOnlyView = new EventEmitter();
10337
10460
  this.isOnlyEdit = new EventEmitter();
10338
10461
  this.enableView = new EventEmitter();
10462
+ this.isEditJudicialDependentPix = new EventEmitter();
10339
10463
  this.ngUnsubscribe = new Subject();
10340
10464
  this.loading = true;
10341
10465
  this.columns = [
@@ -10355,6 +10479,7 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10355
10479
  HistoricalPixAccountListComponent.prototype.ngOnDestroy = function () {
10356
10480
  this.ngUnsubscribe.next();
10357
10481
  this.ngUnsubscribe.complete();
10482
+ this.unsubscribe();
10358
10483
  };
10359
10484
  HistoricalPixAccountListComponent.prototype.ngAfterViewInit = function () {
10360
10485
  this.cd.detectChanges();
@@ -10374,6 +10499,9 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10374
10499
  label: this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
10375
10500
  command: function () {
10376
10501
  if (_this.isAllowToViewHistorical) {
10502
+ _this.sharedStateService.setHideField(true);
10503
+ _this.sharedStateService.setShowButton(false);
10504
+ _this.sharedStateService.setShowEditMode(false);
10377
10505
  var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
10378
10506
  if (_this.withSidebar) {
10379
10507
  _this.isOnlyView.emit(true);
@@ -10382,6 +10510,7 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10382
10510
  });
10383
10511
  }
10384
10512
  else {
10513
+ _this.sharedStateService.setSaveButton(false);
10385
10514
  _this.enableView.emit(dateChange);
10386
10515
  }
10387
10516
  }
@@ -10394,15 +10523,17 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10394
10523
  label: this.translateService.instant("hcm.payroll.edit"),
10395
10524
  command: function () {
10396
10525
  if (_this.isAllowToEditHistorical) {
10526
+ _this.sharedStateService.setHideField(true);
10527
+ _this.sharedStateService.setShowButton(false);
10528
+ _this.sharedStateService.setShowEditMode(true);
10397
10529
  var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
10398
10530
  if (_this.withSidebar) {
10399
- _this.isOnlyView.emit(false);
10400
- _this.isOnlyEdit.emit(true);
10401
10531
  _this.router.navigate(["historical-pix-account/" + dateChange], {
10402
10532
  relativeTo: _this.activatedRoute,
10403
10533
  });
10404
10534
  }
10405
10535
  else {
10536
+ _this.sharedStateService.setSaveButton(true);
10406
10537
  _this.enableView.emit(dateChange);
10407
10538
  }
10408
10539
  }
@@ -10488,6 +10619,24 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10488
10619
  this.lastRecord = payload[0];
10489
10620
  }
10490
10621
  };
10622
+ HistoricalPixAccountListComponent.prototype.unsubscribe = function () {
10623
+ if (this._subscription) {
10624
+ this._subscription.unsubscribe();
10625
+ }
10626
+ };
10627
+ Object.defineProperty(HistoricalPixAccountListComponent.prototype, "hideFieldsOnAdd$", {
10628
+ set: function (subject) {
10629
+ var _this = this;
10630
+ this.unsubscribe();
10631
+ if (subject) {
10632
+ this._subscription = subject.subscribe(function (value) {
10633
+ _this.sharedStateService.setHideField(value);
10634
+ });
10635
+ }
10636
+ },
10637
+ enumerable: true,
10638
+ configurable: true
10639
+ });
10491
10640
  Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToAddHistorical", {
10492
10641
  get: function () {
10493
10642
  return (this.permission["incluir"]);
@@ -10540,7 +10689,8 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10540
10689
  { type: ChangeDetectorRef },
10541
10690
  { type: Router },
10542
10691
  { type: MessageService },
10543
- { type: HistoricalPixAccountListService }
10692
+ { type: HistoricalPixAccountListService },
10693
+ { type: SharedStateService }
10544
10694
  ]; };
10545
10695
  __decorate([
10546
10696
  ViewChild(CustomFieldsComponent$1, { static: false })
@@ -10566,6 +10716,9 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10566
10716
  __decorate([
10567
10717
  Input()
10568
10718
  ], HistoricalPixAccountListComponent.prototype, "withSidebar", void 0);
10719
+ __decorate([
10720
+ Input()
10721
+ ], HistoricalPixAccountListComponent.prototype, "hideField", void 0);
10569
10722
  __decorate([
10570
10723
  Output()
10571
10724
  ], HistoricalPixAccountListComponent.prototype, "isOnlyView", void 0);
@@ -10575,6 +10728,12 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10575
10728
  __decorate([
10576
10729
  Output()
10577
10730
  ], HistoricalPixAccountListComponent.prototype, "enableView", void 0);
10731
+ __decorate([
10732
+ Output()
10733
+ ], HistoricalPixAccountListComponent.prototype, "isEditJudicialDependentPix", void 0);
10734
+ __decorate([
10735
+ Input()
10736
+ ], HistoricalPixAccountListComponent.prototype, "hideFieldsOnAdd$", null);
10578
10737
  __decorate([
10579
10738
  Input()
10580
10739
  ], HistoricalPixAccountListComponent.prototype, "reloadList", null);
@@ -10624,5 +10783,5 @@ var HistoricalPixAccountListModule = /** @class */ (function () {
10624
10783
  * Generated bundle index. Do not edit.
10625
10784
  */
10626
10785
 
10627
- export { AdmissionDraftSummaryComponent, AdmissionDraftSummaryModule, AdmissionDraftSummaryService, AutocompleteParametersService, BlockUiComponent, BlockUiModule, BreadcrumbComponent, BreadcrumbSDSModule, CNPJValidator, CPFValidator, CompanyIndicationType, CompanyIndicationsService, CompareType, ControlMessagesErrorComponent, ControlMessagesErrorModule, CoreDirectives, CoreFieldType, CustomFieldsComponent, CustomFieldsModule, DataListModule, DataListRestModule, DateValidator, DirectionEnumeration, EmployeeSelectorComponent, EmployeeSelectorModule, EmployeeSummaryComponent, EmployeeSummaryModule, EmployeeSummaryService, EntityODataParameter, ErrorPageComponent, ErrorPageModule, FieldValidatorComponent, FieldValidatorModule, FileUploadComponent, FileUploadCoreModule, FormComparatorService, FromToComponent, FromToModule, HistoricalBankAccountComponent, HistoricalBankAccountListComponent, HistoricalBankAccountListModule, HistoricalBankAccountListService, HistoricalBankAccountModule, HistoricalBankAccountService, HistoricalPixAccountComponent, HistoricalPixAccountListComponent, HistoricalPixAccountListModule, HistoricalPixAccountListService, HistoricalPixAccountModule, HistoricalPixAccountService, HttpClientService, HttpRequestType, ImageCropComponent, ImageCropModule, ImageCropService, InputDateComponent, InputDateModelComponent, InputDateModelModule, InputDateModule, InputRestAutoCompleteComponent, InputRestAutoCompleteEmployeeModelModule, InputRestAutoCompleteEmployeeModelService, InputRestAutoCompleteEmployeeModule, InputRestAutoCompleteEmployeeService, InputRestAutoCompleteEnumComponent, InputRestAutoCompleteEnumModule, InputRestAutoCompleteEnumService, InputRestAutoCompleteJobpositionComponent, InputRestAutoCompleteJobpositionModule, InputRestAutoCompleteJobpositionService, InputRestAutoCompleteModelEnumModule, InputRestAutoCompleteModelEnumService, InputRestAutoCompleteModelModule, InputRestAutoCompleteModelService, InputRestAutoCompleteModule, InputRestAutoCompleteService, IntegrationService, ListRestComponent, ListRestModule, LookupModule, LookupParametersService, MenuType, ModuleType, NameNotSpacesDirective, OnlyNumberDirective, Operators, ParameterType, PermissionService, ReportFormat, ReportService, ReportStage, ServiceType, ServicesModule, SpinnerLoaderComponent, SpinnerLoaderModule, StringMethods, ToastComponent, ToastModule, ToastService, TypeAdmissionModule, TypeAdmissionServices, UsingType, WorkflowDataService, WorkflowIntegrator, WorkstationgroupLookupDto, WorkstationgroupLookupModule, _moment, assign, autoCompleteObjectForIdObject, clearValues, cnpjValidator, compareValues, configEnabledFields, containsMoreThanOneConsecutiveAbbreviation, containsMoreThanOneConsecutiveBlankSpace, containsMoreThanTwoRepeatedCharacters, containsSpecialCharacters, convertBooleanString, convertStringToBoolean, cpfValidator, firstNameIsValid, firstNameLengthIsValid, formatMoney, fullNameLengthIsValid, getAddWeekDaysBusiness, getFormat, getFormatDate, getMoment, getNowDate, getObjValids, getQueryParams, getWeekDaysBusiness, getYears, invertFieldDate, isBirthDayValid, isDateCompare, isDateExpirationBeforeExpeditionDate, isDateField, isDateSameOrAfterCurrentDate, isFullDate, isMax, isNumber, isObject, isRequired, isShallow, isValid, isValidDate, isValidPIS, mountCustomForSave, mountCustomForShow, mountCustomToSave, mountCustomToShow, mountGeneratedCustomToSave, ngCalendarFormat, notEmpty, numberOrZero, removeCharacteresSpecials, removeEmpty, removeWhiteSpaces, setCustonFields, setDisableField, setErrors, setRequired, setRequiredFields, setValidator, setValidatorsAndDisableFields, setValueCustom, stringMethods, sun, uiid, validateBirthDate, verifyValidationsForm, SharedModule as ɵa, DataListRestComponent as ɵb, DataListRestService as ɵc, FileUploadService as ɵd, InputRestAutoCompleteEmployeeComponent as ɵe, InputRestAutoCompleteEmployeeModelComponent as ɵf, InputRestAutoCompleteModelComponent as ɵg, InputRestAutoCompleteModelEnumComponent as ɵh, ListRestService as ɵi, DataListComponent as ɵj, DataListService as ɵk, LookupComponent as ɵl, LookupService as ɵm, WorkstationgroupLookupComponent as ɵn, AutocompleteService as ɵo, LookupService$1 as ɵp, HistoricalBankAccountFormComponent as ɵq, HistoricalPixAccountFormComponent as ɵr };
10786
+ export { AdmissionDraftSummaryComponent, AdmissionDraftSummaryModule, AdmissionDraftSummaryService, AutocompleteParametersService, BlockUiComponent, BlockUiModule, BreadcrumbComponent, BreadcrumbSDSModule, CNPJValidator, CPFValidator, CompanyIndicationType, CompanyIndicationsService, CompareType, ControlMessagesErrorComponent, ControlMessagesErrorModule, CoreDirectives, CoreFieldType, CustomFieldsComponent, CustomFieldsModule, DataListModule, DataListRestModule, DateValidator, DirectionEnumeration, EmployeeSelectorComponent, EmployeeSelectorModule, EmployeeSummaryComponent, EmployeeSummaryModule, EmployeeSummaryService, EntityODataParameter, ErrorPageComponent, ErrorPageModule, FieldValidatorComponent, FieldValidatorModule, FileUploadComponent, FileUploadCoreModule, FormComparatorService, FromToComponent, FromToModule, HistoricalBankAccountComponent, HistoricalBankAccountListComponent, HistoricalBankAccountListModule, HistoricalBankAccountListService, HistoricalBankAccountModule, HistoricalBankAccountService, HistoricalPixAccountComponent, HistoricalPixAccountListComponent, HistoricalPixAccountListModule, HistoricalPixAccountListService, HistoricalPixAccountModule, HistoricalPixAccountService, HttpClientService, HttpRequestType, ImageCropComponent, ImageCropModule, ImageCropService, InputDateComponent, InputDateModelComponent, InputDateModelModule, InputDateModule, InputRestAutoCompleteComponent, InputRestAutoCompleteEmployeeModelModule, InputRestAutoCompleteEmployeeModelService, InputRestAutoCompleteEmployeeModule, InputRestAutoCompleteEmployeeService, InputRestAutoCompleteEnumComponent, InputRestAutoCompleteEnumModule, InputRestAutoCompleteEnumService, InputRestAutoCompleteJobpositionComponent, InputRestAutoCompleteJobpositionModule, InputRestAutoCompleteJobpositionService, InputRestAutoCompleteModelEnumModule, InputRestAutoCompleteModelEnumService, InputRestAutoCompleteModelModule, InputRestAutoCompleteModelService, InputRestAutoCompleteModule, InputRestAutoCompleteService, IntegrationService, ListRestComponent, ListRestModule, LookupModule, LookupParametersService, MenuType, ModuleType, NameNotSpacesDirective, OnlyNumberDirective, Operators, ParameterType, PermissionService, ReportFormat, ReportService, ReportStage, ServiceType, ServicesModule, SharedStateService, SpinnerLoaderComponent, SpinnerLoaderModule, StringMethods, ToastComponent, ToastModule, ToastService, TypeAdmissionModule, TypeAdmissionServices, UsingType, WorkflowDataService, WorkflowIntegrator, WorkstationgroupLookupDto, WorkstationgroupLookupModule, _moment, assign, autoCompleteObjectForIdObject, clearValues, cnpjValidator, compareValues, configEnabledFields, containsMoreThanOneConsecutiveAbbreviation, containsMoreThanOneConsecutiveBlankSpace, containsMoreThanTwoRepeatedCharacters, containsSpecialCharacters, convertBooleanString, convertStringToBoolean, cpfValidator, firstNameIsValid, firstNameLengthIsValid, formatMoney, fullNameLengthIsValid, getAddWeekDaysBusiness, getFormat, getFormatDate, getMoment, getNowDate, getObjValids, getQueryParams, getWeekDaysBusiness, getYears, invertFieldDate, isBirthDayValid, isDateCompare, isDateExpirationBeforeExpeditionDate, isDateField, isDateSameOrAfterCurrentDate, isFullDate, isMax, isNumber, isObject, isRequired, isShallow, isValid, isValidDate, isValidPIS, mountCustomForSave, mountCustomForShow, mountCustomToSave, mountCustomToShow, mountGeneratedCustomToSave, ngCalendarFormat, notEmpty, numberOrZero, removeCharacteresSpecials, removeEmpty, removeWhiteSpaces, setCustonFields, setDisableField, setErrors, setRequired, setRequiredFields, setValidator, setValidatorsAndDisableFields, setValueCustom, stringMethods, sun, uiid, validateBirthDate, verifyValidationsForm, SharedModule as ɵa, DataListRestComponent as ɵb, DataListRestService as ɵc, FileUploadService as ɵd, InputRestAutoCompleteEmployeeComponent as ɵe, InputRestAutoCompleteEmployeeModelComponent as ɵf, InputRestAutoCompleteModelComponent as ɵg, InputRestAutoCompleteModelEnumComponent as ɵh, ListRestService as ɵi, DataListComponent as ɵj, DataListService as ɵk, LookupComponent as ɵl, LookupService as ɵm, WorkstationgroupLookupComponent as ɵn, AutocompleteService as ɵo, LookupService$1 as ɵp, HistoricalBankAccountFormComponent as ɵq, HistoricakPixAccountBase as ɵr, HistoricalPixAccountFormComponent as ɵs };
10628
10787
  //# sourceMappingURL=senior-gestao-pessoas-payroll-core.js.map