@katlux/toolkit 0.1.0-beta.6 → 0.1.0-beta.60
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/KBulkActions/KBulkActions.logic.d.ts +9 -2
- package/dist/runtime/components/KButton/KButton.logic.d.ts +1 -1
- 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/KCheckbox/KCheckbox.global.d.vue.ts +30 -0
- package/dist/runtime/components/KCheckbox/KCheckbox.global.vue +4 -1
- package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +30 -0
- package/dist/runtime/components/KCheckbox/KCheckbox.logic.d.ts +17 -0
- package/dist/runtime/components/KCheckbox/KCheckbox.logic.js +16 -1
- package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +75 -8
- package/dist/runtime/components/KCombobox/KCombobox.global.vue +18 -4
- package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +75 -8
- package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +46 -8
- package/dist/runtime/components/KCombobox/KCombobox.logic.js +77 -9
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +169 -0
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue +46 -0
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +169 -0
- package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.d.ts +127 -0
- package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.js +160 -0
- package/dist/runtime/components/KDatatable/KDataIterator.global.vue +1 -1
- package/dist/runtime/components/KDatatable/KDataIterator.logic.d.ts +2 -2
- package/dist/runtime/components/KDatatable/KDatatable.global.vue +1 -1
- package/dist/runtime/components/KDatatable/KDatatable.logic.d.ts +2 -2
- package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +95 -8
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue +27 -3
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +95 -8
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.d.ts +43 -1
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.js +106 -7
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +84 -8
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue +26 -3
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +84 -8
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.d.ts +38 -1
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.js +161 -7
- package/dist/runtime/components/KDropdown/KDropdown.global.d.vue.ts +27 -0
- package/dist/runtime/components/KDropdown/KDropdown.global.vue +14 -4
- package/dist/runtime/components/KDropdown/KDropdown.global.vue.d.ts +27 -0
- package/dist/runtime/components/KDropdown/KDropdown.logic.d.ts +36 -1
- package/dist/runtime/components/KDropdown/KDropdown.logic.js +92 -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 +41 -0
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue +27 -12
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +41 -0
- package/dist/runtime/components/KHourPicker/KHourPicker.logic.d.ts +26 -3
- package/dist/runtime/components/KHourPicker/KHourPicker.logic.js +34 -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/KMaskTextbox/KMaskTextbox.global.d.vue.ts +21 -0
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue +4 -2
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +21 -0
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.logic.d.ts +11 -0
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.logic.js +9 -0
- package/dist/runtime/components/KModal/KModal.global.d.vue.ts +14 -2
- package/dist/runtime/components/KModal/KModal.global.vue +5 -1
- package/dist/runtime/components/KModal/KModal.global.vue.d.ts +14 -2
- package/dist/runtime/components/KModal/KModal.logic.d.ts +10 -2
- package/dist/runtime/components/KModal/KModal.logic.js +12 -3
- package/dist/runtime/components/KPagination/KPagination.global.vue +1 -1
- 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/KRadiobox/KRadiobox.global.d.vue.ts +21 -0
- package/dist/runtime/components/KRadiobox/KRadiobox.global.vue +3 -1
- package/dist/runtime/components/KRadiobox/KRadiobox.global.vue.d.ts +21 -0
- package/dist/runtime/components/KRadiobox/KRadiobox.logic.d.ts +11 -0
- package/dist/runtime/components/KRadiobox/KRadiobox.logic.js +9 -0
- package/dist/runtime/components/KTextarea/KTextarea.global.d.vue.ts +21 -0
- package/dist/runtime/components/KTextarea/KTextarea.global.vue +3 -1
- package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +21 -0
- package/dist/runtime/components/KTextarea/KTextarea.logic.d.ts +11 -0
- package/dist/runtime/components/KTextarea/KTextarea.logic.js +9 -0
- package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +35 -2
- package/dist/runtime/components/KTextbox/KTextbox.global.vue +7 -4
- package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +35 -2
- package/dist/runtime/components/KTextbox/KTextbox.logic.d.ts +21 -4
- package/dist/runtime/components/KTextbox/KTextbox.logic.js +21 -5
- package/dist/runtime/components/KToast/KToast.global.d.vue.ts +57 -0
- package/dist/runtime/components/KToast/KToast.global.vue +32 -0
- package/dist/runtime/components/KToast/KToast.global.vue.d.ts +57 -0
- package/dist/runtime/components/KToast/KToast.logic.d.ts +34 -0
- package/dist/runtime/components/KToast/KToast.logic.js +47 -0
- package/dist/runtime/components/KTree/KTree.logic.d.ts +1 -1
- package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +65 -7
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue +15 -3
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +65 -7
- package/dist/runtime/components/KTreePicker/KTreePicker.logic.d.ts +37 -5
- package/dist/runtime/components/KTreePicker/KTreePicker.logic.js +32 -1
- package/dist/runtime/components/KTreeView/KTreeView.global.d.vue.ts +8 -8
- package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +8 -8
- package/dist/runtime/components/KTreeView/KTreeView.logic.d.ts +1 -1
- 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 +99 -13
- package/dist/runtime/presets/default/assets/scss/index.scss +42 -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.d.vue.ts +3 -0
- package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue +59 -42
- package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue.d.ts +3 -0
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.d.vue.ts +7 -0
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue +108 -79
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue.d.ts +7 -0
- package/dist/runtime/presets/default/components/KCombobox/KComboboxList.d.vue.ts +1 -0
- package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue +79 -61
- package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue.d.ts +1 -0
- package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.d.vue.ts +29 -0
- package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.vue +202 -0
- package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.vue.d.ts +29 -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 +7 -0
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue +58 -25
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue.d.ts +7 -0
- package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.d.vue.ts +6 -0
- package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue +81 -52
- package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue.d.ts +6 -0
- package/dist/runtime/presets/default/components/KDropdown/KDropdown.d.vue.ts +10 -0
- package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue +57 -25
- package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue.d.ts +10 -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 +8 -2
- package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue +48 -28
- package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue.d.ts +8 -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 +65 -48
- package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.d.vue.ts +2 -0
- package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue +117 -84
- package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue.d.ts +2 -0
- package/dist/runtime/presets/default/components/KModal/KModal.d.vue.ts +2 -0
- package/dist/runtime/presets/default/components/KModal/KModal.vue +85 -35
- package/dist/runtime/presets/default/components/KModal/KModal.vue.d.ts +2 -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 +97 -34
- package/dist/runtime/presets/default/components/KPanel/KPanel.vue.d.ts +3 -0
- package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.d.vue.ts +2 -0
- package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.vue +40 -35
- package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.vue.d.ts +2 -0
- 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.d.vue.ts +2 -0
- package/dist/runtime/presets/default/components/KTextarea/KTextarea.vue +40 -21
- package/dist/runtime/presets/default/components/KTextarea/KTextarea.vue.d.ts +2 -0
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.d.vue.ts +4 -1
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue +76 -37
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue.d.ts +4 -1
- package/dist/runtime/presets/default/components/KToast/KToast.d.vue.ts +17 -0
- package/dist/runtime/presets/default/components/KToast/KToast.vue +118 -0
- package/dist/runtime/presets/default/components/KToast/KToast.vue.d.ts +17 -0
- package/dist/runtime/presets/default/components/KTree/KTree.vue +103 -80
- package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.d.vue.ts +6 -0
- package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue +88 -55
- package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue.d.ts +6 -0
- 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
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { type KComboboxProps } from './KCombobox.logic.js';
|
|
1
2
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
3
|
dataProvider: {
|
|
3
|
-
type: PropType<ADataProvider>;
|
|
4
|
+
type: import("vue").PropType<import("@katlux/providers").ADataProvider>;
|
|
4
5
|
required: boolean;
|
|
5
6
|
};
|
|
6
7
|
closeOnSelect: {
|
|
@@ -27,23 +28,53 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
27
28
|
type: BooleanConstructor;
|
|
28
29
|
default: boolean;
|
|
29
30
|
};
|
|
31
|
+
searchPlaceholder: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
default: string;
|
|
34
|
+
};
|
|
30
35
|
visibleFields: {
|
|
31
|
-
type: PropType<Array<String>>;
|
|
36
|
+
type: import("vue").PropType<Array<String>>;
|
|
32
37
|
default: null;
|
|
33
38
|
};
|
|
34
39
|
labelField: {
|
|
35
40
|
type: StringConstructor;
|
|
36
41
|
required: boolean;
|
|
37
42
|
};
|
|
43
|
+
valueField: {
|
|
44
|
+
type: StringConstructor;
|
|
45
|
+
default: null;
|
|
46
|
+
};
|
|
38
47
|
modelValue: {
|
|
39
|
-
type:
|
|
48
|
+
type: import("vue").PropType<any>;
|
|
49
|
+
default: null;
|
|
50
|
+
};
|
|
51
|
+
teleportTo: {
|
|
52
|
+
type: import("vue").PropType<string>;
|
|
53
|
+
default: undefined;
|
|
54
|
+
};
|
|
55
|
+
validation: {
|
|
56
|
+
type: import("vue").PropType<KComboboxProps["validation"]>;
|
|
40
57
|
default: null;
|
|
58
|
+
validator: (value: string) => boolean;
|
|
59
|
+
};
|
|
60
|
+
validationText: {
|
|
61
|
+
type: StringConstructor;
|
|
62
|
+
default: string;
|
|
63
|
+
};
|
|
64
|
+
isOptionsOpen: {
|
|
65
|
+
type: BooleanConstructor;
|
|
66
|
+
default: undefined;
|
|
67
|
+
};
|
|
68
|
+
fullWidth: {
|
|
69
|
+
type: BooleanConstructor;
|
|
70
|
+
default: boolean;
|
|
41
71
|
};
|
|
42
72
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
43
73
|
"update:modelValue": (value: any) => any;
|
|
74
|
+
"update:isOptionsOpen": (value: boolean) => any;
|
|
44
75
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
45
76
|
dataProvider: {
|
|
46
|
-
type: PropType<ADataProvider>;
|
|
77
|
+
type: import("vue").PropType<import("@katlux/providers").ADataProvider>;
|
|
47
78
|
required: boolean;
|
|
48
79
|
};
|
|
49
80
|
closeOnSelect: {
|
|
@@ -70,30 +101,66 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
70
101
|
type: BooleanConstructor;
|
|
71
102
|
default: boolean;
|
|
72
103
|
};
|
|
104
|
+
searchPlaceholder: {
|
|
105
|
+
type: StringConstructor;
|
|
106
|
+
default: string;
|
|
107
|
+
};
|
|
73
108
|
visibleFields: {
|
|
74
|
-
type: PropType<Array<String>>;
|
|
109
|
+
type: import("vue").PropType<Array<String>>;
|
|
75
110
|
default: null;
|
|
76
111
|
};
|
|
77
112
|
labelField: {
|
|
78
113
|
type: StringConstructor;
|
|
79
114
|
required: boolean;
|
|
80
115
|
};
|
|
116
|
+
valueField: {
|
|
117
|
+
type: StringConstructor;
|
|
118
|
+
default: null;
|
|
119
|
+
};
|
|
81
120
|
modelValue: {
|
|
82
|
-
type:
|
|
121
|
+
type: import("vue").PropType<any>;
|
|
122
|
+
default: null;
|
|
123
|
+
};
|
|
124
|
+
teleportTo: {
|
|
125
|
+
type: import("vue").PropType<string>;
|
|
126
|
+
default: undefined;
|
|
127
|
+
};
|
|
128
|
+
validation: {
|
|
129
|
+
type: import("vue").PropType<KComboboxProps["validation"]>;
|
|
83
130
|
default: null;
|
|
131
|
+
validator: (value: string) => boolean;
|
|
132
|
+
};
|
|
133
|
+
validationText: {
|
|
134
|
+
type: StringConstructor;
|
|
135
|
+
default: string;
|
|
136
|
+
};
|
|
137
|
+
isOptionsOpen: {
|
|
138
|
+
type: BooleanConstructor;
|
|
139
|
+
default: undefined;
|
|
140
|
+
};
|
|
141
|
+
fullWidth: {
|
|
142
|
+
type: BooleanConstructor;
|
|
143
|
+
default: boolean;
|
|
84
144
|
};
|
|
85
145
|
}>> & Readonly<{
|
|
86
146
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
147
|
+
"onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
|
|
87
148
|
}>, {
|
|
88
149
|
disabled: boolean;
|
|
150
|
+
validation: "error" | "success" | "warning" | null | undefined;
|
|
151
|
+
validationText: string;
|
|
89
152
|
modelValue: any;
|
|
90
153
|
searchbox: boolean;
|
|
154
|
+
searchPlaceholder: string;
|
|
155
|
+
isOptionsOpen: boolean;
|
|
91
156
|
placeholder: string;
|
|
92
|
-
|
|
157
|
+
teleportTo: string;
|
|
158
|
+
fullWidth: boolean;
|
|
93
159
|
closeOnSelect: boolean;
|
|
94
160
|
multiSelect: boolean;
|
|
95
161
|
maxSelectedDisplay: string | number | boolean;
|
|
96
|
-
visibleFields:
|
|
162
|
+
visibleFields: String[];
|
|
163
|
+
valueField: string;
|
|
97
164
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
98
165
|
declare const _default: typeof __VLS_export;
|
|
99
166
|
export default _default;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useKComboboxLogic, KComboboxDefaultProps } from "./KCombobox.logic";
|
|
3
3
|
import { usePresetComponent } from "../../composables/usePresetComponent";
|
|
4
|
-
import { computed } from "vue";
|
|
4
|
+
import { computed, watch } from "vue";
|
|
5
5
|
import KComboboxDefault from "../../presets/default/components/KCombobox/KCombobox.vue";
|
|
6
6
|
const props = defineProps(KComboboxDefaultProps);
|
|
7
|
-
const emit = defineEmits(["update:modelValue"]);
|
|
7
|
+
const emit = defineEmits(["update:modelValue", "update:isOptionsOpen"]);
|
|
8
8
|
const {
|
|
9
9
|
selectedItems,
|
|
10
10
|
isOptionsOpen,
|
|
@@ -17,6 +17,9 @@ const {
|
|
|
17
17
|
filteredOptions,
|
|
18
18
|
loading
|
|
19
19
|
} = useKComboboxLogic(props, emit);
|
|
20
|
+
watch(isOptionsOpen, (newVal) => {
|
|
21
|
+
emit("update:isOptionsOpen", newVal);
|
|
22
|
+
});
|
|
20
23
|
const presetComponent = usePresetComponent("KCombobox", KComboboxDefault);
|
|
21
24
|
const templateProps = computed(() => ({
|
|
22
25
|
disabled: props.disabled,
|
|
@@ -24,6 +27,7 @@ const templateProps = computed(() => ({
|
|
|
24
27
|
labelField: props.labelField,
|
|
25
28
|
placeholder: props.placeholder,
|
|
26
29
|
searchbox: props.searchbox,
|
|
30
|
+
searchPlaceholder: props.searchPlaceholder,
|
|
27
31
|
searchtext: searchtext.value,
|
|
28
32
|
filteredOptions: filteredOptions.value,
|
|
29
33
|
getSelectedContent,
|
|
@@ -31,13 +35,23 @@ const templateProps = computed(() => ({
|
|
|
31
35
|
closeDropdown,
|
|
32
36
|
selectItem,
|
|
33
37
|
isSelected,
|
|
34
|
-
loading: loading.value
|
|
38
|
+
loading: loading.value,
|
|
39
|
+
teleportTo: props.teleportTo,
|
|
40
|
+
valueField: props.valueField,
|
|
41
|
+
validation: props.validation,
|
|
42
|
+
validationText: props.validationText,
|
|
43
|
+
fullWidth: props.fullWidth
|
|
35
44
|
}));
|
|
36
45
|
function updateSearchText(val) {
|
|
37
46
|
searchtext.value = val;
|
|
38
47
|
}
|
|
48
|
+
function updateIsOptionsOpen(val) {
|
|
49
|
+
isOptionsOpen.value = val;
|
|
50
|
+
}
|
|
39
51
|
</script>
|
|
40
52
|
|
|
41
53
|
<template lang="pug">
|
|
42
|
-
component(:is="presetComponent" v-bind="templateProps" @update:searchtext="updateSearchText")
|
|
54
|
+
component(:is="presetComponent" v-bind="{...templateProps, ...$attrs}" @update:searchtext="updateSearchText" @update:isOptionsOpen="updateIsOptionsOpen")
|
|
55
|
+
template(v-for="(_, slot) in $slots" #[slot]="scope")
|
|
56
|
+
slot(:name="slot" v-bind="scope")
|
|
43
57
|
</template>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { type KComboboxProps } from './KCombobox.logic.js';
|
|
1
2
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
3
|
dataProvider: {
|
|
3
|
-
type: PropType<ADataProvider>;
|
|
4
|
+
type: import("vue").PropType<import("@katlux/providers").ADataProvider>;
|
|
4
5
|
required: boolean;
|
|
5
6
|
};
|
|
6
7
|
closeOnSelect: {
|
|
@@ -27,23 +28,53 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
27
28
|
type: BooleanConstructor;
|
|
28
29
|
default: boolean;
|
|
29
30
|
};
|
|
31
|
+
searchPlaceholder: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
default: string;
|
|
34
|
+
};
|
|
30
35
|
visibleFields: {
|
|
31
|
-
type: PropType<Array<String>>;
|
|
36
|
+
type: import("vue").PropType<Array<String>>;
|
|
32
37
|
default: null;
|
|
33
38
|
};
|
|
34
39
|
labelField: {
|
|
35
40
|
type: StringConstructor;
|
|
36
41
|
required: boolean;
|
|
37
42
|
};
|
|
43
|
+
valueField: {
|
|
44
|
+
type: StringConstructor;
|
|
45
|
+
default: null;
|
|
46
|
+
};
|
|
38
47
|
modelValue: {
|
|
39
|
-
type:
|
|
48
|
+
type: import("vue").PropType<any>;
|
|
49
|
+
default: null;
|
|
50
|
+
};
|
|
51
|
+
teleportTo: {
|
|
52
|
+
type: import("vue").PropType<string>;
|
|
53
|
+
default: undefined;
|
|
54
|
+
};
|
|
55
|
+
validation: {
|
|
56
|
+
type: import("vue").PropType<KComboboxProps["validation"]>;
|
|
40
57
|
default: null;
|
|
58
|
+
validator: (value: string) => boolean;
|
|
59
|
+
};
|
|
60
|
+
validationText: {
|
|
61
|
+
type: StringConstructor;
|
|
62
|
+
default: string;
|
|
63
|
+
};
|
|
64
|
+
isOptionsOpen: {
|
|
65
|
+
type: BooleanConstructor;
|
|
66
|
+
default: undefined;
|
|
67
|
+
};
|
|
68
|
+
fullWidth: {
|
|
69
|
+
type: BooleanConstructor;
|
|
70
|
+
default: boolean;
|
|
41
71
|
};
|
|
42
72
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
43
73
|
"update:modelValue": (value: any) => any;
|
|
74
|
+
"update:isOptionsOpen": (value: boolean) => any;
|
|
44
75
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
45
76
|
dataProvider: {
|
|
46
|
-
type: PropType<ADataProvider>;
|
|
77
|
+
type: import("vue").PropType<import("@katlux/providers").ADataProvider>;
|
|
47
78
|
required: boolean;
|
|
48
79
|
};
|
|
49
80
|
closeOnSelect: {
|
|
@@ -70,30 +101,66 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
70
101
|
type: BooleanConstructor;
|
|
71
102
|
default: boolean;
|
|
72
103
|
};
|
|
104
|
+
searchPlaceholder: {
|
|
105
|
+
type: StringConstructor;
|
|
106
|
+
default: string;
|
|
107
|
+
};
|
|
73
108
|
visibleFields: {
|
|
74
|
-
type: PropType<Array<String>>;
|
|
109
|
+
type: import("vue").PropType<Array<String>>;
|
|
75
110
|
default: null;
|
|
76
111
|
};
|
|
77
112
|
labelField: {
|
|
78
113
|
type: StringConstructor;
|
|
79
114
|
required: boolean;
|
|
80
115
|
};
|
|
116
|
+
valueField: {
|
|
117
|
+
type: StringConstructor;
|
|
118
|
+
default: null;
|
|
119
|
+
};
|
|
81
120
|
modelValue: {
|
|
82
|
-
type:
|
|
121
|
+
type: import("vue").PropType<any>;
|
|
122
|
+
default: null;
|
|
123
|
+
};
|
|
124
|
+
teleportTo: {
|
|
125
|
+
type: import("vue").PropType<string>;
|
|
126
|
+
default: undefined;
|
|
127
|
+
};
|
|
128
|
+
validation: {
|
|
129
|
+
type: import("vue").PropType<KComboboxProps["validation"]>;
|
|
83
130
|
default: null;
|
|
131
|
+
validator: (value: string) => boolean;
|
|
132
|
+
};
|
|
133
|
+
validationText: {
|
|
134
|
+
type: StringConstructor;
|
|
135
|
+
default: string;
|
|
136
|
+
};
|
|
137
|
+
isOptionsOpen: {
|
|
138
|
+
type: BooleanConstructor;
|
|
139
|
+
default: undefined;
|
|
140
|
+
};
|
|
141
|
+
fullWidth: {
|
|
142
|
+
type: BooleanConstructor;
|
|
143
|
+
default: boolean;
|
|
84
144
|
};
|
|
85
145
|
}>> & Readonly<{
|
|
86
146
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
147
|
+
"onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
|
|
87
148
|
}>, {
|
|
88
149
|
disabled: boolean;
|
|
150
|
+
validation: "error" | "success" | "warning" | null | undefined;
|
|
151
|
+
validationText: string;
|
|
89
152
|
modelValue: any;
|
|
90
153
|
searchbox: boolean;
|
|
154
|
+
searchPlaceholder: string;
|
|
155
|
+
isOptionsOpen: boolean;
|
|
91
156
|
placeholder: string;
|
|
92
|
-
|
|
157
|
+
teleportTo: string;
|
|
158
|
+
fullWidth: boolean;
|
|
93
159
|
closeOnSelect: boolean;
|
|
94
160
|
multiSelect: boolean;
|
|
95
161
|
maxSelectedDisplay: string | number | boolean;
|
|
96
|
-
visibleFields:
|
|
162
|
+
visibleFields: String[];
|
|
163
|
+
valueField: string;
|
|
97
164
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
98
165
|
declare const _default: typeof __VLS_export;
|
|
99
166
|
export default _default;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ADataProvider } from '@katlux/providers';
|
|
2
2
|
import { type TDataRow } from '@katlux/providers';
|
|
3
|
+
import { type PropType } from 'vue';
|
|
3
4
|
export type ComboboxItem = TDataRow;
|
|
4
5
|
export interface KComboboxProps {
|
|
5
6
|
dataProvider: ADataProvider;
|
|
@@ -9,12 +10,20 @@ export interface KComboboxProps {
|
|
|
9
10
|
maxSelectedDisplay?: number | string | false;
|
|
10
11
|
placeholder?: string;
|
|
11
12
|
searchbox?: boolean;
|
|
13
|
+
searchPlaceholder?: string;
|
|
12
14
|
visibleFields?: Array<String> | null;
|
|
13
15
|
labelField: string;
|
|
14
|
-
|
|
16
|
+
valueField?: string;
|
|
17
|
+
modelValue?: any;
|
|
18
|
+
teleportTo?: string;
|
|
19
|
+
isOptionsOpen?: boolean;
|
|
20
|
+
fullWidth?: boolean;
|
|
21
|
+
validation?: 'success' | 'warning' | 'error' | null;
|
|
22
|
+
validationText?: string;
|
|
15
23
|
}
|
|
16
24
|
export interface KComboboxEmits {
|
|
17
|
-
(e: 'update:modelValue', value:
|
|
25
|
+
(e: 'update:modelValue', value: any): void;
|
|
26
|
+
(e: 'update:isOptionsOpen', value: boolean): void;
|
|
18
27
|
}
|
|
19
28
|
export declare const KComboboxDefaultProps: {
|
|
20
29
|
dataProvider: {
|
|
@@ -45,6 +54,10 @@ export declare const KComboboxDefaultProps: {
|
|
|
45
54
|
type: BooleanConstructor;
|
|
46
55
|
default: boolean;
|
|
47
56
|
};
|
|
57
|
+
searchPlaceholder: {
|
|
58
|
+
type: StringConstructor;
|
|
59
|
+
default: string;
|
|
60
|
+
};
|
|
48
61
|
visibleFields: {
|
|
49
62
|
type: PropType<Array<String>>;
|
|
50
63
|
default: null;
|
|
@@ -53,20 +66,45 @@ export declare const KComboboxDefaultProps: {
|
|
|
53
66
|
type: StringConstructor;
|
|
54
67
|
required: boolean;
|
|
55
68
|
};
|
|
69
|
+
valueField: {
|
|
70
|
+
type: StringConstructor;
|
|
71
|
+
default: null;
|
|
72
|
+
};
|
|
56
73
|
modelValue: {
|
|
57
|
-
type: PropType<
|
|
74
|
+
type: PropType<any>;
|
|
75
|
+
default: null;
|
|
76
|
+
};
|
|
77
|
+
teleportTo: {
|
|
78
|
+
type: PropType<string>;
|
|
79
|
+
default: undefined;
|
|
80
|
+
};
|
|
81
|
+
validation: {
|
|
82
|
+
type: PropType<KComboboxProps["validation"]>;
|
|
58
83
|
default: null;
|
|
84
|
+
validator: (value: string) => boolean;
|
|
85
|
+
};
|
|
86
|
+
validationText: {
|
|
87
|
+
type: StringConstructor;
|
|
88
|
+
default: string;
|
|
89
|
+
};
|
|
90
|
+
isOptionsOpen: {
|
|
91
|
+
type: BooleanConstructor;
|
|
92
|
+
default: undefined;
|
|
93
|
+
};
|
|
94
|
+
fullWidth: {
|
|
95
|
+
type: BooleanConstructor;
|
|
96
|
+
default: boolean;
|
|
59
97
|
};
|
|
60
98
|
};
|
|
61
99
|
export declare function useKComboboxLogic(props: KComboboxProps, emit: KComboboxEmits): {
|
|
62
|
-
selectedItems: import("vue").Ref<
|
|
100
|
+
selectedItems: import("vue").Ref<TDataRow[] | null, TDataRow[] | null>;
|
|
63
101
|
isOptionsOpen: import("vue").Ref<boolean, boolean>;
|
|
64
102
|
searchtext: import("vue").Ref<string, string>;
|
|
65
103
|
selectItem: (option: ComboboxItem) => void;
|
|
66
|
-
isSelected: (option: ComboboxItem) =>
|
|
67
|
-
getSelectedContent: () =>
|
|
104
|
+
isSelected: (option: ComboboxItem) => boolean | undefined;
|
|
105
|
+
getSelectedContent: () => TDataRow[];
|
|
68
106
|
toggleDropdown: () => void;
|
|
69
107
|
closeDropdown: () => void;
|
|
70
|
-
filteredOptions: import("vue").ComputedRef<
|
|
71
|
-
loading:
|
|
108
|
+
filteredOptions: import("vue").ComputedRef<TDataRow[]>;
|
|
109
|
+
loading: import("vue").ComputedRef<Boolean>;
|
|
72
110
|
};
|
|
@@ -31,6 +31,10 @@ export const KComboboxDefaultProps = {
|
|
|
31
31
|
type: Boolean,
|
|
32
32
|
default: false
|
|
33
33
|
},
|
|
34
|
+
searchPlaceholder: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: "Search..."
|
|
37
|
+
},
|
|
34
38
|
visibleFields: {
|
|
35
39
|
type: Array,
|
|
36
40
|
default: null
|
|
@@ -39,15 +43,45 @@ export const KComboboxDefaultProps = {
|
|
|
39
43
|
type: String,
|
|
40
44
|
required: true
|
|
41
45
|
},
|
|
46
|
+
valueField: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: null
|
|
49
|
+
},
|
|
42
50
|
modelValue: {
|
|
43
|
-
type: [Object, Array],
|
|
51
|
+
type: [Object, Array, String, Number],
|
|
44
52
|
default: null
|
|
53
|
+
},
|
|
54
|
+
teleportTo: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: void 0
|
|
57
|
+
},
|
|
58
|
+
validation: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: null,
|
|
61
|
+
validator: (value) => [null, "success", "warning", "error"].includes(value)
|
|
62
|
+
},
|
|
63
|
+
validationText: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: ""
|
|
66
|
+
},
|
|
67
|
+
isOptionsOpen: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
default: void 0
|
|
70
|
+
},
|
|
71
|
+
fullWidth: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: true
|
|
45
74
|
}
|
|
46
75
|
};
|
|
47
76
|
export function useKComboboxLogic(props, emit) {
|
|
48
77
|
const selectedItems = ref(null);
|
|
49
78
|
const isOptionsOpen = ref(false);
|
|
50
79
|
const searchtext = ref("");
|
|
80
|
+
watch(() => props.isOptionsOpen, (newVal) => {
|
|
81
|
+
if (newVal !== void 0 && newVal !== isOptionsOpen.value) {
|
|
82
|
+
isOptionsOpen.value = newVal;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
51
85
|
function selectItem(option) {
|
|
52
86
|
if (props.multiSelect) {
|
|
53
87
|
if (isSelected(option)) {
|
|
@@ -62,12 +96,17 @@ export function useKComboboxLogic(props, emit) {
|
|
|
62
96
|
}
|
|
63
97
|
isOptionsOpen.value = !props.closeOnSelect;
|
|
64
98
|
if (props.multiSelect) {
|
|
65
|
-
|
|
99
|
+
const value = props.valueField ? selectedItems.value?.map((item) => item[props.valueField]) : selectedItems.value;
|
|
100
|
+
emit("update:modelValue", value);
|
|
66
101
|
} else {
|
|
67
|
-
|
|
102
|
+
const value = props.valueField ? selectedItems.value?.[0]?.[props.valueField] : selectedItems.value?.[0];
|
|
103
|
+
emit("update:modelValue", value || null);
|
|
68
104
|
}
|
|
69
105
|
}
|
|
70
106
|
function isSelected(option) {
|
|
107
|
+
if (props.valueField) {
|
|
108
|
+
return selectedItems.value?.some((item) => item[props.valueField] === option[props.valueField]);
|
|
109
|
+
}
|
|
71
110
|
return selectedItems.value?.some((item) => item[props.labelField] === option[props.labelField]);
|
|
72
111
|
}
|
|
73
112
|
function getSelectedContent() {
|
|
@@ -102,6 +141,7 @@ export function useKComboboxLogic(props, emit) {
|
|
|
102
141
|
watch(
|
|
103
142
|
() => searchtext.value,
|
|
104
143
|
(newText) => {
|
|
144
|
+
if (!props.dataProvider?.filter) return;
|
|
105
145
|
const filter = {
|
|
106
146
|
operator: EDataFilterOperator.In,
|
|
107
147
|
field: { [props.labelField]: newText.trim().toLowerCase() },
|
|
@@ -111,18 +151,46 @@ export function useKComboboxLogic(props, emit) {
|
|
|
111
151
|
}
|
|
112
152
|
);
|
|
113
153
|
const filteredOptions = computed(() => {
|
|
114
|
-
return props.dataProvider
|
|
154
|
+
return props.dataProvider?.pageData.value || [];
|
|
115
155
|
});
|
|
156
|
+
function resolveSelectedFromValue() {
|
|
157
|
+
if (!props.modelValue) {
|
|
158
|
+
selectedItems.value = null;
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
if (!props.valueField) {
|
|
162
|
+
selectedItems.value = Array.isArray(props.modelValue) ? props.modelValue : [props.modelValue];
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
const provider = props.dataProvider;
|
|
166
|
+
const data = provider?.allData?.value || provider?.pageData?.value || [];
|
|
167
|
+
if (data.length === 0) return;
|
|
168
|
+
const values = Array.isArray(props.modelValue) ? props.modelValue : [props.modelValue];
|
|
169
|
+
const matchedItems = data.filter((item) => values.includes(item[props.valueField]));
|
|
170
|
+
if (matchedItems.length > 0) {
|
|
171
|
+
selectedItems.value = matchedItems;
|
|
172
|
+
} else if (typeof props.modelValue === "object") {
|
|
173
|
+
selectedItems.value = Array.isArray(props.modelValue) ? props.modelValue : [props.modelValue];
|
|
174
|
+
}
|
|
175
|
+
}
|
|
116
176
|
onMounted(() => {
|
|
117
|
-
|
|
118
|
-
if (props.searchbox) {
|
|
177
|
+
resolveSelectedFromValue();
|
|
178
|
+
if (props.searchbox && props.dataProvider?.filter) {
|
|
119
179
|
props.dataProvider.filter.value = null;
|
|
120
180
|
}
|
|
121
181
|
});
|
|
122
182
|
watch(
|
|
123
183
|
() => props.modelValue,
|
|
124
|
-
(
|
|
125
|
-
|
|
184
|
+
() => {
|
|
185
|
+
resolveSelectedFromValue();
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
watch(
|
|
189
|
+
() => props.dataProvider?.allData?.value || props.dataProvider?.pageData?.value,
|
|
190
|
+
(newData) => {
|
|
191
|
+
if (newData && newData.length > 0 && props.modelValue && (!selectedItems.value || selectedItems.value.length === 0 || !selectedItems.value[0][props.labelField])) {
|
|
192
|
+
resolveSelectedFromValue();
|
|
193
|
+
}
|
|
126
194
|
}
|
|
127
195
|
);
|
|
128
196
|
return {
|
|
@@ -135,6 +203,6 @@ export function useKComboboxLogic(props, emit) {
|
|
|
135
203
|
toggleDropdown,
|
|
136
204
|
closeDropdown,
|
|
137
205
|
filteredOptions,
|
|
138
|
-
loading: props.dataProvider.
|
|
206
|
+
loading: computed(() => props.dataProvider?.loading.value ?? false)
|
|
139
207
|
};
|
|
140
208
|
}
|