@katlux/toolkit 0.1.1-alpha.109 → 0.1.1-alpha.111

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 (61) hide show
  1. package/dist/compiled/composables/useDataProvider.mjs +26 -10
  2. package/dist/compiled/composables/useRequestQueue.mjs +35 -0
  3. package/dist/module.json +1 -1
  4. package/dist/runtime/components/KBulkActions/KBulkActions.logic.d.ts +2 -0
  5. package/dist/runtime/components/KBulkActions/KBulkActions.logic.js +46 -3
  6. package/dist/runtime/components/KButton/KButton.global.d.vue.ts +1 -1
  7. package/dist/runtime/components/KButton/KButton.global.vue.d.ts +1 -1
  8. package/dist/runtime/components/KButton/KButton.logic.d.ts +1 -1
  9. package/dist/runtime/components/KCheckbox/KCheckbox.global.d.vue.ts +1 -1
  10. package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +1 -1
  11. package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +28 -1
  12. package/dist/runtime/components/KCombobox/KCombobox.global.vue +12 -1
  13. package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +28 -1
  14. package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +22 -0
  15. package/dist/runtime/components/KCombobox/KCombobox.logic.js +115 -10
  16. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +5 -5
  17. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +5 -5
  18. package/dist/runtime/components/KContextMenu/KContextMenu.global.d.vue.ts +1 -1
  19. package/dist/runtime/components/KContextMenu/KContextMenu.global.vue.d.ts +1 -1
  20. package/dist/runtime/components/KDatatable/KDataIterator.global.d.vue.ts +1 -1
  21. package/dist/runtime/components/KDatatable/KDataIterator.global.vue.d.ts +1 -1
  22. package/dist/runtime/components/KDatatable/KDataIterator.logic.d.ts +6 -5
  23. package/dist/runtime/components/KDatatable/KDataIterator.logic.js +37 -15
  24. package/dist/runtime/components/KDatatable/KDatatable.logic.d.ts +4 -3
  25. package/dist/runtime/components/KDatatable/KDatatable.logic.js +45 -12
  26. package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +2 -2
  27. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +2 -2
  28. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +3 -3
  29. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +3 -3
  30. package/dist/runtime/components/KGrid/KGrid.global.d.vue.ts +1 -1
  31. package/dist/runtime/components/KGrid/KGrid.global.vue.d.ts +1 -1
  32. package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +1 -1
  33. package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +1 -1
  34. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.d.vue.ts +1 -1
  35. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +1 -1
  36. package/dist/runtime/components/KPagination/KPagination.logic.js +9 -5
  37. package/dist/runtime/components/KTextarea/KTextarea.global.d.vue.ts +2 -2
  38. package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +2 -2
  39. package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +1 -1
  40. package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +1 -1
  41. package/dist/runtime/components/KToast/KToast.global.d.vue.ts +1 -1
  42. package/dist/runtime/components/KToast/KToast.global.vue.d.ts +1 -1
  43. package/dist/runtime/components/KTree/KTree.logic.d.ts +1 -1
  44. package/dist/runtime/components/KTree/KTree.logic.js +7 -4
  45. package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +4 -4
  46. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +4 -4
  47. package/dist/runtime/components/KTreePicker/KTreePicker.logic.d.ts +7 -0
  48. package/dist/runtime/components/KTreeView/KTreeView.global.d.vue.ts +3 -3
  49. package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +3 -3
  50. package/dist/runtime/components/KTreeView/KTreeView.logic.d.ts +1 -1
  51. package/dist/runtime/components/KTreeView/KTreeView.logic.js +4 -1
  52. package/dist/runtime/composables/useDataProvider.js +26 -10
  53. package/dist/runtime/composables/useRequestQueue.d.ts +25 -0
  54. package/dist/runtime/composables/useRequestQueue.js +35 -0
  55. package/dist/runtime/presets/default/components/KCombobox/KCombobox.d.vue.ts +15 -1
  56. package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue +23 -2
  57. package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue.d.ts +15 -1
  58. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.d.vue.ts +15 -1
  59. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue +170 -7
  60. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue.d.ts +15 -1
  61. package/package.json +1 -1
@@ -90,9 +90,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
90
90
  default: boolean;
91
91
  };
92
92
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
93
- "update:modelValue": (value: import("./KCompositeInput.logic.js").ICompositeItem[]) => any;
94
93
  "update:selectionValue": (value: any) => any;
95
94
  "update:inputValue": (value: any) => any;
95
+ "update:modelValue": (value: import("./KCompositeInput.logic.js").ICompositeItem[]) => any;
96
96
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
97
97
  label: {
98
98
  type: StringConstructor;
@@ -184,18 +184,17 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
184
184
  default: boolean;
185
185
  };
186
186
  }>> & Readonly<{
187
- "onUpdate:modelValue"?: ((value: import("./KCompositeInput.logic.js").ICompositeItem[]) => any) | undefined;
188
187
  "onUpdate:selectionValue"?: ((value: any) => any) | undefined;
189
188
  "onUpdate:inputValue"?: ((value: any) => any) | undefined;
189
+ "onUpdate:modelValue"?: ((value: import("./KCompositeInput.logic.js").ICompositeItem[]) => any) | undefined;
190
190
  }>, {
191
191
  type: import("./KCompositeInput.logic.js").CompositeInputType;
192
192
  label: string;
193
- validation: "error" | "success" | "warning" | null | undefined;
194
- validationText: string;
195
- modelValue: import("./KCompositeInput.logic.js").ICompositeItem[];
196
193
  inputType: "number" | "url" | "search" | "text" | "password" | "email" | "tel" | undefined;
194
+ validation: "error" | "success" | "warning" | null | undefined;
197
195
  selectionValue: string | number | Record<string, any> | unknown[];
198
196
  inputValue: string | number | Record<string, any> | unknown[];
197
+ modelValue: import("./KCompositeInput.logic.js").ICompositeItem[];
199
198
  selectionSide: import("./KCompositeInput.logic.js").SelectionSide;
200
199
  mask: string;
201
200
  labelField: string;
@@ -205,6 +204,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
205
204
  searchbox: boolean;
206
205
  showClear: boolean;
207
206
  teleportTo: string;
207
+ validationText: string;
208
208
  inputConfigField: string;
209
209
  validateAll: boolean;
210
210
  inputFormat: string;
@@ -46,8 +46,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
46
46
  "onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
47
47
  }>, {
48
48
  isOpen: boolean;
49
- teleportTo: string;
50
49
  x: number;
50
+ teleportTo: string;
51
51
  y: number;
52
52
  target: string | HTMLElement;
53
53
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -46,8 +46,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
46
46
  "onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
47
47
  }>, {
48
48
  isOpen: boolean;
49
- teleportTo: string;
50
49
  x: number;
50
+ teleportTo: string;
51
51
  y: number;
52
52
  target: string | HTMLElement;
53
53
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -11,9 +11,9 @@ interface Props {
11
11
  page?: number;
12
12
  }
13
13
  declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
14
- bulkActions: IKDatatableAction[];
15
14
  search: string;
16
15
  loading: boolean;
16
+ bulkActions: IKDatatableAction[];
17
17
  visibleFields: Array<string> | null;
18
18
  rowActions: IKDatatableAction[];
19
19
  itemsPerPage: number;
@@ -11,9 +11,9 @@ interface Props {
11
11
  page?: number;
12
12
  }
13
13
  declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
14
- bulkActions: IKDatatableAction[];
15
14
  search: string;
16
15
  loading: boolean;
16
+ bulkActions: IKDatatableAction[];
17
17
  visibleFields: Array<string> | null;
18
18
  rowActions: IKDatatableAction[];
19
19
  itemsPerPage: number;
@@ -1,3 +1,4 @@
1
+ import { type Ref } from 'vue';
1
2
  import { ADataProvider } from '@katlux/providers';
2
3
  export interface KDataIteratorProps {
3
4
  dataProvider: ADataProvider;
@@ -15,9 +16,9 @@ export declare const KDataIteratorDefaultProps: {
15
16
  page: number;
16
17
  };
17
18
  export declare function useKDataIteratorLogic(props: KDataIteratorProps): {
18
- selectedRows: import("@katlux/providers").CompatRef<any[]> | import("vue").Ref<any[], any[]>;
19
- selectAll: import("vue").Ref<boolean, boolean> | import("@katlux/providers").CompatRef<boolean>;
20
- pageData: import("vue").Ref<import("@katlux/providers").TDataRow[], import("@katlux/providers").TDataRow[]>;
21
- loading: import("vue").Ref<boolean, boolean>;
22
- initialLoad: import("vue").Ref<boolean, boolean>;
19
+ selectedRows: Ref<any[], any[]>;
20
+ selectAll: Ref<boolean, boolean>;
21
+ pageData: Ref<import("@katlux/providers").TDataRow[], import("@katlux/providers").TDataRow[]>;
22
+ loading: Ref<boolean, boolean>;
23
+ initialLoad: Ref<boolean, boolean>;
23
24
  };
@@ -1,4 +1,4 @@
1
- import { watch } from "vue";
1
+ import { watch, isRef } from "vue";
2
2
  import { useDataProvider } from "../../composables/useDataProvider.js";
3
3
  export const KDataIteratorDefaultProps = {
4
4
  visibleFields: null,
@@ -9,18 +9,38 @@ export const KDataIteratorDefaultProps = {
9
9
  };
10
10
  export function useKDataIteratorLogic(props) {
11
11
  const { pageData, selectedRows: dpSelectedRows, selectAll: dpSelectAll, loading: dpLoading, initialLoad: dpInitialLoad } = useDataProvider(props.dataProvider);
12
- const selectedRows = props.dataProvider?.selectedRows && !props.dataProvider?.selectedRows?.__v_skip ? props.dataProvider.selectedRows : dpSelectedRows;
13
- const selectAll = props.dataProvider?.selectAll && !props.dataProvider?.selectAll?.__v_skip ? props.dataProvider.selectAll : dpSelectAll;
12
+ const selectedRows = isRef(props.dataProvider?.selectedRows) ? props.dataProvider.selectedRows : dpSelectedRows;
13
+ const selectAll = isRef(props.dataProvider?.selectAll) ? props.dataProvider.selectAll : dpSelectAll;
14
14
  const idKey = props.dataProvider?.idKey || "id";
15
15
  const getRowId = (row) => row?.[idKey] ?? row?.id ?? row;
16
16
  let isInternalUpdating = false;
17
- const getPageRows = () => (props.dataProvider?.pageData?.value ?? props.dataProvider?.pageData ?? pageData.value) || [];
17
+ const getPageRows = () => {
18
+ const dpData = props.dataProvider?.pageData;
19
+ if (isRef(dpData)) return dpData.value || [];
20
+ if (Array.isArray(dpData)) return dpData;
21
+ return pageData.value || [];
22
+ };
18
23
  const syncToProvider = () => {
19
- if (props.dataProvider?.selectedRows && props.dataProvider.selectedRows !== selectedRows) {
20
- props.dataProvider.selectedRows.value = selectedRows.value;
21
- }
22
- if (props.dataProvider?.selectAll && props.dataProvider.selectAll !== selectAll) {
23
- props.dataProvider.selectAll.value = selectAll.value;
24
+ if (props.dataProvider) {
25
+ isInternalUpdating = true;
26
+ try {
27
+ if (typeof props.dataProvider.setSelectedRows === "function") {
28
+ props.dataProvider.setSelectedRows(selectedRows.value);
29
+ } else if (isRef(props.dataProvider.selectedRows)) {
30
+ props.dataProvider.selectedRows.value = selectedRows.value;
31
+ } else {
32
+ props.dataProvider.selectedRows = selectedRows.value;
33
+ }
34
+ if (typeof props.dataProvider.setSelectAll === "function") {
35
+ props.dataProvider.setSelectAll(selectAll.value);
36
+ } else if (isRef(props.dataProvider.selectAll)) {
37
+ props.dataProvider.selectAll.value = selectAll.value;
38
+ } else {
39
+ props.dataProvider.selectAll = selectAll.value;
40
+ }
41
+ } finally {
42
+ isInternalUpdating = false;
43
+ }
24
44
  }
25
45
  };
26
46
  watch(() => selectAll.value, (newVal) => {
@@ -61,20 +81,22 @@ export function useKDataIteratorLogic(props) {
61
81
  }
62
82
  });
63
83
  watch(() => props.itemsPerPage, (newVal) => {
64
- if (newVal !== void 0 && newVal !== props.dataProvider?.pageSize?.value) {
84
+ const currentSize = props.dataProvider?.pageSize?.value ?? props.dataProvider?.pageSize;
85
+ if (newVal !== void 0 && newVal !== currentSize) {
65
86
  if (typeof props.dataProvider?.setPageSize === "function") {
66
87
  props.dataProvider.setPageSize(newVal);
67
- } else if (props.dataProvider?.pageSize) {
68
- props.dataProvider.pageSize.value = newVal;
88
+ } else if (props.dataProvider) {
89
+ props.dataProvider.pageSize = newVal;
69
90
  }
70
91
  }
71
92
  });
72
93
  watch(() => props.page, (newVal) => {
73
- if (newVal !== void 0 && newVal !== props.dataProvider?.currentPage?.value) {
94
+ const currentPage = props.dataProvider?.currentPage?.value ?? props.dataProvider?.currentPage;
95
+ if (newVal !== void 0 && newVal !== currentPage) {
74
96
  if (typeof props.dataProvider?.setCurrentPage === "function") {
75
97
  props.dataProvider.setCurrentPage(newVal);
76
- } else if (props.dataProvider?.currentPage) {
77
- props.dataProvider.currentPage.value = newVal;
98
+ } else if (props.dataProvider) {
99
+ props.dataProvider.currentPage = newVal;
78
100
  }
79
101
  }
80
102
  });
@@ -1,3 +1,4 @@
1
+ import { type Ref } from 'vue';
1
2
  import { ADataProvider } from '@katlux/providers';
2
3
  export interface KDatatableProps {
3
4
  dataProvider: ADataProvider;
@@ -11,8 +12,8 @@ export declare const KDatatableDefaultProps: {
11
12
  emptyFilterStateText: string;
12
13
  };
13
14
  export declare function useKDatatableLogic(props: KDatatableProps): {
14
- selectedRows: import("@katlux/providers").CompatRef<any[]>;
15
- selectAll: import("@katlux/providers").CompatRef<boolean>;
15
+ selectedRows: Ref<any[], any[]>;
16
+ selectAll: Ref<boolean, boolean>;
16
17
  getRowKey: (row: any, index: number) => string | number;
17
- pageData: import("vue").Ref<import("@katlux/providers").TDataRow[], import("@katlux/providers").TDataRow[]>;
18
+ pageData: Ref<import("@katlux/providers").TDataRow[], import("@katlux/providers").TDataRow[]>;
18
19
  };
@@ -1,4 +1,4 @@
1
- import { watch } from "vue";
1
+ import { watch, isRef } from "vue";
2
2
  import { useDataProvider } from "../../composables/useDataProvider.js";
3
3
  export const KDatatableDefaultProps = {
4
4
  visibleFields: null,
@@ -6,11 +6,18 @@ export const KDatatableDefaultProps = {
6
6
  emptyFilterStateText: "no result found for filter"
7
7
  };
8
8
  export function useKDatatableLogic(props) {
9
- const { pageData, selectedRows: dpSelectedRows, selectAll: dpSelectAll } = useDataProvider(props.dataProvider);
10
- const selectedRows = props.dataProvider?.selectedRows || dpSelectedRows;
11
- const selectAll = props.dataProvider?.selectAll || dpSelectAll;
9
+ const { pageData, selectedRows: dpSelectedRows, selectAll: dpSelectAll, loading: dpLoading, initialLoad: dpInitialLoad } = useDataProvider(props.dataProvider);
10
+ const selectedRows = isRef(props.dataProvider?.selectedRows) ? props.dataProvider.selectedRows : dpSelectedRows;
11
+ const selectAll = isRef(props.dataProvider?.selectAll) ? props.dataProvider.selectAll : dpSelectAll;
12
12
  const idKey = props.dataProvider?.idKey || "id";
13
13
  const getRowId = (row) => row?.[idKey] ?? row?.id ?? row;
14
+ let isInternalUpdating = false;
15
+ const getPageRows = () => {
16
+ const dpData = props.dataProvider?.pageData;
17
+ if (isRef(dpData)) return dpData.value || [];
18
+ if (Array.isArray(dpData)) return dpData;
19
+ return pageData.value || [];
20
+ };
14
21
  const getRowKey = (row, index) => {
15
22
  if (row && row[idKey] !== void 0 && row[idKey] !== null) {
16
23
  return row[idKey];
@@ -23,8 +30,24 @@ export function useKDatatableLogic(props) {
23
30
  }
24
31
  return index;
25
32
  };
26
- let isInternalUpdating = false;
27
- const getPageRows = () => (props.dataProvider?.pageData?.value ?? props.dataProvider?.pageData ?? pageData.value) || [];
33
+ const syncToProvider = () => {
34
+ if (props.dataProvider) {
35
+ if (typeof props.dataProvider.setSelectedRows === "function") {
36
+ props.dataProvider.setSelectedRows(selectedRows.value);
37
+ } else if (isRef(props.dataProvider.selectedRows)) {
38
+ props.dataProvider.selectedRows.value = selectedRows.value;
39
+ } else {
40
+ props.dataProvider.selectedRows = selectedRows.value;
41
+ }
42
+ if (typeof props.dataProvider.setSelectAll === "function") {
43
+ props.dataProvider.setSelectAll(selectAll.value);
44
+ } else if (isRef(props.dataProvider.selectAll)) {
45
+ props.dataProvider.selectAll.value = selectAll.value;
46
+ } else {
47
+ props.dataProvider.selectAll = selectAll.value;
48
+ }
49
+ }
50
+ };
28
51
  watch(() => selectAll.value, (newVal) => {
29
52
  if (isInternalUpdating) return;
30
53
  const currentRows = getPageRows();
@@ -36,21 +59,31 @@ export function useKDatatableLogic(props) {
36
59
  const newSelections = currentRows.filter((r) => !currentSelectedIds.has(getRowId(r)));
37
60
  selectedRows.value = [...selectedRows.value, ...newSelections];
38
61
  }
62
+ syncToProvider();
39
63
  });
40
64
  watch([getPageRows, () => selectedRows.value], () => {
41
65
  const currentRows = getPageRows();
42
66
  if (currentRows.length === 0) {
43
- isInternalUpdating = true;
44
- selectAll.value = false;
45
- isInternalUpdating = false;
67
+ if (selectAll.value) {
68
+ isInternalUpdating = true;
69
+ selectAll.value = false;
70
+ isInternalUpdating = false;
71
+ syncToProvider();
72
+ }
46
73
  return;
47
74
  }
48
75
  const selectedIds = new Set(selectedRows.value.map(getRowId));
49
76
  const allCurrentSelected = currentRows.every((r) => selectedIds.has(getRowId(r)));
50
- isInternalUpdating = true;
51
- selectAll.value = allCurrentSelected;
52
- isInternalUpdating = false;
77
+ if (selectAll.value !== allCurrentSelected) {
78
+ isInternalUpdating = true;
79
+ selectAll.value = allCurrentSelected;
80
+ isInternalUpdating = false;
81
+ }
82
+ syncToProvider();
53
83
  }, { immediate: true });
84
+ watch(() => selectedRows.value, () => {
85
+ syncToProvider();
86
+ }, { deep: true });
54
87
  return {
55
88
  selectedRows,
56
89
  selectAll,
@@ -124,15 +124,15 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
124
124
  label: string;
125
125
  day: string | Date;
126
126
  validation: "error" | "success" | "warning" | null | undefined;
127
- validationText: string;
128
127
  modelValue: string | Date;
129
128
  placeholder: string;
130
129
  showClear: boolean;
131
130
  teleportTo: string;
132
- align: "left" | "right" | undefined;
131
+ validationText: string;
133
132
  format: string;
134
133
  calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
135
134
  calendarMarkedDays: import("../KCalendar/types.js").IMarkedDay[];
135
+ align: "left" | "right" | undefined;
136
136
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
137
137
  declare const _default: typeof __VLS_export;
138
138
  export default _default;
@@ -124,15 +124,15 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
124
124
  label: string;
125
125
  day: string | Date;
126
126
  validation: "error" | "success" | "warning" | null | undefined;
127
- validationText: string;
128
127
  modelValue: string | Date;
129
128
  placeholder: string;
130
129
  showClear: boolean;
131
130
  teleportTo: string;
132
- align: "left" | "right" | undefined;
131
+ validationText: string;
133
132
  format: string;
134
133
  calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
135
134
  calendarMarkedDays: import("../KCalendar/types.js").IMarkedDay[];
135
+ align: "left" | "right" | undefined;
136
136
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
137
137
  declare const _default: typeof __VLS_export;
138
138
  export default _default;
@@ -130,16 +130,16 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
130
130
  label: string;
131
131
  day: string | Date;
132
132
  validation: "error" | "success" | "warning" | null | undefined;
133
- validationText: string;
134
133
  modelValue: string | Date;
135
134
  placeholder: string;
136
135
  showClear: boolean;
137
136
  teleportTo: string;
137
+ validationText: string;
138
138
  format: string;
139
- calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
140
- calendarMarkedDays: import("../KCalendar/types.js").IMarkedDay[];
141
139
  timeFormat: string;
142
140
  timeStep: number;
141
+ calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
142
+ calendarMarkedDays: import("../KCalendar/types.js").IMarkedDay[];
143
143
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
144
144
  declare const _default: typeof __VLS_export;
145
145
  export default _default;
@@ -130,16 +130,16 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
130
130
  label: string;
131
131
  day: string | Date;
132
132
  validation: "error" | "success" | "warning" | null | undefined;
133
- validationText: string;
134
133
  modelValue: string | Date;
135
134
  placeholder: string;
136
135
  showClear: boolean;
137
136
  teleportTo: string;
137
+ validationText: string;
138
138
  format: string;
139
- calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
140
- calendarMarkedDays: import("../KCalendar/types.js").IMarkedDay[];
141
139
  timeFormat: string;
142
140
  timeStep: number;
141
+ calendarDefinedDays: import("../KCalendar/types.js").IDefinedDay[];
142
+ calendarMarkedDays: import("../KCalendar/types.js").IMarkedDay[];
143
143
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
144
144
  declare const _default: typeof __VLS_export;
145
145
  export default _default;
@@ -1,7 +1,7 @@
1
1
  import { type KGridProps } from './KGrid.logic.js';
2
2
  declare const __VLS_export: import("vue").DefineComponent<KGridProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KGridProps> & Readonly<{}>, {
3
- direction: "row" | "column";
4
3
  noGap: boolean;
4
+ direction: "row" | "column";
5
5
  align: "start" | "center" | "end" | "stretch" | "baseline";
6
6
  wrap: "wrap" | "nowrap";
7
7
  flexChild: boolean;
@@ -1,7 +1,7 @@
1
1
  import { type KGridProps } from './KGrid.logic.js';
2
2
  declare const __VLS_export: import("vue").DefineComponent<KGridProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KGridProps> & Readonly<{}>, {
3
- direction: "row" | "column";
4
3
  noGap: boolean;
4
+ direction: "row" | "column";
5
5
  align: "start" | "center" | "end" | "stretch" | "baseline";
6
6
  wrap: "wrap" | "nowrap";
7
7
  flexChild: boolean;
@@ -110,10 +110,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
110
110
  label: string;
111
111
  disabled: boolean;
112
112
  validation: "error" | "success" | "warning" | null | undefined;
113
- validationText: string;
114
113
  modelValue: string;
115
114
  placeholder: string;
116
115
  showClear: boolean;
116
+ validationText: string;
117
117
  format: string;
118
118
  step: number;
119
119
  startHour: string;
@@ -110,10 +110,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
110
110
  label: string;
111
111
  disabled: boolean;
112
112
  validation: "error" | "success" | "warning" | null | undefined;
113
- validationText: string;
114
113
  modelValue: string;
115
114
  placeholder: string;
116
115
  showClear: boolean;
116
+ validationText: string;
117
117
  format: string;
118
118
  step: number;
119
119
  startHour: string;
@@ -66,10 +66,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
66
66
  }>, {
67
67
  label: string;
68
68
  validation: "error" | "success" | "warning" | null | undefined;
69
- validationText: string;
70
69
  modelValue: string;
71
70
  placeholder: string;
72
71
  showClear: boolean;
72
+ validationText: string;
73
73
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
74
74
  declare const _default: typeof __VLS_export;
75
75
  export default _default;
@@ -66,10 +66,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
66
66
  }>, {
67
67
  label: string;
68
68
  validation: "error" | "success" | "warning" | null | undefined;
69
- validationText: string;
70
69
  modelValue: string;
71
70
  placeholder: string;
72
71
  showClear: boolean;
72
+ validationText: string;
73
73
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
74
74
  declare const _default: typeof __VLS_export;
75
75
  export default _default;
@@ -5,9 +5,9 @@ export const KPaginationDefaultProps = {};
5
5
  export function useKPaginationLogic(props) {
6
6
  const dp = props.dataProvider;
7
7
  const { rowCount: dpRowCount, pageSize: dpPageSize, currentPage: dpCurrentPage } = useDataProvider(props.dataProvider);
8
- const rowCount = computed(() => dpRowCount.value ?? dp?.rowCount?.value ?? 0);
9
- const pageSize = computed(() => dpPageSize.value ?? dp?.pageSize?.value ?? 10);
10
- const currentPage = computed(() => dpCurrentPage.value ?? dp?.currentPage?.value ?? 1);
8
+ const rowCount = computed(() => dpRowCount.value ?? dp?.rowCount?.value ?? dp?.rowCount ?? 0);
9
+ const pageSize = computed(() => dpPageSize.value ?? dp?.pageSize?.value ?? dp?.pageSize ?? 10);
10
+ const currentPage = computed(() => dpCurrentPage.value ?? dp?.currentPage?.value ?? dp?.currentPage ?? 1);
11
11
  let route;
12
12
  try {
13
13
  route = useRoute();
@@ -49,8 +49,12 @@ export function useKPaginationLogic(props) {
49
49
  const pageClicked = (item) => {
50
50
  if (typeof dp?.setCurrentPage === "function") {
51
51
  dp.setCurrentPage(item);
52
- } else if (dp?.currentPage) {
53
- dp.currentPage.value = item;
52
+ } else if (dp) {
53
+ if (typeof dp.currentPage === "object" && "value" in dp.currentPage) {
54
+ dp.currentPage.value = item;
55
+ } else {
56
+ dp.currentPage = item;
57
+ }
54
58
  }
55
59
  dpCurrentPage.value = item;
56
60
  };
@@ -57,10 +57,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
57
57
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
58
58
  }>, {
59
59
  label: string;
60
+ rows: number;
60
61
  validation: "error" | "success" | "warning" | null | undefined;
61
- validationText: string;
62
62
  placeholder: string;
63
- rows: number;
63
+ validationText: string;
64
64
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
65
65
  declare const _default: typeof __VLS_export;
66
66
  export default _default;
@@ -57,10 +57,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
57
57
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
58
58
  }>, {
59
59
  label: string;
60
+ rows: number;
60
61
  validation: "error" | "success" | "warning" | null | undefined;
61
- validationText: string;
62
62
  placeholder: string;
63
- rows: number;
63
+ validationText: string;
64
64
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
65
65
  declare const _default: typeof __VLS_export;
66
66
  export default _default;
@@ -69,10 +69,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
69
69
  type: "number" | "url" | "search" | "text" | "password" | "email" | "tel" | undefined;
70
70
  label: string;
71
71
  validation: "error" | "success" | "warning" | null | undefined;
72
- validationText: string;
73
72
  modelValue: string;
74
73
  placeholder: string;
75
74
  showClear: boolean;
75
+ validationText: string;
76
76
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
77
77
  declare const _default: typeof __VLS_export;
78
78
  export default _default;
@@ -69,10 +69,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
69
69
  type: "number" | "url" | "search" | "text" | "password" | "email" | "tel" | undefined;
70
70
  label: string;
71
71
  validation: "error" | "success" | "warning" | null | undefined;
72
- validationText: string;
73
72
  modelValue: string;
74
73
  placeholder: string;
75
74
  showClear: boolean;
75
+ validationText: string;
76
76
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
77
77
  declare const _default: typeof __VLS_export;
78
78
  export default _default;
@@ -48,8 +48,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
48
48
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
49
49
  }>, {
50
50
  type: import("./KToast.logic.js").KToastType;
51
- modelValue: boolean;
52
51
  text: string;
52
+ modelValue: boolean;
53
53
  timeout: number;
54
54
  teleport: boolean;
55
55
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -48,8 +48,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
48
48
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
49
49
  }>, {
50
50
  type: import("./KToast.logic.js").KToastType;
51
- modelValue: boolean;
52
51
  text: string;
52
+ modelValue: boolean;
53
53
  timeout: number;
54
54
  teleport: boolean;
55
55
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -45,7 +45,7 @@ export declare const KTreeDefaultProps: {
45
45
  };
46
46
  };
47
47
  export declare function useKTreeLogic(props: KTreeProps): {
48
- visibleRows: import("vue").ComputedRef<import("@katlux/providers").TDataRow[]>;
48
+ visibleRows: import("vue").ComputedRef<any>;
49
49
  expandedNodes: any;
50
50
  toggleNode: (nodeId: string | number) => void;
51
51
  };
@@ -34,19 +34,22 @@ export const KTreeDefaultProps = {
34
34
  default: ""
35
35
  }
36
36
  };
37
+ import { useDataProvider } from "../../composables/useDataProvider.js";
37
38
  export function useKTreeLogic(props) {
39
+ const { pageData, setFilter } = useDataProvider(props.dataProvider);
38
40
  const visibleRows = computed(() => {
39
- return props.dataProvider.pageData.value || [];
41
+ const raw = props.dataProvider?.pageData?.value ?? props.dataProvider?.pageData ?? pageData.value;
42
+ return raw || [];
40
43
  });
41
44
  watch(() => props.searchtext, (newVal) => {
42
45
  if (newVal) {
43
- props.dataProvider.filter.value = {
46
+ setFilter({
44
47
  operator: EDataFilterOperator.In,
45
48
  field: { [props.labelField || "name"]: newVal },
46
49
  active: true
47
- };
50
+ });
48
51
  } else {
49
- props.dataProvider.filter.value = null;
52
+ setFilter(null);
50
53
  }
51
54
  });
52
55
  const toggleNode = (nodeId) => {
@@ -164,23 +164,23 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
164
164
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
165
165
  "onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
166
166
  }>, {
167
+ parentKey: string;
168
+ loading: boolean;
169
+ idKey: string;
167
170
  label: string;
168
171
  disabled: boolean;
169
- loading: boolean;
170
172
  validation: "error" | "success" | "warning" | null | undefined;
171
- validationText: string;
172
173
  modelValue: any;
173
174
  valueField: string;
174
175
  placeholder: string;
175
176
  searchbox: boolean;
177
+ validationText: string;
176
178
  searchPlaceholder: string;
177
179
  isOptionsOpen: boolean;
178
180
  fullWidth: boolean;
179
181
  closeOnSelect: boolean;
180
182
  multiSelect: boolean;
181
183
  iconField: string;
182
- idKey: string;
183
- parentKey: string;
184
184
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
185
185
  declare const _default: typeof __VLS_export;
186
186
  export default _default;