@seniorsistemas/angular-components 14.16.4 → 14.16.7

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 (21) hide show
  1. package/bundles/seniorsistemas-angular-components.umd.js +37 -7
  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/custom-fields/custom-fields.component.d.ts +6 -3
  6. package/components/dynamic-form/configurations/fields/select-field.d.ts +2 -0
  7. package/components/table/frozen-position/frozen-position.directive.d.ts +5 -2
  8. package/esm2015/components/custom-fields/custom-fields.component.js +22 -12
  9. package/esm2015/components/dynamic-form/components/fields/select/select-field.component.js +2 -2
  10. package/esm2015/components/dynamic-form/configurations/fields/select-field.js +2 -1
  11. package/esm2015/components/table/frozen-position/frozen-position.directive.js +13 -2
  12. package/esm5/components/custom-fields/custom-fields.component.js +30 -12
  13. package/esm5/components/dynamic-form/components/fields/select/select-field.component.js +2 -2
  14. package/esm5/components/dynamic-form/configurations/fields/select-field.js +2 -1
  15. package/esm5/components/table/frozen-position/frozen-position.directive.js +13 -2
  16. package/fesm2015/seniorsistemas-angular-components.js +31 -9
  17. package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
  18. package/fesm5/seniorsistemas-angular-components.js +39 -9
  19. package/fesm5/seniorsistemas-angular-components.js.map +1 -1
  20. package/package.json +1 -1
  21. package/seniorsistemas-angular-components.metadata.json +1 -1
@@ -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;
@@ -3977,7 +3978,9 @@
3977
3978
  this.el = el;
3978
3979
  this.host = host;
3979
3980
  this.sTableFrozenPosition = "left";
3981
+ this.isTableVisible = false;
3980
3982
  this.onColumnsChanged = new core.EventEmitter();
3983
+ this.table = host;
3981
3984
  this.host.onColResize.subscribe(function () {
3982
3985
  _this.handleColResize();
3983
3986
  });
@@ -4013,6 +4016,15 @@
4013
4016
  this.applyStylesForTable();
4014
4017
  this.setUpColumnMonitoring();
4015
4018
  };
4019
+ TableFrozenPositionDirective.prototype.ngAfterContentChecked = function () {
4020
+ if (!this.isTableVisible && !!this.table.el.nativeElement.offsetParent) {
4021
+ this.isTableVisible = true;
4022
+ this.synchronizeRowHeight();
4023
+ }
4024
+ else if (this.isTableVisible && !this.table.el.nativeElement.offsetParent) {
4025
+ this.isTableVisible = false;
4026
+ }
4027
+ };
4016
4028
  TableFrozenPositionDirective.prototype.ngOnDestroy = function () {
4017
4029
  window.removeEventListener("resize", this.handleWindowResize.bind(this));
4018
4030
  if (this.tableHeadObservable) {
@@ -4930,7 +4942,7 @@
4930
4942
  ], SelectFieldComponent.prototype, "formControl", void 0);
4931
4943
  SelectFieldComponent = __decorate([
4932
4944
  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"
4945
+ 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
4946
  })
4935
4947
  ], SelectFieldComponent);
4936
4948
  return SelectFieldComponent;
@@ -5684,11 +5696,12 @@
5684
5696
  })(CustomFieldType || (CustomFieldType = {}));
5685
5697
  var moment$3 = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
5686
5698
  var CustomFieldsComponent = /** @class */ (function () {
5687
- function CustomFieldsComponent(customFieldsService, localeService, sanitizer, translateService) {
5699
+ function CustomFieldsComponent(customFieldsService, localeService, sanitizer, translateService, controlContainer) {
5688
5700
  this.customFieldsService = customFieldsService;
5689
5701
  this.localeService = localeService;
5690
5702
  this.sanitizer = sanitizer;
5691
5703
  this.translateService = translateService;
5704
+ this.controlContainer = controlContainer;
5692
5705
  this.customFieldsEndpoint = "platform/field_customization/queries/getEntity";
5693
5706
  this.fileLocationEndpoint = "platform/field_customization/actions/requestUpload";
5694
5707
  this.requestAccessEndpoint = "platform/field_customization/actions/requestAccess";
@@ -5697,6 +5710,20 @@
5697
5710
  this.ngUsubscribe = new rxjs.Subject();
5698
5711
  }
5699
5712
  CustomFieldsComponent_1 = CustomFieldsComponent;
5713
+ Object.defineProperty(CustomFieldsComponent.prototype, "parentForm", {
5714
+ get: function () {
5715
+ return this.controlContainer.control;
5716
+ },
5717
+ enumerable: true,
5718
+ configurable: true
5719
+ });
5720
+ Object.defineProperty(CustomFieldsComponent.prototype, "parentControl", {
5721
+ get: function () {
5722
+ return this.parentForm.get("custom");
5723
+ },
5724
+ enumerable: true,
5725
+ configurable: true
5726
+ });
5700
5727
  CustomFieldsComponent.prototype.registerOnChange = function (fn) {
5701
5728
  var _this = this;
5702
5729
  this.onChange = fn;
@@ -5740,7 +5767,10 @@
5740
5767
  this.formGroup = new forms.FormGroup({});
5741
5768
  var observables = [this.getCustomFields(), this.localeService.get()];
5742
5769
  rxjs.forkJoin(observables)
5743
- .pipe(operators.takeUntil(this.ngUsubscribe))
5770
+ .pipe(operators.takeUntil(this.ngUsubscribe), operators.finalize(function () {
5771
+ _this.formGroup.markAsPristine();
5772
+ _this.parentControl.markAsPristine();
5773
+ }))
5744
5774
  .subscribe(function (response) {
5745
5775
  var _a = __read(response, 2), customFieldsResponse = _a[0], localeOptions = _a[1];
5746
5776
  var defaults = {};
@@ -5787,13 +5817,11 @@
5787
5817
  validators.push(forms.Validators.required);
5788
5818
  }
5789
5819
  var control = new forms.FormControl({ value: defaults[fieldType].defaultValue, disabled: _this.formGroup.disabled }, validators);
5790
- control.markAsDirty({ onlySelf: true });
5791
5820
  _this.formGroup.addControl(formField.name, control);
5792
5821
  _this.fields.push(formField);
5793
5822
  });
5794
5823
  _this.createFieldCustomization(fields);
5795
5824
  _this.formGroup.patchValue(_this.parseValuesForFields(_this.value));
5796
- _this.formGroup.markAsDirty({ onlySelf: true });
5797
5825
  _this.ready = true;
5798
5826
  });
5799
5827
  };
@@ -6158,7 +6186,8 @@
6158
6186
  { type: CustomFieldsService },
6159
6187
  { type: LocaleService },
6160
6188
  { type: platformBrowser.DomSanitizer },
6161
- { type: core$1.TranslateService }
6189
+ { type: core$1.TranslateService },
6190
+ { type: forms.ControlContainer, decorators: [{ type: core.Optional }] }
6162
6191
  ]; };
6163
6192
  __decorate([
6164
6193
  core.Input()
@@ -6203,7 +6232,8 @@
6203
6232
  multi: true,
6204
6233
  },
6205
6234
  ]
6206
- })
6235
+ }),
6236
+ __param(4, core.Optional())
6207
6237
  ], CustomFieldsComponent);
6208
6238
  return CustomFieldsComponent;
6209
6239
  }());