@katlux/toolkit 0.1.0-beta.49 → 0.1.0-beta.50
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 +4 -1
- package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +1 -1
- package/dist/runtime/components/KCombobox/KCombobox.logic.js +2 -2
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +149 -0
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue +65 -0
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +149 -0
- package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.d.ts +116 -0
- package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.js +149 -0
- package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +2 -2
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue +3 -3
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +2 -2
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.js +26 -32
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +2 -2
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue +4 -10
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +2 -2
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.js +16 -9
- package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +1 -1
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +1 -1
- package/dist/runtime/components/KIcon/KIcon.logic.js +11 -6
- package/dist/runtime/components/KTextbox/KTextbox.logic.d.ts +1 -1
- package/dist/runtime/components/KTextbox/KTextbox.logic.js +1 -1
- package/dist/runtime/components/KTree/KTree.global.d.vue.ts +1 -1
- package/dist/runtime/components/KTree/KTree.global.vue.d.ts +1 -1
- package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +2 -2
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +2 -2
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.d.vue.ts +2 -0
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue +11 -3
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue.d.ts +2 -0
- package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue +1 -1
- package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.d.vue.ts +27 -0
- package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.vue +190 -0
- package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.vue.d.ts +27 -0
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue +0 -1
- package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue +1 -1
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue +5 -2
- package/package.json +1 -1
|
@@ -78,11 +78,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
78
78
|
"onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
|
|
79
79
|
}>, {
|
|
80
80
|
isOpen: boolean;
|
|
81
|
-
modelValue: string | Date;
|
|
82
81
|
day: string | Date;
|
|
82
|
+
modelValue: string | Date;
|
|
83
|
+
showClear: boolean;
|
|
83
84
|
teleportTo: string;
|
|
84
85
|
format: string;
|
|
85
|
-
showClear: boolean;
|
|
86
86
|
calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
|
|
87
87
|
calendarMarkedDays: import("../KCalendar/types.js").IMarkedDay[];
|
|
88
88
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -42,9 +42,9 @@ const handleDateSelected = (date) => {
|
|
|
42
42
|
dateSelected(date);
|
|
43
43
|
};
|
|
44
44
|
watch(_date, (newDate) => {
|
|
45
|
-
const d1 = newDate instanceof Date ? newDate.getTime() : new Date(newDate).getTime();
|
|
46
|
-
const d2 = props.modelValue instanceof Date ? props.modelValue.getTime() : new Date(props.modelValue
|
|
47
|
-
const d3 = props.day instanceof Date ? props.day.getTime() : new Date(props.day
|
|
45
|
+
const d1 = newDate && (newDate instanceof Date || typeof newDate === "string") ? newDate instanceof Date ? newDate.getTime() : new Date(newDate).getTime() : 0;
|
|
46
|
+
const d2 = props.modelValue && (props.modelValue instanceof Date || typeof props.modelValue === "string") ? props.modelValue instanceof Date ? props.modelValue.getTime() : new Date(props.modelValue).getTime() : 0;
|
|
47
|
+
const d3 = props.day && (props.day instanceof Date || typeof props.day === "string") ? props.day instanceof Date ? props.day.getTime() : new Date(props.day).getTime() : 0;
|
|
48
48
|
if (d1 !== d2 && d1 !== d3) {
|
|
49
49
|
emit("update:day", newDate);
|
|
50
50
|
emit("update:modelValue", newDate);
|
|
@@ -78,11 +78,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
78
78
|
"onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
|
|
79
79
|
}>, {
|
|
80
80
|
isOpen: boolean;
|
|
81
|
-
modelValue: string | Date;
|
|
82
81
|
day: string | Date;
|
|
82
|
+
modelValue: string | Date;
|
|
83
|
+
showClear: boolean;
|
|
83
84
|
teleportTo: string;
|
|
84
85
|
format: string;
|
|
85
|
-
showClear: boolean;
|
|
86
86
|
calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
|
|
87
87
|
calendarMarkedDays: import("../KCalendar/types.js").IMarkedDay[];
|
|
88
88
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -70,12 +70,9 @@ export function useKDatePickerLogic(props) {
|
|
|
70
70
|
calendarShow.value = true;
|
|
71
71
|
};
|
|
72
72
|
const dateSelected = (date) => {
|
|
73
|
-
console.log("Date selected:", date);
|
|
74
73
|
_date.value = date;
|
|
75
74
|
const formatted = formatDate(date);
|
|
76
|
-
console.log("Formatted date:", formatted);
|
|
77
75
|
maskedModel.value = formatted;
|
|
78
|
-
console.log("maskedModel.value after update:", maskedModel.value);
|
|
79
76
|
calendarShow.value = false;
|
|
80
77
|
};
|
|
81
78
|
const formatDate = (date) => {
|
|
@@ -89,50 +86,47 @@ export function useKDatePickerLogic(props) {
|
|
|
89
86
|
return formattedDate;
|
|
90
87
|
};
|
|
91
88
|
onMounted(() => {
|
|
92
|
-
|
|
93
|
-
_date.value = props.modelValue;
|
|
94
|
-
} else if (props.day) {
|
|
95
|
-
_date.value = props.day;
|
|
96
|
-
}
|
|
89
|
+
syncValue(props.modelValue || props.day);
|
|
97
90
|
if (props.isOpen) {
|
|
98
91
|
calendarShow.value = props.isOpen;
|
|
99
92
|
}
|
|
100
|
-
if (_date.value) {
|
|
101
|
-
const initialDate = _date.value instanceof Date ? _date.value : new Date(_date.value);
|
|
102
|
-
if (!isNaN(initialDate.getTime())) {
|
|
103
|
-
maskedModel.value = formatDate(initialDate);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
93
|
});
|
|
94
|
+
const syncValue = (val) => {
|
|
95
|
+
if (val === void 0 || val === null || val === "") {
|
|
96
|
+
_date.value = "";
|
|
97
|
+
maskedModel.value = "";
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const d = val instanceof Date ? val : new Date(val);
|
|
101
|
+
if (!isNaN(d.getTime())) {
|
|
102
|
+
_date.value = val;
|
|
103
|
+
maskedModel.value = formatDate(d);
|
|
104
|
+
} else {
|
|
105
|
+
_date.value = "";
|
|
106
|
+
maskedModel.value = "";
|
|
107
|
+
}
|
|
108
|
+
};
|
|
107
109
|
watch(() => props.day, (newDay) => {
|
|
108
|
-
if (newDay) {
|
|
109
|
-
const d1 = newDay instanceof Date ? newDay.getTime() : new Date(newDay).getTime();
|
|
110
|
-
const d2 = _date.value instanceof Date ? _date.value.getTime() : new Date(_date.value).getTime();
|
|
111
|
-
if (d1 !== d2) {
|
|
112
|
-
|
|
113
|
-
syncMaskedModel(newDay);
|
|
110
|
+
if (newDay !== void 0) {
|
|
111
|
+
const d1 = newDay && (newDay instanceof Date || typeof newDay === "string") ? newDay instanceof Date ? newDay.getTime() : new Date(newDay).getTime() : 0;
|
|
112
|
+
const d2 = _date.value instanceof Date ? _date.value.getTime() : new Date(_date.value || "").getTime();
|
|
113
|
+
if (d1 !== d2 || !newDay && _date.value) {
|
|
114
|
+
syncValue(newDay);
|
|
114
115
|
}
|
|
115
116
|
}
|
|
116
117
|
});
|
|
117
118
|
watch(() => props.modelValue, (newVal) => {
|
|
118
|
-
if (newVal) {
|
|
119
|
-
const d1 = newVal instanceof Date ? newVal.getTime() : new Date(newVal).getTime();
|
|
120
|
-
const d2 = _date.value instanceof Date ? _date.value.getTime() : new Date(_date.value).getTime();
|
|
121
|
-
if (d1 !== d2) {
|
|
122
|
-
|
|
123
|
-
syncMaskedModel(newVal);
|
|
119
|
+
if (newVal !== void 0) {
|
|
120
|
+
const d1 = newVal && (newVal instanceof Date || typeof newVal === "string") ? newVal instanceof Date ? newVal.getTime() : new Date(newVal).getTime() : 0;
|
|
121
|
+
const d2 = _date.value instanceof Date ? _date.value.getTime() : new Date(_date.value || "").getTime();
|
|
122
|
+
if (d1 !== d2 || !newVal && _date.value) {
|
|
123
|
+
syncValue(newVal);
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
});
|
|
127
127
|
watch(() => props.isOpen, (newVal) => {
|
|
128
128
|
calendarShow.value = !!newVal;
|
|
129
129
|
});
|
|
130
|
-
const syncMaskedModel = (val) => {
|
|
131
|
-
const d = val instanceof Date ? val : new Date(val);
|
|
132
|
-
if (!isNaN(d.getTime())) {
|
|
133
|
-
maskedModel.value = formatDate(d);
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
130
|
const calendarDay = computed(() => {
|
|
137
131
|
const val = props.modelValue || props.day;
|
|
138
132
|
if (val) {
|
|
@@ -92,11 +92,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
92
92
|
"onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
|
|
93
93
|
}>, {
|
|
94
94
|
isOpen: boolean;
|
|
95
|
-
modelValue: string | Date;
|
|
96
95
|
day: string | Date;
|
|
96
|
+
modelValue: string | Date;
|
|
97
|
+
showClear: boolean;
|
|
97
98
|
teleportTo: string;
|
|
98
99
|
format: string;
|
|
99
|
-
showClear: boolean;
|
|
100
100
|
calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
|
|
101
101
|
calendarMarkedDays: import("../KCalendar/types.js").IMarkedDay[];
|
|
102
102
|
timeFormat: string;
|
|
@@ -46,17 +46,11 @@ const updateCalendarShow = (val) => {
|
|
|
46
46
|
calendarShow.value = val;
|
|
47
47
|
};
|
|
48
48
|
watch(_date, (newDate) => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
const d1 = newDate instanceof Date ? newDate.getTime() : new Date(newDate).getTime();
|
|
56
|
-
const d2 = props.modelValue instanceof Date ? props.modelValue.getTime() : new Date(props.modelValue || "").getTime();
|
|
57
|
-
const d3 = props.day instanceof Date ? props.day.getTime() : new Date(props.day || "").getTime();
|
|
49
|
+
const d1 = newDate && (newDate instanceof Date || typeof newDate === "string") ? newDate instanceof Date ? newDate.getTime() : new Date(newDate).getTime() : 0;
|
|
50
|
+
const d2 = props.modelValue && (props.modelValue instanceof Date || typeof props.modelValue === "string") ? props.modelValue instanceof Date ? props.modelValue.getTime() : new Date(props.modelValue).getTime() : 0;
|
|
51
|
+
const d3 = props.day && (props.day instanceof Date || typeof props.day === "string") ? props.day instanceof Date ? props.day.getTime() : new Date(props.day).getTime() : 0;
|
|
58
52
|
if (d1 !== d2 && d1 !== d3) {
|
|
59
|
-
emit("update:modelValue", newDate);
|
|
53
|
+
emit("update:modelValue", newDate || "");
|
|
60
54
|
}
|
|
61
55
|
});
|
|
62
56
|
watch(calendarShow, (newVal) => {
|
|
@@ -92,11 +92,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
92
92
|
"onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
|
|
93
93
|
}>, {
|
|
94
94
|
isOpen: boolean;
|
|
95
|
-
modelValue: string | Date;
|
|
96
95
|
day: string | Date;
|
|
96
|
+
modelValue: string | Date;
|
|
97
|
+
showClear: boolean;
|
|
97
98
|
teleportTo: string;
|
|
98
99
|
format: string;
|
|
99
|
-
showClear: boolean;
|
|
100
100
|
calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
|
|
101
101
|
calendarMarkedDays: import("../KCalendar/types.js").IMarkedDay[];
|
|
102
102
|
timeFormat: string;
|
|
@@ -131,6 +131,8 @@ export function useKDateTimePickerLogic(props) {
|
|
|
131
131
|
const timeStr = _time.value || "00:00";
|
|
132
132
|
maskedModel.value = `${dateStr} ${timeStr}`;
|
|
133
133
|
}
|
|
134
|
+
} else {
|
|
135
|
+
maskedModel.value = "";
|
|
134
136
|
}
|
|
135
137
|
};
|
|
136
138
|
const formatDate = (date) => {
|
|
@@ -158,7 +160,12 @@ export function useKDateTimePickerLogic(props) {
|
|
|
158
160
|
}
|
|
159
161
|
});
|
|
160
162
|
const syncValue = (val) => {
|
|
161
|
-
if (
|
|
163
|
+
if (val === void 0 || val === null || val === "") {
|
|
164
|
+
_date.value = "";
|
|
165
|
+
_time.value = "";
|
|
166
|
+
maskedModel.value = "";
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
162
169
|
if (val instanceof Date) {
|
|
163
170
|
_date.value = val;
|
|
164
171
|
const h = val.getHours().toString().padStart(2, "0");
|
|
@@ -178,19 +185,19 @@ export function useKDateTimePickerLogic(props) {
|
|
|
178
185
|
updateMaskedModel();
|
|
179
186
|
};
|
|
180
187
|
watch(() => props.modelValue, (newVal) => {
|
|
181
|
-
if (newVal) {
|
|
182
|
-
const d1 = newVal instanceof Date ? newVal.getTime() : new Date(newVal).getTime();
|
|
183
|
-
const d2 = _date.value instanceof Date ? _date.value.getTime() : new Date(_date.value).getTime();
|
|
184
|
-
if (d1 !== d2) {
|
|
188
|
+
if (newVal !== void 0) {
|
|
189
|
+
const d1 = newVal && (newVal instanceof Date || typeof newVal === "string") ? newVal instanceof Date ? newVal.getTime() : new Date(newVal).getTime() : 0;
|
|
190
|
+
const d2 = _date.value instanceof Date ? _date.value.getTime() : new Date(_date.value || "").getTime();
|
|
191
|
+
if (d1 !== d2 || !newVal && _date.value) {
|
|
185
192
|
syncValue(newVal);
|
|
186
193
|
}
|
|
187
194
|
}
|
|
188
195
|
});
|
|
189
196
|
watch(() => props.day, (newDay) => {
|
|
190
|
-
if (newDay) {
|
|
191
|
-
const d1 = newDay instanceof Date ? newDay.getTime() : new Date(newDay).getTime();
|
|
192
|
-
const d2 = _date.value instanceof Date ? _date.value.getTime() : new Date(_date.value).getTime();
|
|
193
|
-
if (d1 !== d2) {
|
|
197
|
+
if (newDay !== void 0) {
|
|
198
|
+
const d1 = newDay && (newDay instanceof Date || typeof newDay === "string") ? newDay instanceof Date ? newDay.getTime() : new Date(newDay).getTime() : 0;
|
|
199
|
+
const d2 = _date.value instanceof Date ? _date.value.getTime() : new Date(_date.value || "").getTime();
|
|
200
|
+
if (d1 !== d2 || !newDay && _date.value) {
|
|
194
201
|
syncValue(newDay);
|
|
195
202
|
}
|
|
196
203
|
}
|
|
@@ -83,8 +83,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
83
83
|
disabled: boolean;
|
|
84
84
|
modelValue: string;
|
|
85
85
|
placeholder: string;
|
|
86
|
-
format: string;
|
|
87
86
|
showClear: boolean;
|
|
87
|
+
format: string;
|
|
88
88
|
step: number;
|
|
89
89
|
startHour: string;
|
|
90
90
|
endHour: string;
|
|
@@ -83,8 +83,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
83
83
|
disabled: boolean;
|
|
84
84
|
modelValue: string;
|
|
85
85
|
placeholder: string;
|
|
86
|
-
format: string;
|
|
87
86
|
showClear: boolean;
|
|
87
|
+
format: string;
|
|
88
88
|
step: number;
|
|
89
89
|
startHour: string;
|
|
90
90
|
endHour: string;
|
|
@@ -26,12 +26,17 @@ export function useKIconLogic(props) {
|
|
|
26
26
|
iconMap[match[1]] = modules[path];
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
const
|
|
30
|
-
(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
const formatSize = (val) => {
|
|
30
|
+
if (val === void 0 || val === null || val === "") return void 0;
|
|
31
|
+
if (typeof val === "number") return `${val}px`;
|
|
32
|
+
if (typeof val === "string") {
|
|
33
|
+
if (/^\d+$/.test(val)) return `${val}px`;
|
|
34
|
+
return val;
|
|
35
|
+
}
|
|
36
|
+
return val;
|
|
37
|
+
};
|
|
38
|
+
const widthPx = computed(() => formatSize(props.width));
|
|
39
|
+
const heightPx = computed(() => formatSize(props.height) || "12px");
|
|
35
40
|
const iconComponent = computed(() => iconMap[props.iconname] || null);
|
|
36
41
|
return {
|
|
37
42
|
widthPx,
|
|
@@ -12,7 +12,7 @@ export interface KTextboxEmits {
|
|
|
12
12
|
*/
|
|
13
13
|
export declare function useKTextboxLogic(props: KTextboxProps, emit: KTextboxEmits): {
|
|
14
14
|
text: import("vue").WritableComputedRef<string, string>;
|
|
15
|
-
showClear: import("vue").ComputedRef<boolean
|
|
15
|
+
showClear: import("vue").ComputedRef<boolean>;
|
|
16
16
|
clear: () => void;
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
@@ -5,7 +5,7 @@ export function useKTextboxLogic(props, emit) {
|
|
|
5
5
|
set: (value) => emit("update:modelValue", value)
|
|
6
6
|
});
|
|
7
7
|
const showClear = computed(() => {
|
|
8
|
-
return props.showClear && text.value !== "";
|
|
8
|
+
return !!props.showClear && text.value !== "";
|
|
9
9
|
});
|
|
10
10
|
const clear = () => {
|
|
11
11
|
text.value = "";
|
|
@@ -66,8 +66,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
66
66
|
};
|
|
67
67
|
}>> & Readonly<{}>, {
|
|
68
68
|
disabled: boolean;
|
|
69
|
-
searchtext: string;
|
|
70
69
|
labelField: string;
|
|
70
|
+
searchtext: string;
|
|
71
71
|
multiSelect: boolean;
|
|
72
72
|
iconField: string;
|
|
73
73
|
isNodeSelected: (node: any) => boolean;
|
|
@@ -66,8 +66,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
66
66
|
};
|
|
67
67
|
}>> & Readonly<{}>, {
|
|
68
68
|
disabled: boolean;
|
|
69
|
-
searchtext: string;
|
|
70
69
|
labelField: string;
|
|
70
|
+
searchtext: string;
|
|
71
71
|
multiSelect: boolean;
|
|
72
72
|
iconField: string;
|
|
73
73
|
isNodeSelected: (node: any) => boolean;
|
|
@@ -106,9 +106,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
106
106
|
disabled: boolean;
|
|
107
107
|
loading: boolean;
|
|
108
108
|
modelValue: any;
|
|
109
|
-
searchbox: boolean;
|
|
110
|
-
placeholder: string;
|
|
111
109
|
dataProvider: any;
|
|
110
|
+
placeholder: string;
|
|
111
|
+
searchbox: boolean;
|
|
112
112
|
closeOnSelect: boolean;
|
|
113
113
|
multiSelect: boolean;
|
|
114
114
|
iconField: string;
|
|
@@ -106,9 +106,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
106
106
|
disabled: boolean;
|
|
107
107
|
loading: boolean;
|
|
108
108
|
modelValue: any;
|
|
109
|
-
searchbox: boolean;
|
|
110
|
-
placeholder: string;
|
|
111
109
|
dataProvider: any;
|
|
110
|
+
placeholder: string;
|
|
111
|
+
searchbox: boolean;
|
|
112
112
|
closeOnSelect: boolean;
|
|
113
113
|
multiSelect: boolean;
|
|
114
114
|
iconField: string;
|
|
@@ -17,8 +17,10 @@ type __VLS_Props = {
|
|
|
17
17
|
};
|
|
18
18
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
19
19
|
"update:searchtext": (value: string) => any;
|
|
20
|
+
"update:isOptionsOpen": (value: boolean) => any;
|
|
20
21
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
21
22
|
"onUpdate:searchtext"?: ((value: string) => any) | undefined;
|
|
23
|
+
"onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
|
|
22
24
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
25
|
declare const _default: typeof __VLS_export;
|
|
24
26
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
|
-
.KCombobox(ref="activatorRef"
|
|
2
|
+
.KCombobox(ref="activatorRef" :class="{ disabled: disabled, open: isOptionsOpen }")
|
|
3
3
|
KGrid(@click.stop="toggleDropdown" align="center" justify="space-between").KCombobox__selected-content-container
|
|
4
4
|
KGrid(align="center" wrap="no-wrap").KCombobox__selected-content
|
|
5
5
|
.KCombobox__selected-content-item(
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
:key="item.value || item.id || index"
|
|
9
9
|
) {{ item[labelField] }}
|
|
10
10
|
.KCombobox__selected-content-placeholder(v-else) {{placeholder}}
|
|
11
|
-
KIcon(iconname="chevron" width="
|
|
12
|
-
KDropdown(:isOpen="
|
|
11
|
+
KIcon(iconname="chevron" width="20" height="20").chevron
|
|
12
|
+
KDropdown(v-model:isOpen="isOptionsOpenModel" :anchorEl="activatorRef" fullWidth :teleportTo="teleportTo").KCombobox__options
|
|
13
13
|
slot
|
|
14
14
|
KComboboxList(
|
|
15
15
|
:searchbox="searchbox"
|
|
@@ -47,12 +47,18 @@ const props = defineProps<{
|
|
|
47
47
|
|
|
48
48
|
const emit = defineEmits<{
|
|
49
49
|
(e: 'update:searchtext', value: string): void
|
|
50
|
+
(e: 'update:isOptionsOpen', value: boolean): void
|
|
50
51
|
}>()
|
|
51
52
|
|
|
52
53
|
const searchtextModel = computed({
|
|
53
54
|
get: () => props.searchtext,
|
|
54
55
|
set: (value) => emit('update:searchtext', value)
|
|
55
56
|
})
|
|
57
|
+
|
|
58
|
+
const isOptionsOpenModel = computed({
|
|
59
|
+
get: () => props.isOptionsOpen,
|
|
60
|
+
set: (value) => emit('update:isOptionsOpen', value)
|
|
61
|
+
})
|
|
56
62
|
</script>
|
|
57
63
|
|
|
58
64
|
<style lang="scss" scoped>
|
|
@@ -74,6 +80,8 @@ const searchtextModel = computed({
|
|
|
74
80
|
.chevron {
|
|
75
81
|
transform: rotate(90deg);
|
|
76
82
|
transition: transform 0.3s ease-in-out;
|
|
83
|
+
flex-shrink: 0;
|
|
84
|
+
min-width: 20px;
|
|
77
85
|
}
|
|
78
86
|
&.open {
|
|
79
87
|
.chevron {
|
|
@@ -17,8 +17,10 @@ type __VLS_Props = {
|
|
|
17
17
|
};
|
|
18
18
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
19
19
|
"update:searchtext": (value: string) => any;
|
|
20
|
+
"update:isOptionsOpen": (value: boolean) => any;
|
|
20
21
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
21
22
|
"onUpdate:searchtext"?: ((value: string) => any) | undefined;
|
|
23
|
+
"onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
|
|
22
24
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
25
|
declare const _default: typeof __VLS_export;
|
|
24
26
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
2
|
.KCombobox__options-content
|
|
3
|
-
KTextbox(v-if="searchbox" v-model="searchtextModel" placeholder="Search..." showClear)
|
|
3
|
+
KTextbox(v-if="searchbox" v-model="searchtextModel" placeholder="Search..." :showClear="true")
|
|
4
4
|
.KCombobox__loading(v-if="loading")
|
|
5
5
|
.KCombobox__loading-spinner
|
|
6
6
|
ul.KCombobox__options-list(v-else)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ADataProvider } from '@katlux/providers';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
selectionValue: any;
|
|
4
|
+
inputValue: any;
|
|
5
|
+
modelValue: any[];
|
|
6
|
+
dataProvider: ADataProvider;
|
|
7
|
+
type: string;
|
|
8
|
+
selectionSide: string;
|
|
9
|
+
inputType: any;
|
|
10
|
+
mask: string;
|
|
11
|
+
labelField: string;
|
|
12
|
+
valueField: string;
|
|
13
|
+
placeholder: string;
|
|
14
|
+
inputPlaceholder: string;
|
|
15
|
+
searchbox: boolean;
|
|
16
|
+
showClear: boolean;
|
|
17
|
+
teleportTo?: string;
|
|
18
|
+
};
|
|
19
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
20
|
+
"update:selectionValue": (value: any) => any;
|
|
21
|
+
"update:inputValue": (value: any) => any;
|
|
22
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
23
|
+
"onUpdate:selectionValue"?: ((value: any) => any) | undefined;
|
|
24
|
+
"onUpdate:inputValue"?: ((value: any) => any) | undefined;
|
|
25
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const _default: typeof __VLS_export;
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
<template lang="pug">
|
|
2
|
+
.KCompositeInput(:class="{'selection-right': selectionSide === 'right'}")
|
|
3
|
+
KGrid(gap="0" align="stretch")
|
|
4
|
+
//- Selection Combobox
|
|
5
|
+
.KCompositeInput-selection(:style="selectionStyle")
|
|
6
|
+
KCombobox(
|
|
7
|
+
v-model="selectionValue"
|
|
8
|
+
:dataProvider="dataProvider"
|
|
9
|
+
:labelField="labelField"
|
|
10
|
+
:valueField="valueField"
|
|
11
|
+
:placeholder="placeholder"
|
|
12
|
+
:searchbox="searchbox"
|
|
13
|
+
closeOnSelect
|
|
14
|
+
:teleportTo="teleportTo"
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
//- Secondary Input
|
|
18
|
+
.KCompositeInput-main
|
|
19
|
+
template(v-if="type === 'textbox'")
|
|
20
|
+
KTextbox(
|
|
21
|
+
v-model="inputValue"
|
|
22
|
+
:type="inputType"
|
|
23
|
+
:placeholder="inputPlaceholder"
|
|
24
|
+
:showClear="showClear"
|
|
25
|
+
)
|
|
26
|
+
template(v-else-if="type === 'textarea'")
|
|
27
|
+
KTextarea(
|
|
28
|
+
v-model="inputValue"
|
|
29
|
+
:placeholder="inputPlaceholder"
|
|
30
|
+
)
|
|
31
|
+
template(v-else-if="type === 'maskedtextbox'")
|
|
32
|
+
KMaskTextbox(
|
|
33
|
+
v-model="inputValue"
|
|
34
|
+
:mask="mask"
|
|
35
|
+
:placeholder="inputPlaceholder"
|
|
36
|
+
:showClear="showClear"
|
|
37
|
+
)
|
|
38
|
+
template(v-else-if="type === 'combobox'")
|
|
39
|
+
//- For internal combobox, we assume same items for now or specific logic could be added
|
|
40
|
+
KCombobox(
|
|
41
|
+
v-model="inputValue"
|
|
42
|
+
:dataProvider="dataProvider"
|
|
43
|
+
:labelField="labelField"
|
|
44
|
+
:valueField="valueField"
|
|
45
|
+
:placeholder="inputPlaceholder"
|
|
46
|
+
:searchbox="searchbox"
|
|
47
|
+
:teleportTo="teleportTo"
|
|
48
|
+
)
|
|
49
|
+
template(v-else-if="type === 'datepicker'")
|
|
50
|
+
KDatePicker(
|
|
51
|
+
v-model="inputValue"
|
|
52
|
+
:placeholder="inputPlaceholder"
|
|
53
|
+
:showClear="showClear"
|
|
54
|
+
)
|
|
55
|
+
template(v-else-if="type === 'datetimepicker'")
|
|
56
|
+
KDateTimePicker(
|
|
57
|
+
v-model="inputValue"
|
|
58
|
+
:placeholder="inputPlaceholder"
|
|
59
|
+
:showClear="showClear"
|
|
60
|
+
)
|
|
61
|
+
template(v-else-if="type === 'hourpicker'")
|
|
62
|
+
KHourPicker(
|
|
63
|
+
v-model="inputValue"
|
|
64
|
+
:placeholder="inputPlaceholder"
|
|
65
|
+
:showClear="showClear"
|
|
66
|
+
)
|
|
67
|
+
</template>
|
|
68
|
+
|
|
69
|
+
<script lang="ts" setup>
|
|
70
|
+
import { computed } from 'vue'
|
|
71
|
+
import type { ADataProvider } from '@katlux/providers'
|
|
72
|
+
|
|
73
|
+
const props = defineProps<{
|
|
74
|
+
selectionValue: any
|
|
75
|
+
inputValue: any
|
|
76
|
+
modelValue: any[]
|
|
77
|
+
dataProvider: ADataProvider
|
|
78
|
+
type: string
|
|
79
|
+
selectionSide: string
|
|
80
|
+
inputType: any
|
|
81
|
+
mask: string
|
|
82
|
+
labelField: string
|
|
83
|
+
valueField: string
|
|
84
|
+
placeholder: string
|
|
85
|
+
inputPlaceholder: string
|
|
86
|
+
searchbox: boolean
|
|
87
|
+
showClear: boolean
|
|
88
|
+
teleportTo?: string
|
|
89
|
+
}>()
|
|
90
|
+
|
|
91
|
+
const emit = defineEmits<{
|
|
92
|
+
(e: 'update:selectionValue', value: any): void
|
|
93
|
+
(e: 'update:inputValue', value: any): void
|
|
94
|
+
}>()
|
|
95
|
+
|
|
96
|
+
const selectionValue = computed({
|
|
97
|
+
get: () => props.selectionValue,
|
|
98
|
+
set: (val) => emit('update:selectionValue', val)
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
const inputValue = computed({
|
|
102
|
+
get: () => props.inputValue,
|
|
103
|
+
set: (val) => emit('update:inputValue', val)
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
const selectionStyle = computed(() => ({
|
|
107
|
+
width: '120px', // Default width for selection, can be made prop if needed
|
|
108
|
+
flex: '0 0 auto'
|
|
109
|
+
}))
|
|
110
|
+
</script>
|
|
111
|
+
|
|
112
|
+
<style lang="scss" scoped>
|
|
113
|
+
.KCompositeInput {
|
|
114
|
+
width: 100%;
|
|
115
|
+
|
|
116
|
+
:deep(.KGrid) {
|
|
117
|
+
border: 1px solid var(--neutral-200);
|
|
118
|
+
border-radius: var(--radius-md);
|
|
119
|
+
overflow: hidden;
|
|
120
|
+
background: var(--neutral-50);
|
|
121
|
+
|
|
122
|
+
&:focus-within {
|
|
123
|
+
border-color: var(--primary-500);
|
|
124
|
+
box-shadow: 0 0 0 2px var(--primary-100);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&-selection {
|
|
129
|
+
border-right: 1px solid var(--neutral-200);
|
|
130
|
+
|
|
131
|
+
:deep(.KCombobox) {
|
|
132
|
+
.KCombobox-trigger {
|
|
133
|
+
border: none !important;
|
|
134
|
+
border-radius: 0 !important;
|
|
135
|
+
background: var(--neutral-100) !important;
|
|
136
|
+
height: 100%;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&-main {
|
|
142
|
+
flex: 1;
|
|
143
|
+
min-width: 0;
|
|
144
|
+
display: flex;
|
|
145
|
+
align-items: center;
|
|
146
|
+
|
|
147
|
+
:deep(.KTextbox), :deep(.KTextarea), :deep(.KMaskTextbox), :deep(.KCombobox),
|
|
148
|
+
:deep(.KDatePicker), :deep(.KDateTimePicker), :deep(.KHourPicker) {
|
|
149
|
+
width: 100%;
|
|
150
|
+
border: none !important;
|
|
151
|
+
background: transparent !important;
|
|
152
|
+
box-shadow: none !important;
|
|
153
|
+
|
|
154
|
+
// Target inputs and triggers
|
|
155
|
+
input, textarea, .KCombobox-trigger {
|
|
156
|
+
border: none !important;
|
|
157
|
+
border-radius: 0 !important;
|
|
158
|
+
background: transparent !important;
|
|
159
|
+
box-shadow: none !important;
|
|
160
|
+
outline: none !important;
|
|
161
|
+
padding: 0 12px !important;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// Ensure secondary inputs (like in MaskTextbox) are also borderless
|
|
165
|
+
:deep(.KTextbox), :deep(.KMaskTextbox) {
|
|
166
|
+
border: none !important;
|
|
167
|
+
background: transparent !important;
|
|
168
|
+
box-shadow: none !important;
|
|
169
|
+
width: 100%;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Do NOT force height on icons, let flexbox handle it
|
|
173
|
+
.closeIcon, .KIcon {
|
|
174
|
+
margin: 0 8px !important;
|
|
175
|
+
flex-shrink: 0;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
&.selection-right {
|
|
181
|
+
.KGrid {
|
|
182
|
+
flex-direction: row-reverse;
|
|
183
|
+
}
|
|
184
|
+
.KCompositeInput-selection {
|
|
185
|
+
border-right: none;
|
|
186
|
+
border-left: 1px solid var(--neutral-200);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
</style>
|