@katlux/toolkit 0.1.1-alpha.145 → 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 +575 -0
- 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 -872
- package/bin/cli.mjs +81 -48
- package/bin/create-preset.mjs +1 -0
- package/bin/preset-contracts.json +2997 -0
- 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 +32 -720
- package/dist/compiled/composables/useDataProvider.mjs +39 -26
- package/dist/compiled/composables/useFilterLogic.mjs +10 -2
- package/dist/compiled/composables/useKatluxForm.mjs +13 -11
- package/dist/compiled/composables/usePresetComponent.mjs +2 -0
- package/dist/compiled/composables/useRequestQueue.mjs +3 -1
- package/dist/compiled/composables/useVirtualDataset.mjs +657 -0
- package/dist/compiled/composables/useVirtualScroll.mjs +93 -66
- 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 +58 -77
- package/dist/module.d.cts +5 -0
- package/dist/module.d.mts +4 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +54 -77
- 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.global.d.vue.ts +7 -3
- package/dist/runtime/components/KBulkActions/KBulkActions.global.vue +4 -1
- package/dist/runtime/components/KBulkActions/KBulkActions.global.vue.d.ts +7 -3
- package/dist/runtime/components/KBulkActions/KBulkActions.logic.d.ts +12 -2
- package/dist/runtime/components/KBulkActions/KBulkActions.logic.js +40 -41
- package/dist/runtime/components/KButton/KButton.global.d.vue.ts +1 -1
- package/dist/runtime/components/KButton/KButton.global.vue.d.ts +1 -1
- package/dist/runtime/components/KButton/KButton.logic.d.ts +1 -1
- package/dist/runtime/components/KCalendar/KCalendar.global.d.vue.ts +19 -10
- package/dist/runtime/components/KCalendar/KCalendar.global.vue +7 -2
- package/dist/runtime/components/KCalendar/KCalendar.global.vue.d.ts +19 -10
- package/dist/runtime/components/KCalendar/KCalendar.logic.d.ts +14 -201
- package/dist/runtime/components/KCalendar/KCalendar.logic.js +67 -14
- package/dist/runtime/components/KCalendar/KCalendarMonth.global.d.vue.ts +25 -5
- package/dist/runtime/components/KCalendar/KCalendarMonth.global.vue +15 -1
- package/dist/runtime/components/KCalendar/KCalendarMonth.global.vue.d.ts +25 -5
- package/dist/runtime/components/KCalendar/KCalendarMonth.logic.d.ts +21 -3
- package/dist/runtime/components/KCalendar/KCalendarMonth.logic.js +136 -7
- package/dist/runtime/components/KCalendar/recurringUtils.js +6 -5
- package/dist/runtime/components/KCheckbox/KCheckbox.global.d.vue.ts +2 -2
- package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +2 -2
- package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +18 -3
- package/dist/runtime/components/KCombobox/KCombobox.global.vue +9 -4
- package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +18 -3
- package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +16 -2
- package/dist/runtime/components/KCombobox/KCombobox.logic.js +32 -13
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +8 -8
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +8 -8
- 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 -22
- package/dist/runtime/components/KDatatable/KDataIterator.global.d.vue.ts +38 -11
- package/dist/runtime/components/KDatatable/KDataIterator.global.vue +39 -20
- package/dist/runtime/components/KDatatable/KDataIterator.global.vue.d.ts +38 -11
- package/dist/runtime/components/KDatatable/KDataIterator.logic.d.ts +31 -8
- package/dist/runtime/components/KDatatable/KDataIterator.logic.js +69 -24
- package/dist/runtime/components/KDatatable/KDatatable.global.d.vue.ts +10 -14
- package/dist/runtime/components/KDatatable/KDatatable.global.vue +6 -5
- package/dist/runtime/components/KDatatable/KDatatable.global.vue.d.ts +10 -14
- package/dist/runtime/components/KDatatable/KDatatable.logic.d.ts +4 -6
- package/dist/runtime/components/KDatatable/KDatatable.logic.js +32 -24
- package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +33 -15
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue +60 -16
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +33 -15
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.d.ts +30 -6
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.js +249 -59
- 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/KDateTimePicker/KDateTimePicker.logic.js +2 -0
- 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 +55 -4
- package/dist/runtime/components/KGantt/KGantt.global.vue +18 -3
- package/dist/runtime/components/KGantt/KGantt.global.vue.d.ts +55 -4
- package/dist/runtime/components/KGantt/KGantt.logic.d.ts +33 -5
- package/dist/runtime/components/KGantt/KGantt.logic.js +39 -6
- package/dist/runtime/components/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 +2 -2
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +2 -2
- 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 +3 -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 +2 -2
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +2 -2
- 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.d.vue.ts +23 -0
- package/dist/runtime/components/KMultiTabs/MultiTabs.global.vue +24 -0
- package/dist/runtime/components/KMultiTabs/MultiTabs.global.vue.d.ts +23 -0
- package/dist/runtime/components/KPagination/KPagination.global.d.vue.ts +3 -1
- package/dist/runtime/components/KPagination/KPagination.global.vue +2 -1
- package/dist/runtime/components/KPagination/KPagination.global.vue.d.ts +3 -1
- package/dist/runtime/components/KPagination/KPagination.logic.d.ts +2 -1
- package/dist/runtime/components/KPagination/KPagination.logic.js +74 -14
- 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 +15 -4
- package/dist/runtime/components/KTextbox/KTextbox.global.vue +8 -2
- package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +15 -4
- 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.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 +4 -4
- package/dist/runtime/components/KTree/KTree.global.vue.d.ts +4 -4
- package/dist/runtime/components/KTree/KTree.logic.d.ts +2 -2
- package/dist/runtime/components/KTree/KTree.logic.js +37 -13
- package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +7 -5
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue +4 -6
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +7 -5
- 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 +40 -6
- package/dist/runtime/components/KTreeView/KTreeView.global.vue +19 -1
- package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +40 -6
- package/dist/runtime/components/KTreeView/KTreeView.logic.d.ts +24 -4
- package/dist/runtime/components/KTreeView/KTreeView.logic.js +105 -11
- 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 +32 -720
- package/dist/runtime/composables/useDataProvider.d.ts +5 -3
- package/dist/runtime/composables/useDataProvider.js +39 -26
- package/dist/runtime/composables/useFilterLogic.d.ts +16 -4
- package/dist/runtime/composables/useFilterLogic.js +10 -2
- package/dist/runtime/composables/useKatluxForm.d.ts +4 -4
- package/dist/runtime/composables/useKatluxForm.js +13 -11
- 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/useSortLogic.d.ts +1 -1
- package/dist/runtime/composables/useVirtualDataset.d.ts +9 -0
- package/dist/runtime/composables/useVirtualDataset.js +657 -0
- package/dist/runtime/composables/useVirtualScroll.d.ts +14 -10
- package/dist/runtime/composables/useVirtualScroll.js +93 -66
- 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 +16 -1
- package/dist/runtime/plugins/toastPlugin.client.js +2 -2
- package/dist/runtime/presets/default/assets/scss/css-variables.css +3 -0
- package/dist/runtime/presets/default/assets/scss/css-variables.scss +6 -1
- package/dist/runtime/presets/default/assets/scss/index.css +3 -0
- package/dist/runtime/presets/default/assets/svg/katlux-logo.svg +7 -0
- package/dist/runtime/presets/default/assets/svg/katlux.svg +6 -0
- package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.d.vue.ts +3 -2
- package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue +31 -3
- package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue.d.ts +3 -2
- package/dist/runtime/presets/default/components/KCalendar/KCalendar.d.vue.ts +3 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue +6 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue.d.ts +3 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.d.vue.ts +7 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue +57 -2
- package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue.d.ts +7 -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 +67 -22
- package/dist/runtime/presets/default/components/KContextMenu/KContextMenu.vue.d.ts +2 -0
- package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.d.vue.ts +41 -8
- package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.vue +184 -174
- package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.vue.d.ts +41 -8
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.d.vue.ts +17 -10
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +113 -394
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue.d.ts +17 -10
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.d.vue.ts +6 -0
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue +71 -4
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue.d.ts +6 -0
- package/dist/runtime/presets/default/components/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 +11 -2
- package/dist/runtime/presets/default/components/KGantt/KGantt.vue +46 -29
- package/dist/runtime/presets/default/components/KGantt/KGantt.vue.d.ts +11 -2
- package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.d.vue.ts +6 -2
- package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue +23 -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 +3 -3
- package/dist/runtime/presets/default/components/KTree/KTree.vue +61 -56
- package/dist/runtime/presets/default/components/KTree/KTree.vue.d.ts +3 -3
- 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/presets/default/components/KTreeView/KTreeView.d.vue.ts +11 -2
- package/dist/runtime/presets/default/components/KTreeView/KTreeView.vue +14 -2
- package/dist/runtime/presets/default/components/KTreeView/KTreeView.vue.d.ts +11 -2
- package/dist/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 +18 -19
- package/dist/skills/katlux-components/SKILL.md +2 -0
- package/dist/skills/katlux-components/components/KBulkActions.md +26 -2
- package/dist/skills/katlux-components/components/KCombobox.md +2 -2
- package/dist/skills/katlux-components/components/KDataIterator.md +17 -4
- package/dist/skills/katlux-components/components/KDatatable.md +38 -0
- package/dist/skills/katlux-components/components/KDatePicker.md +3 -1
- package/dist/skills/katlux-components/components/KGantt.md +9 -0
- package/dist/skills/katlux-components/components/KIcon.md +1 -1
- package/dist/skills/katlux-components/components/KLayout.md +4 -0
- package/dist/skills/katlux-components/components/KLineChart.md +3 -0
- package/dist/skills/katlux-components/components/KLoader.md +3 -0
- package/dist/skills/katlux-components/components/KProductList.md +0 -1
- package/dist/skills/katlux-components/components/KScatterChart.md +3 -0
- package/dist/skills/katlux-components/components/KTextbox.md +1 -0
- package/dist/skills/katlux-components/components/KTreePicker.md +2 -1
- package/dist/skills/katlux-components/components/KTreeView.md +12 -0
- package/dist/skills/katlux-config/SKILL.md +27 -8
- package/dist/skills/katlux-presets/SKILL.md +163 -3
- package/dist/skills/katlux-presets/creating-a-preset.md +67 -0
- package/dist/skills/katlux-providers/SKILL.md +19 -5
- package/dist/skills/katlux-providers/providers/ADataProvider.md +17 -9
- package/dist/skills/katlux-providers/providers/CAPIFlatClientDataProvider.md +27 -3
- package/dist/skills/katlux-providers/providers/CAPIFlatServerDataProvider.md +11 -1
- package/dist/skills/katlux-providers/providers/CAPITreeServerDataProvider.md +13 -0
- package/dist/skills/katlux-providers/providers/CFlatClientDataProvider.md +19 -4
- package/dist/skills/katlux-providers/providers/CFlatServerDataProvider.md +4 -2
- package/dist/skills/katlux-providers/providers/CTreeClientDataProvider.md +2 -2
- package/dist/skills/katlux-providers/providers/RequestProvider.md +10 -0
- package/dist/skills/katlux-providers/providers/encryption-field-level.md +67 -20
- package/dist/skills/katlux-providers/providers/encryption-key-management.md +23 -2
- package/dist/skills/katlux-providers/providers/encryption-key-pinning.md +25 -11
- package/dist/skills/katlux-providers/providers/encryption-searchable.md +341 -0
- package/dist/skills/katlux-providers/providers/encryption-symmetric.md +29 -2
- package/dist/skills/katlux-providers/providers/encryption-threat-model.md +70 -1
- package/dist/skills/katlux-providers/providers/encryption.md +26 -1
- package/dist/skills/katlux-providers/providers/types.md +3 -1
- package/dist/skills/katlux-providers/providers/useDataProvider.md +2 -1
- package/dist/skills/katlux-providers/providers/useVirtualDataset.md +154 -0
- package/dist/skills/katlux-tokens/SKILL.md +2 -1
- package/dist/types.d.mts +1 -1
- package/package.json +7 -3
- package/bin/add-ai-reference.mjs +0 -259
|
@@ -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,
|
|
@@ -23,12 +24,16 @@ export const KCalendarDefaultProps = {
|
|
|
23
24
|
required: false
|
|
24
25
|
},
|
|
25
26
|
selectedDay: {
|
|
26
|
-
type: [Date, String],
|
|
27
|
+
type: [Date, String, Array],
|
|
27
28
|
default: null
|
|
28
29
|
},
|
|
29
30
|
modelValue: {
|
|
30
|
-
type: [Date, String],
|
|
31
|
+
type: [Date, String, Array],
|
|
31
32
|
default: void 0
|
|
33
|
+
},
|
|
34
|
+
range: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: false
|
|
32
37
|
}
|
|
33
38
|
};
|
|
34
39
|
export function useKCalendarLogic(props, emit) {
|
|
@@ -41,8 +46,10 @@ export function useKCalendarLogic(props, emit) {
|
|
|
41
46
|
const activeDate = ref(/* @__PURE__ */ new Date());
|
|
42
47
|
function initViewFromDate(dateInput) {
|
|
43
48
|
if (!dateInput) return false;
|
|
44
|
-
const
|
|
45
|
-
if (!
|
|
49
|
+
const target = Array.isArray(dateInput) ? dateInput[0] : dateInput;
|
|
50
|
+
if (!target) return false;
|
|
51
|
+
const date = parseDateValue(target);
|
|
52
|
+
if (date && !isNaN(date.getTime())) {
|
|
46
53
|
actualMonth.value = date.getMonth() + 1;
|
|
47
54
|
actualYear.value = date.getFullYear();
|
|
48
55
|
activeDate.value = new Date(date);
|
|
@@ -50,20 +57,35 @@ export function useKCalendarLogic(props, emit) {
|
|
|
50
57
|
}
|
|
51
58
|
return false;
|
|
52
59
|
}
|
|
60
|
+
const hoverDate = ref(null);
|
|
61
|
+
const onDayHover = (date) => {
|
|
62
|
+
hoverDate.value = date;
|
|
63
|
+
};
|
|
53
64
|
watch(
|
|
54
65
|
() => props.day,
|
|
55
66
|
(newVal) => {
|
|
56
67
|
if (!newVal) return;
|
|
57
|
-
|
|
68
|
+
if (Array.isArray(newVal)) {
|
|
69
|
+
if (newVal[0]) initViewFromDate(newVal[0]);
|
|
70
|
+
} else {
|
|
71
|
+
initViewFromDate(newVal);
|
|
72
|
+
}
|
|
58
73
|
},
|
|
59
74
|
{ immediate: true }
|
|
60
75
|
);
|
|
61
76
|
watch(
|
|
62
77
|
() => props.modelValue !== void 0 ? props.modelValue : props.selectedDay,
|
|
63
78
|
(newValue) => {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
79
|
+
if (props.range && Array.isArray(newValue)) {
|
|
80
|
+
monthSelectedDay.value = newValue;
|
|
81
|
+
if (newValue[0] && !props.day && actualYear.value === void 0) {
|
|
82
|
+
initViewFromDate(newValue[0]);
|
|
83
|
+
}
|
|
84
|
+
} else {
|
|
85
|
+
monthSelectedDay.value = newValue ?? "";
|
|
86
|
+
if (!props.day && actualYear.value === void 0 && newValue) {
|
|
87
|
+
initViewFromDate(newValue);
|
|
88
|
+
}
|
|
67
89
|
}
|
|
68
90
|
},
|
|
69
91
|
{ immediate: true }
|
|
@@ -71,6 +93,9 @@ export function useKCalendarLogic(props, emit) {
|
|
|
71
93
|
watch(
|
|
72
94
|
() => monthSelectedDay.value,
|
|
73
95
|
(newValue) => {
|
|
96
|
+
if (props.range && Array.isArray(newValue) && newValue.length === 2 && (!newValue[0] || !newValue[1])) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
74
99
|
if (newValue !== props.selectedDay)
|
|
75
100
|
emit("update:selectedDay", newValue);
|
|
76
101
|
if (newValue !== props.modelValue)
|
|
@@ -79,7 +104,12 @@ export function useKCalendarLogic(props, emit) {
|
|
|
79
104
|
{ flush: "sync" }
|
|
80
105
|
);
|
|
81
106
|
onMounted(() => {
|
|
82
|
-
|
|
107
|
+
const initVal = props.modelValue !== void 0 ? props.modelValue : props.selectedDay;
|
|
108
|
+
if (props.range && Array.isArray(initVal)) {
|
|
109
|
+
monthSelectedDay.value = initVal;
|
|
110
|
+
} else {
|
|
111
|
+
monthSelectedDay.value = initVal || "";
|
|
112
|
+
}
|
|
83
113
|
if (actualYear.value === void 0) {
|
|
84
114
|
const now = /* @__PURE__ */ new Date();
|
|
85
115
|
actualMonth.value = now.getMonth() + 1;
|
|
@@ -157,14 +187,35 @@ export function useKCalendarLogic(props, emit) {
|
|
|
157
187
|
const targetMonth = date.getMonth();
|
|
158
188
|
const targetDay = date.getDate();
|
|
159
189
|
return allDays.filter((markedDay) => {
|
|
160
|
-
const d =
|
|
161
|
-
if (!
|
|
190
|
+
const d = parseDateValue(markedDay.date);
|
|
191
|
+
if (!d) return false;
|
|
162
192
|
return d.getFullYear() === targetYear && d.getMonth() === targetMonth && d.getDate() === targetDay;
|
|
163
193
|
});
|
|
164
194
|
}
|
|
165
195
|
function dayClicked(date) {
|
|
166
|
-
|
|
167
|
-
|
|
196
|
+
if (props.range) {
|
|
197
|
+
const current = Array.isArray(monthSelectedDay.value) ? monthSelectedDay.value : [];
|
|
198
|
+
if (current.length === 0 || current.length === 2 && current[0] && current[1]) {
|
|
199
|
+
monthSelectedDay.value = [date, null];
|
|
200
|
+
emit("dayClicked", date, getDayMark(date));
|
|
201
|
+
} else {
|
|
202
|
+
let start = current[0];
|
|
203
|
+
let end = date;
|
|
204
|
+
if (end.getTime() < start.getTime()) {
|
|
205
|
+
const tmp = start;
|
|
206
|
+
start = end;
|
|
207
|
+
end = tmp;
|
|
208
|
+
}
|
|
209
|
+
const finalRange = [start, end];
|
|
210
|
+
monthSelectedDay.value = finalRange;
|
|
211
|
+
emit("update:selectedDay", finalRange);
|
|
212
|
+
emit("update:modelValue", finalRange);
|
|
213
|
+
emit("dayClicked", date, getDayMark(date));
|
|
214
|
+
}
|
|
215
|
+
} else {
|
|
216
|
+
monthSelectedDay.value = date;
|
|
217
|
+
emit("dayClicked", date, getDayMark(date));
|
|
218
|
+
}
|
|
168
219
|
}
|
|
169
220
|
function goToPrev() {
|
|
170
221
|
if (props.view === "week") {
|
|
@@ -219,6 +270,8 @@ export function useKCalendarLogic(props, emit) {
|
|
|
219
270
|
showingYear,
|
|
220
271
|
getExpandedDefinedDays,
|
|
221
272
|
getExpandedMarkedDays,
|
|
222
|
-
dayClicked
|
|
273
|
+
dayClicked,
|
|
274
|
+
hoverDate,
|
|
275
|
+
onDayHover
|
|
223
276
|
};
|
|
224
277
|
}
|
|
@@ -25,12 +25,21 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
25
25
|
default: () => never[];
|
|
26
26
|
};
|
|
27
27
|
selectedDay: {
|
|
28
|
-
type: import("vue").PropType<Date | string>;
|
|
28
|
+
type: import("vue").PropType<Date | string | (Date | string | null)[]>;
|
|
29
|
+
default: null;
|
|
30
|
+
};
|
|
31
|
+
range: {
|
|
32
|
+
type: BooleanConstructor;
|
|
33
|
+
default: boolean;
|
|
34
|
+
};
|
|
35
|
+
hoverDate: {
|
|
36
|
+
type: import("vue").PropType<Date | null>;
|
|
29
37
|
default: null;
|
|
30
38
|
};
|
|
31
39
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
32
|
-
"update:selectedDay": (value: string | Date) => any;
|
|
40
|
+
"update:selectedDay": (value: string | Date | (string | Date | null)[]) => any;
|
|
33
41
|
dayClicked: (value: string | Date) => any;
|
|
42
|
+
dayHover: (value: Date | null) => any;
|
|
34
43
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
35
44
|
month: {
|
|
36
45
|
type: NumberConstructor;
|
|
@@ -58,16 +67,27 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
58
67
|
default: () => never[];
|
|
59
68
|
};
|
|
60
69
|
selectedDay: {
|
|
61
|
-
type: import("vue").PropType<Date | string>;
|
|
70
|
+
type: import("vue").PropType<Date | string | (Date | string | null)[]>;
|
|
71
|
+
default: null;
|
|
72
|
+
};
|
|
73
|
+
range: {
|
|
74
|
+
type: BooleanConstructor;
|
|
75
|
+
default: boolean;
|
|
76
|
+
};
|
|
77
|
+
hoverDate: {
|
|
78
|
+
type: import("vue").PropType<Date | null>;
|
|
62
79
|
default: null;
|
|
63
80
|
};
|
|
64
81
|
}>> & Readonly<{
|
|
65
|
-
"onUpdate:selectedDay"?: ((value: string | Date) => any) | undefined;
|
|
82
|
+
"onUpdate:selectedDay"?: ((value: string | Date | (string | Date | null)[]) => any) | undefined;
|
|
66
83
|
onDayClicked?: ((value: string | Date) => any) | undefined;
|
|
84
|
+
onDayHover?: ((value: Date | null) => any) | undefined;
|
|
67
85
|
}>, {
|
|
86
|
+
range: boolean;
|
|
87
|
+
hoverDate: Date | null;
|
|
68
88
|
definedDays: import("./types.js").IDefinedDay[];
|
|
69
89
|
markedDays: import("./types.js").IMarkedDay[];
|
|
70
|
-
selectedDay: string | Date;
|
|
90
|
+
selectedDay: string | Date | (string | Date | null)[];
|
|
71
91
|
startingWeekday: string;
|
|
72
92
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
73
93
|
declare const _default: typeof __VLS_export;
|
|
@@ -4,12 +4,19 @@ import { usePresetComponent } from "../../composables/usePresetComponent";
|
|
|
4
4
|
import { computed } from "vue";
|
|
5
5
|
import KCalendarMonthDefault from "../../presets/default/components/KCalendar/KCalendarMonth.vue";
|
|
6
6
|
const props = defineProps(KCalendarMonthDefaultProps);
|
|
7
|
-
const emit = defineEmits(["update:selectedDay", "dayClicked"]);
|
|
7
|
+
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,
|
|
15
|
+
isRangeStart,
|
|
16
|
+
isRangeEnd,
|
|
17
|
+
isInRange,
|
|
18
|
+
onDayHover,
|
|
19
|
+
onDayKeyDown,
|
|
13
20
|
getMarkedDayClass,
|
|
14
21
|
selectDay,
|
|
15
22
|
getCalendarDaysData
|
|
@@ -20,8 +27,15 @@ const templateProps = computed(() => ({
|
|
|
20
27
|
year: props.year,
|
|
21
28
|
weekdays: weekdays.value,
|
|
22
29
|
calendarDays: calendarDays.value,
|
|
30
|
+
focusedDay: focusedDay.value,
|
|
31
|
+
focusRequestId: focusRequestId.value,
|
|
23
32
|
isMarked,
|
|
24
33
|
isSelectedDay,
|
|
34
|
+
isRangeStart,
|
|
35
|
+
isRangeEnd,
|
|
36
|
+
isInRange,
|
|
37
|
+
onDayHover,
|
|
38
|
+
onDayKeyDown,
|
|
25
39
|
getMarkedDayClass,
|
|
26
40
|
selectDay,
|
|
27
41
|
getCalendarDaysData
|
|
@@ -25,12 +25,21 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
25
25
|
default: () => never[];
|
|
26
26
|
};
|
|
27
27
|
selectedDay: {
|
|
28
|
-
type: import("vue").PropType<Date | string>;
|
|
28
|
+
type: import("vue").PropType<Date | string | (Date | string | null)[]>;
|
|
29
|
+
default: null;
|
|
30
|
+
};
|
|
31
|
+
range: {
|
|
32
|
+
type: BooleanConstructor;
|
|
33
|
+
default: boolean;
|
|
34
|
+
};
|
|
35
|
+
hoverDate: {
|
|
36
|
+
type: import("vue").PropType<Date | null>;
|
|
29
37
|
default: null;
|
|
30
38
|
};
|
|
31
39
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
32
|
-
"update:selectedDay": (value: string | Date) => any;
|
|
40
|
+
"update:selectedDay": (value: string | Date | (string | Date | null)[]) => any;
|
|
33
41
|
dayClicked: (value: string | Date) => any;
|
|
42
|
+
dayHover: (value: Date | null) => any;
|
|
34
43
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
35
44
|
month: {
|
|
36
45
|
type: NumberConstructor;
|
|
@@ -58,16 +67,27 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
58
67
|
default: () => never[];
|
|
59
68
|
};
|
|
60
69
|
selectedDay: {
|
|
61
|
-
type: import("vue").PropType<Date | string>;
|
|
70
|
+
type: import("vue").PropType<Date | string | (Date | string | null)[]>;
|
|
71
|
+
default: null;
|
|
72
|
+
};
|
|
73
|
+
range: {
|
|
74
|
+
type: BooleanConstructor;
|
|
75
|
+
default: boolean;
|
|
76
|
+
};
|
|
77
|
+
hoverDate: {
|
|
78
|
+
type: import("vue").PropType<Date | null>;
|
|
62
79
|
default: null;
|
|
63
80
|
};
|
|
64
81
|
}>> & Readonly<{
|
|
65
|
-
"onUpdate:selectedDay"?: ((value: string | Date) => any) | undefined;
|
|
82
|
+
"onUpdate:selectedDay"?: ((value: string | Date | (string | Date | null)[]) => any) | undefined;
|
|
66
83
|
onDayClicked?: ((value: string | Date) => any) | undefined;
|
|
84
|
+
onDayHover?: ((value: Date | null) => any) | undefined;
|
|
67
85
|
}>, {
|
|
86
|
+
range: boolean;
|
|
87
|
+
hoverDate: Date | null;
|
|
68
88
|
definedDays: import("./types.js").IDefinedDay[];
|
|
69
89
|
markedDays: import("./types.js").IMarkedDay[];
|
|
70
|
-
selectedDay: string | Date;
|
|
90
|
+
selectedDay: string | Date | (string | Date | null)[];
|
|
71
91
|
startingWeekday: string;
|
|
72
92
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
73
93
|
declare const _default: typeof __VLS_export;
|
|
@@ -7,11 +7,14 @@ export interface KCalendarMonthProps {
|
|
|
7
7
|
startingWeekday?: string;
|
|
8
8
|
definedDays?: IDefinedDay[];
|
|
9
9
|
markedDays?: IMarkedDay[];
|
|
10
|
-
selectedDay?: Date | string;
|
|
10
|
+
selectedDay?: Date | string | (Date | string | null)[];
|
|
11
|
+
range?: boolean;
|
|
12
|
+
hoverDate?: Date | null;
|
|
11
13
|
}
|
|
12
14
|
export interface KCalendarMonthEmits {
|
|
13
|
-
(e: 'update:selectedDay', value: Date | string): void;
|
|
15
|
+
(e: 'update:selectedDay', value: Date | string | (Date | string | null)[]): void;
|
|
14
16
|
(e: 'dayClicked', value: Date | string): void;
|
|
17
|
+
(e: 'dayHover', value: Date | null): void;
|
|
15
18
|
}
|
|
16
19
|
export declare const KCalendarMonthDefaultProps: {
|
|
17
20
|
month: {
|
|
@@ -40,15 +43,30 @@ export declare const KCalendarMonthDefaultProps: {
|
|
|
40
43
|
default: () => never[];
|
|
41
44
|
};
|
|
42
45
|
selectedDay: {
|
|
43
|
-
type: PropType<Date | string>;
|
|
46
|
+
type: PropType<Date | string | (Date | string | null)[]>;
|
|
47
|
+
default: null;
|
|
48
|
+
};
|
|
49
|
+
range: {
|
|
50
|
+
type: BooleanConstructor;
|
|
51
|
+
default: boolean;
|
|
52
|
+
};
|
|
53
|
+
hoverDate: {
|
|
54
|
+
type: PropType<Date | null>;
|
|
44
55
|
default: null;
|
|
45
56
|
};
|
|
46
57
|
};
|
|
47
58
|
export declare function useKCalendarMonthLogic(props: KCalendarMonthProps, emit: KCalendarMonthEmits): {
|
|
48
59
|
weekdays: import("vue").ComputedRef<string[]>;
|
|
49
60
|
calendarDays: import("vue").ComputedRef<(string | number)[]>;
|
|
61
|
+
focusedDay: import("vue").Ref<number | null, number | null>;
|
|
62
|
+
focusRequestId: import("vue").Ref<number, number>;
|
|
50
63
|
isMarked: (day: number | string) => boolean;
|
|
51
64
|
isSelectedDay: (day: number) => boolean;
|
|
65
|
+
isRangeStart: (day: number) => boolean;
|
|
66
|
+
isRangeEnd: (day: number) => boolean;
|
|
67
|
+
isInRange: (day: number) => boolean;
|
|
68
|
+
onDayHover: (day: number | string) => void;
|
|
69
|
+
onDayKeyDown: (e: KeyboardEvent, day: number) => void;
|
|
52
70
|
getMarkedDayClass: (day: number) => string;
|
|
53
71
|
selectDay: (day: number | string) => void;
|
|
54
72
|
getCalendarDaysData: (day: number) => IMarkedDay[];
|
|
@@ -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,
|
|
@@ -28,7 +29,15 @@ export const KCalendarMonthDefaultProps = {
|
|
|
28
29
|
default: () => []
|
|
29
30
|
},
|
|
30
31
|
selectedDay: {
|
|
31
|
-
type: [Date, String],
|
|
32
|
+
type: [Date, String, Array],
|
|
33
|
+
default: null
|
|
34
|
+
},
|
|
35
|
+
range: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: false
|
|
38
|
+
},
|
|
39
|
+
hoverDate: {
|
|
40
|
+
type: [Date, Object],
|
|
32
41
|
default: null
|
|
33
42
|
}
|
|
34
43
|
};
|
|
@@ -69,11 +78,11 @@ export function useKCalendarMonthLogic(props, emit) {
|
|
|
69
78
|
function getCalendarDaysData(day) {
|
|
70
79
|
if (!day) return [];
|
|
71
80
|
const defined = (props.definedDays || []).filter((d) => {
|
|
72
|
-
const raw =
|
|
81
|
+
const raw = parseDateValue(d.date);
|
|
73
82
|
return raw instanceof Date && raw.getDate() === day && raw.getMonth() + 1 === props.month && raw.getFullYear() === props.year;
|
|
74
83
|
});
|
|
75
84
|
const marked = (props.markedDays || []).filter((markedDay) => {
|
|
76
|
-
const raw =
|
|
85
|
+
const raw = parseDateValue(markedDay.date);
|
|
77
86
|
return raw instanceof Date && raw.getDate() === day && raw.getMonth() + 1 === props.month && raw.getFullYear() === props.year;
|
|
78
87
|
});
|
|
79
88
|
return [...defined, ...marked];
|
|
@@ -81,16 +90,129 @@ export function useKCalendarMonthLogic(props, emit) {
|
|
|
81
90
|
function isMarked(day) {
|
|
82
91
|
if (!day || typeof day === "string") return false;
|
|
83
92
|
return (props.markedDays || []).some((markedDay) => {
|
|
84
|
-
const date =
|
|
85
|
-
if (!
|
|
93
|
+
const date = parseDateValue(markedDay.date);
|
|
94
|
+
if (!date) return false;
|
|
86
95
|
return date.getDate() === day && date.getMonth() + 1 === props.month && date.getFullYear() === props.year;
|
|
87
96
|
});
|
|
88
97
|
}
|
|
98
|
+
function isSameDay(a, b) {
|
|
99
|
+
const da = parseDateValue(a);
|
|
100
|
+
const db = parseDateValue(b);
|
|
101
|
+
if (!da || !db) return false;
|
|
102
|
+
return da.getFullYear() === db.getFullYear() && da.getMonth() === db.getMonth() && da.getDate() === db.getDate();
|
|
103
|
+
}
|
|
89
104
|
function isSelectedDay(day) {
|
|
90
105
|
if (!props.selectedDay || !day) return false;
|
|
91
|
-
|
|
106
|
+
if (Array.isArray(props.selectedDay)) {
|
|
107
|
+
const [d1, d2] = props.selectedDay;
|
|
108
|
+
const cur = new Date(props.year, props.month - 1, day);
|
|
109
|
+
const isD1 = d1 ? isSameDay(cur, d1) : false;
|
|
110
|
+
const isD2 = d2 ? isSameDay(cur, d2) : false;
|
|
111
|
+
return isD1 || isD2;
|
|
112
|
+
}
|
|
113
|
+
const selected = parseDateValue(props.selectedDay);
|
|
114
|
+
if (!selected) return false;
|
|
92
115
|
return selected.getDate() === day && selected.getMonth() + 1 === props.month && selected.getFullYear() === props.year;
|
|
93
116
|
}
|
|
117
|
+
function isRangeStart(day) {
|
|
118
|
+
if (!props.range || !props.selectedDay || !day) return false;
|
|
119
|
+
if (Array.isArray(props.selectedDay)) {
|
|
120
|
+
const [d1, d2] = props.selectedDay;
|
|
121
|
+
const pd1 = d1 ? parseDateValue(d1) : null;
|
|
122
|
+
if (!pd1) return false;
|
|
123
|
+
const cur = new Date(props.year, props.month - 1, day);
|
|
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
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return isSameDay(cur, pd1);
|
|
132
|
+
}
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
function isRangeEnd(day) {
|
|
136
|
+
if (!props.range || !props.selectedDay || !day) return false;
|
|
137
|
+
if (Array.isArray(props.selectedDay)) {
|
|
138
|
+
const [d1, d2] = props.selectedDay;
|
|
139
|
+
const pd1 = d1 ? parseDateValue(d1) : null;
|
|
140
|
+
if (!pd1) return false;
|
|
141
|
+
const cur = new Date(props.year, props.month - 1, day);
|
|
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
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if (!d2 && props.hoverDate) {
|
|
150
|
+
const hover = parseDateValue(props.hoverDate);
|
|
151
|
+
if (hover && hover.getTime() >= pd1.getTime()) {
|
|
152
|
+
return isSameDay(cur, hover);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
function isInRange(day) {
|
|
159
|
+
if (!props.range || !props.selectedDay || !day) return false;
|
|
160
|
+
if (Array.isArray(props.selectedDay)) {
|
|
161
|
+
const [d1, d2] = props.selectedDay;
|
|
162
|
+
let start = d1 ? parseDateValue(d1) : null;
|
|
163
|
+
let end = d2 ? parseDateValue(d2) : null;
|
|
164
|
+
if (start && !end && props.hoverDate) {
|
|
165
|
+
end = parseDateValue(props.hoverDate);
|
|
166
|
+
}
|
|
167
|
+
if (!start || !end) return false;
|
|
168
|
+
let minTime = new Date(start.getFullYear(), start.getMonth(), start.getDate()).getTime();
|
|
169
|
+
let maxTime = new Date(end.getFullYear(), end.getMonth(), end.getDate()).getTime();
|
|
170
|
+
if (minTime > maxTime) {
|
|
171
|
+
const tmp = minTime;
|
|
172
|
+
minTime = maxTime;
|
|
173
|
+
maxTime = tmp;
|
|
174
|
+
}
|
|
175
|
+
const curTime = new Date(props.year, props.month - 1, day).getTime();
|
|
176
|
+
return curTime > minTime && curTime < maxTime;
|
|
177
|
+
}
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
function onDayHover(day) {
|
|
181
|
+
if (!props.range) return;
|
|
182
|
+
if (!day) {
|
|
183
|
+
emit("dayHover", null);
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
const dayNum = typeof day === "number" ? day : parseInt(day, 10);
|
|
187
|
+
if (isNaN(dayNum) || dayNum <= 0) {
|
|
188
|
+
emit("dayHover", null);
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
const date = new Date(props.year, props.month - 1, dayNum);
|
|
192
|
+
emit("dayHover", date);
|
|
193
|
+
}
|
|
194
|
+
const focusedDay = ref(null);
|
|
195
|
+
const focusRequestId = ref(0);
|
|
196
|
+
function onDayKeyDown(e, day) {
|
|
197
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
198
|
+
e.preventDefault();
|
|
199
|
+
selectDay(day);
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
let targetDay = null;
|
|
203
|
+
if (e.key === "ArrowLeft") targetDay = day - 1;
|
|
204
|
+
else if (e.key === "ArrowRight") targetDay = day + 1;
|
|
205
|
+
else if (e.key === "ArrowUp") targetDay = day - 7;
|
|
206
|
+
else if (e.key === "ArrowDown") targetDay = day + 7;
|
|
207
|
+
if (targetDay !== null) {
|
|
208
|
+
e.preventDefault();
|
|
209
|
+
const daysInMonth = new Date(props.year, props.month, 0).getDate();
|
|
210
|
+
if (targetDay >= 1 && targetDay <= daysInMonth) {
|
|
211
|
+
focusedDay.value = targetDay;
|
|
212
|
+
focusRequestId.value++;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
94
216
|
function getMarkedDayClass(day) {
|
|
95
217
|
const markedDays = getCalendarDaysData(day);
|
|
96
218
|
if (!markedDays.length) return "";
|
|
@@ -116,8 +238,15 @@ export function useKCalendarMonthLogic(props, emit) {
|
|
|
116
238
|
return {
|
|
117
239
|
weekdays,
|
|
118
240
|
calendarDays,
|
|
241
|
+
focusedDay,
|
|
242
|
+
focusRequestId,
|
|
119
243
|
isMarked,
|
|
120
244
|
isSelectedDay,
|
|
245
|
+
isRangeStart,
|
|
246
|
+
isRangeEnd,
|
|
247
|
+
isInRange,
|
|
248
|
+
onDayHover,
|
|
249
|
+
onDayKeyDown,
|
|
121
250
|
getMarkedDayClass,
|
|
122
251
|
selectDay,
|
|
123
252
|
getCalendarDaysData
|
|
@@ -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,11 +77,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
77
77
|
}>, {
|
|
78
78
|
label: string;
|
|
79
79
|
disabled: boolean;
|
|
80
|
-
|
|
81
|
-
validation: "error" | "success" | "warning" | null | undefined;
|
|
80
|
+
validation: "success" | "warning" | "error" | null | undefined;
|
|
82
81
|
validationText: string;
|
|
83
82
|
idKey: string;
|
|
84
83
|
indeterminate: boolean;
|
|
84
|
+
value: any;
|
|
85
85
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
86
86
|
declare const _default: typeof __VLS_export;
|
|
87
87
|
export default _default;
|
|
@@ -77,11 +77,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
77
77
|
}>, {
|
|
78
78
|
label: string;
|
|
79
79
|
disabled: boolean;
|
|
80
|
-
|
|
81
|
-
validation: "error" | "success" | "warning" | null | undefined;
|
|
80
|
+
validation: "success" | "warning" | "error" | null | undefined;
|
|
82
81
|
validationText: string;
|
|
83
82
|
idKey: string;
|
|
84
83
|
indeterminate: boolean;
|
|
84
|
+
value: any;
|
|
85
85
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
86
86
|
declare const _default: typeof __VLS_export;
|
|
87
87
|
export default _default;
|
|
@@ -104,12 +104,20 @@ 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;
|
|
115
|
+
"update:scrollState": (state: {
|
|
116
|
+
loadedCount: number;
|
|
117
|
+
hasMore: boolean;
|
|
118
|
+
lastAppendedPage: number;
|
|
119
|
+
totalCount: number;
|
|
120
|
+
}) => any;
|
|
113
121
|
"scroll-state-change": (state: {
|
|
114
122
|
loadedCount: number;
|
|
115
123
|
hasMore: boolean;
|
|
@@ -213,8 +221,15 @@ 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;
|
|
227
|
+
"onUpdate:scrollState"?: ((state: {
|
|
228
|
+
loadedCount: number;
|
|
229
|
+
hasMore: boolean;
|
|
230
|
+
lastAppendedPage: number;
|
|
231
|
+
totalCount: number;
|
|
232
|
+
}) => any) | undefined;
|
|
218
233
|
"onScroll-state-change"?: ((state: {
|
|
219
234
|
loadedCount: number;
|
|
220
235
|
hasMore: boolean;
|
|
@@ -225,7 +240,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
225
240
|
modelValue: any;
|
|
226
241
|
label: string;
|
|
227
242
|
disabled: boolean;
|
|
228
|
-
validation: "
|
|
243
|
+
validation: "success" | "warning" | "error" | null | undefined;
|
|
244
|
+
validationText: string;
|
|
229
245
|
searchbox: boolean;
|
|
230
246
|
searchtext: string;
|
|
231
247
|
searchPlaceholder: string;
|
|
@@ -236,7 +252,6 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
236
252
|
placeholder: string;
|
|
237
253
|
teleportTo: string;
|
|
238
254
|
fullWidth: boolean;
|
|
239
|
-
validationText: string;
|
|
240
255
|
maxHeight: number;
|
|
241
256
|
closeOnSelect: boolean;
|
|
242
257
|
multiSelect: boolean;
|