@fy-/fws-vue 0.9.7 → 0.9.8

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.
@@ -1,9 +1,11 @@
1
1
  <script setup lang="ts">
2
2
  import { LinkIcon } from "@heroicons/vue/24/solid";
3
- import { computed, ref, toRef } from "vue";
3
+ import { computed, onMounted, 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 Datepicker from "flowbite-datepicker/Datepicker";
8
+
7
9
  type modelValueType = string | number | string[] | number[] | undefined;
8
10
 
9
11
  type checkboxValueType = any[] | Set<any> | undefined | boolean;
@@ -45,7 +47,7 @@ const translate = useTranslation();
45
47
  const inputRef = ref<HTMLInputElement>();
46
48
  const errorProps = toRef(props, "error");
47
49
  const errorVuelidateProps = toRef(props, "errorVuelidate");
48
-
50
+ const dpRef = ref<Datepicker | null>(null);
49
51
  const checkErrors = computed(() => {
50
52
  if (errorProps.value) return errorProps.value;
51
53
  if (errorVuelidateProps.value && errorVuelidateProps.value.length > 0) {
@@ -92,6 +94,15 @@ const modelCheckbox = computed({
92
94
  },
93
95
  });
94
96
  defineExpose({ focus, blur, getInputRef });
97
+
98
+ onMounted(() => {
99
+ if (props.type === "datepicker" && inputRef.value) {
100
+ dpRef.value = new Datepicker(inputRef.value, {
101
+ format: "dd/mm/yyyy",
102
+ autohide: true,
103
+ });
104
+ }
105
+ });
95
106
  </script>
96
107
  <template>
97
108
  <div>
@@ -191,6 +202,7 @@ defineExpose({ focus, blur, getInputRef });
191
202
  @focus="handleFocus"
192
203
  @blur="handleBlur"
193
204
  v-model="model"
205
+ ref="inputRef"
194
206
  />
195
207
  </div>
196
208
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fy-/fws-vue",
3
- "version": "0.9.7",
3
+ "version": "0.9.8",
4
4
  "author": "Florian 'Fy' Gasquez <m@fy.to>",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -38,7 +38,8 @@
38
38
  "pinia": "2.x.x",
39
39
  "timeago.js": "^4.0.x",
40
40
  "vue": "^3.3.x",
41
+ "vue-picture-cropper": "^0.7.x",
41
42
  "vue-router": "^4.1.x",
42
- "vue-picture-cropper": "^0.7.x"
43
+ "flowbite-datepicker": "^1.2.x"
43
44
  }
44
45
  }