@katlux/toolkit 0.1.0-beta.43 → 0.1.0-beta.45
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/KCombobox/KCombobox.global.d.vue.ts +1 -1
- package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +1 -1
- package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +41 -2
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue +10 -1
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +41 -2
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.d.ts +15 -0
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.js +79 -4
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +39 -2
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue +9 -1
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +39 -2
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.d.ts +15 -0
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.js +113 -13
- package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +21 -1
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue +24 -11
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +21 -1
- package/dist/runtime/components/KHourPicker/KHourPicker.logic.d.ts +14 -3
- package/dist/runtime/components/KHourPicker/KHourPicker.logic.js +25 -10
- package/dist/runtime/components/KHourSelect/KHourSelect.logic.js +4 -1
- package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +3 -2
- package/dist/runtime/components/KTextbox/KTextbox.global.vue +2 -2
- package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +3 -2
- package/dist/runtime/components/KTextbox/KTextbox.logic.d.ts +4 -4
- package/dist/runtime/components/KTextbox/KTextbox.logic.js +4 -4
- package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +1 -1
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +1 -1
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.d.vue.ts +2 -0
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue +3 -1
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue.d.ts +2 -0
- package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.d.vue.ts +2 -0
- package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue +3 -1
- package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue.d.ts +2 -0
- package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.d.vue.ts +6 -2
- package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue +23 -13
- package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue.d.ts +6 -2
- package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue +6 -1
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.d.vue.ts +1 -1
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue +2 -2
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue.d.ts +1 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -87,12 +87,12 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
87
87
|
}>, {
|
|
88
88
|
disabled: boolean;
|
|
89
89
|
modelValue: import("@katlux/providers").TDataRow | import("@katlux/providers").TDataRow[] | null;
|
|
90
|
-
visibleFields: String[];
|
|
91
90
|
searchbox: boolean;
|
|
92
91
|
placeholder: string;
|
|
93
92
|
closeOnSelect: boolean;
|
|
94
93
|
multiSelect: boolean;
|
|
95
94
|
maxSelectedDisplay: string | number | boolean;
|
|
95
|
+
visibleFields: String[];
|
|
96
96
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
97
97
|
declare const _default: typeof __VLS_export;
|
|
98
98
|
export default _default;
|
|
@@ -87,12 +87,12 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
87
87
|
}>, {
|
|
88
88
|
disabled: boolean;
|
|
89
89
|
modelValue: import("@katlux/providers").TDataRow | import("@katlux/providers").TDataRow[] | null;
|
|
90
|
-
visibleFields: String[];
|
|
91
90
|
searchbox: boolean;
|
|
92
91
|
placeholder: string;
|
|
93
92
|
closeOnSelect: boolean;
|
|
94
93
|
multiSelect: boolean;
|
|
95
94
|
maxSelectedDisplay: string | number | boolean;
|
|
95
|
+
visibleFields: String[];
|
|
96
96
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
97
97
|
declare const _default: typeof __VLS_export;
|
|
98
98
|
export default _default;
|
|
@@ -7,6 +7,18 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
7
7
|
type: (DateConstructor | StringConstructor)[];
|
|
8
8
|
default: undefined;
|
|
9
9
|
};
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: (DateConstructor | StringConstructor)[];
|
|
12
|
+
default: undefined;
|
|
13
|
+
};
|
|
14
|
+
isOpen: {
|
|
15
|
+
type: BooleanConstructor;
|
|
16
|
+
default: boolean;
|
|
17
|
+
};
|
|
18
|
+
showClear: {
|
|
19
|
+
type: BooleanConstructor;
|
|
20
|
+
default: boolean;
|
|
21
|
+
};
|
|
10
22
|
calendarDefinedDays: {
|
|
11
23
|
type: import("vue").PropType<IDefinedDay[]>;
|
|
12
24
|
default: () => never[];
|
|
@@ -15,7 +27,13 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
15
27
|
type: import("vue").PropType<IMarkedDay[]>;
|
|
16
28
|
default: () => never[];
|
|
17
29
|
};
|
|
18
|
-
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}
|
|
30
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
31
|
+
"update:modelValue": (value: string | Date) => any;
|
|
32
|
+
"update:maskedModel": (value: string) => any;
|
|
33
|
+
"update:calendarShow": (value: boolean) => any;
|
|
34
|
+
"update:day": (value: string | Date) => any;
|
|
35
|
+
"update:isOpen": (value: boolean) => any;
|
|
36
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
37
|
format: {
|
|
20
38
|
type: StringConstructor;
|
|
21
39
|
default: string;
|
|
@@ -24,6 +42,18 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
24
42
|
type: (DateConstructor | StringConstructor)[];
|
|
25
43
|
default: undefined;
|
|
26
44
|
};
|
|
45
|
+
modelValue: {
|
|
46
|
+
type: (DateConstructor | StringConstructor)[];
|
|
47
|
+
default: undefined;
|
|
48
|
+
};
|
|
49
|
+
isOpen: {
|
|
50
|
+
type: BooleanConstructor;
|
|
51
|
+
default: boolean;
|
|
52
|
+
};
|
|
53
|
+
showClear: {
|
|
54
|
+
type: BooleanConstructor;
|
|
55
|
+
default: boolean;
|
|
56
|
+
};
|
|
27
57
|
calendarDefinedDays: {
|
|
28
58
|
type: import("vue").PropType<IDefinedDay[]>;
|
|
29
59
|
default: () => never[];
|
|
@@ -32,9 +62,18 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
32
62
|
type: import("vue").PropType<IMarkedDay[]>;
|
|
33
63
|
default: () => never[];
|
|
34
64
|
};
|
|
35
|
-
}>> & Readonly<{
|
|
65
|
+
}>> & Readonly<{
|
|
66
|
+
"onUpdate:modelValue"?: ((value: string | Date) => any) | undefined;
|
|
67
|
+
"onUpdate:maskedModel"?: ((value: string) => any) | undefined;
|
|
68
|
+
"onUpdate:calendarShow"?: ((value: boolean) => any) | undefined;
|
|
69
|
+
"onUpdate:day"?: ((value: string | Date) => any) | undefined;
|
|
70
|
+
"onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
|
|
71
|
+
}>, {
|
|
72
|
+
isOpen: boolean;
|
|
36
73
|
day: string | Date;
|
|
74
|
+
modelValue: string | Date;
|
|
37
75
|
format: string;
|
|
76
|
+
showClear: boolean;
|
|
38
77
|
calendarDefinedDays: IDefinedDay[];
|
|
39
78
|
calendarMarkedDays: IMarkedDay[];
|
|
40
79
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useKDatePickerLogic, KDatePickerDefaultProps } from "./KDatePicker.logic";
|
|
3
3
|
import { usePresetComponent } from "../../composables/usePresetComponent";
|
|
4
|
-
import { computed } from "vue";
|
|
4
|
+
import { computed, watch } from "vue";
|
|
5
5
|
import KDatePickerDefault from "../../presets/default/components/KDatePicker/KDatePicker.vue";
|
|
6
6
|
const props = defineProps(KDatePickerDefaultProps);
|
|
7
|
+
const emit = defineEmits(["update:maskedModel", "update:calendarShow", "update:day", "update:modelValue", "update:isOpen"]);
|
|
7
8
|
const {
|
|
8
9
|
_date,
|
|
9
10
|
maskedModel,
|
|
@@ -19,6 +20,7 @@ const templateProps = computed(() => ({
|
|
|
19
20
|
_date: _date.value,
|
|
20
21
|
calendarDay: calendarDay.value,
|
|
21
22
|
format: props.format,
|
|
23
|
+
showClear: props.showClear,
|
|
22
24
|
calendarDefinedDays: props.calendarDefinedDays,
|
|
23
25
|
calendarMarkedDays: props.calendarMarkedDays,
|
|
24
26
|
textboxClicked,
|
|
@@ -33,6 +35,13 @@ const updateCalendarShow = (val) => {
|
|
|
33
35
|
const handleDateSelected = (date) => {
|
|
34
36
|
dateSelected(date);
|
|
35
37
|
};
|
|
38
|
+
watch(_date, (newDate) => {
|
|
39
|
+
emit("update:day", newDate);
|
|
40
|
+
emit("update:modelValue", newDate);
|
|
41
|
+
});
|
|
42
|
+
watch(calendarShow, (newVal) => {
|
|
43
|
+
emit("update:isOpen", newVal);
|
|
44
|
+
});
|
|
36
45
|
</script>
|
|
37
46
|
|
|
38
47
|
<template lang="pug">
|
|
@@ -7,6 +7,18 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
7
7
|
type: (DateConstructor | StringConstructor)[];
|
|
8
8
|
default: undefined;
|
|
9
9
|
};
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: (DateConstructor | StringConstructor)[];
|
|
12
|
+
default: undefined;
|
|
13
|
+
};
|
|
14
|
+
isOpen: {
|
|
15
|
+
type: BooleanConstructor;
|
|
16
|
+
default: boolean;
|
|
17
|
+
};
|
|
18
|
+
showClear: {
|
|
19
|
+
type: BooleanConstructor;
|
|
20
|
+
default: boolean;
|
|
21
|
+
};
|
|
10
22
|
calendarDefinedDays: {
|
|
11
23
|
type: import("vue").PropType<IDefinedDay[]>;
|
|
12
24
|
default: () => never[];
|
|
@@ -15,7 +27,13 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
15
27
|
type: import("vue").PropType<IMarkedDay[]>;
|
|
16
28
|
default: () => never[];
|
|
17
29
|
};
|
|
18
|
-
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}
|
|
30
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
31
|
+
"update:modelValue": (value: string | Date) => any;
|
|
32
|
+
"update:maskedModel": (value: string) => any;
|
|
33
|
+
"update:calendarShow": (value: boolean) => any;
|
|
34
|
+
"update:day": (value: string | Date) => any;
|
|
35
|
+
"update:isOpen": (value: boolean) => any;
|
|
36
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
37
|
format: {
|
|
20
38
|
type: StringConstructor;
|
|
21
39
|
default: string;
|
|
@@ -24,6 +42,18 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
24
42
|
type: (DateConstructor | StringConstructor)[];
|
|
25
43
|
default: undefined;
|
|
26
44
|
};
|
|
45
|
+
modelValue: {
|
|
46
|
+
type: (DateConstructor | StringConstructor)[];
|
|
47
|
+
default: undefined;
|
|
48
|
+
};
|
|
49
|
+
isOpen: {
|
|
50
|
+
type: BooleanConstructor;
|
|
51
|
+
default: boolean;
|
|
52
|
+
};
|
|
53
|
+
showClear: {
|
|
54
|
+
type: BooleanConstructor;
|
|
55
|
+
default: boolean;
|
|
56
|
+
};
|
|
27
57
|
calendarDefinedDays: {
|
|
28
58
|
type: import("vue").PropType<IDefinedDay[]>;
|
|
29
59
|
default: () => never[];
|
|
@@ -32,9 +62,18 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
32
62
|
type: import("vue").PropType<IMarkedDay[]>;
|
|
33
63
|
default: () => never[];
|
|
34
64
|
};
|
|
35
|
-
}>> & Readonly<{
|
|
65
|
+
}>> & Readonly<{
|
|
66
|
+
"onUpdate:modelValue"?: ((value: string | Date) => any) | undefined;
|
|
67
|
+
"onUpdate:maskedModel"?: ((value: string) => any) | undefined;
|
|
68
|
+
"onUpdate:calendarShow"?: ((value: boolean) => any) | undefined;
|
|
69
|
+
"onUpdate:day"?: ((value: string | Date) => any) | undefined;
|
|
70
|
+
"onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
|
|
71
|
+
}>, {
|
|
72
|
+
isOpen: boolean;
|
|
36
73
|
day: string | Date;
|
|
74
|
+
modelValue: string | Date;
|
|
37
75
|
format: string;
|
|
76
|
+
showClear: boolean;
|
|
38
77
|
calendarDefinedDays: IDefinedDay[];
|
|
39
78
|
calendarMarkedDays: IMarkedDay[];
|
|
40
79
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -3,6 +3,9 @@ import type { IMarkedDay, IDefinedDay } from '@katlux/toolkit/components/KCalend
|
|
|
3
3
|
export interface KDatePickerProps {
|
|
4
4
|
format: string;
|
|
5
5
|
day?: Date | string;
|
|
6
|
+
modelValue?: Date | string;
|
|
7
|
+
isOpen?: boolean;
|
|
8
|
+
showClear?: boolean;
|
|
6
9
|
calendarDefinedDays: IDefinedDay[];
|
|
7
10
|
calendarMarkedDays: IMarkedDay[];
|
|
8
11
|
}
|
|
@@ -15,6 +18,18 @@ export declare const KDatePickerDefaultProps: {
|
|
|
15
18
|
type: (DateConstructor | StringConstructor)[];
|
|
16
19
|
default: undefined;
|
|
17
20
|
};
|
|
21
|
+
modelValue: {
|
|
22
|
+
type: (DateConstructor | StringConstructor)[];
|
|
23
|
+
default: undefined;
|
|
24
|
+
};
|
|
25
|
+
isOpen: {
|
|
26
|
+
type: BooleanConstructor;
|
|
27
|
+
default: boolean;
|
|
28
|
+
};
|
|
29
|
+
showClear: {
|
|
30
|
+
type: BooleanConstructor;
|
|
31
|
+
default: boolean;
|
|
32
|
+
};
|
|
18
33
|
calendarDefinedDays: {
|
|
19
34
|
type: PropType<IDefinedDay[]>;
|
|
20
35
|
default: () => never[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref, onMounted, computed } from "vue";
|
|
1
|
+
import { ref, watch, onMounted, computed } from "vue";
|
|
2
2
|
export const KDatePickerDefaultProps = {
|
|
3
3
|
format: {
|
|
4
4
|
type: String,
|
|
@@ -8,6 +8,18 @@ export const KDatePickerDefaultProps = {
|
|
|
8
8
|
type: [Date, String],
|
|
9
9
|
default: void 0
|
|
10
10
|
},
|
|
11
|
+
modelValue: {
|
|
12
|
+
type: [Date, String],
|
|
13
|
+
default: void 0
|
|
14
|
+
},
|
|
15
|
+
isOpen: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: false
|
|
18
|
+
},
|
|
19
|
+
showClear: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: false
|
|
22
|
+
},
|
|
11
23
|
calendarDefinedDays: {
|
|
12
24
|
type: Array,
|
|
13
25
|
default: () => []
|
|
@@ -21,6 +33,34 @@ export function useKDatePickerLogic(props) {
|
|
|
21
33
|
const _date = ref("");
|
|
22
34
|
const maskedModel = ref("");
|
|
23
35
|
const calendarShow = ref(false);
|
|
36
|
+
watch(maskedModel, (newVal) => {
|
|
37
|
+
if (newVal === "") {
|
|
38
|
+
_date.value = "";
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const format = props.format;
|
|
42
|
+
let day = "", month = "", year = "";
|
|
43
|
+
let rawIdx = 0;
|
|
44
|
+
for (let i = 0; i < format.length; i++) {
|
|
45
|
+
const char = format[i];
|
|
46
|
+
if (char === "M") {
|
|
47
|
+
month += newVal[rawIdx] || "";
|
|
48
|
+
rawIdx++;
|
|
49
|
+
} else if (char === "D") {
|
|
50
|
+
day += newVal[rawIdx] || "";
|
|
51
|
+
rawIdx++;
|
|
52
|
+
} else if (char === "Y") {
|
|
53
|
+
year += newVal[rawIdx] || "";
|
|
54
|
+
rawIdx++;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (month.length === 2 && day.length === 2 && year.length === 4) {
|
|
58
|
+
const d = new Date(parseInt(year), parseInt(month) - 1, parseInt(day));
|
|
59
|
+
if (!isNaN(d.getTime())) {
|
|
60
|
+
_date.value = d;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
});
|
|
24
64
|
const textboxClicked = () => {
|
|
25
65
|
calendarShow.value = true;
|
|
26
66
|
};
|
|
@@ -44,11 +84,46 @@ export function useKDatePickerLogic(props) {
|
|
|
44
84
|
return formattedDate;
|
|
45
85
|
};
|
|
46
86
|
onMounted(() => {
|
|
47
|
-
|
|
87
|
+
if (props.modelValue) {
|
|
88
|
+
_date.value = props.modelValue;
|
|
89
|
+
} else if (props.day) {
|
|
90
|
+
_date.value = props.day;
|
|
91
|
+
}
|
|
92
|
+
if (props.isOpen) {
|
|
93
|
+
calendarShow.value = props.isOpen;
|
|
94
|
+
}
|
|
95
|
+
if (_date.value) {
|
|
96
|
+
const initialDate = _date.value instanceof Date ? _date.value : new Date(_date.value);
|
|
97
|
+
if (!isNaN(initialDate.getTime())) {
|
|
98
|
+
maskedModel.value = formatDate(initialDate);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
48
101
|
});
|
|
102
|
+
watch(() => props.day, (newDay) => {
|
|
103
|
+
if (newDay) {
|
|
104
|
+
_date.value = newDay;
|
|
105
|
+
syncMaskedModel(newDay);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
watch(() => props.modelValue, (newVal) => {
|
|
109
|
+
if (newVal) {
|
|
110
|
+
_date.value = newVal;
|
|
111
|
+
syncMaskedModel(newVal);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
watch(() => props.isOpen, (newVal) => {
|
|
115
|
+
calendarShow.value = !!newVal;
|
|
116
|
+
});
|
|
117
|
+
const syncMaskedModel = (val) => {
|
|
118
|
+
const d = val instanceof Date ? val : new Date(val);
|
|
119
|
+
if (!isNaN(d.getTime())) {
|
|
120
|
+
maskedModel.value = formatDate(d);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
49
123
|
const calendarDay = computed(() => {
|
|
50
|
-
|
|
51
|
-
|
|
124
|
+
const val = props.modelValue || props.day;
|
|
125
|
+
if (val) {
|
|
126
|
+
return val;
|
|
52
127
|
}
|
|
53
128
|
return /* @__PURE__ */ new Date();
|
|
54
129
|
});
|
|
@@ -11,6 +11,18 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
11
11
|
type: (DateConstructor | StringConstructor)[];
|
|
12
12
|
default: undefined;
|
|
13
13
|
};
|
|
14
|
+
modelValue: {
|
|
15
|
+
type: (DateConstructor | StringConstructor)[];
|
|
16
|
+
default: undefined;
|
|
17
|
+
};
|
|
18
|
+
isOpen: {
|
|
19
|
+
type: BooleanConstructor;
|
|
20
|
+
default: boolean;
|
|
21
|
+
};
|
|
22
|
+
showClear: {
|
|
23
|
+
type: BooleanConstructor;
|
|
24
|
+
default: boolean;
|
|
25
|
+
};
|
|
14
26
|
timeStep: {
|
|
15
27
|
type: NumberConstructor;
|
|
16
28
|
default: number;
|
|
@@ -23,7 +35,12 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
23
35
|
type: import("vue").PropType<IMarkedDay[]>;
|
|
24
36
|
default: () => never[];
|
|
25
37
|
};
|
|
26
|
-
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}
|
|
38
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
39
|
+
"update:modelValue": (value: string | Date) => any;
|
|
40
|
+
"update:maskedModel": (value: string) => any;
|
|
41
|
+
"update:calendarShow": (value: boolean) => any;
|
|
42
|
+
"update:isOpen": (value: boolean) => any;
|
|
43
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
27
44
|
format: {
|
|
28
45
|
type: StringConstructor;
|
|
29
46
|
default: string;
|
|
@@ -36,6 +53,18 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
36
53
|
type: (DateConstructor | StringConstructor)[];
|
|
37
54
|
default: undefined;
|
|
38
55
|
};
|
|
56
|
+
modelValue: {
|
|
57
|
+
type: (DateConstructor | StringConstructor)[];
|
|
58
|
+
default: undefined;
|
|
59
|
+
};
|
|
60
|
+
isOpen: {
|
|
61
|
+
type: BooleanConstructor;
|
|
62
|
+
default: boolean;
|
|
63
|
+
};
|
|
64
|
+
showClear: {
|
|
65
|
+
type: BooleanConstructor;
|
|
66
|
+
default: boolean;
|
|
67
|
+
};
|
|
39
68
|
timeStep: {
|
|
40
69
|
type: NumberConstructor;
|
|
41
70
|
default: number;
|
|
@@ -48,9 +77,17 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
48
77
|
type: import("vue").PropType<IMarkedDay[]>;
|
|
49
78
|
default: () => never[];
|
|
50
79
|
};
|
|
51
|
-
}>> & Readonly<{
|
|
80
|
+
}>> & Readonly<{
|
|
81
|
+
"onUpdate:modelValue"?: ((value: string | Date) => any) | undefined;
|
|
82
|
+
"onUpdate:maskedModel"?: ((value: string) => any) | undefined;
|
|
83
|
+
"onUpdate:calendarShow"?: ((value: boolean) => any) | undefined;
|
|
84
|
+
"onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
|
|
85
|
+
}>, {
|
|
86
|
+
isOpen: boolean;
|
|
52
87
|
day: string | Date;
|
|
88
|
+
modelValue: string | Date;
|
|
53
89
|
format: string;
|
|
90
|
+
showClear: boolean;
|
|
54
91
|
calendarDefinedDays: IDefinedDay[];
|
|
55
92
|
calendarMarkedDays: IMarkedDay[];
|
|
56
93
|
timeFormat: string;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useKDateTimePickerLogic, KDateTimePickerDefaultProps } from "./KDateTimePicker.logic";
|
|
3
3
|
import { usePresetComponent } from "../../composables/usePresetComponent";
|
|
4
|
-
import { computed } from "vue";
|
|
4
|
+
import { computed, watch } from "vue";
|
|
5
5
|
import KDateTimePickerDefault from "../../presets/default/components/KDateTimePicker/KDateTimePicker.vue";
|
|
6
6
|
const props = defineProps(KDateTimePickerDefaultProps);
|
|
7
|
+
const emit = defineEmits(["update:maskedModel", "update:calendarShow", "update:modelValue", "update:isOpen"]);
|
|
7
8
|
const {
|
|
8
9
|
_date,
|
|
9
10
|
_time,
|
|
@@ -26,6 +27,7 @@ const templateProps = computed(() => ({
|
|
|
26
27
|
timeStep: props.timeStep,
|
|
27
28
|
calendarDefinedDays: props.calendarDefinedDays,
|
|
28
29
|
calendarMarkedDays: props.calendarMarkedDays,
|
|
30
|
+
showClear: props.showClear,
|
|
29
31
|
textboxClicked,
|
|
30
32
|
dateSelected,
|
|
31
33
|
timeSelected
|
|
@@ -36,6 +38,12 @@ const updateMaskedModel = (val) => {
|
|
|
36
38
|
const updateCalendarShow = (val) => {
|
|
37
39
|
calendarShow.value = val;
|
|
38
40
|
};
|
|
41
|
+
watch(_date, (newDate) => {
|
|
42
|
+
emit("update:modelValue", newDate);
|
|
43
|
+
});
|
|
44
|
+
watch(calendarShow, (newVal) => {
|
|
45
|
+
emit("update:isOpen", newVal);
|
|
46
|
+
});
|
|
39
47
|
</script>
|
|
40
48
|
|
|
41
49
|
<template lang="pug">
|
|
@@ -11,6 +11,18 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
11
11
|
type: (DateConstructor | StringConstructor)[];
|
|
12
12
|
default: undefined;
|
|
13
13
|
};
|
|
14
|
+
modelValue: {
|
|
15
|
+
type: (DateConstructor | StringConstructor)[];
|
|
16
|
+
default: undefined;
|
|
17
|
+
};
|
|
18
|
+
isOpen: {
|
|
19
|
+
type: BooleanConstructor;
|
|
20
|
+
default: boolean;
|
|
21
|
+
};
|
|
22
|
+
showClear: {
|
|
23
|
+
type: BooleanConstructor;
|
|
24
|
+
default: boolean;
|
|
25
|
+
};
|
|
14
26
|
timeStep: {
|
|
15
27
|
type: NumberConstructor;
|
|
16
28
|
default: number;
|
|
@@ -23,7 +35,12 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
23
35
|
type: import("vue").PropType<IMarkedDay[]>;
|
|
24
36
|
default: () => never[];
|
|
25
37
|
};
|
|
26
|
-
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}
|
|
38
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
39
|
+
"update:modelValue": (value: string | Date) => any;
|
|
40
|
+
"update:maskedModel": (value: string) => any;
|
|
41
|
+
"update:calendarShow": (value: boolean) => any;
|
|
42
|
+
"update:isOpen": (value: boolean) => any;
|
|
43
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
27
44
|
format: {
|
|
28
45
|
type: StringConstructor;
|
|
29
46
|
default: string;
|
|
@@ -36,6 +53,18 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
36
53
|
type: (DateConstructor | StringConstructor)[];
|
|
37
54
|
default: undefined;
|
|
38
55
|
};
|
|
56
|
+
modelValue: {
|
|
57
|
+
type: (DateConstructor | StringConstructor)[];
|
|
58
|
+
default: undefined;
|
|
59
|
+
};
|
|
60
|
+
isOpen: {
|
|
61
|
+
type: BooleanConstructor;
|
|
62
|
+
default: boolean;
|
|
63
|
+
};
|
|
64
|
+
showClear: {
|
|
65
|
+
type: BooleanConstructor;
|
|
66
|
+
default: boolean;
|
|
67
|
+
};
|
|
39
68
|
timeStep: {
|
|
40
69
|
type: NumberConstructor;
|
|
41
70
|
default: number;
|
|
@@ -48,9 +77,17 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
48
77
|
type: import("vue").PropType<IMarkedDay[]>;
|
|
49
78
|
default: () => never[];
|
|
50
79
|
};
|
|
51
|
-
}>> & Readonly<{
|
|
80
|
+
}>> & Readonly<{
|
|
81
|
+
"onUpdate:modelValue"?: ((value: string | Date) => any) | undefined;
|
|
82
|
+
"onUpdate:maskedModel"?: ((value: string) => any) | undefined;
|
|
83
|
+
"onUpdate:calendarShow"?: ((value: boolean) => any) | undefined;
|
|
84
|
+
"onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
|
|
85
|
+
}>, {
|
|
86
|
+
isOpen: boolean;
|
|
52
87
|
day: string | Date;
|
|
88
|
+
modelValue: string | Date;
|
|
53
89
|
format: string;
|
|
90
|
+
showClear: boolean;
|
|
54
91
|
calendarDefinedDays: IDefinedDay[];
|
|
55
92
|
calendarMarkedDays: IMarkedDay[];
|
|
56
93
|
timeFormat: string;
|
|
@@ -4,6 +4,9 @@ export interface KDateTimePickerProps {
|
|
|
4
4
|
format?: string;
|
|
5
5
|
timeFormat?: string;
|
|
6
6
|
day?: Date | string;
|
|
7
|
+
modelValue?: Date | string;
|
|
8
|
+
isOpen?: boolean;
|
|
9
|
+
showClear?: boolean;
|
|
7
10
|
timeStep?: number;
|
|
8
11
|
calendarDefinedDays?: IDefinedDay[];
|
|
9
12
|
calendarMarkedDays?: IMarkedDay[];
|
|
@@ -21,6 +24,18 @@ export declare const KDateTimePickerDefaultProps: {
|
|
|
21
24
|
type: (DateConstructor | StringConstructor)[];
|
|
22
25
|
default: undefined;
|
|
23
26
|
};
|
|
27
|
+
modelValue: {
|
|
28
|
+
type: (DateConstructor | StringConstructor)[];
|
|
29
|
+
default: undefined;
|
|
30
|
+
};
|
|
31
|
+
isOpen: {
|
|
32
|
+
type: BooleanConstructor;
|
|
33
|
+
default: boolean;
|
|
34
|
+
};
|
|
35
|
+
showClear: {
|
|
36
|
+
type: BooleanConstructor;
|
|
37
|
+
default: boolean;
|
|
38
|
+
};
|
|
24
39
|
timeStep: {
|
|
25
40
|
type: NumberConstructor;
|
|
26
41
|
default: number;
|