@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.
- package/esm2020/lib/formly/field/selection/pickable/pickable.field.directive.mjs +13 -3
- package/esm2020/lib/formly/field/selection/pickable/pickable.list.field.component.mjs +2 -2
- package/fesm2015/dereekb-dbx-form.mjs +13 -3
- package/fesm2015/dereekb-dbx-form.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-form.mjs +13 -3
- package/fesm2020/dereekb-dbx-form.mjs.map +1 -1
- package/lib/formly/field/selection/pickable/pickable.field.directive.d.ts +1 -0
- package/mapbox/package.json +4 -4
- package/package.json +3 -3
|
@@ -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
|
-
|
|
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 (
|
|
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.
|
|
1736
|
+
return !this.dbxPickableListFieldComponent.pickOnlyOne;
|
|
1727
1737
|
}
|
|
1728
1738
|
get selectionMode() {
|
|
1729
1739
|
let selectionMode = 'select';
|