adata-ui 4.0.45 → 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 +1 -1
- package/dist/runtime/components/button/Button.vue +1 -1
- package/dist/runtime/components/button/Button.vue.d.ts +1 -1
- package/dist/runtime/components/date-picker/DatePicker.vue +119 -0
- package/dist/runtime/components/date-picker/DatePicker.vue.d.ts +15 -0
- package/dist/runtime/components/row-card/RowCard.vue +1 -1
- package/dist/runtime/composables/projectState.d.ts +2 -2
- package/dist/runtime/i18n/i18n.config.d.ts +6 -0
- package/dist/runtime/i18n.d.ts +1 -1
- package/dist/runtime/lang/en.js +3 -1
- package/dist/runtime/lang/kk.js +3 -1
- package/dist/runtime/lang/ru.d.ts +2 -0
- package/dist/runtime/lang/ru.js +3 -1
- package/package.json +2 -1
package/dist/module.json
CHANGED
|
@@ -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:
|
|
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;
|
|
@@ -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:
|
|
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: () =>
|
|
2
|
-
export declare const useContacts: () =>
|
|
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: {
|
package/dist/runtime/i18n.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: any;
|
|
2
2
|
export default _default;
|
package/dist/runtime/lang/en.js
CHANGED
package/dist/runtime/lang/kk.js
CHANGED
package/dist/runtime/lang/ru.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adata-ui",
|
|
3
|
-
"version": "4.0.
|
|
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",
|