@katlux/toolkit 0.1.1-alpha.144 → 0.1.1-alpha.146
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/bin/ai-init.mjs +517 -0
- package/bin/ai-tokens.mjs +1043 -0
- package/bin/cli.mjs +80 -43
- package/bin/create-preset.mjs +1 -0
- package/bin/preset-contracts.json +2941 -0
- package/dist/compiled/composables/locales.mjs +204 -25
- package/dist/compiled/composables/useDataProvider.mjs +36 -25
- package/dist/compiled/composables/useFilterLogic.mjs +10 -2
- package/dist/compiled/composables/useKatluxForm.mjs +6 -4
- package/dist/compiled/composables/useVirtualDataset.mjs +689 -0
- package/dist/compiled/composables/useVirtualScroll.mjs +29 -9
- package/dist/module.cjs +63 -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 +60 -78
- package/dist/runtime/components/KAccordion/KAccordion.global.d.vue.ts +2 -2
- package/dist/runtime/components/KAccordion/KAccordion.global.vue.d.ts +2 -2
- package/dist/runtime/components/KAlert/KAlert.global.d.vue.ts +1 -1
- package/dist/runtime/components/KAlert/KAlert.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 +4 -2
- package/dist/runtime/components/KBulkActions/KBulkActions.logic.js +70 -37
- package/dist/runtime/components/KButton/KButton.global.d.vue.ts +2 -2
- package/dist/runtime/components/KButton/KButton.global.vue.d.ts +2 -2
- package/dist/runtime/components/KButton/KButton.logic.d.ts +1 -1
- package/dist/runtime/components/KCalendar/KCalendar.global.d.vue.ts +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 +60 -11
- package/dist/runtime/components/KCalendar/KCalendarMonth.global.d.vue.ts +25 -5
- package/dist/runtime/components/KCalendar/KCalendarMonth.global.vue +11 -1
- package/dist/runtime/components/KCalendar/KCalendarMonth.global.vue.d.ts +25 -5
- package/dist/runtime/components/KCalendar/KCalendarMonth.logic.d.ts +19 -3
- package/dist/runtime/components/KCalendar/KCalendarMonth.logic.js +115 -1
- 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 +9 -9
- package/dist/runtime/components/KCombobox/KCombobox.global.vue +1 -1
- package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +9 -9
- package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +7 -1
- package/dist/runtime/components/KCombobox/KCombobox.logic.js +1 -1
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +14 -14
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +14 -14
- package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.d.ts +3 -3
- package/dist/runtime/components/KContextMenu/KContextMenu.logic.js +5 -0
- package/dist/runtime/components/KDatatable/KDataIterator.global.d.vue.ts +22 -18
- package/dist/runtime/components/KDatatable/KDataIterator.global.vue +23 -16
- package/dist/runtime/components/KDatatable/KDataIterator.global.vue.d.ts +22 -18
- package/dist/runtime/components/KDatatable/KDataIterator.logic.d.ts +13 -10
- package/dist/runtime/components/KDatatable/KDataIterator.logic.js +25 -20
- package/dist/runtime/components/KDatatable/KDatatable.global.d.vue.ts +9 -13
- package/dist/runtime/components/KDatatable/KDatatable.global.vue +6 -5
- package/dist/runtime/components/KDatatable/KDatatable.global.vue.d.ts +9 -13
- package/dist/runtime/components/KDatatable/KDatatable.logic.d.ts +4 -6
- package/dist/runtime/components/KDatatable/KDatatable.logic.js +26 -19
- package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +31 -15
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue +38 -13
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +31 -15
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.d.ts +28 -6
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.js +197 -53
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +3 -3
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +3 -3
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.js +2 -0
- package/dist/runtime/components/KDropdown/KDropdown.global.d.vue.ts +1 -1
- package/dist/runtime/components/KDropdown/KDropdown.global.vue.d.ts +1 -1
- package/dist/runtime/components/KGantt/KGantt.global.d.vue.ts +55 -6
- package/dist/runtime/components/KGantt/KGantt.global.vue +12 -3
- package/dist/runtime/components/KGantt/KGantt.global.vue.d.ts +55 -6
- 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/KHourPicker/KHourPicker.global.d.vue.ts +2 -2
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +2 -2
- package/dist/runtime/components/KHourSelect/KHourSelect.global.d.vue.ts +1 -1
- package/dist/runtime/components/KHourSelect/KHourSelect.global.vue.d.ts +1 -1
- package/dist/runtime/components/KLoader/KLoader.global.vue +2 -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/KMultiTabs/MultiTabs.global.d.vue.ts +23 -0
- package/dist/runtime/components/KMultiTabs/MultiTabs.global.vue +22 -0
- package/dist/runtime/components/KMultiTabs/MultiTabs.global.vue.d.ts +23 -0
- package/dist/runtime/components/KPagination/KPagination.global.d.vue.ts +4 -2
- package/dist/runtime/components/KPagination/KPagination.global.vue +2 -1
- package/dist/runtime/components/KPagination/KPagination.global.vue.d.ts +4 -2
- package/dist/runtime/components/KPagination/KPagination.logic.d.ts +1 -0
- package/dist/runtime/components/KPagination/KPagination.logic.js +57 -5
- 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/KRangeSlider/KRangeSlider.global.d.vue.ts +1 -1
- package/dist/runtime/components/KRangeSlider/KRangeSlider.global.vue.d.ts +1 -1
- package/dist/runtime/components/KSlider/KSlider.global.d.vue.ts +1 -1
- package/dist/runtime/components/KSlider/KSlider.global.vue.d.ts +1 -1
- package/dist/runtime/components/KTabs/KTabs.global.d.vue.ts +2 -2
- package/dist/runtime/components/KTabs/KTabs.global.vue.d.ts +2 -2
- 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 +3 -3
- package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +3 -3
- package/dist/runtime/components/KToast/KToast.global.d.vue.ts +3 -3
- package/dist/runtime/components/KToast/KToast.global.vue.d.ts +3 -3
- package/dist/runtime/components/KTooltip/KTooltip.global.d.vue.ts +1 -1
- package/dist/runtime/components/KTooltip/KTooltip.global.vue.d.ts +1 -1
- package/dist/runtime/components/KTree/KTree.global.d.vue.ts +7 -7
- package/dist/runtime/components/KTree/KTree.global.vue.d.ts +7 -7
- package/dist/runtime/components/KTree/KTree.logic.d.ts +2 -2
- package/dist/runtime/components/KTree/KTree.logic.js +16 -12
- package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +7 -9
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue +1 -5
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +7 -9
- package/dist/runtime/components/KTreeView/KTreeView.global.d.vue.ts +39 -5
- package/dist/runtime/components/KTreeView/KTreeView.global.vue +19 -1
- package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +39 -5
- package/dist/runtime/components/KTreeView/KTreeView.logic.d.ts +23 -3
- package/dist/runtime/components/KTreeView/KTreeView.logic.js +76 -6
- package/dist/runtime/composables/locales.js +204 -25
- package/dist/runtime/composables/useDataProvider.d.ts +5 -3
- package/dist/runtime/composables/useDataProvider.js +36 -25
- 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 +6 -4
- package/dist/runtime/composables/useSortLogic.d.ts +1 -1
- package/dist/runtime/composables/useVirtualDataset.d.ts +121 -0
- package/dist/runtime/composables/useVirtualDataset.js +689 -0
- package/dist/runtime/composables/useVirtualScroll.d.ts +8 -4
- package/dist/runtime/composables/useVirtualScroll.js +29 -9
- package/dist/runtime/plugins/nuxtCompatPlugin.js +9 -1
- 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 +5 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue +33 -2
- package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue.d.ts +5 -0
- package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.d.vue.ts +2 -2
- package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue.d.ts +2 -2
- package/dist/runtime/presets/default/components/KContextMenu/KContextMenu.vue +7 -1
- package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.d.vue.ts +30 -8
- package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.vue +80 -164
- package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.vue.d.ts +30 -8
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.d.vue.ts +16 -9
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +99 -394
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue.d.ts +16 -9
- 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/KGantt/KGantt.d.vue.ts +11 -12
- package/dist/runtime/presets/default/components/KGantt/KGantt.vue +77 -14
- package/dist/runtime/presets/default/components/KGantt/KGantt.vue.d.ts +11 -12
- package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue +1 -0
- package/dist/runtime/presets/default/components/KToast/KToast.d.vue.ts +2 -2
- package/dist/runtime/presets/default/components/KToast/KToast.vue.d.ts +2 -2
- package/dist/runtime/presets/default/components/KTree/KTree.d.vue.ts +4 -4
- package/dist/runtime/presets/default/components/KTree/KTree.vue +48 -14
- package/dist/runtime/presets/default/components/KTree/KTree.vue.d.ts +4 -4
- 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/skills/KATLUX_INDEX.md +9 -6
- package/dist/skills/katlux-components/SKILL.md +2 -0
- package/dist/skills/katlux-components/components/KBulkActions.md +25 -1
- package/dist/skills/katlux-components/components/KCombobox.md +2 -2
- package/dist/skills/katlux-components/components/KDataIterator.md +12 -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/KLineChart.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/KTreePicker.md +2 -1
- package/dist/skills/katlux-components/components/KTreeView.md +12 -0
- package/dist/skills/katlux-config/SKILL.md +19 -8
- package/dist/skills/katlux-presets/SKILL.md +121 -1
- package/dist/skills/katlux-presets/creating-a-preset.md +67 -0
- package/dist/skills/katlux-providers/SKILL.md +7 -5
- package/dist/skills/katlux-providers/providers/ADataProvider.md +16 -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/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 +63 -19
- package/dist/skills/katlux-providers/providers/encryption-key-management.md +20 -2
- package/dist/skills/katlux-providers/providers/encryption-key-pinning.md +25 -11
- package/dist/skills/katlux-providers/providers/encryption-searchable.md +218 -0
- package/dist/skills/katlux-providers/providers/encryption-symmetric.md +25 -1
- package/dist/skills/katlux-providers/providers/encryption-threat-model.md +63 -0
- 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 +9 -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"
|
|
@@ -51,12 +51,13 @@
|
|
|
51
51
|
td.check(v-if="props.bulkActions && props.bulkActions.length > 0")
|
|
52
52
|
KCheckbox(:model-value="isRowSelected(row)" @update:model-value="toggleRow(row)" :idKey="rowIdKey")
|
|
53
53
|
td(
|
|
54
|
-
v-for="visibleField in visibleFields ||
|
|
54
|
+
v-for="visibleField in visibleFields || dpFields"
|
|
55
55
|
:key="visibleField"
|
|
56
56
|
:data-field="visibleField"
|
|
57
57
|
:style="getColumnStyle(visibleField)"
|
|
58
58
|
)
|
|
59
|
-
|
|
59
|
+
span.cell-skeleton(v-if="row?.__encrypted || isCellEncrypted(row?.[visibleField])" aria-hidden="true")
|
|
60
|
+
component(v-else-if="getCellSlot(visibleField)" :is="getCellSlot(visibleField)" :row="row" :field="visibleField" :value="row[visibleField]")
|
|
60
61
|
span(v-else) {{ row[visibleField] }}
|
|
61
62
|
td.rowAction(v-if="props.rowActions && props.rowActions.length > 0")
|
|
62
63
|
template(v-for="rowAction in props.rowActions" :key="rowAction.label")
|
|
@@ -82,29 +83,28 @@
|
|
|
82
83
|
)
|
|
83
84
|
td(:colspan="totalColspan")
|
|
84
85
|
.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)")
|
|
86
|
+
KBulkActions.bulk-actions(v-if="props.bulkActions && props.bulkActions.length > 0" :bulkActions="props.bulkActions" :selectedRows="selectedRows" :selectAll="selectAll" :unselectedRows="unselectedRows" :totalCount="dpRowCount" :filter="activeFilter")
|
|
87
|
+
KPagination.pagination(:dataProvider="props.dataProvider" :urlPageParam="props.urlPageParam" @update:currentPage="emit('update:currentPage', $event)" @update:pageSize="emit('update:pageSize', $event)")
|
|
87
88
|
.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" :
|
|
89
|
+
KBulkActions.bulk-actions(:bulkActions="props.bulkActions" :selectedRows="selectedRows" :selectAll="selectAll" :unselectedRows="unselectedRows" :totalCount="dpRowCount" :filter="activeFilter")
|
|
89
90
|
</template>
|
|
90
91
|
|
|
91
92
|
<script setup lang="ts">
|
|
92
|
-
import { ref, computed
|
|
93
|
+
import { ref, computed } from 'vue'
|
|
93
94
|
import { ADataProvider } from '@katlux/providers'
|
|
94
95
|
import type { IKDatatableAction } from '@katlux/providers'
|
|
95
96
|
import { useKatluxI18n } from '#toolkit/composables/useKatluxI18n'
|
|
96
|
-
import {
|
|
97
|
-
import { useVirtualScroll } from '#toolkit/composables/useVirtualScroll'
|
|
97
|
+
import { useVirtualDataset } from '#toolkit/composables/useVirtualDataset'
|
|
98
98
|
|
|
99
99
|
const { t } = useKatluxI18n()
|
|
100
100
|
|
|
101
101
|
const props = withDefaults(defineProps<{
|
|
102
102
|
dataProvider: ADataProvider
|
|
103
|
-
visibleFields
|
|
104
|
-
rowActions
|
|
105
|
-
bulkActions
|
|
106
|
-
selectedRows
|
|
107
|
-
selectAll
|
|
103
|
+
visibleFields?: Array<string> | null
|
|
104
|
+
rowActions?: Array<IKDatatableAction>
|
|
105
|
+
bulkActions?: Array<IKDatatableAction>
|
|
106
|
+
selectedRows?: any[]
|
|
107
|
+
selectAll?: boolean
|
|
108
108
|
selectAllScope?: 'page' | 'dataset'
|
|
109
109
|
unselectedRows?: any[]
|
|
110
110
|
currentPage?: number
|
|
@@ -116,10 +116,16 @@ const props = withDefaults(defineProps<{
|
|
|
116
116
|
emptyStateText?: string
|
|
117
117
|
emptyFilterStateText?: string
|
|
118
118
|
virtualScroll?: boolean
|
|
119
|
-
itemHeight?: number
|
|
119
|
+
itemHeight?: number | ((row: any, index: number) => number)
|
|
120
120
|
viewportHeight?: number
|
|
121
121
|
buffer?: number
|
|
122
|
+
urlPageParam?: string
|
|
122
123
|
}>(), {
|
|
124
|
+
visibleFields: null,
|
|
125
|
+
rowActions: () => [],
|
|
126
|
+
bulkActions: () => [],
|
|
127
|
+
selectedRows: () => [],
|
|
128
|
+
selectAll: false,
|
|
123
129
|
selectAllScope: undefined,
|
|
124
130
|
unselectedRows: () => [],
|
|
125
131
|
virtualScroll: false,
|
|
@@ -128,6 +134,7 @@ const props = withDefaults(defineProps<{
|
|
|
128
134
|
buffer: 5,
|
|
129
135
|
emptyStateText: 'no result',
|
|
130
136
|
emptyFilterStateText: 'no result found for filter',
|
|
137
|
+
urlPageParam: undefined
|
|
131
138
|
})
|
|
132
139
|
|
|
133
140
|
const emit = defineEmits<{
|
|
@@ -155,164 +162,61 @@ const unselectedRows = computed({
|
|
|
155
162
|
set: (val) => emit('update:unselectedRows', val)
|
|
156
163
|
})
|
|
157
164
|
|
|
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
|
|
193
|
-
})
|
|
194
|
-
|
|
195
|
-
const unselectedRowIds = computed(() => {
|
|
196
|
-
const idKey = (props.dataProvider as any)?.idKey || 'id'
|
|
197
|
-
const set = new Set<any>()
|
|
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
|
|
165
|
+
const selectAllScope = computed({
|
|
166
|
+
get: () => props.selectAllScope,
|
|
167
|
+
set: (val) => emit('update:selectAllScope', val as any)
|
|
225
168
|
})
|
|
226
169
|
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
if (effectiveSelectAllScope.value === 'dataset') {
|
|
231
|
-
return selectAll.value === true && unselectedRows.value.length === 0
|
|
232
|
-
}
|
|
233
|
-
return pageSelectedCount.value === total
|
|
170
|
+
const pageSize = computed({
|
|
171
|
+
get: () => props.pageSize,
|
|
172
|
+
set: (val) => emit('update:pageSize', val as any)
|
|
234
173
|
})
|
|
235
174
|
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
175
|
+
const {
|
|
176
|
+
datatableItems,
|
|
177
|
+
displayRows,
|
|
178
|
+
startIndex,
|
|
179
|
+
endIndex,
|
|
180
|
+
topSpacerHeight,
|
|
181
|
+
bottomSpacerHeight,
|
|
182
|
+
containerRef,
|
|
183
|
+
onScroll,
|
|
184
|
+
scrollToIndex,
|
|
185
|
+
containerCssVars,
|
|
186
|
+
scrollTop,
|
|
187
|
+
rowIdKey,
|
|
188
|
+
getRowKey,
|
|
189
|
+
isRowSelected,
|
|
190
|
+
isAllSelected,
|
|
191
|
+
isIndeterminate,
|
|
192
|
+
pageSelectedCount,
|
|
193
|
+
handleSelectAll,
|
|
194
|
+
toggleRow,
|
|
195
|
+
effectiveSelectAllScope,
|
|
196
|
+
focusedIndex,
|
|
197
|
+
handleKeyDown,
|
|
198
|
+
effectivePageSize,
|
|
199
|
+
isLoading,
|
|
200
|
+
pageRows,
|
|
201
|
+
dpRowCount,
|
|
202
|
+
dpFilter,
|
|
203
|
+
dpSortList,
|
|
204
|
+
dpFields,
|
|
205
|
+
activeFilter,
|
|
206
|
+
isCellEncrypted
|
|
207
|
+
} = useVirtualDataset({
|
|
208
|
+
dataProvider: () => props.dataProvider,
|
|
209
|
+
virtualScroll: computed(() => props.virtualScroll),
|
|
210
|
+
itemHeight: computed(() => props.itemHeight || 40),
|
|
211
|
+
viewportHeight: computed(() => props.viewportHeight || 500),
|
|
212
|
+
buffer: computed(() => props.buffer ?? 5),
|
|
213
|
+
pageSize,
|
|
214
|
+
selectedRows,
|
|
215
|
+
selectAll,
|
|
216
|
+
unselectedRows,
|
|
217
|
+
selectAllScope
|
|
246
218
|
})
|
|
247
219
|
|
|
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
220
|
const getCellSlot = (fieldName: string) => {
|
|
317
221
|
const slotName = 'cell-' + fieldName
|
|
318
222
|
return props.cellSlots?.[slotName]
|
|
@@ -333,237 +237,12 @@ const getColumnStyle = (field: string) => {
|
|
|
333
237
|
return style
|
|
334
238
|
}
|
|
335
239
|
|
|
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
|
|
365
|
-
})
|
|
366
|
-
|
|
367
|
-
const {
|
|
368
|
-
visibleItems,
|
|
369
|
-
startIndex,
|
|
370
|
-
endIndex,
|
|
371
|
-
topSpacerHeight,
|
|
372
|
-
bottomSpacerHeight,
|
|
373
|
-
containerRef,
|
|
374
|
-
onScroll,
|
|
375
|
-
scrollToIndex,
|
|
376
|
-
containerCssVars,
|
|
377
|
-
scrollTop
|
|
378
|
-
} = useVirtualScroll({
|
|
379
|
-
items: datatableItems,
|
|
380
|
-
itemHeight: computed(() => props.itemHeight || 40),
|
|
381
|
-
containerHeight: computed(() => props.viewportHeight || 500),
|
|
382
|
-
buffer: computed(() => props.buffer ?? 5),
|
|
383
|
-
virtualScroll: computed(() => !!props.virtualScroll),
|
|
384
|
-
onThresholdReach: () => {
|
|
385
|
-
const dp = props.dataProvider as any
|
|
386
|
-
if (typeof dp?.loadMore === 'function') {
|
|
387
|
-
dp.loadMore()
|
|
388
|
-
} else if (typeof dp?.nextPage === 'function' && dp.hasMore) {
|
|
389
|
-
dp.nextPage()
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
})
|
|
393
|
-
|
|
394
|
-
const deliveredRowsCache = shallowRef<Map<any, any>>(new Map())
|
|
395
|
-
const requestedPages = new Set<number>()
|
|
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
|
-
}
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
const queuePage = (page: number) => {
|
|
445
|
-
if (!requestedPages.has(page)) {
|
|
446
|
-
requestedPages.add(page)
|
|
447
|
-
pageQueue.push(page)
|
|
448
|
-
processPageQueue()
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
const ensureVisiblePagesLoaded = () => {
|
|
453
|
-
if (!props.virtualScroll) return
|
|
454
|
-
const ps = effectivePageSize.value
|
|
455
|
-
if (!ps || ps <= 0) return
|
|
456
|
-
|
|
457
|
-
const start = startIndex.value
|
|
458
|
-
const end = endIndex.value
|
|
459
|
-
const startPage = Math.floor(start / ps) + 1
|
|
460
|
-
const endPage = Math.floor(Math.max(0, end - 1) / ps) + 1
|
|
461
|
-
|
|
462
|
-
for (let p = startPage; p <= endPage; p++) {
|
|
463
|
-
queuePage(p)
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
watch([startIndex, endIndex], () => {
|
|
468
|
-
ensureVisiblePagesLoaded()
|
|
469
|
-
}, { immediate: true })
|
|
470
|
-
|
|
471
|
-
const displayRows = computed(() => {
|
|
472
|
-
if (props.virtualScroll) {
|
|
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
|
|
486
|
-
}
|
|
487
|
-
return pageRows.value
|
|
488
|
-
})
|
|
489
|
-
|
|
490
240
|
const totalColspan = computed(() => {
|
|
491
|
-
const fieldsCount = (props.visibleFields ||
|
|
241
|
+
const fieldsCount = (props.visibleFields || dpFields.value || []).length
|
|
492
242
|
const checkCount = props.bulkActions && props.bulkActions.length > 0 ? 1 : 0
|
|
493
243
|
const actionCount = props.rowActions && props.rowActions.length > 0 ? 1 : 0
|
|
494
244
|
return fieldsCount + checkCount + actionCount
|
|
495
245
|
})
|
|
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
246
|
</script>
|
|
568
247
|
|
|
569
248
|
<style lang="scss" scoped>
|
|
@@ -621,6 +300,23 @@ const handleKeyDown = (e: KeyboardEvent) => {
|
|
|
621
300
|
&:first-child {
|
|
622
301
|
border-left: none;
|
|
623
302
|
}
|
|
303
|
+
|
|
304
|
+
.cell-skeleton {
|
|
305
|
+
display: inline-block;
|
|
306
|
+
width: 65%;
|
|
307
|
+
min-width: 48px;
|
|
308
|
+
height: 1em;
|
|
309
|
+
border-radius: var(--border-radius-sm, 4px);
|
|
310
|
+
background: linear-gradient(
|
|
311
|
+
90deg,
|
|
312
|
+
var(--color-bg-subtle, rgba(0, 0, 0, 0.06)) 25%,
|
|
313
|
+
var(--color-bg-muted, rgba(0, 0, 0, 0.12)) 50%,
|
|
314
|
+
var(--color-bg-subtle, rgba(0, 0, 0, 0.06)) 75%
|
|
315
|
+
);
|
|
316
|
+
background-size: 200% 100%;
|
|
317
|
+
animation: k-skeleton-pulse 1.5s ease-in-out infinite;
|
|
318
|
+
vertical-align: middle;
|
|
319
|
+
}
|
|
624
320
|
}
|
|
625
321
|
td.empty-state {
|
|
626
322
|
text-align: center;
|
|
@@ -707,5 +403,14 @@ const handleKeyDown = (e: KeyboardEvent) => {
|
|
|
707
403
|
}
|
|
708
404
|
}
|
|
709
405
|
}
|
|
406
|
+
|
|
407
|
+
@keyframes k-skeleton-pulse {
|
|
408
|
+
0% {
|
|
409
|
+
background-position: 200% 0;
|
|
410
|
+
}
|
|
411
|
+
100% {
|
|
412
|
+
background-position: -200% 0;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
710
415
|
}
|
|
711
416
|
</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;
|
|
41
45
|
virtualScroll: boolean;
|
|
42
|
-
itemHeight: number;
|
|
46
|
+
itemHeight: number | ((row: any, index: number) => number);
|
|
43
47
|
buffer: number;
|
|
48
|
+
visibleFields: Array<string> | null;
|
|
44
49
|
viewportHeight: number;
|
|
50
|
+
rowActions: Array<IKDatatableAction>;
|
|
45
51
|
selectAllScope: "page" | "dataset";
|
|
52
|
+
urlPageParam: string;
|
|
46
53
|
emptyStateText: string;
|
|
47
54
|
emptyFilterStateText: string;
|
|
48
55
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { IMarkedDay, IDefinedDay } from '#toolkit/components/KCalendar/types';
|
|
2
|
+
import type { IDatePickerQuickPreset } from '#toolkit/components/KDatePicker/KDatePicker.logic';
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
label?: string;
|
|
4
5
|
maskedModel: string;
|
|
@@ -6,6 +7,7 @@ type __VLS_Props = {
|
|
|
6
7
|
_date: any;
|
|
7
8
|
calendarDay: Date | string;
|
|
8
9
|
format: string;
|
|
10
|
+
effectiveMask?: string;
|
|
9
11
|
showClear: boolean;
|
|
10
12
|
definedDays?: IDefinedDay[];
|
|
11
13
|
markedDays?: IMarkedDay[];
|
|
@@ -17,6 +19,10 @@ type __VLS_Props = {
|
|
|
17
19
|
validation?: 'success' | 'warning' | null | 'error';
|
|
18
20
|
validationText?: string;
|
|
19
21
|
align?: 'left' | 'right';
|
|
22
|
+
range?: boolean;
|
|
23
|
+
viewCount?: number;
|
|
24
|
+
quickPresets?: IDatePickerQuickPreset[];
|
|
25
|
+
applyQuickPreset?: (id: string) => void;
|
|
20
26
|
};
|
|
21
27
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
22
28
|
blur: (event: FocusEvent) => any;
|