@fy-/fws-vue 1.1.3 → 1.1.4
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.
|
@@ -4,7 +4,7 @@ import { computed, onMounted, onUnmounted, ref, toRef } from "vue";
|
|
|
4
4
|
import type { ErrorObject } from "@vuelidate/core";
|
|
5
5
|
import { useTranslation } from "../../composables/translations";
|
|
6
6
|
import DefaultTagInput from "./DefaultTagInput.vue";
|
|
7
|
-
import
|
|
7
|
+
import VueDatePicker from "@vuepic/vue-datepicker";
|
|
8
8
|
|
|
9
9
|
type modelValueType = string | number | string[] | number[] | undefined;
|
|
10
10
|
|
|
@@ -49,7 +49,6 @@ const translate = useTranslation();
|
|
|
49
49
|
const inputRef = ref<HTMLInputElement>();
|
|
50
50
|
const errorProps = toRef(props, "error");
|
|
51
51
|
const errorVuelidateProps = toRef(props, "errorVuelidate");
|
|
52
|
-
const dpRef = ref<Datepicker | null>(null);
|
|
53
52
|
const checkErrors = computed(() => {
|
|
54
53
|
if (errorProps.value) return errorProps.value;
|
|
55
54
|
if (errorVuelidateProps.value && errorVuelidateProps.value.length > 0) {
|
|
@@ -96,31 +95,6 @@ const modelCheckbox = computed({
|
|
|
96
95
|
},
|
|
97
96
|
});
|
|
98
97
|
defineExpose({ focus, blur, getInputRef });
|
|
99
|
-
|
|
100
|
-
function setDpValue(e: any) {
|
|
101
|
-
model.value = e.detail.date.toISOString().split("T")[0];
|
|
102
|
-
dpValue.value = e.detail.date.toISOString().split("T")[0];
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
const dpValue = ref<string | undefined>(undefined);
|
|
106
|
-
|
|
107
|
-
onMounted(() => {
|
|
108
|
-
if (props.type === "datepicker" && inputRef.value) {
|
|
109
|
-
dpRef.value = new Datepicker(inputRef.value, {
|
|
110
|
-
autohide: true,
|
|
111
|
-
format: "yyyy-mm-dd",
|
|
112
|
-
dateFormat: "yyyy-mm-dd",
|
|
113
|
-
...props.dpOptions,
|
|
114
|
-
});
|
|
115
|
-
inputRef.value.addEventListener("changeDate", setDpValue);
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
onUnmounted(() => {
|
|
119
|
-
if (dpRef.value) {
|
|
120
|
-
dpRef.value.destroy();
|
|
121
|
-
inputRef.value?.removeEventListener("changeDate", setDpValue);
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
98
|
</script>
|
|
125
99
|
<template>
|
|
126
100
|
<div>
|
|
@@ -209,17 +183,14 @@ onUnmounted(() => {
|
|
|
209
183
|
/>
|
|
210
184
|
</svg>
|
|
211
185
|
</div>
|
|
212
|
-
<
|
|
213
|
-
datepicker
|
|
214
|
-
type="text"
|
|
215
|
-
class="bg-fv-neutral-50 border border-fv-neutral-300 text-fv-neutral-900 text-sm rounded-lg focus:ring-fv-primary-500 focus:border-fv-primary-500 block w-full ps-10 p-2.5 dark:bg-fv-neutral-700 dark:border-fv-neutral-600 dark:placeholder-fv-neutral-400 dark:text-white dark:focus:ring-fv-primary-500 dark:focus:border-fv-primary-500"
|
|
216
|
-
:placeholder="placeholder"
|
|
217
|
-
:disabled="disabled"
|
|
218
|
-
:aria-describedby="help ? `${id}-help` : id"
|
|
219
|
-
:required="req"
|
|
220
|
-
ref="inputRef"
|
|
186
|
+
<VueDatePicker
|
|
221
187
|
v-model="model"
|
|
222
|
-
|
|
188
|
+
model-type="yyyy-mm-dd"
|
|
189
|
+
auto-apply
|
|
190
|
+
:placeholder="placeholder"
|
|
191
|
+
year-first
|
|
192
|
+
dark
|
|
193
|
+
></VueDatePicker>
|
|
223
194
|
</div>
|
|
224
195
|
</div>
|
|
225
196
|
<div v-if="type == 'chips' || type == 'tags'">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fy-/fws-vue",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"author": "Florian 'Fy' Gasquez <m@fy.to>",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -40,6 +40,6 @@
|
|
|
40
40
|
"vue": "^3.3.x",
|
|
41
41
|
"vue-picture-cropper": "^0.7.x",
|
|
42
42
|
"vue-router": "^4.1.x",
|
|
43
|
-
"
|
|
43
|
+
"@vuepic/vue-datepicker": "^8.8.x"
|
|
44
44
|
}
|
|
45
45
|
}
|