@katlux/toolkit 0.1.0-beta.5 → 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/compiled/composables/usePresetComponent.mjs +21 -16
- package/dist/module.cjs +52 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +52 -0
- package/dist/runtime/components/KCalendar/KCalendar.global.d.vue.ts +11 -12
- package/dist/runtime/components/KCalendar/KCalendar.global.vue.d.ts +11 -12
- package/dist/runtime/components/KCalendar/KCalendar.logic.d.ts +1 -0
- package/dist/runtime/components/KCalendar/KCalendar.logic.js +25 -10
- package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +18 -10
- package/dist/runtime/components/KCombobox/KCombobox.global.vue +6 -2
- package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +18 -10
- package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +78 -0
- package/dist/runtime/components/KCombobox/KCombobox.logic.js +8 -3
- 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 +56 -8
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue +23 -3
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +56 -8
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.d.ts +22 -1
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.js +89 -7
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +54 -8
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue +23 -3
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +54 -8
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.d.ts +22 -1
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.js +148 -7
- package/dist/runtime/components/KDropdown/KDropdown.global.d.vue.ts +18 -0
- package/dist/runtime/components/KDropdown/KDropdown.global.vue +13 -4
- package/dist/runtime/components/KDropdown/KDropdown.global.vue.d.ts +18 -0
- package/dist/runtime/components/KDropdown/KDropdown.logic.d.ts +28 -1
- package/dist/runtime/components/KDropdown/KDropdown.logic.js +85 -4
- package/dist/runtime/components/KGrid/KGrid.global.d.vue.ts +7 -56
- package/dist/runtime/components/KGrid/KGrid.global.vue +9 -2
- package/dist/runtime/components/KGrid/KGrid.global.vue.d.ts +7 -56
- package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +20 -0
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue +25 -12
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +20 -0
- 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/KIcon/KIcon.global.d.vue.ts +1 -1
- package/dist/runtime/components/KIcon/KIcon.global.vue.d.ts +1 -1
- package/dist/runtime/components/KIcon/KIcon.logic.d.ts +1 -1
- package/dist/runtime/components/KIcon/KIcon.logic.js +13 -8
- package/dist/runtime/components/KLoader/KLoader.global.d.vue.ts +3 -3
- package/dist/runtime/components/KLoader/KLoader.global.vue.d.ts +3 -3
- package/dist/runtime/components/KLoader/KLoader.logic.d.ts +8 -1
- package/dist/runtime/components/KLoader/KLoader.logic.js +1 -0
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue +1 -1
- package/dist/runtime/components/KModal/KModal.global.vue +4 -1
- package/dist/runtime/components/KModal/KModal.logic.d.ts +3 -1
- package/dist/runtime/components/KModal/KModal.logic.js +6 -2
- package/dist/runtime/components/KPanel/KPanel.global.d.vue.ts +5 -28
- package/dist/runtime/components/KPanel/KPanel.global.vue +12 -4
- package/dist/runtime/components/KPanel/KPanel.global.vue.d.ts +5 -28
- package/dist/runtime/components/KPanel/KPanel.logic.d.ts +10 -0
- package/dist/runtime/components/KPanel/KPanel.logic.js +8 -0
- package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +15 -2
- package/dist/runtime/components/KTextbox/KTextbox.global.vue +5 -4
- package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +15 -2
- package/dist/runtime/components/KTextbox/KTextbox.logic.d.ts +10 -4
- package/dist/runtime/components/KTextbox/KTextbox.logic.js +12 -5
- 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/components/KTreePicker/KTreePicker.logic.d.ts +77 -0
- package/dist/runtime/composables/usePresetComponent.d.ts +16 -0
- package/dist/runtime/composables/usePresetComponent.js +21 -16
- package/dist/runtime/presets/default/assets/scss/css-variables.css +64 -13
- package/dist/runtime/presets/default/assets/scss/css-variables.scss +286 -0
- package/dist/runtime/presets/default/assets/scss/docs.scss +52 -0
- package/dist/runtime/presets/default/assets/scss/index.css +72 -13
- package/dist/runtime/presets/default/assets/scss/index.scss +12 -0
- package/dist/runtime/presets/default/assets/scss/mixins.scss +94 -0
- package/dist/runtime/presets/default/assets/scss/reset.scss +16 -0
- package/dist/runtime/presets/default/components/KAccordion/KAccordion.vue +5 -2
- package/dist/runtime/presets/default/components/KAccordion/KAccordionItem.vue +40 -37
- package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue +29 -22
- package/dist/runtime/presets/default/components/KButton/KButton.vue +147 -428
- package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue +57 -53
- package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue +189 -161
- package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue +46 -36
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.d.vue.ts +3 -0
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue +90 -70
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue.d.ts +3 -0
- package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue +78 -60
- 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/KDataIterator/KDataIterator.vue +40 -31
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +110 -92
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.d.vue.ts +3 -0
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue +44 -25
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue.d.ts +3 -0
- package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.d.vue.ts +3 -0
- package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue +68 -52
- package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue.d.ts +3 -0
- package/dist/runtime/presets/default/components/KDropdown/KDropdown.d.vue.ts +8 -0
- package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue +46 -25
- package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue.d.ts +8 -0
- package/dist/runtime/presets/default/components/KGantt/KGantt.vue +337 -241
- package/dist/runtime/presets/default/components/KGantt/KGanttRuler.vue +40 -35
- package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue +170 -140
- package/dist/runtime/presets/default/components/KGrid/KGrid.vue +62 -60
- package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.d.vue.ts +6 -2
- package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue +44 -28
- package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue.d.ts +6 -2
- package/dist/runtime/presets/default/components/KHourSelect/KHourSelect.vue +34 -28
- package/dist/runtime/presets/default/components/KIcon/KIcon.d.vue.ts +1 -1
- package/dist/runtime/presets/default/components/KIcon/KIcon.vue +31 -22
- package/dist/runtime/presets/default/components/KIcon/KIcon.vue.d.ts +1 -1
- package/dist/runtime/presets/default/components/KLoader/KLoader.vue +53 -47
- package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue +113 -84
- package/dist/runtime/presets/default/components/KModal/KModal.d.vue.ts +1 -0
- package/dist/runtime/presets/default/components/KModal/KModal.vue +64 -35
- package/dist/runtime/presets/default/components/KModal/KModal.vue.d.ts +1 -0
- package/dist/runtime/presets/default/components/KPagination/KPagination.vue +42 -40
- package/dist/runtime/presets/default/components/KPanel/KPanel.d.vue.ts +3 -0
- package/dist/runtime/presets/default/components/KPanel/KPanel.vue +95 -34
- package/dist/runtime/presets/default/components/KPanel/KPanel.vue.d.ts +3 -0
- package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.vue +30 -29
- package/dist/runtime/presets/default/components/KRangeSlider/KRangeSlider.vue +158 -125
- package/dist/runtime/presets/default/components/KSlider/KSlider.vue +123 -100
- package/dist/runtime/presets/default/components/KTabs/KTabItem.vue +40 -37
- package/dist/runtime/presets/default/components/KTabs/KTabs.vue +9 -6
- package/dist/runtime/presets/default/components/KTextarea/KTextarea.vue +23 -20
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.d.vue.ts +2 -1
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue +49 -36
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue.d.ts +2 -1
- package/dist/runtime/presets/default/components/KTree/KTree.vue +102 -80
- package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue +55 -34
- package/dist/runtime/presets/default/components/KTreeView/KTreeCell.vue +31 -30
- package/dist/runtime/presets/default/components/KTreeView/KTreeView.vue +34 -27
- package/package.json +5 -5
|
@@ -27,8 +27,17 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
27
27
|
type: BooleanConstructor;
|
|
28
28
|
default: boolean;
|
|
29
29
|
};
|
|
30
|
+
isOpen: {
|
|
31
|
+
type: BooleanConstructor;
|
|
32
|
+
default: boolean;
|
|
33
|
+
};
|
|
34
|
+
showClear: {
|
|
35
|
+
type: BooleanConstructor;
|
|
36
|
+
default: boolean;
|
|
37
|
+
};
|
|
30
38
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
31
39
|
"update:modelValue": (value: string) => any;
|
|
40
|
+
"update:isOpen": (value: boolean) => any;
|
|
32
41
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
33
42
|
step: {
|
|
34
43
|
type: NumberConstructor;
|
|
@@ -58,12 +67,23 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
58
67
|
type: BooleanConstructor;
|
|
59
68
|
default: boolean;
|
|
60
69
|
};
|
|
70
|
+
isOpen: {
|
|
71
|
+
type: BooleanConstructor;
|
|
72
|
+
default: boolean;
|
|
73
|
+
};
|
|
74
|
+
showClear: {
|
|
75
|
+
type: BooleanConstructor;
|
|
76
|
+
default: boolean;
|
|
77
|
+
};
|
|
61
78
|
}>> & Readonly<{
|
|
62
79
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
80
|
+
"onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
|
|
63
81
|
}>, {
|
|
82
|
+
isOpen: boolean;
|
|
64
83
|
disabled: boolean;
|
|
65
84
|
modelValue: string;
|
|
66
85
|
placeholder: string;
|
|
86
|
+
showClear: boolean;
|
|
67
87
|
format: string;
|
|
68
88
|
step: number;
|
|
69
89
|
startHour: string;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed } from "vue";
|
|
2
|
+
import { computed, watch } from "vue";
|
|
3
3
|
import { useKHourPickerLogic, KHourPickerDefaultProps } from "./KHourPicker.logic";
|
|
4
4
|
import { usePresetComponent } from "../../composables/usePresetComponent";
|
|
5
5
|
import KHourPickerDefault from "../../presets/default/components/KHourPicker/KHourPicker.vue";
|
|
6
6
|
const props = defineProps(KHourPickerDefaultProps);
|
|
7
|
-
const emit = defineEmits(["update:modelValue"]);
|
|
7
|
+
const emit = defineEmits(["update:modelValue", "update:isOpen"]);
|
|
8
8
|
const {
|
|
9
9
|
isOpen,
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
maskedModel,
|
|
11
|
+
textboxClicked,
|
|
12
12
|
closeDropdown,
|
|
13
|
-
onTimeSelect
|
|
14
|
-
|
|
13
|
+
onTimeSelect,
|
|
14
|
+
clear
|
|
15
|
+
} = useKHourPickerLogic(props);
|
|
15
16
|
const presetComponent = usePresetComponent("KHourPicker", KHourPickerDefault);
|
|
16
17
|
const templateProps = computed(() => ({
|
|
17
|
-
|
|
18
|
+
maskedModel: maskedModel.value,
|
|
18
19
|
isOpen: isOpen.value,
|
|
19
20
|
step: props.step,
|
|
20
21
|
format: props.format,
|
|
@@ -22,19 +23,31 @@ const templateProps = computed(() => ({
|
|
|
22
23
|
endHour: props.endHour,
|
|
23
24
|
placeholder: props.placeholder,
|
|
24
25
|
disabled: props.disabled,
|
|
25
|
-
|
|
26
|
+
showClear: props.showClear,
|
|
27
|
+
textboxClicked,
|
|
26
28
|
closeDropdown,
|
|
27
|
-
onTimeSelect
|
|
29
|
+
onTimeSelect,
|
|
30
|
+
clear
|
|
28
31
|
}));
|
|
29
|
-
const
|
|
32
|
+
const updateIsOpen = (val) => {
|
|
30
33
|
isOpen.value = val;
|
|
31
34
|
};
|
|
35
|
+
const updateMaskedModel = (val) => {
|
|
36
|
+
maskedModel.value = val;
|
|
37
|
+
};
|
|
38
|
+
watch(maskedModel, (newVal) => {
|
|
39
|
+
emit("update:modelValue", newVal);
|
|
40
|
+
});
|
|
41
|
+
watch(isOpen, (newVal) => {
|
|
42
|
+
emit("update:isOpen", newVal);
|
|
43
|
+
});
|
|
32
44
|
</script>
|
|
33
45
|
|
|
34
46
|
<template lang="pug">
|
|
35
47
|
component(
|
|
36
48
|
:is="presetComponent"
|
|
37
|
-
v-bind="templateProps"
|
|
38
|
-
@update:isOpen="
|
|
49
|
+
v-bind="{...templateProps, ...$attrs}"
|
|
50
|
+
@update:isOpen="updateIsOpen"
|
|
51
|
+
@update:maskedModel="updateMaskedModel"
|
|
39
52
|
)
|
|
40
53
|
</template>
|
|
@@ -27,8 +27,17 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
27
27
|
type: BooleanConstructor;
|
|
28
28
|
default: boolean;
|
|
29
29
|
};
|
|
30
|
+
isOpen: {
|
|
31
|
+
type: BooleanConstructor;
|
|
32
|
+
default: boolean;
|
|
33
|
+
};
|
|
34
|
+
showClear: {
|
|
35
|
+
type: BooleanConstructor;
|
|
36
|
+
default: boolean;
|
|
37
|
+
};
|
|
30
38
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
31
39
|
"update:modelValue": (value: string) => any;
|
|
40
|
+
"update:isOpen": (value: boolean) => any;
|
|
32
41
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
33
42
|
step: {
|
|
34
43
|
type: NumberConstructor;
|
|
@@ -58,12 +67,23 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
58
67
|
type: BooleanConstructor;
|
|
59
68
|
default: boolean;
|
|
60
69
|
};
|
|
70
|
+
isOpen: {
|
|
71
|
+
type: BooleanConstructor;
|
|
72
|
+
default: boolean;
|
|
73
|
+
};
|
|
74
|
+
showClear: {
|
|
75
|
+
type: BooleanConstructor;
|
|
76
|
+
default: boolean;
|
|
77
|
+
};
|
|
61
78
|
}>> & Readonly<{
|
|
62
79
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
80
|
+
"onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
|
|
63
81
|
}>, {
|
|
82
|
+
isOpen: boolean;
|
|
64
83
|
disabled: boolean;
|
|
65
84
|
modelValue: string;
|
|
66
85
|
placeholder: string;
|
|
86
|
+
showClear: boolean;
|
|
67
87
|
format: string;
|
|
68
88
|
step: number;
|
|
69
89
|
startHour: string;
|
|
@@ -6,6 +6,8 @@ export interface KHourPickerProps {
|
|
|
6
6
|
modelValue?: string;
|
|
7
7
|
placeholder?: string;
|
|
8
8
|
disabled?: boolean;
|
|
9
|
+
isOpen?: boolean;
|
|
10
|
+
showClear?: boolean;
|
|
9
11
|
}
|
|
10
12
|
export declare const KHourPickerDefaultProps: {
|
|
11
13
|
step: {
|
|
@@ -36,11 +38,20 @@ export declare const KHourPickerDefaultProps: {
|
|
|
36
38
|
type: BooleanConstructor;
|
|
37
39
|
default: boolean;
|
|
38
40
|
};
|
|
41
|
+
isOpen: {
|
|
42
|
+
type: BooleanConstructor;
|
|
43
|
+
default: boolean;
|
|
44
|
+
};
|
|
45
|
+
showClear: {
|
|
46
|
+
type: BooleanConstructor;
|
|
47
|
+
default: boolean;
|
|
48
|
+
};
|
|
39
49
|
};
|
|
40
|
-
export declare function useKHourPickerLogic(props: KHourPickerProps
|
|
50
|
+
export declare function useKHourPickerLogic(props: KHourPickerProps): {
|
|
41
51
|
isOpen: import("vue").Ref<boolean, boolean>;
|
|
42
|
-
|
|
43
|
-
|
|
52
|
+
maskedModel: import("vue").Ref<string, string>;
|
|
53
|
+
textboxClicked: () => void;
|
|
44
54
|
closeDropdown: () => void;
|
|
45
55
|
onTimeSelect: (time: string) => void;
|
|
56
|
+
clear: () => void;
|
|
46
57
|
};
|
|
@@ -28,12 +28,20 @@ export const KHourPickerDefaultProps = {
|
|
|
28
28
|
disabled: {
|
|
29
29
|
type: Boolean,
|
|
30
30
|
default: false
|
|
31
|
+
},
|
|
32
|
+
isOpen: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: false
|
|
35
|
+
},
|
|
36
|
+
showClear: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false
|
|
31
39
|
}
|
|
32
40
|
};
|
|
33
|
-
export function useKHourPickerLogic(props
|
|
34
|
-
const isOpen = ref(false);
|
|
35
|
-
const
|
|
36
|
-
const
|
|
41
|
+
export function useKHourPickerLogic(props) {
|
|
42
|
+
const isOpen = ref(props.isOpen || false);
|
|
43
|
+
const maskedModel = ref(props.modelValue || "");
|
|
44
|
+
const textboxClicked = () => {
|
|
37
45
|
if (props.disabled) return;
|
|
38
46
|
isOpen.value = !isOpen.value;
|
|
39
47
|
};
|
|
@@ -41,18 +49,25 @@ export function useKHourPickerLogic(props, emit) {
|
|
|
41
49
|
isOpen.value = false;
|
|
42
50
|
};
|
|
43
51
|
const onTimeSelect = (time) => {
|
|
44
|
-
|
|
45
|
-
|
|
52
|
+
maskedModel.value = time;
|
|
53
|
+
closeDropdown();
|
|
54
|
+
};
|
|
55
|
+
const clear = () => {
|
|
56
|
+
maskedModel.value = "";
|
|
46
57
|
closeDropdown();
|
|
47
58
|
};
|
|
48
59
|
watch(() => props.modelValue, (val) => {
|
|
49
|
-
|
|
60
|
+
maskedModel.value = val || "";
|
|
61
|
+
});
|
|
62
|
+
watch(() => props.isOpen, (val) => {
|
|
63
|
+
isOpen.value = !!val;
|
|
50
64
|
});
|
|
51
65
|
return {
|
|
52
66
|
isOpen,
|
|
53
|
-
|
|
54
|
-
|
|
67
|
+
maskedModel,
|
|
68
|
+
textboxClicked,
|
|
55
69
|
closeDropdown,
|
|
56
|
-
onTimeSelect
|
|
70
|
+
onTimeSelect,
|
|
71
|
+
clear
|
|
57
72
|
};
|
|
58
73
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref, computed } from "vue";
|
|
1
|
+
import { ref, computed, watch } from "vue";
|
|
2
2
|
export const KHourSelectDefaultProps = {
|
|
3
3
|
step: {
|
|
4
4
|
type: Number,
|
|
@@ -61,6 +61,9 @@ export function useKHourSelectLogic(props) {
|
|
|
61
61
|
const selectTime = (time) => {
|
|
62
62
|
selectedTime.value = time;
|
|
63
63
|
};
|
|
64
|
+
watch(() => props.modelValue, (val) => {
|
|
65
|
+
selectedTime.value = val || "";
|
|
66
|
+
});
|
|
64
67
|
return {
|
|
65
68
|
timeSlots,
|
|
66
69
|
selectedTime,
|
|
@@ -33,8 +33,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
33
33
|
default: number;
|
|
34
34
|
};
|
|
35
35
|
}>> & Readonly<{}>, {
|
|
36
|
-
rotate: string | number;
|
|
37
36
|
width: string | number;
|
|
37
|
+
rotate: string | number;
|
|
38
38
|
height: string | number;
|
|
39
39
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
40
40
|
declare const _default: typeof __VLS_export;
|
|
@@ -33,8 +33,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
33
33
|
default: number;
|
|
34
34
|
};
|
|
35
35
|
}>> & Readonly<{}>, {
|
|
36
|
-
rotate: string | number;
|
|
37
36
|
width: string | number;
|
|
37
|
+
rotate: string | number;
|
|
38
38
|
height: string | number;
|
|
39
39
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
40
40
|
declare const _default: typeof __VLS_export;
|
|
@@ -25,5 +25,5 @@ export declare const KIconDefaultProps: {
|
|
|
25
25
|
export declare function useKIconLogic(props: KIconProps): {
|
|
26
26
|
widthPx: import("vue").ComputedRef<string | undefined>;
|
|
27
27
|
heightPx: import("vue").ComputedRef<string>;
|
|
28
|
-
iconComponent: import("vue").ComputedRef<
|
|
28
|
+
iconComponent: import("vue").ComputedRef<string | null>;
|
|
29
29
|
};
|
|
@@ -18,20 +18,25 @@ export const KIconDefaultProps = {
|
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
export function useKIconLogic(props) {
|
|
21
|
-
const modules = import.meta.glob("../../presets/default/assets/svg/*.svg", { eager: true });
|
|
21
|
+
const modules = import.meta.glob("../../presets/default/assets/svg/*.svg", { eager: true, as: "raw" });
|
|
22
22
|
const iconMap = {};
|
|
23
23
|
for (const path in modules) {
|
|
24
24
|
const match = path.match(/([^/]+)\.svg$/);
|
|
25
25
|
if (match) {
|
|
26
|
-
iconMap[match[1]] = modules[path]
|
|
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,
|
|
@@ -8,7 +8,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
8
8
|
default: boolean;
|
|
9
9
|
};
|
|
10
10
|
size: {
|
|
11
|
-
type: PropType<"small" | "medium" | "large">;
|
|
11
|
+
type: import("vue").PropType<"small" | "medium" | "large">;
|
|
12
12
|
default: string;
|
|
13
13
|
};
|
|
14
14
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -21,11 +21,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
21
21
|
default: boolean;
|
|
22
22
|
};
|
|
23
23
|
size: {
|
|
24
|
-
type: PropType<"small" | "medium" | "large">;
|
|
24
|
+
type: import("vue").PropType<"small" | "medium" | "large">;
|
|
25
25
|
default: string;
|
|
26
26
|
};
|
|
27
27
|
}>> & Readonly<{}>, {
|
|
28
|
-
size:
|
|
28
|
+
size: "small" | "large" | "medium";
|
|
29
29
|
overlay: boolean;
|
|
30
30
|
loading: boolean;
|
|
31
31
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -8,7 +8,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
8
8
|
default: boolean;
|
|
9
9
|
};
|
|
10
10
|
size: {
|
|
11
|
-
type: PropType<"small" | "medium" | "large">;
|
|
11
|
+
type: import("vue").PropType<"small" | "medium" | "large">;
|
|
12
12
|
default: string;
|
|
13
13
|
};
|
|
14
14
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -21,11 +21,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
21
21
|
default: boolean;
|
|
22
22
|
};
|
|
23
23
|
size: {
|
|
24
|
-
type: PropType<"small" | "medium" | "large">;
|
|
24
|
+
type: import("vue").PropType<"small" | "medium" | "large">;
|
|
25
25
|
default: string;
|
|
26
26
|
};
|
|
27
27
|
}>> & Readonly<{}>, {
|
|
28
|
-
size:
|
|
28
|
+
size: "small" | "large" | "medium";
|
|
29
29
|
overlay: boolean;
|
|
30
30
|
loading: boolean;
|
|
31
31
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
1
2
|
export interface KLoaderProps {
|
|
2
3
|
loading?: boolean;
|
|
3
4
|
overlay?: boolean;
|
|
@@ -18,5 +19,11 @@ export declare const KLoaderDefaultProps: {
|
|
|
18
19
|
};
|
|
19
20
|
};
|
|
20
21
|
export declare function useKLoaderLogic(props: KLoaderProps): {
|
|
21
|
-
loaderClasses:
|
|
22
|
+
loaderClasses: import("vue").ComputedRef<(string | {
|
|
23
|
+
'is-overlay': boolean | undefined;
|
|
24
|
+
'is-loading'?: undefined;
|
|
25
|
+
} | {
|
|
26
|
+
'is-loading': boolean | undefined;
|
|
27
|
+
'is-overlay'?: undefined;
|
|
28
|
+
})[]>;
|
|
22
29
|
};
|
|
@@ -4,13 +4,16 @@ import { usePresetComponent } from "../../composables/usePresetComponent";
|
|
|
4
4
|
import { computed } from "vue";
|
|
5
5
|
import KModalDefault from "../../presets/default/components/KModal/KModal.vue";
|
|
6
6
|
const props = defineProps(KModalDefaultProps);
|
|
7
|
-
const
|
|
7
|
+
const useId = globalThis.useId || (() => `k-modal-${Math.random().toString(36).slice(2, 9)}`);
|
|
8
|
+
const stableId = useId();
|
|
9
|
+
const { modalId, opened, openModal, closeModal } = useKModalLogic(props, stableId);
|
|
8
10
|
defineExpose({
|
|
9
11
|
openModal,
|
|
10
12
|
closeModal
|
|
11
13
|
});
|
|
12
14
|
const presetComponent = usePresetComponent("KModal", KModalDefault);
|
|
13
15
|
const templateProps = computed(() => ({
|
|
16
|
+
modalId: modalId.value,
|
|
14
17
|
opened: opened.value,
|
|
15
18
|
closeModal
|
|
16
19
|
}));
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
export declare const KMODAL_PORTAL_ID_KEY = "KMODAL_PORTAL_ID";
|
|
1
2
|
export interface KModalProps {
|
|
2
3
|
}
|
|
3
4
|
export declare const KModalDefaultProps: {};
|
|
4
|
-
export declare function useKModalLogic(props: KModalProps): {
|
|
5
|
+
export declare function useKModalLogic(props: KModalProps, stableId: string): {
|
|
6
|
+
modalId: import("vue").ComputedRef<string>;
|
|
5
7
|
opened: import("vue").Ref<boolean, boolean>;
|
|
6
8
|
openModal: () => void;
|
|
7
9
|
closeModal: () => void;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { ref } from "vue";
|
|
1
|
+
import { ref, provide, computed } from "vue";
|
|
2
|
+
export const KMODAL_PORTAL_ID_KEY = "KMODAL_PORTAL_ID";
|
|
2
3
|
export const KModalDefaultProps = {};
|
|
3
|
-
export function useKModalLogic(props) {
|
|
4
|
+
export function useKModalLogic(props, stableId) {
|
|
5
|
+
const modalId = computed(() => stableId);
|
|
6
|
+
provide(KMODAL_PORTAL_ID_KEY, modalId);
|
|
4
7
|
const opened = ref(false);
|
|
5
8
|
function openModal() {
|
|
6
9
|
opened.value = true;
|
|
@@ -9,6 +12,7 @@ export function useKModalLogic(props) {
|
|
|
9
12
|
opened.value = false;
|
|
10
13
|
}
|
|
11
14
|
return {
|
|
15
|
+
modalId,
|
|
12
16
|
opened,
|
|
13
17
|
openModal,
|
|
14
18
|
closeModal
|
|
@@ -1,33 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
default: string;
|
|
5
|
-
};
|
|
6
|
-
noGap: {
|
|
7
|
-
type: BooleanConstructor;
|
|
8
|
-
default: boolean;
|
|
9
|
-
};
|
|
10
|
-
flexContent: {
|
|
11
|
-
type: BooleanConstructor;
|
|
12
|
-
default: boolean;
|
|
13
|
-
};
|
|
14
|
-
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
15
|
-
title: {
|
|
16
|
-
type: StringConstructor;
|
|
17
|
-
default: string;
|
|
18
|
-
};
|
|
19
|
-
noGap: {
|
|
20
|
-
type: BooleanConstructor;
|
|
21
|
-
default: boolean;
|
|
22
|
-
};
|
|
23
|
-
flexContent: {
|
|
24
|
-
type: BooleanConstructor;
|
|
25
|
-
default: boolean;
|
|
26
|
-
};
|
|
27
|
-
}>> & Readonly<{}>, {
|
|
1
|
+
import { type KPanelProps } from './KPanel.logic.js';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<KPanelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KPanelProps> & Readonly<{}>, {
|
|
3
|
+
type: "default" | "primary" | "danger" | "success" | "warning" | "info";
|
|
28
4
|
title: string;
|
|
29
5
|
noGap: boolean;
|
|
30
6
|
flexContent: boolean;
|
|
31
|
-
|
|
7
|
+
scrollable: boolean;
|
|
8
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
32
9
|
declare const _default: typeof __VLS_export;
|
|
33
10
|
export default _default;
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { useKPanelLogic
|
|
2
|
+
import { useKPanelLogic } from "./KPanel.logic";
|
|
3
3
|
import { usePresetComponent } from "../../composables/usePresetComponent";
|
|
4
4
|
import { computed } from "vue";
|
|
5
5
|
import KPanelDefault from "../../presets/default/components/KPanel/KPanel.vue";
|
|
6
|
-
const props = defineProps(
|
|
7
|
-
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
title: { type: String, required: false, default: "" },
|
|
8
|
+
noGap: { type: Boolean, required: false, default: true },
|
|
9
|
+
flexContent: { type: Boolean, required: false, default: false },
|
|
10
|
+
scrollable: { type: Boolean, required: false, default: false },
|
|
11
|
+
type: { type: String, required: false, default: "default" }
|
|
12
|
+
});
|
|
8
13
|
const presetComponent = usePresetComponent("KPanel", KPanelDefault);
|
|
9
14
|
const templateProps = computed(() => ({
|
|
15
|
+
title: props.title,
|
|
10
16
|
noGap: props.noGap,
|
|
11
|
-
flexContent: props.flexContent
|
|
17
|
+
flexContent: props.flexContent,
|
|
18
|
+
scrollable: props.scrollable,
|
|
19
|
+
type: props.type
|
|
12
20
|
}));
|
|
13
21
|
</script>
|
|
14
22
|
|
|
@@ -1,33 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
default: string;
|
|
5
|
-
};
|
|
6
|
-
noGap: {
|
|
7
|
-
type: BooleanConstructor;
|
|
8
|
-
default: boolean;
|
|
9
|
-
};
|
|
10
|
-
flexContent: {
|
|
11
|
-
type: BooleanConstructor;
|
|
12
|
-
default: boolean;
|
|
13
|
-
};
|
|
14
|
-
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
15
|
-
title: {
|
|
16
|
-
type: StringConstructor;
|
|
17
|
-
default: string;
|
|
18
|
-
};
|
|
19
|
-
noGap: {
|
|
20
|
-
type: BooleanConstructor;
|
|
21
|
-
default: boolean;
|
|
22
|
-
};
|
|
23
|
-
flexContent: {
|
|
24
|
-
type: BooleanConstructor;
|
|
25
|
-
default: boolean;
|
|
26
|
-
};
|
|
27
|
-
}>> & Readonly<{}>, {
|
|
1
|
+
import { type KPanelProps } from './KPanel.logic.js';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<KPanelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KPanelProps> & Readonly<{}>, {
|
|
3
|
+
type: "default" | "primary" | "danger" | "success" | "warning" | "info";
|
|
28
4
|
title: string;
|
|
29
5
|
noGap: boolean;
|
|
30
6
|
flexContent: boolean;
|
|
31
|
-
|
|
7
|
+
scrollable: boolean;
|
|
8
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
32
9
|
declare const _default: typeof __VLS_export;
|
|
33
10
|
export default _default;
|
|
@@ -2,6 +2,8 @@ export interface KPanelProps {
|
|
|
2
2
|
title?: string;
|
|
3
3
|
noGap?: boolean;
|
|
4
4
|
flexContent?: boolean;
|
|
5
|
+
scrollable?: boolean;
|
|
6
|
+
type?: 'default' | 'primary' | 'danger' | 'success' | 'warning' | 'info';
|
|
5
7
|
}
|
|
6
8
|
export declare const KPanelDefaultProps: {
|
|
7
9
|
title: {
|
|
@@ -16,5 +18,13 @@ export declare const KPanelDefaultProps: {
|
|
|
16
18
|
type: BooleanConstructor;
|
|
17
19
|
default: boolean;
|
|
18
20
|
};
|
|
21
|
+
scrollable: {
|
|
22
|
+
type: BooleanConstructor;
|
|
23
|
+
default: boolean;
|
|
24
|
+
};
|
|
25
|
+
type: {
|
|
26
|
+
type: StringConstructor;
|
|
27
|
+
default: string;
|
|
28
|
+
};
|
|
19
29
|
};
|
|
20
30
|
export declare function useKPanelLogic(props: KPanelProps): {};
|
|
@@ -10,6 +10,14 @@ export const KPanelDefaultProps = {
|
|
|
10
10
|
flexContent: {
|
|
11
11
|
type: Boolean,
|
|
12
12
|
default: false
|
|
13
|
+
},
|
|
14
|
+
scrollable: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: false
|
|
17
|
+
},
|
|
18
|
+
type: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "default"
|
|
13
21
|
}
|
|
14
22
|
};
|
|
15
23
|
export function useKPanelLogic(props) {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { type KTextboxProps } from './KTextbox.logic.js';
|
|
1
2
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
3
|
modelValue: {
|
|
3
4
|
type: StringConstructor;
|
|
4
|
-
|
|
5
|
+
default: string;
|
|
5
6
|
};
|
|
6
7
|
placeholder: {
|
|
7
8
|
type: StringConstructor;
|
|
@@ -11,12 +12,17 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
11
12
|
type: BooleanConstructor;
|
|
12
13
|
default: boolean;
|
|
13
14
|
};
|
|
15
|
+
type: {
|
|
16
|
+
type: import("vue").PropType<KTextboxProps["type"]>;
|
|
17
|
+
default: string;
|
|
18
|
+
validator: (value: string) => boolean;
|
|
19
|
+
};
|
|
14
20
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
15
21
|
"update:modelValue": (value: string) => any;
|
|
16
22
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
17
23
|
modelValue: {
|
|
18
24
|
type: StringConstructor;
|
|
19
|
-
|
|
25
|
+
default: string;
|
|
20
26
|
};
|
|
21
27
|
placeholder: {
|
|
22
28
|
type: StringConstructor;
|
|
@@ -26,9 +32,16 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
26
32
|
type: BooleanConstructor;
|
|
27
33
|
default: boolean;
|
|
28
34
|
};
|
|
35
|
+
type: {
|
|
36
|
+
type: import("vue").PropType<KTextboxProps["type"]>;
|
|
37
|
+
default: string;
|
|
38
|
+
validator: (value: string) => boolean;
|
|
39
|
+
};
|
|
29
40
|
}>> & Readonly<{
|
|
30
41
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
31
42
|
}>, {
|
|
43
|
+
type: "number" | "text" | "url" | "search" | "password" | "email" | "tel" | undefined;
|
|
44
|
+
modelValue: string;
|
|
32
45
|
placeholder: string;
|
|
33
46
|
showClear: boolean;
|
|
34
47
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|