@katlux/toolkit 0.1.1-alpha.146 → 0.1.1-alpha.147

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 (231) hide show
  1. package/README.md +32 -22
  2. package/bin/ai-init.mjs +71 -13
  3. package/bin/ai-tokens/adapters/antigravityAdapter.mjs +22 -0
  4. package/bin/ai-tokens/adapters/claudeCodeAdapter.mjs +192 -0
  5. package/bin/ai-tokens/adapters/codexAdapter.mjs +176 -0
  6. package/bin/ai-tokens/adapters/cursorAdapter.mjs +202 -0
  7. package/bin/ai-tokens/adapters/index.mjs +30 -0
  8. package/bin/ai-tokens/cliViews.mjs +301 -0
  9. package/bin/ai-tokens/formatAndDates.mjs +89 -0
  10. package/bin/ai-tokens/reportGenerator.mjs +232 -0
  11. package/bin/ai-tokens/transcriptParser.mjs +299 -0
  12. package/bin/ai-tokens.mjs +38 -1030
  13. package/bin/cli.mjs +14 -10
  14. package/bin/preset-contracts.json +66 -10
  15. package/dist/compiled/composables/locales/asianAndPacific.mjs +296 -0
  16. package/dist/compiled/composables/locales/northernAndEasternEuropean.mjs +342 -0
  17. package/dist/compiled/composables/locales/westernEuropean.mjs +268 -0
  18. package/dist/compiled/composables/locales.mjs +28 -895
  19. package/dist/compiled/composables/useDataProvider.mjs +3 -1
  20. package/dist/compiled/composables/useKatluxForm.mjs +7 -7
  21. package/dist/compiled/composables/usePresetComponent.mjs +2 -0
  22. package/dist/compiled/composables/useRequestQueue.mjs +3 -1
  23. package/dist/compiled/composables/useVirtualDataset.mjs +322 -354
  24. package/dist/compiled/composables/useVirtualScroll.mjs +69 -62
  25. package/dist/compiled/composables/virtualDataset/cacheStateHelpers.mjs +76 -0
  26. package/dist/compiled/composables/virtualDataset/keyboardNavHelpers.mjs +60 -0
  27. package/dist/compiled/composables/virtualDataset/treeSelectionHelpers.mjs +103 -0
  28. package/dist/compiled/composables/virtualDataset/types.mjs +0 -0
  29. package/dist/compiled/utils/deprecation.mjs +44 -0
  30. package/dist/compiled/utils/dom.mjs +124 -0
  31. package/dist/module.cjs +0 -5
  32. package/dist/module.json +1 -1
  33. package/dist/module.mjs +1 -6
  34. package/dist/runtime/app.config.d.ts +3 -0
  35. package/dist/runtime/components/KAccordion/KAccordion.global.d.vue.ts +1 -1
  36. package/dist/runtime/components/KAccordion/KAccordion.global.vue.d.ts +1 -1
  37. package/dist/runtime/components/KBulkActions/KBulkActions.logic.d.ts +8 -0
  38. package/dist/runtime/components/KBulkActions/KBulkActions.logic.js +21 -55
  39. package/dist/runtime/components/KButton/KButton.global.d.vue.ts +2 -2
  40. package/dist/runtime/components/KButton/KButton.global.vue.d.ts +2 -2
  41. package/dist/runtime/components/KButton/KButton.logic.d.ts +1 -1
  42. package/dist/runtime/components/KCalendar/KCalendar.global.d.vue.ts +4 -4
  43. package/dist/runtime/components/KCalendar/KCalendar.global.vue.d.ts +4 -4
  44. package/dist/runtime/components/KCalendar/KCalendar.logic.js +8 -4
  45. package/dist/runtime/components/KCalendar/KCalendarMonth.global.vue +4 -0
  46. package/dist/runtime/components/KCalendar/KCalendarMonth.logic.d.ts +2 -0
  47. package/dist/runtime/components/KCalendar/KCalendarMonth.logic.js +41 -26
  48. package/dist/runtime/components/KCalendar/recurringUtils.js +6 -5
  49. package/dist/runtime/components/KCheckbox/KCheckbox.global.d.vue.ts +1 -1
  50. package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +1 -1
  51. package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +17 -2
  52. package/dist/runtime/components/KCombobox/KCombobox.global.vue +9 -4
  53. package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +17 -2
  54. package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +10 -2
  55. package/dist/runtime/components/KCombobox/KCombobox.logic.js +32 -13
  56. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +7 -7
  57. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +7 -7
  58. package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.d.ts +3 -3
  59. package/dist/runtime/components/KContextMenu/KContextMenu.global.d.vue.ts +3 -3
  60. package/dist/runtime/components/KContextMenu/KContextMenu.global.vue +4 -1
  61. package/dist/runtime/components/KContextMenu/KContextMenu.global.vue.d.ts +3 -3
  62. package/dist/runtime/components/KContextMenu/KContextMenu.logic.d.ts +24 -4
  63. package/dist/runtime/components/KContextMenu/KContextMenu.logic.js +43 -27
  64. package/dist/runtime/components/KDatatable/KDataIterator.global.d.vue.ts +25 -2
  65. package/dist/runtime/components/KDatatable/KDataIterator.global.vue +19 -7
  66. package/dist/runtime/components/KDatatable/KDataIterator.global.vue.d.ts +25 -2
  67. package/dist/runtime/components/KDatatable/KDataIterator.logic.d.ts +20 -0
  68. package/dist/runtime/components/KDatatable/KDataIterator.logic.js +54 -14
  69. package/dist/runtime/components/KDatatable/KDatatable.global.d.vue.ts +1 -1
  70. package/dist/runtime/components/KDatatable/KDatatable.global.vue.d.ts +1 -1
  71. package/dist/runtime/components/KDatatable/KDatatable.logic.js +6 -5
  72. package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +5 -3
  73. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue +45 -26
  74. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +5 -3
  75. package/dist/runtime/components/KDatePicker/KDatePicker.logic.d.ts +2 -0
  76. package/dist/runtime/components/KDatePicker/KDatePicker.logic.js +66 -20
  77. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +2 -2
  78. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +2 -2
  79. package/dist/runtime/components/KDropdown/KDropdown.global.d.vue.ts +4 -4
  80. package/dist/runtime/components/KDropdown/KDropdown.global.vue.d.ts +4 -4
  81. package/dist/runtime/components/KDropdown/KDropdown.logic.d.ts +3 -2
  82. package/dist/runtime/components/KDropdown/KDropdown.logic.js +14 -13
  83. package/dist/runtime/components/KGantt/KGantt.global.d.vue.ts +3 -1
  84. package/dist/runtime/components/KGantt/KGantt.global.vue +7 -1
  85. package/dist/runtime/components/KGantt/KGantt.global.vue.d.ts +3 -1
  86. package/dist/runtime/components/KGrid/KGrid.global.d.vue.ts +1 -1
  87. package/dist/runtime/components/KGrid/KGrid.global.vue.d.ts +1 -1
  88. package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +1 -1
  89. package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +1 -1
  90. package/dist/runtime/components/KIcon/KIcon.global.d.vue.ts +1 -1
  91. package/dist/runtime/components/KIcon/KIcon.global.vue.d.ts +1 -1
  92. package/dist/runtime/components/KLayout/KLayout.global.d.vue.ts +4 -1
  93. package/dist/runtime/components/KLayout/KLayout.global.vue +4 -1
  94. package/dist/runtime/components/KLayout/KLayout.global.vue.d.ts +4 -1
  95. package/dist/runtime/components/KLoader/KLoader.global.d.vue.ts +9 -0
  96. package/dist/runtime/components/KLoader/KLoader.global.vue +1 -0
  97. package/dist/runtime/components/KLoader/KLoader.global.vue.d.ts +9 -0
  98. package/dist/runtime/components/KLoader/KLoader.logic.d.ts +5 -0
  99. package/dist/runtime/components/KLoader/KLoader.logic.js +4 -0
  100. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.d.vue.ts +1 -1
  101. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +1 -1
  102. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.logic.js +30 -7
  103. package/dist/runtime/components/KMultiTabs/KMultiTabs.logic.d.ts +1 -0
  104. package/dist/runtime/components/KMultiTabs/MultiTabs.global.vue +6 -4
  105. package/dist/runtime/components/KPagination/KPagination.logic.d.ts +1 -1
  106. package/dist/runtime/components/KPagination/KPagination.logic.js +17 -9
  107. package/dist/runtime/components/KRadiobox/KRadiobox.global.d.vue.ts +1 -1
  108. package/dist/runtime/components/KRadiobox/KRadiobox.global.vue.d.ts +1 -1
  109. package/dist/runtime/components/KTabs/KTabs.logic.js +33 -11
  110. package/dist/runtime/components/KTextarea/KTextarea.global.d.vue.ts +2 -2
  111. package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +2 -2
  112. package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +14 -3
  113. package/dist/runtime/components/KTextbox/KTextbox.global.vue +8 -2
  114. package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +14 -3
  115. package/dist/runtime/components/KTextbox/KTextbox.logic.d.ts +5 -0
  116. package/dist/runtime/components/KTextbox/KTextbox.logic.js +4 -0
  117. package/dist/runtime/components/KTooltip/KTooltip.global.d.vue.ts +1 -1
  118. package/dist/runtime/components/KTooltip/KTooltip.global.vue.d.ts +1 -1
  119. package/dist/runtime/components/KTooltip/KTooltip.logic.d.ts +11 -2
  120. package/dist/runtime/components/KTooltip/KTooltip.logic.js +7 -5
  121. package/dist/runtime/components/KTree/KTree.global.d.vue.ts +1 -1
  122. package/dist/runtime/components/KTree/KTree.global.vue.d.ts +1 -1
  123. package/dist/runtime/components/KTree/KTree.logic.js +21 -1
  124. package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +8 -4
  125. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue +4 -2
  126. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +8 -4
  127. package/dist/runtime/components/KTreePicker/KTreePicker.logic.d.ts +3 -2
  128. package/dist/runtime/components/KTreePicker/KTreePicker.logic.js +10 -1
  129. package/dist/runtime/components/KTreeView/KTreeView.global.d.vue.ts +3 -3
  130. package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +3 -3
  131. package/dist/runtime/components/KTreeView/KTreeView.logic.d.ts +1 -1
  132. package/dist/runtime/components/KTreeView/KTreeView.logic.js +36 -12
  133. package/dist/runtime/composables/locales/asianAndPacific.d.ts +11 -0
  134. package/dist/runtime/composables/locales/asianAndPacific.js +296 -0
  135. package/dist/runtime/composables/locales/northernAndEasternEuropean.d.ts +12 -0
  136. package/dist/runtime/composables/locales/northernAndEasternEuropean.js +342 -0
  137. package/dist/runtime/composables/locales/westernEuropean.d.ts +10 -0
  138. package/dist/runtime/composables/locales/westernEuropean.js +268 -0
  139. package/dist/runtime/composables/locales.d.ts +4 -24
  140. package/dist/runtime/composables/locales.js +28 -895
  141. package/dist/runtime/composables/useDataProvider.js +3 -1
  142. package/dist/runtime/composables/useKatluxForm.js +7 -7
  143. package/dist/runtime/composables/usePresetComponent.js +2 -0
  144. package/dist/runtime/composables/useRequestQueue.d.ts +2 -0
  145. package/dist/runtime/composables/useRequestQueue.js +3 -1
  146. package/dist/runtime/composables/useVirtualDataset.d.ts +6 -118
  147. package/dist/runtime/composables/useVirtualDataset.js +322 -354
  148. package/dist/runtime/composables/useVirtualScroll.d.ts +9 -9
  149. package/dist/runtime/composables/useVirtualScroll.js +69 -62
  150. package/dist/runtime/composables/virtualDataset/cacheStateHelpers.d.ts +49 -0
  151. package/dist/runtime/composables/virtualDataset/cacheStateHelpers.js +76 -0
  152. package/dist/runtime/composables/virtualDataset/keyboardNavHelpers.d.ts +26 -0
  153. package/dist/runtime/composables/virtualDataset/keyboardNavHelpers.js +60 -0
  154. package/dist/runtime/composables/virtualDataset/treeSelectionHelpers.d.ts +24 -0
  155. package/dist/runtime/composables/virtualDataset/treeSelectionHelpers.js +103 -0
  156. package/dist/runtime/composables/virtualDataset/types.d.ts +113 -0
  157. package/dist/runtime/composables/virtualDataset/types.js +0 -0
  158. package/dist/runtime/directives/clickOutside.d.ts +1 -1
  159. package/dist/runtime/directives/clickOutside.js +41 -13
  160. package/dist/runtime/plugins/nuxtCompatPlugin.d.ts +2 -1
  161. package/dist/runtime/plugins/nuxtCompatPlugin.js +7 -0
  162. package/dist/runtime/plugins/toastPlugin.client.js +2 -2
  163. package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.d.vue.ts +2 -0
  164. package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue +24 -0
  165. package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue.d.ts +2 -0
  166. package/dist/runtime/presets/default/components/KCalendar/KCalendarWeek.vue +6 -5
  167. package/dist/runtime/presets/default/components/KCombobox/KCombobox.d.vue.ts +4 -1
  168. package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue +27 -17
  169. package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue.d.ts +4 -1
  170. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.d.vue.ts +1 -1
  171. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue +10 -10
  172. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue.d.ts +1 -1
  173. package/dist/runtime/presets/default/components/KContextMenu/KContextMenu.d.vue.ts +2 -0
  174. package/dist/runtime/presets/default/components/KContextMenu/KContextMenu.vue +60 -21
  175. package/dist/runtime/presets/default/components/KContextMenu/KContextMenu.vue.d.ts +2 -0
  176. package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.d.vue.ts +12 -1
  177. package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.vue +109 -15
  178. package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.vue.d.ts +12 -1
  179. package/dist/runtime/presets/default/components/KDatatable/KDatatable.d.vue.ts +1 -1
  180. package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +14 -0
  181. package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue.d.ts +1 -1
  182. package/dist/runtime/presets/default/components/KDropdown/KDropdown.d.vue.ts +5 -2
  183. package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue +15 -12
  184. package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue.d.ts +5 -2
  185. package/dist/runtime/presets/default/components/KGantt/KGantt.d.vue.ts +10 -0
  186. package/dist/runtime/presets/default/components/KGantt/KGantt.vue +23 -69
  187. package/dist/runtime/presets/default/components/KGantt/KGantt.vue.d.ts +10 -0
  188. package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.d.vue.ts +6 -2
  189. package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue +22 -8
  190. package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue.d.ts +6 -2
  191. package/dist/runtime/presets/default/components/KLayout/KLayout.vue +2 -2
  192. package/dist/runtime/presets/default/components/KLoader/KLoader.d.vue.ts +1 -0
  193. package/dist/runtime/presets/default/components/KLoader/KLoader.vue +13 -2
  194. package/dist/runtime/presets/default/components/KLoader/KLoader.vue.d.ts +1 -0
  195. package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue +1 -94
  196. package/dist/runtime/presets/default/components/KMultiTabs/KMultiTabs.vue +69 -4
  197. package/dist/runtime/presets/default/components/KRangeSlider/KRangeSlider.vue +18 -46
  198. package/dist/runtime/presets/default/components/KSlider/KSlider.vue +11 -23
  199. package/dist/runtime/presets/default/components/KTextbox/KTextbox.d.vue.ts +4 -1
  200. package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue +24 -8
  201. package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue.d.ts +4 -1
  202. package/dist/runtime/presets/default/components/KTree/KTree.d.vue.ts +1 -1
  203. package/dist/runtime/presets/default/components/KTree/KTree.vue +51 -80
  204. package/dist/runtime/presets/default/components/KTree/KTree.vue.d.ts +1 -1
  205. package/dist/runtime/presets/default/components/KTree/KTreeNodeItem.d.vue.ts +1 -0
  206. package/dist/runtime/presets/default/components/KTree/KTreeNodeItem.vue +12 -2
  207. package/dist/runtime/presets/default/components/KTree/KTreeNodeItem.vue.d.ts +1 -0
  208. package/dist/runtime/server/middleware/session.js +7 -0
  209. package/dist/runtime/utils/deprecation.d.ts +14 -0
  210. package/dist/runtime/utils/deprecation.js +44 -0
  211. package/dist/runtime/utils/dom.d.ts +31 -0
  212. package/dist/runtime/utils/dom.js +124 -0
  213. package/dist/skills/KATLUX_INDEX.md +15 -19
  214. package/dist/skills/katlux-components/components/KBulkActions.md +1 -1
  215. package/dist/skills/katlux-components/components/KDataIterator.md +5 -0
  216. package/dist/skills/katlux-components/components/KLayout.md +4 -0
  217. package/dist/skills/katlux-components/components/KLoader.md +3 -0
  218. package/dist/skills/katlux-components/components/KTextbox.md +1 -0
  219. package/dist/skills/katlux-config/SKILL.md +15 -7
  220. package/dist/skills/katlux-presets/SKILL.md +42 -2
  221. package/dist/skills/katlux-providers/SKILL.md +12 -0
  222. package/dist/skills/katlux-providers/providers/ADataProvider.md +1 -0
  223. package/dist/skills/katlux-providers/providers/CAPITreeServerDataProvider.md +13 -0
  224. package/dist/skills/katlux-providers/providers/RequestProvider.md +2 -2
  225. package/dist/skills/katlux-providers/providers/encryption-field-level.md +5 -2
  226. package/dist/skills/katlux-providers/providers/encryption-key-management.md +5 -2
  227. package/dist/skills/katlux-providers/providers/encryption-searchable.md +150 -27
  228. package/dist/skills/katlux-providers/providers/encryption-symmetric.md +4 -1
  229. package/dist/skills/katlux-providers/providers/encryption-threat-model.md +12 -6
  230. package/dist/skills/katlux-providers/providers/encryption.md +1 -1
  231. package/package.json +3 -3
@@ -27,8 +27,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
27
27
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
28
28
  onChange?: ((value: any) => any) | undefined;
29
29
  }>, {
30
- multiOpen: boolean;
31
30
  modelValue: string | number | string[] | number[];
31
+ multiOpen: boolean;
32
32
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
33
33
  declare const _default: typeof __VLS_export;
34
34
  export default _default;
@@ -27,8 +27,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
27
27
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
28
28
  onChange?: ((value: any) => any) | undefined;
29
29
  }>, {
30
- multiOpen: boolean;
31
30
  modelValue: string | number | string[] | number[];
31
+ multiOpen: boolean;
32
32
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
33
33
  declare const _default: typeof __VLS_export;
34
34
  export default _default;
@@ -11,6 +11,14 @@ export interface KBulkActionsProps {
11
11
  dataProvider?: CFlatClientDataProvider;
12
12
  }
13
13
  export declare const KBulkActionsDefaultProps: {};
14
+ /**
15
+ * Resolves the subset of `selectedRows` an action applies to without requiring extra action props
16
+ * or `fn.toString()` parameter-name inspection (which breaks under production minification).
17
+ *
18
+ * - 2-argument `visible(rows, selectAll)` predicates are evaluated directly against the selection.
19
+ * - 1-argument `visible(arg)` predicates are probed with an `Array` Proxy: accessing only `Array`
20
+ * properties/methods evaluates the whole selection; accessing any row property filters per-row.
21
+ */
14
22
  export declare function getApplicableRows(action: IKDatatableAction, selectedRows: TDataRow[], selectAll: boolean): TDataRow[];
15
23
  export declare function useKBulkActionsLogic(props: KBulkActionsProps): {
16
24
  selected: import("vue").Ref<{
@@ -1,6 +1,10 @@
1
1
  import { ref, watch, computed } from "vue";
2
2
  import { CFlatClientDataProvider } from "@katlux/providers";
3
3
  export const KBulkActionsDefaultProps = {};
4
+ function isArrayPropertyAccess(prop) {
5
+ if (typeof prop === "symbol") return true;
6
+ return prop === "length" || /^\d+$/.test(prop) || Reflect.has(Array.prototype, prop);
7
+ }
4
8
  export function getApplicableRows(action, selectedRows, selectAll) {
5
9
  if (!action.visible) {
6
10
  return selectedRows || [];
@@ -8,8 +12,7 @@ export function getApplicableRows(action, selectedRows, selectAll) {
8
12
  if (!selectAll && (!selectedRows || selectedRows.length === 0)) {
9
13
  return [];
10
14
  }
11
- const isBulkAction = action.isBulk === true || action.bulk === true || action.scope === "bulk" || typeof action.visible === "function" && action.visible.length >= 2;
12
- if (isBulkAction) {
15
+ if (typeof action.visible === "function" && action.visible.length >= 2) {
13
16
  try {
14
17
  const isVisible = Boolean(action.visible(selectedRows || [], selectAll));
15
18
  return isVisible ? selectedRows || [] : [];
@@ -21,65 +24,31 @@ export function getApplicableRows(action, selectedRows, selectAll) {
21
24
  if (selectAll && (!selectedRows || selectedRows.length === 0)) {
22
25
  return [];
23
26
  }
24
- if (action.isBulk === false || action.scope === "row") {
25
- return (selectedRows || []).filter((row) => {
26
- try {
27
- return Boolean(action.visible(row));
28
- } catch (err) {
29
- console.error(`[KBulkActions] Error evaluating row visible predicate for "${action.label}":`, err);
30
- return false;
31
- }
32
- });
33
- }
34
- let isBulkPredicate = false;
35
- if (typeof action.visible === "function" && selectedRows && selectedRows.length > 0) {
36
- let accessedArrayMethod = false;
37
- let accessedRowProperty = false;
38
- const sampleRow = selectedRows[0] || {};
39
- const probe = new Proxy(sampleRow, {
27
+ const rows = selectedRows || [];
28
+ if (typeof action.visible === "function" && rows.length > 0) {
29
+ let accessedNonArrayProp = false;
30
+ const arrayProbe = new Proxy(rows, {
40
31
  get(target, prop, receiver) {
41
- if (typeof prop === "string" && ["length", "filter", "map", "slice", "forEach", "some", "every", "find", "includes", "reduce"].includes(prop)) {
42
- accessedArrayMethod = true;
43
- if (prop === "length") return selectedRows.length;
44
- if (typeof selectedRows[prop] === "function") {
45
- return selectedRows[prop].bind(selectedRows);
46
- }
47
- }
48
- if (typeof prop === "string" && prop in target) {
49
- accessedRowProperty = true;
32
+ if (!isArrayPropertyAccess(prop)) {
33
+ accessedNonArrayProp = true;
50
34
  }
51
- return Reflect.get(target, prop, receiver);
35
+ const value = Reflect.get(target, prop, receiver);
36
+ return typeof value === "function" ? value.bind(target) : value;
52
37
  }
53
38
  });
54
39
  try {
55
- const probeResult = action.visible(probe);
56
- if (accessedArrayMethod && !accessedRowProperty) {
57
- isBulkPredicate = true;
58
- } else if (accessedRowProperty) {
59
- isBulkPredicate = false;
60
- } else if (typeof probeResult === "boolean") {
61
- const fnStr = action.visible.toString();
62
- const paramMatch = fnStr.match(/^(?:async\s*)?(?:function\s*\w*\s*)?\(([^)]*)\)/) || fnStr.match(/^(?:async\s*)?([a-zA-Z0-9_$]+)\s*=>/);
63
- const paramName = paramMatch ? paramMatch[1].trim().split(/[\s,]+/)[0] : "";
64
- if (["rows", "items", "selection", "records"].includes(paramName)) {
65
- isBulkPredicate = true;
66
- }
40
+ const probeResult = action.visible(arrayProbe, selectAll);
41
+ if (!accessedNonArrayProp) {
42
+ return Boolean(probeResult) ? rows : [];
67
43
  }
68
44
  } catch (err) {
69
- console.error(`[KBulkActions] Error probing visible predicate for "${action.label}":`, err);
70
- return [];
71
- }
72
- }
73
- if (isBulkPredicate) {
74
- try {
75
- const isVisible = Boolean(action.visible(selectedRows || [], selectAll));
76
- return isVisible ? selectedRows || [] : [];
77
- } catch (err) {
78
- console.error(`[KBulkActions] Error evaluating bulk action visible predicate for "${action.label}":`, err);
79
- return [];
45
+ if (!accessedNonArrayProp) {
46
+ console.error(`[KBulkActions] Error probing visible predicate for "${action.label}":`, err);
47
+ return [];
48
+ }
80
49
  }
81
50
  }
82
- return (selectedRows || []).filter((row) => {
51
+ return rows.filter((row) => {
83
52
  try {
84
53
  return Boolean(action.visible(row));
85
54
  } catch (err) {
@@ -121,9 +90,6 @@ export function useKBulkActionsLogic(props) {
121
90
  const selectedRowKeys = (props.selectedRows || []).map(getRowKey);
122
91
  const unselectedRowKeys = (props.unselectedRows || []).map(getRowKey);
123
92
  const applicableRows = getApplicableRows(act, props.selectedRows, props.selectAll);
124
- if (props.selectAll && (!props.selectedRows || props.selectedRows.length === 0)) {
125
- console.warn(`[KBulkActions] Bulk action "${act.label}" executed in selectAll mode with an empty row array. Handlers must inspect the "isAllSelected" flag and "filter" parameter to perform dataset/query-level operations.`);
126
- }
127
93
  const payload = [...applicableRows];
128
94
  Object.defineProperties(payload, {
129
95
  isAllSelected: { value: Boolean(props.selectAll), enumerable: false, configurable: true, writable: true },
@@ -55,11 +55,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
55
55
  onClick?: (() => any) | undefined;
56
56
  }>, {
57
57
  size: "small" | "large" | "medium" | undefined;
58
- type: "default" | "info" | "success" | "warning" | "danger" | "primary" | "dark" | "light" | undefined;
58
+ type: "default" | "info" | "success" | "warning" | "danger" | "primary" | "light" | "dark" | undefined;
59
+ iconOnly: boolean;
59
60
  disabled: boolean;
60
61
  href: string;
61
62
  loading: boolean;
62
- iconOnly: boolean;
63
63
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
64
64
  declare const _default: typeof __VLS_export;
65
65
  export default _default;
@@ -55,11 +55,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
55
55
  onClick?: (() => any) | undefined;
56
56
  }>, {
57
57
  size: "small" | "large" | "medium" | undefined;
58
- type: "default" | "info" | "success" | "warning" | "danger" | "primary" | "dark" | "light" | undefined;
58
+ type: "default" | "info" | "success" | "warning" | "danger" | "primary" | "light" | "dark" | undefined;
59
+ iconOnly: boolean;
59
60
  disabled: boolean;
60
61
  href: string;
61
62
  loading: boolean;
62
- iconOnly: boolean;
63
63
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
64
64
  declare const _default: typeof __VLS_export;
65
65
  export default _default;
@@ -23,7 +23,7 @@ export interface KButtonEmits {
23
23
  export declare function useKButtonLogic(props: KButtonProps, emit: KButtonEmits): {
24
24
  isLink: import("vue").ComputedRef<boolean>;
25
25
  isDisabled: import("vue").ComputedRef<boolean | undefined>;
26
- buttonClasses: import("vue").ComputedRef<("small" | "default" | "info" | "success" | "warning" | "danger" | "primary" | "dark" | "light" | "large" | "medium" | {
26
+ buttonClasses: import("vue").ComputedRef<("default" | "info" | "success" | "warning" | "danger" | "small" | "primary" | "light" | "dark" | "large" | "medium" | {
27
27
  disabled: boolean | undefined;
28
28
  'icon-only': boolean | undefined;
29
29
  })[]>;
@@ -33,8 +33,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
33
33
  default: boolean;
34
34
  };
35
35
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
36
- "update:modelValue": (value: String | Date | (String | Date | null)[] | [Date, Date]) => any;
37
- "update:selectedDay": (value: String | Date | (String | Date | null)[] | [Date, Date]) => any;
36
+ "update:modelValue": (value: String | Date | [Date, Date] | (String | Date | null)[]) => any;
37
+ "update:selectedDay": (value: String | Date | [Date, Date] | (String | Date | null)[]) => any;
38
38
  dayClicked: (date: Date, marked: import("./types.js").IMarkedDay[]) => any;
39
39
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
40
40
  view: {
@@ -71,8 +71,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
71
71
  default: boolean;
72
72
  };
73
73
  }>> & Readonly<{
74
- "onUpdate:modelValue"?: ((value: String | Date | (String | Date | null)[] | [Date, Date]) => any) | undefined;
75
- "onUpdate:selectedDay"?: ((value: String | Date | (String | Date | null)[] | [Date, Date]) => any) | undefined;
74
+ "onUpdate:modelValue"?: ((value: String | Date | [Date, Date] | (String | Date | null)[]) => any) | undefined;
75
+ "onUpdate:selectedDay"?: ((value: String | Date | [Date, Date] | (String | Date | null)[]) => any) | undefined;
76
76
  onDayClicked?: ((date: Date, marked: import("./types.js").IMarkedDay[]) => any) | undefined;
77
77
  }>, {
78
78
  modelValue: String | Date | (String | Date | null)[];
@@ -33,8 +33,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
33
33
  default: boolean;
34
34
  };
35
35
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
36
- "update:modelValue": (value: String | Date | (String | Date | null)[] | [Date, Date]) => any;
37
- "update:selectedDay": (value: String | Date | (String | Date | null)[] | [Date, Date]) => any;
36
+ "update:modelValue": (value: String | Date | [Date, Date] | (String | Date | null)[]) => any;
37
+ "update:selectedDay": (value: String | Date | [Date, Date] | (String | Date | null)[]) => any;
38
38
  dayClicked: (date: Date, marked: import("./types.js").IMarkedDay[]) => any;
39
39
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
40
40
  view: {
@@ -71,8 +71,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
71
71
  default: boolean;
72
72
  };
73
73
  }>> & Readonly<{
74
- "onUpdate:modelValue"?: ((value: String | Date | (String | Date | null)[] | [Date, Date]) => any) | undefined;
75
- "onUpdate:selectedDay"?: ((value: String | Date | (String | Date | null)[] | [Date, Date]) => any) | undefined;
74
+ "onUpdate:modelValue"?: ((value: String | Date | [Date, Date] | (String | Date | null)[]) => any) | undefined;
75
+ "onUpdate:selectedDay"?: ((value: String | Date | [Date, Date] | (String | Date | null)[]) => any) | undefined;
76
76
  onDayClicked?: ((date: Date, marked: import("./types.js").IMarkedDay[]) => any) | undefined;
77
77
  }>, {
78
78
  modelValue: String | Date | (String | Date | null)[];
@@ -1,5 +1,6 @@
1
1
  import { watch, ref, computed, onMounted } from "vue";
2
2
  import { expandAllRecurringDaysForRange } from "./recurringUtils.js";
3
+ import { parseDateValue } from "../KDatePicker/KDatePicker.logic.js";
3
4
  export const KCalendarDefaultProps = {
4
5
  view: {
5
6
  type: String,
@@ -47,8 +48,8 @@ export function useKCalendarLogic(props, emit) {
47
48
  if (!dateInput) return false;
48
49
  const target = Array.isArray(dateInput) ? dateInput[0] : dateInput;
49
50
  if (!target) return false;
50
- const date = typeof target === "string" ? new Date(target) : target;
51
- if (!isNaN(date.getTime())) {
51
+ const date = parseDateValue(target);
52
+ if (date && !isNaN(date.getTime())) {
52
53
  actualMonth.value = date.getMonth() + 1;
53
54
  actualYear.value = date.getFullYear();
54
55
  activeDate.value = new Date(date);
@@ -92,6 +93,9 @@ export function useKCalendarLogic(props, emit) {
92
93
  watch(
93
94
  () => monthSelectedDay.value,
94
95
  (newValue) => {
96
+ if (props.range && Array.isArray(newValue) && newValue.length === 2 && (!newValue[0] || !newValue[1])) {
97
+ return;
98
+ }
95
99
  if (newValue !== props.selectedDay)
96
100
  emit("update:selectedDay", newValue);
97
101
  if (newValue !== props.modelValue)
@@ -183,8 +187,8 @@ export function useKCalendarLogic(props, emit) {
183
187
  const targetMonth = date.getMonth();
184
188
  const targetDay = date.getDate();
185
189
  return allDays.filter((markedDay) => {
186
- const d = typeof markedDay.date === "string" ? new Date(markedDay.date) : markedDay.date;
187
- if (!(d instanceof Date) || isNaN(d.getTime())) return false;
190
+ const d = parseDateValue(markedDay.date);
191
+ if (!d) return false;
188
192
  return d.getFullYear() === targetYear && d.getMonth() === targetMonth && d.getDate() === targetDay;
189
193
  });
190
194
  }
@@ -8,6 +8,8 @@ const emit = defineEmits(["update:selectedDay", "dayClicked", "dayHover"]);
8
8
  const {
9
9
  weekdays,
10
10
  calendarDays,
11
+ focusedDay,
12
+ focusRequestId,
11
13
  isMarked,
12
14
  isSelectedDay,
13
15
  isRangeStart,
@@ -25,6 +27,8 @@ const templateProps = computed(() => ({
25
27
  year: props.year,
26
28
  weekdays: weekdays.value,
27
29
  calendarDays: calendarDays.value,
30
+ focusedDay: focusedDay.value,
31
+ focusRequestId: focusRequestId.value,
28
32
  isMarked,
29
33
  isSelectedDay,
30
34
  isRangeStart,
@@ -58,6 +58,8 @@ export declare const KCalendarMonthDefaultProps: {
58
58
  export declare function useKCalendarMonthLogic(props: KCalendarMonthProps, emit: KCalendarMonthEmits): {
59
59
  weekdays: import("vue").ComputedRef<string[]>;
60
60
  calendarDays: import("vue").ComputedRef<(string | number)[]>;
61
+ focusedDay: import("vue").Ref<number | null, number | null>;
62
+ focusRequestId: import("vue").Ref<number, number>;
61
63
  isMarked: (day: number | string) => boolean;
62
64
  isSelectedDay: (day: number) => boolean;
63
65
  isRangeStart: (day: number) => boolean;
@@ -1,4 +1,5 @@
1
- import { computed } from "vue";
1
+ import { computed, ref } from "vue";
2
+ import { parseDateValue } from "../KDatePicker/KDatePicker.logic.js";
2
3
  export const KCalendarMonthDefaultProps = {
3
4
  month: {
4
5
  type: Number,
@@ -77,11 +78,11 @@ export function useKCalendarMonthLogic(props, emit) {
77
78
  function getCalendarDaysData(day) {
78
79
  if (!day) return [];
79
80
  const defined = (props.definedDays || []).filter((d) => {
80
- const raw = typeof d.date === "string" ? new Date(d.date) : d.date;
81
+ const raw = parseDateValue(d.date);
81
82
  return raw instanceof Date && raw.getDate() === day && raw.getMonth() + 1 === props.month && raw.getFullYear() === props.year;
82
83
  });
83
84
  const marked = (props.markedDays || []).filter((markedDay) => {
84
- const raw = typeof markedDay.date === "string" ? new Date(markedDay.date) : markedDay.date;
85
+ const raw = parseDateValue(markedDay.date);
85
86
  return raw instanceof Date && raw.getDate() === day && raw.getMonth() + 1 === props.month && raw.getFullYear() === props.year;
86
87
  });
87
88
  return [...defined, ...marked];
@@ -89,15 +90,15 @@ export function useKCalendarMonthLogic(props, emit) {
89
90
  function isMarked(day) {
90
91
  if (!day || typeof day === "string") return false;
91
92
  return (props.markedDays || []).some((markedDay) => {
92
- const date = typeof markedDay.date === "string" ? new Date(markedDay.date) : markedDay.date;
93
- if (!(date instanceof Date)) return false;
93
+ const date = parseDateValue(markedDay.date);
94
+ if (!date) return false;
94
95
  return date.getDate() === day && date.getMonth() + 1 === props.month && date.getFullYear() === props.year;
95
96
  });
96
97
  }
97
98
  function isSameDay(a, b) {
98
- const da = a instanceof Date ? a : new Date(a);
99
- const db = b instanceof Date ? b : new Date(b);
100
- if (isNaN(da.getTime()) || isNaN(db.getTime())) return false;
99
+ const da = parseDateValue(a);
100
+ const db = parseDateValue(b);
101
+ if (!da || !db) return false;
101
102
  return da.getFullYear() === db.getFullYear() && da.getMonth() === db.getMonth() && da.getDate() === db.getDate();
102
103
  }
103
104
  function isSelectedDay(day) {
@@ -109,20 +110,25 @@ export function useKCalendarMonthLogic(props, emit) {
109
110
  const isD2 = d2 ? isSameDay(cur, d2) : false;
110
111
  return isD1 || isD2;
111
112
  }
112
- const selected = typeof props.selectedDay === "string" ? new Date(props.selectedDay) : props.selectedDay;
113
+ const selected = parseDateValue(props.selectedDay);
114
+ if (!selected) return false;
113
115
  return selected.getDate() === day && selected.getMonth() + 1 === props.month && selected.getFullYear() === props.year;
114
116
  }
115
117
  function isRangeStart(day) {
116
118
  if (!props.range || !props.selectedDay || !day) return false;
117
119
  if (Array.isArray(props.selectedDay)) {
118
120
  const [d1, d2] = props.selectedDay;
119
- if (!d1) return false;
121
+ const pd1 = d1 ? parseDateValue(d1) : null;
122
+ if (!pd1) return false;
120
123
  const cur = new Date(props.year, props.month - 1, day);
121
- if (d1 && d2) {
122
- const start = new Date(d1).getTime() <= new Date(d2).getTime() ? d1 : d2;
123
- return isSameDay(cur, start);
124
+ if (d2) {
125
+ const pd2 = parseDateValue(d2);
126
+ if (pd2) {
127
+ const start = pd1.getTime() <= pd2.getTime() ? pd1 : pd2;
128
+ return isSameDay(cur, start);
129
+ }
124
130
  }
125
- return isSameDay(cur, d1);
131
+ return isSameDay(cur, pd1);
126
132
  }
127
133
  return false;
128
134
  }
@@ -130,14 +136,20 @@ export function useKCalendarMonthLogic(props, emit) {
130
136
  if (!props.range || !props.selectedDay || !day) return false;
131
137
  if (Array.isArray(props.selectedDay)) {
132
138
  const [d1, d2] = props.selectedDay;
139
+ const pd1 = d1 ? parseDateValue(d1) : null;
140
+ if (!pd1) return false;
133
141
  const cur = new Date(props.year, props.month - 1, day);
134
- if (d1 && d2) {
135
- const end = new Date(d1).getTime() <= new Date(d2).getTime() ? d2 : d1;
136
- return isSameDay(cur, end);
142
+ if (d2) {
143
+ const pd2 = parseDateValue(d2);
144
+ if (pd2) {
145
+ const end = pd1.getTime() <= pd2.getTime() ? pd2 : pd1;
146
+ return isSameDay(cur, end);
147
+ }
137
148
  }
138
- if (d1 && !d2 && props.hoverDate) {
139
- if (new Date(props.hoverDate).getTime() >= new Date(d1).getTime()) {
140
- return isSameDay(cur, props.hoverDate);
149
+ if (!d2 && props.hoverDate) {
150
+ const hover = parseDateValue(props.hoverDate);
151
+ if (hover && hover.getTime() >= pd1.getTime()) {
152
+ return isSameDay(cur, hover);
141
153
  }
142
154
  }
143
155
  }
@@ -147,10 +159,10 @@ export function useKCalendarMonthLogic(props, emit) {
147
159
  if (!props.range || !props.selectedDay || !day) return false;
148
160
  if (Array.isArray(props.selectedDay)) {
149
161
  const [d1, d2] = props.selectedDay;
150
- let start = d1 ? d1 instanceof Date ? d1 : new Date(d1) : null;
151
- let end = d2 ? d2 instanceof Date ? d2 : new Date(d2) : null;
162
+ let start = d1 ? parseDateValue(d1) : null;
163
+ let end = d2 ? parseDateValue(d2) : null;
152
164
  if (start && !end && props.hoverDate) {
153
- end = props.hoverDate instanceof Date ? props.hoverDate : new Date(props.hoverDate);
165
+ end = parseDateValue(props.hoverDate);
154
166
  }
155
167
  if (!start || !end) return false;
156
168
  let minTime = new Date(start.getFullYear(), start.getMonth(), start.getDate()).getTime();
@@ -179,6 +191,8 @@ export function useKCalendarMonthLogic(props, emit) {
179
191
  const date = new Date(props.year, props.month - 1, dayNum);
180
192
  emit("dayHover", date);
181
193
  }
194
+ const focusedDay = ref(null);
195
+ const focusRequestId = ref(0);
182
196
  function onDayKeyDown(e, day) {
183
197
  if (e.key === "Enter" || e.key === " ") {
184
198
  e.preventDefault();
@@ -194,9 +208,8 @@ export function useKCalendarMonthLogic(props, emit) {
194
208
  e.preventDefault();
195
209
  const daysInMonth = new Date(props.year, props.month, 0).getDate();
196
210
  if (targetDay >= 1 && targetDay <= daysInMonth) {
197
- const container = e.currentTarget?.parentElement;
198
- const el = container?.querySelector(`[data-day="${targetDay}"]`);
199
- el?.focus();
211
+ focusedDay.value = targetDay;
212
+ focusRequestId.value++;
200
213
  }
201
214
  }
202
215
  }
@@ -225,6 +238,8 @@ export function useKCalendarMonthLogic(props, emit) {
225
238
  return {
226
239
  weekdays,
227
240
  calendarDays,
241
+ focusedDay,
242
+ focusRequestId,
228
243
  isMarked,
229
244
  isSelectedDay,
230
245
  isRangeStart,
@@ -1,4 +1,5 @@
1
1
  import { DAY_NAMES } from "./types.js";
2
+ import { parseDateValue } from "../KDatePicker/KDatePicker.logic.js";
2
3
  function isDateMatchingRecurring(date, recurringDate) {
3
4
  for (const rule of recurringDate.recurringRules) {
4
5
  const day = date.getDate();
@@ -78,7 +79,7 @@ export function expandAllRecurringDaysForRange(startDate, endDate, daysWithRecur
78
79
  return daysArr.flatMap((dayWithRecurring) => {
79
80
  const dateVal = dayWithRecurring.date;
80
81
  if (!(dateVal && typeof dateVal === "object" && "recurringRules" in dateVal)) {
81
- const d = typeof dateVal === "string" ? new Date(dateVal) : dateVal;
82
+ const d = parseDateValue(dateVal);
82
83
  if (d instanceof Date && !isNaN(d.getTime()) && d >= startDate && d <= endDate) {
83
84
  return [{ ...dayWithRecurring, date: d }];
84
85
  } else {
@@ -91,12 +92,12 @@ export function expandAllRecurringDaysForRange(startDate, endDate, daysWithRecur
91
92
  let rangeStart = startDate;
92
93
  let rangeEnd = endDate;
93
94
  if (recurringDate.startDate) {
94
- const s = new Date(recurringDate.startDate);
95
- if (s > rangeStart) rangeStart = s;
95
+ const s = parseDateValue(recurringDate.startDate);
96
+ if (s && s > rangeStart) rangeStart = s;
96
97
  }
97
98
  if (recurringDate.endDate) {
98
- const e = new Date(recurringDate.endDate);
99
- if (e < rangeEnd) rangeEnd = e;
99
+ const e = parseDateValue(recurringDate.endDate);
100
+ if (e && e < rangeEnd) rangeEnd = e;
100
101
  }
101
102
  if (rangeEnd < rangeStart) return [];
102
103
  function matchesAll(date, rule) {
@@ -77,7 +77,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
77
77
  }>, {
78
78
  label: string;
79
79
  disabled: boolean;
80
- validation: "error" | "success" | "warning" | null | undefined;
80
+ validation: "success" | "warning" | "error" | null | undefined;
81
81
  validationText: string;
82
82
  idKey: string;
83
83
  indeterminate: boolean;
@@ -77,7 +77,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
77
77
  }>, {
78
78
  label: string;
79
79
  disabled: boolean;
80
- validation: "error" | "success" | "warning" | null | undefined;
80
+ validation: "success" | "warning" | "error" | null | undefined;
81
81
  validationText: string;
82
82
  idKey: string;
83
83
  indeterminate: boolean;
@@ -104,10 +104,12 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
104
104
  isOptionsOpen: import("vue").Ref<boolean, boolean>;
105
105
  selectItem: (option: import("./KCombobox.logic.js").ComboboxItem) => void;
106
106
  toggleDropdown: () => void;
107
- closeDropdown: () => void;
107
+ closeDropdown: (restoreFocus?: boolean) => void;
108
+ focus: () => boolean;
108
109
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
109
110
  "update:modelValue": (value: any) => any;
110
111
  blur: (event: FocusEvent) => any;
112
+ change: (value: any) => any;
111
113
  "update:isOptionsOpen": (value: boolean) => any;
112
114
  "update:searchtext": (value: string) => any;
113
115
  "update:scrollState": (state: {
@@ -116,6 +118,12 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
116
118
  lastAppendedPage: number;
117
119
  totalCount: number;
118
120
  }) => any;
121
+ "scroll-state-change": (state: {
122
+ loadedCount: number;
123
+ hasMore: boolean;
124
+ lastAppendedPage: number;
125
+ totalCount: number;
126
+ }) => any;
119
127
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
120
128
  label: {
121
129
  type: StringConstructor;
@@ -213,6 +221,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
213
221
  }>> & Readonly<{
214
222
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
215
223
  onBlur?: ((event: FocusEvent) => any) | undefined;
224
+ onChange?: ((value: any) => any) | undefined;
216
225
  "onUpdate:isOptionsOpen"?: ((value: boolean) => any) | undefined;
217
226
  "onUpdate:searchtext"?: ((value: string) => any) | undefined;
218
227
  "onUpdate:scrollState"?: ((state: {
@@ -221,11 +230,17 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
221
230
  lastAppendedPage: number;
222
231
  totalCount: number;
223
232
  }) => any) | undefined;
233
+ "onScroll-state-change"?: ((state: {
234
+ loadedCount: number;
235
+ hasMore: boolean;
236
+ lastAppendedPage: number;
237
+ totalCount: number;
238
+ }) => any) | undefined;
224
239
  }>, {
225
240
  modelValue: any;
226
241
  label: string;
227
242
  disabled: boolean;
228
- validation: "error" | "success" | "warning" | null | undefined;
243
+ validation: "success" | "warning" | "error" | null | undefined;
229
244
  validationText: string;
230
245
  searchbox: boolean;
231
246
  searchtext: string;
@@ -1,13 +1,16 @@
1
1
  <script setup>
2
2
  import { useKComboboxLogic, KComboboxDefaultProps } from "./KCombobox.logic";
3
3
  import { usePresetComponent } from "../../composables/usePresetComponent";
4
- import { computed, watch } from "vue";
4
+ import { computed, ref, watch } from "vue";
5
5
  import KComboboxDefault from "../../presets/default/components/KCombobox/KCombobox.vue";
6
+ import { focusTarget } from "../../utils/dom";
6
7
  const props = defineProps(KComboboxDefaultProps);
7
- const emit = defineEmits(["update:modelValue", "update:isOptionsOpen", "update:searchtext", "update:scrollState", "blur"]);
8
+ const emit = defineEmits(["update:modelValue", "change", "update:isOptionsOpen", "update:searchtext", "update:scrollState", "scroll-state-change", "blur"]);
9
+ const presetRef = ref(null);
8
10
  const {
9
11
  selectedItems,
10
12
  isOptionsOpen,
13
+ focusRequestId,
11
14
  searchtext,
12
15
  selectItem,
13
16
  isSelected,
@@ -34,13 +37,15 @@ defineExpose({
34
37
  isOptionsOpen,
35
38
  selectItem,
36
39
  toggleDropdown,
37
- closeDropdown
40
+ closeDropdown,
41
+ focus: () => focusTarget(presetRef.value)
38
42
  });
39
43
  const presetComponent = usePresetComponent("KCombobox", KComboboxDefault);
40
44
  const templateProps = computed(() => ({
41
45
  label: props.label,
42
46
  disabled: props.disabled,
43
47
  isOptionsOpen: isOptionsOpen.value,
48
+ focusRequestId: focusRequestId.value,
44
49
  highlightedIndex: highlightedIndex.value,
45
50
  onKeyDown,
46
51
  setHighlightedIndex,
@@ -79,7 +84,7 @@ function updateIsOptionsOpen(val) {
79
84
  </script>
80
85
 
81
86
  <template lang="pug">
82
- component(:is="presetComponent" v-bind="{...templateProps, ...$attrs}" @update:searchtext="updateSearchText" @update:isOptionsOpen="updateIsOptionsOpen" @blur="emit('blur', $event)")
87
+ component(:is="presetComponent" ref="presetRef" v-bind="{...templateProps, ...$attrs}" @update:searchtext="updateSearchText" @update:isOptionsOpen="updateIsOptionsOpen" @blur="emit('blur', $event)")
83
88
  template(v-for="(_, slot) in $slots" #[slot]="scope")
84
89
  slot(:name="slot" v-bind="scope")
85
90
  </template>