adata-ui 4.0.44 → 4.0.46

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.44",
8
+ "version": "4.0.46",
9
9
  "builder": {
10
10
  "@nuxt/module-builder": "1.0.1",
11
11
  "unbuild": "3.5.0"
@@ -8,7 +8,7 @@ const props = defineProps({
8
8
  view: { type: String, required: false, default: "default" },
9
9
  size: { type: String, required: false, default: "lg" },
10
10
  form: { type: String, required: false, default: "button" },
11
- icon: { type: [Object, Function], required: false },
11
+ icon: { type: null, required: false },
12
12
  iconClass: { type: String, required: false, default: "" },
13
13
  loading: { type: Boolean, required: false, default: false },
14
14
  disabled: { type: Boolean, required: false, default: false },
@@ -21,12 +21,12 @@ declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {},
21
21
  view: "default" | "outline" | "transparent";
22
22
  disabled: boolean;
23
23
  active: boolean;
24
- to: string;
25
24
  loading: boolean;
26
25
  variant: "primary" | "success" | "danger" | "gray" | "ghost";
27
26
  form: "icon" | "button";
28
27
  iconClass: string;
29
28
  block: boolean;
29
+ to: string;
30
30
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
31
31
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
32
32
  export default _default;
@@ -1,5 +1,6 @@
1
1
  <script setup>
2
2
  import { twMerge } from "tailwind-merge";
3
+ import { useSlots, computed } from "#imports";
3
4
  defineOptions({ name: "ACheckbox" });
4
5
  const emit = defineEmits(["update:modelValue"]);
5
6
  const props = defineProps({
@@ -0,0 +1,119 @@
1
+ <script setup>
2
+ import VueDatePicker from "@vuepic/vue-datepicker";
3
+ import "@vuepic/vue-datepicker/dist/main.css";
4
+ import { kk, ru, enUS } from "date-fns/locale";
5
+ import { nextTick, ref, useI18n, computed } from "#imports";
6
+ const props = defineProps({
7
+ placeholder: { type: String, required: false },
8
+ yearPicker: { type: Boolean, required: false },
9
+ menuTitle: { type: String, required: false }
10
+ });
11
+ const { t, locale } = useI18n();
12
+ 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
+ const datePicker = ref();
24
+ function closeDatePicker() {
25
+ datePicker.value?.closeMenu();
26
+ }
27
+ const currentLocale = computed(() => {
28
+ if (locale.value === "en") return enUS;
29
+ if (locale.value === "kk") return kk;
30
+ return ru;
31
+ });
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
+ function menuOpened() {
42
+ nextTick(() => {
43
+ const menu = document.querySelector(".dp__menu");
44
+ menu?.classList.remove("dp__theme_light");
45
+ menu?.classList.add("date-picker-menu-shadow");
46
+ const topArrow = document.querySelector(".dp__arrow_top");
47
+ const bottomArrow = document.querySelector(".dp__arrow_bottom");
48
+ topArrow?.remove();
49
+ bottomArrow?.remove();
50
+ });
51
+ }
52
+ </script>
53
+
54
+ <template>
55
+ <vue-date-picker
56
+ ref="datePicker"
57
+ v-model="date"
58
+ :enable-time-picker="false"
59
+ :format="format"
60
+ :format-locale="currentLocale"
61
+ :placeholder="placeholder || t('reuse.date')"
62
+ :year-picker="yearPicker"
63
+ :ui="{
64
+ navBtnNext: 'hidden',
65
+ navBtnPrev: 'hidden',
66
+ menu: 'p-2'
67
+ }"
68
+ class="custom-date-picker"
69
+ @open="menuOpened"
70
+ @date-update="selectDate"
71
+ @update-month-year="selectYear"
72
+ >
73
+ <template #top-extra>
74
+ <div
75
+ class="flex items-center justify-between"
76
+ :class="{ 'mb-2': yearPicker }"
77
+ >
78
+ <p class="text-base font-semibold">
79
+ {{ menuTitle || t("reuse.selectDate") }}
80
+ </p>
81
+ <i-x-mark
82
+ class="cursor-pointer size-6 shrink-0"
83
+ @click="closeDatePicker"
84
+ />
85
+ </div>
86
+ </template>
87
+ <template #calendar-header="{ index, day }">
88
+ <p class="text-gray-600 dark:text-gray-200 text-sm font-normal">
89
+ {{ day }}
90
+ </p>
91
+ </template>
92
+ <template #action-row />
93
+ <template #action-preview />
94
+ <template #action-buttons />
95
+ </vue-date-picker>
96
+ </template>
97
+
98
+ <style>
99
+ .custom-date-picker {
100
+ --dp-border-radius: 8px;
101
+ --dp-background-color: white;
102
+ --dp-menu-border-color: white;
103
+ --dp-border-color: white;
104
+ --dp-text-color: #2C3E50;
105
+ --dp-primary-color: #0070EB;
106
+ }
107
+
108
+ .date-picker-menu-shadow {
109
+ box-shadow: 0px 1px 8px 0px rgba(139, 146, 156, 0.3019607843);
110
+ }
111
+
112
+ .dark .custom-date-picker {
113
+ --dp-background-color: #26282B;
114
+ --dp-menu-border-color: #26282B;
115
+ --dp-border-color: #26282B;
116
+ --dp-text-color: #e3e5e8;
117
+ --dp-primary-color: #1B98E2;
118
+ }
119
+ </style>
@@ -0,0 +1,15 @@
1
+ import '@vuepic/vue-datepicker/dist/main.css';
2
+ type __VLS_Props = {
3
+ placeholder?: string;
4
+ yearPicker?: boolean;
5
+ menuTitle?: string;
6
+ };
7
+ type __VLS_PublicProps = __VLS_Props & {
8
+ modelValue?: Date | null;
9
+ };
10
+ declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
+ "update:modelValue": (value: Date | null) => any;
12
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
13
+ "onUpdate:modelValue"?: ((value: Date | null) => any) | undefined;
14
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ export default _default;
@@ -7,7 +7,7 @@ const props = defineProps({
7
7
  titleClasses: { type: String, required: false },
8
8
  cardClasses: { type: String, required: false },
9
9
  valueClasses: { type: String, required: false },
10
- icon: { type: [Object, Function], required: false }
10
+ icon: { type: null, required: false }
11
11
  });
12
12
  const combinedCardClasses = twMerge("flex justify-between items-center rounded-md py-3 px-4 dark:bg-gray-900 bg-white", props.cardClasses);
13
13
  const combinedLeadingClasses = twMerge("rounded-full size-4", props.leadingColor);
@@ -1,2 +1,2 @@
1
- export declare const useCurrentModule: () => import("vue").Ref<string, string>;
2
- export declare const useContacts: () => import("vue").Ref<any, any>;
1
+ export declare const useCurrentModule: () => any;
2
+ export declare const useContacts: () => any;
@@ -21,6 +21,8 @@ declare const _default: {
21
21
  };
22
22
  reuse: {
23
23
  yes: string;
24
+ selectDate: string;
25
+ date: string;
24
26
  };
25
27
  header: {
26
28
  top: {
@@ -566,6 +568,8 @@ declare const _default: {
566
568
  };
567
569
  reuse: {
568
570
  yes: string;
571
+ selectDate: string;
572
+ date: string;
569
573
  };
570
574
  header: {
571
575
  top: {
@@ -1111,6 +1115,8 @@ declare const _default: {
1111
1115
  };
1112
1116
  reuse: {
1113
1117
  yes: string;
1118
+ selectDate: string;
1119
+ date: string;
1114
1120
  };
1115
1121
  header: {
1116
1122
  top: {
@@ -1,2 +1,2 @@
1
- declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
1
+ declare const _default: any;
2
2
  export default _default;
@@ -14,7 +14,9 @@ const EnLocale = {
14
14
  }
15
15
  },
16
16
  reuse: {
17
- yes: "Yes"
17
+ yes: "Yes",
18
+ selectDate: "Select date",
19
+ date: "Date"
18
20
  },
19
21
  header: {
20
22
  top: {
@@ -14,7 +14,9 @@ const KkLocale = {
14
14
  }
15
15
  },
16
16
  reuse: {
17
- yes: "\u0418\u04D9"
17
+ yes: "\u0418\u04D9",
18
+ selectDate: "\u041A\u04AF\u043D\u0434\u0456 \u0442\u0430\u04A3\u0434\u0430\u04A3\u044B\u0437",
19
+ date: "\u041A\u04AF\u043D\u0456"
18
20
  },
19
21
  header: {
20
22
  top: {
@@ -15,6 +15,8 @@ declare const RuLocale: {
15
15
  };
16
16
  reuse: {
17
17
  yes: string;
18
+ selectDate: string;
19
+ date: string;
18
20
  };
19
21
  header: {
20
22
  top: {
@@ -14,7 +14,9 @@ const RuLocale = {
14
14
  }
15
15
  },
16
16
  reuse: {
17
- yes: "\u0414\u0430"
17
+ yes: "\u0414\u0430",
18
+ selectDate: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0434\u0430\u0442\u0443",
19
+ date: "\u0414\u0430\u0442\u0430"
18
20
  },
19
21
  header: {
20
22
  top: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adata-ui",
3
- "version": "4.0.44",
3
+ "version": "4.0.46",
4
4
  "description": "Adata UI",
5
5
  "repository": "your-org/my-module",
6
6
  "license": "MIT",
@@ -39,6 +39,7 @@
39
39
  "@nuxtjs/i18n": "^9.5.4",
40
40
  "@tailwindcss/postcss": "^4.1.6",
41
41
  "@tailwindcss/vite": "^4.1.6",
42
+ "@vuepic/vue-datepicker": "^11.0.2",
42
43
  "defu": "^6.1.4",
43
44
  "reka-ui": "^2.2.1",
44
45
  "sass": "^1.89.0",