@katlux/toolkit 0.1.1-alpha.114 → 0.1.1-alpha.116

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 (122) hide show
  1. package/dist/compiled/composables/useDataProvider.mjs +176 -21
  2. package/dist/compiled/composables/useDataProvider.spec.mjs +52 -0
  3. package/dist/module.json +1 -1
  4. package/dist/runtime/components/KAccordion/KAccordion.global.d.vue.ts +23 -2
  5. package/dist/runtime/components/KAccordion/KAccordion.global.vue +7 -1
  6. package/dist/runtime/components/KAccordion/KAccordion.global.vue.d.ts +23 -2
  7. package/dist/runtime/components/KAccordion/KAccordion.logic.d.ts +12 -1
  8. package/dist/runtime/components/KAccordion/KAccordion.logic.js +32 -4
  9. package/dist/runtime/components/KAlert/KAlert.global.d.vue.ts +4 -1
  10. package/dist/runtime/components/KAlert/KAlert.global.vue +8 -2
  11. package/dist/runtime/components/KAlert/KAlert.global.vue.d.ts +4 -1
  12. package/dist/runtime/components/KAlert/KAlert.logic.d.ts +6 -1
  13. package/dist/runtime/components/KAlert/KAlert.logic.js +12 -2
  14. package/dist/runtime/components/KButton/KButton.logic.d.ts +1 -1
  15. package/dist/runtime/components/KCalendar/KCalendar.global.d.vue.ts +11 -0
  16. package/dist/runtime/components/KCalendar/KCalendar.global.vue +1 -1
  17. package/dist/runtime/components/KCalendar/KCalendar.global.vue.d.ts +11 -0
  18. package/dist/runtime/components/KCalendar/KCalendar.logic.d.ts +6 -0
  19. package/dist/runtime/components/KCalendar/KCalendar.logic.js +13 -4
  20. package/dist/runtime/components/KCheckbox/KCheckbox.global.d.vue.ts +1 -1
  21. package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +1 -1
  22. package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +38 -3
  23. package/dist/runtime/components/KCombobox/KCombobox.global.vue +11 -2
  24. package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +38 -3
  25. package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +18 -0
  26. package/dist/runtime/components/KCombobox/KCombobox.logic.js +24 -2
  27. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +7 -7
  28. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +7 -7
  29. package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.d.ts +3 -3
  30. package/dist/runtime/components/KDatatable/KDataIterator.global.d.vue.ts +29 -1
  31. package/dist/runtime/components/KDatatable/KDataIterator.global.vue +29 -4
  32. package/dist/runtime/components/KDatatable/KDataIterator.global.vue.d.ts +29 -1
  33. package/dist/runtime/components/KDatatable/KDataIterator.logic.d.ts +21 -2
  34. package/dist/runtime/components/KDatatable/KDataIterator.logic.js +66 -31
  35. package/dist/runtime/components/KDatatable/KDatatable.global.d.vue.ts +35 -3
  36. package/dist/runtime/components/KDatatable/KDatatable.global.vue +44 -4
  37. package/dist/runtime/components/KDatatable/KDatatable.global.vue.d.ts +35 -3
  38. package/dist/runtime/components/KDatatable/KDatatable.logic.d.ts +27 -2
  39. package/dist/runtime/components/KDatatable/KDatatable.logic.js +77 -5
  40. package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +6 -6
  41. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +6 -6
  42. package/dist/runtime/components/KDatePicker/KDatePicker.logic.d.ts +2 -2
  43. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +6 -6
  44. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +6 -6
  45. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.d.ts +2 -2
  46. package/dist/runtime/components/KGantt/KGantt.global.d.vue.ts +8 -8
  47. package/dist/runtime/components/KGantt/KGantt.global.vue.d.ts +8 -8
  48. package/dist/runtime/components/KGantt/KGantt.logic.d.ts +4 -4
  49. package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +2 -2
  50. package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +2 -2
  51. package/dist/runtime/components/KHourSelect/KHourSelect.global.d.vue.ts +1 -1
  52. package/dist/runtime/components/KHourSelect/KHourSelect.global.vue.d.ts +1 -1
  53. package/dist/runtime/components/KLayout/KLayout.global.d.vue.ts +3 -0
  54. package/dist/runtime/components/KLayout/KLayout.global.vue +11 -0
  55. package/dist/runtime/components/KLayout/KLayout.global.vue.d.ts +3 -0
  56. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.d.vue.ts +2 -2
  57. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +2 -2
  58. package/dist/runtime/components/KPagination/KPagination.global.d.vue.ts +24 -2
  59. package/dist/runtime/components/KPagination/KPagination.global.vue +8 -2
  60. package/dist/runtime/components/KPagination/KPagination.global.vue.d.ts +24 -2
  61. package/dist/runtime/components/KPagination/KPagination.logic.d.ts +18 -4
  62. package/dist/runtime/components/KPagination/KPagination.logic.js +59 -10
  63. package/dist/runtime/components/KRangeSlider/KRangeSlider.global.d.vue.ts +15 -4
  64. package/dist/runtime/components/KRangeSlider/KRangeSlider.global.vue +22 -4
  65. package/dist/runtime/components/KRangeSlider/KRangeSlider.global.vue.d.ts +15 -4
  66. package/dist/runtime/components/KRangeSlider/KRangeSlider.logic.d.ts +6 -0
  67. package/dist/runtime/components/KRangeSlider/KRangeSlider.logic.js +12 -6
  68. package/dist/runtime/components/KSlider/KSlider.global.d.vue.ts +13 -2
  69. package/dist/runtime/components/KSlider/KSlider.global.vue +9 -3
  70. package/dist/runtime/components/KSlider/KSlider.global.vue.d.ts +13 -2
  71. package/dist/runtime/components/KSlider/KSlider.logic.d.ts +5 -0
  72. package/dist/runtime/components/KSlider/KSlider.logic.js +5 -1
  73. package/dist/runtime/components/KTabs/KTabItem.global.d.vue.ts +18 -0
  74. package/dist/runtime/components/KTabs/KTabItem.global.vue.d.ts +18 -0
  75. package/dist/runtime/components/KTabs/KTabItem.logic.d.ts +11 -0
  76. package/dist/runtime/components/KTabs/KTabItem.logic.js +10 -1
  77. package/dist/runtime/components/KTabs/KTabs.global.d.vue.ts +34 -1
  78. package/dist/runtime/components/KTabs/KTabs.global.vue +10 -1
  79. package/dist/runtime/components/KTabs/KTabs.global.vue.d.ts +34 -1
  80. package/dist/runtime/components/KTabs/KTabs.logic.d.ts +21 -2
  81. package/dist/runtime/components/KTabs/KTabs.logic.js +86 -3
  82. package/dist/runtime/components/KTextarea/KTextarea.global.d.vue.ts +1 -1
  83. package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +1 -1
  84. package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +3 -3
  85. package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +3 -3
  86. package/dist/runtime/components/KToast/KToast.global.d.vue.ts +3 -3
  87. package/dist/runtime/components/KToast/KToast.global.vue.d.ts +3 -3
  88. package/dist/runtime/components/KTree/KTree.global.d.vue.ts +48 -2
  89. package/dist/runtime/components/KTree/KTree.global.vue +13 -2
  90. package/dist/runtime/components/KTree/KTree.global.vue.d.ts +48 -2
  91. package/dist/runtime/components/KTree/KTree.logic.d.ts +26 -2
  92. package/dist/runtime/components/KTree/KTree.logic.js +41 -6
  93. package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +26 -4
  94. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue +1 -1
  95. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +26 -4
  96. package/dist/runtime/components/KTreePicker/KTreePicker.logic.d.ts +16 -0
  97. package/dist/runtime/components/KTreePicker/KTreePicker.logic.js +8 -0
  98. package/dist/runtime/components/KTreeView/KTreeView.global.d.vue.ts +4 -0
  99. package/dist/runtime/components/KTreeView/KTreeView.global.vue +5 -2
  100. package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +4 -0
  101. package/dist/runtime/components/KTreeView/KTreeView.logic.d.ts +4 -1
  102. package/dist/runtime/components/KTreeView/KTreeView.logic.js +7 -1
  103. package/dist/runtime/composables/useDataProvider.d.ts +15 -4
  104. package/dist/runtime/composables/useDataProvider.js +176 -21
  105. package/dist/runtime/presets/default/assets/scss/css-variables.css +1 -0
  106. package/dist/runtime/presets/default/assets/scss/css-variables.scss +1 -0
  107. package/dist/runtime/presets/default/assets/scss/index.css +5 -3
  108. package/dist/runtime/presets/default/assets/scss/index.scss +4 -3
  109. package/dist/runtime/presets/default/components/KAlert/KAlert.d.vue.ts +3 -1
  110. package/dist/runtime/presets/default/components/KAlert/KAlert.vue +3 -3
  111. package/dist/runtime/presets/default/components/KAlert/KAlert.vue.d.ts +3 -1
  112. package/dist/runtime/presets/default/components/KDatatable/KDatatable.d.vue.ts +6 -0
  113. package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +5 -1
  114. package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue.d.ts +6 -0
  115. package/dist/runtime/presets/default/components/KLayout/KLayout.d.vue.ts +3 -0
  116. package/dist/runtime/presets/default/components/KLayout/KLayout.vue +66 -0
  117. package/dist/runtime/presets/default/components/KLayout/KLayout.vue.d.ts +3 -0
  118. package/dist/runtime/presets/default/components/KRangeSlider/KRangeSlider.vue +9 -0
  119. package/dist/runtime/presets/default/components/KSlider/KSlider.vue +9 -0
  120. package/dist/runtime/presets/default/components/KToast/KToast.d.vue.ts +2 -2
  121. package/dist/runtime/presets/default/components/KToast/KToast.vue.d.ts +2 -2
  122. package/package.json +1 -1
@@ -24,7 +24,12 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
24
24
  type: import("vue").PropType<Date | String>;
25
25
  default: null;
26
26
  };
27
+ modelValue: {
28
+ type: import("vue").PropType<Date | String>;
29
+ default: undefined;
30
+ };
27
31
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
32
+ "update:modelValue": (value: String | Date) => any;
28
33
  "update:selectedDay": (value: String | Date) => any;
29
34
  dayClicked: (date: Date, marked: import("./types.js").IMarkedDay[]) => any;
30
35
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
@@ -53,10 +58,16 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
53
58
  type: import("vue").PropType<Date | String>;
54
59
  default: null;
55
60
  };
61
+ modelValue: {
62
+ type: import("vue").PropType<Date | String>;
63
+ default: undefined;
64
+ };
56
65
  }>> & Readonly<{
66
+ "onUpdate:modelValue"?: ((value: String | Date) => any) | undefined;
57
67
  "onUpdate:selectedDay"?: ((value: String | Date) => any) | undefined;
58
68
  onDayClicked?: ((date: Date, marked: import("./types.js").IMarkedDay[]) => any) | undefined;
59
69
  }>, {
70
+ modelValue: String | Date;
60
71
  view: string;
61
72
  viewCount: number;
62
73
  definedDays: import("./types.js").IDefinedDay[];
@@ -7,9 +7,11 @@ export interface KCalendarProps {
7
7
  markedDays?: IMarkedDay[];
8
8
  day?: Date | String;
9
9
  selectedDay?: Date | String;
10
+ modelValue?: Date | String;
10
11
  }
11
12
  export interface KCalendarEmits {
12
13
  (e: 'update:selectedDay', value: Date | String): void;
14
+ (e: 'update:modelValue', value: Date | String): void;
13
15
  (e: 'dayClicked', date: Date, marked: IMarkedDay[]): void;
14
16
  }
15
17
  export declare const KCalendarDefaultProps: {
@@ -38,6 +40,10 @@ export declare const KCalendarDefaultProps: {
38
40
  type: PropType<Date | String>;
39
41
  default: null;
40
42
  };
43
+ modelValue: {
44
+ type: PropType<Date | String>;
45
+ default: undefined;
46
+ };
41
47
  };
42
48
  export declare function useKCalendarLogic(props: KCalendarProps, emit: KCalendarEmits): {
43
49
  monthSelectedDay: import("vue").Ref<Date | {
@@ -25,10 +25,15 @@ export const KCalendarDefaultProps = {
25
25
  selectedDay: {
26
26
  type: [Date, String],
27
27
  default: null
28
+ },
29
+ modelValue: {
30
+ type: [Date, String],
31
+ default: void 0
28
32
  }
29
33
  };
30
34
  export function useKCalendarLogic(props, emit) {
31
- const monthSelectedDay = ref("");
35
+ const initialDay = (props.modelValue !== void 0 ? props.modelValue : props.selectedDay) || "";
36
+ const monthSelectedDay = ref(initialDay);
32
37
  const actualMonth = ref();
33
38
  const actualWeek = ref();
34
39
  const actualYear = ref();
@@ -54,7 +59,7 @@ export function useKCalendarLogic(props, emit) {
54
59
  { immediate: true }
55
60
  );
56
61
  watch(
57
- () => props.selectedDay,
62
+ () => props.modelValue !== void 0 ? props.modelValue : props.selectedDay,
58
63
  (newValue) => {
59
64
  monthSelectedDay.value = newValue ?? "";
60
65
  if (!props.day && actualYear.value === void 0) {
@@ -68,10 +73,13 @@ export function useKCalendarLogic(props, emit) {
68
73
  (newValue) => {
69
74
  if (newValue !== props.selectedDay)
70
75
  emit("update:selectedDay", newValue);
71
- }
76
+ if (newValue !== props.modelValue)
77
+ emit("update:modelValue", newValue);
78
+ },
79
+ { flush: "sync" }
72
80
  );
73
81
  onMounted(() => {
74
- monthSelectedDay.value = props.selectedDay || "";
82
+ monthSelectedDay.value = (props.modelValue !== void 0 ? props.modelValue : props.selectedDay) || "";
75
83
  if (actualYear.value === void 0) {
76
84
  const now = /* @__PURE__ */ new Date();
77
85
  actualMonth.value = now.getMonth() + 1;
@@ -155,6 +163,7 @@ export function useKCalendarLogic(props, emit) {
155
163
  });
156
164
  }
157
165
  function dayClicked(date) {
166
+ monthSelectedDay.value = date;
158
167
  emit("dayClicked", date, getDayMark(date));
159
168
  }
160
169
  function goToPrev() {
@@ -56,9 +56,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
56
56
  }>, {
57
57
  label: string;
58
58
  disabled: boolean;
59
- value: any;
60
59
  validation: "error" | "success" | "warning" | null | undefined;
61
60
  validationText: string;
61
+ value: any;
62
62
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
63
63
  declare const _default: typeof __VLS_export;
64
64
  export default _default;
@@ -56,9 +56,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
56
56
  }>, {
57
57
  label: string;
58
58
  disabled: boolean;
59
- value: any;
60
59
  validation: "error" | "success" | "warning" | null | undefined;
61
60
  validationText: string;
61
+ value: any;
62
62
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
63
63
  declare const _default: typeof __VLS_export;
64
64
  export default _default;
@@ -36,6 +36,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
36
36
  type: StringConstructor;
37
37
  default: string;
38
38
  };
39
+ searchtext: {
40
+ type: StringConstructor;
41
+ default: string;
42
+ };
39
43
  visibleFields: {
40
44
  type: import("vue").PropType<Array<String>>;
41
45
  default: null;
@@ -85,9 +89,28 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
85
89
  type: NumberConstructor;
86
90
  default: number;
87
91
  };
88
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
92
+ }>, {
93
+ virtualScrollState: import("vue").ComputedRef<{
94
+ loadedCount: number;
95
+ hasMore: boolean;
96
+ lastAppendedPage: number;
97
+ totalCount: number;
98
+ }>;
99
+ searchtext: import("vue").Ref<string, string>;
100
+ isOptionsOpen: import("vue").Ref<boolean, boolean>;
101
+ selectItem: (option: import("./KCombobox.logic.js").ComboboxItem) => void;
102
+ toggleDropdown: () => void;
103
+ closeDropdown: () => void;
104
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
89
105
  "update:modelValue": (value: any) => any;
90
106
  "update:isOptionsOpen": (value: boolean) => any;
107
+ "update:searchtext": (value: string) => any;
108
+ "scroll-state-change": (state: {
109
+ loadedCount: number;
110
+ hasMore: boolean;
111
+ lastAppendedPage: number;
112
+ totalCount: number;
113
+ }) => any;
91
114
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
92
115
  label: {
93
116
  type: StringConstructor;
@@ -125,6 +148,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
125
148
  type: StringConstructor;
126
149
  default: string;
127
150
  };
151
+ searchtext: {
152
+ type: StringConstructor;
153
+ default: string;
154
+ };
128
155
  visibleFields: {
129
156
  type: import("vue").PropType<Array<String>>;
130
157
  default: null;
@@ -177,11 +204,21 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
177
204
  }>> & Readonly<{
178
205
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
179
206
  "onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
207
+ "onUpdate:searchtext"?: ((value: string) => any) | undefined;
208
+ "onScroll-state-change"?: ((state: {
209
+ loadedCount: number;
210
+ hasMore: boolean;
211
+ lastAppendedPage: number;
212
+ totalCount: number;
213
+ }) => any) | undefined;
180
214
  }>, {
215
+ modelValue: any;
181
216
  label: string;
182
217
  disabled: boolean;
183
218
  validation: "error" | "success" | "warning" | null | undefined;
219
+ validationText: string;
184
220
  searchbox: boolean;
221
+ searchtext: string;
185
222
  searchPlaceholder: string;
186
223
  virtualScroll: boolean;
187
224
  itemHeight: number;
@@ -190,13 +227,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
190
227
  placeholder: string;
191
228
  teleportTo: string;
192
229
  fullWidth: boolean;
193
- validationText: string;
194
230
  closeOnSelect: boolean;
195
231
  multiSelect: boolean;
196
232
  maxSelectedDisplay: string | number | boolean;
197
233
  visibleFields: String[];
198
234
  valueField: string;
199
- modelValue: any;
200
235
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
201
236
  declare const _default: typeof __VLS_export;
202
237
  export default _default;
@@ -4,7 +4,7 @@ import { usePresetComponent } from "../../composables/usePresetComponent";
4
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", "update:isOptionsOpen"]);
7
+ const emit = defineEmits(["update:modelValue", "update:isOptionsOpen", "update:searchtext", "scroll-state-change"]);
8
8
  const {
9
9
  selectedItems,
10
10
  isOptionsOpen,
@@ -22,11 +22,20 @@ const {
22
22
  loadingMore,
23
23
  initialLoading,
24
24
  canLoadMore,
25
- loadMore
25
+ loadMore,
26
+ virtualScrollState
26
27
  } = useKComboboxLogic(props, emit);
27
28
  watch(isOptionsOpen, (newVal) => {
28
29
  emit("update:isOptionsOpen", newVal);
29
30
  });
31
+ defineExpose({
32
+ virtualScrollState,
33
+ searchtext,
34
+ isOptionsOpen,
35
+ selectItem,
36
+ toggleDropdown,
37
+ closeDropdown
38
+ });
30
39
  const presetComponent = usePresetComponent("KCombobox", KComboboxDefault);
31
40
  const templateProps = computed(() => ({
32
41
  label: props.label,
@@ -36,6 +36,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
36
36
  type: StringConstructor;
37
37
  default: string;
38
38
  };
39
+ searchtext: {
40
+ type: StringConstructor;
41
+ default: string;
42
+ };
39
43
  visibleFields: {
40
44
  type: import("vue").PropType<Array<String>>;
41
45
  default: null;
@@ -85,9 +89,28 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
85
89
  type: NumberConstructor;
86
90
  default: number;
87
91
  };
88
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
92
+ }>, {
93
+ virtualScrollState: import("vue").ComputedRef<{
94
+ loadedCount: number;
95
+ hasMore: boolean;
96
+ lastAppendedPage: number;
97
+ totalCount: number;
98
+ }>;
99
+ searchtext: import("vue").Ref<string, string>;
100
+ isOptionsOpen: import("vue").Ref<boolean, boolean>;
101
+ selectItem: (option: import("./KCombobox.logic.js").ComboboxItem) => void;
102
+ toggleDropdown: () => void;
103
+ closeDropdown: () => void;
104
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
89
105
  "update:modelValue": (value: any) => any;
90
106
  "update:isOptionsOpen": (value: boolean) => any;
107
+ "update:searchtext": (value: string) => any;
108
+ "scroll-state-change": (state: {
109
+ loadedCount: number;
110
+ hasMore: boolean;
111
+ lastAppendedPage: number;
112
+ totalCount: number;
113
+ }) => any;
91
114
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
92
115
  label: {
93
116
  type: StringConstructor;
@@ -125,6 +148,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
125
148
  type: StringConstructor;
126
149
  default: string;
127
150
  };
151
+ searchtext: {
152
+ type: StringConstructor;
153
+ default: string;
154
+ };
128
155
  visibleFields: {
129
156
  type: import("vue").PropType<Array<String>>;
130
157
  default: null;
@@ -177,11 +204,21 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
177
204
  }>> & Readonly<{
178
205
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
179
206
  "onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
207
+ "onUpdate:searchtext"?: ((value: string) => any) | undefined;
208
+ "onScroll-state-change"?: ((state: {
209
+ loadedCount: number;
210
+ hasMore: boolean;
211
+ lastAppendedPage: number;
212
+ totalCount: number;
213
+ }) => any) | undefined;
180
214
  }>, {
215
+ modelValue: any;
181
216
  label: string;
182
217
  disabled: boolean;
183
218
  validation: "error" | "success" | "warning" | null | undefined;
219
+ validationText: string;
184
220
  searchbox: boolean;
221
+ searchtext: string;
185
222
  searchPlaceholder: string;
186
223
  virtualScroll: boolean;
187
224
  itemHeight: number;
@@ -190,13 +227,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
190
227
  placeholder: string;
191
228
  teleportTo: string;
192
229
  fullWidth: boolean;
193
- validationText: string;
194
230
  closeOnSelect: boolean;
195
231
  multiSelect: boolean;
196
232
  maxSelectedDisplay: string | number | boolean;
197
233
  visibleFields: String[];
198
234
  valueField: string;
199
- modelValue: any;
200
235
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
201
236
  declare const _default: typeof __VLS_export;
202
237
  export default _default;
@@ -12,6 +12,7 @@ export interface KComboboxProps {
12
12
  placeholder?: string;
13
13
  searchbox?: boolean;
14
14
  searchPlaceholder?: string;
15
+ searchtext?: string;
15
16
  visibleFields?: Array<String> | null;
16
17
  labelField: string;
17
18
  valueField?: string;
@@ -28,6 +29,13 @@ export interface KComboboxProps {
28
29
  export interface KComboboxEmits {
29
30
  (e: 'update:modelValue', value: any): void;
30
31
  (e: 'update:isOptionsOpen', value: boolean): void;
32
+ (e: 'update:searchtext', value: string): void;
33
+ (e: 'scroll-state-change', state: {
34
+ loadedCount: number;
35
+ hasMore: boolean;
36
+ lastAppendedPage: number;
37
+ totalCount: number;
38
+ }): void;
31
39
  }
32
40
  export declare const KComboboxDefaultProps: {
33
41
  label: {
@@ -66,6 +74,10 @@ export declare const KComboboxDefaultProps: {
66
74
  type: StringConstructor;
67
75
  default: string;
68
76
  };
77
+ searchtext: {
78
+ type: StringConstructor;
79
+ default: string;
80
+ };
69
81
  visibleFields: {
70
82
  type: PropType<Array<String>>;
71
83
  default: null;
@@ -137,4 +149,10 @@ export declare function useKComboboxLogic(props: KComboboxProps, emit: KCombobox
137
149
  virtualScroll: boolean;
138
150
  itemHeight: number;
139
151
  buffer: number;
152
+ virtualScrollState: import("vue").ComputedRef<{
153
+ loadedCount: number;
154
+ hasMore: boolean;
155
+ lastAppendedPage: number;
156
+ totalCount: number;
157
+ }>;
140
158
  };
@@ -40,6 +40,10 @@ export const KComboboxDefaultProps = {
40
40
  type: String,
41
41
  default: "Search..."
42
42
  },
43
+ searchtext: {
44
+ type: String,
45
+ default: ""
46
+ },
43
47
  visibleFields: {
44
48
  type: Array,
45
49
  default: null
@@ -102,11 +106,28 @@ export function useKComboboxLogic(props, emit) {
102
106
  const selectedItems = ref(null);
103
107
  const isOptionsOpen = ref(false);
104
108
  const highlightedIndex = ref(-1);
105
- const searchtext = ref("");
109
+ const searchtext = ref(props.searchtext || "");
106
110
  const loadedOptions = ref([]);
107
111
  const filteredOptions = computed(() => loadedOptions.value);
108
112
  const lastAppendedPage = ref(1);
109
113
  const hasMorePages = ref(true);
114
+ watch(() => props.searchtext, (val) => {
115
+ if (val !== void 0 && val !== searchtext.value) {
116
+ searchtext.value = val;
117
+ }
118
+ });
119
+ watch(searchtext, (val) => {
120
+ emit("update:searchtext", val);
121
+ });
122
+ const virtualScrollState = computed(() => ({
123
+ loadedCount: loadedOptions.value.length,
124
+ hasMore: hasMorePages.value,
125
+ lastAppendedPage: lastAppendedPage.value,
126
+ totalCount: dpRowCount.value ?? 0
127
+ }));
128
+ watch(virtualScrollState, (state) => {
129
+ emit("scroll-state-change", state);
130
+ }, { deep: true });
110
131
  function getItemKey(item, index) {
111
132
  if (!item) return index;
112
133
  if (props.valueField && item[props.valueField] !== void 0) return item[props.valueField];
@@ -487,6 +508,7 @@ export function useKComboboxLogic(props, emit) {
487
508
  loadMore,
488
509
  virtualScroll: props.virtualScroll ?? true,
489
510
  itemHeight: props.itemHeight ?? 40,
490
- buffer: props.buffer ?? 5
511
+ buffer: props.buffer ?? 5,
512
+ virtualScrollState
491
513
  };
492
514
  }
@@ -5,11 +5,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
5
5
  default: string;
6
6
  };
7
7
  selectionValue: {
8
- type: (ArrayConstructor | ObjectConstructor | StringConstructor | NumberConstructor)[];
8
+ type: (StringConstructor | NumberConstructor | ArrayConstructor | ObjectConstructor)[];
9
9
  default: null;
10
10
  };
11
11
  inputValue: {
12
- type: (ArrayConstructor | ObjectConstructor | StringConstructor | NumberConstructor)[];
12
+ type: (StringConstructor | NumberConstructor | ArrayConstructor | ObjectConstructor)[];
13
13
  default: string;
14
14
  };
15
15
  modelValue: {
@@ -99,11 +99,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
99
99
  default: string;
100
100
  };
101
101
  selectionValue: {
102
- type: (ArrayConstructor | ObjectConstructor | StringConstructor | NumberConstructor)[];
102
+ type: (StringConstructor | NumberConstructor | ArrayConstructor | ObjectConstructor)[];
103
103
  default: null;
104
104
  };
105
105
  inputValue: {
106
- type: (ArrayConstructor | ObjectConstructor | StringConstructor | NumberConstructor)[];
106
+ type: (StringConstructor | NumberConstructor | ArrayConstructor | ObjectConstructor)[];
107
107
  default: string;
108
108
  };
109
109
  modelValue: {
@@ -188,18 +188,18 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
188
188
  "onUpdate:selectionValue"?: ((value: any) => any) | undefined;
189
189
  "onUpdate:inputValue"?: ((value: any) => any) | undefined;
190
190
  }>, {
191
+ modelValue: import("./KCompositeInput.logic.js").ICompositeItem[];
191
192
  type: import("./KCompositeInput.logic.js").CompositeInputType;
192
193
  label: string;
193
194
  validation: "error" | "success" | "warning" | null | undefined;
195
+ validationText: string;
194
196
  searchbox: boolean;
195
197
  labelField: string;
196
198
  placeholder: string;
197
199
  teleportTo: string;
198
- validationText: string;
199
200
  mask: string;
200
201
  valueField: string;
201
- modelValue: import("./KCompositeInput.logic.js").ICompositeItem[];
202
- inputType: "number" | "url" | "search" | "text" | "password" | "email" | "tel" | undefined;
202
+ inputType: "number" | "search" | "url" | "text" | "password" | "email" | "tel" | undefined;
203
203
  selectionValue: string | number | Record<string, any> | unknown[];
204
204
  inputValue: string | number | Record<string, any> | unknown[];
205
205
  selectionSide: import("./KCompositeInput.logic.js").SelectionSide;
@@ -5,11 +5,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
5
5
  default: string;
6
6
  };
7
7
  selectionValue: {
8
- type: (ArrayConstructor | ObjectConstructor | StringConstructor | NumberConstructor)[];
8
+ type: (StringConstructor | NumberConstructor | ArrayConstructor | ObjectConstructor)[];
9
9
  default: null;
10
10
  };
11
11
  inputValue: {
12
- type: (ArrayConstructor | ObjectConstructor | StringConstructor | NumberConstructor)[];
12
+ type: (StringConstructor | NumberConstructor | ArrayConstructor | ObjectConstructor)[];
13
13
  default: string;
14
14
  };
15
15
  modelValue: {
@@ -99,11 +99,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
99
99
  default: string;
100
100
  };
101
101
  selectionValue: {
102
- type: (ArrayConstructor | ObjectConstructor | StringConstructor | NumberConstructor)[];
102
+ type: (StringConstructor | NumberConstructor | ArrayConstructor | ObjectConstructor)[];
103
103
  default: null;
104
104
  };
105
105
  inputValue: {
106
- type: (ArrayConstructor | ObjectConstructor | StringConstructor | NumberConstructor)[];
106
+ type: (StringConstructor | NumberConstructor | ArrayConstructor | ObjectConstructor)[];
107
107
  default: string;
108
108
  };
109
109
  modelValue: {
@@ -188,18 +188,18 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
188
188
  "onUpdate:selectionValue"?: ((value: any) => any) | undefined;
189
189
  "onUpdate:inputValue"?: ((value: any) => any) | undefined;
190
190
  }>, {
191
+ modelValue: import("./KCompositeInput.logic.js").ICompositeItem[];
191
192
  type: import("./KCompositeInput.logic.js").CompositeInputType;
192
193
  label: string;
193
194
  validation: "error" | "success" | "warning" | null | undefined;
195
+ validationText: string;
194
196
  searchbox: boolean;
195
197
  labelField: string;
196
198
  placeholder: string;
197
199
  teleportTo: string;
198
- validationText: string;
199
200
  mask: string;
200
201
  valueField: string;
201
- modelValue: import("./KCompositeInput.logic.js").ICompositeItem[];
202
- inputType: "number" | "url" | "search" | "text" | "password" | "email" | "tel" | undefined;
202
+ inputType: "number" | "search" | "url" | "text" | "password" | "email" | "tel" | undefined;
203
203
  selectionValue: string | number | Record<string, any> | unknown[];
204
204
  inputValue: string | number | Record<string, any> | unknown[];
205
205
  selectionSide: import("./KCompositeInput.logic.js").SelectionSide;
@@ -73,11 +73,11 @@ export declare const KCompositeInputDefaultProps: {
73
73
  default: string;
74
74
  };
75
75
  selectionValue: {
76
- type: (ArrayConstructor | ObjectConstructor | StringConstructor | NumberConstructor)[];
76
+ type: (StringConstructor | NumberConstructor | ArrayConstructor | ObjectConstructor)[];
77
77
  default: null;
78
78
  };
79
79
  inputValue: {
80
- type: (ArrayConstructor | ObjectConstructor | StringConstructor | NumberConstructor)[];
80
+ type: (StringConstructor | NumberConstructor | ArrayConstructor | ObjectConstructor)[];
81
81
  default: string;
82
82
  };
83
83
  modelValue: {
@@ -176,7 +176,7 @@ export declare function useKCompositeInputLogic(props: KCompositeInputProps, emi
176
176
  modelValue: any;
177
177
  'onUpdate:modelValue': (val: any) => any;
178
178
  placeholder: string | undefined;
179
- type: "number" | "url" | "search" | "text" | "password" | "email" | "tel" | undefined;
179
+ type: "number" | "search" | "url" | "text" | "password" | "email" | "tel" | undefined;
180
180
  mask: string | undefined;
181
181
  showClear: boolean | undefined;
182
182
  }>;
@@ -8,12 +8,40 @@ interface Props {
8
8
  loading?: boolean;
9
9
  search?: string;
10
10
  itemsPerPage?: number;
11
+ pageSize?: number;
11
12
  page?: number;
13
+ currentPage?: number;
14
+ selectedRows?: any[];
15
+ selectAll?: boolean;
12
16
  }
13
- declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
17
+ declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
18
+ "update:page": (value: number) => any;
19
+ "update:currentPage": (value: number) => any;
20
+ "update:itemsPerPage": (value: number) => any;
21
+ "update:pageSize": (value: number) => any;
22
+ "update:search": (value: string) => any;
23
+ "update:selectedRows": (value: any[]) => any;
24
+ "update:selectAll": (value: boolean) => any;
25
+ "page-change": (value: number) => any;
26
+ "search-change": (value: string) => any;
27
+ }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
28
+ "onUpdate:page"?: ((value: number) => any) | undefined;
29
+ "onUpdate:currentPage"?: ((value: number) => any) | undefined;
30
+ "onUpdate:itemsPerPage"?: ((value: number) => any) | undefined;
31
+ "onUpdate:pageSize"?: ((value: number) => any) | undefined;
32
+ "onUpdate:search"?: ((value: string) => any) | undefined;
33
+ "onUpdate:selectedRows"?: ((value: any[]) => any) | undefined;
34
+ "onUpdate:selectAll"?: ((value: boolean) => any) | undefined;
35
+ "onPage-change"?: ((value: number) => any) | undefined;
36
+ "onSearch-change"?: ((value: string) => any) | undefined;
37
+ }>, {
14
38
  search: string;
15
39
  bulkActions: IKDatatableAction[];
40
+ selectedRows: any[];
41
+ selectAll: boolean;
16
42
  loading: boolean;
43
+ currentPage: number;
44
+ pageSize: number;
17
45
  visibleFields: Array<string> | null;
18
46
  rowActions: IKDatatableAction[];
19
47
  itemsPerPage: number;
@@ -12,9 +12,14 @@ const props = defineProps({
12
12
  loading: { type: Boolean, required: false, default: false },
13
13
  search: { type: String, required: false, default: "" },
14
14
  itemsPerPage: { type: Number, required: false, default: 10 },
15
- page: { type: Number, required: false, default: 1 }
15
+ pageSize: { type: Number, required: false, default: void 0 },
16
+ page: { type: Number, required: false, default: 1 },
17
+ currentPage: { type: Number, required: false, default: void 0 },
18
+ selectedRows: { type: Array, required: false, default: void 0 },
19
+ selectAll: { type: Boolean, required: false, default: void 0 }
16
20
  });
17
- const { selectedRows, selectAll } = useKDataIteratorLogic(props);
21
+ const emit = defineEmits(["update:page", "update:currentPage", "update:itemsPerPage", "update:pageSize", "update:search", "update:selectedRows", "update:selectAll", "page-change", "search-change"]);
22
+ const { selectedRows, selectAll, currentPage, pageSize, setCurrentPage, setPageSize } = useKDataIteratorLogic(props, emit);
18
23
  const slots = useSlots();
19
24
  const mergedSlots = computed(() => ({
20
25
  ...slots
@@ -29,15 +34,32 @@ const templateProps = computed(() => ({
29
34
  selectAll: selectAll.value,
30
35
  loading: props.loading,
31
36
  search: props.search,
32
- itemsPerPage: props.itemsPerPage,
33
- page: props.page,
37
+ itemsPerPage: pageSize.value,
38
+ page: currentPage.value,
34
39
  slots: mergedSlots.value
35
40
  }));
36
41
  const updateSelectedRows = (val) => {
37
42
  selectedRows.value = val;
43
+ emit("update:selectedRows", val);
38
44
  };
39
45
  const updateSelectAll = (val) => {
40
46
  selectAll.value = val;
47
+ emit("update:selectAll", val);
48
+ };
49
+ const updatePage = (val) => {
50
+ setCurrentPage(val);
51
+ emit("update:page", val);
52
+ emit("update:currentPage", val);
53
+ emit("page-change", val);
54
+ };
55
+ const updateItemsPerPage = (val) => {
56
+ setPageSize(val);
57
+ emit("update:itemsPerPage", val);
58
+ emit("update:pageSize", val);
59
+ };
60
+ const updateSearch = (val) => {
61
+ emit("update:search", val);
62
+ emit("search-change", val);
41
63
  };
42
64
  </script>
43
65
 
@@ -47,6 +69,9 @@ component(
47
69
  v-bind="templateProps"
48
70
  @update:selectedRows="updateSelectedRows"
49
71
  @update:selectAll="updateSelectAll"
72
+ @update:page="updatePage"
73
+ @update:itemsPerPage="updateItemsPerPage"
74
+ @update:search="updateSearch"
50
75
  )
51
76
  template(v-for="(_, slot) in $slots" #[slot]="scope")
52
77
  slot(:name="slot" v-bind="scope")