@descope/web-components-ui 1.0.255 → 1.0.257
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index.cjs.js +30 -3
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +30 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/descope-multi-select-combo-box-index-js.js +1 -1
- package/package.json +1 -1
- package/src/components/descope-multi-select-combo-box/MultiSelectComboBoxClass.js +29 -2
- package/src/theme/components/modal.js +1 -1
package/dist/index.esm.js
CHANGED
@@ -7535,7 +7535,7 @@ const multiSelectComboBoxMixin = (superclass) =>
|
|
7535
7535
|
}
|
7536
7536
|
}
|
7537
7537
|
|
7538
|
-
get
|
7538
|
+
get allowCustomValues() {
|
7539
7539
|
return this.getAttribute('allow-custom-value') === 'true';
|
7540
7540
|
}
|
7541
7541
|
|
@@ -7674,7 +7674,7 @@ const multiSelectComboBoxMixin = (superclass) =>
|
|
7674
7674
|
}
|
7675
7675
|
|
7676
7676
|
#handleCustomValues() {
|
7677
|
-
if (this.
|
7677
|
+
if (this.allowCustomValues) {
|
7678
7678
|
this.baseElement.addEventListener('custom-value-set', (e) => {
|
7679
7679
|
const newItemHtml = this.#renderItem({
|
7680
7680
|
label: e.detail,
|
@@ -7782,6 +7782,33 @@ const multiSelectComboBoxMixin = (superclass) =>
|
|
7782
7782
|
const selectedChildren = this.baseElement.items?.filter((item) =>
|
7783
7783
|
vals.includes(item['data-id'])
|
7784
7784
|
);
|
7785
|
+
|
7786
|
+
// If the component allows custom values, we need to add the values that are not present in the children
|
7787
|
+
if (this.allowCustomValues) {
|
7788
|
+
const existingValues =
|
7789
|
+
selectedChildren?.map((child) => child.getAttribute('data-id')) || [];
|
7790
|
+
const missingValues = vals.filter((val) => !existingValues.includes(val));
|
7791
|
+
|
7792
|
+
if (missingValues.length) {
|
7793
|
+
const newItemsHtml = missingValues.reduce((acc, val) => {
|
7794
|
+
const newItemHtml = this.#renderItem({
|
7795
|
+
label: val,
|
7796
|
+
displayName: val,
|
7797
|
+
value: val,
|
7798
|
+
});
|
7799
|
+
return acc + newItemHtml;
|
7800
|
+
}, '');
|
7801
|
+
this.innerHTML += newItemsHtml;
|
7802
|
+
|
7803
|
+
// The value needs to be set with a timeout because it needs to execute after
|
7804
|
+
// the custom values are added to the items by the children change observer
|
7805
|
+
setTimeout(() => {
|
7806
|
+
this.value = vals;
|
7807
|
+
}, 0);
|
7808
|
+
return;
|
7809
|
+
}
|
7810
|
+
}
|
7811
|
+
|
7785
7812
|
const newSelectedValues =
|
7786
7813
|
selectedChildren?.map((child) => child.getAttribute('data-id')) || [];
|
7787
7814
|
if (!compareArraysUnordered(this.#value, newSelectedValues)) {
|
@@ -9786,7 +9813,7 @@ const compVars = ModalClass.cssVarList;
|
|
9786
9813
|
|
9787
9814
|
const modal = {
|
9788
9815
|
[compVars.overlayBackgroundColor]: globalRefs$4.colors.surface.light,
|
9789
|
-
[compVars.overlayShadow]: '
|
9816
|
+
[compVars.overlayShadow]: globalRefs$4.shadow.wide['2xl'],
|
9790
9817
|
[compVars.overlayWidth]: '700px',
|
9791
9818
|
};
|
9792
9819
|
|