selective-ui 1.3.1 → 1.4.0
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/dist/selective-ui.esm.js +23 -10
- package/dist/selective-ui.esm.js.map +1 -1
- package/dist/selective-ui.esm.min.js +2 -2
- package/dist/selective-ui.esm.min.js.br +0 -0
- package/dist/selective-ui.min.js +2 -2
- package/dist/selective-ui.min.js.br +0 -0
- package/dist/selective-ui.umd.js +24 -11
- package/dist/selective-ui.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/ts/components/selectbox.ts +23 -9
package/dist/selective-ui.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Selective UI v1.
|
|
1
|
+
/*! Selective UI v1.4.0 | MIT License */
|
|
2
2
|
/**
|
|
3
3
|
* @class
|
|
4
4
|
*/
|
|
@@ -9686,6 +9686,22 @@ class SelectBox extends Lifecycle {
|
|
|
9686
9686
|
});
|
|
9687
9687
|
this.change(false, trigger);
|
|
9688
9688
|
},
|
|
9689
|
+
deSelectByDataset(_evtToken, dataset, trigger = true) {
|
|
9690
|
+
if (dataset) {
|
|
9691
|
+
superThis.getModelOption().forEach(optionModel => {
|
|
9692
|
+
if (optionModel.dataset) {
|
|
9693
|
+
for (let searchKey in dataset) {
|
|
9694
|
+
let value = dataset[searchKey];
|
|
9695
|
+
!Array.isArray(value) && (value = [value]);
|
|
9696
|
+
if (value.includes(optionModel.dataset[searchKey])) {
|
|
9697
|
+
optionModel.selectedNonTrigger = false;
|
|
9698
|
+
}
|
|
9699
|
+
}
|
|
9700
|
+
}
|
|
9701
|
+
});
|
|
9702
|
+
this.change(false, trigger);
|
|
9703
|
+
}
|
|
9704
|
+
},
|
|
9689
9705
|
setValue(_evtToken = null, value, trigger = true, force = false) {
|
|
9690
9706
|
if (!Array.isArray(value))
|
|
9691
9707
|
value = [value];
|
|
@@ -9715,17 +9731,14 @@ class SelectBox extends Lifecycle {
|
|
|
9715
9731
|
const result = await container.searchController.loadByValues(missing);
|
|
9716
9732
|
if (result.success && result.items.length > 0) {
|
|
9717
9733
|
result.items.forEach((it) => {
|
|
9718
|
-
if (missing.includes(it.value))
|
|
9734
|
+
if (missing.includes(it.value) || missing.includes(it.text))
|
|
9719
9735
|
it.selected = true;
|
|
9720
9736
|
});
|
|
9721
|
-
|
|
9722
|
-
container.searchController.applyAjaxResult?.(result.items, true, true);
|
|
9737
|
+
container.searchController.applyAjaxResult?.(result.items, false, false);
|
|
9723
9738
|
setTimeout(() => {
|
|
9724
|
-
|
|
9725
|
-
|
|
9726
|
-
|
|
9727
|
-
this.change(false, false);
|
|
9728
|
-
}, 100);
|
|
9739
|
+
container.searchController.resetPagination();
|
|
9740
|
+
this.change(false, trigger);
|
|
9741
|
+
}, 200);
|
|
9729
9742
|
}
|
|
9730
9743
|
else if (missing.length > 0) {
|
|
9731
9744
|
console.warn(`Could not load ${missing.length} values:`, missing);
|
|
@@ -10892,7 +10905,7 @@ const SECLASS = new Selective();
|
|
|
10892
10905
|
*
|
|
10893
10906
|
* Declared as `const` literal type to enable strict typing and easy tree-shaking.
|
|
10894
10907
|
*/
|
|
10895
|
-
const version = "1.
|
|
10908
|
+
const version = "1.4.0";
|
|
10896
10909
|
/**
|
|
10897
10910
|
* Library name identifier.
|
|
10898
10911
|
*
|