vue3-extended-multiselect 1.5.5 → 1.5.7
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/CHANGELOG.md +10 -1
- package/README.md +1 -1
- package/jest.config.js +1 -1
- package/package.json +1 -1
- package/src/components/ExtendedMultiselectOptions.vue +1 -1
- package/src/components/ExtendedMultiselectToggle.vue +2 -3
- package/src/components/Vue3ExtendedMultiselect.vue +7 -10
- package/src/composition/toggle.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Patch notes
|
|
2
2
|
|
|
3
|
-
Current `vue3-extended-multiselect` version: **1.5.
|
|
3
|
+
Current `vue3-extended-multiselect` version: **1.5.7**
|
|
4
4
|
|
|
5
5
|
***
|
|
6
6
|
|
|
@@ -213,3 +213,12 @@ Adding descriptive comments for some types in typings.
|
|
|
213
213
|
### 1.5.5 (2023-01-26)
|
|
214
214
|
|
|
215
215
|
* Changing some option block styles.
|
|
216
|
+
|
|
217
|
+
### 1.5.6 (2023-01-26)
|
|
218
|
+
|
|
219
|
+
* Fixing bug with "noOption" slot being displayed when search field value is not empty.
|
|
220
|
+
* Fixing bug with reload of preselected options when using external loader.
|
|
221
|
+
|
|
222
|
+
### 1.5.7 (2023-01-26)
|
|
223
|
+
|
|
224
|
+
* Removal of internal loading state because of using "lodash.debounce".
|
package/README.md
CHANGED
package/jest.config.js
CHANGED
package/package.json
CHANGED
|
@@ -539,7 +539,7 @@ const classes = computed(() => {
|
|
|
539
539
|
*/
|
|
540
540
|
const emptyOptionsList = computed(() => {
|
|
541
541
|
return (!options.value.length || !options.value.filter((option) => !!option).length
|
|
542
|
-
|| !availableOptions.value.length) && !
|
|
542
|
+
|| !availableOptions.value.length) && !searchState.searchValue;
|
|
543
543
|
});
|
|
544
544
|
|
|
545
545
|
/**
|
|
@@ -180,9 +180,8 @@ const {
|
|
|
180
180
|
const { createImagePath } = useImagePath();
|
|
181
181
|
|
|
182
182
|
const { toggleSlotClass, toggleOptionsList } = useToggle(
|
|
183
|
-
loading,
|
|
184
|
-
disabled,
|
|
185
|
-
null,
|
|
183
|
+
loading,
|
|
184
|
+
disabled,
|
|
186
185
|
emitter,
|
|
187
186
|
);
|
|
188
187
|
const { iconSizeClass } = useSizes(iconSize);
|
|
@@ -253,7 +253,7 @@ import ExtendedMultiselectToggle from "./ExtendedMultiselectToggle.vue";
|
|
|
253
253
|
|
|
254
254
|
/**
|
|
255
255
|
* @author Ridiger Daniil Dmitrievich
|
|
256
|
-
* @version 1.5.
|
|
256
|
+
* @version 1.5.7
|
|
257
257
|
*/
|
|
258
258
|
|
|
259
259
|
const props = defineProps({
|
|
@@ -886,7 +886,6 @@ const emit = defineEmits([
|
|
|
886
886
|
|
|
887
887
|
const dropdownActive = ref(false);
|
|
888
888
|
const inputDisabled = ref(false);
|
|
889
|
-
const internalLoader = ref(false);
|
|
890
889
|
const externalOptionsLoader = ref(null);
|
|
891
890
|
const chosenToggleAppearanceSide = ref(null);
|
|
892
891
|
const rawOptions = ref([]);
|
|
@@ -943,7 +942,6 @@ const { emitter } = useEmitter();
|
|
|
943
942
|
const { toggleOptionsList } = useToggle(
|
|
944
943
|
loading,
|
|
945
944
|
disabled,
|
|
946
|
-
internalLoader,
|
|
947
945
|
emitter,
|
|
948
946
|
);
|
|
949
947
|
const { cancel } = useCancel(
|
|
@@ -1065,7 +1063,7 @@ const expanded = computed(() => {
|
|
|
1065
1063
|
* @returns {boolean} loading
|
|
1066
1064
|
*/
|
|
1067
1065
|
const internalLoading = computed(() => {
|
|
1068
|
-
return loading.value
|
|
1066
|
+
return loading.value;
|
|
1069
1067
|
});
|
|
1070
1068
|
|
|
1071
1069
|
/**
|
|
@@ -1269,14 +1267,13 @@ const fieldFocus = (mouseEvent) => {
|
|
|
1269
1267
|
* Initialises options list loading by external async method
|
|
1270
1268
|
* @function
|
|
1271
1269
|
* @param {string} pattern - value of search field
|
|
1270
|
+
* @param {boolean} initialValue - preselected options flag
|
|
1272
1271
|
*/
|
|
1273
|
-
const loadOptionsByExternalLoader = (pattern) => {
|
|
1274
|
-
internalLoader.value = true;
|
|
1272
|
+
const loadOptionsByExternalLoader = (pattern, initialValue) => {
|
|
1275
1273
|
externalOptionsLoader.value = options.value;
|
|
1276
1274
|
options.value(pattern).then(options => {
|
|
1277
1275
|
rawOptions.value = options;
|
|
1278
|
-
|
|
1279
|
-
setPreselectedOptionsByConditions();
|
|
1276
|
+
if (initialValue) setPreselectedOptionsByConditions();
|
|
1280
1277
|
});
|
|
1281
1278
|
};
|
|
1282
1279
|
|
|
@@ -1739,7 +1736,7 @@ onBeforeMount(() => {
|
|
|
1739
1736
|
*/
|
|
1740
1737
|
onMounted(() => {
|
|
1741
1738
|
if (typeof options.value === "function") {
|
|
1742
|
-
loadOptionsByExternalLoader();
|
|
1739
|
+
loadOptionsByExternalLoader(null, true);
|
|
1743
1740
|
} else {
|
|
1744
1741
|
rawOptions.value = options.value;
|
|
1745
1742
|
setPreselectedOptionsByConditions();
|
|
@@ -1766,7 +1763,7 @@ onMounted(() => {
|
|
|
1766
1763
|
});
|
|
1767
1764
|
|
|
1768
1765
|
emitter.value.on("extended:loader-pattern-changed", (pattern) => {
|
|
1769
|
-
loadOptionsByExternalLoader(pattern);
|
|
1766
|
+
loadOptionsByExternalLoader(pattern, false);
|
|
1770
1767
|
});
|
|
1771
1768
|
});
|
|
1772
1769
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed, readonly } from "vue";
|
|
2
2
|
|
|
3
|
-
export default function useToggle(loading, disabled,
|
|
3
|
+
export default function useToggle(loading, disabled, emitter) {
|
|
4
4
|
/**
|
|
5
5
|
* Toggles classes of slots if "loading"
|
|
6
6
|
* or "disabled" props equals true
|
|
@@ -8,7 +8,7 @@ export default function useToggle(loading, disabled, internalLoader, emitter) {
|
|
|
8
8
|
* @returns {string} class
|
|
9
9
|
*/
|
|
10
10
|
const toggleSlotClass = computed(() => {
|
|
11
|
-
return loading.value || disabled.value
|
|
11
|
+
return loading.value || disabled.value
|
|
12
12
|
? "extended__multiselect-toggle--disabled"
|
|
13
13
|
: "extended__multiselect-toggle";
|
|
14
14
|
});
|