@katlux/toolkit 0.1.1-alpha.144 → 0.1.1-alpha.146
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/bin/ai-init.mjs +517 -0
- package/bin/ai-tokens.mjs +1043 -0
- package/bin/cli.mjs +80 -43
- package/bin/create-preset.mjs +1 -0
- package/bin/preset-contracts.json +2941 -0
- package/dist/compiled/composables/locales.mjs +204 -25
- package/dist/compiled/composables/useDataProvider.mjs +36 -25
- package/dist/compiled/composables/useFilterLogic.mjs +10 -2
- package/dist/compiled/composables/useKatluxForm.mjs +6 -4
- package/dist/compiled/composables/useVirtualDataset.mjs +689 -0
- package/dist/compiled/composables/useVirtualScroll.mjs +29 -9
- package/dist/module.cjs +63 -77
- package/dist/module.d.cts +5 -0
- package/dist/module.d.mts +4 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +60 -78
- package/dist/runtime/components/KAccordion/KAccordion.global.d.vue.ts +2 -2
- package/dist/runtime/components/KAccordion/KAccordion.global.vue.d.ts +2 -2
- package/dist/runtime/components/KAlert/KAlert.global.d.vue.ts +1 -1
- package/dist/runtime/components/KAlert/KAlert.global.vue.d.ts +1 -1
- package/dist/runtime/components/KBulkActions/KBulkActions.global.d.vue.ts +7 -3
- package/dist/runtime/components/KBulkActions/KBulkActions.global.vue +4 -1
- package/dist/runtime/components/KBulkActions/KBulkActions.global.vue.d.ts +7 -3
- package/dist/runtime/components/KBulkActions/KBulkActions.logic.d.ts +4 -2
- package/dist/runtime/components/KBulkActions/KBulkActions.logic.js +70 -37
- package/dist/runtime/components/KButton/KButton.global.d.vue.ts +2 -2
- package/dist/runtime/components/KButton/KButton.global.vue.d.ts +2 -2
- package/dist/runtime/components/KButton/KButton.logic.d.ts +1 -1
- package/dist/runtime/components/KCalendar/KCalendar.global.d.vue.ts +19 -10
- package/dist/runtime/components/KCalendar/KCalendar.global.vue +7 -2
- package/dist/runtime/components/KCalendar/KCalendar.global.vue.d.ts +19 -10
- package/dist/runtime/components/KCalendar/KCalendar.logic.d.ts +14 -201
- package/dist/runtime/components/KCalendar/KCalendar.logic.js +60 -11
- package/dist/runtime/components/KCalendar/KCalendarMonth.global.d.vue.ts +25 -5
- package/dist/runtime/components/KCalendar/KCalendarMonth.global.vue +11 -1
- package/dist/runtime/components/KCalendar/KCalendarMonth.global.vue.d.ts +25 -5
- package/dist/runtime/components/KCalendar/KCalendarMonth.logic.d.ts +19 -3
- package/dist/runtime/components/KCalendar/KCalendarMonth.logic.js +115 -1
- package/dist/runtime/components/KCheckbox/KCheckbox.global.d.vue.ts +2 -2
- package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +2 -2
- package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +9 -9
- package/dist/runtime/components/KCombobox/KCombobox.global.vue +1 -1
- package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +9 -9
- package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +7 -1
- package/dist/runtime/components/KCombobox/KCombobox.logic.js +1 -1
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +14 -14
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +14 -14
- package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.d.ts +3 -3
- package/dist/runtime/components/KContextMenu/KContextMenu.logic.js +5 -0
- package/dist/runtime/components/KDatatable/KDataIterator.global.d.vue.ts +22 -18
- package/dist/runtime/components/KDatatable/KDataIterator.global.vue +23 -16
- package/dist/runtime/components/KDatatable/KDataIterator.global.vue.d.ts +22 -18
- package/dist/runtime/components/KDatatable/KDataIterator.logic.d.ts +13 -10
- package/dist/runtime/components/KDatatable/KDataIterator.logic.js +25 -20
- package/dist/runtime/components/KDatatable/KDatatable.global.d.vue.ts +9 -13
- package/dist/runtime/components/KDatatable/KDatatable.global.vue +6 -5
- package/dist/runtime/components/KDatatable/KDatatable.global.vue.d.ts +9 -13
- package/dist/runtime/components/KDatatable/KDatatable.logic.d.ts +4 -6
- package/dist/runtime/components/KDatatable/KDatatable.logic.js +26 -19
- package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +31 -15
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue +38 -13
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +31 -15
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.d.ts +28 -6
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.js +197 -53
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +3 -3
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +3 -3
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.js +2 -0
- 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/KGantt/KGantt.global.d.vue.ts +55 -6
- package/dist/runtime/components/KGantt/KGantt.global.vue +12 -3
- package/dist/runtime/components/KGantt/KGantt.global.vue.d.ts +55 -6
- package/dist/runtime/components/KGantt/KGantt.logic.d.ts +33 -5
- package/dist/runtime/components/KGantt/KGantt.logic.js +39 -6
- package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +2 -2
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +2 -2
- package/dist/runtime/components/KHourSelect/KHourSelect.global.d.vue.ts +1 -1
- package/dist/runtime/components/KHourSelect/KHourSelect.global.vue.d.ts +1 -1
- package/dist/runtime/components/KLoader/KLoader.global.vue +2 -0
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.d.vue.ts +2 -2
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +2 -2
- package/dist/runtime/components/KMultiTabs/MultiTabs.global.d.vue.ts +23 -0
- package/dist/runtime/components/KMultiTabs/MultiTabs.global.vue +22 -0
- package/dist/runtime/components/KMultiTabs/MultiTabs.global.vue.d.ts +23 -0
- package/dist/runtime/components/KPagination/KPagination.global.d.vue.ts +4 -2
- package/dist/runtime/components/KPagination/KPagination.global.vue +2 -1
- package/dist/runtime/components/KPagination/KPagination.global.vue.d.ts +4 -2
- package/dist/runtime/components/KPagination/KPagination.logic.d.ts +1 -0
- package/dist/runtime/components/KPagination/KPagination.logic.js +57 -5
- package/dist/runtime/components/KRadiobox/KRadiobox.global.d.vue.ts +1 -1
- package/dist/runtime/components/KRadiobox/KRadiobox.global.vue.d.ts +1 -1
- package/dist/runtime/components/KRangeSlider/KRangeSlider.global.d.vue.ts +1 -1
- package/dist/runtime/components/KRangeSlider/KRangeSlider.global.vue.d.ts +1 -1
- 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/KTabs/KTabs.global.d.vue.ts +2 -2
- package/dist/runtime/components/KTabs/KTabs.global.vue.d.ts +2 -2
- package/dist/runtime/components/KTextarea/KTextarea.global.d.vue.ts +2 -2
- package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +2 -2
- package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +3 -3
- package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +3 -3
- package/dist/runtime/components/KToast/KToast.global.d.vue.ts +3 -3
- package/dist/runtime/components/KToast/KToast.global.vue.d.ts +3 -3
- package/dist/runtime/components/KTooltip/KTooltip.global.d.vue.ts +1 -1
- package/dist/runtime/components/KTooltip/KTooltip.global.vue.d.ts +1 -1
- package/dist/runtime/components/KTree/KTree.global.d.vue.ts +7 -7
- package/dist/runtime/components/KTree/KTree.global.vue.d.ts +7 -7
- package/dist/runtime/components/KTree/KTree.logic.d.ts +2 -2
- package/dist/runtime/components/KTree/KTree.logic.js +16 -12
- package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +7 -9
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue +1 -5
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +7 -9
- package/dist/runtime/components/KTreeView/KTreeView.global.d.vue.ts +39 -5
- package/dist/runtime/components/KTreeView/KTreeView.global.vue +19 -1
- package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +39 -5
- package/dist/runtime/components/KTreeView/KTreeView.logic.d.ts +23 -3
- package/dist/runtime/components/KTreeView/KTreeView.logic.js +76 -6
- package/dist/runtime/composables/locales.js +204 -25
- package/dist/runtime/composables/useDataProvider.d.ts +5 -3
- package/dist/runtime/composables/useDataProvider.js +36 -25
- package/dist/runtime/composables/useFilterLogic.d.ts +16 -4
- package/dist/runtime/composables/useFilterLogic.js +10 -2
- package/dist/runtime/composables/useKatluxForm.d.ts +4 -4
- package/dist/runtime/composables/useKatluxForm.js +6 -4
- package/dist/runtime/composables/useSortLogic.d.ts +1 -1
- package/dist/runtime/composables/useVirtualDataset.d.ts +121 -0
- package/dist/runtime/composables/useVirtualDataset.js +689 -0
- package/dist/runtime/composables/useVirtualScroll.d.ts +8 -4
- package/dist/runtime/composables/useVirtualScroll.js +29 -9
- package/dist/runtime/plugins/nuxtCompatPlugin.js +9 -1
- package/dist/runtime/presets/default/assets/scss/css-variables.css +3 -0
- package/dist/runtime/presets/default/assets/scss/css-variables.scss +6 -1
- package/dist/runtime/presets/default/assets/scss/index.css +3 -0
- package/dist/runtime/presets/default/assets/svg/katlux-logo.svg +7 -0
- package/dist/runtime/presets/default/assets/svg/katlux.svg +6 -0
- package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.d.vue.ts +3 -2
- package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue +31 -3
- package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue.d.ts +3 -2
- package/dist/runtime/presets/default/components/KCalendar/KCalendar.d.vue.ts +3 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue +6 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue.d.ts +3 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.d.vue.ts +5 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue +33 -2
- package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue.d.ts +5 -0
- package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.d.vue.ts +2 -2
- package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue.d.ts +2 -2
- package/dist/runtime/presets/default/components/KContextMenu/KContextMenu.vue +7 -1
- package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.d.vue.ts +30 -8
- package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.vue +80 -164
- package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.vue.d.ts +30 -8
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.d.vue.ts +16 -9
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +99 -394
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue.d.ts +16 -9
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.d.vue.ts +6 -0
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue +71 -4
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue.d.ts +6 -0
- package/dist/runtime/presets/default/components/KGantt/KGantt.d.vue.ts +11 -12
- package/dist/runtime/presets/default/components/KGantt/KGantt.vue +77 -14
- package/dist/runtime/presets/default/components/KGantt/KGantt.vue.d.ts +11 -12
- package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue +1 -0
- package/dist/runtime/presets/default/components/KToast/KToast.d.vue.ts +2 -2
- package/dist/runtime/presets/default/components/KToast/KToast.vue.d.ts +2 -2
- package/dist/runtime/presets/default/components/KTree/KTree.d.vue.ts +4 -4
- package/dist/runtime/presets/default/components/KTree/KTree.vue +48 -14
- package/dist/runtime/presets/default/components/KTree/KTree.vue.d.ts +4 -4
- package/dist/runtime/presets/default/components/KTreeView/KTreeView.d.vue.ts +11 -2
- package/dist/runtime/presets/default/components/KTreeView/KTreeView.vue +14 -2
- package/dist/runtime/presets/default/components/KTreeView/KTreeView.vue.d.ts +11 -2
- package/dist/skills/KATLUX_INDEX.md +9 -6
- package/dist/skills/katlux-components/SKILL.md +2 -0
- package/dist/skills/katlux-components/components/KBulkActions.md +25 -1
- package/dist/skills/katlux-components/components/KCombobox.md +2 -2
- package/dist/skills/katlux-components/components/KDataIterator.md +12 -4
- package/dist/skills/katlux-components/components/KDatatable.md +38 -0
- package/dist/skills/katlux-components/components/KDatePicker.md +3 -1
- package/dist/skills/katlux-components/components/KGantt.md +9 -0
- package/dist/skills/katlux-components/components/KIcon.md +1 -1
- package/dist/skills/katlux-components/components/KLineChart.md +3 -0
- package/dist/skills/katlux-components/components/KProductList.md +0 -1
- package/dist/skills/katlux-components/components/KScatterChart.md +3 -0
- package/dist/skills/katlux-components/components/KTreePicker.md +2 -1
- package/dist/skills/katlux-components/components/KTreeView.md +12 -0
- package/dist/skills/katlux-config/SKILL.md +19 -8
- package/dist/skills/katlux-presets/SKILL.md +121 -1
- package/dist/skills/katlux-presets/creating-a-preset.md +67 -0
- package/dist/skills/katlux-providers/SKILL.md +7 -5
- package/dist/skills/katlux-providers/providers/ADataProvider.md +16 -9
- package/dist/skills/katlux-providers/providers/CAPIFlatClientDataProvider.md +27 -3
- package/dist/skills/katlux-providers/providers/CAPIFlatServerDataProvider.md +11 -1
- package/dist/skills/katlux-providers/providers/CFlatClientDataProvider.md +19 -4
- package/dist/skills/katlux-providers/providers/CFlatServerDataProvider.md +4 -2
- package/dist/skills/katlux-providers/providers/CTreeClientDataProvider.md +2 -2
- package/dist/skills/katlux-providers/providers/RequestProvider.md +10 -0
- package/dist/skills/katlux-providers/providers/encryption-field-level.md +63 -19
- package/dist/skills/katlux-providers/providers/encryption-key-management.md +20 -2
- package/dist/skills/katlux-providers/providers/encryption-key-pinning.md +25 -11
- package/dist/skills/katlux-providers/providers/encryption-searchable.md +218 -0
- package/dist/skills/katlux-providers/providers/encryption-symmetric.md +25 -1
- package/dist/skills/katlux-providers/providers/encryption-threat-model.md +63 -0
- package/dist/skills/katlux-providers/providers/encryption.md +26 -1
- package/dist/skills/katlux-providers/providers/types.md +3 -1
- package/dist/skills/katlux-providers/providers/useDataProvider.md +2 -1
- package/dist/skills/katlux-providers/providers/useVirtualDataset.md +154 -0
- package/dist/skills/katlux-tokens/SKILL.md +2 -1
- package/dist/types.d.mts +1 -1
- package/package.json +9 -3
- package/bin/add-ai-reference.mjs +0 -259
|
@@ -9,7 +9,15 @@ export function useVirtualScroll(options) {
|
|
|
9
9
|
return unref(options.items) || [];
|
|
10
10
|
};
|
|
11
11
|
const allItems = computed(() => resolveItems());
|
|
12
|
-
const
|
|
12
|
+
const resolveTotalCount = () => {
|
|
13
|
+
if (options.totalCount !== void 0) {
|
|
14
|
+
if (typeof options.totalCount === "function") return options.totalCount();
|
|
15
|
+
const val = unref(options.totalCount);
|
|
16
|
+
return typeof val === "number" && val >= 0 ? val : 0;
|
|
17
|
+
}
|
|
18
|
+
return allItems.value.length;
|
|
19
|
+
};
|
|
20
|
+
const totalCount = computed(() => resolveTotalCount());
|
|
13
21
|
const isVirtual = computed(() => {
|
|
14
22
|
if (options.virtualScroll === void 0) return false;
|
|
15
23
|
return unref(options.virtualScroll) === true;
|
|
@@ -24,11 +32,11 @@ export function useVirtualScroll(options) {
|
|
|
24
32
|
});
|
|
25
33
|
const defaultHeight = 40;
|
|
26
34
|
const getItemHeight = (item, index) => {
|
|
27
|
-
|
|
28
|
-
|
|
35
|
+
const raw = unref(options.itemHeight);
|
|
36
|
+
if (typeof raw === "function") {
|
|
37
|
+
return raw(item, index);
|
|
29
38
|
}
|
|
30
|
-
|
|
31
|
-
return typeof h === "number" && h > 0 ? h : defaultHeight;
|
|
39
|
+
return typeof raw === "number" && raw > 0 ? raw : defaultHeight;
|
|
32
40
|
};
|
|
33
41
|
const baseItemHeight = computed(() => {
|
|
34
42
|
const h = unref(options.itemHeight);
|
|
@@ -79,15 +87,17 @@ export function useVirtualScroll(options) {
|
|
|
79
87
|
}
|
|
80
88
|
});
|
|
81
89
|
}
|
|
82
|
-
const isDynamicHeight = computed(() => typeof options.itemHeight === "function");
|
|
90
|
+
const isDynamicHeight = computed(() => typeof unref(options.itemHeight) === "function");
|
|
83
91
|
const rowOffsets = computed(() => {
|
|
84
92
|
if (!isDynamicHeight.value || colCount.value > 1) return [];
|
|
93
|
+
const count = totalCount.value;
|
|
85
94
|
const items = allItems.value;
|
|
86
|
-
const offsets = new Array(
|
|
95
|
+
const offsets = new Array(count + 1);
|
|
87
96
|
offsets[0] = 0;
|
|
88
97
|
let current = 0;
|
|
89
|
-
for (let i = 0; i <
|
|
90
|
-
|
|
98
|
+
for (let i = 0; i < count; i++) {
|
|
99
|
+
const item = items[i] ?? (typeof options.getItem === "function" ? options.getItem(i) : void 0);
|
|
100
|
+
current += getItemHeight(item, i);
|
|
91
101
|
offsets[i + 1] = current;
|
|
92
102
|
}
|
|
93
103
|
return offsets;
|
|
@@ -154,6 +164,16 @@ export function useVirtualScroll(options) {
|
|
|
154
164
|
});
|
|
155
165
|
const visibleItems = computed(() => {
|
|
156
166
|
if (!isVirtual.value) return allItems.value;
|
|
167
|
+
if (typeof options.getItem === "function") {
|
|
168
|
+
const start = startIndex.value;
|
|
169
|
+
const end = endIndex.value;
|
|
170
|
+
const count = Math.max(0, end - start);
|
|
171
|
+
const res = new Array(count);
|
|
172
|
+
for (let i = 0; i < count; i++) {
|
|
173
|
+
res[i] = options.getItem(start + i);
|
|
174
|
+
}
|
|
175
|
+
return res;
|
|
176
|
+
}
|
|
157
177
|
return allItems.value.slice(startIndex.value, endIndex.value);
|
|
158
178
|
});
|
|
159
179
|
const topSpacerHeight = computed(() => {
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { defineNuxtPlugin, useNuxtApp, useAsyncData, useNuxtData, clearNuxtData, useRoute, useRouter, onNuxtReady, useRequestEvent } from "#app";
|
|
2
|
-
import { setHydrationAdapter } from "@katlux/providers";
|
|
2
|
+
import { setHydrationAdapter, RequestProvider } from "@katlux/providers";
|
|
3
3
|
import { NuxtHydrationAdapter } from "../hydration/NuxtHydrationAdapter.js";
|
|
4
4
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
5
5
|
setHydrationAdapter(new NuxtHydrationAdapter());
|
|
6
|
+
RequestProvider.setContextResolver(() => {
|
|
7
|
+
try {
|
|
8
|
+
const evt = typeof useRequestEvent === "function" ? useRequestEvent() : null;
|
|
9
|
+
if (evt) return { event: evt };
|
|
10
|
+
} catch {
|
|
11
|
+
}
|
|
12
|
+
return null;
|
|
13
|
+
});
|
|
6
14
|
const _global = globalThis;
|
|
7
15
|
_global.useNuxtApp = useNuxtApp;
|
|
8
16
|
_global.useAsyncData = useAsyncData;
|
|
@@ -231,4 +231,7 @@
|
|
|
231
231
|
--button-hover-text-info: var(--button-text-info);
|
|
232
232
|
--button-hover-text-light: var(--button-text-light);
|
|
233
233
|
--button-hover-text-dark: var(--button-text-dark);
|
|
234
|
+
--calendar-range-bg: var(--primary-100);
|
|
235
|
+
--calendar-range-color: var(--primary-700);
|
|
236
|
+
--calendar-range-hover-bg: var(--primary-300);
|
|
234
237
|
}
|
|
@@ -321,4 +321,9 @@
|
|
|
321
321
|
--button-hover-text-info: var(--button-text-info);
|
|
322
322
|
--button-hover-text-light: var(--button-text-light);
|
|
323
323
|
--button-hover-text-dark: var(--button-text-dark);
|
|
324
|
-
|
|
324
|
+
|
|
325
|
+
// Calendar Range
|
|
326
|
+
--calendar-range-bg: var(--primary-100);
|
|
327
|
+
--calendar-range-color: var(--primary-700);
|
|
328
|
+
--calendar-range-hover-bg: var(--primary-300);
|
|
329
|
+
}
|
|
@@ -248,6 +248,9 @@ li {
|
|
|
248
248
|
--button-hover-text-info: var(--button-text-info);
|
|
249
249
|
--button-hover-text-light: var(--button-text-light);
|
|
250
250
|
--button-hover-text-dark: var(--button-text-dark);
|
|
251
|
+
--calendar-range-bg: var(--primary-100);
|
|
252
|
+
--calendar-range-color: var(--primary-700);
|
|
253
|
+
--calendar-range-hover-bg: var(--primary-300);
|
|
251
254
|
}
|
|
252
255
|
|
|
253
256
|
.content h2 {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg width="100%" height="100%" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect width="32" height="32" rx="7" fill="#09090B" />
|
|
3
|
+
<path d="M6 9.5L11 5.5V26.5H6V9.5Z" fill="#F8FAFC" />
|
|
4
|
+
<polygon points="13.5,15.2 20.5,5.5 26.5,5.5 17.5,15.2" fill="#06B6D4" />
|
|
5
|
+
<polygon points="13.5,17.2 18,17.2 26.5,26.5 21,26.5" fill="#A3E635" />
|
|
6
|
+
</svg>
|
|
7
|
+
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg width="100%" height="100%" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M6 9.5L11 5.5V26.5H6V9.5Z" fill="currentColor" />
|
|
3
|
+
<polygon points="13.5,15.2 20.5,5.5 26.5,5.5 17.5,15.2" fill="#06B6D4" />
|
|
4
|
+
<polygon points="13.5,17.2 18,17.2 26.5,26.5 21,26.5" fill="#A3E635" />
|
|
5
|
+
</svg>
|
|
6
|
+
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { CFlatClientDataProvider } from '@katlux/providers';
|
|
2
|
-
import type { IKDatatableAction } from '@katlux/providers';
|
|
2
|
+
import type { IKDatatableAction, IDataFilter } from '@katlux/providers';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
bulkActions: IKDatatableAction[];
|
|
5
5
|
selectedRows: any[];
|
|
6
6
|
selectAll: boolean;
|
|
7
7
|
unselectedRows?: any[];
|
|
8
|
-
|
|
8
|
+
totalCount?: number;
|
|
9
|
+
filter?: IDataFilter | null;
|
|
9
10
|
selected: any;
|
|
10
11
|
dp: CFlatClientDataProvider;
|
|
11
12
|
doAction: (action: any) => void;
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
template(#icon v-if="action.icon")
|
|
20
20
|
KIcon(:iconname="action.icon" :width="16" :height="16")
|
|
21
21
|
template(#default v-if="!action.iconOnly && !action.icon") {{action.label}}
|
|
22
|
-
.info {{
|
|
22
|
+
.info {{ infoText }}
|
|
23
23
|
</template>
|
|
24
24
|
|
|
25
25
|
<script setup lang="ts">
|
|
26
26
|
import { computed } from 'vue'
|
|
27
27
|
import { CFlatClientDataProvider } from '@katlux/providers'
|
|
28
|
-
import type { IKDatatableAction } from '@katlux/providers'
|
|
28
|
+
import type { IKDatatableAction, IDataFilter } from '@katlux/providers'
|
|
29
29
|
import { useKatluxI18n } from '#toolkit/composables/useKatluxI18n'
|
|
30
30
|
|
|
31
31
|
const { t } = useKatluxI18n()
|
|
@@ -35,12 +35,40 @@ const props = defineProps<{
|
|
|
35
35
|
selectedRows: any[]
|
|
36
36
|
selectAll: boolean
|
|
37
37
|
unselectedRows?: any[]
|
|
38
|
-
|
|
38
|
+
totalCount?: number
|
|
39
|
+
filter?: IDataFilter | null
|
|
39
40
|
selected: any
|
|
40
41
|
dp: CFlatClientDataProvider
|
|
41
42
|
doAction: (action: any) => void
|
|
42
43
|
}>()
|
|
43
44
|
|
|
45
|
+
const selectedCount = computed(() => {
|
|
46
|
+
if (props.selectAll) {
|
|
47
|
+
if (props.totalCount !== undefined) {
|
|
48
|
+
return Math.max(0, props.totalCount - (props.unselectedRows?.length || 0))
|
|
49
|
+
}
|
|
50
|
+
return props.selectedRows?.length || 0
|
|
51
|
+
}
|
|
52
|
+
return props.selectedRows?.length || 0
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
const infoText = computed(() => {
|
|
56
|
+
const excluded = props.unselectedRows?.length || 0
|
|
57
|
+
if (props.selectAll) {
|
|
58
|
+
if (props.totalCount !== undefined) {
|
|
59
|
+
if (excluded > 0) {
|
|
60
|
+
return t('{count} items selected ({excluded} excluded)', { count: selectedCount.value, excluded })
|
|
61
|
+
}
|
|
62
|
+
return t('{count} items selected', { count: selectedCount.value })
|
|
63
|
+
}
|
|
64
|
+
if (excluded > 0) {
|
|
65
|
+
return t('All items selected ({count} excluded)', { count: excluded })
|
|
66
|
+
}
|
|
67
|
+
return t('All items selected')
|
|
68
|
+
}
|
|
69
|
+
return t('{count} items selected', { count: selectedCount.value })
|
|
70
|
+
})
|
|
71
|
+
|
|
44
72
|
const emit = defineEmits<{
|
|
45
73
|
(e: 'update:selected', value: any): void
|
|
46
74
|
}>()
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { CFlatClientDataProvider } from '@katlux/providers';
|
|
2
|
-
import type { IKDatatableAction } from '@katlux/providers';
|
|
2
|
+
import type { IKDatatableAction, IDataFilter } from '@katlux/providers';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
bulkActions: IKDatatableAction[];
|
|
5
5
|
selectedRows: any[];
|
|
6
6
|
selectAll: boolean;
|
|
7
7
|
unselectedRows?: any[];
|
|
8
|
-
|
|
8
|
+
totalCount?: number;
|
|
9
|
+
filter?: IDataFilter | null;
|
|
9
10
|
selected: any;
|
|
10
11
|
dp: CFlatClientDataProvider;
|
|
11
12
|
doAction: (action: any) => void;
|
|
@@ -2,11 +2,14 @@ import type { IMarkedDay, IDefinedDay } from '#toolkit/components/KCalendar/type
|
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
view: string;
|
|
4
4
|
viewCount: number;
|
|
5
|
+
range?: boolean;
|
|
5
6
|
actualYear: any;
|
|
6
7
|
actualMonth: any;
|
|
7
8
|
activeDate: Date;
|
|
8
9
|
monthSelectedDay: any;
|
|
9
10
|
rawMarkedDays?: IMarkedDay[];
|
|
11
|
+
hoverDate?: Date | null;
|
|
12
|
+
onDayHover?: (date: Date | null) => void;
|
|
10
13
|
goToPrev: () => void;
|
|
11
14
|
goToNext: () => void;
|
|
12
15
|
getMonthName: (i: number) => string;
|
|
@@ -29,6 +29,9 @@
|
|
|
29
29
|
:definedDays="getExpandedDefinedDays(i)"
|
|
30
30
|
:markedDays="getExpandedMarkedDays(i)"
|
|
31
31
|
:selectedDay="monthSelectedDay"
|
|
32
|
+
:range="range"
|
|
33
|
+
:hoverDate="hoverDate"
|
|
34
|
+
@dayHover="onDayHover ? onDayHover($event) : null"
|
|
32
35
|
@dayClicked="dayClicked"
|
|
33
36
|
)
|
|
34
37
|
</template>
|
|
@@ -39,11 +42,14 @@ import type { IMarkedDay, IDefinedDay } from '#toolkit/components/KCalendar/type
|
|
|
39
42
|
const props = defineProps<{
|
|
40
43
|
view: string
|
|
41
44
|
viewCount: number
|
|
45
|
+
range?: boolean
|
|
42
46
|
actualYear: any
|
|
43
47
|
actualMonth: any
|
|
44
48
|
activeDate: Date
|
|
45
49
|
monthSelectedDay: any
|
|
46
50
|
rawMarkedDays?: IMarkedDay[]
|
|
51
|
+
hoverDate?: Date | null
|
|
52
|
+
onDayHover?: (date: Date | null) => void
|
|
47
53
|
goToPrev: () => void
|
|
48
54
|
goToNext: () => void
|
|
49
55
|
getMonthName: (i: number) => string
|
|
@@ -2,11 +2,14 @@ import type { IMarkedDay, IDefinedDay } from '#toolkit/components/KCalendar/type
|
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
view: string;
|
|
4
4
|
viewCount: number;
|
|
5
|
+
range?: boolean;
|
|
5
6
|
actualYear: any;
|
|
6
7
|
actualMonth: any;
|
|
7
8
|
activeDate: Date;
|
|
8
9
|
monthSelectedDay: any;
|
|
9
10
|
rawMarkedDays?: IMarkedDay[];
|
|
11
|
+
hoverDate?: Date | null;
|
|
12
|
+
onDayHover?: (date: Date | null) => void;
|
|
10
13
|
goToPrev: () => void;
|
|
11
14
|
goToNext: () => void;
|
|
12
15
|
getMonthName: (i: number) => string;
|
|
@@ -6,6 +6,11 @@ type __VLS_Props = {
|
|
|
6
6
|
calendarDays: (number | string)[];
|
|
7
7
|
isMarked: (day: number | string) => boolean;
|
|
8
8
|
isSelectedDay: (day: number) => boolean;
|
|
9
|
+
isRangeStart?: (day: number) => boolean;
|
|
10
|
+
isRangeEnd?: (day: number) => boolean;
|
|
11
|
+
isInRange?: (day: number) => boolean;
|
|
12
|
+
onDayHover?: (day: number | string) => void;
|
|
13
|
+
onDayKeyDown?: (e: KeyboardEvent, day: number) => void;
|
|
9
14
|
getMarkedDayClass: (day: number) => string;
|
|
10
15
|
selectDay: (day: number) => void;
|
|
11
16
|
getCalendarDaysData: (day: number) => IMarkedDay[];
|
|
@@ -2,12 +2,18 @@
|
|
|
2
2
|
.KCalendarMonth
|
|
3
3
|
.calendar-header
|
|
4
4
|
.weekday(v-for="weekday of weekdays") {{weekday}}
|
|
5
|
-
.calendar-days
|
|
5
|
+
.calendar-days(@mouseleave="onDayHover ? onDayHover('') : null")
|
|
6
6
|
.day(
|
|
7
7
|
v-for="(day, index) of calendarDays"
|
|
8
8
|
:key="`${year}-${month}-${index}`"
|
|
9
|
-
:
|
|
9
|
+
:data-day="day || undefined"
|
|
10
|
+
:tabindex="day ? 0 : -1"
|
|
11
|
+
:role="day ? 'button' : undefined"
|
|
12
|
+
:aria-label="day ? `${year}-${month}-${day}` : undefined"
|
|
13
|
+
:class="[{ marked: isMarked(day), empty: !day, selected: isSelectedDay(day), 'range-start': isRangeStart && isRangeStart(day), 'range-end': isRangeEnd && isRangeEnd(day), 'in-range': isInRange && isInRange(day) }, getMarkedDayClass(day)]"
|
|
10
14
|
@click="day ? selectDay(day) : null"
|
|
15
|
+
@keydown="day && onDayKeyDown ? onDayKeyDown($event, day) : null"
|
|
16
|
+
@mouseenter="day && onDayHover ? onDayHover(day) : null"
|
|
11
17
|
)
|
|
12
18
|
span.day-number(
|
|
13
19
|
v-if="day"
|
|
@@ -31,6 +37,11 @@ const props = defineProps<{
|
|
|
31
37
|
calendarDays: (number|string)[]
|
|
32
38
|
isMarked: (day: number | string) => boolean
|
|
33
39
|
isSelectedDay: (day: number) => boolean
|
|
40
|
+
isRangeStart?: (day: number) => boolean
|
|
41
|
+
isRangeEnd?: (day: number) => boolean
|
|
42
|
+
isInRange?: (day: number) => boolean
|
|
43
|
+
onDayHover?: (day: number | string) => void
|
|
44
|
+
onDayKeyDown?: (e: KeyboardEvent, day: number) => void
|
|
34
45
|
getMarkedDayClass: (day: number) => string
|
|
35
46
|
selectDay: (day: number) => void
|
|
36
47
|
getCalendarDaysData: (day: number) => IMarkedDay[]
|
|
@@ -182,6 +193,26 @@ const props = defineProps<{
|
|
|
182
193
|
height: 24px;
|
|
183
194
|
}
|
|
184
195
|
}
|
|
196
|
+
&.in-range {
|
|
197
|
+
background-color: var(--calendar-range-bg, var(--primary-100));
|
|
198
|
+
color: var(--calendar-range-color, var(--primary-700));
|
|
199
|
+
border-radius: 0;
|
|
200
|
+
|
|
201
|
+
&:hover {
|
|
202
|
+
background-color: var(--calendar-range-hover-bg, var(--primary-300));
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
&.range-start {
|
|
206
|
+
border-top-right-radius: 0;
|
|
207
|
+
border-bottom-right-radius: 0;
|
|
208
|
+
}
|
|
209
|
+
&.range-end {
|
|
210
|
+
border-top-left-radius: 0;
|
|
211
|
+
border-bottom-left-radius: 0;
|
|
212
|
+
}
|
|
213
|
+
&.range-start.range-end {
|
|
214
|
+
border-radius: 4px;
|
|
215
|
+
}
|
|
185
216
|
.marked-indicators-row {
|
|
186
217
|
position: absolute;
|
|
187
218
|
top: 2px;
|
|
@@ -6,6 +6,11 @@ type __VLS_Props = {
|
|
|
6
6
|
calendarDays: (number | string)[];
|
|
7
7
|
isMarked: (day: number | string) => boolean;
|
|
8
8
|
isSelectedDay: (day: number) => boolean;
|
|
9
|
+
isRangeStart?: (day: number) => boolean;
|
|
10
|
+
isRangeEnd?: (day: number) => boolean;
|
|
11
|
+
isInRange?: (day: number) => boolean;
|
|
12
|
+
onDayHover?: (day: number | string) => void;
|
|
13
|
+
onDayKeyDown?: (e: KeyboardEvent, day: number) => void;
|
|
9
14
|
getMarkedDayClass: (day: number) => string;
|
|
10
15
|
selectDay: (day: number) => void;
|
|
11
16
|
getCalendarDaysData: (day: number) => IMarkedDay[];
|
|
@@ -10,13 +10,13 @@ type __VLS_Props = {
|
|
|
10
10
|
indeterminate?: boolean;
|
|
11
11
|
};
|
|
12
12
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
13
|
-
blur: (event: FocusEvent) => any;
|
|
14
13
|
"update:modelValue": (value: any) => any;
|
|
14
|
+
blur: (event: FocusEvent) => any;
|
|
15
15
|
"update:model": (value: any) => any;
|
|
16
16
|
"update:indeterminate": (value: boolean) => any;
|
|
17
17
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
18
|
-
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
19
18
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
19
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
20
20
|
"onUpdate:model"?: ((value: any) => any) | undefined;
|
|
21
21
|
"onUpdate:indeterminate"?: ((value: boolean) => any) | undefined;
|
|
22
22
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -10,13 +10,13 @@ type __VLS_Props = {
|
|
|
10
10
|
indeterminate?: boolean;
|
|
11
11
|
};
|
|
12
12
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
13
|
-
blur: (event: FocusEvent) => any;
|
|
14
13
|
"update:modelValue": (value: any) => any;
|
|
14
|
+
blur: (event: FocusEvent) => any;
|
|
15
15
|
"update:model": (value: any) => any;
|
|
16
16
|
"update:indeterminate": (value: boolean) => any;
|
|
17
17
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
18
|
-
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
19
18
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
19
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
20
20
|
"onUpdate:model"?: ((value: any) => any) | undefined;
|
|
21
21
|
"onUpdate:indeterminate"?: ((value: boolean) => any) | undefined;
|
|
22
22
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
</template>
|
|
18
18
|
|
|
19
19
|
<script lang="ts" setup>
|
|
20
|
-
import { ref, computed, watch, nextTick, onBeforeUnmount } from 'vue'
|
|
20
|
+
import { ref, computed, watch, nextTick, onMounted, onBeforeUnmount } from 'vue'
|
|
21
21
|
import KPanel from '../KPanel/KPanel.vue'
|
|
22
22
|
|
|
23
23
|
defineOptions({
|
|
@@ -140,6 +140,12 @@ watch(() => props.open, (isOpen) => {
|
|
|
140
140
|
}
|
|
141
141
|
}, { immediate: true })
|
|
142
142
|
|
|
143
|
+
onMounted(() => {
|
|
144
|
+
if (sourceElementRef.value) {
|
|
145
|
+
emit('registerSourceRef', sourceElementRef.value)
|
|
146
|
+
}
|
|
147
|
+
})
|
|
148
|
+
|
|
143
149
|
onBeforeUnmount(() => {
|
|
144
150
|
if (typeof window !== 'undefined') {
|
|
145
151
|
window.removeEventListener('keydown', handleWindowKeydown)
|
|
@@ -1,35 +1,57 @@
|
|
|
1
1
|
import { ADataProvider } from '@katlux/providers';
|
|
2
|
-
import type { IKDatatableAction } from '@katlux/providers';
|
|
2
|
+
import type { IKDatatableAction, IDataFilter } from '@katlux/providers';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
dataProvider: ADataProvider;
|
|
5
5
|
visibleFields?: Array<string> | null;
|
|
6
6
|
rowActions?: Array<IKDatatableAction>;
|
|
7
7
|
bulkActions?: Array<IKDatatableAction>;
|
|
8
|
-
selectedRows
|
|
9
|
-
selectAll
|
|
8
|
+
selectedRows?: any[];
|
|
9
|
+
selectAll?: boolean;
|
|
10
|
+
selectAllScope?: 'page' | 'dataset';
|
|
11
|
+
unselectedRows?: any[];
|
|
12
|
+
filter?: IDataFilter | null;
|
|
10
13
|
loading?: boolean;
|
|
11
14
|
search?: string;
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
pageSize?: number;
|
|
16
|
+
currentPage?: number;
|
|
14
17
|
slots?: any;
|
|
15
18
|
virtualScroll?: boolean;
|
|
16
|
-
itemHeight?: number;
|
|
19
|
+
itemHeight?: number | ((row: any, index: number) => number);
|
|
20
|
+
gap?: number;
|
|
17
21
|
viewportHeight?: number;
|
|
18
22
|
buffer?: number;
|
|
19
|
-
|
|
23
|
+
urlPageParam?: string;
|
|
20
24
|
};
|
|
21
25
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
26
|
+
"update:currentPage": (value: number) => any;
|
|
27
|
+
"update:pageSize": (value: number) => any;
|
|
28
|
+
"update:search": (value: string) => any;
|
|
22
29
|
"update:selectedRows": (value: any[]) => any;
|
|
23
30
|
"update:selectAll": (value: boolean) => any;
|
|
31
|
+
"update:selectAllScope": (value: "page" | "dataset") => any;
|
|
32
|
+
"update:unselectedRows": (value: any[]) => any;
|
|
33
|
+
"update:filter": (value: IDataFilter | null) => any;
|
|
24
34
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
35
|
+
"onUpdate:currentPage"?: ((value: number) => any) | undefined;
|
|
36
|
+
"onUpdate:pageSize"?: ((value: number) => any) | undefined;
|
|
37
|
+
"onUpdate:search"?: ((value: string) => any) | undefined;
|
|
25
38
|
"onUpdate:selectedRows"?: ((value: any[]) => any) | undefined;
|
|
26
39
|
"onUpdate:selectAll"?: ((value: boolean) => any) | undefined;
|
|
40
|
+
"onUpdate:selectAllScope"?: ((value: "page" | "dataset") => any) | undefined;
|
|
41
|
+
"onUpdate:unselectedRows"?: ((value: any[]) => any) | undefined;
|
|
42
|
+
"onUpdate:filter"?: ((value: IDataFilter | null) => any) | undefined;
|
|
27
43
|
}>, {
|
|
44
|
+
filter: IDataFilter | null;
|
|
45
|
+
selectedRows: any[];
|
|
46
|
+
unselectedRows: any[];
|
|
47
|
+
selectAll: boolean;
|
|
28
48
|
virtualScroll: boolean;
|
|
29
|
-
itemHeight: number;
|
|
49
|
+
itemHeight: number | ((row: any, index: number) => number);
|
|
30
50
|
buffer: number;
|
|
31
51
|
viewportHeight: number;
|
|
52
|
+
selectAllScope: "page" | "dataset";
|
|
32
53
|
gap: number;
|
|
54
|
+
urlPageParam: string;
|
|
33
55
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
34
56
|
declare const _default: typeof __VLS_export;
|
|
35
57
|
export default _default;
|