vue3-extended-multiselect 1.7.3 → 1.7.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.7.3**
3
+ Current `vue3-extended-multiselect` version: **1.7.5**
4
4
 
5
5
  ***
6
6
 
@@ -285,4 +285,12 @@ Adding descriptive comments for some types in typings.
285
285
 
286
286
  ### 1.7.3 (2023-02-07)
287
287
 
288
- * Fixing bug with disabled removal of selected options based on external modelValue changes.
288
+ * Fixing bug with disabled removal of selected options based on external modelValue changes.
289
+
290
+ ### 1.7.4 (2023-02-07)
291
+
292
+ * Adding "update:wrapper" event.
293
+
294
+ ### 1.7.5 (2023-02-08)
295
+
296
+ * Removal of excess condition in toggle restriction.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # vue3-extended-multiselect v1.7.3
1
+ # vue3-extended-multiselect v1.7.5
2
2
 
3
3
  ***
4
4
 
@@ -122,6 +122,7 @@ Event name | Event appointment | Listener method | Simplified event payload | Fi
122
122
  **active**|Dropdown options list expanding.|@active|—|``inputId`` — id of search field set by "id" prop|
123
123
  **close**|Rolling up dropdown options list.|@close|``options`` — array of selected options|``options`` — array of selected options,<br/>``inputId`` — id of search field set by "id" prop|
124
124
  **increase**|Increasing current limit of displayed elements with selected options.|@increase|``limit`` — current limit of options to be shown next|``limit`` — current limit of options to be shown next,<br/>``inputId`` — id of search field set by "id" prop|
125
+ **update:wrapper**|Notifies wrapper component that inner modelValue has been updated by external modelValue update|@update:wrapper|``options`` — array of selected options|``options`` — array of selected options,<br/>``inputId`` — id of search field set by "id" prop|
125
126
 
126
127
  ## Styling with css
127
128
 
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.7.3",
8
+ name: "vue3-extended-multiselect 1.7.5",
9
9
  color: "bgGreen",
10
10
  },
11
11
  extraGlobals: [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue3-extended-multiselect",
3
- "version": "1.7.3",
3
+ "version": "1.7.5",
4
4
  "description": "Extended multiselect component for applications based on Vue 3 framework",
5
5
  "keywords": [
6
6
  "multiselect",
@@ -262,7 +262,7 @@ import ExtendedMultiselectToggle from "./ExtendedMultiselectToggle.vue";
262
262
 
263
263
  /**
264
264
  * @author Ridiger Daniil Dmitrievich, 2022
265
- * @version 1.7.3
265
+ * @version 1.7.5
266
266
  */
267
267
 
268
268
  const props = defineProps({
@@ -898,7 +898,8 @@ const emit = defineEmits([
898
898
  "option-created",
899
899
  "pattern-changed",
900
900
  "select",
901
- "update:modelValue"
901
+ "update:modelValue",
902
+ "update:wrapper"
902
903
  ]);
903
904
 
904
905
  const dropdownActive = ref(false);
@@ -1387,6 +1388,7 @@ const setPreselectedOptions = async (preselectedOptions, restriction = true) =>
1387
1388
  * Determines conditions that control preselected options installattion
1388
1389
  * if "modelValue" prop is defined
1389
1390
  * @function
1391
+ * @emits update:wrapper
1390
1392
  * @param {boolean} withRemoval - removal of selected options flag
1391
1393
  */
1392
1394
  const setPreselectedOptionsByModelValue = (withRemoval = false) => {
@@ -1405,6 +1407,11 @@ const setPreselectedOptionsByModelValue = (withRemoval = false) => {
1405
1407
  }
1406
1408
 
1407
1409
  if (withRemoval) {
1410
+ const eventData = simpleEvents.value
1411
+ ? selectedOptions.value
1412
+ : createEventFields(selectedOptions.value, "options");
1413
+
1414
+ emit("update:wrapper", eventData);
1408
1415
  selectedOptionsWatcher.value = watch(selectedOptions, (value) => {
1409
1416
  if (multiple.value) {
1410
1417
  emit("update:modelValue", value);
@@ -1557,10 +1564,6 @@ const toggleDetector = (mouseEvent, pattern, mode) => {
1557
1564
  return pattern.test(className) === true;
1558
1565
  });
1559
1566
 
1560
- if (Array.prototype.some.call(target.classList, (className) => {
1561
- return optionPattern.test(className);
1562
- })) return [];
1563
-
1564
1567
  if (target.classList.contains("extended__multiselect-options_container")) {
1565
1568
  filteredHasToggle.push("extended__multiselect-options_container");
1566
1569
  return filteredHasToggle;
@@ -1637,6 +1640,7 @@ const toggleRestrictor = (mouseEvent) => {
1637
1640
  const filteredHasToggle = toggleDetector(mouseEvent, togglePattern);
1638
1641
 
1639
1642
  if (filteredHasToggle.length && dropdownActive.value) {
1643
+
1640
1644
  emitter.value.emit("extended:skip-blur");
1641
1645
  }
1642
1646
  };