adata-ui 4.0.50 → 4.0.51

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.
package/dist/module.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "nuxt": ">=3.16.0"
6
6
  },
7
7
  "failOnWarn": false,
8
- "version": "4.0.50",
8
+ "version": "4.0.51",
9
9
  "builder": {
10
10
  "@nuxt/module-builder": "1.0.1",
11
11
  "unbuild": "3.5.0"
@@ -6,20 +6,11 @@ import { nextTick, ref, useI18n, computed } from "#imports";
6
6
  const props = defineProps({
7
7
  placeholder: { type: String, required: false },
8
8
  yearPicker: { type: Boolean, required: false },
9
- menuTitle: { type: String, required: false }
9
+ menuTitle: { type: String, required: false },
10
+ format: { type: String, required: false }
10
11
  });
11
12
  const { t, locale } = useI18n();
12
13
  const date = defineModel({ type: [Date, null], ...{ default: null } });
13
- function format(date2) {
14
- if (props.yearPicker) {
15
- return date2.getFullYear().toString();
16
- } else {
17
- const day = date2.getDate().toString().padStart(2, "0");
18
- const month = (date2.getMonth() + 1).toString().padStart(2, "0");
19
- const year = date2.getFullYear();
20
- return `${day}/${month}/${year}`;
21
- }
22
- }
23
14
  const datePicker = ref();
24
15
  function closeDatePicker() {
25
16
  datePicker.value?.closeMenu();
@@ -29,15 +20,6 @@ const currentLocale = computed(() => {
29
20
  if (locale.value === "kk") return kk;
30
21
  return ru;
31
22
  });
32
- function selectDate(data) {
33
- if (props.yearPicker) return;
34
- date.value = data;
35
- }
36
- function selectYear(data) {
37
- if (props.yearPicker) {
38
- date.value = data.year;
39
- }
40
- }
41
23
  function menuOpened() {
42
24
  nextTick(() => {
43
25
  const menu = document.querySelector(".dp__menu");
@@ -55,6 +37,7 @@ function menuOpened() {
55
37
  <vue-date-picker
56
38
  ref="datePicker"
57
39
  v-model="date"
40
+ v-bind="$attrs"
58
41
  :enable-time-picker="false"
59
42
  :format="format"
60
43
  :format-locale="currentLocale"
@@ -65,10 +48,10 @@ function menuOpened() {
65
48
  navBtnPrev: 'hidden',
66
49
  menu: 'p-2'
67
50
  }"
51
+ model-type="format"
68
52
  class="custom-date-picker"
53
+ auto-apply
69
54
  @open="menuOpened"
70
- @date-update="selectDate"
71
- @update-month-year="selectYear"
72
55
  >
73
56
  <template #top-extra>
74
57
  <div
@@ -3,6 +3,7 @@ type __VLS_Props = {
3
3
  placeholder?: string;
4
4
  yearPicker?: boolean;
5
5
  menuTitle?: string;
6
+ format?: string;
6
7
  };
7
8
  type __VLS_PublicProps = __VLS_Props & {
8
9
  modelValue?: Date | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adata-ui",
3
- "version": "4.0.50",
3
+ "version": "4.0.51",
4
4
  "description": "Adata UI",
5
5
  "repository": "your-org/my-module",
6
6
  "license": "MIT",