@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.
@@ -4800,27 +4800,7 @@ let LookupComponent = LookupComponent_1 = class LookupComponent {
4800
4800
  return result;
4801
4801
  }, {});
4802
4802
  this.formGroupDialog = new FormGroup(formGroup);
4803
- this.onSearchRequest.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => (this.loading = true));
4804
- this.onSelect.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => this.onChange(this.value));
4805
- this.onUnselect.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => this.onChange(this.value));
4806
- this.onClear.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {
4807
- if (this.multiple || this.value) {
4808
- return;
4809
- }
4810
- this.onChange(null);
4811
- });
4812
- this.onFocus.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {
4813
- this.onTouched();
4814
- });
4815
- this.onBlur.pipe(takeUntil(this.ngUnsubscribe)).subscribe(event => {
4816
- const currentValue = this.value && this.value[this.lookupDisplayField];
4817
- const { value } = event.target;
4818
- if (this.multiple || !currentValue || currentValue == value)
4819
- return;
4820
- const newValue = "";
4821
- event.target.value = newValue;
4822
- this.onChange(newValue);
4823
- });
4803
+ this._subscribeEvents();
4824
4804
  }
4825
4805
  printRecordTotalizer() {
4826
4806
  if (this.searchTotalRecordsLabel) {
@@ -4967,14 +4947,14 @@ let LookupComponent = LookupComponent_1 = class LookupComponent {
4967
4947
  else
4968
4948
  this.selected = [selected];
4969
4949
  }
4970
- registerOnChange(fn) {
4971
- this.onChange = (val) => {
4972
- this.writeValue(val);
4973
- fn(val);
4950
+ registerOnChange(onChange) {
4951
+ this.onChange = (value) => {
4952
+ this.writeValue(value);
4953
+ onChange(value);
4974
4954
  };
4975
4955
  }
4976
- registerOnTouched(fn) {
4977
- this.onTouched = fn;
4956
+ registerOnTouched(onTouched) {
4957
+ this.onTouched = onTouched;
4978
4958
  }
4979
4959
  writeValue(value) {
4980
4960
  this.value = value;
@@ -5081,7 +5061,7 @@ let LookupComponent = LookupComponent_1 = class LookupComponent {
5081
5061
  scale: this.getScale(col.scale),
5082
5062
  decimalSeparator: (_a = col.numberLocaleOptions) === null || _a === void 0 ? void 0 : _a.decimalSeparator,
5083
5063
  thousandsSeparator: (_b = col.numberLocaleOptions) === null || _b === void 0 ? void 0 : _b.thousandsSeparator,
5084
- prefix: (_c = col.numberLocaleOptions) === null || _c === void 0 ? void 0 : _c.currencySymbol
5064
+ prefix: (_c = col.numberLocaleOptions) === null || _c === void 0 ? void 0 : _c.currencySymbol,
5085
5065
  };
5086
5066
  }
5087
5067
  onTableRowDoubleClick(rowData) {
@@ -5091,12 +5071,48 @@ let LookupComponent = LookupComponent_1 = class LookupComponent {
5091
5071
  _setFocusFilter() {
5092
5072
  var _a, _b, _c;
5093
5073
  if (this.dialogVisible && !this.collapsed) {
5094
- const 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];
5074
+ const 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];
5095
5075
  if (input) {
5096
5076
  input.focus();
5097
5077
  }
5098
5078
  }
5099
5079
  }
5080
+ _subscribeEvents() {
5081
+ this.onSearchRequest
5082
+ .pipe(takeUntil(this.ngUnsubscribe))
5083
+ .subscribe(() => (this.loading = true));
5084
+ this.onSelect
5085
+ .pipe(takeUntil(this.ngUnsubscribe))
5086
+ .subscribe(() => this.onChange(this.value));
5087
+ this.onUnselect
5088
+ .pipe(takeUntil(this.ngUnsubscribe))
5089
+ .subscribe(() => this.onChange(this.value));
5090
+ this.onClear
5091
+ .pipe(takeUntil(this.ngUnsubscribe))
5092
+ .subscribe(() => {
5093
+ if (this.multiple) {
5094
+ return;
5095
+ }
5096
+ this.onChange(null);
5097
+ });
5098
+ this.onFocus
5099
+ .pipe(takeUntil(this.ngUnsubscribe))
5100
+ .subscribe(() => {
5101
+ this.onTouched();
5102
+ });
5103
+ this.onBlur
5104
+ .pipe(takeUntil(this.ngUnsubscribe))
5105
+ .subscribe((event) => {
5106
+ const target = event.target;
5107
+ const currentValue = this.value && this.value[this.lookupDisplayField];
5108
+ const { value } = target;
5109
+ if (this.multiple || !currentValue || currentValue == value)
5110
+ return;
5111
+ const newValue = "";
5112
+ target.value = newValue;
5113
+ this.onChange(newValue);
5114
+ });
5115
+ }
5100
5116
  };
5101
5117
  LookupComponent.nextId = 0;
5102
5118
  LookupComponent.ctorParameters = () => [
@@ -7112,21 +7128,23 @@ let TableColumnsComponent = class TableColumnsComponent {
7112
7128
  }
7113
7129
  validateComponentAttributes(changes) {
7114
7130
  var _a, _b, _c;
7115
- if (!((_a = changes.columns) === null || _a === void 0 ? void 0 : _a.currentValue)) {
7131
+ if (!this.columns && !((_a = changes.columns) === null || _a === void 0 ? void 0 : _a.currentValue)) {
7116
7132
  throw new Error("The 'columns' attribute must be informed!");
7117
7133
  }
7118
- if (!((_b = changes.rowValue) === null || _b === void 0 ? void 0 : _b.currentValue)) {
7134
+ if (!this.rowValue && !((_b = changes.rowValue) === null || _b === void 0 ? void 0 : _b.currentValue)) {
7119
7135
  throw new Error("The 'rowValue' attribute must be informed!");
7120
7136
  }
7121
- if (!((_c = changes.locale) === null || _c === void 0 ? void 0 : _c.currentValue)) {
7137
+ if (!this.locale && !((_c = changes.locale) === null || _c === void 0 ? void 0 : _c.currentValue)) {
7122
7138
  throw new Error("The 'locale' attribute must be informed!");
7123
7139
  }
7124
7140
  }
7125
7141
  createColumnsTemplate(changes) {
7142
+ var _a, _b, _c;
7126
7143
  this.viewContainerRef.clear();
7127
- const columns = changes.columns.currentValue;
7128
- const rowValue = changes.rowValue.currentValue;
7129
- const locale = changes.locale.currentValue;
7144
+ const columns = ((_a = changes.columns) === null || _a === void 0 ? void 0 : _a.currentValue) || this.columns;
7145
+ const rowValue = ((_b = changes.rowValue) === null || _b === void 0 ? void 0 : _b.currentValue) || this.rowValue;
7146
+ const locale = ((_c = changes.locale) === null || _c === void 0 ? void 0 : _c.currentValue) || this.locale;
7147
+ this.formattedColumns = [];
7130
7148
  columns.forEach((column) => this.formattedColumns.push(this.getColumnValue(column, rowValue, locale)));
7131
7149
  this.viewContainerRef.createEmbeddedView(this.columnsTemplate);
7132
7150
  }