@seniorsistemas/angular-components 14.16.4-dcdfd56c-62cf-4abb-bb20-c5426fcdd5f2 → 14.16.6

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.
@@ -2041,6 +2041,7 @@
2041
2041
  _this.multipleSelectedLabel = config.multipleSelectedLabel || "{0} registros selecionados";
2042
2042
  _this.onClick = config.onClick;
2043
2043
  _this.onChange = config.onChange;
2044
+ _this.emptyMessage = config.emptyMessage;
2044
2045
  return _this;
2045
2046
  }
2046
2047
  return SelectField;
@@ -4930,7 +4931,7 @@
4930
4931
  ], SelectFieldComponent.prototype, "formControl", void 0);
4931
4932
  SelectFieldComponent = __decorate([
4932
4933
  core.Component({
4933
- template: "<p-dropdown\n *ngIf=\"!field.multiple\"\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [options]=\"isFunction(field.options) ? field.options() : field.options\"\n [placeholder]=\"field.placeholder || ' '\"\n [formControl]=\"formControl\"\n [pTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n [showClear]=\"field.showClear\"\n dataKey=\"{{field.dataKey}}\"\n optionLabel=\"{{field.optionLabel}}\"\n [autoDisplayFirst]=\"field.autoDisplayFirst\"\n [appendTo]=\"field.appendTo ? field.appendTo : 'body'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onChange)=\"field.onChange ? field.onChange($event) : null\"\n>\n</p-dropdown>\n<p-multiSelect\n *ngIf=\"field.multiple\"\n [formControl]=\"formControl\"\n [name]=\"field.name\"\n [inputId]=\"(field.id || field.name)\"\n [options]=\"isFunction(field.options) ? field.options() : field.options\"\n [defaultLabel]=\"field.placeholder\"\n [pTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n emptyFilterMessage=\"Nenhum registro encontrado\"\n [showDelay]=\"500\"\n [selectedItemsLabel]=\"field.multipleSelectedLabel\"\n [appendTo]=\"field.appendTo ? field.appendTo : 'body'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onChange)=\"field.onChange ? field.onChange($event) : null\"\n>\n</p-multiSelect>\n\n"
4934
+ template: "<p-dropdown\n *ngIf=\"!field.multiple\"\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [options]=\"isFunction(field.options) ? field.options() : field.options\"\n [placeholder]=\"field.placeholder || ' '\"\n [formControl]=\"formControl\"\n [pTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n [showClear]=\"field.showClear\"\n dataKey=\"{{field.dataKey}}\"\n optionLabel=\"{{field.optionLabel}}\"\n [autoDisplayFirst]=\"field.autoDisplayFirst\"\n [appendTo]=\"field.appendTo || 'body'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onChange)=\"field.onChange ? field.onChange($event) : null\"\n>\n</p-dropdown>\n<p-multiSelect\n *ngIf=\"field.multiple\"\n [formControl]=\"formControl\"\n [name]=\"field.name\"\n [inputId]=\"(field.id || field.name)\"\n [options]=\"isFunction(field.options) ? field.options() : field.options\"\n [defaultLabel]=\"field.placeholder\"\n [pTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [emptyFilterMessage]=\"field.emptyMessage || 'Nenhum registro encontrado'\"\n [showDelay]=\"500\"\n [selectedItemsLabel]=\"field.multipleSelectedLabel\"\n [appendTo]=\"field.appendTo || 'body'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onChange)=\"field.onChange ? field.onChange($event) : null\"\n>\n</p-multiSelect>\n\n"
4934
4935
  })
4935
4936
  ], SelectFieldComponent);
4936
4937
  return SelectFieldComponent;
@@ -5684,11 +5685,12 @@
5684
5685
  })(CustomFieldType || (CustomFieldType = {}));
5685
5686
  var moment$3 = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
5686
5687
  var CustomFieldsComponent = /** @class */ (function () {
5687
- function CustomFieldsComponent(customFieldsService, localeService, sanitizer, translateService) {
5688
+ function CustomFieldsComponent(customFieldsService, localeService, sanitizer, translateService, controlContainer) {
5688
5689
  this.customFieldsService = customFieldsService;
5689
5690
  this.localeService = localeService;
5690
5691
  this.sanitizer = sanitizer;
5691
5692
  this.translateService = translateService;
5693
+ this.controlContainer = controlContainer;
5692
5694
  this.customFieldsEndpoint = "platform/field_customization/queries/getEntity";
5693
5695
  this.fileLocationEndpoint = "platform/field_customization/actions/requestUpload";
5694
5696
  this.requestAccessEndpoint = "platform/field_customization/actions/requestAccess";
@@ -5697,6 +5699,20 @@
5697
5699
  this.ngUsubscribe = new rxjs.Subject();
5698
5700
  }
5699
5701
  CustomFieldsComponent_1 = CustomFieldsComponent;
5702
+ Object.defineProperty(CustomFieldsComponent.prototype, "parentForm", {
5703
+ get: function () {
5704
+ return this.controlContainer.control;
5705
+ },
5706
+ enumerable: true,
5707
+ configurable: true
5708
+ });
5709
+ Object.defineProperty(CustomFieldsComponent.prototype, "parentControl", {
5710
+ get: function () {
5711
+ return this.parentForm.get("custom");
5712
+ },
5713
+ enumerable: true,
5714
+ configurable: true
5715
+ });
5700
5716
  CustomFieldsComponent.prototype.registerOnChange = function (fn) {
5701
5717
  var _this = this;
5702
5718
  this.onChange = fn;
@@ -5740,7 +5756,10 @@
5740
5756
  this.formGroup = new forms.FormGroup({});
5741
5757
  var observables = [this.getCustomFields(), this.localeService.get()];
5742
5758
  rxjs.forkJoin(observables)
5743
- .pipe(operators.takeUntil(this.ngUsubscribe))
5759
+ .pipe(operators.takeUntil(this.ngUsubscribe), operators.finalize(function () {
5760
+ _this.formGroup.markAsPristine();
5761
+ _this.parentControl.markAsPristine();
5762
+ }))
5744
5763
  .subscribe(function (response) {
5745
5764
  var _a = __read(response, 2), customFieldsResponse = _a[0], localeOptions = _a[1];
5746
5765
  var defaults = {};
@@ -5794,7 +5813,6 @@
5794
5813
  _this.formGroup.patchValue(_this.parseValuesForFields(_this.value));
5795
5814
  _this.ready = true;
5796
5815
  });
5797
- this.formGroup.markAsPristine();
5798
5816
  };
5799
5817
  CustomFieldsComponent.prototype.ngOnDestroy = function () {
5800
5818
  this.ngUsubscribe.next();
@@ -6157,7 +6175,8 @@
6157
6175
  { type: CustomFieldsService },
6158
6176
  { type: LocaleService },
6159
6177
  { type: platformBrowser.DomSanitizer },
6160
- { type: core$1.TranslateService }
6178
+ { type: core$1.TranslateService },
6179
+ { type: forms.ControlContainer, decorators: [{ type: core.Optional }] }
6161
6180
  ]; };
6162
6181
  __decorate([
6163
6182
  core.Input()
@@ -6202,7 +6221,8 @@
6202
6221
  multi: true,
6203
6222
  },
6204
6223
  ]
6205
- })
6224
+ }),
6225
+ __param(4, core.Optional())
6206
6226
  ], CustomFieldsComponent);
6207
6227
  return CustomFieldsComponent;
6208
6228
  }());