@katlux/toolkit 0.1.1-alpha.110 → 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.
- package/dist/compiled/composables/useDataProvider.mjs +26 -10
- package/dist/compiled/composables/useRequestQueue.mjs +35 -0
- package/dist/module.json +1 -1
- package/dist/runtime/components/KCheckbox/KCheckbox.global.d.vue.ts +1 -1
- package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +1 -1
- package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +31 -4
- package/dist/runtime/components/KCombobox/KCombobox.global.vue +12 -1
- package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +31 -4
- package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +22 -0
- package/dist/runtime/components/KCombobox/KCombobox.logic.js +115 -10
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +10 -10
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +10 -10
- package/dist/runtime/components/KDatatable/KDataIterator.logic.d.ts +6 -5
- package/dist/runtime/components/KDatatable/KDataIterator.logic.js +37 -15
- package/dist/runtime/components/KDatatable/KDatatable.logic.d.ts +4 -3
- package/dist/runtime/components/KDatatable/KDatatable.logic.js +25 -10
- package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +3 -3
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +3 -3
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +4 -4
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +4 -4
- package/dist/runtime/components/KDropdown/KDropdown.global.d.vue.ts +1 -1
- package/dist/runtime/components/KDropdown/KDropdown.global.vue.d.ts +1 -1
- package/dist/runtime/components/KGrid/KGrid.global.d.vue.ts +1 -1
- package/dist/runtime/components/KGrid/KGrid.global.vue.d.ts +1 -1
- package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +1 -1
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +1 -1
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.d.vue.ts +1 -1
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +1 -1
- package/dist/runtime/components/KPagination/KPagination.logic.js +9 -5
- package/dist/runtime/components/KSlider/KSlider.global.d.vue.ts +1 -1
- package/dist/runtime/components/KSlider/KSlider.global.vue.d.ts +1 -1
- package/dist/runtime/components/KTextarea/KTextarea.global.d.vue.ts +1 -1
- package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +1 -1
- package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +1 -1
- package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +1 -1
- package/dist/runtime/components/KToast/KToast.global.d.vue.ts +1 -1
- package/dist/runtime/components/KToast/KToast.global.vue.d.ts +1 -1
- package/dist/runtime/components/KTree/KTree.global.d.vue.ts +1 -1
- package/dist/runtime/components/KTree/KTree.global.vue.d.ts +1 -1
- package/dist/runtime/components/KTree/KTree.logic.d.ts +1 -1
- package/dist/runtime/components/KTree/KTree.logic.js +7 -4
- package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +3 -3
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +3 -3
- package/dist/runtime/components/KTreePicker/KTreePicker.logic.d.ts +7 -0
- package/dist/runtime/components/KTreeView/KTreeView.logic.d.ts +1 -1
- package/dist/runtime/components/KTreeView/KTreeView.logic.js +4 -1
- package/dist/runtime/composables/useDataProvider.js +26 -10
- package/dist/runtime/composables/useRequestQueue.d.ts +25 -0
- package/dist/runtime/composables/useRequestQueue.js +35 -0
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.d.vue.ts +15 -1
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue +23 -2
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue.d.ts +15 -1
- package/dist/runtime/presets/default/components/KCombobox/KComboboxList.d.vue.ts +15 -1
- package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue +170 -7
- package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue.d.ts +15 -1
- package/package.json +1 -1
|
@@ -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
|
|
13
|
-
const selectAll = props.dataProvider?.selectAll
|
|
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 = () =>
|
|
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
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
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
|
|
68
|
-
props.dataProvider.pageSize
|
|
88
|
+
} else if (props.dataProvider) {
|
|
89
|
+
props.dataProvider.pageSize = newVal;
|
|
69
90
|
}
|
|
70
91
|
}
|
|
71
92
|
});
|
|
72
93
|
watch(() => props.page, (newVal) => {
|
|
73
|
-
|
|
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
|
|
77
|
-
props.dataProvider.currentPage
|
|
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:
|
|
15
|
-
selectAll:
|
|
15
|
+
selectedRows: Ref<any[], any[]>;
|
|
16
|
+
selectAll: Ref<boolean, boolean>;
|
|
16
17
|
getRowKey: (row: any, index: number) => string | number;
|
|
17
|
-
pageData:
|
|
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,13 +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
|
|
11
|
-
const selectAll = props.dataProvider?.selectAll
|
|
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
14
|
let isInternalUpdating = false;
|
|
15
|
-
const getPageRows = () =>
|
|
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
|
+
};
|
|
16
21
|
const getRowKey = (row, index) => {
|
|
17
22
|
if (row && row[idKey] !== void 0 && row[idKey] !== null) {
|
|
18
23
|
return row[idKey];
|
|
@@ -26,11 +31,21 @@ export function useKDatatableLogic(props) {
|
|
|
26
31
|
return index;
|
|
27
32
|
};
|
|
28
33
|
const syncToProvider = () => {
|
|
29
|
-
if (props.dataProvider
|
|
30
|
-
props.dataProvider.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
+
}
|
|
34
49
|
}
|
|
35
50
|
};
|
|
36
51
|
watch(() => selectAll.value, (newVal) => {
|
|
@@ -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
|
-
teleportTo: string;
|
|
131
129
|
showClear: boolean;
|
|
132
|
-
|
|
130
|
+
teleportTo: string;
|
|
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
|
-
teleportTo: string;
|
|
131
129
|
showClear: boolean;
|
|
132
|
-
|
|
130
|
+
teleportTo: string;
|
|
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
|
-
teleportTo: string;
|
|
137
135
|
showClear: boolean;
|
|
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
|
-
teleportTo: string;
|
|
137
135
|
showClear: boolean;
|
|
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;
|
|
@@ -54,8 +54,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
54
54
|
"onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
|
|
55
55
|
}>, {
|
|
56
56
|
isOpen: boolean;
|
|
57
|
-
direction: import("./KDropdown.logic.js").KDropdownDirection;
|
|
58
57
|
teleportTo: string;
|
|
58
|
+
direction: import("./KDropdown.logic.js").KDropdownDirection;
|
|
59
59
|
fullWidth: boolean;
|
|
60
60
|
align: import("./KDropdown.logic.js").KDropdownAlign;
|
|
61
61
|
anchorEl: HTMLElement;
|
|
@@ -54,8 +54,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
54
54
|
"onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
|
|
55
55
|
}>, {
|
|
56
56
|
isOpen: boolean;
|
|
57
|
-
direction: import("./KDropdown.logic.js").KDropdownDirection;
|
|
58
57
|
teleportTo: string;
|
|
58
|
+
direction: import("./KDropdown.logic.js").KDropdownDirection;
|
|
59
59
|
fullWidth: boolean;
|
|
60
60
|
align: import("./KDropdown.logic.js").KDropdownAlign;
|
|
61
61
|
anchorEl: HTMLElement;
|
|
@@ -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
|
|
53
|
-
dp.currentPage
|
|
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
|
};
|
|
@@ -53,9 +53,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
53
53
|
}>> & Readonly<{
|
|
54
54
|
"onUpdate:value"?: ((value: any) => any) | undefined;
|
|
55
55
|
}>, {
|
|
56
|
-
value: number;
|
|
57
56
|
label: string;
|
|
58
57
|
disabled: boolean;
|
|
58
|
+
value: number;
|
|
59
59
|
step: number;
|
|
60
60
|
min: number;
|
|
61
61
|
max: number;
|
|
@@ -53,9 +53,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
53
53
|
}>> & Readonly<{
|
|
54
54
|
"onUpdate:value"?: ((value: any) => any) | undefined;
|
|
55
55
|
}>, {
|
|
56
|
-
value: number;
|
|
57
56
|
label: string;
|
|
58
57
|
disabled: boolean;
|
|
58
|
+
value: number;
|
|
59
59
|
step: number;
|
|
60
60
|
min: number;
|
|
61
61
|
max: number;
|
|
@@ -59,8 +59,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
59
59
|
label: string;
|
|
60
60
|
rows: number;
|
|
61
61
|
validation: "error" | "success" | "warning" | null | undefined;
|
|
62
|
-
validationText: string;
|
|
63
62
|
placeholder: string;
|
|
63
|
+
validationText: string;
|
|
64
64
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
65
65
|
declare const _default: typeof __VLS_export;
|
|
66
66
|
export default _default;
|
|
@@ -59,8 +59,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
59
59
|
label: string;
|
|
60
60
|
rows: number;
|
|
61
61
|
validation: "error" | "success" | "warning" | null | undefined;
|
|
62
|
-
validationText: string;
|
|
63
62
|
placeholder: string;
|
|
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>;
|
|
@@ -66,8 +66,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
66
66
|
};
|
|
67
67
|
}>> & Readonly<{}>, {
|
|
68
68
|
disabled: boolean;
|
|
69
|
-
searchtext: string;
|
|
70
69
|
labelField: string;
|
|
70
|
+
searchtext: string;
|
|
71
71
|
multiSelect: boolean;
|
|
72
72
|
iconField: string;
|
|
73
73
|
isNodeSelected: (node: any) => boolean;
|
|
@@ -66,8 +66,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
66
66
|
};
|
|
67
67
|
}>> & Readonly<{}>, {
|
|
68
68
|
disabled: boolean;
|
|
69
|
-
searchtext: string;
|
|
70
69
|
labelField: string;
|
|
70
|
+
searchtext: string;
|
|
71
71
|
multiSelect: boolean;
|
|
72
72
|
iconField: string;
|
|
73
73
|
isNodeSelected: (node: any) => boolean;
|
|
@@ -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<
|
|
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
|
-
|
|
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
|
-
|
|
46
|
+
setFilter({
|
|
44
47
|
operator: EDataFilterOperator.In,
|
|
45
48
|
field: { [props.labelField || "name"]: newVal },
|
|
46
49
|
active: true
|
|
47
|
-
};
|
|
50
|
+
});
|
|
48
51
|
} else {
|
|
49
|
-
|
|
52
|
+
setFilter(null);
|
|
50
53
|
}
|
|
51
54
|
});
|
|
52
55
|
const toggleNode = (nodeId) => {
|
|
@@ -170,16 +170,16 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
170
170
|
label: string;
|
|
171
171
|
disabled: boolean;
|
|
172
172
|
validation: "error" | "success" | "warning" | null | undefined;
|
|
173
|
-
validationText: string;
|
|
174
173
|
modelValue: any;
|
|
174
|
+
valueField: string;
|
|
175
|
+
placeholder: string;
|
|
175
176
|
searchbox: boolean;
|
|
177
|
+
validationText: string;
|
|
176
178
|
searchPlaceholder: string;
|
|
177
179
|
isOptionsOpen: boolean;
|
|
178
|
-
placeholder: string;
|
|
179
180
|
fullWidth: boolean;
|
|
180
181
|
closeOnSelect: boolean;
|
|
181
182
|
multiSelect: boolean;
|
|
182
|
-
valueField: string;
|
|
183
183
|
iconField: string;
|
|
184
184
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
185
185
|
declare const _default: typeof __VLS_export;
|
|
@@ -170,16 +170,16 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
170
170
|
label: string;
|
|
171
171
|
disabled: boolean;
|
|
172
172
|
validation: "error" | "success" | "warning" | null | undefined;
|
|
173
|
-
validationText: string;
|
|
174
173
|
modelValue: any;
|
|
174
|
+
valueField: string;
|
|
175
|
+
placeholder: string;
|
|
175
176
|
searchbox: boolean;
|
|
177
|
+
validationText: string;
|
|
176
178
|
searchPlaceholder: string;
|
|
177
179
|
isOptionsOpen: boolean;
|
|
178
|
-
placeholder: string;
|
|
179
180
|
fullWidth: boolean;
|
|
180
181
|
closeOnSelect: boolean;
|
|
181
182
|
multiSelect: boolean;
|
|
182
|
-
valueField: string;
|
|
183
183
|
iconField: string;
|
|
184
184
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
185
185
|
declare const _default: typeof __VLS_export;
|
|
@@ -111,4 +111,11 @@ export declare function useKTreePickerLogic(props: KTreePickerProps, emit: any):
|
|
|
111
111
|
closeDropdown: () => void;
|
|
112
112
|
filteredOptions: import("vue").ComputedRef<import("@katlux/providers").TDataRow[]>;
|
|
113
113
|
loading: import("vue").Ref<boolean, boolean>;
|
|
114
|
+
loadingMore: import("vue").ComputedRef<boolean>;
|
|
115
|
+
initialLoading: import("vue").ComputedRef<boolean>;
|
|
116
|
+
canLoadMore: import("vue").ComputedRef<boolean>;
|
|
117
|
+
loadMore: () => void;
|
|
118
|
+
virtualScroll: boolean;
|
|
119
|
+
itemHeight: number;
|
|
120
|
+
buffer: number;
|
|
114
121
|
};
|
|
@@ -63,7 +63,7 @@ export declare const KTreeViewDefaultProps: {
|
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
65
|
export declare function useKTreeViewLogic(props: KTreeViewProps): {
|
|
66
|
-
visibleRows: import("vue").ComputedRef<
|
|
66
|
+
visibleRows: import("vue").ComputedRef<any>;
|
|
67
67
|
expandedNodes: any;
|
|
68
68
|
selectedRows: import("vue").Ref<any[], any[]>;
|
|
69
69
|
selectAll: import("vue").Ref<boolean, boolean>;
|
|
@@ -41,11 +41,14 @@ export const KTreeViewDefaultProps = {
|
|
|
41
41
|
default: () => ({})
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
+
import { useDataProvider } from "../../composables/useDataProvider.js";
|
|
44
45
|
export function useKTreeViewLogic(props) {
|
|
46
|
+
const { pageData } = useDataProvider(props.dataProvider);
|
|
45
47
|
const selectedRows = ref([]);
|
|
46
48
|
const selectAll = ref(false);
|
|
47
49
|
const visibleRows = computed(() => {
|
|
48
|
-
|
|
50
|
+
const raw = props.dataProvider?.pageData?.value ?? props.dataProvider?.pageData ?? pageData.value;
|
|
51
|
+
return raw || [];
|
|
49
52
|
});
|
|
50
53
|
const toggleNode = (nodeId) => {
|
|
51
54
|
if (typeof props.dataProvider.toggleNode === "function") {
|