@seniorsistemas/angular-components 14.16.1 → 14.16.4

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 (27) hide show
  1. package/bundles/seniorsistemas-angular-components.umd.js +36 -26
  2. package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
  3. package/bundles/seniorsistemas-angular-components.umd.min.js +1 -1
  4. package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
  5. package/components/dynamic-form/components/fields/boolean/boolean-field.component.d.ts +1 -0
  6. package/components/dynamic-form/components/fields/calendar/calendar-field.component.d.ts +0 -1
  7. package/components/dynamic-form/configurations/fields/boolean-field.d.ts +2 -0
  8. package/components/dynamic-form/configurations/fields/calendar-field.d.ts +2 -0
  9. package/components/table/table-paging/table-paging.component.d.ts +2 -1
  10. package/esm2015/components/dynamic-form/components/fields/boolean/boolean-field.component.js +5 -2
  11. package/esm2015/components/dynamic-form/components/fields/calendar/calendar-field.component.js +2 -5
  12. package/esm2015/components/dynamic-form/configurations/fields/boolean-field.js +2 -1
  13. package/esm2015/components/dynamic-form/configurations/fields/calendar-field.js +13 -1
  14. package/esm2015/components/dynamic-form/dynamic-form.js +2 -9
  15. package/esm2015/components/table/table-paging/table-paging.component.js +18 -13
  16. package/esm5/components/dynamic-form/components/fields/boolean/boolean-field.component.js +5 -2
  17. package/esm5/components/dynamic-form/components/fields/calendar/calendar-field.component.js +2 -5
  18. package/esm5/components/dynamic-form/configurations/fields/boolean-field.js +2 -1
  19. package/esm5/components/dynamic-form/configurations/fields/calendar-field.js +13 -1
  20. package/esm5/components/dynamic-form/dynamic-form.js +2 -9
  21. package/esm5/components/table/table-paging/table-paging.component.js +20 -15
  22. package/fesm2015/seniorsistemas-angular-components.js +35 -25
  23. package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
  24. package/fesm5/seniorsistemas-angular-components.js +36 -26
  25. package/fesm5/seniorsistemas-angular-components.js.map +1 -1
  26. package/package.json +2 -2
  27. package/seniorsistemas-angular-components.metadata.json +1 -1
@@ -1511,6 +1511,7 @@ var BooleanOptionsLabel = /** @class */ (function () {
1511
1511
  this.true = config.true;
1512
1512
  this.false = config.false;
1513
1513
  this.empty = config.empty;
1514
+ this.clear = config.clear;
1514
1515
  }
1515
1516
  return BooleanOptionsLabel;
1516
1517
  }());
@@ -1561,6 +1562,17 @@ var CalendarField = /** @class */ (function (_super) {
1561
1562
  _this.onYearChange = config.onYearChange;
1562
1563
  _this.selectionMode = config.selectionMode || "single";
1563
1564
  _this.rangeSeparator = config.rangeSeparator || "-";
1565
+ _this.showSeconds = config.showSeconds;
1566
+ // Tornando true o padrão para showSeconds.
1567
+ if (_this.showSeconds === null || _this.showSeconds === undefined) {
1568
+ switch (_this.type) {
1569
+ case FieldType.DateTime:
1570
+ case FieldType.LocalDateTime:
1571
+ case FieldType.Time:
1572
+ _this.showSeconds = true;
1573
+ break;
1574
+ }
1575
+ }
1564
1576
  return _this;
1565
1577
  }
1566
1578
  return CalendarField;
@@ -4371,24 +4383,28 @@ var TablePagingComponent = /** @class */ (function () {
4371
4383
  return exportColumn;
4372
4384
  });
4373
4385
  };
4374
- TablePagingComponent.prototype.getRowsToExport = function () {
4386
+ TablePagingComponent.prototype.getCurrentPageRowsToExport = function () {
4387
+ return this.mapColumnsTranslations(this.table.columns, this.table.value);
4388
+ };
4389
+ TablePagingComponent.prototype.getSelectedRowsToExport = function () {
4390
+ return this.mapColumnsTranslations(this.table.columns, this.table.selection);
4391
+ };
4392
+ TablePagingComponent.prototype.mapColumnsTranslations = function (columns, rows) {
4375
4393
  var _this = this;
4376
- var enumColumns = this.table.columns.filter(function (p) { return p.enumPrefix; });
4394
+ var enumColumns = columns.filter(function (p) { return p.enumPrefix; });
4377
4395
  if (!enumColumns.length)
4378
- return this.table.value;
4379
- return __spread(this.table.value).map(function (row) {
4396
+ return rows;
4397
+ return __spread(rows).map(function (row) {
4398
+ var newRow = __assign({}, row);
4380
4399
  for (var i = 0; i <= enumColumns.length - 1; i++) {
4381
4400
  var column = enumColumns[i];
4382
4401
  var fieldName = column.field;
4383
4402
  var columnData = row[fieldName];
4384
- row[fieldName] = _this.translate.instant(column.enumPrefix + columnData.toString().toLowerCase());
4403
+ newRow[fieldName] = _this.translate.instant(column.enumPrefix + columnData.toString().toLowerCase());
4385
4404
  }
4386
- return row;
4405
+ return newRow;
4387
4406
  });
4388
4407
  };
4389
- TablePagingComponent.prototype.getSelectedRowsToExport = function () {
4390
- return this.table.selection;
4391
- };
4392
4408
  TablePagingComponent.prototype.getExportFileName = function () {
4393
4409
  var _a;
4394
4410
  var fileName = (_a = this.exportFileName) !== null && _a !== void 0 ? _a : "download";
@@ -4397,7 +4413,7 @@ var TablePagingComponent = /** @class */ (function () {
4397
4413
  };
4398
4414
  TablePagingComponent.prototype.exportCurrentPage = function () {
4399
4415
  this.validateComponent();
4400
- ExportUtils.exportCSV(this.getColumnsToExport(), this.getRowsToExport(), undefined, this.getExportFileName());
4416
+ ExportUtils.exportCSV(this.getColumnsToExport(), this.getCurrentPageRowsToExport(), undefined, this.getExportFileName());
4401
4417
  };
4402
4418
  TablePagingComponent.prototype.exportSelectedRecords = function () {
4403
4419
  this.validateComponent();
@@ -4405,15 +4421,16 @@ var TablePagingComponent = /** @class */ (function () {
4405
4421
  };
4406
4422
  TablePagingComponent.prototype.exportAllRecords = function () {
4407
4423
  return __awaiter(this, void 0, void 0, function () {
4408
- var data;
4424
+ var serverData, dataToExport;
4409
4425
  return __generator(this, function (_a) {
4410
4426
  switch (_a.label) {
4411
4427
  case 0:
4412
4428
  this.validateComponent();
4413
4429
  return [4 /*yield*/, this.loadAllRecords()];
4414
4430
  case 1:
4415
- data = _a.sent();
4416
- ExportUtils.exportCSV(this.getColumnsToExport(), data, undefined, this.getExportFileName());
4431
+ serverData = _a.sent();
4432
+ dataToExport = this.mapColumnsTranslations(this.table.columns, serverData);
4433
+ ExportUtils.exportCSV(this.getColumnsToExport(), dataToExport, undefined, this.getExportFileName());
4417
4434
  return [2 /*return*/];
4418
4435
  }
4419
4436
  });
@@ -4500,6 +4517,9 @@ var AutocompleteFieldComponent = /** @class */ (function () {
4500
4517
  var BooleanFieldComponent = /** @class */ (function () {
4501
4518
  function BooleanFieldComponent() {
4502
4519
  }
4520
+ BooleanFieldComponent.prototype.onClear = function () {
4521
+ this.formControl.reset();
4522
+ };
4503
4523
  __decorate([
4504
4524
  Input()
4505
4525
  ], BooleanFieldComponent.prototype, "field", void 0);
@@ -4508,7 +4528,7 @@ var BooleanFieldComponent = /** @class */ (function () {
4508
4528
  ], BooleanFieldComponent.prototype, "formControl", void 0);
4509
4529
  BooleanFieldComponent = __decorate([
4510
4530
  Component({
4511
- template: "<ng-container *ngIf=\"field.verticalAlignment;else horizontalAlignment\">\n <div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <p-radioButton [name]=\"field.name\" [value]=\"true\" [label]=\"field.optionsLabel.true\"\n [formControl]=\"formControl\" [inputId]=\"(field.id || field.name) + '-1'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n </div>\n <div class=\"ui-g-12\">\n <p-radioButton [name]=\"field.name\" [value]=\"false\" [label]=\"field.optionsLabel.false\"\n [formControl]=\"formControl\" [inputId]=\"(field.id || field.name) + '-2'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n </div>\n <div class=\"ui-g-12\">\n <p-radioButton *ngIf=\"!field.required()\" [name]=\"field.name\" [value]=\"null\"\n [label]=\"field.optionsLabel.empty\" [formControl]=\"formControl\" [inputId]=\"(field.id || field.name) + '-3'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n </div>\n </div>\n</ng-container>\n\n<ng-template #horizontalAlignment>\n <div class=\"ui-g\">\n <p-radioButton [name]=\"field.name\" [value]=\"true\" [label]=\"field.optionsLabel.true\" [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-1'\" (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\" (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n <p-radioButton [name]=\"field.name\" [value]=\"false\" [label]=\"field.optionsLabel.false\" [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-2'\" (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\" (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n <p-radioButton *ngIf=\"!field.required()\" [name]=\"field.name\" [value]=\"null\" [label]=\"field.optionsLabel.empty\"\n [formControl]=\"formControl\" [inputId]=\"(field.id || field.name) + '-3'\" (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\" (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n </div>\n</ng-template>\n"
4531
+ template: "<ng-container *ngIf=\"field.verticalAlignment;else horizontalAlignment\">\n <div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <p-radioButton\n [name]=\"field.name\"\n [value]=\"true\"\n [label]=\"field.optionsLabel.true\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-1'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n </div>\n <div class=\"ui-g-12\">\n <p-radioButton\n [name]=\"field.name\"\n [value]=\"false\"\n [label]=\"field.optionsLabel.false\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-2'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n </div>\n <div\n *ngIf=\"!field.showClear && !field.required()\"\n class=\"ui-g-12\">\n <p-radioButton \n [name]=\"field.name\"\n [value]=\"null\"\n [label]=\"field.optionsLabel.empty\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-3'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton> \n </div>\n <div>\n <s-button\n *ngIf=\"field.showClear && !field.required()\"\n [label]=\"field.optionsLabel.clear || 'Clear selection'\"\n (onClick)=\"onClear()\"\n priority=\"link\">\n </s-button>\n </div>\n\n </div>\n</ng-container>\n\n<ng-template #horizontalAlignment>\n <div class=\"ui-g\">\n <p-radioButton\n [name]=\"field.name\"\n [value]=\"true\"\n [label]=\"field.optionsLabel.true\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-1'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n \n <p-radioButton\n [name]=\"field.name\"\n [value]=\"false\"\n [label]=\"field.optionsLabel.false\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-2'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n\n <p-radioButton\n *ngIf=\"!field.showClear && !field.required()\"\n [name]=\"field.name\"\n [value]=\"null\"\n [label]=\"field.optionsLabel.empty\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-3'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n\n <s-button\n *ngIf=\"field.showClear && !field.required()\"\n style=\"margin-left: 40px;\"\n [label]=\"field.optionsLabel.clear || 'Clear selection'\"\n (onClick)=\"onClear()\"\n priority=\"link\">\n </s-button>\n </div>\n</ng-template>\n"
4512
4532
  })
4513
4533
  ], BooleanFieldComponent);
4514
4534
  return BooleanFieldComponent;
@@ -4529,12 +4549,9 @@ var CalendarFieldComponent = /** @class */ (function () {
4529
4549
  __decorate([
4530
4550
  Input()
4531
4551
  ], CalendarFieldComponent.prototype, "timeOnly", void 0);
4532
- __decorate([
4533
- Input()
4534
- ], CalendarFieldComponent.prototype, "showSeconds", void 0);
4535
4552
  CalendarFieldComponent = __decorate([
4536
4553
  Component({
4537
- template: "<div [pTooltip]=\"field.tooltip\" tooltipPosition=\"top\" [showDelay]=\"500\" [appendTo]=\"field.appendTo || 'body'\">\n <!-- Remover as propriedades [showTransitionOptions] e [hideTransitionOptions] quando atualizar para o PrimeNG v10, esses atributos foram\n usados para remover um bug ocasionado pela anima\u00E7\u00E3o do componente p-calendar, bug explicado nas issues: #ERPROM-5534, #ERPROM-8248 e #DSN-1045. -->\n <p-calendar\n #calendar\n sCalendarMask\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [showIcon]=\"true\"\n [timeOnly]=\"timeOnly\"\n [selectionMode]=\"field.selectionMode\"\n [rangeSeparator]=\"field.rangeSeparator\"\n [showTime]=\"showTime\"\n [showSeconds]=\"showTime\"\n [showOnFocus]=\"field.showOnFocus\"\n [formControl]=\"formControl\"\n icon=\"fa fa-calendar\"\n [minDate]=\"field.minDate\"\n [maxDate]=\"field.maxDate\"\n [locale]=\"field.calendarLocaleOptions\"\n [dateFormat]=\"field.calendarLocaleOptions.dateFormat\"\n [hourFormat]=\"field.calendarLocaleOptions.hourFormat\"\n [view]=\"field.view\"\n [placeholder]=\"field.placeholder\"\n inputStyleClass=\"mousetrap\"\n [appendTo]=\"field.appendTo\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event): null\"\n (onSelect)=\"field.onSelect ? field.onSelect($event) : null\"\n (onClose)=\"field.onClose ? field.onClose($event) : null\"\n (onTodayClick)=\"field.onTodayClick ? field.onTodayClick($event) : null\"\n (onClearClick)=\"field.onClearClick ? field.onClearClick($event) : null\"\n (onMonthChange)=\"field.onMonthChange ? field.onMonthChange($event) : null\"\n (onYearChange)=\"field.onYearChange ? field.onYearChange($event) : null\"\n [showTransitionOptions]=\"'0ms'\"\n [hideTransitionOptions]=\"'0ms'\"\n ></p-calendar>\n</div>\n"
4554
+ template: "<div [pTooltip]=\"field.tooltip\" tooltipPosition=\"top\" [showDelay]=\"500\" [appendTo]=\"field.appendTo || 'body'\">\n <!-- Remover as propriedades [showTransitionOptions] e [hideTransitionOptions] quando atualizar para o PrimeNG v10, esses atributos foram\n usados para remover um bug ocasionado pela anima\u00E7\u00E3o do componente p-calendar, bug explicado nas issues: #ERPROM-5534, #ERPROM-8248 e #DSN-1045. -->\n \n <p-calendar\n #calendar\n sCalendarMask\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [showIcon]=\"true\"\n [timeOnly]=\"timeOnly\"\n [selectionMode]=\"field.selectionMode\"\n [rangeSeparator]=\"field.rangeSeparator\"\n [showTime]=\"showTime\"\n [showSeconds]=\"field.showSeconds\"\n [showOnFocus]=\"field.showOnFocus\"\n [formControl]=\"formControl\"\n icon=\"fa fa-calendar\"\n [minDate]=\"field.minDate\"\n [maxDate]=\"field.maxDate\"\n [locale]=\"field.calendarLocaleOptions\"\n [dateFormat]=\"field.calendarLocaleOptions.dateFormat\"\n [hourFormat]=\"field.calendarLocaleOptions.hourFormat\"\n [view]=\"field.view\"\n [placeholder]=\"field.placeholder\"\n inputStyleClass=\"mousetrap\"\n [appendTo]=\"field.appendTo\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event): null\"\n (onSelect)=\"field.onSelect ? field.onSelect($event) : null\"\n (onClose)=\"field.onClose ? field.onClose($event) : null\"\n (onTodayClick)=\"field.onTodayClick ? field.onTodayClick($event) : null\"\n (onClearClick)=\"field.onClearClick ? field.onClearClick($event) : null\"\n (onMonthChange)=\"field.onMonthChange ? field.onMonthChange($event) : null\"\n (onYearChange)=\"field.onYearChange ? field.onYearChange($event) : null\"\n [showTransitionOptions]=\"'0ms'\"\n [hideTransitionOptions]=\"'0ms'\"\n ></p-calendar>\n</div>\n"
4538
4555
  })
4539
4556
  ], CalendarFieldComponent);
4540
4557
  return CalendarFieldComponent;
@@ -5051,16 +5068,9 @@ var DynamicField = /** @class */ (function (_super) {
5051
5068
  DynamicField.prototype.setVariablesByType = function (component) {
5052
5069
  switch (this.field.type) {
5053
5070
  case FieldType.DateTime:
5054
- component.instance.showTime = true;
5055
- component.instance.showSeconds = true;
5056
- break;
5057
5071
  case FieldType.LocalDateTime:
5058
- component.instance.showTime = true;
5059
- component.instance.showSeconds = true;
5060
- break;
5061
5072
  case FieldType.Time:
5062
- component.instance.timeOnly = true;
5063
- component.instance.showSeconds = true;
5073
+ component.instance.showTime = true;
5064
5074
  break;
5065
5075
  }
5066
5076
  };