vue3-extended-multiselect 1.8.4 → 1.8.5
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Patch notes
|
|
2
2
|
|
|
3
|
-
Current `vue3-extended-multiselect` version: **1.8.
|
|
3
|
+
Current `vue3-extended-multiselect` version: **1.8.5**
|
|
4
4
|
|
|
5
5
|
***
|
|
6
6
|
|
|
@@ -319,4 +319,9 @@ Adding descriptive comments for some types in typings.
|
|
|
319
319
|
|
|
320
320
|
### 1.8.4 (2023-02-23)
|
|
321
321
|
|
|
322
|
-
* Fixing bug with single select input focus.
|
|
322
|
+
* Fixing bug with single select input focus.
|
|
323
|
+
|
|
324
|
+
### 1.8.5 (2023-03-07)
|
|
325
|
+
|
|
326
|
+
* Adding "resize-observer-polyfill" dev-dependency.
|
|
327
|
+
* Fixing bug with options wrapper resize when "toggleAppearanceSide" prop is set to "atop".
|
package/README.md
CHANGED
package/jest.config.js
CHANGED
|
@@ -5,7 +5,7 @@ module.exports = {
|
|
|
5
5
|
},
|
|
6
6
|
expand: true,
|
|
7
7
|
displayName: {
|
|
8
|
-
name: "vue3-extended-multiselect 1.8.
|
|
8
|
+
name: "vue3-extended-multiselect 1.8.5",
|
|
9
9
|
color: "bgGreen",
|
|
10
10
|
},
|
|
11
11
|
extraGlobals: [],
|
|
@@ -44,6 +44,7 @@ module.exports = {
|
|
|
44
44
|
resetModules: true,
|
|
45
45
|
resetMocks: true,
|
|
46
46
|
rootDir: "./",
|
|
47
|
+
setupFiles: ["<rootDir>/tests/utils/mocks"],
|
|
47
48
|
slowTestThreshold: 20,
|
|
48
49
|
testEnvironment: "jsdom",
|
|
49
50
|
testLocationInResults: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue3-extended-multiselect",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.5",
|
|
4
4
|
"description": "Extended multiselect component for applications based on Vue 3 framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"multiselect",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"babel-plugin-transform-import-meta": "^2.2.0",
|
|
40
40
|
"eslint": "^7.2.0",
|
|
41
41
|
"eslint-plugin-vue": "^7.0.0",
|
|
42
|
+
"resize-observer-polyfill": "^1.5.1",
|
|
42
43
|
"typescript": "~4.1.0",
|
|
43
44
|
"vue-jest": "^5.0.0-0"
|
|
44
45
|
}
|
|
@@ -98,8 +98,10 @@ import {
|
|
|
98
98
|
computed,
|
|
99
99
|
defineProps,
|
|
100
100
|
inject,
|
|
101
|
+
nextTick,
|
|
101
102
|
onBeforeMount,
|
|
102
103
|
onMounted,
|
|
104
|
+
reactive,
|
|
103
105
|
ref,
|
|
104
106
|
toRefs,
|
|
105
107
|
} from "vue";
|
|
@@ -434,7 +436,7 @@ const setSearchPattern = inject("setSearchPattern");
|
|
|
434
436
|
const fieldWasShown = ref(false);
|
|
435
437
|
const atopWithScroll = ref(null);
|
|
436
438
|
const enterIndex = ref(null);
|
|
437
|
-
const heightFromMounted =
|
|
439
|
+
const heightFromMounted = reactive({});
|
|
438
440
|
const underWithScroll = ref(null);
|
|
439
441
|
|
|
440
442
|
/**
|
|
@@ -685,12 +687,43 @@ const showCreateNewOptionBlock = computed(() => {
|
|
|
685
687
|
const styles = computed(() => {
|
|
686
688
|
return [
|
|
687
689
|
heightFromProps.value,
|
|
688
|
-
heightFromMounted
|
|
690
|
+
heightFromMounted,
|
|
689
691
|
atopWithScroll.value,
|
|
690
692
|
underWithScroll.value
|
|
691
693
|
];
|
|
692
694
|
});
|
|
693
695
|
|
|
696
|
+
/**
|
|
697
|
+
* Toggles "border-bottm-right-radius", "border-bottm-right-radius"
|
|
698
|
+
* and "top" css-properties of options wrapper
|
|
699
|
+
*/
|
|
700
|
+
const calculateTopOffset = (afterLoading = false) => {
|
|
701
|
+
nextTick(() => {
|
|
702
|
+
const offsetHeight = optionsWrapper.value.offsetHeight;
|
|
703
|
+
const scrollHeight = optionsWrapper.value.scrollHeight;
|
|
704
|
+
|
|
705
|
+
if (chosenToggleAppearanceSide.value === "atop") {
|
|
706
|
+
if (!optionsWrapper.value) return;
|
|
707
|
+
|
|
708
|
+
if (scrollHeight > offsetHeight) {
|
|
709
|
+
atopWithScroll.value = {
|
|
710
|
+
borderTopRightRadius: 0,
|
|
711
|
+
};
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
if (toggleMaxHeight.value >= offsetHeight || afterLoading) {
|
|
715
|
+
heightFromMounted.top = `-${offsetHeight - 1}px`;
|
|
716
|
+
}
|
|
717
|
+
} else {
|
|
718
|
+
if (scrollHeight > offsetHeight) {
|
|
719
|
+
underWithScroll.value = {
|
|
720
|
+
borderBottomRightRadius: 0,
|
|
721
|
+
};
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
});
|
|
725
|
+
};
|
|
726
|
+
|
|
694
727
|
/**
|
|
695
728
|
* Restricts repeated selection of option
|
|
696
729
|
* @function
|
|
@@ -1143,27 +1176,8 @@ onBeforeMount(() => {
|
|
|
1143
1176
|
* "onMounted" hook of ExtendedMultiselectOptions component
|
|
1144
1177
|
*/
|
|
1145
1178
|
onMounted(() => {
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
if (chosenToggleAppearanceSide.value === "atop") {
|
|
1150
|
-
if (scrollHeight > offsetHeight) {
|
|
1151
|
-
atopWithScroll.value = {
|
|
1152
|
-
borderTopRightRadius: 0,
|
|
1153
|
-
};
|
|
1154
|
-
}
|
|
1155
|
-
|
|
1156
|
-
if (toggleMaxHeight.value > offsetHeight) {
|
|
1157
|
-
heightFromMounted.value = {
|
|
1158
|
-
top: `-${offsetHeight - 1}px`,
|
|
1159
|
-
};
|
|
1160
|
-
}
|
|
1161
|
-
} else {
|
|
1162
|
-
if (scrollHeight > offsetHeight) {
|
|
1163
|
-
underWithScroll.value = {
|
|
1164
|
-
borderBottomRightRadius: 0,
|
|
1165
|
-
};
|
|
1166
|
-
}
|
|
1167
|
-
}
|
|
1179
|
+
new ResizeObserver(() => {
|
|
1180
|
+
calculateTopOffset();
|
|
1181
|
+
}).observe(optionsWrapper.value);
|
|
1168
1182
|
});
|
|
1169
1183
|
</script>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
global.ResizeObserver = require('resize-observer-polyfill');
|