@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.
- package/README.md +32 -22
- package/bin/ai-init.mjs +71 -13
- package/bin/ai-tokens/adapters/antigravityAdapter.mjs +22 -0
- package/bin/ai-tokens/adapters/claudeCodeAdapter.mjs +192 -0
- package/bin/ai-tokens/adapters/codexAdapter.mjs +176 -0
- package/bin/ai-tokens/adapters/cursorAdapter.mjs +202 -0
- package/bin/ai-tokens/adapters/index.mjs +30 -0
- package/bin/ai-tokens/cliViews.mjs +301 -0
- package/bin/ai-tokens/formatAndDates.mjs +89 -0
- package/bin/ai-tokens/reportGenerator.mjs +232 -0
- package/bin/ai-tokens/transcriptParser.mjs +299 -0
- package/bin/ai-tokens.mjs +38 -1030
- package/bin/cli.mjs +14 -10
- package/bin/preset-contracts.json +66 -10
- package/dist/compiled/composables/locales/asianAndPacific.mjs +296 -0
- package/dist/compiled/composables/locales/northernAndEasternEuropean.mjs +342 -0
- package/dist/compiled/composables/locales/westernEuropean.mjs +268 -0
- package/dist/compiled/composables/locales.mjs +28 -895
- package/dist/compiled/composables/useDataProvider.mjs +3 -1
- package/dist/compiled/composables/useKatluxForm.mjs +7 -7
- package/dist/compiled/composables/usePresetComponent.mjs +2 -0
- package/dist/compiled/composables/useRequestQueue.mjs +3 -1
- package/dist/compiled/composables/useVirtualDataset.mjs +322 -354
- package/dist/compiled/composables/useVirtualScroll.mjs +69 -62
- package/dist/compiled/composables/virtualDataset/cacheStateHelpers.mjs +76 -0
- package/dist/compiled/composables/virtualDataset/keyboardNavHelpers.mjs +60 -0
- package/dist/compiled/composables/virtualDataset/treeSelectionHelpers.mjs +103 -0
- package/dist/compiled/composables/virtualDataset/types.mjs +0 -0
- package/dist/compiled/utils/deprecation.mjs +44 -0
- package/dist/compiled/utils/dom.mjs +124 -0
- package/dist/module.cjs +0 -5
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -6
- package/dist/runtime/app.config.d.ts +3 -0
- package/dist/runtime/components/KAccordion/KAccordion.global.d.vue.ts +1 -1
- package/dist/runtime/components/KAccordion/KAccordion.global.vue.d.ts +1 -1
- package/dist/runtime/components/KBulkActions/KBulkActions.logic.d.ts +8 -0
- package/dist/runtime/components/KBulkActions/KBulkActions.logic.js +21 -55
- 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 +4 -4
- package/dist/runtime/components/KCalendar/KCalendar.global.vue.d.ts +4 -4
- package/dist/runtime/components/KCalendar/KCalendar.logic.js +8 -4
- package/dist/runtime/components/KCalendar/KCalendarMonth.global.vue +4 -0
- package/dist/runtime/components/KCalendar/KCalendarMonth.logic.d.ts +2 -0
- package/dist/runtime/components/KCalendar/KCalendarMonth.logic.js +41 -26
- package/dist/runtime/components/KCalendar/recurringUtils.js +6 -5
- package/dist/runtime/components/KCheckbox/KCheckbox.global.d.vue.ts +1 -1
- package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +1 -1
- package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +17 -2
- package/dist/runtime/components/KCombobox/KCombobox.global.vue +9 -4
- package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +17 -2
- package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +10 -2
- package/dist/runtime/components/KCombobox/KCombobox.logic.js +32 -13
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +7 -7
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +7 -7
- package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.d.ts +3 -3
- package/dist/runtime/components/KContextMenu/KContextMenu.global.d.vue.ts +3 -3
- package/dist/runtime/components/KContextMenu/KContextMenu.global.vue +4 -1
- package/dist/runtime/components/KContextMenu/KContextMenu.global.vue.d.ts +3 -3
- package/dist/runtime/components/KContextMenu/KContextMenu.logic.d.ts +24 -4
- package/dist/runtime/components/KContextMenu/KContextMenu.logic.js +43 -27
- package/dist/runtime/components/KDatatable/KDataIterator.global.d.vue.ts +25 -2
- package/dist/runtime/components/KDatatable/KDataIterator.global.vue +19 -7
- package/dist/runtime/components/KDatatable/KDataIterator.global.vue.d.ts +25 -2
- package/dist/runtime/components/KDatatable/KDataIterator.logic.d.ts +20 -0
- package/dist/runtime/components/KDatatable/KDataIterator.logic.js +54 -14
- package/dist/runtime/components/KDatatable/KDatatable.global.d.vue.ts +1 -1
- package/dist/runtime/components/KDatatable/KDatatable.global.vue.d.ts +1 -1
- package/dist/runtime/components/KDatatable/KDatatable.logic.js +6 -5
- package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +5 -3
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue +45 -26
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +5 -3
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.d.ts +2 -0
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.js +66 -20
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +2 -2
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +2 -2
- package/dist/runtime/components/KDropdown/KDropdown.global.d.vue.ts +4 -4
- package/dist/runtime/components/KDropdown/KDropdown.global.vue.d.ts +4 -4
- package/dist/runtime/components/KDropdown/KDropdown.logic.d.ts +3 -2
- package/dist/runtime/components/KDropdown/KDropdown.logic.js +14 -13
- package/dist/runtime/components/KGantt/KGantt.global.d.vue.ts +3 -1
- package/dist/runtime/components/KGantt/KGantt.global.vue +7 -1
- package/dist/runtime/components/KGantt/KGantt.global.vue.d.ts +3 -1
- package/dist/runtime/components/KGrid/KGrid.global.d.vue.ts +1 -1
- package/dist/runtime/components/KGrid/KGrid.global.vue.d.ts +1 -1
- package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +1 -1
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +1 -1
- package/dist/runtime/components/KIcon/KIcon.global.d.vue.ts +1 -1
- package/dist/runtime/components/KIcon/KIcon.global.vue.d.ts +1 -1
- package/dist/runtime/components/KLayout/KLayout.global.d.vue.ts +4 -1
- package/dist/runtime/components/KLayout/KLayout.global.vue +4 -1
- package/dist/runtime/components/KLayout/KLayout.global.vue.d.ts +4 -1
- package/dist/runtime/components/KLoader/KLoader.global.d.vue.ts +9 -0
- package/dist/runtime/components/KLoader/KLoader.global.vue +1 -0
- package/dist/runtime/components/KLoader/KLoader.global.vue.d.ts +9 -0
- package/dist/runtime/components/KLoader/KLoader.logic.d.ts +5 -0
- package/dist/runtime/components/KLoader/KLoader.logic.js +4 -0
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.d.vue.ts +1 -1
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +1 -1
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.logic.js +30 -7
- package/dist/runtime/components/KMultiTabs/KMultiTabs.logic.d.ts +1 -0
- package/dist/runtime/components/KMultiTabs/MultiTabs.global.vue +6 -4
- package/dist/runtime/components/KPagination/KPagination.logic.d.ts +1 -1
- package/dist/runtime/components/KPagination/KPagination.logic.js +17 -9
- 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/KTabs/KTabs.logic.js +33 -11
- 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 +14 -3
- package/dist/runtime/components/KTextbox/KTextbox.global.vue +8 -2
- package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +14 -3
- package/dist/runtime/components/KTextbox/KTextbox.logic.d.ts +5 -0
- package/dist/runtime/components/KTextbox/KTextbox.logic.js +4 -0
- 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/KTooltip/KTooltip.logic.d.ts +11 -2
- package/dist/runtime/components/KTooltip/KTooltip.logic.js +7 -5
- package/dist/runtime/components/KTree/KTree.global.d.vue.ts +1 -1
- package/dist/runtime/components/KTree/KTree.global.vue.d.ts +1 -1
- package/dist/runtime/components/KTree/KTree.logic.js +21 -1
- package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +8 -4
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue +4 -2
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +8 -4
- package/dist/runtime/components/KTreePicker/KTreePicker.logic.d.ts +3 -2
- package/dist/runtime/components/KTreePicker/KTreePicker.logic.js +10 -1
- package/dist/runtime/components/KTreeView/KTreeView.global.d.vue.ts +3 -3
- package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +3 -3
- package/dist/runtime/components/KTreeView/KTreeView.logic.d.ts +1 -1
- package/dist/runtime/components/KTreeView/KTreeView.logic.js +36 -12
- package/dist/runtime/composables/locales/asianAndPacific.d.ts +11 -0
- package/dist/runtime/composables/locales/asianAndPacific.js +296 -0
- package/dist/runtime/composables/locales/northernAndEasternEuropean.d.ts +12 -0
- package/dist/runtime/composables/locales/northernAndEasternEuropean.js +342 -0
- package/dist/runtime/composables/locales/westernEuropean.d.ts +10 -0
- package/dist/runtime/composables/locales/westernEuropean.js +268 -0
- package/dist/runtime/composables/locales.d.ts +4 -24
- package/dist/runtime/composables/locales.js +28 -895
- package/dist/runtime/composables/useDataProvider.js +3 -1
- package/dist/runtime/composables/useKatluxForm.js +7 -7
- package/dist/runtime/composables/usePresetComponent.js +2 -0
- package/dist/runtime/composables/useRequestQueue.d.ts +2 -0
- package/dist/runtime/composables/useRequestQueue.js +3 -1
- package/dist/runtime/composables/useVirtualDataset.d.ts +6 -118
- package/dist/runtime/composables/useVirtualDataset.js +322 -354
- package/dist/runtime/composables/useVirtualScroll.d.ts +9 -9
- package/dist/runtime/composables/useVirtualScroll.js +69 -62
- package/dist/runtime/composables/virtualDataset/cacheStateHelpers.d.ts +49 -0
- package/dist/runtime/composables/virtualDataset/cacheStateHelpers.js +76 -0
- package/dist/runtime/composables/virtualDataset/keyboardNavHelpers.d.ts +26 -0
- package/dist/runtime/composables/virtualDataset/keyboardNavHelpers.js +60 -0
- package/dist/runtime/composables/virtualDataset/treeSelectionHelpers.d.ts +24 -0
- package/dist/runtime/composables/virtualDataset/treeSelectionHelpers.js +103 -0
- package/dist/runtime/composables/virtualDataset/types.d.ts +113 -0
- package/dist/runtime/composables/virtualDataset/types.js +0 -0
- package/dist/runtime/directives/clickOutside.d.ts +1 -1
- package/dist/runtime/directives/clickOutside.js +41 -13
- package/dist/runtime/plugins/nuxtCompatPlugin.d.ts +2 -1
- package/dist/runtime/plugins/nuxtCompatPlugin.js +7 -0
- package/dist/runtime/plugins/toastPlugin.client.js +2 -2
- package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.d.vue.ts +2 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue +24 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue.d.ts +2 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendarWeek.vue +6 -5
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.d.vue.ts +4 -1
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue +27 -17
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue.d.ts +4 -1
- package/dist/runtime/presets/default/components/KCombobox/KComboboxList.d.vue.ts +1 -1
- package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue +10 -10
- package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue.d.ts +1 -1
- package/dist/runtime/presets/default/components/KContextMenu/KContextMenu.d.vue.ts +2 -0
- package/dist/runtime/presets/default/components/KContextMenu/KContextMenu.vue +60 -21
- package/dist/runtime/presets/default/components/KContextMenu/KContextMenu.vue.d.ts +2 -0
- package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.d.vue.ts +12 -1
- package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.vue +109 -15
- package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.vue.d.ts +12 -1
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.d.vue.ts +1 -1
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +14 -0
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue.d.ts +1 -1
- package/dist/runtime/presets/default/components/KDropdown/KDropdown.d.vue.ts +5 -2
- package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue +15 -12
- package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue.d.ts +5 -2
- package/dist/runtime/presets/default/components/KGantt/KGantt.d.vue.ts +10 -0
- package/dist/runtime/presets/default/components/KGantt/KGantt.vue +23 -69
- package/dist/runtime/presets/default/components/KGantt/KGantt.vue.d.ts +10 -0
- package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.d.vue.ts +6 -2
- package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue +22 -8
- package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue.d.ts +6 -2
- package/dist/runtime/presets/default/components/KLayout/KLayout.vue +2 -2
- package/dist/runtime/presets/default/components/KLoader/KLoader.d.vue.ts +1 -0
- package/dist/runtime/presets/default/components/KLoader/KLoader.vue +13 -2
- package/dist/runtime/presets/default/components/KLoader/KLoader.vue.d.ts +1 -0
- package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue +1 -94
- package/dist/runtime/presets/default/components/KMultiTabs/KMultiTabs.vue +69 -4
- package/dist/runtime/presets/default/components/KRangeSlider/KRangeSlider.vue +18 -46
- package/dist/runtime/presets/default/components/KSlider/KSlider.vue +11 -23
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.d.vue.ts +4 -1
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue +24 -8
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue.d.ts +4 -1
- package/dist/runtime/presets/default/components/KTree/KTree.d.vue.ts +1 -1
- package/dist/runtime/presets/default/components/KTree/KTree.vue +51 -80
- package/dist/runtime/presets/default/components/KTree/KTree.vue.d.ts +1 -1
- package/dist/runtime/presets/default/components/KTree/KTreeNodeItem.d.vue.ts +1 -0
- package/dist/runtime/presets/default/components/KTree/KTreeNodeItem.vue +12 -2
- package/dist/runtime/presets/default/components/KTree/KTreeNodeItem.vue.d.ts +1 -0
- package/dist/runtime/server/middleware/session.js +7 -0
- package/dist/runtime/utils/deprecation.d.ts +14 -0
- package/dist/runtime/utils/deprecation.js +44 -0
- package/dist/runtime/utils/dom.d.ts +31 -0
- package/dist/runtime/utils/dom.js +124 -0
- package/dist/skills/KATLUX_INDEX.md +15 -19
- package/dist/skills/katlux-components/components/KBulkActions.md +1 -1
- package/dist/skills/katlux-components/components/KDataIterator.md +5 -0
- package/dist/skills/katlux-components/components/KLayout.md +4 -0
- package/dist/skills/katlux-components/components/KLoader.md +3 -0
- package/dist/skills/katlux-components/components/KTextbox.md +1 -0
- package/dist/skills/katlux-config/SKILL.md +15 -7
- package/dist/skills/katlux-presets/SKILL.md +42 -2
- package/dist/skills/katlux-providers/SKILL.md +12 -0
- package/dist/skills/katlux-providers/providers/ADataProvider.md +1 -0
- package/dist/skills/katlux-providers/providers/CAPITreeServerDataProvider.md +13 -0
- package/dist/skills/katlux-providers/providers/RequestProvider.md +2 -2
- package/dist/skills/katlux-providers/providers/encryption-field-level.md +5 -2
- package/dist/skills/katlux-providers/providers/encryption-key-management.md +5 -2
- package/dist/skills/katlux-providers/providers/encryption-searchable.md +150 -27
- package/dist/skills/katlux-providers/providers/encryption-symmetric.md +4 -1
- package/dist/skills/katlux-providers/providers/encryption-threat-model.md +12 -6
- package/dist/skills/katlux-providers/providers/encryption.md +1 -1
- 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
|
-
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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 (
|
|
42
|
-
|
|
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
|
-
|
|
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(
|
|
56
|
-
if (
|
|
57
|
-
|
|
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
|
-
|
|
70
|
-
|
|
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
|
|
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" | "
|
|
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" | "
|
|
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<("
|
|
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)[]
|
|
37
|
-
"update:selectedDay": (value: String | Date | (String | Date | null)[]
|
|
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)[]
|
|
75
|
-
"onUpdate:selectedDay"?: ((value: String | Date | (String | Date | null)[]
|
|
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)[]
|
|
37
|
-
"update:selectedDay": (value: String | Date | (String | Date | null)[]
|
|
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)[]
|
|
75
|
-
"onUpdate:selectedDay"?: ((value: String | Date | (String | Date | null)[]
|
|
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 =
|
|
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 =
|
|
187
|
-
if (!
|
|
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 =
|
|
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 =
|
|
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 =
|
|
93
|
-
if (!
|
|
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 =
|
|
99
|
-
const db =
|
|
100
|
-
if (
|
|
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 =
|
|
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
|
-
|
|
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 (
|
|
122
|
-
const
|
|
123
|
-
|
|
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,
|
|
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 (
|
|
135
|
-
const
|
|
136
|
-
|
|
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 (
|
|
139
|
-
|
|
140
|
-
|
|
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 ?
|
|
151
|
-
let end = d2 ?
|
|
162
|
+
let start = d1 ? parseDateValue(d1) : null;
|
|
163
|
+
let end = d2 ? parseDateValue(d2) : null;
|
|
152
164
|
if (start && !end && props.hoverDate) {
|
|
153
|
-
end =
|
|
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
|
-
|
|
198
|
-
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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>
|