@seniorsistemas/angular-components 16.12.3 → 16.13.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 +133 -32
  2. package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
  3. package/bundles/seniorsistemas-angular-components.umd.min.js +2 -2
  4. package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
  5. package/components/custom-fields/custom-fields.component.d.ts +9 -4
  6. package/components/rating-scale/index.d.ts +3 -0
  7. package/components/rating-scale/models/index.d.ts +1 -0
  8. package/components/rating-scale/models/rating-scale-node.d.ts +5 -0
  9. package/components/rating-scale/rating-scale.component.d.ts +15 -0
  10. package/components/rating-scale/rating-scale.module.d.ts +2 -0
  11. package/esm2015/components/custom-fields/custom-fields.component.js +54 -32
  12. package/esm2015/components/rating-scale/index.js +3 -0
  13. package/esm2015/components/rating-scale/models/index.js +1 -0
  14. package/esm2015/components/rating-scale/models/rating-scale-node.js +1 -0
  15. package/esm2015/components/rating-scale/rating-scale.component.js +52 -0
  16. package/esm2015/components/rating-scale/rating-scale.module.js +19 -0
  17. package/esm2015/public-api.js +2 -1
  18. package/esm5/components/custom-fields/custom-fields.component.js +67 -34
  19. package/esm5/components/rating-scale/index.js +3 -0
  20. package/esm5/components/rating-scale/models/index.js +1 -0
  21. package/esm5/components/rating-scale/models/rating-scale-node.js +1 -0
  22. package/esm5/components/rating-scale/rating-scale.component.js +54 -0
  23. package/esm5/components/rating-scale/rating-scale.module.js +22 -0
  24. package/esm5/public-api.js +2 -1
  25. package/fesm2015/seniorsistemas-angular-components.js +115 -32
  26. package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
  27. package/fesm5/seniorsistemas-angular-components.js +132 -33
  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
@@ -7369,37 +7369,6 @@ let CustomFieldsComponent = CustomFieldsComponent_1 = class CustomFieldsComponen
7369
7369
  get parentControl() {
7370
7370
  return this.parentForm.get("custom");
7371
7371
  }
7372
- registerOnChange(fn) {
7373
- this.onChange = fn;
7374
- this.formGroup.valueChanges.subscribe(() => this.onChange(this.parseFieldsValues()));
7375
- }
7376
- registerOnTouched(fn) {
7377
- this.onTouched = fn;
7378
- }
7379
- writeValue(value) {
7380
- if (this.ready) {
7381
- const newValue = this.parseValuesForFields(value);
7382
- this.formGroup.patchValue(newValue);
7383
- this.value = newValue;
7384
- this.createFilesIfSetFormValuesAfterInit();
7385
- }
7386
- else {
7387
- this.formGroup.patchValue(value || {});
7388
- this.value = value;
7389
- }
7390
- }
7391
- setDisabledState(isDisabled) {
7392
- if (isDisabled)
7393
- this.formGroup.disable({ emitEvent: false });
7394
- else
7395
- this.formGroup.enable({ emitEvent: false });
7396
- }
7397
- getCustomFields() {
7398
- if (this.entityObject && this.entityObject.entity_) {
7399
- return of(this.entityObject);
7400
- }
7401
- return this.customFieldsService.getCustomFields(this.domain, this.service, this.entity, this.customFieldsEndpoint);
7402
- }
7403
7372
  ngOnInit() {
7404
7373
  if (!this.domain)
7405
7374
  throw new Error("You need to specify the custom-fields domain!");
@@ -7471,10 +7440,49 @@ let CustomFieldsComponent = CustomFieldsComponent_1 = class CustomFieldsComponen
7471
7440
  this.ready = true;
7472
7441
  });
7473
7442
  }
7443
+ ngAfterViewInit() {
7444
+ this.enableOrDisableFields(this.disableFields);
7445
+ }
7446
+ ngOnChanges(changes) {
7447
+ if (changes.disableFields) {
7448
+ this.enableOrDisableFields(changes.disableFields.currentValue);
7449
+ }
7450
+ }
7474
7451
  ngOnDestroy() {
7475
7452
  this.ngUsubscribe.next();
7476
7453
  this.ngUsubscribe.complete();
7477
7454
  }
7455
+ registerOnChange(fn) {
7456
+ this.onChange = fn;
7457
+ this.formGroup.valueChanges.subscribe(() => this.onChange(this.parseFieldsValues()));
7458
+ }
7459
+ registerOnTouched(fn) {
7460
+ this.onTouched = fn;
7461
+ }
7462
+ writeValue(value) {
7463
+ if (this.ready) {
7464
+ const newValue = this.parseValuesForFields(value);
7465
+ this.formGroup.patchValue(newValue);
7466
+ this.value = newValue;
7467
+ this.createFilesIfSetFormValuesAfterInit();
7468
+ }
7469
+ else {
7470
+ this.formGroup.patchValue(value || {});
7471
+ this.value = value;
7472
+ }
7473
+ }
7474
+ setDisabledState(isDisabled) {
7475
+ if (isDisabled)
7476
+ this.formGroup.disable({ emitEvent: false });
7477
+ else
7478
+ this.formGroup.enable({ emitEvent: false });
7479
+ }
7480
+ getCustomFields() {
7481
+ if (this.entityObject && this.entityObject.entity_) {
7482
+ return of(this.entityObject);
7483
+ }
7484
+ return this.customFieldsService.getCustomFields(this.domain, this.service, this.entity, this.customFieldsEndpoint);
7485
+ }
7478
7486
  validate() {
7479
7487
  const errors = {};
7480
7488
  Object.keys(this.formGroup.controls).forEach(field => {
@@ -7484,6 +7492,17 @@ let CustomFieldsComponent = CustomFieldsComponent_1 = class CustomFieldsComponen
7484
7492
  });
7485
7493
  return errors;
7486
7494
  }
7495
+ enableOrDisableFields(disabled) {
7496
+ if (!this.formGroup) {
7497
+ return;
7498
+ }
7499
+ for (const controlName of Object.keys(this.formGroup.value)) {
7500
+ disabled ? this.formGroup.get(controlName).disable() : this.formGroup.get(controlName).enable();
7501
+ }
7502
+ }
7503
+ cleanFields() {
7504
+ this.formGroup.reset();
7505
+ }
7487
7506
  parseValuesForFields(values) {
7488
7507
  const parsedValues = Object.assign({}, values);
7489
7508
  this.fields.forEach(field => {
@@ -7860,6 +7879,9 @@ __decorate([
7860
7879
  __decorate([
7861
7880
  Input()
7862
7881
  ], CustomFieldsComponent.prototype, "ready$", void 0);
7882
+ __decorate([
7883
+ Input()
7884
+ ], CustomFieldsComponent.prototype, "disableFields", void 0);
7863
7885
  CustomFieldsComponent = CustomFieldsComponent_1 = __decorate([
7864
7886
  Component({
7865
7887
  selector: "s-custom-fields",
@@ -11533,6 +11555,67 @@ var ProgressBarColors;
11533
11555
  ProgressBarColors["Yellow"] = "yellow";
11534
11556
  })(ProgressBarColors || (ProgressBarColors = {}));
11535
11557
 
11558
+ var RatingScaleComponent_1;
11559
+ let RatingScaleComponent = RatingScaleComponent_1 = class RatingScaleComponent {
11560
+ constructor() {
11561
+ this.disabled = false;
11562
+ }
11563
+ writeValue(value) {
11564
+ if (!this.disabled) {
11565
+ this.value = value;
11566
+ }
11567
+ }
11568
+ registerOnChange(onChange) {
11569
+ this._onChange = onChange;
11570
+ }
11571
+ registerOnTouched(onTouched) {
11572
+ this._onTouched = onTouched;
11573
+ }
11574
+ onSelect(rating) {
11575
+ this.value = rating;
11576
+ if (this._onChange) {
11577
+ this._onChange(this.value);
11578
+ }
11579
+ }
11580
+ };
11581
+ __decorate([
11582
+ Input()
11583
+ ], RatingScaleComponent.prototype, "nodes", void 0);
11584
+ __decorate([
11585
+ Input()
11586
+ ], RatingScaleComponent.prototype, "startLabel", void 0);
11587
+ __decorate([
11588
+ Input()
11589
+ ], RatingScaleComponent.prototype, "endLabel", void 0);
11590
+ __decorate([
11591
+ Input()
11592
+ ], RatingScaleComponent.prototype, "disabled", void 0);
11593
+ RatingScaleComponent = RatingScaleComponent_1 = __decorate([
11594
+ Component({
11595
+ selector: "s-rating-scale",
11596
+ template: "<div\n class=\"rating-scale\"\n [ngClass]=\"{ 'rating-scale--disabled': disabled }\">\n <div class=\"nodes\">\n <button\n *ngFor=\"let node of nodes; index as i\"\n class=\"node\"\n [ngClass]=\"{ 'node--selected': value?.id === node.id && !disabled }\"\n tabindex=\"0\"\n (click)=\"onSelect(node)\"> \n <span\n *ngIf=\"node.icon\"\n class=\"icon fas\"\n [ngClass]=\"node.icon\">\n </span>\n <span\n *ngIf=\"node.title\"\n class=\"label\">\n {{ node.title }}\n </span>\n </button>\n </div>\n <div class=\"labels\">\n <span>{{ startLabel }}</span>\n <span>{{ endLabel }}</span>\n </div>\n</div>",
11597
+ providers: [{
11598
+ provide: NG_VALUE_ACCESSOR,
11599
+ useExisting: forwardRef(() => RatingScaleComponent_1),
11600
+ multi: true,
11601
+ }],
11602
+ styles: [".rating-scale{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.rating-scale .nodes{display:-ms-flexbox;display:flex}.rating-scale .nodes .node{-ms-flex-align:center;align-items:center;background-color:#fff;border-radius:6px;display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-pack:center;justify-content:center;margin:0 2px;padding:8px;border:1px solid #7892a1}.rating-scale .nodes .node .icon{color:#6e7280;font-size:1rem}.rating-scale .nodes .node .label{color:#212533;font-size:.875rem;font-weight:400;line-height:150%}.rating-scale .nodes .node .icon,.rating-scale .nodes .node .label{margin:6px}.rating-scale .nodes .node--selected{background-color:#d5e8ec;border-color:#428bca;color:#428bca}.rating-scale .nodes .node:first-child{margin-left:0}.rating-scale .nodes .node:last-child{margin-right:0}.rating-scale .labels{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:12px 0}.rating-scale .labels span{color:#080808;font-family:\"Open Sans\" sans-serif;font-size:.875rem;font-weight:400;line-height:150%}.rating-scale--disabled{opacity:.5}.rating-scale:not(.rating-scale--disabled) .node{cursor:pointer}.rating-scale:not(.rating-scale--disabled) .node:hover{background-color:#dedce5}.rating-scale:not(.rating-scale--disabled) .node:focus{border-width:2px;outline:0}"]
11603
+ })
11604
+ ], RatingScaleComponent);
11605
+
11606
+ let RatingScaleModule = class RatingScaleModule {
11607
+ };
11608
+ RatingScaleModule = __decorate([
11609
+ NgModule({
11610
+ imports: [
11611
+ CommonModule,
11612
+ ReactiveFormsModule,
11613
+ ],
11614
+ declarations: [RatingScaleComponent],
11615
+ exports: [RatingScaleComponent],
11616
+ })
11617
+ ], RatingScaleModule);
11618
+
11536
11619
  var SplitButtonType;
11537
11620
  (function (SplitButtonType) {
11538
11621
  SplitButtonType["Primary"] = "primary";
@@ -11907,5 +11990,5 @@ const fallback = {
11907
11990
  * Generated bundle index. Do not edit.
11908
11991
  */
11909
11992
 
11910
- export { AccordionComponent, AccordionModule, AccordionPanelComponent, AngularComponentsModule, AutocompleteField, BadgeColors, BadgeComponent, BadgeModule, BaseFieldComponent, BignumberField, BignumberInputDirective, BignumberInputModule, BooleanField, BooleanOptionsLabel, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ButtonComponent, ButtonModule, ButtonPriority, ButtonSize, CalendarField, CalendarLocaleOptions, CalendarMaskDirective, CalendarMaskModule, ChipsField, CodeEditorModule, CollapseLinkComponent, CollapseLinkModule, ControlErrorsComponent, ControlErrorsModule, CountryPhonePickerComponent, CountryPhonePickerModule, CurrencyField, CustomFieldsComponent, CustomFieldsModule, CustomFieldsService, DEFAULT_CALENDAR_LOCALE_OPTIONS, DEFAULT_LOCALE_OPTIONS, DEFAULT_NUMBER_LOCALE_OPTIONS, DebounceUtils, DoubleClickDirective, DynamicConfig, DynamicFormComponent, DynamicFormModule, DynamicType, EditableOverlayDirective, EditableOverlayModule, EmptyStateComponent, EmptyStateModule, EnumBadgeColors, EnumColumnFieldType, EnumSeverity, 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, Ordination, PanelComponent, PanelModule, PasswordField, PasswordStrengthComponent, PasswordStrengthDirective, PasswordStrengthModule, PasswordStrengthPositions, PasswordStrengths, ProductHeaderComponent, ProductHeaderModule, ProfilePicturePickerComponent, ProfilePicturePickerModule, ProgressBarColors, ProgressBarComponent, ProgressBarModule, RadioButtonField, RationButtonOption, RowTogllerDirective, Section, SelectField, SelectOption, SidebarComponent, SidebarModule, SlidePanelComponent, SlidePanelModule, SplitButtonComponent, SplitButtonModule, SplitButtonType, 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, WorkspaceSwitchComponent, WorkspaceSwitchModule, countries, fallback, TooltipComponent as ɵa, TooltipDirective as ɵb, SelectFieldComponent as ɵba, TextAreaFieldComponent as ɵbb, TextFieldComponent as ɵbc, BooleanSwitchFieldComponent as ɵbd, PasswordFieldComponent as ɵbe, SliderFieldComponent as ɵbf, DecimalField as ɵbh, StructureModule as ɵbi, HeaderComponent as ɵbj, FooterComponent as ɵbk, NumberLocaleOptions as ɵbl, ThumbnailService as ɵbm, BorderButtonModule as ɵbn, BorderButtonComponent as ɵbo, TimelineItemModule as ɵbp, TimelineIconItemComponent as ɵbq, HorizontalTimelineModule as ɵbr, HorizontalTimelineComponent as ɵbs, VerticalTimelineModule as ɵbt, VerticalTimelineComponent as ɵbu, RangeLineComponent as ɵbv, CollapseOptionComponent as ɵbw, CollapsedItemsComponent as ɵbx, VerticalItemsComponent as ɵby, InfiniteScrollModule as ɵbz, CountryPhonePickerService as ɵc, InfiniteScrollDirective as ɵca, CustomTranslationsModule as ɵcb, CodeEditorComponent as ɵcc, CoreFacade as ɵcd, CodeMirror6Core as ɵce, LocalizedCurrencyImpurePipe as ɵd, LocalizedBignumberPipe as ɵe, LocalizedBignumberImpurePipe as ɵf, EmptyStateGoBackComponent as ɵg, FileUploadService as ɵh, InfoSignComponent as ɵi, TableColumnsComponent as ɵj, TablePagingComponent as ɵk, AutocompleteFieldComponent as ɵl, BooleanFieldComponent as ɵm, CalendarFieldComponent as ɵn, ChipsFieldComponent as ɵo, CurrencyFieldComponent as ɵp, DynamicFieldComponent as ɵq, DynamicFormDirective as ɵr, FieldsetComponent as ɵs, FileUploadComponent$1 as ɵt, LookupFieldComponent as ɵu, NumberFieldComponent as ɵv, BignumberFieldComponent as ɵw, RadioButtonComponent as ɵx, RowComponent as ɵy, SectionComponent as ɵz };
11993
+ export { AccordionComponent, AccordionModule, AccordionPanelComponent, AngularComponentsModule, AutocompleteField, BadgeColors, BadgeComponent, BadgeModule, BaseFieldComponent, BignumberField, BignumberInputDirective, BignumberInputModule, BooleanField, BooleanOptionsLabel, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ButtonComponent, ButtonModule, ButtonPriority, ButtonSize, CalendarField, CalendarLocaleOptions, CalendarMaskDirective, CalendarMaskModule, ChipsField, CodeEditorModule, CollapseLinkComponent, CollapseLinkModule, ControlErrorsComponent, ControlErrorsModule, CountryPhonePickerComponent, CountryPhonePickerModule, CurrencyField, CustomFieldsComponent, CustomFieldsModule, CustomFieldsService, DEFAULT_CALENDAR_LOCALE_OPTIONS, DEFAULT_LOCALE_OPTIONS, DEFAULT_NUMBER_LOCALE_OPTIONS, DebounceUtils, DoubleClickDirective, DynamicConfig, DynamicFormComponent, DynamicFormModule, DynamicType, EditableOverlayDirective, EditableOverlayModule, EmptyStateComponent, EmptyStateModule, EnumBadgeColors, EnumColumnFieldType, EnumSeverity, 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, Ordination, PanelComponent, PanelModule, PasswordField, PasswordStrengthComponent, PasswordStrengthDirective, PasswordStrengthModule, PasswordStrengthPositions, PasswordStrengths, ProductHeaderComponent, ProductHeaderModule, ProfilePicturePickerComponent, ProfilePicturePickerModule, ProgressBarColors, ProgressBarComponent, ProgressBarModule, RadioButtonField, RatingScaleComponent, RatingScaleModule, RationButtonOption, RowTogllerDirective, Section, SelectField, SelectOption, SidebarComponent, SidebarModule, SlidePanelComponent, SlidePanelModule, SplitButtonComponent, SplitButtonModule, SplitButtonType, 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, WorkspaceSwitchComponent, WorkspaceSwitchModule, countries, fallback, TooltipComponent as ɵa, TooltipDirective as ɵb, SelectFieldComponent as ɵba, TextAreaFieldComponent as ɵbb, TextFieldComponent as ɵbc, BooleanSwitchFieldComponent as ɵbd, PasswordFieldComponent as ɵbe, SliderFieldComponent as ɵbf, DecimalField as ɵbh, StructureModule as ɵbi, HeaderComponent as ɵbj, FooterComponent as ɵbk, NumberLocaleOptions as ɵbl, ThumbnailService as ɵbm, BorderButtonModule as ɵbn, BorderButtonComponent as ɵbo, TimelineItemModule as ɵbp, TimelineIconItemComponent as ɵbq, HorizontalTimelineModule as ɵbr, HorizontalTimelineComponent as ɵbs, VerticalTimelineModule as ɵbt, VerticalTimelineComponent as ɵbu, RangeLineComponent as ɵbv, CollapseOptionComponent as ɵbw, CollapsedItemsComponent as ɵbx, VerticalItemsComponent as ɵby, InfiniteScrollModule as ɵbz, CountryPhonePickerService as ɵc, InfiniteScrollDirective as ɵca, CustomTranslationsModule as ɵcb, CodeEditorComponent as ɵcc, CoreFacade as ɵcd, CodeMirror6Core as ɵce, LocalizedCurrencyImpurePipe as ɵd, LocalizedBignumberPipe as ɵe, LocalizedBignumberImpurePipe as ɵf, EmptyStateGoBackComponent as ɵg, FileUploadService as ɵh, InfoSignComponent as ɵi, TableColumnsComponent as ɵj, TablePagingComponent as ɵk, AutocompleteFieldComponent as ɵl, BooleanFieldComponent as ɵm, CalendarFieldComponent as ɵn, ChipsFieldComponent as ɵo, CurrencyFieldComponent as ɵp, DynamicFieldComponent as ɵq, DynamicFormDirective as ɵr, FieldsetComponent as ɵs, FileUploadComponent$1 as ɵt, LookupFieldComponent as ɵu, NumberFieldComponent as ɵv, BignumberFieldComponent as ɵw, RadioButtonComponent as ɵx, RowComponent as ɵy, SectionComponent as ɵz };
11911
11994
  //# sourceMappingURL=seniorsistemas-angular-components.js.map