@seniorsistemas/angular-components 17.3.12 → 17.3.14

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.
@@ -5304,27 +5304,7 @@
5304
5304
  return result;
5305
5305
  }, {});
5306
5306
  this.formGroupDialog = new forms.FormGroup(formGroup);
5307
- this.onSearchRequest.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function () { return (_this.loading = true); });
5308
- this.onSelect.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function () { return _this.onChange(_this.value); });
5309
- this.onUnselect.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function () { return _this.onChange(_this.value); });
5310
- this.onClear.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function () {
5311
- if (_this.multiple || _this.value) {
5312
- return;
5313
- }
5314
- _this.onChange(null);
5315
- });
5316
- this.onFocus.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function () {
5317
- _this.onTouched();
5318
- });
5319
- this.onBlur.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
5320
- var currentValue = _this.value && _this.value[_this.lookupDisplayField];
5321
- var value = event.target.value;
5322
- if (_this.multiple || !currentValue || currentValue == value)
5323
- return;
5324
- var newValue = "";
5325
- event.target.value = newValue;
5326
- _this.onChange(newValue);
5327
- });
5307
+ this._subscribeEvents();
5328
5308
  };
5329
5309
  LookupComponent.prototype.printRecordTotalizer = function () {
5330
5310
  if (this.searchTotalRecordsLabel) {
@@ -5476,15 +5456,15 @@
5476
5456
  else
5477
5457
  this.selected = [selected];
5478
5458
  };
5479
- LookupComponent.prototype.registerOnChange = function (fn) {
5459
+ LookupComponent.prototype.registerOnChange = function (onChange) {
5480
5460
  var _this = this;
5481
- this.onChange = function (val) {
5482
- _this.writeValue(val);
5483
- fn(val);
5461
+ this.onChange = function (value) {
5462
+ _this.writeValue(value);
5463
+ onChange(value);
5484
5464
  };
5485
5465
  };
5486
- LookupComponent.prototype.registerOnTouched = function (fn) {
5487
- this.onTouched = fn;
5466
+ LookupComponent.prototype.registerOnTouched = function (onTouched) {
5467
+ this.onTouched = onTouched;
5488
5468
  };
5489
5469
  LookupComponent.prototype.writeValue = function (value) {
5490
5470
  this.value = value;
@@ -5592,7 +5572,7 @@
5592
5572
  scale: this.getScale(col.scale),
5593
5573
  decimalSeparator: (_a = col.numberLocaleOptions) === null || _a === void 0 ? void 0 : _a.decimalSeparator,
5594
5574
  thousandsSeparator: (_b = col.numberLocaleOptions) === null || _b === void 0 ? void 0 : _b.thousandsSeparator,
5595
- prefix: (_c = col.numberLocaleOptions) === null || _c === void 0 ? void 0 : _c.currencySymbol
5575
+ prefix: (_c = col.numberLocaleOptions) === null || _c === void 0 ? void 0 : _c.currencySymbol,
5596
5576
  };
5597
5577
  };
5598
5578
  LookupComponent.prototype.onTableRowDoubleClick = function (rowData) {
@@ -5602,12 +5582,49 @@
5602
5582
  LookupComponent.prototype._setFocusFilter = function () {
5603
5583
  var _a, _b, _c;
5604
5584
  if (this.dialogVisible && !this.collapsed) {
5605
- var input = (_c = (_b = (_a = this.dialog) === null || _a === void 0 ? void 0 : _a.contentViewChild) === null || _b === void 0 ? void 0 : _b.nativeElement) === null || _c === void 0 ? void 0 : _c.getElementsByTagName('input')[0];
5585
+ var input = (_c = (_b = (_a = this.dialog) === null || _a === void 0 ? void 0 : _a.contentViewChild) === null || _b === void 0 ? void 0 : _b.nativeElement) === null || _c === void 0 ? void 0 : _c.getElementsByTagName("input")[0];
5606
5586
  if (input) {
5607
5587
  input.focus();
5608
5588
  }
5609
5589
  }
5610
5590
  };
5591
+ LookupComponent.prototype._subscribeEvents = function () {
5592
+ var _this = this;
5593
+ this.onSearchRequest
5594
+ .pipe(operators.takeUntil(this.ngUnsubscribe))
5595
+ .subscribe(function () { return (_this.loading = true); });
5596
+ this.onSelect
5597
+ .pipe(operators.takeUntil(this.ngUnsubscribe))
5598
+ .subscribe(function () { return _this.onChange(_this.value); });
5599
+ this.onUnselect
5600
+ .pipe(operators.takeUntil(this.ngUnsubscribe))
5601
+ .subscribe(function () { return _this.onChange(_this.value); });
5602
+ this.onClear
5603
+ .pipe(operators.takeUntil(this.ngUnsubscribe))
5604
+ .subscribe(function () {
5605
+ if (_this.multiple) {
5606
+ return;
5607
+ }
5608
+ _this.onChange(null);
5609
+ });
5610
+ this.onFocus
5611
+ .pipe(operators.takeUntil(this.ngUnsubscribe))
5612
+ .subscribe(function () {
5613
+ _this.onTouched();
5614
+ });
5615
+ this.onBlur
5616
+ .pipe(operators.takeUntil(this.ngUnsubscribe))
5617
+ .subscribe(function (event) {
5618
+ var target = event.target;
5619
+ var currentValue = _this.value && _this.value[_this.lookupDisplayField];
5620
+ var value = target.value;
5621
+ if (_this.multiple || !currentValue || currentValue == value)
5622
+ return;
5623
+ var newValue = "";
5624
+ target.value = newValue;
5625
+ _this.onChange(newValue);
5626
+ });
5627
+ };
5611
5628
  var LookupComponent_1;
5612
5629
  LookupComponent.nextId = 0;
5613
5630
  LookupComponent.ctorParameters = function () { return [
@@ -7762,22 +7779,24 @@
7762
7779
  };
7763
7780
  TableColumnsComponent.prototype.validateComponentAttributes = function (changes) {
7764
7781
  var _a, _b, _c;
7765
- if (!((_a = changes.columns) === null || _a === void 0 ? void 0 : _a.currentValue)) {
7782
+ if (!this.columns && !((_a = changes.columns) === null || _a === void 0 ? void 0 : _a.currentValue)) {
7766
7783
  throw new Error("The 'columns' attribute must be informed!");
7767
7784
  }
7768
- if (!((_b = changes.rowValue) === null || _b === void 0 ? void 0 : _b.currentValue)) {
7785
+ if (!this.rowValue && !((_b = changes.rowValue) === null || _b === void 0 ? void 0 : _b.currentValue)) {
7769
7786
  throw new Error("The 'rowValue' attribute must be informed!");
7770
7787
  }
7771
- if (!((_c = changes.locale) === null || _c === void 0 ? void 0 : _c.currentValue)) {
7788
+ if (!this.locale && !((_c = changes.locale) === null || _c === void 0 ? void 0 : _c.currentValue)) {
7772
7789
  throw new Error("The 'locale' attribute must be informed!");
7773
7790
  }
7774
7791
  };
7775
7792
  TableColumnsComponent.prototype.createColumnsTemplate = function (changes) {
7776
7793
  var _this = this;
7794
+ var _a, _b, _c;
7777
7795
  this.viewContainerRef.clear();
7778
- var columns = changes.columns.currentValue;
7779
- var rowValue = changes.rowValue.currentValue;
7780
- var locale = changes.locale.currentValue;
7796
+ var columns = ((_a = changes.columns) === null || _a === void 0 ? void 0 : _a.currentValue) || this.columns;
7797
+ var rowValue = ((_b = changes.rowValue) === null || _b === void 0 ? void 0 : _b.currentValue) || this.rowValue;
7798
+ var locale = ((_c = changes.locale) === null || _c === void 0 ? void 0 : _c.currentValue) || this.locale;
7799
+ this.formattedColumns = [];
7781
7800
  columns.forEach(function (column) { return _this.formattedColumns.push(_this.getColumnValue(column, rowValue, locale)); });
7782
7801
  this.viewContainerRef.createEmbeddedView(this.columnsTemplate);
7783
7802
  };