@senior-gestao-pessoas/payroll-core 9.3.0 → 9.4.0-0cf4358c-33d1-410a-9833-da0e4b763444

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 (21) hide show
  1. package/bundles/senior-gestao-pessoas-payroll-core.umd.js +157 -51
  2. package/bundles/senior-gestao-pessoas-payroll-core.umd.js.map +1 -1
  3. package/bundles/senior-gestao-pessoas-payroll-core.umd.min.js +1 -1
  4. package/bundles/senior-gestao-pessoas-payroll-core.umd.min.js.map +1 -1
  5. package/components/historical-pix-account/historical-pix-account.component.d.ts +17 -3
  6. package/components/historical-pix-account-list/historical-pix-account-list.component.d.ts +4 -1
  7. package/esm2015/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.js +2 -1
  8. package/esm2015/components/historical-pix-account/historical-pix-account.component.js +83 -12
  9. package/esm2015/components/historical-pix-account-list/historical-pix-account-list.component.js +53 -43
  10. package/esm5/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.js +2 -1
  11. package/esm5/components/historical-pix-account/historical-pix-account.component.js +99 -12
  12. package/esm5/components/historical-pix-account-list/historical-pix-account-list.component.js +61 -43
  13. package/fesm2015/senior-gestao-pessoas-payroll-core.js +133 -51
  14. package/fesm2015/senior-gestao-pessoas-payroll-core.js.map +1 -1
  15. package/fesm5/senior-gestao-pessoas-payroll-core.js +157 -51
  16. package/fesm5/senior-gestao-pessoas-payroll-core.js.map +1 -1
  17. package/locale/en-US.json +1 -1
  18. package/locale/es-ES.json +1 -1
  19. package/locale/pt-BR.json +1 -1
  20. package/package.json +2 -32
  21. package/senior-gestao-pessoas-payroll-core.metadata.json +1 -1
@@ -9256,17 +9256,23 @@ var FormatUtilsService = /** @class */ (function () {
9256
9256
  }());
9257
9257
 
9258
9258
  var HistoricalPixAccountComponent = /** @class */ (function () {
9259
- function HistoricalPixAccountComponent(translateService, cd, formBuilder) {
9259
+ function HistoricalPixAccountComponent(translateService, cd, formBuilder, messageService) {
9260
9260
  var _this = this;
9261
9261
  this.translateService = translateService;
9262
9262
  this.cd = cd;
9263
9263
  this.formBuilder = formBuilder;
9264
+ this.messageService = messageService;
9264
9265
  this.recordByRow = 1;
9265
9266
  this.showDateChange = false;
9266
9267
  this.isEditMode = false;
9267
9268
  this.isViewMode = false;
9268
9269
  this.withSideBar = true;
9269
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 = [];
9270
9276
  this.visibleChange = new EventEmitter();
9271
9277
  this.ngUnsubscribe = new Subject();
9272
9278
  this.orderBy = {
@@ -9300,26 +9306,50 @@ var HistoricalPixAccountComponent = /** @class */ (function () {
9300
9306
  visible: _this.isEditMode,
9301
9307
  label: _this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
9302
9308
  command: function () {
9303
- rowData["index"] = key;
9304
- _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: false };
9305
- _this.visible = true;
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
+ }
9306
9317
  },
9307
9318
  },
9308
9319
  {
9309
9320
  visible: !!(!_this.isEditMode && _this.withSideBar),
9310
9321
  label: _this.translateService.instant("hcm.payroll.edit"),
9311
9322
  command: function () {
9312
- rowData["index"] = key;
9313
- _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true };
9314
- _this.visible = true;
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
+ }
9315
9336
  },
9316
9337
  },
9317
9338
  {
9318
9339
  visible: !_this.isEditMode,
9319
9340
  label: _this.translateService.instant("hcm.payroll.delete"),
9320
9341
  command: function () {
9321
- _this.loading = true;
9322
- _this.deleteAnnuityItem(key);
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
+ }
9323
9353
  },
9324
9354
  },
9325
9355
  ];
@@ -9329,6 +9359,11 @@ var HistoricalPixAccountComponent = /** @class */ (function () {
9329
9359
  HistoricalPixAccountComponent.prototype.ngOnInit = function () {
9330
9360
  this.formGroup.setControl(this.fieldFormGroup, this.historicalPixAccountList);
9331
9361
  };
9362
+ HistoricalPixAccountComponent.prototype.ngOnChanges = function (changes) {
9363
+ if (changes['listDataReciever'] && changes['listDataReciever'].currentValue) {
9364
+ this.listFromApp = changes['listDataReciever'].currentValue;
9365
+ }
9366
+ };
9332
9367
  HistoricalPixAccountComponent.prototype.createFormGroup = function () {
9333
9368
  this.historicalPixAccountList = this.formBuilder.group({
9334
9369
  historicalPixAccountList: this.formBuilder.control(null),
@@ -9385,6 +9420,13 @@ var HistoricalPixAccountComponent = /** @class */ (function () {
9385
9420
  this.pixAccountItemInput = {};
9386
9421
  this.visible = true;
9387
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
+ };
9388
9430
  HistoricalPixAccountComponent.prototype.deleteAnnuityItem = function (index) {
9389
9431
  var newlist = __spread(this.getHistoricalPixAccountList());
9390
9432
  newlist.sort(compareValues(this.orderBy.field, this.orderBy.direction));
@@ -9530,10 +9572,39 @@ var HistoricalPixAccountComponent = /** @class */ (function () {
9530
9572
  HistoricalPixAccountComponent.prototype.getFormattedPercentage = function (value) {
9531
9573
  return FormatUtilsService.getFormattedPercentage(value);
9532
9574
  };
9575
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToAddHistorical", {
9576
+ get: function () {
9577
+ return (this.permission["incluir"]);
9578
+ },
9579
+ enumerable: true,
9580
+ configurable: true
9581
+ });
9582
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToDeleteHistorical", {
9583
+ get: function () {
9584
+ return (this.permission["excluir"]);
9585
+ },
9586
+ enumerable: true,
9587
+ configurable: true
9588
+ });
9589
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToEditHistorical", {
9590
+ get: function () {
9591
+ return (this.permission["editar"]);
9592
+ },
9593
+ enumerable: true,
9594
+ configurable: true
9595
+ });
9596
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToViewHistorical", {
9597
+ get: function () {
9598
+ return (this.permission["visualizar"]);
9599
+ },
9600
+ enumerable: true,
9601
+ configurable: true
9602
+ });
9533
9603
  HistoricalPixAccountComponent.ctorParameters = function () { return [
9534
9604
  { type: TranslateService },
9535
9605
  { type: ChangeDetectorRef },
9536
- { type: FormBuilder }
9606
+ { type: FormBuilder },
9607
+ { type: MessageService }
9537
9608
  ]; };
9538
9609
  __decorate([
9539
9610
  ViewChild(CustomFieldsComponent$1, { static: false })
@@ -9583,6 +9654,21 @@ var HistoricalPixAccountComponent = /** @class */ (function () {
9583
9654
  __decorate([
9584
9655
  Input()
9585
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);
9586
9672
  __decorate([
9587
9673
  Input()
9588
9674
  ], HistoricalPixAccountComponent.prototype, "dateChange", null);
@@ -9814,6 +9900,7 @@ var HistoricalPixAccountFormComponent = /** @class */ (function () {
9814
9900
  percentage: this.formBuilder.control(null, Validators.compose(__spread(this.initialValidatorOfPercentage, [
9815
9901
  Validators.max(this.maxValuePercentage),
9816
9902
  ]))),
9903
+ externalId: this.formBuilder.control(null),
9817
9904
  customFields: this.formBuilder.control(null),
9818
9905
  });
9819
9906
  };
@@ -10246,6 +10333,7 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10246
10333
  this.endPoint = "hcm/payroll/queries/historicalEmployeePixQuery";
10247
10334
  this.keyPayload = "historicalEmployeePix";
10248
10335
  this.withSidebar = true;
10336
+ this.isOnlyView = new EventEmitter();
10249
10337
  this.enableView = new EventEmitter();
10250
10338
  this.ngUnsubscribe = new Subject();
10251
10339
  this.loading = true;
@@ -10254,18 +10342,6 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10254
10342
  label: this.translateService.instant("hcm.payroll.historical_pix_account_label_date_change"),
10255
10343
  field: "dateChange",
10256
10344
  },
10257
- {
10258
- label: this.translateService.instant("hcm.payroll.historical_pix_account_label_pix_key_type"),
10259
- field: "pixKeyType.value",
10260
- },
10261
- {
10262
- label: this.translateService.instant("hcm.payroll.historical_pix_account_label_pix_key"),
10263
- field: "pixKey",
10264
- },
10265
- {
10266
- label: this.translateService.instant("hcm.payroll.historical_pix_account_label_percentage"),
10267
- field: "percentage",
10268
- },
10269
10345
  {
10270
10346
  label: this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_label_qtd_account"),
10271
10347
  field: "numberOfPixAccount",
@@ -10286,40 +10362,50 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10286
10362
  var _this = this;
10287
10363
  payload.forEach(function (value) {
10288
10364
  value.dateChange = moment$e(value.dateChange).format(_this.dateFormat);
10289
- value.pixKey = _this.formatPixKeyByType(value.pixKeyType, value.pixKey);
10290
- value.percentage = FormatUtilsService.getFormattedPercentage(value.percentage);
10291
10365
  });
10292
10366
  this.onGridLoad(payload);
10293
10367
  this.loading = false;
10294
10368
  };
10295
- HistoricalPixAccountListComponent.prototype.formatPixKeyByType = function (pixKeyType, pixKey) {
10296
- var keyType = pixKeyType ? pixKeyType.key.toUpperCase() : "";
10297
- if (keyType === "TELEPHONE") {
10298
- return FormatUtilsService.getFormattedTelephoneNumber(pixKey);
10299
- }
10300
- else if (keyType === "CPF") {
10301
- return FormatUtilsService.getFormattedCpf(pixKey);
10302
- }
10303
- else if (keyType === "CNPJ") {
10304
- return FormatUtilsService.getFormattedCnpj(pixKey);
10305
- }
10306
- else {
10307
- return pixKey;
10308
- }
10309
- };
10310
10369
  HistoricalPixAccountListComponent.prototype.getMenuActions = function (rowData) {
10311
10370
  var _this = this;
10312
10371
  return [
10313
10372
  {
10314
10373
  label: this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
10315
10374
  command: function () {
10316
- var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
10317
- if (_this.withSidebar)
10318
- _this.router.navigate(["historical-pix-account/" + dateChange], {
10319
- relativeTo: _this.activatedRoute,
10320
- });
10321
- else
10322
- _this.enableView.emit(dateChange);
10375
+ if (_this.isAllowToViewHistorical) {
10376
+ var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
10377
+ if (_this.withSidebar) {
10378
+ _this.isOnlyView.emit(true);
10379
+ _this.router.navigate(["historical-pix-account/" + dateChange], {
10380
+ relativeTo: _this.activatedRoute,
10381
+ });
10382
+ }
10383
+ else {
10384
+ _this.enableView.emit(dateChange);
10385
+ }
10386
+ }
10387
+ else {
10388
+ _this.isNotAllowMessage();
10389
+ }
10390
+ },
10391
+ },
10392
+ {
10393
+ label: this.translateService.instant("hcm.payroll.edit"),
10394
+ command: function () {
10395
+ if (_this.isAllowToEditHistorical) {
10396
+ var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
10397
+ if (_this.withSidebar) {
10398
+ _this.router.navigate(["historical-pix-account/" + dateChange], {
10399
+ relativeTo: _this.activatedRoute,
10400
+ });
10401
+ }
10402
+ else {
10403
+ _this.enableView.emit(dateChange);
10404
+ }
10405
+ }
10406
+ else {
10407
+ _this.isNotAllowMessage();
10408
+ }
10323
10409
  },
10324
10410
  },
10325
10411
  {
@@ -10329,11 +10415,7 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10329
10415
  _this.delete(rowData.id, rowData.dateChange);
10330
10416
  }
10331
10417
  else {
10332
- _this.messageService.add({
10333
- severity: "error",
10334
- summary: _this.translateService.instant("hcm.payroll.error"),
10335
- detail: _this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10336
- });
10418
+ _this.isNotAllowMessage();
10337
10419
  }
10338
10420
  },
10339
10421
  },
@@ -10391,6 +10473,13 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10391
10473
  });
10392
10474
  }
10393
10475
  };
10476
+ HistoricalPixAccountListComponent.prototype.isNotAllowMessage = function () {
10477
+ this.messageService.add({
10478
+ severity: "error",
10479
+ summary: this.translateService.instant("hcm.payroll.error"),
10480
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10481
+ });
10482
+ };
10394
10483
  HistoricalPixAccountListComponent.prototype.onGridLoad = function (payload) {
10395
10484
  if (payload && payload.length) {
10396
10485
  this.lastRecord = payload[0];
@@ -10403,6 +10492,13 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10403
10492
  enumerable: true,
10404
10493
  configurable: true
10405
10494
  });
10495
+ Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToEditHistorical", {
10496
+ get: function () {
10497
+ return (this.permission["editar"]);
10498
+ },
10499
+ enumerable: true,
10500
+ configurable: true
10501
+ });
10406
10502
  Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToDeleteHistorical", {
10407
10503
  get: function () {
10408
10504
  return (this.permission["excluir"]);
@@ -10410,6 +10506,13 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10410
10506
  enumerable: true,
10411
10507
  configurable: true
10412
10508
  });
10509
+ Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToViewHistorical", {
10510
+ get: function () {
10511
+ return (this.permission["visualizar"]);
10512
+ },
10513
+ enumerable: true,
10514
+ configurable: true
10515
+ });
10413
10516
  Object.defineProperty(HistoricalPixAccountListComponent.prototype, "scopedActions", {
10414
10517
  get: function () {
10415
10518
  return this.getMenuActions.bind(this);
@@ -10460,6 +10563,9 @@ var HistoricalPixAccountListComponent = /** @class */ (function () {
10460
10563
  __decorate([
10461
10564
  Input()
10462
10565
  ], HistoricalPixAccountListComponent.prototype, "withSidebar", void 0);
10566
+ __decorate([
10567
+ Output()
10568
+ ], HistoricalPixAccountListComponent.prototype, "isOnlyView", void 0);
10463
10569
  __decorate([
10464
10570
  Output()
10465
10571
  ], HistoricalPixAccountListComponent.prototype, "enableView", void 0);