@katlux/toolkit 0.1.1-alpha.110 → 0.1.1-alpha.112

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 (139) hide show
  1. package/dist/compiled/composables/locales.mjs +195 -27
  2. package/dist/compiled/composables/useDataProvider.mjs +129 -82
  3. package/dist/compiled/composables/useDataProvider.spec.mjs +20 -1
  4. package/dist/compiled/composables/useKatluxContext.mjs +21 -0
  5. package/dist/compiled/composables/useKatluxContext.spec.mjs +63 -0
  6. package/dist/compiled/composables/useKatluxI18n.mjs +20 -9
  7. package/dist/compiled/composables/usePresetComponent.mjs +12 -3
  8. package/dist/compiled/composables/useRequestQueue.mjs +35 -0
  9. package/dist/compiled/utils/PresetResolver.mjs +21 -7
  10. package/dist/compiled/utils/TemplateResolver.mjs +11 -5
  11. package/dist/module.cjs +3 -31
  12. package/dist/module.json +1 -1
  13. package/dist/module.mjs +4 -32
  14. package/dist/runtime/components/KBulkActions/KBulkActions.logic.d.ts +1 -1
  15. package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +29 -2
  16. package/dist/runtime/components/KCombobox/KCombobox.global.vue +18 -1
  17. package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +29 -2
  18. package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +25 -0
  19. package/dist/runtime/components/KCombobox/KCombobox.logic.js +298 -15
  20. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +3 -3
  21. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +3 -3
  22. package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.d.ts +1 -1
  23. package/dist/runtime/components/KDatatable/KDataIterator.logic.d.ts +6 -5
  24. package/dist/runtime/components/KDatatable/KDataIterator.logic.js +48 -19
  25. package/dist/runtime/components/KDatatable/KDatatable.logic.d.ts +4 -3
  26. package/dist/runtime/components/KDatatable/KDatatable.logic.js +42 -18
  27. package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +5 -5
  28. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +5 -5
  29. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +5 -5
  30. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +5 -5
  31. package/dist/runtime/components/KGrid/KGrid.global.d.vue.ts +1 -1
  32. package/dist/runtime/components/KGrid/KGrid.global.vue.d.ts +1 -1
  33. package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +1 -1
  34. package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +1 -1
  35. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.d.vue.ts +1 -1
  36. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +1 -1
  37. package/dist/runtime/components/KModal/KModal.global.d.vue.ts +15 -2
  38. package/dist/runtime/components/KModal/KModal.global.vue +6 -1
  39. package/dist/runtime/components/KModal/KModal.global.vue.d.ts +15 -2
  40. package/dist/runtime/components/KModal/KModal.logic.d.ts +8 -2
  41. package/dist/runtime/components/KModal/KModal.logic.js +21 -3
  42. package/dist/runtime/components/KPagination/KPagination.global.vue +2 -0
  43. package/dist/runtime/components/KPagination/KPagination.logic.d.ts +2 -1
  44. package/dist/runtime/components/KPagination/KPagination.logic.js +10 -5
  45. package/dist/runtime/components/KTabs/KTabItem.logic.js +20 -5
  46. package/dist/runtime/components/KTabs/KTabs.logic.js +18 -2
  47. package/dist/runtime/components/KTextarea/KTextarea.global.d.vue.ts +1 -1
  48. package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +1 -1
  49. package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +1 -1
  50. package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +1 -1
  51. package/dist/runtime/components/KToast/KToast.global.d.vue.ts +1 -1
  52. package/dist/runtime/components/KToast/KToast.global.vue.d.ts +1 -1
  53. package/dist/runtime/components/KToast/KToast.logic.d.ts +1 -0
  54. package/dist/runtime/components/KToast/KToast.logic.js +19 -5
  55. package/dist/runtime/components/KTree/KTree.global.d.vue.ts +11 -2
  56. package/dist/runtime/components/KTree/KTree.global.vue +1 -0
  57. package/dist/runtime/components/KTree/KTree.global.vue.d.ts +11 -2
  58. package/dist/runtime/components/KTree/KTree.logic.d.ts +9 -4
  59. package/dist/runtime/components/KTree/KTree.logic.js +14 -8
  60. package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +2 -2
  61. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +2 -2
  62. package/dist/runtime/components/KTreePicker/KTreePicker.logic.d.ts +10 -0
  63. package/dist/runtime/components/KTreeView/KTreeView.global.d.vue.ts +28 -4
  64. package/dist/runtime/components/KTreeView/KTreeView.global.vue +15 -1
  65. package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +28 -4
  66. package/dist/runtime/components/KTreeView/KTreeView.logic.d.ts +18 -4
  67. package/dist/runtime/components/KTreeView/KTreeView.logic.js +28 -6
  68. package/dist/runtime/composables/locales.js +195 -27
  69. package/dist/runtime/composables/useDataProvider.d.ts +1 -1
  70. package/dist/runtime/composables/useDataProvider.js +129 -82
  71. package/dist/runtime/composables/useDebounce.d.ts +1 -1
  72. package/dist/runtime/composables/useKatluxContext.d.ts +13 -0
  73. package/dist/runtime/composables/useKatluxContext.js +21 -0
  74. package/dist/runtime/composables/useKatluxI18n.js +20 -9
  75. package/dist/runtime/composables/usePresetComponent.js +12 -3
  76. package/dist/runtime/composables/useRequestQueue.d.ts +25 -0
  77. package/dist/runtime/composables/useRequestQueue.js +35 -0
  78. package/dist/runtime/directives/clickOutside.d.ts +3 -2
  79. package/dist/runtime/directives/clickOutside.js +9 -2
  80. package/dist/runtime/hydration/NuxtHydrationAdapter.d.ts +10 -0
  81. package/dist/runtime/hydration/NuxtHydrationAdapter.js +88 -0
  82. package/dist/runtime/plugins/PresetPlugin.js +9 -1
  83. package/dist/runtime/plugins/nuxtCompatPlugin.d.ts +2 -3
  84. package/dist/runtime/plugins/nuxtCompatPlugin.js +6 -1
  85. package/dist/runtime/presets/default/components/KCalendar/KCalendar.d.vue.ts +1 -1
  86. package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue +1 -1
  87. package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue.d.ts +1 -1
  88. package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.d.vue.ts +1 -1
  89. package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue +1 -1
  90. package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue.d.ts +1 -1
  91. package/dist/runtime/presets/default/components/KCalendar/KCalendarWeek.d.vue.ts +1 -1
  92. package/dist/runtime/presets/default/components/KCalendar/KCalendarWeek.vue +1 -1
  93. package/dist/runtime/presets/default/components/KCalendar/KCalendarWeek.vue.d.ts +1 -1
  94. package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue +24 -2
  95. package/dist/runtime/presets/default/components/KCombobox/KCombobox.d.vue.ts +19 -2
  96. package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue +42 -8
  97. package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue.d.ts +19 -2
  98. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.d.vue.ts +19 -2
  99. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue +203 -12
  100. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue.d.ts +19 -2
  101. package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.d.vue.ts +1 -1
  102. package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.vue +1 -1
  103. package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.vue.d.ts +1 -1
  104. package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +1 -0
  105. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.d.vue.ts +1 -1
  106. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue +1 -1
  107. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue.d.ts +1 -1
  108. package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.d.vue.ts +1 -1
  109. package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue +1 -1
  110. package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue.d.ts +1 -1
  111. package/dist/runtime/presets/default/components/KGantt/KGantt.vue +1 -20
  112. package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.d.vue.ts +2 -2
  113. package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue +2 -2
  114. package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue.d.ts +2 -2
  115. package/dist/runtime/presets/default/components/KLoader/KLoader.vue +6 -2
  116. package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue +1 -1
  117. package/dist/runtime/presets/default/components/KModal/KModal.vue +16 -4
  118. package/dist/runtime/presets/default/components/KPagination/KPagination.d.vue.ts +1 -0
  119. package/dist/runtime/presets/default/components/KPagination/KPagination.vue +5 -4
  120. package/dist/runtime/presets/default/components/KPagination/KPagination.vue.d.ts +1 -0
  121. package/dist/runtime/presets/default/components/KRangeSlider/KRangeSlider.vue +3 -1
  122. package/dist/runtime/presets/default/components/KSlider/KSlider.vue +2 -1
  123. package/dist/runtime/presets/default/components/KTabs/KTabs.vue +2 -1
  124. package/dist/runtime/presets/default/components/KToast/KToast.d.vue.ts +1 -1
  125. package/dist/runtime/presets/default/components/KToast/KToast.vue +1 -1
  126. package/dist/runtime/presets/default/components/KToast/KToast.vue.d.ts +1 -1
  127. package/dist/runtime/presets/default/components/KTooltip/KTooltip.vue +2 -0
  128. package/dist/runtime/presets/default/components/KTree/KTree.d.vue.ts +20 -10
  129. package/dist/runtime/presets/default/components/KTree/KTree.vue +34 -24
  130. package/dist/runtime/presets/default/components/KTree/KTree.vue.d.ts +20 -10
  131. package/dist/runtime/presets/default/components/KTreeView/KTreeCell.vue +2 -1
  132. package/dist/runtime/presets/default/components/KTreeView/KTreeView.d.vue.ts +8 -2
  133. package/dist/runtime/presets/default/components/KTreeView/KTreeView.vue +10 -1
  134. package/dist/runtime/presets/default/components/KTreeView/KTreeView.vue.d.ts +8 -2
  135. package/dist/runtime/server/middleware/session.d.ts +2 -0
  136. package/dist/runtime/server/middleware/session.js +36 -0
  137. package/dist/runtime/utils/PresetResolver.js +21 -7
  138. package/dist/runtime/utils/TemplateResolver.js +11 -5
  139. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import type { ComboboxItem } from '../../../../components/KCombobox/KCombobox.logic.js';
1
+ import type { ComboboxItem } from '#toolkit/components/KCombobox/KCombobox.logic';
2
2
  type __VLS_Props = {
3
3
  label?: string;
4
4
  disabled: boolean;
@@ -15,8 +15,18 @@ type __VLS_Props = {
15
15
  selectItem: (option: ComboboxItem) => void;
16
16
  isSelected: (option: ComboboxItem) => boolean;
17
17
  loading: boolean;
18
+ loadingMore?: boolean;
19
+ initialLoading?: boolean;
20
+ canLoadMore?: boolean;
21
+ loadMore?: () => void;
22
+ virtualScroll?: boolean;
23
+ itemHeight?: number;
24
+ buffer?: number;
18
25
  teleportTo?: string;
19
26
  fullWidth: boolean;
27
+ highlightedIndex?: number;
28
+ onKeyDown?: (e: KeyboardEvent) => void;
29
+ setHighlightedIndex?: (idx: number) => void;
20
30
  validation?: 'success' | 'warning' | 'error' | null;
21
31
  validationText?: string;
22
32
  };
@@ -26,6 +36,13 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
26
36
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
27
37
  "onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
28
38
  "onUpdate:searchtext"?: ((value: string) => any) | undefined;
29
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
39
+ }>, {
40
+ loadingMore: boolean;
41
+ initialLoading: boolean;
42
+ canLoadMore: boolean;
43
+ virtualScroll: boolean;
44
+ itemHeight: number;
45
+ buffer: number;
46
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
47
  declare const _default: typeof __VLS_export;
31
48
  export default _default;
@@ -1,18 +1,35 @@
1
- import type { ComboboxItem } from '../../../../components/KCombobox/KCombobox.logic.js';
1
+ import type { ComboboxItem } from '#toolkit/components/KCombobox/KCombobox.logic';
2
2
  type __VLS_Props = {
3
3
  searchbox: boolean;
4
4
  searchtext: string;
5
5
  searchPlaceholder: string;
6
6
  loading: boolean;
7
+ loadingMore?: boolean;
8
+ initialLoading?: boolean;
9
+ canLoadMore?: boolean;
10
+ loadMore?: () => void;
11
+ virtualScroll?: boolean;
12
+ itemHeight?: number;
13
+ buffer?: number;
7
14
  filteredOptions: any[];
8
15
  labelField: string;
9
16
  selectItem: (option: ComboboxItem) => void;
10
17
  isSelected: (option: ComboboxItem) => boolean;
18
+ highlightedIndex?: number;
19
+ onKeyDown?: (e: KeyboardEvent) => void;
20
+ setHighlightedIndex?: (idx: number) => void;
11
21
  };
12
22
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
13
23
  "update:searchtext": (value: string) => any;
14
24
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
15
25
  "onUpdate:searchtext"?: ((value: string) => any) | undefined;
16
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
+ }>, {
27
+ loadingMore: boolean;
28
+ initialLoading: boolean;
29
+ canLoadMore: boolean;
30
+ virtualScroll: boolean;
31
+ itemHeight: number;
32
+ buffer: number;
33
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
34
  declare const _default: typeof __VLS_export;
18
35
  export default _default;
@@ -1,33 +1,70 @@
1
1
  <template lang="pug">
2
- .KCombobox__options-content
3
- KTextbox(v-if="searchbox" v-model="searchtextModel" :placeholder="searchPlaceholder" :showClear="true")
4
- .KCombobox__loading(v-if="loading")
2
+ .KCombobox__options-content(ref="contentRef")
3
+ KTextbox(v-if="searchbox" v-model="searchtextModel" :placeholder="searchPlaceholder" :showClear="true" @keydown="onKeyDown")
4
+ .KCombobox__loading(v-if="initialLoading || (loading && filteredOptions.length === 0)")
5
5
  .KCombobox__loading-spinner
6
- ul.KCombobox__options-list(v-else)
6
+ .KCombobox__empty(v-else-if="filteredOptions.length === 0")
7
+ span.KCombobox__empty-text {{ t('No result') }}
8
+ ul.KCombobox__options-list(
9
+ v-else
10
+ ref="listRef"
11
+ role="listbox"
12
+ :style="{ '--top-spacer': `${topSpacerHeight}px`, '--bottom-spacer': `${bottomSpacerHeight}px`, '--k-combobox-item-height': `${itemH}px` }"
13
+ @scroll.passive="onScroll"
14
+ )
15
+ li.KCombobox__virtual-spacer.is-top(v-if="topSpacerHeight > 0" role="presentation")
7
16
  li.KCombobox__options-list-item(
8
- v-for="option in filteredOptions"
9
- :key="option.value"
17
+ v-for="(option, index) in visibleOptions"
18
+ :key="getItemKey(option, startIndex + index)"
19
+ :id="'k-combobox-opt-' + (startIndex + index)"
20
+ role="option"
21
+ :aria-selected="isSelected(option) ? 'true' : 'false'"
22
+ :class="{ 'is-highlighted': (startIndex + index) === highlightedIndex }"
23
+ @mouseenter="setHighlightedIndex && setHighlightedIndex(startIndex + index)"
10
24
  @click.stop="selectItem(option)"
11
25
  )
12
26
  KGrid(align="center" justify="space-between" wrap="nowrap")
13
27
  span.KCombobox__options-list-item__text {{ option[labelField] }}
14
28
  KIcon(iconname="check" width="12" height="12" :class="{'visible': isSelected(option)}")
29
+ li.KCombobox__virtual-spacer.is-bottom(v-if="bottomSpacerHeight > 0" role="presentation")
30
+ li.KCombobox__loading-more(v-if="loadingMore" role="status")
31
+ .KCombobox__loading-spinner.is-small
15
32
  </template>
16
33
 
17
34
  <script lang="ts" setup>
18
- import { computed } from 'vue'
19
- import type { ComboboxItem } from '../../../../components/KCombobox/KCombobox.logic'
35
+ import { computed, ref, onMounted, onBeforeUnmount, watch } from 'vue'
36
+ import { useKatluxI18n } from '#toolkit/composables/useKatluxI18n'
37
+ import type { ComboboxItem } from '#toolkit/components/KCombobox/KCombobox.logic'
20
38
 
21
- const props = defineProps<{
39
+ const { t } = useKatluxI18n()
40
+
41
+ const props = withDefaults(defineProps<{
22
42
  searchbox: boolean
23
43
  searchtext: string
24
44
  searchPlaceholder: string
25
45
  loading: boolean
46
+ loadingMore?: boolean
47
+ initialLoading?: boolean
48
+ canLoadMore?: boolean
49
+ loadMore?: () => void
50
+ virtualScroll?: boolean
51
+ itemHeight?: number
52
+ buffer?: number
26
53
  filteredOptions: any[]
27
54
  labelField: string
28
55
  selectItem: (option: ComboboxItem) => void
29
56
  isSelected: (option: ComboboxItem) => boolean
30
- }>()
57
+ highlightedIndex?: number
58
+ onKeyDown?: (e: KeyboardEvent) => void
59
+ setHighlightedIndex?: (idx: number) => void
60
+ }>(), {
61
+ virtualScroll: true,
62
+ itemHeight: 40,
63
+ buffer: 5,
64
+ loadingMore: false,
65
+ initialLoading: false,
66
+ canLoadMore: false,
67
+ })
31
68
 
32
69
  const emit = defineEmits<{
33
70
  (e: 'update:searchtext', value: string): void
@@ -37,6 +74,120 @@ const searchtextModel = computed({
37
74
  get: () => props.searchtext,
38
75
  set: (value) => emit('update:searchtext', value)
39
76
  })
77
+
78
+ const contentRef = ref<HTMLElement | null>(null)
79
+ const listRef = ref<HTMLElement | null>(null)
80
+ const scrollTop = ref(0)
81
+ const containerHeight = ref(200)
82
+
83
+ const totalCount = computed(() => props.filteredOptions?.length || 0)
84
+ const itemH = computed(() => props.itemHeight || 40)
85
+ const buf = computed(() => props.buffer ?? 5)
86
+
87
+ const startIndex = computed(() => {
88
+ if (!props.virtualScroll) return 0
89
+ return Math.max(0, Math.floor(scrollTop.value / itemH.value) - buf.value)
90
+ })
91
+
92
+ const visibleCount = computed(() => {
93
+ if (!props.virtualScroll) return totalCount.value
94
+ return Math.ceil(containerHeight.value / itemH.value) + 2 * buf.value + 1
95
+ })
96
+
97
+ const endIndex = computed(() => {
98
+ if (!props.virtualScroll) return totalCount.value
99
+ return Math.min(totalCount.value, startIndex.value + visibleCount.value)
100
+ })
101
+
102
+ const visibleOptions = computed(() => {
103
+ if (!props.filteredOptions || props.filteredOptions.length === 0) return []
104
+ if (!props.virtualScroll) return props.filteredOptions
105
+ return props.filteredOptions.slice(startIndex.value, endIndex.value)
106
+ })
107
+
108
+ const topSpacerHeight = computed(() => {
109
+ if (!props.virtualScroll) return 0
110
+ return startIndex.value * itemH.value
111
+ })
112
+
113
+ const bottomSpacerHeight = computed(() => {
114
+ if (!props.virtualScroll) return 0
115
+ return Math.max(0, (totalCount.value - endIndex.value) * itemH.value)
116
+ })
117
+
118
+ function getItemKey(option: any, fallbackIndex: number): any {
119
+ if (!option) return fallbackIndex
120
+ if (option.id !== undefined) return option.id
121
+ if (option.value !== undefined) return option.value
122
+ if (props.labelField && option[props.labelField] !== undefined) {
123
+ return `${option[props.labelField]}-${fallbackIndex}`
124
+ }
125
+ return fallbackIndex
126
+ }
127
+
128
+ function onScroll(e: Event) {
129
+ const target = e.target as HTMLElement
130
+ if (!target) return
131
+ scrollTop.value = target.scrollTop
132
+
133
+ const threshold = 60
134
+ const distanceToBottom = target.scrollHeight - (target.scrollTop + target.clientHeight)
135
+ if (distanceToBottom <= threshold && props.canLoadMore && typeof props.loadMore === 'function') {
136
+ props.loadMore()
137
+ }
138
+ }
139
+
140
+ watch(() => props.searchtext, () => {
141
+ if (listRef.value) {
142
+ listRef.value.scrollTop = 0
143
+ scrollTop.value = 0
144
+ }
145
+ })
146
+
147
+ watch(() => props.highlightedIndex, (idx) => {
148
+ if (idx === undefined || idx < 0 || !listRef.value) return
149
+ const targetTop = idx * itemH.value
150
+ const targetBottom = targetTop + itemH.value
151
+ const currentTop = listRef.value.scrollTop
152
+ const currentBottom = currentTop + containerHeight.value
153
+ if (targetTop < currentTop) {
154
+ listRef.value.scrollTop = targetTop
155
+ } else if (targetBottom > currentBottom) {
156
+ listRef.value.scrollTop = Math.max(0, targetBottom - containerHeight.value)
157
+ }
158
+ })
159
+
160
+ let resizeObserver: ResizeObserver | null = null
161
+
162
+ onMounted(() => {
163
+ if (props.searchbox && typeof requestAnimationFrame !== 'undefined') {
164
+ requestAnimationFrame(() => {
165
+ const inputEl = contentRef.value?.querySelector('input')
166
+ inputEl?.focus()
167
+ })
168
+ }
169
+
170
+ if (listRef.value) {
171
+ containerHeight.value = listRef.value.clientHeight || 200
172
+ if (typeof ResizeObserver !== 'undefined') {
173
+ resizeObserver = new ResizeObserver((entries) => {
174
+ for (const entry of entries) {
175
+ if (entry.contentRect.height > 0) {
176
+ containerHeight.value = entry.contentRect.height
177
+ }
178
+ }
179
+ })
180
+ resizeObserver.observe(listRef.value)
181
+ }
182
+ }
183
+ })
184
+
185
+ onBeforeUnmount(() => {
186
+ if (resizeObserver) {
187
+ resizeObserver.disconnect()
188
+ resizeObserver = null
189
+ }
190
+ })
40
191
  </script>
41
192
 
42
193
  <style lang="scss" scoped>
@@ -53,14 +204,19 @@ const searchtextModel = computed({
53
204
  overflow-y: auto;
54
205
  flex: 1;
55
206
  min-height: 0;
207
+ margin: 0;
208
+ padding: 0;
209
+ list-style: none;
210
+
56
211
  &-item {
57
212
  cursor: pointer;
58
- height: 40px;
213
+ height: var(--k-combobox-item-height, 40px);
59
214
  padding: 10px;
60
215
  box-sizing: border-box;
61
216
 
62
217
  border-bottom: 1px solid var(--border-color-light);
63
- &:hover {
218
+ &:hover,
219
+ &.is-highlighted {
64
220
  background-color: var(--background-color-medium);
65
221
  }
66
222
  &:last-child {
@@ -83,6 +239,27 @@ const searchtextModel = computed({
83
239
  }
84
240
  }
85
241
 
242
+ .KCombobox__virtual-spacer {
243
+ list-style: none;
244
+ padding: 0;
245
+ margin: 0;
246
+ pointer-events: none;
247
+ border: none;
248
+ &.is-top {
249
+ height: var(--top-spacer, 0px);
250
+ }
251
+ &.is-bottom {
252
+ height: var(--bottom-spacer, 0px);
253
+ }
254
+ }
255
+
256
+ .KCombobox__empty {
257
+ padding: var(--component-gap);
258
+ text-align: center;
259
+ color: var(--font-color-secondary);
260
+ font-size: var(--font-size-sm, 0.875rem);
261
+ }
262
+
86
263
  .KCombobox__loading {
87
264
  padding: 10px;
88
265
  display: flex;
@@ -96,6 +273,12 @@ const searchtextModel = computed({
96
273
  border-top-color: var(--primary-color-500);
97
274
  border-radius: 50%;
98
275
  animation: spin 0.8s linear infinite;
276
+
277
+ &.is-small {
278
+ width: 16px;
279
+ height: 16px;
280
+ border-width: 2px;
281
+ }
99
282
  }
100
283
 
101
284
  @keyframes spin {
@@ -104,4 +287,12 @@ const searchtextModel = computed({
104
287
  }
105
288
  }
106
289
  }
290
+
291
+ .KCombobox__loading-more {
292
+ list-style: none;
293
+ padding: calc(var(--component-gap) / 2);
294
+ display: flex;
295
+ justify-content: center;
296
+ align-items: center;
297
+ }
107
298
  </style>
@@ -1,18 +1,35 @@
1
- import type { ComboboxItem } from '../../../../components/KCombobox/KCombobox.logic.js';
1
+ import type { ComboboxItem } from '#toolkit/components/KCombobox/KCombobox.logic';
2
2
  type __VLS_Props = {
3
3
  searchbox: boolean;
4
4
  searchtext: string;
5
5
  searchPlaceholder: string;
6
6
  loading: boolean;
7
+ loadingMore?: boolean;
8
+ initialLoading?: boolean;
9
+ canLoadMore?: boolean;
10
+ loadMore?: () => void;
11
+ virtualScroll?: boolean;
12
+ itemHeight?: number;
13
+ buffer?: number;
7
14
  filteredOptions: any[];
8
15
  labelField: string;
9
16
  selectItem: (option: ComboboxItem) => void;
10
17
  isSelected: (option: ComboboxItem) => boolean;
18
+ highlightedIndex?: number;
19
+ onKeyDown?: (e: KeyboardEvent) => void;
20
+ setHighlightedIndex?: (idx: number) => void;
11
21
  };
12
22
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
13
23
  "update:searchtext": (value: string) => any;
14
24
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
15
25
  "onUpdate:searchtext"?: ((value: string) => any) | undefined;
16
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
+ }>, {
27
+ loadingMore: boolean;
28
+ initialLoading: boolean;
29
+ canLoadMore: boolean;
30
+ virtualScroll: boolean;
31
+ itemHeight: number;
32
+ buffer: number;
33
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
34
  declare const _default: typeof __VLS_export;
18
35
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import type { ADataProvider } from '@katlux/providers';
2
- import type { ICompositeInputConfig } from '../../../../components/KCompositeInput/KCompositeInput.logic.js';
2
+ import type { ICompositeInputConfig } from '#toolkit/components/KCompositeInput/KCompositeInput.logic';
3
3
  type __VLS_Props = {
4
4
  label?: string;
5
5
  selectionValue: any;
@@ -83,7 +83,7 @@
83
83
  <script lang="ts" setup>
84
84
  import { computed } from 'vue'
85
85
  import type { ADataProvider } from '@katlux/providers'
86
- import type { ICompositeInputConfig } from '../../../../components/KCompositeInput/KCompositeInput.logic'
86
+ import type { ICompositeInputConfig } from '#toolkit/components/KCompositeInput/KCompositeInput.logic'
87
87
 
88
88
  const props = defineProps<{
89
89
  label?: string
@@ -1,5 +1,5 @@
1
1
  import type { ADataProvider } from '@katlux/providers';
2
- import type { ICompositeInputConfig } from '../../../../components/KCompositeInput/KCompositeInput.logic.js';
2
+ import type { ICompositeInputConfig } from '#toolkit/components/KCompositeInput/KCompositeInput.logic';
3
3
  type __VLS_Props = {
4
4
  label?: string;
5
5
  selectionValue: any;
@@ -45,6 +45,7 @@
45
45
  size="small"
46
46
  :type="rowAction.type || 'default'"
47
47
  :iconOnly="rowAction.iconOnly || !!rowAction.icon"
48
+ :aria-label="rowAction.label"
48
49
  @click="rowAction.action(row)"
49
50
  )
50
51
  template(#icon v-if="rowAction.icon")
@@ -1,4 +1,4 @@
1
- import type { IMarkedDay, IDefinedDay } from '../../../../components/KCalendar/types.js';
1
+ import type { IMarkedDay, IDefinedDay } from '#toolkit/components/KCalendar/types';
2
2
  type __VLS_Props = {
3
3
  label?: string;
4
4
  maskedModel: string;
@@ -22,7 +22,7 @@ const activatorRef = ref<HTMLElement | null>(null)
22
22
  import type {
23
23
  IMarkedDay,
24
24
  IDefinedDay,
25
- } from '../../../../components/KCalendar/types'
25
+ } from '#toolkit/components/KCalendar/types'
26
26
 
27
27
  const props = defineProps<{
28
28
  label?: string
@@ -1,4 +1,4 @@
1
- import type { IMarkedDay, IDefinedDay } from '../../../../components/KCalendar/types.js';
1
+ import type { IMarkedDay, IDefinedDay } from '#toolkit/components/KCalendar/types';
2
2
  type __VLS_Props = {
3
3
  label?: string;
4
4
  maskedModel: string;
@@ -1,4 +1,4 @@
1
- import type { IMarkedDay, IDefinedDay } from '../../../../components/KCalendar/types.js';
1
+ import type { IMarkedDay, IDefinedDay } from '#toolkit/components/KCalendar/types';
2
2
  type __VLS_Props = {
3
3
  label?: string;
4
4
  maskedModel: string;
@@ -26,7 +26,7 @@ const activatorRef = ref<HTMLElement | null>(null)
26
26
  import type {
27
27
  IMarkedDay,
28
28
  IDefinedDay,
29
- } from '../../../../components/KCalendar/types'
29
+ } from '#toolkit/components/KCalendar/types'
30
30
 
31
31
  const props = defineProps<{
32
32
  label?: string
@@ -1,4 +1,4 @@
1
- import type { IMarkedDay, IDefinedDay } from '../../../../components/KCalendar/types.js';
1
+ import type { IMarkedDay, IDefinedDay } from '#toolkit/components/KCalendar/types';
2
2
  type __VLS_Props = {
3
3
  label?: string;
4
4
  maskedModel: string;
@@ -182,8 +182,7 @@ const onTaskDragStart = (
182
182
  { event, task, rowId, mode, wrapperEl }: { event: MouseEvent; task: IGanttTask; rowId: any; mode: string; wrapperEl: HTMLElement | null },
183
183
  row: any
184
184
  ) => {
185
- console.log('[KGantt] onTaskDragStart called', { editable: props.editable, mode, taskId: task.id, wrapperElFound: !!wrapperEl })
186
- if (!props.editable) { console.warn('[KGantt] ABORT: not editable'); return }
185
+ if (!props.editable) { return }
187
186
  event.preventDefault()
188
187
 
189
188
  const wrapperRect = wrapperEl?.getBoundingClientRect()
@@ -266,14 +265,6 @@ const onMouseUp = () => {
266
265
  [endField]: state.currentEndMs
267
266
  }
268
267
 
269
- console.log('[KGantt] onMouseUp', {
270
- mode: state.mode,
271
- originalStart: new Date(state.originalStartMs).toISOString(),
272
- currentStart: new Date(state.currentStartMs).toISOString(),
273
- sameTime: state.currentStartMs === state.originalStartMs,
274
- wrapperWidth: state.wrapperWidth
275
- })
276
-
277
268
  let targetRow = state.sourceRow
278
269
 
279
270
  // Check if the task was moved to a different row
@@ -288,11 +279,9 @@ const onMouseUp = () => {
288
279
  if (resourceTypeField) {
289
280
  const myType = state.sourceRow?.[resourceTypeField]
290
281
  const theirType = hoverRow?.[resourceTypeField]
291
- console.log('[KGantt] cross-row check', { myType, theirType, taskType, taskTypeField })
292
282
 
293
283
  // If task has a specific type, it MUST match the target resource type
294
284
  if (taskType && theirType && taskType !== theirType) {
295
- console.warn('[KGantt] CANCEL: task type mismatch with target resource')
296
285
  activeDragState.value = null
297
286
  return
298
287
  }
@@ -300,7 +289,6 @@ const onMouseUp = () => {
300
289
  // Original logic: if source resource has a type, target must match (if resourceTypeField is set)
301
290
  // This covers the case where the task doesn't have a type, but we still want to keep it within the same resource group
302
291
  if (myType && theirType && myType !== theirType) {
303
- console.warn('[KGantt] CANCEL: resource type mismatch')
304
292
  activeDragState.value = null
305
293
  return
306
294
  }
@@ -315,19 +303,12 @@ const onMouseUp = () => {
315
303
  : (targetRow?.[tasksField] || [])
316
304
 
317
305
  const overlapping = isTaskOverlapping(updatedTask, targetTasks, startField, endField)
318
- console.log('[KGantt] overlap check', {
319
- updatedTask: { id: updatedTask.id, start: (updatedTask as any)[startField], end: (updatedTask as any)[endField] },
320
- targetTaskCount: targetTasks.length,
321
- overlapping
322
- })
323
306
 
324
307
  if (overlapping) {
325
- console.warn('[KGantt] CANCEL: overlap detected')
326
308
  activeDragState.value = null
327
309
  return
328
310
  }
329
311
 
330
- console.log('[KGantt] COMMIT: emitting update:task')
331
312
  emit('update:task', {
332
313
 
333
314
  task: updatedTask,
@@ -17,11 +17,11 @@ type __VLS_Props = {
17
17
  validationText?: string;
18
18
  };
19
19
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
20
- "update:isOpen": (value: boolean) => any;
21
20
  "update:maskedModel": (value: string) => any;
21
+ "update:isOpen": (value: boolean) => any;
22
22
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
23
- "onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
24
23
  "onUpdate:maskedModel"?: ((value: string) => any) | undefined;
24
+ "onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
25
25
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
26
  declare const _default: typeof __VLS_export;
27
27
  export default _default;
@@ -32,8 +32,8 @@
32
32
  <script lang="ts" setup>
33
33
  import { ref, computed } from 'vue'
34
34
  const activatorRef = ref<HTMLElement | null>(null)
35
- import KHourSelect from '../../../../components/KHourSelect/KHourSelect.global.vue'
36
- import KMaskTextbox from '../../../../components/KMaskTextbox/KMaskTextbox.global.vue'
35
+ import KHourSelect from '#toolkit/components/KHourSelect/KHourSelect.global.vue'
36
+ import KMaskTextbox from '#toolkit/components/KMaskTextbox/KMaskTextbox.global.vue'
37
37
 
38
38
  const props = defineProps<{
39
39
  label?: string
@@ -17,11 +17,11 @@ type __VLS_Props = {
17
17
  validationText?: string;
18
18
  };
19
19
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
20
- "update:isOpen": (value: boolean) => any;
21
20
  "update:maskedModel": (value: string) => any;
21
+ "update:isOpen": (value: boolean) => any;
22
22
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
23
- "onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
24
23
  "onUpdate:maskedModel"?: ((value: string) => any) | undefined;
24
+ "onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
25
25
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
26
  declare const _default: typeof __VLS_export;
27
27
  export default _default;
@@ -14,12 +14,16 @@ const props = defineProps<{
14
14
  }>()
15
15
 
16
16
  const computedClasses = computed(() => {
17
- return {
17
+ const base = {
18
18
  'is-loading': props.loading,
19
19
  'is-overlay': props.overlay,
20
20
  [`is-${props.size || 'medium'}`]: true,
21
- ...props.loaderClasses
22
21
  }
22
+ if (!props.loaderClasses) return base
23
+ if (Array.isArray(props.loaderClasses)) {
24
+ return [base, ...props.loaderClasses]
25
+ }
26
+ return { ...base, ...props.loaderClasses }
23
27
  })
24
28
  </script>
25
29
 
@@ -15,7 +15,7 @@
15
15
  </template>
16
16
 
17
17
  <script lang="ts" setup>
18
- import { getMaskPatternDef } from '../../../../components/KMaskTextbox/KMaskTextbox.logic'
18
+ import { getMaskPatternDef } from '#toolkit/components/KMaskTextbox/KMaskTextbox.logic'
19
19
 
20
20
  const props = defineProps<{
21
21
  label?: string
@@ -1,6 +1,6 @@
1
1
  <template lang="pug">
2
2
  dialog.k-modal(ref="dialogRef" @close="closeModal" @click="handleBackdropClick" @mousedown="handleMouseDown" role="dialog" aria-modal="true" :aria-label="t('Dialog Window')")
3
- .modal-portal(:id="modalId" style="position: absolute; top: 0; left: 0; z-index: 9999; pointer-events: none;")
3
+ .modal-portal(:id="modalId")
4
4
  KPanel(no-gap flex-content scrollable).modal-container
5
5
  template(#header)
6
6
  slot(name="header")
@@ -29,15 +29,19 @@ let isMouseDownOnBackdrop = false
29
29
  watch(() => props.opened, (isOpen) => {
30
30
  if (!dialogRef.value) return
31
31
  if (isOpen) {
32
- dialogRef.value.showModal()
32
+ if (!dialogRef.value.open) {
33
+ dialogRef.value.showModal()
34
+ }
33
35
  } else {
34
- dialogRef.value.close()
36
+ if (dialogRef.value.open) {
37
+ dialogRef.value.close()
38
+ }
35
39
  }
36
40
  })
37
41
 
38
42
  // Sync the initial state if the modal was initially rendered as opened
39
43
  onMounted(() => {
40
- if (props.opened && dialogRef.value) {
44
+ if (props.opened && dialogRef.value && !dialogRef.value.open) {
41
45
  dialogRef.value.showModal()
42
46
  }
43
47
  })
@@ -81,6 +85,14 @@ const handleBackdropClick = (event: MouseEvent) => {
81
85
  backdrop-filter: blur(var(--modal-backdrop-blur));
82
86
  }
83
87
 
88
+ .modal-portal {
89
+ position: absolute;
90
+ top: 0;
91
+ left: 0;
92
+ z-index: 9999;
93
+ pointer-events: none;
94
+ }
95
+
84
96
  .modal-container {
85
97
  flex: 1;
86
98
  display: flex;
@@ -1,5 +1,6 @@
1
1
  type __VLS_Props = {
2
2
  dp: any;
3
+ currentPage: number;
3
4
  totalPages: number;
4
5
  getPageHref: (page: number) => string | undefined;
5
6
  visiblePages: number[];