@fy-/fws-vue 0.3.31 → 0.3.41
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.
|
@@ -131,9 +131,9 @@ defineExpose({ focus, blur, getInputRef });
|
|
|
131
131
|
>
|
|
132
132
|
<label
|
|
133
133
|
:for="id"
|
|
134
|
-
v-if="label
|
|
134
|
+
v-if="label"
|
|
135
135
|
class="block mb-2 text-sm font-medium text-fv-neutral-900 dark:text-white"
|
|
136
|
-
>{{ label
|
|
136
|
+
>{{ label }}
|
|
137
137
|
</label>
|
|
138
138
|
<input
|
|
139
139
|
ref="inputRef"
|
|
@@ -238,6 +238,8 @@ defineExpose({ focus, blur, getInputRef });
|
|
|
238
238
|
<input
|
|
239
239
|
type="checkbox"
|
|
240
240
|
v-model="modelCheckbox"
|
|
241
|
+
:true-value="checkboxTrueValue"
|
|
242
|
+
:false-value="checkboxFalseValue"
|
|
241
243
|
class="sr-only peer"
|
|
242
244
|
@focus="handleFocus"
|
|
243
245
|
@blur="handleBlur"
|
|
@@ -269,6 +271,8 @@ defineExpose({ focus, blur, getInputRef });
|
|
|
269
271
|
:type="type"
|
|
270
272
|
@focus="handleFocus"
|
|
271
273
|
@blur="handleBlur"
|
|
274
|
+
:true-value="checkboxTrueValue"
|
|
275
|
+
:false-value="checkboxFalseValue"
|
|
272
276
|
v-model="modelCheckbox"
|
|
273
277
|
class="w-4 h-4 text-fv-primary-600 bg-fv-neutral-100 border-fv-neutral-300 rounded focus:ring-fv-primary-500 dark:focus:ring-fv-primary-600 dark:ring-offset-fv-neutral-800 dark:focus:ring-offset-fv-neutral-800 focus:ring-2 dark:bg-fv-neutral-700 dark:border-fv-neutral-600"
|
|
274
278
|
/>
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
ref="textInput"
|
|
32
32
|
@input="handleInput"
|
|
33
33
|
@paste.prevent="handlePaste"
|
|
34
|
+
@keydown="handleKeydown"
|
|
34
35
|
placeholder="Add a tag..."
|
|
35
36
|
></div>
|
|
36
37
|
</div>
|
|
@@ -126,6 +127,17 @@ const handlePaste = (e: any) => {
|
|
|
126
127
|
e.preventDefault();
|
|
127
128
|
addTag();
|
|
128
129
|
};
|
|
130
|
+
const handleKeydown = (event: KeyboardEvent) => {
|
|
131
|
+
if (!textInput.value) return;
|
|
132
|
+
|
|
133
|
+
// Handles backspace when there is no separator involved
|
|
134
|
+
if (event.key === "Backspace" && textInput.value.innerText) {
|
|
135
|
+
// Prevent default to stop any default backspace behavior
|
|
136
|
+
event.preventDefault();
|
|
137
|
+
// Remove last character
|
|
138
|
+
textInput.value.innerText = textInput.value.innerText.slice(0, -1);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
129
141
|
</script>
|
|
130
142
|
|
|
131
143
|
<style scoped>
|