@po-ui/ng-components 5.22.4 → 5.22.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.
@@ -19852,7 +19852,11 @@
19852
19852
  // Seleciona o valor do model.
19853
19853
  PoLookupBaseComponent.prototype.selectValue = function (valueSelected) {
19854
19854
  this.valueToModel = valueSelected;
19855
- this.callOnChange(this.valueToModel);
19855
+ this.multiple
19856
+ ? this.callOnChange(this.valueToModel)
19857
+ : this.valueToModel
19858
+ ? this.callOnChange(this.valueToModel[this.fieldValue])
19859
+ : this.callOnChange(undefined);
19856
19860
  this.selected.emit(valueSelected);
19857
19861
  };
19858
19862
  PoLookupBaseComponent.prototype.callOnChange = function (value) {
@@ -19861,7 +19865,7 @@
19861
19865
  this.onChangePropagate(value);
19862
19866
  }
19863
19867
  if (this.oldValueToModel !== this.valueToModel) {
19864
- this.change.emit(this.valueToModel);
19868
+ this.change.emit(value);
19865
19869
  }
19866
19870
  // Armazenar o valor antigo do model
19867
19871
  this.oldValueToModel = this.valueToModel;
@@ -19942,7 +19946,7 @@
19942
19946
  var _this = this;
19943
19947
  if (options.length) {
19944
19948
  this.selectedOptions = __spreadArray([], __read(options));
19945
- var newModel = this.multiple ? options.map(function (option) { return option[_this.fieldValue]; }) : options[0][this.fieldValue];
19949
+ var newModel = this.multiple ? options.map(function (option) { return option[_this.fieldValue]; }) : options[0];
19946
19950
  this.selectValue(newModel);
19947
19951
  if (options.length === 1) {
19948
19952
  this.oldValue = options[0][this.fieldLabel];
@@ -20274,12 +20278,19 @@
20274
20278
  //Método responsável por selecionar as linhas quando abre o modal.
20275
20279
  PoLookupModalBaseComponent.prototype.setSelectedItems = function () {
20276
20280
  var _this = this;
20277
- this.selecteds.forEach(function (selectedItem) { return _this.poTable.selectRowItem(function (item) { return item[_this.fieldValue] === selectedItem.value; }); });
20281
+ this.selecteds.forEach(function (selectedItem) {
20282
+ if (_this.multiple) {
20283
+ _this.poTable.selectRowItem(function (item) { return item[_this.fieldValue] === selectedItem.value; });
20284
+ }
20285
+ else {
20286
+ _this.poTable.selectRowItem(function (item) { return item[_this.fieldValue] === selectedItem[_this.fieldValue]; });
20287
+ }
20288
+ });
20278
20289
  };
20279
20290
  //Método responsável por criar os disclaimers quando abre o modal.
20280
20291
  PoLookupModalBaseComponent.prototype.setDisclaimersItems = function () {
20281
20292
  if (this.selectedItems && !Array.isArray(this.selectedItems)) {
20282
- this.selecteds = [{ value: this.selectedItems }];
20293
+ this.multiple ? (this.selecteds = [{ value: this.selectedItems }]) : (this.selecteds = [this.selectedItems]);
20283
20294
  return;
20284
20295
  }
20285
20296
  if (this.selectedItems && this.selectedItems.length) {