@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
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
@update:model-value="handleSelectAll"
|
|
24
24
|
)
|
|
25
25
|
th(
|
|
26
|
-
v-for="field in visibleFields ||
|
|
26
|
+
v-for="field in visibleFields || dpFields"
|
|
27
27
|
:key="field"
|
|
28
28
|
:data-field="field"
|
|
29
29
|
:style="getColumnStyle(field)"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
tbody
|
|
36
36
|
tr.empty-row(v-if="!isLoading && (!datatableItems || datatableItems.length === 0)")
|
|
37
37
|
td.empty-state(:colspan="totalColspan")
|
|
38
|
-
span(v-if="dpFilter?.active
|
|
38
|
+
span(v-if="dpFilter?.active") {{ props.emptyFilterStateText || t('No result found for filter') }}
|
|
39
39
|
span(v-else) {{ props.emptyStateText || t('No result') }}
|
|
40
40
|
tr.k-virtual-spacer.is-top(
|
|
41
41
|
v-if="props.virtualScroll && topSpacerHeight > 0"
|
|
@@ -47,16 +47,18 @@
|
|
|
47
47
|
v-for="(row, index) in displayRows"
|
|
48
48
|
:key="getRowKey(row, index)"
|
|
49
49
|
:class="{ 'selected': isRowSelected(row), 'active-focus': focusedIndex === (props.virtualScroll ? startIndex + index : index), 'alt-row': (props.virtualScroll ? (startIndex + index) % 2 === 1 : index % 2 === 1) }"
|
|
50
|
+
:style="getRowStyle(row, index)"
|
|
50
51
|
)
|
|
51
52
|
td.check(v-if="props.bulkActions && props.bulkActions.length > 0")
|
|
52
53
|
KCheckbox(:model-value="isRowSelected(row)" @update:model-value="toggleRow(row)" :idKey="rowIdKey")
|
|
53
54
|
td(
|
|
54
|
-
v-for="visibleField in visibleFields ||
|
|
55
|
+
v-for="visibleField in visibleFields || dpFields"
|
|
55
56
|
:key="visibleField"
|
|
56
57
|
:data-field="visibleField"
|
|
57
58
|
:style="getColumnStyle(visibleField)"
|
|
58
59
|
)
|
|
59
|
-
|
|
60
|
+
span.cell-skeleton(v-if="row?.__encrypted || isCellEncrypted(row?.[visibleField])" aria-hidden="true")
|
|
61
|
+
component(v-else-if="getCellSlot(visibleField)" :is="getCellSlot(visibleField)" :row="row" :field="visibleField" :value="row[visibleField]")
|
|
60
62
|
span(v-else) {{ row[visibleField] }}
|
|
61
63
|
td.rowAction(v-if="props.rowActions && props.rowActions.length > 0")
|
|
62
64
|
template(v-for="rowAction in props.rowActions" :key="rowAction.label")
|
|
@@ -82,29 +84,28 @@
|
|
|
82
84
|
)
|
|
83
85
|
td(:colspan="totalColspan")
|
|
84
86
|
.footer(v-if="!props.virtualScroll")
|
|
85
|
-
KBulkActions.bulk-actions(v-if="props.bulkActions && props.bulkActions.length > 0" :bulkActions="props.bulkActions" :selectedRows="selectedRows" :selectAll="selectAll" :unselectedRows="unselectedRows" :
|
|
86
|
-
KPagination.pagination(:dataProvider="props.dataProvider" @update:currentPage="emit('update:currentPage', $event)" @update:pageSize="emit('update:pageSize', $event)")
|
|
87
|
+
KBulkActions.bulk-actions(v-if="props.bulkActions && props.bulkActions.length > 0" :bulkActions="props.bulkActions" :selectedRows="selectedRows" :selectAll="selectAll" :unselectedRows="unselectedRows" :totalCount="dpRowCount" :filter="activeFilter")
|
|
88
|
+
KPagination.pagination(:dataProvider="props.dataProvider" :urlPageParam="props.urlPageParam" @update:currentPage="emit('update:currentPage', $event)" @update:pageSize="emit('update:pageSize', $event)")
|
|
87
89
|
.footer.virtual-footer(v-else-if="props.bulkActions && props.bulkActions.length > 0")
|
|
88
|
-
KBulkActions.bulk-actions(:bulkActions="props.bulkActions" :selectedRows="selectedRows" :selectAll="selectAll" :unselectedRows="unselectedRows" :
|
|
90
|
+
KBulkActions.bulk-actions(:bulkActions="props.bulkActions" :selectedRows="selectedRows" :selectAll="selectAll" :unselectedRows="unselectedRows" :totalCount="dpRowCount" :filter="activeFilter")
|
|
89
91
|
</template>
|
|
90
92
|
|
|
91
93
|
<script setup lang="ts">
|
|
92
|
-
import { ref, computed
|
|
94
|
+
import { ref, computed } from 'vue'
|
|
93
95
|
import { ADataProvider } from '@katlux/providers'
|
|
94
96
|
import type { IKDatatableAction } from '@katlux/providers'
|
|
95
97
|
import { useKatluxI18n } from '#toolkit/composables/useKatluxI18n'
|
|
96
|
-
import {
|
|
97
|
-
import { useVirtualScroll } from '#toolkit/composables/useVirtualScroll'
|
|
98
|
+
import { useVirtualDataset } from '#toolkit/composables/useVirtualDataset'
|
|
98
99
|
|
|
99
100
|
const { t } = useKatluxI18n()
|
|
100
101
|
|
|
101
102
|
const props = withDefaults(defineProps<{
|
|
102
103
|
dataProvider: ADataProvider
|
|
103
|
-
visibleFields
|
|
104
|
-
rowActions
|
|
105
|
-
bulkActions
|
|
106
|
-
selectedRows
|
|
107
|
-
selectAll
|
|
104
|
+
visibleFields?: Array<string> | null
|
|
105
|
+
rowActions?: Array<IKDatatableAction>
|
|
106
|
+
bulkActions?: Array<IKDatatableAction>
|
|
107
|
+
selectedRows?: any[]
|
|
108
|
+
selectAll?: boolean
|
|
108
109
|
selectAllScope?: 'page' | 'dataset'
|
|
109
110
|
unselectedRows?: any[]
|
|
110
111
|
currentPage?: number
|
|
@@ -116,10 +117,16 @@ const props = withDefaults(defineProps<{
|
|
|
116
117
|
emptyStateText?: string
|
|
117
118
|
emptyFilterStateText?: string
|
|
118
119
|
virtualScroll?: boolean
|
|
119
|
-
itemHeight?: number
|
|
120
|
+
itemHeight?: number | ((row: any, index: number) => number)
|
|
120
121
|
viewportHeight?: number
|
|
121
122
|
buffer?: number
|
|
123
|
+
urlPageParam?: string
|
|
122
124
|
}>(), {
|
|
125
|
+
visibleFields: null,
|
|
126
|
+
rowActions: () => [],
|
|
127
|
+
bulkActions: () => [],
|
|
128
|
+
selectedRows: () => [],
|
|
129
|
+
selectAll: false,
|
|
123
130
|
selectAllScope: undefined,
|
|
124
131
|
unselectedRows: () => [],
|
|
125
132
|
virtualScroll: false,
|
|
@@ -128,6 +135,7 @@ const props = withDefaults(defineProps<{
|
|
|
128
135
|
buffer: 5,
|
|
129
136
|
emptyStateText: 'no result',
|
|
130
137
|
emptyFilterStateText: 'no result found for filter',
|
|
138
|
+
urlPageParam: undefined
|
|
131
139
|
})
|
|
132
140
|
|
|
133
141
|
const emit = defineEmits<{
|
|
@@ -155,217 +163,19 @@ const unselectedRows = computed({
|
|
|
155
163
|
set: (val) => emit('update:unselectedRows', val)
|
|
156
164
|
})
|
|
157
165
|
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
console.warn('[KDatatable] virtualScroll is enabled with selectAllScope="page". Overriding selectAllScope to "dataset" because page-scoped selection is incompatible with virtual scrolling.')
|
|
162
|
-
}
|
|
163
|
-
return 'dataset'
|
|
164
|
-
}
|
|
165
|
-
return props.selectAllScope || 'page'
|
|
166
|
-
})
|
|
167
|
-
|
|
168
|
-
const rowIdKey = computed(() => (props.dataProvider as any)?.idKey || 'id')
|
|
169
|
-
|
|
170
|
-
const getRowKey = (row: any, index: number): string | number => {
|
|
171
|
-
const idKey = (props.dataProvider as any)?.idKey || 'id'
|
|
172
|
-
if (row && row[idKey] !== undefined && row[idKey] !== null) {
|
|
173
|
-
return row[idKey]
|
|
174
|
-
}
|
|
175
|
-
if (row && row.id !== undefined && row.id !== null) {
|
|
176
|
-
return row.id
|
|
177
|
-
}
|
|
178
|
-
if (row && row._id !== undefined && row._id !== null) {
|
|
179
|
-
return row._id
|
|
180
|
-
}
|
|
181
|
-
return props.virtualScroll ? startIndex.value + index : index
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
const selectedRowIds = computed(() => {
|
|
185
|
-
const idKey = (props.dataProvider as any)?.idKey || 'id'
|
|
186
|
-
const set = new Set<any>()
|
|
187
|
-
for (const r of selectedRows.value || []) {
|
|
188
|
-
const id = r?.[idKey] ?? r?.id ?? r?._id ?? r
|
|
189
|
-
set.add(id)
|
|
190
|
-
set.add(r)
|
|
191
|
-
}
|
|
192
|
-
return set
|
|
166
|
+
const selectAllScope = computed({
|
|
167
|
+
get: () => props.selectAllScope,
|
|
168
|
+
set: (val) => emit('update:selectAllScope', val as any)
|
|
193
169
|
})
|
|
194
170
|
|
|
195
|
-
const
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
for (const r of unselectedRows.value || []) {
|
|
199
|
-
const id = r?.[idKey] ?? r?.id ?? r?._id ?? r
|
|
200
|
-
set.add(id)
|
|
201
|
-
set.add(r)
|
|
202
|
-
}
|
|
203
|
-
return set
|
|
204
|
-
})
|
|
205
|
-
|
|
206
|
-
const isRowSelected = (row: any) => {
|
|
207
|
-
const idKey = (props.dataProvider as any)?.idKey || 'id'
|
|
208
|
-
const rowId = row?.[idKey] ?? row?.id ?? row?._id ?? row
|
|
209
|
-
if (effectiveSelectAllScope.value === 'dataset' && selectAll.value) {
|
|
210
|
-
return !unselectedRowIds.value.has(rowId) && !unselectedRowIds.value.has(row)
|
|
211
|
-
}
|
|
212
|
-
return selectedRowIds.value.has(rowId) || selectedRowIds.value.has(row)
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
const pageSelectedCount = computed(() => {
|
|
216
|
-
if (!datatableItems.value || datatableItems.value.length === 0) return 0
|
|
217
|
-
let count = 0
|
|
218
|
-
const ids = selectedRowIds.value
|
|
219
|
-
const idKey = (props.dataProvider as any)?.idKey || 'id'
|
|
220
|
-
for (const r of datatableItems.value) {
|
|
221
|
-
const id = r?.[idKey] ?? r?.id ?? r?._id ?? r
|
|
222
|
-
if (ids.has(id) || ids.has(r)) count++
|
|
223
|
-
}
|
|
224
|
-
return count
|
|
225
|
-
})
|
|
226
|
-
|
|
227
|
-
const isAllSelected = computed(() => {
|
|
228
|
-
const total = datatableItems.value.length
|
|
229
|
-
if (total === 0) return false
|
|
230
|
-
if (effectiveSelectAllScope.value === 'dataset') {
|
|
231
|
-
return selectAll.value === true && unselectedRows.value.length === 0
|
|
232
|
-
}
|
|
233
|
-
return pageSelectedCount.value === total
|
|
234
|
-
})
|
|
235
|
-
|
|
236
|
-
const isIndeterminate = computed(() => {
|
|
237
|
-
const total = datatableItems.value.length
|
|
238
|
-
if (total === 0) return false
|
|
239
|
-
if (effectiveSelectAllScope.value === 'dataset') {
|
|
240
|
-
if (selectAll.value === true) {
|
|
241
|
-
return unselectedRows.value.length > 0
|
|
242
|
-
}
|
|
243
|
-
return (selectedRows.value && selectedRows.value.length > 0)
|
|
244
|
-
}
|
|
245
|
-
return pageSelectedCount.value > 0 && pageSelectedCount.value < total
|
|
246
|
-
})
|
|
247
|
-
|
|
248
|
-
const handleSelectAll = () => {
|
|
249
|
-
const total = datatableItems.value.length
|
|
250
|
-
if (total === 0) return
|
|
251
|
-
|
|
252
|
-
if (effectiveSelectAllScope.value === 'dataset') {
|
|
253
|
-
if (isAllSelected.value) {
|
|
254
|
-
selectAll.value = false
|
|
255
|
-
unselectedRows.value = []
|
|
256
|
-
selectedRows.value = []
|
|
257
|
-
} else {
|
|
258
|
-
selectAll.value = true
|
|
259
|
-
unselectedRows.value = []
|
|
260
|
-
selectedRows.value = []
|
|
261
|
-
}
|
|
262
|
-
return
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
// page scope: retain selections from other pages
|
|
266
|
-
const idKey = (props.dataProvider as any)?.idKey || 'id'
|
|
267
|
-
if (isAllSelected.value) {
|
|
268
|
-
const pageIdSet = new Set(datatableItems.value.map((r: any) => r?.[idKey] ?? r?.id ?? r?._id ?? r))
|
|
269
|
-
selectedRows.value = (selectedRows.value || []).filter((r: any) => {
|
|
270
|
-
const id = r?.[idKey] ?? r?.id ?? r?._id ?? r
|
|
271
|
-
return !pageIdSet.has(id) && !pageIdSet.has(r)
|
|
272
|
-
})
|
|
273
|
-
unselectedRows.value = []
|
|
274
|
-
selectAll.value = false
|
|
275
|
-
} else {
|
|
276
|
-
const existingIds = selectedRowIds.value
|
|
277
|
-
const toAdd = datatableItems.value.filter((r: any) => {
|
|
278
|
-
const id = r?.[idKey] ?? r?.id ?? r?._id ?? r
|
|
279
|
-
return !existingIds.has(id) && !existingIds.has(r)
|
|
280
|
-
})
|
|
281
|
-
selectedRows.value = [...(selectedRows.value || []), ...toAdd]
|
|
282
|
-
unselectedRows.value = []
|
|
283
|
-
selectAll.value = false
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
const toggleRow = (row: any) => {
|
|
288
|
-
const idKey = (props.dataProvider as any)?.idKey || 'id'
|
|
289
|
-
const rowId = row?.[idKey] ?? row?.id ?? row?._id ?? row
|
|
290
|
-
|
|
291
|
-
if (effectiveSelectAllScope.value === 'dataset' && selectAll.value) {
|
|
292
|
-
const isCurrentlyExcluded = unselectedRowIds.value.has(rowId) || unselectedRowIds.value.has(row)
|
|
293
|
-
if (isCurrentlyExcluded) {
|
|
294
|
-
unselectedRows.value = (unselectedRows.value || []).filter((r: any) => {
|
|
295
|
-
const rId = r?.[idKey] ?? r?.id ?? r?._id ?? r
|
|
296
|
-
return rId !== rowId && r !== row
|
|
297
|
-
})
|
|
298
|
-
} else {
|
|
299
|
-
unselectedRows.value = [...(unselectedRows.value || []), row]
|
|
300
|
-
}
|
|
301
|
-
return
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
const isSelected = isRowSelected(row)
|
|
305
|
-
if (isSelected) {
|
|
306
|
-
const next = (selectedRows.value || []).filter((r: any) => {
|
|
307
|
-
const rId = r?.[idKey] ?? r?.id ?? r?._id ?? r
|
|
308
|
-
return rId !== rowId && r !== row
|
|
309
|
-
})
|
|
310
|
-
selectedRows.value = next
|
|
311
|
-
} else {
|
|
312
|
-
selectedRows.value = [...(selectedRows.value || []), row]
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
const getCellSlot = (fieldName: string) => {
|
|
317
|
-
const slotName = 'cell-' + fieldName
|
|
318
|
-
return props.cellSlots?.[slotName]
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
const getHeaderSlot = (fieldName: string) => {
|
|
322
|
-
const slotName = 'header-' + fieldName
|
|
323
|
-
return props.headerSlots?.[slotName] || props.cellSlots?.[slotName]
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
const getColumnStyle = (field: string) => {
|
|
327
|
-
const w = props.columnWidths?.[field]
|
|
328
|
-
if (!w) return undefined
|
|
329
|
-
const style: Record<string, string> = { width: w, whiteSpace: 'nowrap' }
|
|
330
|
-
if (w !== '1%' && !w.endsWith('%')) {
|
|
331
|
-
style.minWidth = w
|
|
332
|
-
}
|
|
333
|
-
return style
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
const { pageData, virtualRows, filter: dpFilter, loading: dpLoading, initialLoad: dpInitialLoad } = useDataProvider(props.dataProvider)
|
|
337
|
-
const pageRows = computed(() => pageData.value || [])
|
|
338
|
-
|
|
339
|
-
const effectivePageSize = computed(() => {
|
|
340
|
-
const ps = props.pageSize ?? props.dataProvider?.pageSize
|
|
341
|
-
return isRef(ps) ? ps.value : ((ps as any)?.value ?? ps ?? 10)
|
|
342
|
-
})
|
|
343
|
-
|
|
344
|
-
const isLoading = computed(() => {
|
|
345
|
-
return dpLoading.value || dpInitialLoad.value || false
|
|
346
|
-
})
|
|
347
|
-
|
|
348
|
-
// Data source for virtualization: full items array when virtualScroll is true
|
|
349
|
-
const datatableItems = computed(() => {
|
|
350
|
-
const currentRows = pageRows.value
|
|
351
|
-
const dp = props.dataProvider as any
|
|
352
|
-
if (props.virtualScroll) {
|
|
353
|
-
if (Array.isArray(virtualRows?.value) && virtualRows.value.length > 0) return virtualRows.value
|
|
354
|
-
if (Array.isArray(dp?.rowMap)) return dp.rowMap
|
|
355
|
-
if (Array.isArray(dp?.rowMap?.value)) return dp.rowMap.value
|
|
356
|
-
if (Array.isArray(dp?.allVisibleRows)) return dp.allVisibleRows
|
|
357
|
-
if (Array.isArray(dp?.allVisibleRows?.value)) return dp.allVisibleRows.value
|
|
358
|
-
if (Array.isArray(dp?.allVisibleNodes)) return dp.allVisibleNodes
|
|
359
|
-
if (Array.isArray(dp?.allVisibleNodes?.value)) return dp.allVisibleNodes.value
|
|
360
|
-
if (Array.isArray(dp?.allData?.value)) return dp.allData.value
|
|
361
|
-
if (Array.isArray(dp?.allData)) return dp.allData
|
|
362
|
-
if (Array.isArray(dp?.data)) return dp.data
|
|
363
|
-
}
|
|
364
|
-
return currentRows
|
|
171
|
+
const pageSize = computed({
|
|
172
|
+
get: () => props.pageSize,
|
|
173
|
+
set: (val) => emit('update:pageSize', val as any)
|
|
365
174
|
})
|
|
366
175
|
|
|
367
176
|
const {
|
|
368
|
-
|
|
177
|
+
datatableItems,
|
|
178
|
+
displayRows,
|
|
369
179
|
startIndex,
|
|
370
180
|
endIndex,
|
|
371
181
|
topSpacerHeight,
|
|
@@ -374,196 +184,79 @@ const {
|
|
|
374
184
|
onScroll,
|
|
375
185
|
scrollToIndex,
|
|
376
186
|
containerCssVars,
|
|
377
|
-
scrollTop
|
|
378
|
-
|
|
379
|
-
|
|
187
|
+
scrollTop,
|
|
188
|
+
rowIdKey,
|
|
189
|
+
getRowKey,
|
|
190
|
+
isRowSelected,
|
|
191
|
+
isAllSelected,
|
|
192
|
+
isIndeterminate,
|
|
193
|
+
pageSelectedCount,
|
|
194
|
+
handleSelectAll,
|
|
195
|
+
toggleRow,
|
|
196
|
+
effectiveSelectAllScope,
|
|
197
|
+
focusedIndex,
|
|
198
|
+
handleKeyDown,
|
|
199
|
+
effectivePageSize,
|
|
200
|
+
isLoading,
|
|
201
|
+
pageRows,
|
|
202
|
+
dpRowCount,
|
|
203
|
+
dpFilter,
|
|
204
|
+
dpSortList,
|
|
205
|
+
dpFields,
|
|
206
|
+
activeFilter,
|
|
207
|
+
isCellEncrypted
|
|
208
|
+
} = useVirtualDataset({
|
|
209
|
+
dataProvider: () => props.dataProvider,
|
|
210
|
+
virtualScroll: computed(() => props.virtualScroll),
|
|
380
211
|
itemHeight: computed(() => props.itemHeight || 40),
|
|
381
|
-
|
|
212
|
+
viewportHeight: computed(() => props.viewportHeight || 500),
|
|
382
213
|
buffer: computed(() => props.buffer ?? 5),
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
} else if (typeof dp?.nextPage === 'function' && dp.hasMore) {
|
|
389
|
-
dp.nextPage()
|
|
390
|
-
}
|
|
391
|
-
}
|
|
214
|
+
pageSize,
|
|
215
|
+
selectedRows,
|
|
216
|
+
selectAll,
|
|
217
|
+
unselectedRows,
|
|
218
|
+
selectAllScope
|
|
392
219
|
})
|
|
393
220
|
|
|
394
|
-
const
|
|
395
|
-
const
|
|
396
|
-
|
|
397
|
-
// Track delivered page rows in persistent cache so previously loaded pages stay decrypted
|
|
398
|
-
watch(pageRows, (rows) => {
|
|
399
|
-
if (Array.isArray(rows) && rows.length > 0) {
|
|
400
|
-
const idKey = rowIdKey.value
|
|
401
|
-
const nextCache = new Map(deliveredRowsCache.value)
|
|
402
|
-
for (const r of rows) {
|
|
403
|
-
const id = (r as any)?.[idKey] ?? (r as any)?.id
|
|
404
|
-
if (id !== undefined && id !== null) {
|
|
405
|
-
nextCache.set(id, r)
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
deliveredRowsCache.value = nextCache
|
|
409
|
-
}
|
|
410
|
-
}, { immediate: true, deep: true })
|
|
411
|
-
|
|
412
|
-
// Reset cache on filter or sort updates
|
|
413
|
-
watch([dpFilter, () => (props.dataProvider as any)?.sortList], () => {
|
|
414
|
-
deliveredRowsCache.value = new Map()
|
|
415
|
-
requestedPages.clear()
|
|
416
|
-
const curPage = (props.dataProvider as any)?.currentPage || 1
|
|
417
|
-
requestedPages.add(curPage)
|
|
418
|
-
}, { deep: true })
|
|
419
|
-
|
|
420
|
-
let isFetchingPage = false
|
|
421
|
-
const pageQueue: number[] = []
|
|
422
|
-
|
|
423
|
-
const processPageQueue = async () => {
|
|
424
|
-
if (isFetchingPage || pageQueue.length === 0) return
|
|
425
|
-
const nextPage = pageQueue.shift()!
|
|
426
|
-
const dp = props.dataProvider as any
|
|
427
|
-
if (dp && typeof dp.setCurrentPage === 'function') {
|
|
428
|
-
isFetchingPage = true
|
|
429
|
-
try {
|
|
430
|
-
dp.setCurrentPage(nextPage)
|
|
431
|
-
if (typeof dp.loadPageData === 'function') {
|
|
432
|
-
const res = dp.loadPageData()
|
|
433
|
-
if (res instanceof Promise) await res
|
|
434
|
-
}
|
|
435
|
-
} finally {
|
|
436
|
-
isFetchingPage = false
|
|
437
|
-
if (pageQueue.length > 0) {
|
|
438
|
-
processPageQueue()
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
}
|
|
221
|
+
const getCellSlot = (fieldName: string) => {
|
|
222
|
+
const slotName = 'cell-' + fieldName
|
|
223
|
+
return props.cellSlots?.[slotName]
|
|
442
224
|
}
|
|
443
225
|
|
|
444
|
-
const
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
pageQueue.push(page)
|
|
448
|
-
processPageQueue()
|
|
449
|
-
}
|
|
226
|
+
const getHeaderSlot = (fieldName: string) => {
|
|
227
|
+
const slotName = 'header-' + fieldName
|
|
228
|
+
return props.headerSlots?.[slotName] || props.cellSlots?.[slotName]
|
|
450
229
|
}
|
|
451
230
|
|
|
452
|
-
const
|
|
453
|
-
if (
|
|
454
|
-
const
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
for (let p = startPage; p <= endPage; p++) {
|
|
463
|
-
queuePage(p)
|
|
231
|
+
const getRowStyle = (row: any, index: number) => {
|
|
232
|
+
if (typeof props.itemHeight !== 'function') return undefined
|
|
233
|
+
const absIndex = props.virtualScroll ? startIndex.value + index : index
|
|
234
|
+
const h = props.itemHeight(row, absIndex)
|
|
235
|
+
if (typeof h === 'number' && Number.isFinite(h) && h > 0) {
|
|
236
|
+
return {
|
|
237
|
+
'--virtual-item-height': `${h}px`,
|
|
238
|
+
height: `${h}px`
|
|
239
|
+
}
|
|
464
240
|
}
|
|
241
|
+
return undefined
|
|
465
242
|
}
|
|
466
243
|
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
const items = visibleItems.value
|
|
474
|
-
const cache = deliveredRowsCache.value
|
|
475
|
-
if (cache.size > 0) {
|
|
476
|
-
const idKey = rowIdKey.value
|
|
477
|
-
return items.map(item => {
|
|
478
|
-
const id = (item as any)?.[idKey] ?? (item as any)?.id
|
|
479
|
-
if (id !== undefined && id !== null && cache.has(id)) {
|
|
480
|
-
return cache.get(id)
|
|
481
|
-
}
|
|
482
|
-
return item
|
|
483
|
-
})
|
|
484
|
-
}
|
|
485
|
-
return items
|
|
244
|
+
const getColumnStyle = (field: string) => {
|
|
245
|
+
const w = props.columnWidths?.[field]
|
|
246
|
+
if (!w) return undefined
|
|
247
|
+
const style: Record<string, string> = { width: w, whiteSpace: 'nowrap' }
|
|
248
|
+
if (w !== '1%' && !w.endsWith('%')) {
|
|
249
|
+
style.minWidth = w
|
|
486
250
|
}
|
|
487
|
-
return
|
|
488
|
-
}
|
|
251
|
+
return style
|
|
252
|
+
}
|
|
489
253
|
|
|
490
254
|
const totalColspan = computed(() => {
|
|
491
|
-
const fieldsCount = (props.visibleFields ||
|
|
255
|
+
const fieldsCount = (props.visibleFields || dpFields.value || []).length
|
|
492
256
|
const checkCount = props.bulkActions && props.bulkActions.length > 0 ? 1 : 0
|
|
493
257
|
const actionCount = props.rowActions && props.rowActions.length > 0 ? 1 : 0
|
|
494
258
|
return fieldsCount + checkCount + actionCount
|
|
495
259
|
})
|
|
496
|
-
|
|
497
|
-
const focusedIndex = ref<number>(-1)
|
|
498
|
-
const theadStickyOffset = 40
|
|
499
|
-
const handleKeyDown = (e: KeyboardEvent) => {
|
|
500
|
-
if (!props.virtualScroll) return
|
|
501
|
-
const total = datatableItems.value.length
|
|
502
|
-
if (total === 0) return
|
|
503
|
-
|
|
504
|
-
const itemH = props.itemHeight || 40
|
|
505
|
-
const vpH = props.viewportHeight || 500
|
|
506
|
-
const firstInView = Math.floor(scrollTop.value / itemH)
|
|
507
|
-
const lastInView = Math.min(total - 1, Math.floor((scrollTop.value + vpH) / itemH) - 1)
|
|
508
|
-
|
|
509
|
-
const ensureVisible = (index: number) => {
|
|
510
|
-
const rowTop = index * itemH
|
|
511
|
-
const rowBottom = rowTop + itemH
|
|
512
|
-
if (rowTop < scrollTop.value) {
|
|
513
|
-
scrollToIndex(index, 'auto', index > 0 ? theadStickyOffset : 0)
|
|
514
|
-
} else if (rowBottom > scrollTop.value + vpH) {
|
|
515
|
-
const targetScroll = Math.max(0, rowBottom - vpH)
|
|
516
|
-
scrollTop.value = targetScroll
|
|
517
|
-
if (containerRef.value) {
|
|
518
|
-
containerRef.value.scrollTop = targetScroll
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
if (e.key === 'ArrowDown') {
|
|
524
|
-
e.preventDefault()
|
|
525
|
-
if (focusedIndex.value < firstInView || focusedIndex.value > lastInView) {
|
|
526
|
-
focusedIndex.value = Math.min(total - 1, firstInView)
|
|
527
|
-
} else {
|
|
528
|
-
focusedIndex.value = Math.min(total - 1, focusedIndex.value + 1)
|
|
529
|
-
}
|
|
530
|
-
ensureVisible(focusedIndex.value)
|
|
531
|
-
} else if (e.key === 'ArrowUp') {
|
|
532
|
-
e.preventDefault()
|
|
533
|
-
if (focusedIndex.value < firstInView || focusedIndex.value > lastInView) {
|
|
534
|
-
focusedIndex.value = Math.max(0, lastInView)
|
|
535
|
-
} else {
|
|
536
|
-
focusedIndex.value = Math.max(0, focusedIndex.value - 1)
|
|
537
|
-
}
|
|
538
|
-
ensureVisible(focusedIndex.value)
|
|
539
|
-
} else if (e.key === 'PageDown') {
|
|
540
|
-
e.preventDefault()
|
|
541
|
-
const step = Math.max(1, Math.floor(vpH / itemH))
|
|
542
|
-
if (focusedIndex.value < firstInView || focusedIndex.value > lastInView) {
|
|
543
|
-
focusedIndex.value = Math.min(total - 1, firstInView + step)
|
|
544
|
-
} else {
|
|
545
|
-
focusedIndex.value = Math.min(total - 1, focusedIndex.value + step)
|
|
546
|
-
}
|
|
547
|
-
ensureVisible(focusedIndex.value)
|
|
548
|
-
} else if (e.key === 'PageUp') {
|
|
549
|
-
e.preventDefault()
|
|
550
|
-
const step = Math.max(1, Math.floor(vpH / itemH))
|
|
551
|
-
if (focusedIndex.value < firstInView || focusedIndex.value > lastInView) {
|
|
552
|
-
focusedIndex.value = Math.max(0, lastInView - step)
|
|
553
|
-
} else {
|
|
554
|
-
focusedIndex.value = Math.max(0, focusedIndex.value - step)
|
|
555
|
-
}
|
|
556
|
-
ensureVisible(focusedIndex.value)
|
|
557
|
-
} else if (e.key === 'Home') {
|
|
558
|
-
e.preventDefault()
|
|
559
|
-
focusedIndex.value = 0
|
|
560
|
-
scrollToIndex(0)
|
|
561
|
-
} else if (e.key === 'End') {
|
|
562
|
-
e.preventDefault()
|
|
563
|
-
focusedIndex.value = total - 1
|
|
564
|
-
scrollToIndex(total - 1, 'auto', theadStickyOffset)
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
260
|
</script>
|
|
568
261
|
|
|
569
262
|
<style lang="scss" scoped>
|
|
@@ -621,6 +314,23 @@ const handleKeyDown = (e: KeyboardEvent) => {
|
|
|
621
314
|
&:first-child {
|
|
622
315
|
border-left: none;
|
|
623
316
|
}
|
|
317
|
+
|
|
318
|
+
.cell-skeleton {
|
|
319
|
+
display: inline-block;
|
|
320
|
+
width: 65%;
|
|
321
|
+
min-width: 48px;
|
|
322
|
+
height: 1em;
|
|
323
|
+
border-radius: var(--border-radius-sm, 4px);
|
|
324
|
+
background: linear-gradient(
|
|
325
|
+
90deg,
|
|
326
|
+
var(--color-bg-subtle, rgba(0, 0, 0, 0.06)) 25%,
|
|
327
|
+
var(--color-bg-muted, rgba(0, 0, 0, 0.12)) 50%,
|
|
328
|
+
var(--color-bg-subtle, rgba(0, 0, 0, 0.06)) 75%
|
|
329
|
+
);
|
|
330
|
+
background-size: 200% 100%;
|
|
331
|
+
animation: k-skeleton-pulse 1.5s ease-in-out infinite;
|
|
332
|
+
vertical-align: middle;
|
|
333
|
+
}
|
|
624
334
|
}
|
|
625
335
|
td.empty-state {
|
|
626
336
|
text-align: center;
|
|
@@ -707,5 +417,14 @@ const handleKeyDown = (e: KeyboardEvent) => {
|
|
|
707
417
|
}
|
|
708
418
|
}
|
|
709
419
|
}
|
|
420
|
+
|
|
421
|
+
@keyframes k-skeleton-pulse {
|
|
422
|
+
0% {
|
|
423
|
+
background-position: 200% 0;
|
|
424
|
+
}
|
|
425
|
+
100% {
|
|
426
|
+
background-position: -200% 0;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
710
429
|
}
|
|
711
430
|
</style>
|
|
@@ -2,11 +2,11 @@ import { ADataProvider } from '@katlux/providers';
|
|
|
2
2
|
import type { IKDatatableAction } from '@katlux/providers';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
dataProvider: ADataProvider;
|
|
5
|
-
visibleFields
|
|
6
|
-
rowActions
|
|
7
|
-
bulkActions
|
|
8
|
-
selectedRows
|
|
9
|
-
selectAll
|
|
5
|
+
visibleFields?: Array<string> | null;
|
|
6
|
+
rowActions?: Array<IKDatatableAction>;
|
|
7
|
+
bulkActions?: Array<IKDatatableAction>;
|
|
8
|
+
selectedRows?: any[];
|
|
9
|
+
selectAll?: boolean;
|
|
10
10
|
selectAllScope?: 'page' | 'dataset';
|
|
11
11
|
unselectedRows?: any[];
|
|
12
12
|
currentPage?: number;
|
|
@@ -18,31 +18,38 @@ type __VLS_Props = {
|
|
|
18
18
|
emptyStateText?: string;
|
|
19
19
|
emptyFilterStateText?: string;
|
|
20
20
|
virtualScroll?: boolean;
|
|
21
|
-
itemHeight?: number;
|
|
21
|
+
itemHeight?: number | ((row: any, index: number) => number);
|
|
22
22
|
viewportHeight?: number;
|
|
23
23
|
buffer?: number;
|
|
24
|
+
urlPageParam?: string;
|
|
24
25
|
};
|
|
25
26
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
26
27
|
"update:currentPage": (value: number) => any;
|
|
27
28
|
"update:pageSize": (value: number) => any;
|
|
28
29
|
"update:selectedRows": (value: any[]) => any;
|
|
29
30
|
"update:selectAll": (value: boolean) => any;
|
|
30
|
-
"update:unselectedRows": (value: any[]) => any;
|
|
31
31
|
"update:selectAllScope": (value: "page" | "dataset") => any;
|
|
32
|
+
"update:unselectedRows": (value: any[]) => any;
|
|
32
33
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
33
34
|
"onUpdate:currentPage"?: ((value: number) => any) | undefined;
|
|
34
35
|
"onUpdate:pageSize"?: ((value: number) => any) | undefined;
|
|
35
36
|
"onUpdate:selectedRows"?: ((value: any[]) => any) | undefined;
|
|
36
37
|
"onUpdate:selectAll"?: ((value: boolean) => any) | undefined;
|
|
37
|
-
"onUpdate:unselectedRows"?: ((value: any[]) => any) | undefined;
|
|
38
38
|
"onUpdate:selectAllScope"?: ((value: "page" | "dataset") => any) | undefined;
|
|
39
|
+
"onUpdate:unselectedRows"?: ((value: any[]) => any) | undefined;
|
|
39
40
|
}>, {
|
|
41
|
+
selectedRows: any[];
|
|
40
42
|
unselectedRows: any[];
|
|
43
|
+
bulkActions: Array<IKDatatableAction>;
|
|
44
|
+
selectAll: boolean;
|
|
45
|
+
selectAllScope: "page" | "dataset";
|
|
41
46
|
virtualScroll: boolean;
|
|
42
|
-
itemHeight: number;
|
|
47
|
+
itemHeight: number | ((row: any, index: number) => number);
|
|
43
48
|
buffer: number;
|
|
49
|
+
visibleFields: Array<string> | null;
|
|
44
50
|
viewportHeight: number;
|
|
45
|
-
|
|
51
|
+
rowActions: Array<IKDatatableAction>;
|
|
52
|
+
urlPageParam: string;
|
|
46
53
|
emptyStateText: string;
|
|
47
54
|
emptyFilterStateText: string;
|
|
48
55
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|