@dereekb/dbx-form 9.10.1 → 9.10.3

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.
@@ -1495,6 +1495,9 @@ class AbstractDbxPickableItemFieldDirective extends FieldType$1 {
1495
1495
  get asArrayValue() {
1496
1496
  return this.pickableField.asArrayValue ?? true;
1497
1497
  }
1498
+ get pickOnlyOne() {
1499
+ return this.asArrayValue === false || this.multiSelect === false;
1500
+ }
1498
1501
  get filterLabel() {
1499
1502
  return this.pickableField.filterLabel;
1500
1503
  }
@@ -1615,7 +1618,14 @@ class AbstractDbxPickableItemFieldDirective extends FieldType$1 {
1615
1618
  return value;
1616
1619
  }
1617
1620
  addValue(value) {
1618
- this.setValues([...this.values, value]);
1621
+ let newValues;
1622
+ if (this.pickOnlyOne) {
1623
+ newValues = [value];
1624
+ }
1625
+ else {
1626
+ newValues = [...this.values, value];
1627
+ }
1628
+ this.setValues(newValues);
1619
1629
  }
1620
1630
  removeValue(value) {
1621
1631
  const hashToFilter = this.hashForValue(value);
@@ -1627,7 +1637,7 @@ class AbstractDbxPickableItemFieldDirective extends FieldType$1 {
1627
1637
  if (this.hashForValue) {
1628
1638
  values = findUnique(values, this.hashForValue);
1629
1639
  }
1630
- if (!this.multiSelect) {
1640
+ if (this.pickOnlyOne) {
1631
1641
  values = [values[0]].filter((x) => x != null);
1632
1642
  }
1633
1643
  this._setValueOnFormControl(values);
@@ -1723,7 +1733,7 @@ class DbxPickableListFieldItemListViewComponent extends AbstractDbxSelectionList
1723
1733
  map((x) => addConfigToValueListItems(this.config, x)), shareReplay(1));
1724
1734
  }
1725
1735
  get multiple() {
1726
- return this.dbxPickableListFieldComponent.multiSelect;
1736
+ return !this.dbxPickableListFieldComponent.pickOnlyOne;
1727
1737
  }
1728
1738
  get selectionMode() {
1729
1739
  let selectionMode = 'select';