@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
|
@@ -41,31 +41,51 @@ function getMaskPatternDef(mask, position) {
|
|
|
41
41
|
if (remaining.startsWith("DD")) {
|
|
42
42
|
return {
|
|
43
43
|
pattern: /[0-9]/,
|
|
44
|
-
length: 2
|
|
44
|
+
length: 2,
|
|
45
|
+
validate: (val) => {
|
|
46
|
+
const d = Number(val);
|
|
47
|
+
return val.length === 1 ? d <= 3 : d >= 1 && d <= 31;
|
|
48
|
+
}
|
|
45
49
|
};
|
|
46
50
|
}
|
|
47
51
|
if (remaining.startsWith("MM")) {
|
|
48
52
|
return {
|
|
49
53
|
pattern: /[0-9]/,
|
|
50
|
-
length: 2
|
|
54
|
+
length: 2,
|
|
55
|
+
validate: (val) => {
|
|
56
|
+
const m = Number(val);
|
|
57
|
+
return val.length === 1 ? m <= 1 : m >= 1 && m <= 12;
|
|
58
|
+
}
|
|
51
59
|
};
|
|
52
60
|
}
|
|
53
61
|
if (remaining.startsWith("HH")) {
|
|
54
62
|
return {
|
|
55
63
|
pattern: /[0-9]/,
|
|
56
|
-
length: 2
|
|
64
|
+
length: 2,
|
|
65
|
+
validate: (val) => {
|
|
66
|
+
const h = Number(val);
|
|
67
|
+
return val.length === 1 ? h <= 2 : h >= 0 && h <= 23;
|
|
68
|
+
}
|
|
57
69
|
};
|
|
58
70
|
}
|
|
59
71
|
if (remaining.length >= 2 && remaining.startsWith("mm") && (position === 0 || mask[position - 1] !== "m")) {
|
|
60
72
|
return {
|
|
61
73
|
pattern: /[0-9]/,
|
|
62
|
-
length: 2
|
|
74
|
+
length: 2,
|
|
75
|
+
validate: (val) => {
|
|
76
|
+
const s = Number(val);
|
|
77
|
+
return val.length === 1 ? s <= 5 : s >= 0 && s <= 59;
|
|
78
|
+
}
|
|
63
79
|
};
|
|
64
80
|
}
|
|
65
81
|
if (remaining.length >= 2 && remaining.startsWith("ss") && (position === 0 || mask[position - 1] !== "s")) {
|
|
66
82
|
return {
|
|
67
83
|
pattern: /[0-9]/,
|
|
68
|
-
length: 2
|
|
84
|
+
length: 2,
|
|
85
|
+
validate: (val) => {
|
|
86
|
+
const s = Number(val);
|
|
87
|
+
return val.length === 1 ? s <= 5 : s >= 0 && s <= 59;
|
|
88
|
+
}
|
|
69
89
|
};
|
|
70
90
|
}
|
|
71
91
|
const char = mask[position];
|
|
@@ -120,8 +140,11 @@ export function applyMask(rawValue, mask) {
|
|
|
120
140
|
if (patternDef.convert) {
|
|
121
141
|
charToAdd = patternDef.convert(inputChar);
|
|
122
142
|
}
|
|
123
|
-
patternValue
|
|
124
|
-
|
|
143
|
+
const candidate = patternValue + charToAdd;
|
|
144
|
+
if (!patternDef.validate || patternDef.validate(candidate)) {
|
|
145
|
+
patternValue = candidate;
|
|
146
|
+
collected++;
|
|
147
|
+
}
|
|
125
148
|
valueIndex++;
|
|
126
149
|
} else {
|
|
127
150
|
valueIndex++;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
modelValue: {
|
|
3
|
+
type: import("vue").PropType<import("./KMultiTabs.logic.js").KMultiTabsGroup[]>;
|
|
4
|
+
default: undefined;
|
|
5
|
+
};
|
|
6
|
+
}>, {
|
|
7
|
+
addTab: (...args: any[]) => any;
|
|
8
|
+
splitScreen: (...args: any[]) => any;
|
|
9
|
+
closeSplit: (...args: any[]) => any;
|
|
10
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
"update:modelValue": (...args: any[]) => void;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
|
+
modelValue: {
|
|
14
|
+
type: import("vue").PropType<import("./KMultiTabs.logic.js").KMultiTabsGroup[]>;
|
|
15
|
+
default: undefined;
|
|
16
|
+
};
|
|
17
|
+
}>> & Readonly<{
|
|
18
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
19
|
+
}>, {
|
|
20
|
+
modelValue: import("./KMultiTabs.logic.js").KMultiTabsGroup[];
|
|
21
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
22
|
+
declare const _default: typeof __VLS_export;
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from "vue";
|
|
3
|
+
import KMultiTabs from "./KMultiTabs.global.vue";
|
|
4
|
+
import { KMultiTabsDefaultProps } from "./KMultiTabs.logic";
|
|
5
|
+
import { warnDeprecatedOnce } from "../../utils/deprecation";
|
|
6
|
+
defineProps(KMultiTabsDefaultProps);
|
|
7
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
8
|
+
warnDeprecatedOnce(
|
|
9
|
+
"MultiTabs:component",
|
|
10
|
+
"<MultiTabs> is deprecated and will be removed in a future release. Use <KMultiTabs> instead."
|
|
11
|
+
);
|
|
12
|
+
const kMultiTabsRef = ref();
|
|
13
|
+
defineExpose({
|
|
14
|
+
addTab: (...args) => kMultiTabsRef.value?.addTab?.(...args),
|
|
15
|
+
splitScreen: (...args) => kMultiTabsRef.value?.splitScreen?.(...args),
|
|
16
|
+
closeSplit: (...args) => kMultiTabsRef.value?.closeSplit?.(...args)
|
|
17
|
+
});
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template lang="pug">
|
|
21
|
+
KMultiTabs(ref="kMultiTabsRef" v-bind="{ ...$props, ...$attrs }" @update:modelValue="emit('update:modelValue', $event)")
|
|
22
|
+
template(v-for="(_, slot) in $slots" #[slot]="scope")
|
|
23
|
+
slot(:name="slot" v-bind="scope")
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
modelValue: {
|
|
3
|
+
type: import("vue").PropType<import("./KMultiTabs.logic.js").KMultiTabsGroup[]>;
|
|
4
|
+
default: undefined;
|
|
5
|
+
};
|
|
6
|
+
}>, {
|
|
7
|
+
addTab: (...args: any[]) => any;
|
|
8
|
+
splitScreen: (...args: any[]) => any;
|
|
9
|
+
closeSplit: (...args: any[]) => any;
|
|
10
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
"update:modelValue": (...args: any[]) => void;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
|
+
modelValue: {
|
|
14
|
+
type: import("vue").PropType<import("./KMultiTabs.logic.js").KMultiTabsGroup[]>;
|
|
15
|
+
default: undefined;
|
|
16
|
+
};
|
|
17
|
+
}>> & Readonly<{
|
|
18
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
19
|
+
}>, {
|
|
20
|
+
modelValue: import("./KMultiTabs.logic.js").KMultiTabsGroup[];
|
|
21
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
22
|
+
declare const _default: typeof __VLS_export;
|
|
23
|
+
export default _default;
|
|
@@ -6,6 +6,7 @@ interface Props {
|
|
|
6
6
|
pageSize?: number;
|
|
7
7
|
totalItems?: number;
|
|
8
8
|
maxVisiblePages?: number;
|
|
9
|
+
urlPageParam?: string;
|
|
9
10
|
}
|
|
10
11
|
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
11
12
|
"update:modelValue": (value: number) => any;
|
|
@@ -21,9 +22,10 @@ declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {},
|
|
|
21
22
|
"onPage-click"?: ((value: number) => any) | undefined;
|
|
22
23
|
}>, {
|
|
23
24
|
modelValue: number;
|
|
25
|
+
dataProvider: ADataProvider;
|
|
24
26
|
currentPage: number;
|
|
25
27
|
pageSize: number;
|
|
26
|
-
|
|
28
|
+
urlPageParam: string;
|
|
27
29
|
totalItems: number;
|
|
28
30
|
maxVisiblePages: number;
|
|
29
31
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -10,7 +10,8 @@ const props = defineProps({
|
|
|
10
10
|
currentPage: { type: Number, required: false, default: void 0 },
|
|
11
11
|
pageSize: { type: Number, required: false, default: void 0 },
|
|
12
12
|
totalItems: { type: Number, required: false, default: void 0 },
|
|
13
|
-
maxVisiblePages: { type: Number, required: false, default: 10 }
|
|
13
|
+
maxVisiblePages: { type: Number, required: false, default: 10 },
|
|
14
|
+
urlPageParam: { type: String, required: false, default: void 0 }
|
|
14
15
|
});
|
|
15
16
|
const emit = defineEmits(["update:modelValue", "update:currentPage", "update:pageSize", "change", "page-click"]);
|
|
16
17
|
const {
|
|
@@ -6,6 +6,7 @@ interface Props {
|
|
|
6
6
|
pageSize?: number;
|
|
7
7
|
totalItems?: number;
|
|
8
8
|
maxVisiblePages?: number;
|
|
9
|
+
urlPageParam?: string;
|
|
9
10
|
}
|
|
10
11
|
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
11
12
|
"update:modelValue": (value: number) => any;
|
|
@@ -21,9 +22,10 @@ declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {},
|
|
|
21
22
|
"onPage-click"?: ((value: number) => any) | undefined;
|
|
22
23
|
}>, {
|
|
23
24
|
modelValue: number;
|
|
25
|
+
dataProvider: ADataProvider;
|
|
24
26
|
currentPage: number;
|
|
25
27
|
pageSize: number;
|
|
26
|
-
|
|
28
|
+
urlPageParam: string;
|
|
27
29
|
totalItems: number;
|
|
28
30
|
maxVisiblePages: number;
|
|
29
31
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -6,6 +6,7 @@ export interface KPaginationProps {
|
|
|
6
6
|
pageSize?: number;
|
|
7
7
|
totalItems?: number;
|
|
8
8
|
maxVisiblePages?: number;
|
|
9
|
+
urlPageParam?: string;
|
|
9
10
|
}
|
|
10
11
|
export type KPaginationEmits = {
|
|
11
12
|
(e: 'update:modelValue', page: number): void;
|
|
@@ -19,7 +20,7 @@ export declare const KPaginationDefaultProps: {
|
|
|
19
20
|
pageSize: number;
|
|
20
21
|
};
|
|
21
22
|
export declare function useKPaginationLogic(props: KPaginationProps, emit?: KPaginationEmits): {
|
|
22
|
-
dp: ADataProvider<import("@katlux/providers").TDataRow> | undefined;
|
|
23
|
+
readonly dp: ADataProvider<import("@katlux/providers").TDataRow> | undefined;
|
|
23
24
|
totalPages: import("vue").ComputedRef<number>;
|
|
24
25
|
currentPage: import("vue").ComputedRef<number>;
|
|
25
26
|
getPageHref: (page: number) => string | undefined;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { computed, ref, watch } from "vue";
|
|
2
|
-
import { useRoute } from "vue-router";
|
|
2
|
+
import { useRoute, useRouter } from "vue-router";
|
|
3
3
|
import { useDataProvider } from "../../composables/useDataProvider.js";
|
|
4
4
|
export const KPaginationDefaultProps = {
|
|
5
5
|
maxVisiblePages: 10,
|
|
6
6
|
pageSize: 10
|
|
7
7
|
};
|
|
8
8
|
export function useKPaginationLogic(props, emit) {
|
|
9
|
-
const
|
|
10
|
-
const dpBridge = dp ? useDataProvider(dp) : null;
|
|
9
|
+
const dpBridge = useDataProvider(() => props.dataProvider);
|
|
11
10
|
const localCurrentPage = ref(props.modelValue ?? props.currentPage ?? 1);
|
|
12
11
|
const localPageSize = ref(props.pageSize ?? 10);
|
|
13
12
|
watch(() => props.modelValue, (val) => {
|
|
13
|
+
const dp = props.dataProvider;
|
|
14
14
|
const currentDpPage = dp?.currentPage?.value ?? dp?.currentPage;
|
|
15
15
|
if (val !== void 0 && val !== localCurrentPage.value && val !== currentDpPage) {
|
|
16
16
|
localCurrentPage.value = val;
|
|
@@ -20,6 +20,7 @@ export function useKPaginationLogic(props, emit) {
|
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
watch(() => props.currentPage, (val) => {
|
|
23
|
+
const dp = props.dataProvider;
|
|
23
24
|
const currentDpPage = dp?.currentPage?.value ?? dp?.currentPage;
|
|
24
25
|
if (val !== void 0 && val !== localCurrentPage.value && val !== currentDpPage) {
|
|
25
26
|
localCurrentPage.value = val;
|
|
@@ -29,6 +30,7 @@ export function useKPaginationLogic(props, emit) {
|
|
|
29
30
|
}
|
|
30
31
|
});
|
|
31
32
|
watch(() => props.pageSize, (val) => {
|
|
33
|
+
const dp = props.dataProvider;
|
|
32
34
|
const currentDpSize = dp?.pageSize?.value ?? dp?.pageSize;
|
|
33
35
|
if (val !== void 0 && val !== localPageSize.value && val !== currentDpSize) {
|
|
34
36
|
localPageSize.value = val;
|
|
@@ -39,35 +41,90 @@ export function useKPaginationLogic(props, emit) {
|
|
|
39
41
|
});
|
|
40
42
|
const rowCount = computed(() => {
|
|
41
43
|
if (props.totalItems !== void 0) return props.totalItems;
|
|
42
|
-
if (
|
|
43
|
-
return
|
|
44
|
+
if (props.dataProvider) return dpBridge.rowCount.value;
|
|
45
|
+
return 0;
|
|
44
46
|
});
|
|
45
47
|
const pageSize = computed(() => {
|
|
46
48
|
if (props.pageSize !== void 0) return props.pageSize;
|
|
47
|
-
if (
|
|
48
|
-
return
|
|
49
|
+
if (props.dataProvider) return dpBridge.pageSize.value;
|
|
50
|
+
return localPageSize.value;
|
|
49
51
|
});
|
|
50
52
|
const currentPage = computed(() => {
|
|
51
53
|
if (props.modelValue !== void 0) return props.modelValue;
|
|
52
54
|
if (props.currentPage !== void 0) return props.currentPage;
|
|
53
|
-
if (
|
|
55
|
+
if (props.dataProvider) return dpBridge.currentPage.value;
|
|
54
56
|
return localCurrentPage.value;
|
|
55
57
|
});
|
|
56
58
|
let route;
|
|
59
|
+
let router;
|
|
57
60
|
try {
|
|
58
61
|
route = useRoute();
|
|
62
|
+
router = useRouter();
|
|
59
63
|
} catch {
|
|
60
64
|
}
|
|
65
|
+
const urlParamKey = computed(() => props.urlPageParam);
|
|
66
|
+
if (urlParamKey.value && route?.query?.[urlParamKey.value]) {
|
|
67
|
+
const parsed = parseInt(String(route.query[urlParamKey.value]), 10);
|
|
68
|
+
if (!isNaN(parsed) && parsed > 0 && parsed !== currentPage.value) {
|
|
69
|
+
localCurrentPage.value = parsed;
|
|
70
|
+
const dp = props.dataProvider;
|
|
71
|
+
if (dp && typeof dp.setCurrentPage === "function") {
|
|
72
|
+
dp.setCurrentPage(parsed);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const updateUrlQuery = (page) => {
|
|
77
|
+
const param = urlParamKey.value;
|
|
78
|
+
if (!param || !router || !route) return;
|
|
79
|
+
const currentQuery = { ...route.query || {} };
|
|
80
|
+
if (page === 1) {
|
|
81
|
+
delete currentQuery[param];
|
|
82
|
+
} else {
|
|
83
|
+
currentQuery[param] = String(page);
|
|
84
|
+
}
|
|
85
|
+
router.replace({ query: currentQuery }).catch(() => {
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
watch(currentPage, (newVal) => {
|
|
89
|
+
if (urlParamKey.value && newVal) {
|
|
90
|
+
updateUrlQuery(newVal);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
watch(() => urlParamKey.value && route?.query ? route.query[urlParamKey.value] : void 0, (val) => {
|
|
94
|
+
if (!urlParamKey.value) return;
|
|
95
|
+
if (val !== void 0 && val !== null) {
|
|
96
|
+
const parsed = parseInt(String(val), 10);
|
|
97
|
+
const target = !isNaN(parsed) && parsed > 0 ? parsed : 1;
|
|
98
|
+
if (target !== currentPage.value) {
|
|
99
|
+
localCurrentPage.value = target;
|
|
100
|
+
const dp = props.dataProvider;
|
|
101
|
+
if (dp && typeof dp.setCurrentPage === "function") {
|
|
102
|
+
dp.setCurrentPage(target);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
} else if (currentPage.value !== 1) {
|
|
106
|
+
localCurrentPage.value = 1;
|
|
107
|
+
const dp = props.dataProvider;
|
|
108
|
+
if (dp && typeof dp.setCurrentPage === "function") {
|
|
109
|
+
dp.setCurrentPage(1);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
});
|
|
61
113
|
const totalPages = computed(
|
|
62
114
|
() => Math.max(1, Math.ceil(rowCount.value / (pageSize.value || 10)))
|
|
63
115
|
);
|
|
64
116
|
const maxVisiblePages = props.maxVisiblePages || 10;
|
|
65
117
|
const getPageHref = (page) => {
|
|
66
|
-
const param =
|
|
118
|
+
const param = urlParamKey.value;
|
|
67
119
|
if (!param || !route?.path) return void 0;
|
|
68
|
-
const query = { ...route.query || {}
|
|
69
|
-
|
|
70
|
-
|
|
120
|
+
const query = { ...route.query || {} };
|
|
121
|
+
if (page === 1) {
|
|
122
|
+
delete query[param];
|
|
123
|
+
} else {
|
|
124
|
+
query[param] = page.toString();
|
|
125
|
+
}
|
|
126
|
+
const queryString = Object.entries(query).filter(([_, value]) => value !== void 0 && value !== null).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`).join("&");
|
|
127
|
+
return queryString ? `${route.path}?${queryString}` : route.path;
|
|
71
128
|
};
|
|
72
129
|
const visiblePages = computed(() => {
|
|
73
130
|
if (totalPages.value <= maxVisiblePages) {
|
|
@@ -98,6 +155,7 @@ export function useKPaginationLogic(props, emit) {
|
|
|
98
155
|
return;
|
|
99
156
|
}
|
|
100
157
|
localCurrentPage.value = item;
|
|
158
|
+
const dp = props.dataProvider;
|
|
101
159
|
if (typeof dp?.setCurrentPage === "function") {
|
|
102
160
|
dp.setCurrentPage(item);
|
|
103
161
|
} else if (dp) {
|
|
@@ -107,7 +165,7 @@ export function useKPaginationLogic(props, emit) {
|
|
|
107
165
|
dp.currentPage = item;
|
|
108
166
|
}
|
|
109
167
|
}
|
|
110
|
-
if (
|
|
168
|
+
if (dp) {
|
|
111
169
|
dpBridge.currentPage.value = item;
|
|
112
170
|
}
|
|
113
171
|
emit?.("update:modelValue", item);
|
|
@@ -132,7 +190,9 @@ export function useKPaginationLogic(props, emit) {
|
|
|
132
190
|
pageClicked(totalPages.value);
|
|
133
191
|
};
|
|
134
192
|
return {
|
|
135
|
-
dp
|
|
193
|
+
get dp() {
|
|
194
|
+
return props.dataProvider;
|
|
195
|
+
},
|
|
136
196
|
totalPages,
|
|
137
197
|
currentPage,
|
|
138
198
|
getPageHref,
|
|
@@ -51,7 +51,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
51
51
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
52
52
|
}>, {
|
|
53
53
|
disabled: boolean;
|
|
54
|
-
validation: "
|
|
54
|
+
validation: "success" | "warning" | "error" | null | undefined;
|
|
55
55
|
validationText: string;
|
|
56
56
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
57
57
|
declare const _default: typeof __VLS_export;
|
|
@@ -51,7 +51,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
51
51
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
52
52
|
}>, {
|
|
53
53
|
disabled: boolean;
|
|
54
|
-
validation: "
|
|
54
|
+
validation: "success" | "warning" | "error" | null | undefined;
|
|
55
55
|
validationText: string;
|
|
56
56
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
57
57
|
declare const _default: typeof __VLS_export;
|
|
@@ -12,12 +12,13 @@ export const KTabsDefaultProps = {
|
|
|
12
12
|
export function useKTabsLogic(props = {}, emit) {
|
|
13
13
|
const openIndexes = ref([]);
|
|
14
14
|
const registeredItems = ref([]);
|
|
15
|
+
const fallbackItems = ref([]);
|
|
15
16
|
let slots = null;
|
|
16
17
|
try {
|
|
17
18
|
slots = useSlots();
|
|
18
19
|
} catch (e) {
|
|
19
20
|
}
|
|
20
|
-
const
|
|
21
|
+
const parsedSlotItems = computed(() => {
|
|
21
22
|
if (!slots?.default) return [];
|
|
22
23
|
const vnodes = slots.default();
|
|
23
24
|
const tabs = [];
|
|
@@ -33,10 +34,22 @@ export function useKTabsLogic(props = {}, emit) {
|
|
|
33
34
|
vnodes.forEach(processVNode);
|
|
34
35
|
return tabs;
|
|
35
36
|
});
|
|
37
|
+
const items = computed(() => {
|
|
38
|
+
if (registeredItems.value.length > 0) {
|
|
39
|
+
return registeredItems.value;
|
|
40
|
+
}
|
|
41
|
+
if (fallbackItems.value.length > 0) {
|
|
42
|
+
return fallbackItems.value;
|
|
43
|
+
}
|
|
44
|
+
if (parsedSlotItems.value.length > 0) {
|
|
45
|
+
return parsedSlotItems.value;
|
|
46
|
+
}
|
|
47
|
+
return fallbackItems.value;
|
|
48
|
+
});
|
|
36
49
|
const getTargetProp = () => props.modelValue !== void 0 ? props.modelValue : props.activeTab;
|
|
37
50
|
function findIndexForValue(val) {
|
|
38
51
|
if (val === void 0 || val === null) return -1;
|
|
39
|
-
const allItems = items.value
|
|
52
|
+
const allItems = items.value;
|
|
40
53
|
if (typeof val === "number") {
|
|
41
54
|
if (val >= 0 && (allItems.length === 0 || val < allItems.length)) {
|
|
42
55
|
return val;
|
|
@@ -55,7 +68,7 @@ export function useKTabsLogic(props = {}, emit) {
|
|
|
55
68
|
return -1;
|
|
56
69
|
}
|
|
57
70
|
function getValueForIndex(index) {
|
|
58
|
-
const allItems = items.value
|
|
71
|
+
const allItems = items.value;
|
|
59
72
|
const item = allItems[index];
|
|
60
73
|
if (item) {
|
|
61
74
|
if (item.value !== void 0) return item.value;
|
|
@@ -85,7 +98,7 @@ export function useKTabsLogic(props = {}, emit) {
|
|
|
85
98
|
const target = getTargetProp();
|
|
86
99
|
if (target !== void 0) {
|
|
87
100
|
const targetIndex = findIndexForValue(target);
|
|
88
|
-
if (targetIndex !== -1 &&
|
|
101
|
+
if (targetIndex !== -1 && (openIndexes.value.length !== 1 || openIndexes.value[0] !== targetIndex)) {
|
|
89
102
|
openIndexes.value = [targetIndex];
|
|
90
103
|
}
|
|
91
104
|
}
|
|
@@ -95,17 +108,26 @@ export function useKTabsLogic(props = {}, emit) {
|
|
|
95
108
|
const synced = syncFromProps();
|
|
96
109
|
if (synced) return;
|
|
97
110
|
if (openIndexes.value.length === 0) {
|
|
98
|
-
newItems.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
111
|
+
const firstOpenIndex = newItems.findIndex(
|
|
112
|
+
(item) => item.isOpen === true || item.isOpen === "true" || item.isOpen === ""
|
|
113
|
+
);
|
|
114
|
+
if (firstOpenIndex !== -1) {
|
|
115
|
+
openIndexes.value = [firstOpenIndex];
|
|
116
|
+
} else if (newItems.length > 0 && getTargetProp() === void 0) {
|
|
117
|
+
openIndexes.value = [0];
|
|
118
|
+
}
|
|
119
|
+
} else if (openIndexes.value.length > 1) {
|
|
120
|
+
openIndexes.value = [openIndexes.value[0]];
|
|
103
121
|
}
|
|
104
122
|
}, { immediate: true });
|
|
105
123
|
function registerItem(item) {
|
|
124
|
+
const existingIdx = registeredItems.value.indexOf(item);
|
|
125
|
+
if (existingIdx !== -1) {
|
|
126
|
+
return existingIdx;
|
|
127
|
+
}
|
|
106
128
|
registeredItems.value.push(item);
|
|
107
129
|
const target = getTargetProp();
|
|
108
|
-
if (target !== void 0 && openIndexes.value.length === 0) {
|
|
130
|
+
if (target !== void 0 && (openIndexes.value.length === 0 || openIndexes.value.length > 1)) {
|
|
109
131
|
const targetIndex = findIndexForValue(target);
|
|
110
132
|
if (targetIndex !== -1) {
|
|
111
133
|
openIndexes.value = [targetIndex];
|
|
@@ -147,7 +169,7 @@ export function useKTabsLogic(props = {}, emit) {
|
|
|
147
169
|
} catch (e) {
|
|
148
170
|
}
|
|
149
171
|
function onTabKeyDown(e, index) {
|
|
150
|
-
const allItems = items.value
|
|
172
|
+
const allItems = items.value;
|
|
151
173
|
const total = allItems.length;
|
|
152
174
|
if (total <= 1) return;
|
|
153
175
|
let targetIndex = -1;
|
|
@@ -57,9 +57,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
57
57
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
58
58
|
}>, {
|
|
59
59
|
label: string;
|
|
60
|
-
validation: "
|
|
61
|
-
placeholder: string;
|
|
60
|
+
validation: "success" | "warning" | "error" | null | undefined;
|
|
62
61
|
validationText: string;
|
|
62
|
+
placeholder: string;
|
|
63
63
|
rows: number;
|
|
64
64
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
65
65
|
declare const _default: typeof __VLS_export;
|
|
@@ -57,9 +57,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
57
57
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
58
58
|
}>, {
|
|
59
59
|
label: string;
|
|
60
|
-
validation: "
|
|
61
|
-
placeholder: string;
|
|
60
|
+
validation: "success" | "warning" | "error" | null | undefined;
|
|
62
61
|
validationText: string;
|
|
62
|
+
placeholder: string;
|
|
63
63
|
rows: number;
|
|
64
64
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
65
65
|
declare const _default: typeof __VLS_export;
|
|
@@ -16,6 +16,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
16
16
|
type: BooleanConstructor;
|
|
17
17
|
default: boolean;
|
|
18
18
|
};
|
|
19
|
+
loading: {
|
|
20
|
+
type: BooleanConstructor;
|
|
21
|
+
default: boolean;
|
|
22
|
+
};
|
|
19
23
|
type: {
|
|
20
24
|
type: import("vue").PropType<KTextboxProps["type"]>;
|
|
21
25
|
default: string;
|
|
@@ -30,7 +34,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
30
34
|
type: StringConstructor;
|
|
31
35
|
default: string;
|
|
32
36
|
};
|
|
33
|
-
}>, {
|
|
37
|
+
}>, {
|
|
38
|
+
focus: () => boolean;
|
|
39
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
34
40
|
"update:modelValue": (value: string) => any;
|
|
35
41
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
36
42
|
label: {
|
|
@@ -49,6 +55,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
49
55
|
type: BooleanConstructor;
|
|
50
56
|
default: boolean;
|
|
51
57
|
};
|
|
58
|
+
loading: {
|
|
59
|
+
type: BooleanConstructor;
|
|
60
|
+
default: boolean;
|
|
61
|
+
};
|
|
52
62
|
type: {
|
|
53
63
|
type: import("vue").PropType<KTextboxProps["type"]>;
|
|
54
64
|
default: string;
|
|
@@ -67,11 +77,12 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
67
77
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
68
78
|
}>, {
|
|
69
79
|
modelValue: string;
|
|
70
|
-
type: "number" | "
|
|
80
|
+
type: "number" | "url" | "search" | "text" | "password" | "email" | "tel" | undefined;
|
|
71
81
|
label: string;
|
|
72
|
-
|
|
73
|
-
|
|
82
|
+
loading: boolean;
|
|
83
|
+
validation: "success" | "warning" | "error" | null | undefined;
|
|
74
84
|
validationText: string;
|
|
85
|
+
placeholder: string;
|
|
75
86
|
showClear: boolean;
|
|
76
87
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
77
88
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useKTextboxLogic, KTextboxDefaultProps } from "./KTextbox.logic";
|
|
3
3
|
import { usePresetComponent } from "../../composables/usePresetComponent";
|
|
4
|
-
import { computed } from "vue";
|
|
4
|
+
import { computed, ref } from "vue";
|
|
5
5
|
import KTextboxDefault from "../../presets/default/components/KTextbox/KTextbox.vue";
|
|
6
|
+
import { focusTarget } from "../../utils/dom";
|
|
6
7
|
const props = defineProps(KTextboxDefaultProps);
|
|
7
8
|
const emit = defineEmits(["update:modelValue"]);
|
|
9
|
+
const presetRef = ref(null);
|
|
8
10
|
const { text, showClear, clear } = useKTextboxLogic(props, emit);
|
|
9
11
|
const presetComponent = usePresetComponent("KTextbox", KTextboxDefault);
|
|
10
12
|
const templateProps = computed(() => ({
|
|
@@ -12,13 +14,17 @@ const templateProps = computed(() => ({
|
|
|
12
14
|
text: text.value,
|
|
13
15
|
showClear: showClear.value,
|
|
14
16
|
clear,
|
|
17
|
+
loading: props.loading,
|
|
15
18
|
placeholder: props.placeholder,
|
|
16
19
|
type: props.type,
|
|
17
20
|
validation: props.validation,
|
|
18
21
|
validationText: props.validationText
|
|
19
22
|
}));
|
|
23
|
+
defineExpose({
|
|
24
|
+
focus: () => focusTarget(presetRef.value)
|
|
25
|
+
});
|
|
20
26
|
</script>
|
|
21
27
|
|
|
22
28
|
<template lang="pug">
|
|
23
|
-
component(:is="presetComponent" v-bind="{ ...templateProps, ...$attrs }" @update:text="text = $event")
|
|
29
|
+
component(:is="presetComponent" ref="presetRef" v-bind="{ ...templateProps, ...$attrs }" @update:text="text = $event")
|
|
24
30
|
</template>
|
|
@@ -16,6 +16,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
16
16
|
type: BooleanConstructor;
|
|
17
17
|
default: boolean;
|
|
18
18
|
};
|
|
19
|
+
loading: {
|
|
20
|
+
type: BooleanConstructor;
|
|
21
|
+
default: boolean;
|
|
22
|
+
};
|
|
19
23
|
type: {
|
|
20
24
|
type: import("vue").PropType<KTextboxProps["type"]>;
|
|
21
25
|
default: string;
|
|
@@ -30,7 +34,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
30
34
|
type: StringConstructor;
|
|
31
35
|
default: string;
|
|
32
36
|
};
|
|
33
|
-
}>, {
|
|
37
|
+
}>, {
|
|
38
|
+
focus: () => boolean;
|
|
39
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
34
40
|
"update:modelValue": (value: string) => any;
|
|
35
41
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
36
42
|
label: {
|
|
@@ -49,6 +55,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
49
55
|
type: BooleanConstructor;
|
|
50
56
|
default: boolean;
|
|
51
57
|
};
|
|
58
|
+
loading: {
|
|
59
|
+
type: BooleanConstructor;
|
|
60
|
+
default: boolean;
|
|
61
|
+
};
|
|
52
62
|
type: {
|
|
53
63
|
type: import("vue").PropType<KTextboxProps["type"]>;
|
|
54
64
|
default: string;
|
|
@@ -67,11 +77,12 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
67
77
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
68
78
|
}>, {
|
|
69
79
|
modelValue: string;
|
|
70
|
-
type: "number" | "
|
|
80
|
+
type: "number" | "url" | "search" | "text" | "password" | "email" | "tel" | undefined;
|
|
71
81
|
label: string;
|
|
72
|
-
|
|
73
|
-
|
|
82
|
+
loading: boolean;
|
|
83
|
+
validation: "success" | "warning" | "error" | null | undefined;
|
|
74
84
|
validationText: string;
|
|
85
|
+
placeholder: string;
|
|
75
86
|
showClear: boolean;
|
|
76
87
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
77
88
|
declare const _default: typeof __VLS_export;
|