@seniorsistemas/angular-components 14.16.4 → 14.16.5

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.
@@ -1,5 +1,5 @@
1
1
  import { __spread, __assign, __decorate, __extends, __rest, __values, __param, __awaiter, __generator, __read } from 'tslib';
2
- import { Input, Component, NgModule, EventEmitter, HostBinding, Output, ViewChild, Renderer2, HostListener, Directive, Injectable, Pipe, forwardRef, ViewEncapsulation, TemplateRef, ViewContainerRef, ComponentFactoryResolver, ChangeDetectorRef, ElementRef, InjectionToken, Inject, ContentChild, ApplicationRef, Injector, ContentChildren } from '@angular/core';
2
+ import { Input, Component, NgModule, EventEmitter, HostBinding, Output, ViewChild, Renderer2, HostListener, Directive, Injectable, Pipe, forwardRef, ViewEncapsulation, TemplateRef, ViewContainerRef, ComponentFactoryResolver, ChangeDetectorRef, ElementRef, InjectionToken, Inject, Optional, ContentChild, ApplicationRef, Injector, ContentChildren } from '@angular/core';
3
3
  import { CommonModule } from '@angular/common';
4
4
  import { BreadcrumbModule as BreadcrumbModule$1 } from 'primeng/breadcrumb';
5
5
  import { NavigationEnd, PRIMARY_OUTLET, ActivatedRoute, Router, RouterModule } from '@angular/router';
@@ -10,7 +10,7 @@ import { TooltipModule } from 'primeng/tooltip';
10
10
  import { DomHandler } from 'primeng/dom';
11
11
  import { Calendar, CalendarModule } from 'primeng/calendar';
12
12
  import { trigger, state, style as style$7, transition, animate, group, query, animateChild } from '@angular/animations';
13
- import { FormsModule, ReactiveFormsModule, NG_VALUE_ACCESSOR, FormControl, FormGroup, NG_VALIDATORS, Validators, FormArray } from '@angular/forms';
13
+ import { FormsModule, ReactiveFormsModule, NG_VALUE_ACCESSOR, FormControl, FormGroup, NG_VALIDATORS, Validators, FormArray, ControlContainer } from '@angular/forms';
14
14
  import { HttpClient, HttpEventType, HttpClientModule } from '@angular/common/http';
15
15
  import { Hotkey, HotkeysService, HotkeyModule } from 'angular2-hotkeys';
16
16
  import BigNumber, { BigNumber as BigNumber$1 } from 'bignumber.js';
@@ -5511,11 +5511,12 @@ var CustomFieldType;
5511
5511
  })(CustomFieldType || (CustomFieldType = {}));
5512
5512
  var moment$3 = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
5513
5513
  var CustomFieldsComponent = /** @class */ (function () {
5514
- function CustomFieldsComponent(customFieldsService, localeService, sanitizer, translateService) {
5514
+ function CustomFieldsComponent(customFieldsService, localeService, sanitizer, translateService, controlContainer) {
5515
5515
  this.customFieldsService = customFieldsService;
5516
5516
  this.localeService = localeService;
5517
5517
  this.sanitizer = sanitizer;
5518
5518
  this.translateService = translateService;
5519
+ this.controlContainer = controlContainer;
5519
5520
  this.customFieldsEndpoint = "platform/field_customization/queries/getEntity";
5520
5521
  this.fileLocationEndpoint = "platform/field_customization/actions/requestUpload";
5521
5522
  this.requestAccessEndpoint = "platform/field_customization/actions/requestAccess";
@@ -5524,6 +5525,20 @@ var CustomFieldsComponent = /** @class */ (function () {
5524
5525
  this.ngUsubscribe = new Subject();
5525
5526
  }
5526
5527
  CustomFieldsComponent_1 = CustomFieldsComponent;
5528
+ Object.defineProperty(CustomFieldsComponent.prototype, "parentForm", {
5529
+ get: function () {
5530
+ return this.controlContainer.control;
5531
+ },
5532
+ enumerable: true,
5533
+ configurable: true
5534
+ });
5535
+ Object.defineProperty(CustomFieldsComponent.prototype, "parentControl", {
5536
+ get: function () {
5537
+ return this.parentForm.get("custom");
5538
+ },
5539
+ enumerable: true,
5540
+ configurable: true
5541
+ });
5527
5542
  CustomFieldsComponent.prototype.registerOnChange = function (fn) {
5528
5543
  var _this = this;
5529
5544
  this.onChange = fn;
@@ -5567,7 +5582,10 @@ var CustomFieldsComponent = /** @class */ (function () {
5567
5582
  this.formGroup = new FormGroup({});
5568
5583
  var observables = [this.getCustomFields(), this.localeService.get()];
5569
5584
  forkJoin(observables)
5570
- .pipe(takeUntil(this.ngUsubscribe))
5585
+ .pipe(takeUntil(this.ngUsubscribe), finalize(function () {
5586
+ _this.formGroup.markAsPristine();
5587
+ _this.parentControl.markAsPristine();
5588
+ }))
5571
5589
  .subscribe(function (response) {
5572
5590
  var _a = __read(response, 2), customFieldsResponse = _a[0], localeOptions = _a[1];
5573
5591
  var defaults = {};
@@ -5614,13 +5632,11 @@ var CustomFieldsComponent = /** @class */ (function () {
5614
5632
  validators.push(Validators.required);
5615
5633
  }
5616
5634
  var control = new FormControl({ value: defaults[fieldType].defaultValue, disabled: _this.formGroup.disabled }, validators);
5617
- control.markAsDirty({ onlySelf: true });
5618
5635
  _this.formGroup.addControl(formField.name, control);
5619
5636
  _this.fields.push(formField);
5620
5637
  });
5621
5638
  _this.createFieldCustomization(fields);
5622
5639
  _this.formGroup.patchValue(_this.parseValuesForFields(_this.value));
5623
- _this.formGroup.markAsDirty({ onlySelf: true });
5624
5640
  _this.ready = true;
5625
5641
  });
5626
5642
  };
@@ -5985,7 +6001,8 @@ var CustomFieldsComponent = /** @class */ (function () {
5985
6001
  { type: CustomFieldsService },
5986
6002
  { type: LocaleService },
5987
6003
  { type: DomSanitizer },
5988
- { type: TranslateService }
6004
+ { type: TranslateService },
6005
+ { type: ControlContainer, decorators: [{ type: Optional }] }
5989
6006
  ]; };
5990
6007
  __decorate([
5991
6008
  Input()
@@ -6030,7 +6047,8 @@ var CustomFieldsComponent = /** @class */ (function () {
6030
6047
  multi: true,
6031
6048
  },
6032
6049
  ]
6033
- })
6050
+ }),
6051
+ __param(4, Optional())
6034
6052
  ], CustomFieldsComponent);
6035
6053
  return CustomFieldsComponent;
6036
6054
  }());