@katlux/toolkit 0.1.0-beta.6 → 0.1.0-beta.66

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.
Files changed (184) hide show
  1. package/dist/compiled/composables/usePresetComponent.mjs +21 -16
  2. package/dist/module.cjs +52 -0
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +52 -0
  5. package/dist/runtime/components/KBulkActions/KBulkActions.logic.d.ts +9 -2
  6. package/dist/runtime/components/KCalendar/KCalendar.global.d.vue.ts +11 -12
  7. package/dist/runtime/components/KCalendar/KCalendar.global.vue.d.ts +11 -12
  8. package/dist/runtime/components/KCalendar/KCalendar.logic.d.ts +1 -0
  9. package/dist/runtime/components/KCalendar/KCalendar.logic.js +25 -10
  10. package/dist/runtime/components/KCheckbox/KCheckbox.global.d.vue.ts +30 -0
  11. package/dist/runtime/components/KCheckbox/KCheckbox.global.vue +4 -1
  12. package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +30 -0
  13. package/dist/runtime/components/KCheckbox/KCheckbox.logic.d.ts +17 -0
  14. package/dist/runtime/components/KCheckbox/KCheckbox.logic.js +16 -1
  15. package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +75 -8
  16. package/dist/runtime/components/KCombobox/KCombobox.global.vue +18 -4
  17. package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +75 -8
  18. package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +46 -8
  19. package/dist/runtime/components/KCombobox/KCombobox.logic.js +77 -9
  20. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +169 -0
  21. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue +46 -0
  22. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +169 -0
  23. package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.d.ts +127 -0
  24. package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.js +160 -0
  25. package/dist/runtime/components/KDatatable/KDataIterator.global.vue +1 -1
  26. package/dist/runtime/components/KDatatable/KDataIterator.logic.d.ts +2 -2
  27. package/dist/runtime/components/KDatatable/KDatatable.global.vue +1 -1
  28. package/dist/runtime/components/KDatatable/KDatatable.logic.d.ts +2 -2
  29. package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +95 -8
  30. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue +27 -3
  31. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +95 -8
  32. package/dist/runtime/components/KDatePicker/KDatePicker.logic.d.ts +43 -1
  33. package/dist/runtime/components/KDatePicker/KDatePicker.logic.js +106 -7
  34. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +84 -8
  35. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue +26 -3
  36. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +84 -8
  37. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.d.ts +38 -1
  38. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.js +161 -7
  39. package/dist/runtime/components/KDropdown/KDropdown.global.d.vue.ts +27 -0
  40. package/dist/runtime/components/KDropdown/KDropdown.global.vue +14 -4
  41. package/dist/runtime/components/KDropdown/KDropdown.global.vue.d.ts +27 -0
  42. package/dist/runtime/components/KDropdown/KDropdown.logic.d.ts +36 -1
  43. package/dist/runtime/components/KDropdown/KDropdown.logic.js +92 -4
  44. package/dist/runtime/components/KGrid/KGrid.global.d.vue.ts +7 -56
  45. package/dist/runtime/components/KGrid/KGrid.global.vue +9 -2
  46. package/dist/runtime/components/KGrid/KGrid.global.vue.d.ts +7 -56
  47. package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +41 -0
  48. package/dist/runtime/components/KHourPicker/KHourPicker.global.vue +27 -12
  49. package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +41 -0
  50. package/dist/runtime/components/KHourPicker/KHourPicker.logic.d.ts +26 -3
  51. package/dist/runtime/components/KHourPicker/KHourPicker.logic.js +34 -10
  52. package/dist/runtime/components/KHourSelect/KHourSelect.logic.js +4 -1
  53. package/dist/runtime/components/KIcon/KIcon.global.d.vue.ts +1 -1
  54. package/dist/runtime/components/KIcon/KIcon.global.vue.d.ts +1 -1
  55. package/dist/runtime/components/KIcon/KIcon.logic.d.ts +1 -1
  56. package/dist/runtime/components/KIcon/KIcon.logic.js +13 -8
  57. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.d.vue.ts +21 -0
  58. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue +4 -2
  59. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +21 -0
  60. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.logic.d.ts +11 -0
  61. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.logic.js +9 -0
  62. package/dist/runtime/components/KModal/KModal.global.d.vue.ts +14 -2
  63. package/dist/runtime/components/KModal/KModal.global.vue +5 -1
  64. package/dist/runtime/components/KModal/KModal.global.vue.d.ts +14 -2
  65. package/dist/runtime/components/KModal/KModal.logic.d.ts +10 -2
  66. package/dist/runtime/components/KModal/KModal.logic.js +12 -3
  67. package/dist/runtime/components/KPagination/KPagination.global.vue +1 -1
  68. package/dist/runtime/components/KPanel/KPanel.global.d.vue.ts +5 -28
  69. package/dist/runtime/components/KPanel/KPanel.global.vue +12 -4
  70. package/dist/runtime/components/KPanel/KPanel.global.vue.d.ts +5 -28
  71. package/dist/runtime/components/KPanel/KPanel.logic.d.ts +10 -0
  72. package/dist/runtime/components/KPanel/KPanel.logic.js +8 -0
  73. package/dist/runtime/components/KRadiobox/KRadiobox.global.d.vue.ts +21 -0
  74. package/dist/runtime/components/KRadiobox/KRadiobox.global.vue +3 -1
  75. package/dist/runtime/components/KRadiobox/KRadiobox.global.vue.d.ts +21 -0
  76. package/dist/runtime/components/KRadiobox/KRadiobox.logic.d.ts +11 -0
  77. package/dist/runtime/components/KRadiobox/KRadiobox.logic.js +9 -0
  78. package/dist/runtime/components/KTextarea/KTextarea.global.d.vue.ts +21 -0
  79. package/dist/runtime/components/KTextarea/KTextarea.global.vue +3 -1
  80. package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +21 -0
  81. package/dist/runtime/components/KTextarea/KTextarea.logic.d.ts +11 -0
  82. package/dist/runtime/components/KTextarea/KTextarea.logic.js +9 -0
  83. package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +35 -2
  84. package/dist/runtime/components/KTextbox/KTextbox.global.vue +7 -4
  85. package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +35 -2
  86. package/dist/runtime/components/KTextbox/KTextbox.logic.d.ts +21 -4
  87. package/dist/runtime/components/KTextbox/KTextbox.logic.js +21 -5
  88. package/dist/runtime/components/KToast/KToast.global.d.vue.ts +57 -0
  89. package/dist/runtime/components/KToast/KToast.global.vue +32 -0
  90. package/dist/runtime/components/KToast/KToast.global.vue.d.ts +57 -0
  91. package/dist/runtime/components/KToast/KToast.logic.d.ts +34 -0
  92. package/dist/runtime/components/KToast/KToast.logic.js +47 -0
  93. package/dist/runtime/components/KTree/KTree.logic.d.ts +1 -1
  94. package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +63 -5
  95. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue +15 -3
  96. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +63 -5
  97. package/dist/runtime/components/KTreePicker/KTreePicker.logic.d.ts +37 -5
  98. package/dist/runtime/components/KTreePicker/KTreePicker.logic.js +32 -1
  99. package/dist/runtime/components/KTreeView/KTreeView.global.d.vue.ts +5 -5
  100. package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +5 -5
  101. package/dist/runtime/components/KTreeView/KTreeView.logic.d.ts +1 -1
  102. package/dist/runtime/composables/usePresetComponent.d.ts +16 -0
  103. package/dist/runtime/composables/usePresetComponent.js +21 -16
  104. package/dist/runtime/presets/default/assets/scss/css-variables.css +64 -13
  105. package/dist/runtime/presets/default/assets/scss/css-variables.scss +286 -0
  106. package/dist/runtime/presets/default/assets/scss/docs.scss +52 -0
  107. package/dist/runtime/presets/default/assets/scss/index.css +99 -13
  108. package/dist/runtime/presets/default/assets/scss/index.scss +42 -0
  109. package/dist/runtime/presets/default/assets/scss/mixins.scss +94 -0
  110. package/dist/runtime/presets/default/assets/scss/reset.scss +16 -0
  111. package/dist/runtime/presets/default/components/KAccordion/KAccordion.vue +5 -2
  112. package/dist/runtime/presets/default/components/KAccordion/KAccordionItem.vue +40 -37
  113. package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue +29 -22
  114. package/dist/runtime/presets/default/components/KButton/KButton.vue +147 -428
  115. package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue +57 -53
  116. package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue +189 -161
  117. package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.d.vue.ts +3 -0
  118. package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue +59 -42
  119. package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue.d.ts +3 -0
  120. package/dist/runtime/presets/default/components/KCombobox/KCombobox.d.vue.ts +7 -0
  121. package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue +108 -79
  122. package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue.d.ts +7 -0
  123. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.d.vue.ts +1 -0
  124. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue +79 -61
  125. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue.d.ts +1 -0
  126. package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.d.vue.ts +29 -0
  127. package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.vue +202 -0
  128. package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.vue.d.ts +29 -0
  129. package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.vue +40 -31
  130. package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +110 -92
  131. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.d.vue.ts +7 -0
  132. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue +58 -25
  133. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue.d.ts +7 -0
  134. package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.d.vue.ts +6 -0
  135. package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue +81 -52
  136. package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue.d.ts +6 -0
  137. package/dist/runtime/presets/default/components/KDropdown/KDropdown.d.vue.ts +10 -0
  138. package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue +57 -25
  139. package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue.d.ts +10 -0
  140. package/dist/runtime/presets/default/components/KGantt/KGantt.vue +337 -241
  141. package/dist/runtime/presets/default/components/KGantt/KGanttRuler.vue +40 -35
  142. package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue +170 -140
  143. package/dist/runtime/presets/default/components/KGrid/KGrid.vue +62 -60
  144. package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.d.vue.ts +8 -2
  145. package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue +48 -28
  146. package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue.d.ts +8 -2
  147. package/dist/runtime/presets/default/components/KHourSelect/KHourSelect.vue +34 -28
  148. package/dist/runtime/presets/default/components/KIcon/KIcon.d.vue.ts +1 -1
  149. package/dist/runtime/presets/default/components/KIcon/KIcon.vue +31 -22
  150. package/dist/runtime/presets/default/components/KIcon/KIcon.vue.d.ts +1 -1
  151. package/dist/runtime/presets/default/components/KLoader/KLoader.vue +65 -48
  152. package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.d.vue.ts +2 -0
  153. package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue +117 -84
  154. package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue.d.ts +2 -0
  155. package/dist/runtime/presets/default/components/KModal/KModal.d.vue.ts +2 -0
  156. package/dist/runtime/presets/default/components/KModal/KModal.vue +85 -35
  157. package/dist/runtime/presets/default/components/KModal/KModal.vue.d.ts +2 -0
  158. package/dist/runtime/presets/default/components/KPagination/KPagination.vue +42 -40
  159. package/dist/runtime/presets/default/components/KPanel/KPanel.d.vue.ts +3 -0
  160. package/dist/runtime/presets/default/components/KPanel/KPanel.vue +97 -34
  161. package/dist/runtime/presets/default/components/KPanel/KPanel.vue.d.ts +3 -0
  162. package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.d.vue.ts +2 -0
  163. package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.vue +40 -35
  164. package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.vue.d.ts +2 -0
  165. package/dist/runtime/presets/default/components/KRangeSlider/KRangeSlider.vue +158 -125
  166. package/dist/runtime/presets/default/components/KSlider/KSlider.vue +123 -100
  167. package/dist/runtime/presets/default/components/KTabs/KTabItem.vue +40 -37
  168. package/dist/runtime/presets/default/components/KTabs/KTabs.vue +9 -6
  169. package/dist/runtime/presets/default/components/KTextarea/KTextarea.d.vue.ts +2 -0
  170. package/dist/runtime/presets/default/components/KTextarea/KTextarea.vue +40 -21
  171. package/dist/runtime/presets/default/components/KTextarea/KTextarea.vue.d.ts +2 -0
  172. package/dist/runtime/presets/default/components/KTextbox/KTextbox.d.vue.ts +4 -1
  173. package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue +76 -37
  174. package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue.d.ts +4 -1
  175. package/dist/runtime/presets/default/components/KToast/KToast.d.vue.ts +17 -0
  176. package/dist/runtime/presets/default/components/KToast/KToast.vue +118 -0
  177. package/dist/runtime/presets/default/components/KToast/KToast.vue.d.ts +17 -0
  178. package/dist/runtime/presets/default/components/KTree/KTree.vue +103 -80
  179. package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.d.vue.ts +6 -0
  180. package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue +88 -55
  181. package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue.d.ts +6 -0
  182. package/dist/runtime/presets/default/components/KTreeView/KTreeCell.vue +31 -30
  183. package/dist/runtime/presets/default/components/KTreeView/KTreeView.vue +34 -27
  184. package/package.json +5 -5
@@ -0,0 +1,169 @@
1
+ import { type KCompositeInputProps } from './KCompositeInput.logic.js';
2
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
+ selectionValue: {
4
+ type: (ObjectConstructor | ArrayConstructor | NumberConstructor | StringConstructor)[];
5
+ default: null;
6
+ };
7
+ inputValue: {
8
+ type: (ObjectConstructor | ArrayConstructor | NumberConstructor | StringConstructor)[];
9
+ default: string;
10
+ };
11
+ modelValue: {
12
+ type: import("vue").PropType<import("./KCompositeInput.logic.js").ICompositeItem[]>;
13
+ default: () => never[];
14
+ };
15
+ dataProvider: {
16
+ type: import("vue").PropType<import("@katlux/providers").ADataProvider>;
17
+ required: boolean;
18
+ };
19
+ type: {
20
+ type: import("vue").PropType<import("./KCompositeInput.logic.js").CompositeInputType>;
21
+ default: string;
22
+ };
23
+ selectionSide: {
24
+ type: import("vue").PropType<import("./KCompositeInput.logic.js").SelectionSide>;
25
+ default: string;
26
+ };
27
+ inputType: {
28
+ type: import("vue").PropType<KCompositeInputProps["inputType"]>;
29
+ default: string;
30
+ };
31
+ mask: {
32
+ type: StringConstructor;
33
+ default: string;
34
+ };
35
+ labelField: {
36
+ type: StringConstructor;
37
+ default: string;
38
+ };
39
+ valueField: {
40
+ type: StringConstructor;
41
+ default: string;
42
+ };
43
+ placeholder: {
44
+ type: StringConstructor;
45
+ default: string;
46
+ };
47
+ inputPlaceholder: {
48
+ type: StringConstructor;
49
+ default: string;
50
+ };
51
+ searchbox: {
52
+ type: BooleanConstructor;
53
+ default: boolean;
54
+ };
55
+ showClear: {
56
+ type: BooleanConstructor;
57
+ default: boolean;
58
+ };
59
+ teleportTo: {
60
+ type: StringConstructor;
61
+ default: undefined;
62
+ };
63
+ validation: {
64
+ type: import("vue").PropType<KCompositeInputProps["validation"]>;
65
+ default: null;
66
+ validator: (value: string) => boolean;
67
+ };
68
+ validationText: {
69
+ type: StringConstructor;
70
+ default: string;
71
+ };
72
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
73
+ "update:modelValue": (value: import("./KCompositeInput.logic.js").ICompositeItem[]) => any;
74
+ "update:selectionValue": (value: any) => any;
75
+ "update:inputValue": (value: any) => any;
76
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
77
+ selectionValue: {
78
+ type: (ObjectConstructor | ArrayConstructor | NumberConstructor | StringConstructor)[];
79
+ default: null;
80
+ };
81
+ inputValue: {
82
+ type: (ObjectConstructor | ArrayConstructor | NumberConstructor | StringConstructor)[];
83
+ default: string;
84
+ };
85
+ modelValue: {
86
+ type: import("vue").PropType<import("./KCompositeInput.logic.js").ICompositeItem[]>;
87
+ default: () => never[];
88
+ };
89
+ dataProvider: {
90
+ type: import("vue").PropType<import("@katlux/providers").ADataProvider>;
91
+ required: boolean;
92
+ };
93
+ type: {
94
+ type: import("vue").PropType<import("./KCompositeInput.logic.js").CompositeInputType>;
95
+ default: string;
96
+ };
97
+ selectionSide: {
98
+ type: import("vue").PropType<import("./KCompositeInput.logic.js").SelectionSide>;
99
+ default: string;
100
+ };
101
+ inputType: {
102
+ type: import("vue").PropType<KCompositeInputProps["inputType"]>;
103
+ default: string;
104
+ };
105
+ mask: {
106
+ type: StringConstructor;
107
+ default: string;
108
+ };
109
+ labelField: {
110
+ type: StringConstructor;
111
+ default: string;
112
+ };
113
+ valueField: {
114
+ type: StringConstructor;
115
+ default: string;
116
+ };
117
+ placeholder: {
118
+ type: StringConstructor;
119
+ default: string;
120
+ };
121
+ inputPlaceholder: {
122
+ type: StringConstructor;
123
+ default: string;
124
+ };
125
+ searchbox: {
126
+ type: BooleanConstructor;
127
+ default: boolean;
128
+ };
129
+ showClear: {
130
+ type: BooleanConstructor;
131
+ default: boolean;
132
+ };
133
+ teleportTo: {
134
+ type: StringConstructor;
135
+ default: undefined;
136
+ };
137
+ validation: {
138
+ type: import("vue").PropType<KCompositeInputProps["validation"]>;
139
+ default: null;
140
+ validator: (value: string) => boolean;
141
+ };
142
+ validationText: {
143
+ type: StringConstructor;
144
+ default: string;
145
+ };
146
+ }>> & Readonly<{
147
+ "onUpdate:modelValue"?: ((value: import("./KCompositeInput.logic.js").ICompositeItem[]) => any) | undefined;
148
+ "onUpdate:selectionValue"?: ((value: any) => any) | undefined;
149
+ "onUpdate:inputValue"?: ((value: any) => any) | undefined;
150
+ }>, {
151
+ type: import("./KCompositeInput.logic.js").CompositeInputType;
152
+ validation: "error" | "success" | "warning" | null | undefined;
153
+ validationText: string;
154
+ modelValue: import("./KCompositeInput.logic.js").ICompositeItem[];
155
+ searchbox: boolean;
156
+ labelField: string;
157
+ placeholder: string;
158
+ teleportTo: string;
159
+ valueField: string;
160
+ inputType: "number" | "text" | "url" | "search" | "password" | "email" | "tel" | undefined;
161
+ selectionValue: string | number | Record<string, any> | unknown[];
162
+ inputValue: string | number | Record<string, any> | unknown[];
163
+ selectionSide: import("./KCompositeInput.logic.js").SelectionSide;
164
+ mask: string;
165
+ inputPlaceholder: string;
166
+ showClear: boolean;
167
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
168
+ declare const _default: typeof __VLS_export;
169
+ export default _default;
@@ -0,0 +1,46 @@
1
+ <script setup>
2
+ import { computed, watch, shallowRef, ref, onMounted } from "vue";
3
+ import {
4
+ useKCompositeInputLogic,
5
+ KCompositeInputDefaultProps
6
+ } from "./KCompositeInput.logic";
7
+ import { usePresetComponent } from "../../composables/usePresetComponent";
8
+ import KCompositeInputDefault from "../../presets/default/components/KCompositeInput/KCompositeInput.vue";
9
+ import { CFlatClientDataProvider } from "@katlux/providers";
10
+ const props = defineProps(KCompositeInputDefaultProps);
11
+ const emit = defineEmits(["update:selectionValue", "update:inputValue", "update:modelValue"]);
12
+ const {
13
+ internalSelectionValue,
14
+ internalInputValue,
15
+ selectionProps,
16
+ inputProps
17
+ } = useKCompositeInputLogic(props, emit);
18
+ const presetComponent = usePresetComponent("KCompositeInput", KCompositeInputDefault);
19
+ const templateProps = computed(() => ({
20
+ ...props,
21
+ selectionValue: internalSelectionValue.value,
22
+ inputValue: internalInputValue.value,
23
+ modelValue: props.modelValue,
24
+ // Determine if searchbox is needed
25
+ searchbox: props.searchbox
26
+ }));
27
+ function updateSelection(val) {
28
+ internalSelectionValue.value = val;
29
+ }
30
+ function updateInput(val) {
31
+ internalInputValue.value = val;
32
+ }
33
+ function updateModelValue(val) {
34
+ emit("update:modelValue", val);
35
+ }
36
+ </script>
37
+
38
+ <template lang="pug">
39
+ component(
40
+ :is="presetComponent"
41
+ v-bind="{...templateProps, ...$attrs}"
42
+ @update:selectionValue="updateSelection"
43
+ @update:inputValue="updateInput"
44
+ @update:modelValue="updateModelValue"
45
+ )
46
+ </template>
@@ -0,0 +1,169 @@
1
+ import { type KCompositeInputProps } from './KCompositeInput.logic.js';
2
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
+ selectionValue: {
4
+ type: (ObjectConstructor | ArrayConstructor | NumberConstructor | StringConstructor)[];
5
+ default: null;
6
+ };
7
+ inputValue: {
8
+ type: (ObjectConstructor | ArrayConstructor | NumberConstructor | StringConstructor)[];
9
+ default: string;
10
+ };
11
+ modelValue: {
12
+ type: import("vue").PropType<import("./KCompositeInput.logic.js").ICompositeItem[]>;
13
+ default: () => never[];
14
+ };
15
+ dataProvider: {
16
+ type: import("vue").PropType<import("@katlux/providers").ADataProvider>;
17
+ required: boolean;
18
+ };
19
+ type: {
20
+ type: import("vue").PropType<import("./KCompositeInput.logic.js").CompositeInputType>;
21
+ default: string;
22
+ };
23
+ selectionSide: {
24
+ type: import("vue").PropType<import("./KCompositeInput.logic.js").SelectionSide>;
25
+ default: string;
26
+ };
27
+ inputType: {
28
+ type: import("vue").PropType<KCompositeInputProps["inputType"]>;
29
+ default: string;
30
+ };
31
+ mask: {
32
+ type: StringConstructor;
33
+ default: string;
34
+ };
35
+ labelField: {
36
+ type: StringConstructor;
37
+ default: string;
38
+ };
39
+ valueField: {
40
+ type: StringConstructor;
41
+ default: string;
42
+ };
43
+ placeholder: {
44
+ type: StringConstructor;
45
+ default: string;
46
+ };
47
+ inputPlaceholder: {
48
+ type: StringConstructor;
49
+ default: string;
50
+ };
51
+ searchbox: {
52
+ type: BooleanConstructor;
53
+ default: boolean;
54
+ };
55
+ showClear: {
56
+ type: BooleanConstructor;
57
+ default: boolean;
58
+ };
59
+ teleportTo: {
60
+ type: StringConstructor;
61
+ default: undefined;
62
+ };
63
+ validation: {
64
+ type: import("vue").PropType<KCompositeInputProps["validation"]>;
65
+ default: null;
66
+ validator: (value: string) => boolean;
67
+ };
68
+ validationText: {
69
+ type: StringConstructor;
70
+ default: string;
71
+ };
72
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
73
+ "update:modelValue": (value: import("./KCompositeInput.logic.js").ICompositeItem[]) => any;
74
+ "update:selectionValue": (value: any) => any;
75
+ "update:inputValue": (value: any) => any;
76
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
77
+ selectionValue: {
78
+ type: (ObjectConstructor | ArrayConstructor | NumberConstructor | StringConstructor)[];
79
+ default: null;
80
+ };
81
+ inputValue: {
82
+ type: (ObjectConstructor | ArrayConstructor | NumberConstructor | StringConstructor)[];
83
+ default: string;
84
+ };
85
+ modelValue: {
86
+ type: import("vue").PropType<import("./KCompositeInput.logic.js").ICompositeItem[]>;
87
+ default: () => never[];
88
+ };
89
+ dataProvider: {
90
+ type: import("vue").PropType<import("@katlux/providers").ADataProvider>;
91
+ required: boolean;
92
+ };
93
+ type: {
94
+ type: import("vue").PropType<import("./KCompositeInput.logic.js").CompositeInputType>;
95
+ default: string;
96
+ };
97
+ selectionSide: {
98
+ type: import("vue").PropType<import("./KCompositeInput.logic.js").SelectionSide>;
99
+ default: string;
100
+ };
101
+ inputType: {
102
+ type: import("vue").PropType<KCompositeInputProps["inputType"]>;
103
+ default: string;
104
+ };
105
+ mask: {
106
+ type: StringConstructor;
107
+ default: string;
108
+ };
109
+ labelField: {
110
+ type: StringConstructor;
111
+ default: string;
112
+ };
113
+ valueField: {
114
+ type: StringConstructor;
115
+ default: string;
116
+ };
117
+ placeholder: {
118
+ type: StringConstructor;
119
+ default: string;
120
+ };
121
+ inputPlaceholder: {
122
+ type: StringConstructor;
123
+ default: string;
124
+ };
125
+ searchbox: {
126
+ type: BooleanConstructor;
127
+ default: boolean;
128
+ };
129
+ showClear: {
130
+ type: BooleanConstructor;
131
+ default: boolean;
132
+ };
133
+ teleportTo: {
134
+ type: StringConstructor;
135
+ default: undefined;
136
+ };
137
+ validation: {
138
+ type: import("vue").PropType<KCompositeInputProps["validation"]>;
139
+ default: null;
140
+ validator: (value: string) => boolean;
141
+ };
142
+ validationText: {
143
+ type: StringConstructor;
144
+ default: string;
145
+ };
146
+ }>> & Readonly<{
147
+ "onUpdate:modelValue"?: ((value: import("./KCompositeInput.logic.js").ICompositeItem[]) => any) | undefined;
148
+ "onUpdate:selectionValue"?: ((value: any) => any) | undefined;
149
+ "onUpdate:inputValue"?: ((value: any) => any) | undefined;
150
+ }>, {
151
+ type: import("./KCompositeInput.logic.js").CompositeInputType;
152
+ validation: "error" | "success" | "warning" | null | undefined;
153
+ validationText: string;
154
+ modelValue: import("./KCompositeInput.logic.js").ICompositeItem[];
155
+ searchbox: boolean;
156
+ labelField: string;
157
+ placeholder: string;
158
+ teleportTo: string;
159
+ valueField: string;
160
+ inputType: "number" | "text" | "url" | "search" | "password" | "email" | "tel" | undefined;
161
+ selectionValue: string | number | Record<string, any> | unknown[];
162
+ inputValue: string | number | Record<string, any> | unknown[];
163
+ selectionSide: import("./KCompositeInput.logic.js").SelectionSide;
164
+ mask: string;
165
+ inputPlaceholder: string;
166
+ showClear: boolean;
167
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
168
+ declare const _default: typeof __VLS_export;
169
+ export default _default;
@@ -0,0 +1,127 @@
1
+ import { type PropType } from 'vue';
2
+ import type { ADataProvider } from '@katlux/providers';
3
+ export type CompositeInputType = 'textbox' | 'textarea' | 'maskedtextbox' | 'combobox' | 'datepicker' | 'datetimepicker' | 'hourpicker';
4
+ export type SelectionSide = 'left' | 'right';
5
+ export interface ICompositeItem {
6
+ selection: any;
7
+ value: any;
8
+ }
9
+ export interface KCompositeInputProps {
10
+ selectionValue: any;
11
+ inputValue: any;
12
+ modelValue?: ICompositeItem[];
13
+ dataProvider: ADataProvider;
14
+ type?: CompositeInputType;
15
+ selectionSide?: SelectionSide;
16
+ inputType?: 'text' | 'password' | 'email' | 'url' | 'tel' | 'search' | 'number';
17
+ mask?: string;
18
+ labelField?: string;
19
+ valueField?: string;
20
+ placeholder?: string;
21
+ inputPlaceholder?: string;
22
+ searchbox?: boolean;
23
+ showClear?: boolean;
24
+ teleportTo?: string;
25
+ validation?: 'success' | 'warning' | 'error' | null;
26
+ validationText?: string;
27
+ }
28
+ export interface KCompositeInputEmits {
29
+ (e: 'update:selectionValue', value: any): void;
30
+ (e: 'update:inputValue', value: any): void;
31
+ (e: 'update:modelValue', value: ICompositeItem[]): void;
32
+ }
33
+ export declare const KCompositeInputDefaultProps: {
34
+ selectionValue: {
35
+ type: (ObjectConstructor | ArrayConstructor | NumberConstructor | StringConstructor)[];
36
+ default: null;
37
+ };
38
+ inputValue: {
39
+ type: (ObjectConstructor | ArrayConstructor | NumberConstructor | StringConstructor)[];
40
+ default: string;
41
+ };
42
+ modelValue: {
43
+ type: PropType<ICompositeItem[]>;
44
+ default: () => never[];
45
+ };
46
+ dataProvider: {
47
+ type: PropType<ADataProvider>;
48
+ required: boolean;
49
+ };
50
+ type: {
51
+ type: PropType<CompositeInputType>;
52
+ default: string;
53
+ };
54
+ selectionSide: {
55
+ type: PropType<SelectionSide>;
56
+ default: string;
57
+ };
58
+ inputType: {
59
+ type: PropType<KCompositeInputProps["inputType"]>;
60
+ default: string;
61
+ };
62
+ mask: {
63
+ type: StringConstructor;
64
+ default: string;
65
+ };
66
+ labelField: {
67
+ type: StringConstructor;
68
+ default: string;
69
+ };
70
+ valueField: {
71
+ type: StringConstructor;
72
+ default: string;
73
+ };
74
+ placeholder: {
75
+ type: StringConstructor;
76
+ default: string;
77
+ };
78
+ inputPlaceholder: {
79
+ type: StringConstructor;
80
+ default: string;
81
+ };
82
+ searchbox: {
83
+ type: BooleanConstructor;
84
+ default: boolean;
85
+ };
86
+ showClear: {
87
+ type: BooleanConstructor;
88
+ default: boolean;
89
+ };
90
+ teleportTo: {
91
+ type: StringConstructor;
92
+ default: undefined;
93
+ };
94
+ validation: {
95
+ type: PropType<KCompositeInputProps["validation"]>;
96
+ default: null;
97
+ validator: (value: string) => boolean;
98
+ };
99
+ validationText: {
100
+ type: StringConstructor;
101
+ default: string;
102
+ };
103
+ };
104
+ export declare function useKCompositeInputLogic(props: KCompositeInputProps, emit: KCompositeInputEmits): {
105
+ internalSelectionValue: import("vue").WritableComputedRef<any, any>;
106
+ internalInputValue: import("vue").WritableComputedRef<any, any>;
107
+ selectionProps: import("vue").ComputedRef<{
108
+ modelValue: any;
109
+ 'onUpdate:modelValue': (val: any) => any;
110
+ dataProvider: ADataProvider;
111
+ labelField: string | undefined;
112
+ valueField: string | undefined;
113
+ placeholder: string | undefined;
114
+ searchbox: boolean | undefined;
115
+ closeOnSelect: boolean;
116
+ teleportTo: string | undefined;
117
+ }>;
118
+ inputProps: import("vue").ComputedRef<{
119
+ modelValue: any;
120
+ 'onUpdate:modelValue': (val: any) => any;
121
+ placeholder: string;
122
+ type: "number" | "text" | "url" | "search" | "password" | "email" | "tel" | undefined;
123
+ mask: string | undefined;
124
+ showClear: boolean | undefined;
125
+ }>;
126
+ resolvedSelectionItem: import("vue").ComputedRef<any>;
127
+ };
@@ -0,0 +1,160 @@
1
+ import { computed, watch } from "vue";
2
+ export const KCompositeInputDefaultProps = {
3
+ selectionValue: {
4
+ type: [String, Number, Object, Array],
5
+ default: null
6
+ },
7
+ inputValue: {
8
+ type: [String, Number, Object, Array],
9
+ default: ""
10
+ },
11
+ modelValue: {
12
+ type: Array,
13
+ default: () => []
14
+ },
15
+ dataProvider: {
16
+ type: Object,
17
+ required: true
18
+ },
19
+ type: {
20
+ type: String,
21
+ default: "textbox"
22
+ },
23
+ selectionSide: {
24
+ type: String,
25
+ default: "left"
26
+ },
27
+ inputType: {
28
+ type: String,
29
+ default: "text"
30
+ },
31
+ mask: {
32
+ type: String,
33
+ default: ""
34
+ },
35
+ labelField: {
36
+ type: String,
37
+ default: "label"
38
+ },
39
+ valueField: {
40
+ type: String,
41
+ default: "value"
42
+ },
43
+ placeholder: {
44
+ type: String,
45
+ default: "Select..."
46
+ },
47
+ inputPlaceholder: {
48
+ type: String,
49
+ default: ""
50
+ },
51
+ searchbox: {
52
+ type: Boolean,
53
+ default: false
54
+ },
55
+ showClear: {
56
+ type: Boolean,
57
+ default: false
58
+ },
59
+ teleportTo: {
60
+ type: String,
61
+ default: void 0
62
+ },
63
+ validation: {
64
+ type: String,
65
+ default: null,
66
+ validator: (value) => [null, "success", "warning", "error"].includes(value)
67
+ },
68
+ validationText: {
69
+ type: String,
70
+ default: ""
71
+ }
72
+ };
73
+ export function useKCompositeInputLogic(props, emit) {
74
+ const getSelectionKey = (selection) => {
75
+ if (selection && typeof selection === "object" && props.valueField) {
76
+ return selection[props.valueField];
77
+ }
78
+ return selection;
79
+ };
80
+ const resolvedSelectionItem = computed(() => {
81
+ if (props.selectionValue === null || props.selectionValue === void 0) return null;
82
+ if (typeof props.selectionValue === "object") return props.selectionValue;
83
+ if (props.dataProvider && typeof props.dataProvider === "object") {
84
+ const provider = props.dataProvider;
85
+ const data = provider.allData?.value || provider.pageData?.value || [];
86
+ return data.find((item) => getSelectionKey(item) === props.selectionValue) || props.selectionValue;
87
+ }
88
+ return props.selectionValue;
89
+ });
90
+ const internalSelectionValue = computed({
91
+ get: () => resolvedSelectionItem.value,
92
+ set: (val) => {
93
+ const key = getSelectionKey(val);
94
+ emit("update:selectionValue", key);
95
+ }
96
+ });
97
+ const internalInputValue = computed({
98
+ get: () => props.inputValue,
99
+ set: (val) => {
100
+ emit("update:inputValue", val);
101
+ updateModelValue(props.selectionValue, val);
102
+ }
103
+ });
104
+ watch(() => props.selectionValue, (newSelection) => {
105
+ const newKey = getSelectionKey(newSelection);
106
+ if (newKey !== void 0 && newKey !== null) {
107
+ const existingItem = props.modelValue?.find((item) => {
108
+ const itemKey = getSelectionKey(item.selection);
109
+ return JSON.stringify(itemKey) === JSON.stringify(newKey) || itemKey === newKey;
110
+ });
111
+ if (existingItem) {
112
+ emit("update:inputValue", existingItem.value);
113
+ } else {
114
+ const defaultValue = props.type?.includes("picker") ? null : "";
115
+ emit("update:inputValue", defaultValue);
116
+ }
117
+ }
118
+ });
119
+ function updateModelValue(selection, value) {
120
+ const selectionKey = getSelectionKey(selection);
121
+ if (selectionKey === void 0 || selectionKey === null) return;
122
+ const currentModel = [...props.modelValue || []];
123
+ const index = currentModel.findIndex((item) => {
124
+ const itemKey = getSelectionKey(item.selection);
125
+ return JSON.stringify(itemKey) === JSON.stringify(selectionKey) || itemKey === selectionKey;
126
+ });
127
+ if (index !== -1) {
128
+ currentModel[index] = { ...currentModel[index], value };
129
+ } else {
130
+ currentModel.push({ selection, value });
131
+ }
132
+ emit("update:modelValue", currentModel);
133
+ }
134
+ const selectionProps = computed(() => ({
135
+ modelValue: internalSelectionValue.value,
136
+ "onUpdate:modelValue": (val) => internalSelectionValue.value = val,
137
+ dataProvider: props.dataProvider,
138
+ labelField: props.labelField,
139
+ valueField: props.valueField,
140
+ placeholder: props.placeholder,
141
+ searchbox: props.searchbox,
142
+ closeOnSelect: true,
143
+ teleportTo: props.teleportTo
144
+ }));
145
+ const inputProps = computed(() => ({
146
+ modelValue: props.inputValue,
147
+ "onUpdate:modelValue": (val) => internalInputValue.value = val,
148
+ placeholder: props.inputPlaceholder || "",
149
+ type: props.inputType,
150
+ mask: props.mask,
151
+ showClear: props.showClear
152
+ }));
153
+ return {
154
+ internalSelectionValue,
155
+ internalInputValue,
156
+ selectionProps,
157
+ inputProps,
158
+ resolvedSelectionItem
159
+ };
160
+ }
@@ -5,7 +5,7 @@ import { computed, useSlots } from "vue";
5
5
  import KDataIteratorDefault from "../../presets/default/components/KDataIterator/KDataIterator.vue";
6
6
  import { ADataProvider } from "@katlux/providers";
7
7
  const props = defineProps({
8
- dataProvider: { type: null, required: true },
8
+ dataProvider: { type: Object, required: true },
9
9
  visibleFields: { type: [Array, null], required: false, default: null },
10
10
  rowActions: { type: Array, required: false, default: () => [] },
11
11
  bulkActions: { type: Array, required: false, default: () => [] },
@@ -15,6 +15,6 @@ export declare const KDataIteratorDefaultProps: {
15
15
  page: number;
16
16
  };
17
17
  export declare function useKDataIteratorLogic(props: KDataIteratorProps): {
18
- selectedRows: any;
19
- selectAll: any;
18
+ selectedRows: import("vue").Ref<any[], any[]>;
19
+ selectAll: import("vue").Ref<boolean, boolean>;
20
20
  };
@@ -5,7 +5,7 @@ import { computed, useSlots } from "vue";
5
5
  import DatatableDefault from "../../presets/default/components/KDatatable/KDatatable.vue";
6
6
  import { ADataProvider } from "@katlux/providers";
7
7
  const props = defineProps({
8
- dataProvider: { type: null, required: true },
8
+ dataProvider: { type: Object, required: true },
9
9
  visibleFields: { type: [Array, null], required: true, default: null },
10
10
  rowActions: { type: Array, required: false, default: () => [] },
11
11
  bulkActions: { type: Array, required: false, default: () => [] },