vueless 0.0.368 → 0.0.370

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.368",
3
+ "version": "0.0.370",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -161,14 +161,14 @@ onMounted(() => {
161
161
  selectedItem.value =
162
162
  getToggleType() === TYPE_RADIO
163
163
  ? selectedValue?.value || selectedItem.value
164
- : selectedValue?.value?.includes(props.value) || selectedItem.value;
164
+ : selectedValue?.value?.includes(props.value) || "";
165
165
  });
166
166
 
167
167
  function onClickSetValue() {
168
168
  selectedItem.value =
169
169
  getToggleType() === TYPE_RADIO
170
170
  ? props.value
171
- : selectedValue?.value?.includes(props.value) || selectedItem.value;
171
+ : selectedValue?.value?.includes(props.value) || "";
172
172
 
173
173
  updateSelectedValue && updateSelectedValue(props.value, !selectedItem.value);
174
174
 
@@ -568,7 +568,7 @@ const emit = defineEmits([
568
568
  "addOption",
569
569
 
570
570
  /**
571
- * Triggers when label position is changed.
571
+ * Triggers when the user commits the change to options or selected value explicitly.
572
572
  */
573
573
  "change",
574
574
  ]);
@@ -664,6 +664,7 @@ const dropdownValue = computed({
664
664
  }
665
665
 
666
666
  emit("update:modelValue", value);
667
+ emit("change", { value, options: props.options });
667
668
  deactivate();
668
669
  },
669
670
  });
@@ -727,15 +728,12 @@ const isLocalValue = computed(() => {
727
728
  : Boolean(String(localValue.value));
728
729
  });
729
730
 
730
- watch(search, () => onSearchChange);
731
- watch(
732
- localValue,
733
- () => {
734
- setLabelPosition();
735
- emit("change");
736
- },
737
- { deep: true },
738
- );
731
+ const onSearchChange = debounce(function (query) {
732
+ emit("searchChange", query);
733
+ }, 300);
734
+
735
+ watch(search, onSearchChange);
736
+ watch(localValue, setLabelPosition, { deep: true });
739
737
 
740
738
  if (props.addOption) {
741
739
  document.addEventListener("keydown", onKeydownAddOption);
@@ -743,10 +741,6 @@ if (props.addOption) {
743
741
 
744
742
  onMounted(setLabelPosition);
745
743
 
746
- const onSearchChange = debounce(async function (query) {
747
- emit("searchChange", query);
748
- }, 300);
749
-
750
744
  function getOptionLabel(option) {
751
745
  if (!option) return "";
752
746
 
@@ -762,10 +756,12 @@ function onKeydownAddOption(event) {
762
756
 
763
757
  if (isMeta && isEnter && isMac) {
764
758
  emit("addOption");
759
+ emit("change", { value: dropdownValue.value, options: props.options });
765
760
  }
766
761
 
767
762
  if (isEnter && isCtrl && !isMac) {
768
763
  emit("addOption");
764
+ emit("change", { value: dropdownValue.value, options: props.options });
769
765
  }
770
766
  }
771
767
 
@@ -851,6 +847,7 @@ function removeElement(option, shouldClose = true) {
851
847
  }
852
848
 
853
849
  emit("update:modelValue", value);
850
+ emit("change", { value, options: props.options });
854
851
  emit("remove", option, elementId);
855
852
 
856
853
  if (shouldClose) {
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.368",
4
+ "version": "0.0.370",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",
@@ -7683,7 +7683,7 @@
7683
7683
  },
7684
7684
  {
7685
7685
  "name": "change",
7686
- "description": "Triggers when label position is changed."
7686
+ "description": "Triggers when the user commits the change to options or selected value explicitly."
7687
7687
  }
7688
7688
  ],
7689
7689
  "slots": [