vue3-extended-multiselect 1.9.0 → 1.9.1
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 +6 -2
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/components/Vue3ExtendedMultiselect.vue +16 -1
- package/tests/unit/events.spec.js +12 -1
- package/tests/utils/utils.js +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Patch notes
|
|
2
2
|
|
|
3
|
-
Current `vue3-extended-multiselect` version: **1.9.
|
|
3
|
+
Current `vue3-extended-multiselect` version: **1.9.1**
|
|
4
4
|
|
|
5
5
|
***
|
|
6
6
|
|
|
@@ -336,4 +336,8 @@ Adding descriptive comments for some types in typings.
|
|
|
336
336
|
* Adding "dropdownDisabled" optional prop.
|
|
337
337
|
* Adding unit-test for new optional prop.
|
|
338
338
|
* Adding some new css-variabled.
|
|
339
|
-
* Removal of excess type from types.
|
|
339
|
+
* Removal of excess type from types.
|
|
340
|
+
|
|
341
|
+
### 1.9.1 (2023-03-20)
|
|
342
|
+
|
|
343
|
+
* Fixing bug with "pattern-changed" event with a call to the internal loader method.
|
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -262,7 +262,7 @@ import ExtendedMultiselectToggle from "./ExtendedMultiselectToggle.vue";
|
|
|
262
262
|
|
|
263
263
|
/**
|
|
264
264
|
* @author Ridiger Daniil Dmitrievich, 2022
|
|
265
|
-
* @version 1.9.
|
|
265
|
+
* @version 1.9.1
|
|
266
266
|
*/
|
|
267
267
|
|
|
268
268
|
const props = defineProps({
|
|
@@ -1713,6 +1713,7 @@ const updateModelValue = () => {
|
|
|
1713
1713
|
* @listens extended:clean-options
|
|
1714
1714
|
* @listens extended:create-option
|
|
1715
1715
|
* @listens extended:increase-display
|
|
1716
|
+
* @listens extended:loader-pattern-changed
|
|
1716
1717
|
* @listens extended:search-pattern-changed
|
|
1717
1718
|
*/
|
|
1718
1719
|
onBeforeMount(() => {
|
|
@@ -1825,6 +1826,20 @@ onBeforeMount(() => {
|
|
|
1825
1826
|
emit("increase", eventData);
|
|
1826
1827
|
});
|
|
1827
1828
|
|
|
1829
|
+
emitter.value.on("extended:loader-pattern-changed", (pattern) => {
|
|
1830
|
+
const eventData = simpleEvents.value
|
|
1831
|
+
? pattern
|
|
1832
|
+
: createEventFields(pattern, "pattern");
|
|
1833
|
+
|
|
1834
|
+
/**
|
|
1835
|
+
* @event pattern-changed
|
|
1836
|
+
* @type {Object}
|
|
1837
|
+
* @property {string} inputId - id of search field set by "id" prop
|
|
1838
|
+
* @property {pattern} - pattern of internal search for available options
|
|
1839
|
+
*/
|
|
1840
|
+
emit("pattern-changed", eventData);
|
|
1841
|
+
});
|
|
1842
|
+
|
|
1828
1843
|
emitter.value.on("extended:search-pattern-changed", (pattern) => {
|
|
1829
1844
|
const eventData = simpleEvents.value
|
|
1830
1845
|
? pattern
|
|
@@ -5,7 +5,8 @@ import {
|
|
|
5
5
|
SEARCH_PATTERN,
|
|
6
6
|
} from "../utils/mount";
|
|
7
7
|
import {
|
|
8
|
-
mockOptionSelection,
|
|
8
|
+
mockOptionSelection,
|
|
9
|
+
mockOptionsLoader,
|
|
9
10
|
createNewOptionsWrapper,
|
|
10
11
|
} from "../utils/utils";
|
|
11
12
|
|
|
@@ -29,6 +30,16 @@ describe("events", () => {
|
|
|
29
30
|
);
|
|
30
31
|
|
|
31
32
|
expect(wrapper.emitted()['pattern-changed'][0][0]).toEqual(globalThis.SEARCH_VALUE);
|
|
33
|
+
|
|
34
|
+
propsData.options = mockOptionsLoader;
|
|
35
|
+
wrapper = await mountComponent(Vue3ExtendedMultiselect, true, propsData);
|
|
36
|
+
|
|
37
|
+
wrapper.vm.emitter.emit(
|
|
38
|
+
"extended:loader-pattern-changed",
|
|
39
|
+
globalThis.SEARCH_VALUE_WITH_RESULTS,
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
expect(wrapper.emitted()['pattern-changed'][0][0]).toEqual(globalThis.SEARCH_VALUE_WITH_RESULTS);
|
|
32
43
|
});
|
|
33
44
|
|
|
34
45
|
|
package/tests/utils/utils.js
CHANGED
|
@@ -10,6 +10,10 @@ export const mockOptionSelection = async (wrapper) => {
|
|
|
10
10
|
await fireEvent.click(optionElement.element);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
export const mockOptionsLoader = async () => {
|
|
14
|
+
return await Promise.resolve(globalThis.OPTIONS);
|
|
15
|
+
}
|
|
16
|
+
|
|
13
17
|
export const expandOptionsList = async (wrapper) => {
|
|
14
18
|
const toggle = wrapper.find("#extended__multiselect-toggle");
|
|
15
19
|
await fireEvent.click(toggle.element);
|
|
@@ -18,4 +22,4 @@ export const expandOptionsList = async (wrapper) => {
|
|
|
18
22
|
export const createNewOptionsWrapper = (wrapper) => {
|
|
19
23
|
const optionsWrapper = wrapper.findComponent(ExtendedMultiselectOptions);
|
|
20
24
|
return optionsWrapper.find("div > div:first-child");
|
|
21
|
-
}
|
|
25
|
+
}
|