@seniorsistemas/angular-components 16.3.9 → 16.4.0

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 (31) hide show
  1. package/bundles/seniorsistemas-angular-components.umd.js +86 -18
  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/progressbar/index.d.ts +3 -0
  6. package/components/progressbar/models/index.d.ts +1 -0
  7. package/components/progressbar/models/progressbar-colors.d.ts +6 -0
  8. package/components/progressbar/progressbar.component.d.ts +11 -0
  9. package/components/progressbar/progressbar.module.d.ts +2 -0
  10. package/components/table/table-paging/table-paging.component.d.ts +4 -3
  11. package/esm2015/components/progressbar/index.js +4 -0
  12. package/esm2015/components/progressbar/models/index.js +2 -0
  13. package/esm2015/components/progressbar/models/progressbar-colors.js +8 -0
  14. package/esm2015/components/progressbar/progressbar.component.js +42 -0
  15. package/esm2015/components/progressbar/progressbar.module.js +15 -0
  16. package/esm2015/components/table/table-paging/table-paging.component.js +25 -17
  17. package/esm2015/public-api.js +2 -1
  18. package/esm5/components/progressbar/index.js +4 -0
  19. package/esm5/components/progressbar/models/index.js +2 -0
  20. package/esm5/components/progressbar/models/progressbar-colors.js +8 -0
  21. package/esm5/components/progressbar/progressbar.component.js +43 -0
  22. package/esm5/components/progressbar/progressbar.module.js +18 -0
  23. package/esm5/components/table/table-paging/table-paging.component.js +24 -19
  24. package/esm5/public-api.js +2 -1
  25. package/fesm2015/seniorsistemas-angular-components.js +84 -19
  26. package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
  27. package/fesm5/seniorsistemas-angular-components.js +87 -21
  28. package/fesm5/seniorsistemas-angular-components.js.map +1 -1
  29. package/package.json +1 -1
  30. package/public-api.d.ts +1 -0
  31. package/seniorsistemas-angular-components.metadata.json +1 -1
@@ -35,7 +35,7 @@ import { MultiSelectModule } from 'primeng/multiselect';
35
35
  import { InputSwitchModule } from 'primeng/inputswitch';
36
36
  import { PanelModule } from 'primeng/panel';
37
37
  import { RadioButtonModule } from 'primeng/radiobutton';
38
- import { ProgressBarModule } from 'primeng/progressbar';
38
+ import { ProgressBarModule as ProgressBarModule$1 } from 'primeng/progressbar';
39
39
  import { DomSanitizer } from '@angular/platform-browser';
40
40
  import { TranslateService, TranslateModule } from '@ngx-translate/core';
41
41
  import Cropper from 'cropperjs';
@@ -3120,7 +3120,7 @@ var FileUploadModule = /** @class */ (function () {
3120
3120
  CommonModule,
3121
3121
  ButtonModule,
3122
3122
  TooltipModule$1,
3123
- ProgressBarModule,
3123
+ ProgressBarModule$1,
3124
3124
  ],
3125
3125
  exports: [FileUploadComponent],
3126
3126
  })
@@ -4966,19 +4966,19 @@ var TablePagingComponent = /** @class */ (function () {
4966
4966
  TablePagingComponent.prototype.getSelectedRowsToExport = function (columns) {
4967
4967
  return this.mapColumnsTranslations(columns, this.table.selection);
4968
4968
  };
4969
- TablePagingComponent.prototype.getInnerPropValue = function (obj, path) {
4969
+ TablePagingComponent.prototype.getPropertyValue = function (obj, path) {
4970
4970
  return path.split(".").reduce(function (result, prop) { return (result[prop] === undefined ? undefined : result[prop]); }, obj);
4971
4971
  };
4972
- TablePagingComponent.prototype.setInnerPropValue = function (obj, path, value) {
4973
- this.recursionSet(obj, path.split("."), value);
4972
+ TablePagingComponent.prototype.setPropertyValue = function (obj, path, value) {
4973
+ this.recursionSetValue(obj, path.split("."), value);
4974
4974
  };
4975
- TablePagingComponent.prototype.recursionSet = function (obj, keysList, value) {
4975
+ TablePagingComponent.prototype.recursionSetValue = function (obj, keysList, value) {
4976
4976
  var key = keysList[0];
4977
4977
  if (keysList.length === 1) {
4978
4978
  obj[key] = value;
4979
4979
  return obj;
4980
4980
  }
4981
- obj[key] = (this.recursionSet((obj === null || obj === void 0 ? void 0 : obj[key]) || {}, keysList.slice(1), value));
4981
+ obj[key] = (this.recursionSetValue((obj === null || obj === void 0 ? void 0 : obj[key]) || {}, keysList.slice(1), value));
4982
4982
  return obj;
4983
4983
  };
4984
4984
  TablePagingComponent.prototype.mapColumnsTranslations = function (columns, rows) {
@@ -4989,37 +4989,42 @@ var TablePagingComponent = /** @class */ (function () {
4989
4989
  }
4990
4990
  return __spread(rows).map(function (row) {
4991
4991
  var newRow = __assign({}, row);
4992
- var _loop_1 = function (i) {
4993
- var column = enumColumns[i];
4994
- var fields = column.field;
4995
- if (!Array.isArray(fields)) {
4996
- fields = [fields];
4997
- }
4992
+ enumColumns.forEach(function (column) {
4993
+ var fields = !Array.isArray(column.field) ? [column.field] : column.field;
4998
4994
  fields.forEach(function (fieldName) {
4999
- var columnData = _this.getInnerPropValue(row, fieldName);
4995
+ var columnData = _this.getPropertyValue(row, fieldName);
5000
4996
  if (columnData === null || columnData === undefined) {
5001
4997
  return;
5002
4998
  }
5003
4999
  var newValue = _this.translateValue(column, columnData);
5004
- _this.setInnerPropValue(newRow, fieldName, newValue);
5000
+ _this.setPropertyValue(newRow, fieldName, newValue);
5005
5001
  });
5006
- };
5007
- for (var i = 0; i <= enumColumns.length - 1; i++) {
5008
- _loop_1(i);
5009
- }
5002
+ });
5010
5003
  return newRow;
5011
5004
  });
5012
5005
  };
5013
5006
  TablePagingComponent.prototype.translateValue = function (column, columnData) {
5007
+ // Default usage: ENUM_VALUE -> domain.service.enum_value
5014
5008
  var enumValue = columnData.toString().toLowerCase();
5015
5009
  var translationKey = column.enumPrefix + enumValue;
5016
5010
  var translatedValue = this.translate.instant(translationKey);
5011
+ // Custom usage 1: V9 -> domain.service.v_9
5017
5012
  if (translationKey === translatedValue && enumValue.length > 1) {
5018
5013
  translationKey = "" + column.enumPrefix + enumValue.substring(0, 1) + "_" + enumValue.substr(1);
5019
- return this.translate.instant(translationKey);
5014
+ translatedValue = this.translate.instant(translationKey);
5015
+ }
5016
+ // Custom usage 2: EnumValue -> domain.service.enum_value
5017
+ if (translationKey === translatedValue) {
5018
+ var enumKey = this.convertToSnakeCase(columnData.toString());
5019
+ translationKey = "" + column.enumPrefix + enumKey;
5020
+ translatedValue = this.translate.instant(translationKey);
5020
5021
  }
5021
5022
  return translatedValue;
5022
5023
  };
5024
+ TablePagingComponent.prototype.convertToSnakeCase = function (str) {
5025
+ return str.replace(/([A-Z])/g, function (match, group) { return "_" + group.toLowerCase(); })
5026
+ .replace(/^_/, '');
5027
+ };
5023
5028
  TablePagingComponent.prototype.getExportFileName = function () {
5024
5029
  var _a;
5025
5030
  var fileName = (_a = this.exportFileName) !== null && _a !== void 0 ? _a : "download";
@@ -10394,9 +10399,70 @@ var CodeEditorModule = /** @class */ (function () {
10394
10399
  return CodeEditorModule;
10395
10400
  }());
10396
10401
 
10402
+ var ProgressBarComponent = /** @class */ (function () {
10403
+ function ProgressBarComponent() {
10404
+ this.showValue = true;
10405
+ }
10406
+ ProgressBarComponent.prototype.ngOnInit = function () {
10407
+ this.validateValues();
10408
+ };
10409
+ ProgressBarComponent.prototype.validateValues = function () {
10410
+ if (this.value < 0 || this.value > 100) {
10411
+ throw new Error("Invalid value for value");
10412
+ }
10413
+ if (this.targetValue < 0 || this.targetValue > 100) {
10414
+ throw new Error("Invalid value for targetValue");
10415
+ }
10416
+ };
10417
+ __decorate([
10418
+ Input()
10419
+ ], ProgressBarComponent.prototype, "value", void 0);
10420
+ __decorate([
10421
+ Input()
10422
+ ], ProgressBarComponent.prototype, "targetValue", void 0);
10423
+ __decorate([
10424
+ Input()
10425
+ ], ProgressBarComponent.prototype, "targetLabel", void 0);
10426
+ __decorate([
10427
+ Input()
10428
+ ], ProgressBarComponent.prototype, "activeColor", void 0);
10429
+ __decorate([
10430
+ Input()
10431
+ ], ProgressBarComponent.prototype, "showValue", void 0);
10432
+ ProgressBarComponent = __decorate([
10433
+ Component({
10434
+ selector: "s-progressbar",
10435
+ template: "<div class=\"progress-bar\">\n <div class=\"progress-bar-all\">\n <div\n class=\"progress-bar-active\"\n [ngClass]=\"{\n 'progress-bar-active--blue' : activeColor == 'blue',\n 'progress-bar-active--green': activeColor == 'green',\n 'progress-bar-active--red': activeColor == 'red',\n 'progress-bar-active--yellow': activeColor == 'yellow'\n }\"\n [ngStyle]=\"{ 'width': value + '%' }\">\n {{ showValue && value ? value + '%' : '' }}\n </div>\n </div>\n <div\n *ngIf=\"targetValue\"\n class=\"target\"\n [ngStyle]=\"{\n 'left': targetValue <= 50 ? targetValue + '%' : 'unset',\n 'right': targetValue > 50 ? 100 - targetValue + '%' : 'unset',\n 'align-items': targetValue > 50 ? 'flex-end' : 'flex-start'\n }\">\n <span class=\"target-line\"></span>\n <span class=\"target-label\">\n {{ targetLabel || value + '%' }}\n </span>\n </div>\n</div>\n",
10436
+ styles: [".progress-bar{position:relative}.progress-bar .progress-bar-all{background-color:#d8d8d8;border-radius:4px;height:24px;overflow:hidden;width:100%}.progress-bar .progress-bar-all .progress-bar-active{-ms-flex-align:center;align-items:center;color:#fff;display:-ms-flexbox;display:flex;font-family:\"Open Sans\",sans-serif;font-size:14px;height:100%;-ms-flex-pack:center;justify-content:center;line-height:150%;width:80%}.progress-bar .progress-bar-all .progress-bar-active--blue{background-color:#428bca}.progress-bar .progress-bar-all .progress-bar-active--green{background-color:#0c9348}.progress-bar .progress-bar-all .progress-bar-active--red{background-color:#c13018}.progress-bar .progress-bar-all .progress-bar-active--yellow{background-color:#fcbf10}.progress-bar .target{-ms-flex-align:start;align-items:flex-start;bottom:-38px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:absolute}.progress-bar .target .target-line{background-color:#333;height:40px;margin:8px 0;width:1px}.progress-bar .target .target-label{background-color:#426e78;border-radius:10px;color:#e5eaea;font-family:\"Open Sans\",sans-serif;font-size:12px;line-height:150%;padding:2px 12px}"]
10437
+ })
10438
+ ], ProgressBarComponent);
10439
+ return ProgressBarComponent;
10440
+ }());
10441
+
10442
+ var ProgressBarModule = /** @class */ (function () {
10443
+ function ProgressBarModule() {
10444
+ }
10445
+ ProgressBarModule = __decorate([
10446
+ NgModule({
10447
+ imports: [CommonModule],
10448
+ declarations: [ProgressBarComponent],
10449
+ exports: [ProgressBarComponent],
10450
+ })
10451
+ ], ProgressBarModule);
10452
+ return ProgressBarModule;
10453
+ }());
10454
+
10455
+ var ProgressBarColors;
10456
+ (function (ProgressBarColors) {
10457
+ ProgressBarColors["Blue"] = "blue";
10458
+ ProgressBarColors["Green"] = "green";
10459
+ ProgressBarColors["Red"] = "red";
10460
+ ProgressBarColors["Yellow"] = "yellow";
10461
+ })(ProgressBarColors || (ProgressBarColors = {}));
10462
+
10397
10463
  /**
10398
10464
  * Generated bundle index. Do not edit.
10399
10465
  */
10400
10466
 
10401
- export { AngularComponentsModule, AutocompleteField, BaseFieldComponent, BignumberField, BignumberInputDirective, BignumberInputModule, BooleanField, BooleanOptionsLabel, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ButtonComponent, ButtonModule, ButtonPriority, ButtonSize, CalendarField, CalendarLocaleOptions, CalendarMaskDirective, CalendarMaskModule, ChipsField, CodeEditorModule, CollapseLinkComponent, CollapseLinkModule, ControlErrorsComponent, ControlErrorsModule, CurrencyField, CustomFieldsComponent, CustomFieldsModule, CustomFieldsService, DEFAULT_CALENDAR_LOCALE_OPTIONS, DEFAULT_LOCALE_OPTIONS, DEFAULT_NUMBER_LOCALE_OPTIONS, DoubleClickDirective, DynamicConfig, DynamicFormComponent, DynamicFormModule, DynamicType, EditableOverlayDirective, EditableOverlayModule, EmptyStateComponent, EmptyStateModule, EnumBadgeColors, EnumColumnFieldType, ExportUtils, Field, FieldType, Fieldset, FileUploadComponent, FileUploadModule, FileValidation, FormField, GlobalSearchComponent, GlobalSearchDropdownItemComponent, GlobalSearchModule, GlobalSearchSizeEnum, HostProjectConfigsInjectionToken, ImageCropperComponent, ImageCropperModule, ImageCropperService, InfoSignDirective, InfoSignModule, Languages, LoadingStateComponent, LoadingStateDirective, LoadingStateModule, LocaleModule, LocaleOptions, LocaleService, LocalizedCurrencyPipe, LocalizedCurrencyPipeOptions, LocalizedDateImpurePipe, LocalizedDatePipe, LocalizedNumberInputDirective, LocalizedNumberInputModule, LocalizedNumberPipe, LocalizedTimeImpurePipe, LocalizedTimePipe, LongPressDirective, LookupComponent, LookupField, MaskFormatterModule, MaskFormatterPipe, MouseEventsModule, NavigationDirective, NumberAlignmentOption, NumberField, NumberInputDirective, NumberInputModule, NumberLocaleOptions, ObjectCardComponent, ObjectCardFieldComponent, ObjectCardMainComponent, ObjectCardModule, Option, ProductHeaderComponent, ProductHeaderModule, ProfilePicturePickerComponent, ProfilePicturePickerModule, RadioButtonField, RationButtonOption, RowTogllerDirective, Section, SelectField, SelectOption, SidebarComponent, SidebarModule, StatsCardComponent, StatsCardModule, StepState, StepsComponent, StepsModule, Structure, TableFrozenPositionDirective, TableHeaderCheckboxComponent, TableHeaderCheckboxModule, TableModule, TaxCalculationLanguageConfigs, TextAreaField, TextField, Themes, ThumbnailComponent, ThumbnailModule, ThumbnailSize, TileComponent, TileModule, TimelineComponent, TimelineItem, TimelineItemSeverity, TimelineItemSize, TimelineModule, TokenListComponent, TokenListModule, TooltipModule, TooltipPosition, ValidateErrors, LocalizedCurrencyImpurePipe as ɵa, LocalizedBignumberPipe as ɵb, TextAreaFieldComponent as ɵba, TextFieldComponent as ɵbb, BooleanSwitchFieldComponent as ɵbc, DecimalField as ɵbe, StructureModule as ɵbf, HeaderComponent as ɵbg, FooterComponent as ɵbh, NumberLocaleOptions as ɵbi, ThumbnailService as ɵbj, TimelineItemModule as ɵbk, TimelineIconItemComponent as ɵbl, HorizontalTimelineModule as ɵbm, HorizontalTimelineComponent as ɵbn, VerticalTimelineModule as ɵbo, VerticalTimelineComponent as ɵbp, RangeLineComponent as ɵbq, CollapseOptionComponent as ɵbr, CollapsedItemsComponent as ɵbs, VerticalItemsComponent as ɵbt, InfiniteScrollModule as ɵbu, InfiniteScrollDirective as ɵbv, CustomTranslationsModule as ɵbw, CodeEditorComponent as ɵbx, CoreFacade as ɵby, CodeMirror6Core as ɵbz, LocalizedBignumberImpurePipe as ɵc, TooltipModule as ɵd, TooltipComponent as ɵe, TooltipDirective as ɵf, EmptyStateGoBackComponent as ɵg, InfoSignComponent as ɵh, TableColumnsComponent as ɵi, TablePagingComponent as ɵj, AutocompleteFieldComponent as ɵk, BooleanFieldComponent as ɵl, CalendarFieldComponent as ɵm, ChipsFieldComponent as ɵn, CurrencyFieldComponent as ɵo, DynamicFieldComponent as ɵp, DynamicFormDirective as ɵq, FieldsetComponent as ɵr, FileUploadComponent$1 as ɵs, LookupFieldComponent as ɵt, NumberFieldComponent as ɵu, BignumberFieldComponent as ɵv, RadioButtonComponent as ɵw, RowComponent as ɵx, SectionComponent as ɵy, SelectFieldComponent as ɵz };
10467
+ export { AngularComponentsModule, AutocompleteField, BaseFieldComponent, BignumberField, BignumberInputDirective, BignumberInputModule, BooleanField, BooleanOptionsLabel, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ButtonComponent, ButtonModule, ButtonPriority, ButtonSize, CalendarField, CalendarLocaleOptions, CalendarMaskDirective, CalendarMaskModule, ChipsField, CodeEditorModule, CollapseLinkComponent, CollapseLinkModule, ControlErrorsComponent, ControlErrorsModule, CurrencyField, CustomFieldsComponent, CustomFieldsModule, CustomFieldsService, DEFAULT_CALENDAR_LOCALE_OPTIONS, DEFAULT_LOCALE_OPTIONS, DEFAULT_NUMBER_LOCALE_OPTIONS, DoubleClickDirective, DynamicConfig, DynamicFormComponent, DynamicFormModule, DynamicType, EditableOverlayDirective, EditableOverlayModule, EmptyStateComponent, EmptyStateModule, EnumBadgeColors, EnumColumnFieldType, ExportUtils, Field, FieldType, Fieldset, FileUploadComponent, FileUploadModule, FileValidation, FormField, GlobalSearchComponent, GlobalSearchDropdownItemComponent, GlobalSearchModule, GlobalSearchSizeEnum, HostProjectConfigsInjectionToken, ImageCropperComponent, ImageCropperModule, ImageCropperService, InfoSignDirective, InfoSignModule, Languages, LoadingStateComponent, LoadingStateDirective, LoadingStateModule, LocaleModule, LocaleOptions, LocaleService, LocalizedCurrencyPipe, LocalizedCurrencyPipeOptions, LocalizedDateImpurePipe, LocalizedDatePipe, LocalizedNumberInputDirective, LocalizedNumberInputModule, LocalizedNumberPipe, LocalizedTimeImpurePipe, LocalizedTimePipe, LongPressDirective, LookupComponent, LookupField, MaskFormatterModule, MaskFormatterPipe, MouseEventsModule, NavigationDirective, NumberAlignmentOption, NumberField, NumberInputDirective, NumberInputModule, NumberLocaleOptions, ObjectCardComponent, ObjectCardFieldComponent, ObjectCardMainComponent, ObjectCardModule, Option, ProductHeaderComponent, ProductHeaderModule, ProfilePicturePickerComponent, ProfilePicturePickerModule, ProgressBarColors, ProgressBarComponent, ProgressBarModule, RadioButtonField, RationButtonOption, RowTogllerDirective, Section, SelectField, SelectOption, SidebarComponent, SidebarModule, StatsCardComponent, StatsCardModule, StepState, StepsComponent, StepsModule, Structure, TableFrozenPositionDirective, TableHeaderCheckboxComponent, TableHeaderCheckboxModule, TableModule, TaxCalculationLanguageConfigs, TextAreaField, TextField, Themes, ThumbnailComponent, ThumbnailModule, ThumbnailSize, TileComponent, TileModule, TimelineComponent, TimelineItem, TimelineItemSeverity, TimelineItemSize, TimelineModule, TokenListComponent, TokenListModule, TooltipModule, TooltipPosition, ValidateErrors, LocalizedCurrencyImpurePipe as ɵa, LocalizedBignumberPipe as ɵb, TextAreaFieldComponent as ɵba, TextFieldComponent as ɵbb, BooleanSwitchFieldComponent as ɵbc, DecimalField as ɵbe, StructureModule as ɵbf, HeaderComponent as ɵbg, FooterComponent as ɵbh, NumberLocaleOptions as ɵbi, ThumbnailService as ɵbj, TimelineItemModule as ɵbk, TimelineIconItemComponent as ɵbl, HorizontalTimelineModule as ɵbm, HorizontalTimelineComponent as ɵbn, VerticalTimelineModule as ɵbo, VerticalTimelineComponent as ɵbp, RangeLineComponent as ɵbq, CollapseOptionComponent as ɵbr, CollapsedItemsComponent as ɵbs, VerticalItemsComponent as ɵbt, InfiniteScrollModule as ɵbu, InfiniteScrollDirective as ɵbv, CustomTranslationsModule as ɵbw, CodeEditorComponent as ɵbx, CoreFacade as ɵby, CodeMirror6Core as ɵbz, LocalizedBignumberImpurePipe as ɵc, TooltipModule as ɵd, TooltipComponent as ɵe, TooltipDirective as ɵf, EmptyStateGoBackComponent as ɵg, InfoSignComponent as ɵh, TableColumnsComponent as ɵi, TablePagingComponent as ɵj, AutocompleteFieldComponent as ɵk, BooleanFieldComponent as ɵl, CalendarFieldComponent as ɵm, ChipsFieldComponent as ɵn, CurrencyFieldComponent as ɵo, DynamicFieldComponent as ɵp, DynamicFormDirective as ɵq, FieldsetComponent as ɵr, FileUploadComponent$1 as ɵs, LookupFieldComponent as ɵt, NumberFieldComponent as ɵu, BignumberFieldComponent as ɵv, RadioButtonComponent as ɵw, RowComponent as ɵx, SectionComponent as ɵy, SelectFieldComponent as ɵz };
10402
10468
  //# sourceMappingURL=seniorsistemas-angular-components.js.map