@fy-/fws-vue 1.3.1 → 1.3.3

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.
@@ -3,7 +3,7 @@ import { LinkIcon } from "@heroicons/vue/24/solid";
3
3
  import { computed, onMounted, onUnmounted, ref, toRef } from "vue";
4
4
  import type { ErrorObject } from "@vuelidate/core";
5
5
  import { useTranslation } from "../../composables/translations";
6
- //import DefaultTagInput from "./DefaultTagInput.vue";
6
+ import DefaultTagInput from "./DefaultTagInput.vue";
7
7
 
8
8
  type modelValueType = string | number | string[] | number[] | undefined;
9
9
 
@@ -96,16 +96,12 @@ const modelCheckbox = computed({
96
96
  });
97
97
  defineExpose({ focus, blur, getInputRef });
98
98
  const dpComponent = ref<any | null>(null);
99
- const dptagComponent = ref<any | null>(null);
100
99
  onMounted(async () => {
101
- if (props.type === "datepicker") {
100
+ if (!import.meta.env.SSR) {
101
+ // Dynamically import VueDatePicker only on the client side
102
102
  const { default: VueDatePicker } = await import("@vuepic/vue-datepicker");
103
103
  dpComponent.value = VueDatePicker;
104
104
  }
105
- if (props.type === "tags" || props.type === "chips") {
106
- const { default: DefaultTagInput } = await import("./DefaultTagInput.vue");
107
- dptagComponent.value = DefaultTagInput;
108
- }
109
105
  });
110
106
  </script>
111
107
  <template>
@@ -215,9 +211,7 @@ onMounted(async () => {
215
211
  >{{ label ? label : placeholder }}
216
212
  </label>
217
213
  <!-- @vue-skip -->
218
- <component
219
- :is="dptagComponent"
220
- v-if="dptagComponent"
214
+ <DefaultTagInput
221
215
  v-model="model"
222
216
  :id="id"
223
217
  :disabled="disabled"
@@ -63,7 +63,6 @@ const removeTag = (index: number) => {
63
63
  focusInput();
64
64
  };
65
65
 
66
- /*
67
66
  const removeLastTag = () => {
68
67
  if (!textInput.value) return;
69
68
  if (textInput.value.innerText === "") {
@@ -85,7 +84,7 @@ const removeLastTag = () => {
85
84
  }
86
85
  }
87
86
  };
88
- */
87
+
89
88
  const focusInput = () => {
90
89
  if (!textInput.value) return;
91
90
 
@@ -110,6 +109,7 @@ const handlePaste = (e: any) => {
110
109
  :class="`tags-input ${$props.error ? 'error' : ''}`"
111
110
  @click="focusInput"
112
111
  @keydown.enter.prevent="addTag"
112
+ @keydown.backspace.prevent="removeLastTag"
113
113
  >
114
114
  <span
115
115
  v-for="(tag, index) in model"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fy-/fws-vue",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "author": "Florian 'Fy' Gasquez <m@fy.to>",
5
5
  "license": "MIT",
6
6
  "repository": {