@fy-/fws-vue 1.1.2 → 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,26 +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
|
-
}
|
|
103
|
-
|
|
104
|
-
onMounted(() => {
|
|
105
|
-
if (props.type === "datepicker" && inputRef.value) {
|
|
106
|
-
dpRef.value = new Datepicker(inputRef.value, {
|
|
107
|
-
autohide: true,
|
|
108
|
-
...props.dpOptions,
|
|
109
|
-
});
|
|
110
|
-
inputRef.value.addEventListener("changeDate", setDpValue);
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
onUnmounted(() => {
|
|
114
|
-
if (dpRef.value) {
|
|
115
|
-
dpRef.value.destroy();
|
|
116
|
-
inputRef.value?.removeEventListener("changeDate", setDpValue);
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
98
|
</script>
|
|
120
99
|
<template>
|
|
121
100
|
<div>
|
|
@@ -204,16 +183,14 @@ onUnmounted(() => {
|
|
|
204
183
|
/>
|
|
205
184
|
</svg>
|
|
206
185
|
</div>
|
|
207
|
-
<
|
|
208
|
-
|
|
209
|
-
type="
|
|
210
|
-
|
|
186
|
+
<VueDatePicker
|
|
187
|
+
v-model="model"
|
|
188
|
+
model-type="yyyy-mm-dd"
|
|
189
|
+
auto-apply
|
|
211
190
|
:placeholder="placeholder"
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
ref="inputRef"
|
|
216
|
-
/>
|
|
191
|
+
year-first
|
|
192
|
+
dark
|
|
193
|
+
></VueDatePicker>
|
|
217
194
|
</div>
|
|
218
195
|
</div>
|
|
219
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
|
}
|