@vc-shell/vc-app-skill 2.0.0-alpha.33 → 2.0.0-alpha.33-pr220.455e322
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/CHANGELOG.md +52 -55
- package/README.md +18 -12
- package/package.json +4 -4
- package/runtime/agents/api-analyzer.md +31 -16
- package/runtime/agents/blade-enhancer.md +15 -9
- package/runtime/agents/details-blade-generator.md +47 -31
- package/runtime/agents/list-blade-generator.md +21 -37
- package/runtime/agents/locales-generator.md +3 -0
- package/runtime/agents/migration-agent.md +18 -7
- package/runtime/agents/module-analyzer.md +2 -0
- package/runtime/agents/module-assembler.md +15 -0
- package/runtime/agents/promote-agent.md +15 -4
- package/runtime/agents/type-checker.md +11 -0
- package/runtime/knowledge/docs/core/api/platform.docs.md +30 -30
- package/runtime/knowledge/docs/core/blade-navigation/blade-nav-composables.docs.md +41 -41
- package/runtime/knowledge/docs/core/composables/bladeContext/index.docs.md +12 -10
- package/runtime/knowledge/docs/core/composables/useApiClient/useApiClient.docs.md +11 -14
- package/runtime/knowledge/docs/core/composables/useAppBarMobileButtons/useAppBarMobileButtons.docs.md +35 -35
- package/runtime/knowledge/docs/core/composables/useAppBarWidget/useAppBarWidget.docs.md +35 -35
- package/runtime/knowledge/docs/core/composables/useAppInsights/useAppInsights.docs.md +15 -15
- package/runtime/knowledge/docs/core/composables/useAssets/useAssets.docs.md +21 -18
- package/runtime/knowledge/docs/core/composables/useAssetsManager/useAssetsManager.docs.md +31 -27
- package/runtime/knowledge/docs/core/composables/useAsync/useAsync.docs.md +90 -61
- package/runtime/knowledge/docs/core/composables/useBeforeUnload/useBeforeUnload.docs.md +19 -18
- package/runtime/knowledge/docs/core/composables/useBlade/useBlade.docs.md +89 -68
- package/runtime/knowledge/docs/core/composables/useBladeForm/useBladeForm.docs.md +27 -25
- package/runtime/knowledge/docs/core/composables/useBladeRegistry/useBladeRegistry.docs.md +15 -15
- package/runtime/knowledge/docs/core/composables/useBladeWidgets/index.docs.md +74 -78
- package/runtime/knowledge/docs/core/composables/useBreadcrumbs/useBreadcrumbs.docs.md +11 -11
- package/runtime/knowledge/docs/core/composables/useConnectionStatus/useConnectionStatus.docs.md +27 -15
- package/runtime/knowledge/docs/core/composables/useDashboard/useDashboard.docs.md +30 -30
- package/runtime/knowledge/docs/core/composables/useDynamicProperties/useDynamicProperties.docs.md +34 -36
- package/runtime/knowledge/docs/core/composables/useErrorHandler/useErrorHandler.docs.md +44 -23
- package/runtime/knowledge/docs/core/composables/useFunctions/useFunctions.docs.md +14 -11
- package/runtime/knowledge/docs/core/composables/useKeyboardNavigation/useKeyboardNavigation.docs.md +47 -38
- package/runtime/knowledge/docs/core/composables/useLanguages/useLanguages.docs.md +37 -28
- package/runtime/knowledge/docs/core/composables/useLoading/useLoading.docs.md +23 -17
- package/runtime/knowledge/docs/core/composables/useMenuExpanded/index.docs.md +10 -10
- package/runtime/knowledge/docs/core/composables/useMenuService/useMenuService.docs.md +42 -42
- package/runtime/knowledge/docs/core/composables/useModificationTracker/useModificationTracker.docs.md +22 -12
- package/runtime/knowledge/docs/core/composables/useNotifications/useNotifications.docs.md +33 -41
- package/runtime/knowledge/docs/core/composables/usePermissions/usePermissions.docs.md +16 -16
- package/runtime/knowledge/docs/core/composables/usePopup/usePopup.docs.md +32 -24
- package/runtime/knowledge/docs/core/composables/useResponsive/useResponsive.docs.md +32 -11
- package/runtime/knowledge/docs/core/composables/useSettings/useSettings.docs.md +24 -15
- package/runtime/knowledge/docs/core/composables/useSettingsMenu/useSettingsMenu.docs.md +7 -7
- package/runtime/knowledge/docs/core/composables/useSidebarState/useSidebarState.docs.md +32 -24
- package/runtime/knowledge/docs/core/composables/useSlowNetworkDetection/useSlowNetworkDetection.docs.md +21 -17
- package/runtime/knowledge/docs/core/composables/useTheme/useTheme.docs.md +24 -24
- package/runtime/knowledge/docs/core/composables/useToolbar/useToolbar.docs.md +28 -31
- package/runtime/knowledge/docs/core/composables/useUser/useUser.docs.md +43 -24
- package/runtime/knowledge/docs/core/composables/useUserManagement/useUserManagement.docs.md +68 -48
- package/runtime/knowledge/docs/core/composables/useWebVitals/useWebVitals.docs.md +19 -19
- package/runtime/knowledge/docs/core/composables/useWidgets/useWidgets.docs.md +42 -47
- package/runtime/knowledge/docs/core/directives/autofocus/autofocus.docs.md +10 -4
- package/runtime/knowledge/docs/core/directives/loading/loading.docs.md +35 -20
- package/runtime/knowledge/docs/core/notifications/notifications.docs.md +36 -35
- package/runtime/knowledge/docs/core/plugins/ai-agent/ai-agent.docs.md +38 -38
- package/runtime/knowledge/docs/core/plugins/extension-points/extension-points.docs.md +107 -91
- package/runtime/knowledge/docs/core/plugins/global-error-handler/global-error-handler.docs.md +10 -10
- package/runtime/knowledge/docs/core/plugins/i18n/i18n.docs.md +21 -23
- package/runtime/knowledge/docs/core/plugins/modularity/modularity.docs.md +98 -90
- package/runtime/knowledge/docs/core/plugins/permissions/permissions.docs.md +10 -16
- package/runtime/knowledge/docs/core/plugins/signalR/signalR.docs.md +9 -9
- package/runtime/knowledge/docs/core/plugins/validation/validation.docs.md +65 -22
- package/runtime/knowledge/docs/core/services/services.docs.md +19 -22
- package/runtime/knowledge/docs/core/types/types.docs.md +40 -40
- package/runtime/knowledge/docs/core/utilities/date/date-utilities.docs.md +27 -27
- package/runtime/knowledge/docs/core/utilities/shared-utilities.docs.md +23 -23
- package/runtime/knowledge/docs/core/utilities/thumbnail/thumbnail.docs.md +22 -25
- package/runtime/knowledge/docs/core/utilities/utilities.docs.md +64 -64
- package/runtime/knowledge/docs/injection-keys.docs.md +52 -51
- package/runtime/knowledge/docs/modules/assets-manager/assets-manager.docs.md +9 -9
- package/runtime/knowledge/docs/shell/_internal/popup/common/popup-common.docs.md +23 -43
- package/runtime/knowledge/docs/shell/auth/ChangePasswordPage/change-password-page.docs.md +5 -5
- package/runtime/knowledge/docs/shell/auth/ForgotPasswordPage/forgot-password-page.docs.md +5 -5
- package/runtime/knowledge/docs/shell/auth/InvitePage/invite-page.docs.md +8 -7
- package/runtime/knowledge/docs/shell/auth/LoginPage/login-page.docs.md +7 -7
- package/runtime/knowledge/docs/shell/auth/ResetPasswordPage/reset-password-page.docs.md +8 -7
- package/runtime/knowledge/docs/shell/auth/sign-in/sign-in.docs.md +29 -13
- package/runtime/knowledge/docs/shell/components/change-password/change-password.docs.md +13 -16
- package/runtime/knowledge/docs/shell/components/change-password-button/change-password-button.docs.md +1 -7
- package/runtime/knowledge/docs/shell/components/error-interceptor/error-interceptor.docs.md +5 -5
- package/runtime/knowledge/docs/shell/components/language-selector/language-selector.docs.md +1 -1
- package/runtime/knowledge/docs/shell/components/logout-button/logout-button.docs.md +1 -1
- package/runtime/knowledge/docs/shell/components/notification-template/notification-template.docs.md +17 -9
- package/runtime/knowledge/docs/shell/components/settings-menu/settings-menu.docs.md +12 -18
- package/runtime/knowledge/docs/shell/components/settings-menu-item/settings-menu-item.docs.md +34 -65
- package/runtime/knowledge/docs/shell/components/sidebar/sidebar.docs.md +16 -26
- package/runtime/knowledge/docs/shell/components/theme-selector/theme-selector.docs.md +2 -2
- package/runtime/knowledge/docs/shell/components/user-dropdown-button/user-dropdown-button.docs.md +7 -9
- package/runtime/knowledge/docs/shell/dashboard/dashboard-charts/dashboard-charts.docs.md +30 -40
- package/runtime/knowledge/docs/shell/dashboard/dashboard-widget-card/dashboard-widget-card.docs.md +26 -19
- package/runtime/knowledge/docs/shell/dashboard/draggable-dashboard/draggable-dashboard.docs.md +15 -12
- package/runtime/knowledge/docs/ui/components/atoms/vc-badge/vc-badge.docs.md +15 -26
- package/runtime/knowledge/docs/ui/components/atoms/vc-banner/vc-banner.docs.md +21 -19
- package/runtime/knowledge/docs/ui/components/atoms/vc-button/vc-button.docs.md +83 -67
- package/runtime/knowledge/docs/ui/components/atoms/vc-card/vc-card.docs.md +100 -59
- package/runtime/knowledge/docs/ui/components/atoms/vc-col/vc-col.docs.md +28 -11
- package/runtime/knowledge/docs/ui/components/atoms/vc-container/vc-container.docs.md +20 -17
- package/runtime/knowledge/docs/ui/components/atoms/vc-hint/vc-hint.docs.md +26 -17
- package/runtime/knowledge/docs/ui/components/atoms/vc-icon/vc-icon.docs.md +30 -32
- package/runtime/knowledge/docs/ui/components/atoms/vc-image/vc-image.docs.md +25 -48
- package/runtime/knowledge/docs/ui/components/atoms/vc-label/vc-label.docs.md +29 -24
- package/runtime/knowledge/docs/ui/components/atoms/vc-link/vc-link.docs.md +23 -15
- package/runtime/knowledge/docs/ui/components/atoms/vc-loading/vc-loading.docs.md +22 -13
- package/runtime/knowledge/docs/ui/components/atoms/vc-progress/vc-progress.docs.md +33 -18
- package/runtime/knowledge/docs/ui/components/atoms/vc-row/vc-row.docs.md +56 -15
- package/runtime/knowledge/docs/ui/components/atoms/vc-scrollable-container/vc-scrollable-container.docs.md +28 -15
- package/runtime/knowledge/docs/ui/components/atoms/vc-skeleton/vc-skeleton.docs.md +40 -20
- package/runtime/knowledge/docs/ui/components/atoms/vc-status/vc-status.docs.md +25 -14
- package/runtime/knowledge/docs/ui/components/atoms/vc-status-icon/vc-status-icon.docs.md +40 -14
- package/runtime/knowledge/docs/ui/components/atoms/vc-tooltip/vc-tooltip.docs.md +54 -42
- package/runtime/knowledge/docs/ui/components/atoms/vc-video/vc-video.docs.md +17 -17
- package/runtime/knowledge/docs/ui/components/atoms/vc-widget/vc-widget.docs.md +21 -21
- package/runtime/knowledge/docs/ui/components/molecules/multilanguage-selector/multilanguage-selector.docs.md +23 -10
- package/runtime/knowledge/docs/ui/components/molecules/vc-accordion/vc-accordion.docs.md +55 -44
- package/runtime/knowledge/docs/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.docs.md +23 -20
- package/runtime/knowledge/docs/ui/components/molecules/vc-checkbox/vc-checkbox.docs.md +92 -65
- package/runtime/knowledge/docs/ui/components/molecules/vc-checkbox-group/vc-checkbox-group.docs.md +22 -36
- package/runtime/knowledge/docs/ui/components/molecules/vc-color-input/vc-color-input.docs.md +65 -23
- package/runtime/knowledge/docs/ui/components/molecules/vc-date-picker/vc-date-picker.docs.md +52 -73
- package/runtime/knowledge/docs/ui/components/molecules/vc-dropdown/vc-dropdown.docs.md +91 -85
- package/runtime/knowledge/docs/ui/components/molecules/vc-dropdown-panel/vc-dropdown-panel.docs.md +38 -42
- package/runtime/knowledge/docs/ui/components/molecules/vc-editor/vc-editor.docs.md +56 -73
- package/runtime/knowledge/docs/ui/components/molecules/vc-field/vc-field.docs.md +61 -27
- package/runtime/knowledge/docs/ui/components/molecules/vc-file-upload/vc-file-upload.docs.md +42 -50
- package/runtime/knowledge/docs/ui/components/molecules/vc-form/vc-form.docs.md +35 -64
- package/runtime/knowledge/docs/ui/components/molecules/vc-image-tile/vc-image-tile.docs.md +38 -41
- package/runtime/knowledge/docs/ui/components/molecules/vc-input/vc-input.docs.md +109 -131
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-currency/vc-input-currency.docs.md +47 -88
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.docs.md +50 -64
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-group/vc-input-group.docs.md +29 -24
- package/runtime/knowledge/docs/ui/components/molecules/vc-menu/vc-menu.docs.md +32 -28
- package/runtime/knowledge/docs/ui/components/molecules/vc-multivalue/vc-multivalue.docs.md +57 -65
- package/runtime/knowledge/docs/ui/components/molecules/vc-pagination/vc-pagination.docs.md +28 -26
- package/runtime/knowledge/docs/ui/components/molecules/vc-radio-button/vc-radio-button.docs.md +55 -20
- package/runtime/knowledge/docs/ui/components/molecules/vc-radio-group/vc-radio-group.docs.md +21 -35
- package/runtime/knowledge/docs/ui/components/molecules/vc-rating/vc-rating.docs.md +38 -33
- package/runtime/knowledge/docs/ui/components/molecules/vc-select/vc-select.docs.md +72 -83
- package/runtime/knowledge/docs/ui/components/molecules/vc-slider/vc-slider.docs.md +21 -16
- package/runtime/knowledge/docs/ui/components/molecules/vc-switch/vc-switch.docs.md +55 -64
- package/runtime/knowledge/docs/ui/components/molecules/vc-textarea/vc-textarea.docs.md +51 -70
- package/runtime/knowledge/docs/ui/components/molecules/vc-toast/vc-toast.docs.md +58 -57
- package/runtime/knowledge/docs/ui/components/organisms/vc-app/vc-app.docs.md +49 -26
- package/runtime/knowledge/docs/ui/components/organisms/vc-auth-layout/vc-auth-layout.docs.md +82 -28
- package/runtime/knowledge/docs/ui/components/organisms/vc-blade/vc-blade.docs.md +90 -75
- package/runtime/knowledge/docs/ui/components/organisms/vc-data-table/composables/table-composables.docs.md +30 -44
- package/runtime/knowledge/docs/ui/components/organisms/vc-data-table/vc-data-table.docs.md +512 -369
- package/runtime/knowledge/docs/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.docs.md +35 -52
- package/runtime/knowledge/docs/ui/components/organisms/vc-gallery/vc-gallery.docs.md +33 -62
- package/runtime/knowledge/docs/ui/components/organisms/vc-image-upload/vc-image-upload.docs.md +17 -23
- package/runtime/knowledge/docs/ui/components/organisms/vc-popup/vc-popup.docs.md +109 -68
- package/runtime/knowledge/docs/ui/components/organisms/vc-sidebar/vc-sidebar.docs.md +82 -44
- package/runtime/knowledge/docs/ui/composables/ui-composables.docs.md +8 -8
- package/runtime/knowledge/docs/ui/composables/useDataTablePagination.docs.md +164 -0
- package/runtime/knowledge/docs/ui/composables/useDataTableSort.docs.md +34 -26
- package/runtime/knowledge/docs/ui/composables/useTableSelection.docs.md +48 -40
- package/runtime/knowledge/docs/ui/composables/useTableSort.docs.md +30 -17
- package/runtime/knowledge/docs/ui/types/ui-types.docs.md +40 -29
- package/runtime/knowledge/examples/offers-module.md +15 -13
- package/runtime/knowledge/examples/team-module.md +82 -119
- package/runtime/knowledge/examples/videos-module.md +44 -17
- package/runtime/knowledge/index.md +22 -0
- package/runtime/knowledge/migration-prompts/blade-form-migration.md +17 -8
- package/runtime/knowledge/migration-prompts/blade-props-migration.md +1 -2
- package/runtime/knowledge/migration-prompts/datatable-migration.md +801 -0
- package/runtime/knowledge/migration-prompts/icon-migration.md +97 -0
- package/runtime/knowledge/migration-prompts/manual-migration-audit.md +117 -0
- package/runtime/knowledge/migration-prompts/notifications-migration.md +8 -3
- package/runtime/knowledge/migration-prompts/nswag-migration.md +25 -29
- package/runtime/knowledge/migration-prompts/use-assets-migration.md +164 -0
- package/runtime/knowledge/migration-prompts/use-data-table-pagination-migration.md +176 -0
- package/runtime/knowledge/migration-prompts/widgets-migration.md +48 -27
- package/runtime/knowledge/patterns/assets-management.md +20 -20
- package/runtime/knowledge/patterns/blade-navigation.md +7 -14
- package/runtime/knowledge/patterns/blade-widget.md +19 -17
- package/runtime/knowledge/patterns/child-blade-flow.md +19 -7
- package/runtime/knowledge/patterns/composable-details.md +20 -50
- package/runtime/knowledge/patterns/composable-list.md +43 -31
- package/runtime/knowledge/patterns/dashboard-widget.md +14 -16
- package/runtime/knowledge/patterns/datatable-pattern.md +521 -0
- package/runtime/knowledge/patterns/details-blade-pattern.md +78 -116
- package/runtime/knowledge/patterns/extension-points-usage.md +53 -44
- package/runtime/knowledge/patterns/form-validation.md +28 -64
- package/runtime/knowledge/patterns/list-blade-pattern.md +33 -21
- package/runtime/knowledge/patterns/module-structure.md +7 -1
- package/runtime/knowledge/patterns/multilanguage-fields.md +8 -14
- package/runtime/knowledge/patterns/notification-template.md +21 -14
- package/runtime/knowledge/patterns/signalr-notifications.md +30 -32
- package/runtime/knowledge/patterns/toolbar-pattern.md +18 -20
- package/runtime/vc-app.md +241 -62
|
@@ -20,12 +20,12 @@ Columns are defined as `<VcColumn>` child components -- no configuration objects
|
|
|
20
20
|
|
|
21
21
|
## When to Use
|
|
22
22
|
|
|
23
|
-
| Scenario
|
|
24
|
-
|
|
25
|
-
| Tabular data with sorting, selection, pagination | **VcDataTable**
|
|
26
|
-
| Simple short list without table features
|
|
27
|
-
| Image/card grid layout
|
|
28
|
-
| Key-value detail display
|
|
23
|
+
| Scenario | Component |
|
|
24
|
+
| ------------------------------------------------ | -------------------------------------------------------------------- |
|
|
25
|
+
| Tabular data with sorting, selection, pagination | **VcDataTable** |
|
|
26
|
+
| Simple short list without table features | `v-for` with custom markup |
|
|
27
|
+
| Image/card grid layout | [VcGallery](../vc-gallery) |
|
|
28
|
+
| Key-value detail display | [VcField](../../molecules/vc-field) or [VcCard](../../atoms/vc-card) |
|
|
29
29
|
|
|
30
30
|
Use VcDataTable whenever you need structured rows and columns with any combination of sorting, filtering, inline editing, or column management. **Do not use** VcDataTable for simple lists of 5-10 items that need no table features -- a plain `v-for` loop is lighter. For thumbnail/card grids, prefer VcGallery.
|
|
31
31
|
|
|
@@ -68,10 +68,28 @@ The simplest possible table -- pass an array and declare columns:
|
|
|
68
68
|
```vue
|
|
69
69
|
<template>
|
|
70
70
|
<VcDataTable :items="products">
|
|
71
|
-
<VcColumn
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
<VcColumn
|
|
72
|
+
id="name"
|
|
73
|
+
field="name"
|
|
74
|
+
title="Name"
|
|
75
|
+
/>
|
|
76
|
+
<VcColumn
|
|
77
|
+
id="price"
|
|
78
|
+
field="price"
|
|
79
|
+
title="Price"
|
|
80
|
+
type="money"
|
|
81
|
+
/>
|
|
82
|
+
<VcColumn
|
|
83
|
+
id="stock"
|
|
84
|
+
field="stock"
|
|
85
|
+
title="Stock"
|
|
86
|
+
type="number"
|
|
87
|
+
/>
|
|
88
|
+
<VcColumn
|
|
89
|
+
id="status"
|
|
90
|
+
field="status"
|
|
91
|
+
title="Status"
|
|
92
|
+
/>
|
|
75
93
|
</VcDataTable>
|
|
76
94
|
</template>
|
|
77
95
|
|
|
@@ -82,7 +100,7 @@ import { VcDataTable, VcColumn } from "@vc-shell/framework";
|
|
|
82
100
|
const products = ref([
|
|
83
101
|
{ id: "1", name: "Laptop", price: 1299.99, currency: "USD", stock: 45, status: "In Stock" },
|
|
84
102
|
{ id: "2", name: "Mouse", price: 49.99, currency: "USD", stock: 120, status: "In Stock" },
|
|
85
|
-
{ id: "3", name: "Monitor", price: 599.
|
|
103
|
+
{ id: "3", name: "Monitor", price: 599.0, currency: "USD", stock: 0, status: "Out of Stock" },
|
|
86
104
|
]);
|
|
87
105
|
</script>
|
|
88
106
|
```
|
|
@@ -201,9 +219,25 @@ Mark columns as sortable and bind the sort state:
|
|
|
201
219
|
v-model:sort-order="sortOrder"
|
|
202
220
|
@sort="handleSort"
|
|
203
221
|
>
|
|
204
|
-
<VcColumn
|
|
205
|
-
|
|
206
|
-
|
|
222
|
+
<VcColumn
|
|
223
|
+
id="name"
|
|
224
|
+
field="name"
|
|
225
|
+
title="Name"
|
|
226
|
+
sortable
|
|
227
|
+
/>
|
|
228
|
+
<VcColumn
|
|
229
|
+
id="price"
|
|
230
|
+
field="price"
|
|
231
|
+
title="Price"
|
|
232
|
+
type="money"
|
|
233
|
+
sortable
|
|
234
|
+
/>
|
|
235
|
+
<VcColumn
|
|
236
|
+
id="stock"
|
|
237
|
+
field="stock"
|
|
238
|
+
title="Stock"
|
|
239
|
+
type="number"
|
|
240
|
+
/>
|
|
207
241
|
</VcDataTable>
|
|
208
242
|
</template>
|
|
209
243
|
|
|
@@ -235,12 +269,7 @@ Allow users to remove sorting entirely (3-state cycle: asc -> desc -> none):
|
|
|
235
269
|
Hold Shift and click additional columns to sort by multiple fields:
|
|
236
270
|
|
|
237
271
|
```vue
|
|
238
|
-
<VcDataTable
|
|
239
|
-
:items="products"
|
|
240
|
-
sort-mode="multiple"
|
|
241
|
-
v-model:multi-sort-meta="multiSort"
|
|
242
|
-
@sort="handleSort"
|
|
243
|
-
>
|
|
272
|
+
<VcDataTable :items="products" sort-mode="multiple" v-model:multi-sort-meta="multiSort" @sort="handleSort">
|
|
244
273
|
<VcColumn id="category" field="category" title="Category" sortable />
|
|
245
274
|
<VcColumn id="name" field="name" title="Name" sortable />
|
|
246
275
|
<VcColumn id="price" field="price" title="Price" type="money" sortable />
|
|
@@ -273,8 +302,17 @@ When the backend sort field differs from the column id:
|
|
|
273
302
|
v-model:selection="selected"
|
|
274
303
|
selection-mode="multiple"
|
|
275
304
|
>
|
|
276
|
-
<VcColumn
|
|
277
|
-
|
|
305
|
+
<VcColumn
|
|
306
|
+
id="name"
|
|
307
|
+
field="name"
|
|
308
|
+
title="Name"
|
|
309
|
+
/>
|
|
310
|
+
<VcColumn
|
|
311
|
+
id="price"
|
|
312
|
+
field="price"
|
|
313
|
+
title="Price"
|
|
314
|
+
type="money"
|
|
315
|
+
/>
|
|
278
316
|
</VcDataTable>
|
|
279
317
|
|
|
280
318
|
<p>{{ selected.length }} items selected</p>
|
|
@@ -290,11 +328,7 @@ A checkbox column is automatically prepended. A "Select All" banner appears when
|
|
|
290
328
|
### Single Selection (radio)
|
|
291
329
|
|
|
292
330
|
```vue
|
|
293
|
-
<VcDataTable
|
|
294
|
-
:items="products"
|
|
295
|
-
v-model:selection="selectedProduct"
|
|
296
|
-
selection-mode="single"
|
|
297
|
-
>
|
|
331
|
+
<VcDataTable :items="products" v-model:selection="selectedProduct" selection-mode="single">
|
|
298
332
|
<VcColumn id="name" field="name" title="Name" />
|
|
299
333
|
</VcDataTable>
|
|
300
334
|
```
|
|
@@ -313,12 +347,7 @@ For explicit control over checkbox column placement:
|
|
|
313
347
|
### Disabling Selection on Specific Rows
|
|
314
348
|
|
|
315
349
|
```vue
|
|
316
|
-
<VcDataTable
|
|
317
|
-
:items="products"
|
|
318
|
-
v-model:selection="selected"
|
|
319
|
-
selection-mode="multiple"
|
|
320
|
-
:is-row-selectable="(item) => item.stock > 0"
|
|
321
|
-
>
|
|
350
|
+
<VcDataTable :items="products" v-model:selection="selected" selection-mode="multiple" :is-row-selectable="(item) => item.stock > 0">
|
|
322
351
|
<VcColumn id="name" field="name" title="Name" />
|
|
323
352
|
</VcDataTable>
|
|
324
353
|
```
|
|
@@ -330,14 +359,7 @@ Out-of-stock rows will have a disabled (grayed-out) checkbox.
|
|
|
330
359
|
For server-side "select all" that includes items not currently visible:
|
|
331
360
|
|
|
332
361
|
```vue
|
|
333
|
-
<VcDataTable
|
|
334
|
-
:items="products"
|
|
335
|
-
v-model:selection="selected"
|
|
336
|
-
v-model:select-all-active="allSelected"
|
|
337
|
-
selection-mode="multiple"
|
|
338
|
-
:total-count="totalCount"
|
|
339
|
-
@select-all="handleSelectAll"
|
|
340
|
-
>
|
|
362
|
+
<VcDataTable :items="products" v-model:selection="selected" v-model:select-all-active="allSelected" selection-mode="multiple" :total-count="totalCount" @select-all="handleSelectAll">
|
|
341
363
|
<VcColumn id="name" field="name" title="Name" />
|
|
342
364
|
</VcDataTable>
|
|
343
365
|
```
|
|
@@ -365,8 +387,17 @@ function handleSelectAll(event: { selected: boolean }) {
|
|
|
365
387
|
:total-count="totalCount"
|
|
366
388
|
@pagination-click="onPageChange"
|
|
367
389
|
>
|
|
368
|
-
<VcColumn
|
|
369
|
-
|
|
390
|
+
<VcColumn
|
|
391
|
+
id="name"
|
|
392
|
+
field="name"
|
|
393
|
+
title="Name"
|
|
394
|
+
/>
|
|
395
|
+
<VcColumn
|
|
396
|
+
id="price"
|
|
397
|
+
field="price"
|
|
398
|
+
title="Price"
|
|
399
|
+
type="money"
|
|
400
|
+
/>
|
|
370
401
|
</VcDataTable>
|
|
371
402
|
</template>
|
|
372
403
|
|
|
@@ -398,10 +429,30 @@ Click any editable cell to activate its editor. Press Enter or click away to com
|
|
|
398
429
|
|
|
399
430
|
```vue
|
|
400
431
|
<template>
|
|
401
|
-
<VcDataTable
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
432
|
+
<VcDataTable
|
|
433
|
+
:items="products"
|
|
434
|
+
edit-mode="cell"
|
|
435
|
+
@cell-edit-complete="onCellSave"
|
|
436
|
+
>
|
|
437
|
+
<VcColumn
|
|
438
|
+
id="name"
|
|
439
|
+
field="name"
|
|
440
|
+
title="Name"
|
|
441
|
+
editable
|
|
442
|
+
/>
|
|
443
|
+
<VcColumn
|
|
444
|
+
id="price"
|
|
445
|
+
field="price"
|
|
446
|
+
title="Price"
|
|
447
|
+
type="money"
|
|
448
|
+
editable
|
|
449
|
+
/>
|
|
450
|
+
<VcColumn
|
|
451
|
+
id="stock"
|
|
452
|
+
field="stock"
|
|
453
|
+
title="Stock"
|
|
454
|
+
type="number"
|
|
455
|
+
/>
|
|
405
456
|
</VcDataTable>
|
|
406
457
|
</template>
|
|
407
458
|
|
|
@@ -439,12 +490,7 @@ function onRowSave(event: { data: Product; newData: Product; index: number }) {
|
|
|
439
490
|
All editable cells are active at once -- useful for price lists, inventory grids, or spreadsheet-like UIs.
|
|
440
491
|
|
|
441
492
|
```vue
|
|
442
|
-
<VcDataTable
|
|
443
|
-
:items="products"
|
|
444
|
-
edit-mode="inline"
|
|
445
|
-
:validation-rules="validationRules"
|
|
446
|
-
@edit-save="onBulkSave"
|
|
447
|
-
>
|
|
493
|
+
<VcDataTable :items="products" edit-mode="inline" :validation-rules="validationRules" @edit-save="onBulkSave">
|
|
448
494
|
<VcColumn id="name" field="name" title="Name" editable />
|
|
449
495
|
<VcColumn id="price" field="price" title="Price" type="money" editable />
|
|
450
496
|
<VcColumn id="stock" field="stock" title="Stock" type="number" editable />
|
|
@@ -558,9 +604,22 @@ Enable drag-and-drop row reordering with a drag handle column:
|
|
|
558
604
|
:reorderable-rows="true"
|
|
559
605
|
@row-reorder="onReorder"
|
|
560
606
|
>
|
|
561
|
-
<VcColumn
|
|
562
|
-
|
|
563
|
-
|
|
607
|
+
<VcColumn
|
|
608
|
+
id="drag"
|
|
609
|
+
:row-reorder="true"
|
|
610
|
+
:width="40"
|
|
611
|
+
/>
|
|
612
|
+
<VcColumn
|
|
613
|
+
id="name"
|
|
614
|
+
field="name"
|
|
615
|
+
title="Name"
|
|
616
|
+
/>
|
|
617
|
+
<VcColumn
|
|
618
|
+
id="priority"
|
|
619
|
+
field="priority"
|
|
620
|
+
title="Priority"
|
|
621
|
+
type="number"
|
|
622
|
+
/>
|
|
564
623
|
</VcDataTable>
|
|
565
624
|
</template>
|
|
566
625
|
|
|
@@ -583,16 +642,35 @@ Show additional detail below a row when the user clicks the expand toggle:
|
|
|
583
642
|
|
|
584
643
|
```vue
|
|
585
644
|
<template>
|
|
586
|
-
<VcDataTable
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
645
|
+
<VcDataTable
|
|
646
|
+
:items="orders"
|
|
647
|
+
v-model:expanded-rows="expandedRows"
|
|
648
|
+
>
|
|
649
|
+
<VcColumn
|
|
650
|
+
id="expand"
|
|
651
|
+
:expander="true"
|
|
652
|
+
:width="40"
|
|
653
|
+
/>
|
|
654
|
+
<VcColumn
|
|
655
|
+
id="orderNumber"
|
|
656
|
+
field="number"
|
|
657
|
+
title="Order #"
|
|
658
|
+
/>
|
|
659
|
+
<VcColumn
|
|
660
|
+
id="total"
|
|
661
|
+
field="total"
|
|
662
|
+
title="Total"
|
|
663
|
+
type="money"
|
|
664
|
+
/>
|
|
590
665
|
|
|
591
666
|
<template #expansion="{ data }">
|
|
592
667
|
<div class="tw-p-4">
|
|
593
668
|
<h4 class="tw-font-semibold tw-mb-2">Order Items</h4>
|
|
594
669
|
<ul>
|
|
595
|
-
<li
|
|
670
|
+
<li
|
|
671
|
+
v-for="item in data.lineItems"
|
|
672
|
+
:key="item.id"
|
|
673
|
+
>
|
|
596
674
|
{{ item.name }} x{{ item.quantity }} -- {{ item.price }}
|
|
597
675
|
</li>
|
|
598
676
|
</ul>
|
|
@@ -609,12 +687,7 @@ const expandedRows = ref<Order[]>([]);
|
|
|
609
687
|
Customize expand/collapse icons:
|
|
610
688
|
|
|
611
689
|
```vue
|
|
612
|
-
<VcDataTable
|
|
613
|
-
:items="orders"
|
|
614
|
-
v-model:expanded-rows="expandedRows"
|
|
615
|
-
expanded-row-icon="lucide-minus-circle"
|
|
616
|
-
collapsed-row-icon="lucide-plus-circle"
|
|
617
|
-
>
|
|
690
|
+
<VcDataTable :items="orders" v-model:expanded-rows="expandedRows" expanded-row-icon="lucide-minus-circle" collapsed-row-icon="lucide-plus-circle">
|
|
618
691
|
...
|
|
619
692
|
</VcDataTable>
|
|
620
693
|
```
|
|
@@ -630,12 +703,25 @@ Use `isRowExpandable` to control which rows show the expand toggle. Rows that fa
|
|
|
630
703
|
v-model:expanded-rows="expandedRows"
|
|
631
704
|
:is-row-expandable="(order) => order.lineItems.length > 0"
|
|
632
705
|
>
|
|
633
|
-
<VcColumn
|
|
634
|
-
|
|
706
|
+
<VcColumn
|
|
707
|
+
id="expand"
|
|
708
|
+
:expander="true"
|
|
709
|
+
:width="40"
|
|
710
|
+
/>
|
|
711
|
+
<VcColumn
|
|
712
|
+
id="orderNumber"
|
|
713
|
+
field="number"
|
|
714
|
+
title="Order #"
|
|
715
|
+
/>
|
|
635
716
|
|
|
636
717
|
<template #expansion="{ data }">
|
|
637
718
|
<div class="tw-p-4">
|
|
638
|
-
<p
|
|
719
|
+
<p
|
|
720
|
+
v-for="item in data.lineItems"
|
|
721
|
+
:key="item.id"
|
|
722
|
+
>
|
|
723
|
+
{{ item.name }}
|
|
724
|
+
</p>
|
|
639
725
|
</div>
|
|
640
726
|
</template>
|
|
641
727
|
</VcDataTable>
|
|
@@ -660,8 +746,17 @@ Group rows by a field value. Each group gets a subheader row.
|
|
|
660
746
|
:expandable-row-groups="true"
|
|
661
747
|
v-model:expanded-row-groups="expandedGroups"
|
|
662
748
|
>
|
|
663
|
-
<VcColumn
|
|
664
|
-
|
|
749
|
+
<VcColumn
|
|
750
|
+
id="name"
|
|
751
|
+
field="name"
|
|
752
|
+
title="Name"
|
|
753
|
+
/>
|
|
754
|
+
<VcColumn
|
|
755
|
+
id="price"
|
|
756
|
+
field="price"
|
|
757
|
+
title="Price"
|
|
758
|
+
type="money"
|
|
759
|
+
/>
|
|
665
760
|
|
|
666
761
|
<template #groupheader="{ data }">
|
|
667
762
|
<strong>{{ data.category }}</strong> ({{ getCategoryCount(data.category) }} items)
|
|
@@ -728,13 +823,7 @@ Add the `filter` prop to a VcColumn to render a filter control in its header.
|
|
|
728
823
|
**Date range filter** -- start/end date pickers:
|
|
729
824
|
|
|
730
825
|
```vue
|
|
731
|
-
<VcColumn
|
|
732
|
-
id="createdDate"
|
|
733
|
-
field="createdDate"
|
|
734
|
-
title="Created"
|
|
735
|
-
type="datetime"
|
|
736
|
-
:filter="{ range: ['startDate', 'endDate'] }"
|
|
737
|
-
/>
|
|
826
|
+
<VcColumn id="createdDate" field="createdDate" title="Created" type="datetime" :filter="{ range: ['startDate', 'endDate'] }" />
|
|
738
827
|
```
|
|
739
828
|
|
|
740
829
|
The `range` tuple specifies the two backend field names emitted in the `@filter` event payload.
|
|
@@ -809,11 +898,7 @@ A filter icon button appears in the toolbar. Clicking it opens the global filter
|
|
|
809
898
|
Column filters and global filters work together. The `@filter` event merges all active filter values into a single flat object:
|
|
810
899
|
|
|
811
900
|
```vue
|
|
812
|
-
<VcDataTable
|
|
813
|
-
:items="products"
|
|
814
|
-
:global-filters="globalFilters"
|
|
815
|
-
@filter="handleFilter"
|
|
816
|
-
>
|
|
901
|
+
<VcDataTable :items="products" :global-filters="globalFilters" @filter="handleFilter">
|
|
817
902
|
<VcColumn id="name" field="name" title="Name" :filter="true" />
|
|
818
903
|
<VcColumn id="status" field="status" title="Status" :filter="{ options: statusOptions }" />
|
|
819
904
|
</VcDataTable>
|
|
@@ -831,14 +916,7 @@ function handleFilter(event: { filters: Record<string, unknown> }) {
|
|
|
831
916
|
## Search Bar
|
|
832
917
|
|
|
833
918
|
```vue
|
|
834
|
-
<VcDataTable
|
|
835
|
-
:items="products"
|
|
836
|
-
searchable
|
|
837
|
-
v-model:search-value="searchQuery"
|
|
838
|
-
search-placeholder="Search products..."
|
|
839
|
-
:search-debounce="300"
|
|
840
|
-
@search="onSearch"
|
|
841
|
-
>
|
|
919
|
+
<VcDataTable :items="products" searchable v-model:search-value="searchQuery" search-placeholder="Search products..." :search-debounce="300" @search="onSearch">
|
|
842
920
|
<VcColumn id="name" field="name" title="Name" />
|
|
843
921
|
</VcDataTable>
|
|
844
922
|
```
|
|
@@ -870,8 +948,17 @@ Load more data as the user scrolls down:
|
|
|
870
948
|
scroll-height="500px"
|
|
871
949
|
@load-more="loadNextPage"
|
|
872
950
|
>
|
|
873
|
-
<VcColumn
|
|
874
|
-
|
|
951
|
+
<VcColumn
|
|
952
|
+
id="name"
|
|
953
|
+
field="name"
|
|
954
|
+
title="Name"
|
|
955
|
+
/>
|
|
956
|
+
<VcColumn
|
|
957
|
+
id="price"
|
|
958
|
+
field="price"
|
|
959
|
+
title="Price"
|
|
960
|
+
type="money"
|
|
961
|
+
/>
|
|
875
962
|
</VcDataTable>
|
|
876
963
|
</template>
|
|
877
964
|
|
|
@@ -897,10 +984,7 @@ async function loadNextPage() {
|
|
|
897
984
|
Persist column widths, column order, hidden columns, sort, and filters across page reloads:
|
|
898
985
|
|
|
899
986
|
```vue
|
|
900
|
-
<VcDataTable
|
|
901
|
-
:items="products"
|
|
902
|
-
state-key="product-list"
|
|
903
|
-
>
|
|
987
|
+
<VcDataTable :items="products" state-key="product-list">
|
|
904
988
|
<VcColumn id="name" field="name" title="Name" sortable />
|
|
905
989
|
<VcColumn id="price" field="price" title="Price" type="money" sortable />
|
|
906
990
|
</VcDataTable>
|
|
@@ -919,12 +1003,7 @@ Use sessionStorage instead of localStorage:
|
|
|
919
1003
|
Listen to state events:
|
|
920
1004
|
|
|
921
1005
|
```vue
|
|
922
|
-
<VcDataTable
|
|
923
|
-
:items="products"
|
|
924
|
-
state-key="product-list"
|
|
925
|
-
@state-save="onStateSave"
|
|
926
|
-
@state-restore="onStateRestore"
|
|
927
|
-
>
|
|
1006
|
+
<VcDataTable :items="products" state-key="product-list" @state-save="onStateSave" @state-restore="onStateRestore">
|
|
928
1007
|
...
|
|
929
1008
|
</VcDataTable>
|
|
930
1009
|
```
|
|
@@ -942,13 +1021,7 @@ Per-row action buttons that appear on hover or in a dropdown menu.
|
|
|
942
1021
|
Quick action buttons appear on the right side of the row on hover. Extra actions overflow into a dropdown.
|
|
943
1022
|
|
|
944
1023
|
```vue
|
|
945
|
-
<VcDataTable
|
|
946
|
-
:items="products"
|
|
947
|
-
:row-actions="getActions"
|
|
948
|
-
row-actions-mode="inline"
|
|
949
|
-
:max-quick-actions="3"
|
|
950
|
-
@row-action="onAction"
|
|
951
|
-
>
|
|
1024
|
+
<VcDataTable :items="products" :row-actions="getActions" row-actions-mode="inline" :max-quick-actions="3" @row-action="onAction">
|
|
952
1025
|
<VcColumn id="name" field="name" title="Name" />
|
|
953
1026
|
<VcColumn id="price" field="price" title="Price" type="money" />
|
|
954
1027
|
</VcDataTable>
|
|
@@ -974,11 +1047,7 @@ function onAction(event: { action: TableAction; item: Product; index: number })
|
|
|
974
1047
|
All actions in a three-dot dropdown menu:
|
|
975
1048
|
|
|
976
1049
|
```vue
|
|
977
|
-
<VcDataTable
|
|
978
|
-
:items="products"
|
|
979
|
-
:row-actions="getActions"
|
|
980
|
-
row-actions-mode="dropdown"
|
|
981
|
-
>
|
|
1050
|
+
<VcDataTable :items="products" :row-actions="getActions" row-actions-mode="dropdown">
|
|
982
1051
|
...
|
|
983
1052
|
</VcDataTable>
|
|
984
1053
|
```
|
|
@@ -988,11 +1057,7 @@ All actions in a three-dot dropdown menu:
|
|
|
988
1057
|
Render actions in a dedicated column (always visible, not overlay):
|
|
989
1058
|
|
|
990
1059
|
```vue
|
|
991
|
-
<VcDataTable
|
|
992
|
-
:items="products"
|
|
993
|
-
:row-actions="getActions"
|
|
994
|
-
row-actions-position="column"
|
|
995
|
-
>
|
|
1060
|
+
<VcDataTable :items="products" :row-actions="getActions" row-actions-position="column">
|
|
996
1061
|
...
|
|
997
1062
|
</VcDataTable>
|
|
998
1063
|
```
|
|
@@ -1029,22 +1094,17 @@ On mobile screens, VcDataTable automatically switches from a table to a card lay
|
|
|
1029
1094
|
|
|
1030
1095
|
**Mobile roles:**
|
|
1031
1096
|
|
|
1032
|
-
| Role
|
|
1033
|
-
|
|
1034
|
-
| `"title"`
|
|
1035
|
-
| `"image"`
|
|
1036
|
-
| `"field"`
|
|
1037
|
-
| `"status"` | Badge/chip at the bottom
|
|
1097
|
+
| Role | Description | Max count |
|
|
1098
|
+
| ---------- | ----------------------------------- | --------- |
|
|
1099
|
+
| `"title"` | Bold heading at the top of the card | 1 |
|
|
1100
|
+
| `"image"` | Thumbnail on the left side | 1 |
|
|
1101
|
+
| `"field"` | Label + value pair in a 2x2 grid | 4 |
|
|
1102
|
+
| `"status"` | Badge/chip at the bottom | Multiple |
|
|
1038
1103
|
|
|
1039
1104
|
### Pull-to-Refresh (mobile)
|
|
1040
1105
|
|
|
1041
1106
|
```vue
|
|
1042
|
-
<VcDataTable
|
|
1043
|
-
:items="products"
|
|
1044
|
-
:pull-to-refresh="true"
|
|
1045
|
-
:pull-to-refresh-text="{ pull: 'Pull down', release: 'Release to refresh', refreshing: 'Loading...' }"
|
|
1046
|
-
@pull-refresh="reload"
|
|
1047
|
-
>
|
|
1107
|
+
<VcDataTable :items="products" :pull-to-refresh="true" :pull-to-refresh-text="{ pull: 'Pull down', release: 'Release to refresh', refreshing: 'Loading...' }" @pull-refresh="reload">
|
|
1048
1108
|
...
|
|
1049
1109
|
</VcDataTable>
|
|
1050
1110
|
```
|
|
@@ -1122,9 +1182,26 @@ For inline editing mode, enable adding/removing rows directly in the table:
|
|
|
1122
1182
|
@row-remove="onRowRemove"
|
|
1123
1183
|
@edit-save="onBulkSave"
|
|
1124
1184
|
>
|
|
1125
|
-
<VcColumn
|
|
1126
|
-
|
|
1127
|
-
|
|
1185
|
+
<VcColumn
|
|
1186
|
+
id="name"
|
|
1187
|
+
field="name"
|
|
1188
|
+
title="Name"
|
|
1189
|
+
editable
|
|
1190
|
+
/>
|
|
1191
|
+
<VcColumn
|
|
1192
|
+
id="price"
|
|
1193
|
+
field="price"
|
|
1194
|
+
title="Price"
|
|
1195
|
+
type="money"
|
|
1196
|
+
editable
|
|
1197
|
+
/>
|
|
1198
|
+
<VcColumn
|
|
1199
|
+
id="stock"
|
|
1200
|
+
field="stock"
|
|
1201
|
+
title="Stock"
|
|
1202
|
+
type="number"
|
|
1203
|
+
editable
|
|
1204
|
+
/>
|
|
1128
1205
|
</VcDataTable>
|
|
1129
1206
|
</template>
|
|
1130
1207
|
|
|
@@ -1146,11 +1223,11 @@ function onRowRemove(event: { data: Product; index: number; cancel: () => void }
|
|
|
1146
1223
|
|
|
1147
1224
|
**Add button positions:**
|
|
1148
1225
|
|
|
1149
|
-
| Position
|
|
1150
|
-
|
|
1151
|
-
| `"header"` | Above the table body
|
|
1152
|
-
| `"footer"` | Below the table body
|
|
1153
|
-
| `"none"`
|
|
1226
|
+
| Position | Description |
|
|
1227
|
+
| ---------- | -------------------------------------------------------- |
|
|
1228
|
+
| `"header"` | Above the table body |
|
|
1229
|
+
| `"footer"` | Below the table body |
|
|
1230
|
+
| `"none"` | No built-in button (trigger via external button or slot) |
|
|
1154
1231
|
|
|
1155
1232
|
---
|
|
1156
1233
|
|
|
@@ -1158,47 +1235,47 @@ function onRowRemove(event: { data: Product; index: number; cancel: () => void }
|
|
|
1158
1235
|
|
|
1159
1236
|
### Props
|
|
1160
1237
|
|
|
1161
|
-
| Prop
|
|
1162
|
-
|
|
1163
|
-
| `id`
|
|
1164
|
-
| `field`
|
|
1165
|
-
| `title`
|
|
1166
|
-
| `type`
|
|
1167
|
-
| `currencyField`
|
|
1168
|
-
| `format`
|
|
1169
|
-
| `width`
|
|
1170
|
-
| `minWidth`
|
|
1171
|
-
| `maxWidth`
|
|
1172
|
-
| `align`
|
|
1173
|
-
| `headerAlign`
|
|
1174
|
-
| `sortable`
|
|
1175
|
-
| `sortField`
|
|
1176
|
-
| `filter`
|
|
1177
|
-
| `filterField`
|
|
1178
|
-
| `filterPlaceholder` | `string`
|
|
1179
|
-
| `visible`
|
|
1180
|
-
| `alwaysVisible`
|
|
1181
|
-
| `editable`
|
|
1182
|
-
| `rules`
|
|
1183
|
-
| `class`
|
|
1184
|
-
| `headerClass`
|
|
1185
|
-
| `bodyClass`
|
|
1186
|
-
| `lineClamp`
|
|
1187
|
-
| `selectionMode`
|
|
1188
|
-
| `rowEditor`
|
|
1189
|
-
| `rowReorder`
|
|
1190
|
-
| `expander`
|
|
1191
|
-
| `mobileRole`
|
|
1192
|
-
| `mobileVisible`
|
|
1238
|
+
| Prop | Type | Default | Description |
|
|
1239
|
+
| ------------------- | ------------------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
1240
|
+
| `id` | `string` | **required** | Unique column identifier. Must be unique within the table. |
|
|
1241
|
+
| `field` | `string` | same as `id` | Data field path to read from each row item. |
|
|
1242
|
+
| `title` | `string` | -- | Header text displayed in the column header. |
|
|
1243
|
+
| `type` | `CellType` | `"text"` | Cell formatter: `"text"`, `"number"`, `"money"`, `"date"`, `"datetime"`, `"date-ago"`, `"time"`, `"image"`, `"link"`, `"html"`, `"status"`, `"status-icon"`. |
|
|
1244
|
+
| `currencyField` | `string` | `"currency"` | Field to read currency code from (for `type="money"`). |
|
|
1245
|
+
| `format` | `string` | -- | Date/number format string (e.g. `"DD.MM.YYYY"`). |
|
|
1246
|
+
| `width` | `string \| number` | -- | Column width in px or CSS value (e.g. `200`, `"150px"`). |
|
|
1247
|
+
| `minWidth` | `string \| number` | `60` | Minimum column width during resize. |
|
|
1248
|
+
| `maxWidth` | `string \| number` | -- | Maximum column width during resize. |
|
|
1249
|
+
| `align` | `"start" \| "center" \| "end"` | -- | Cell text alignment. |
|
|
1250
|
+
| `headerAlign` | `"start" \| "center" \| "end"` | same as `align` | Header text alignment. |
|
|
1251
|
+
| `sortable` | `boolean` | `false` | Enable sorting on this column. |
|
|
1252
|
+
| `sortField` | `string` | same as `id` | Backend field name used in sort events. |
|
|
1253
|
+
| `filter` | `ColumnFilterConfig` | -- | Filter config: `true` (text), `"field"` (text with custom field), `{ options }` (select), `{ range }` (date range). |
|
|
1254
|
+
| `filterField` | `string` | same as `id` | Backend field name used in filter events. |
|
|
1255
|
+
| `filterPlaceholder` | `string` | -- | Placeholder text for the filter input. |
|
|
1256
|
+
| `visible` | `boolean` | `true` | Initial visibility. Hidden columns can be toggled via column switcher. |
|
|
1257
|
+
| `alwaysVisible` | `boolean` | `false` | Keep visible when `showAllColumns=false` (blade narrows). |
|
|
1258
|
+
| `editable` | `boolean` | `false` | Enable inline editing for this column's cells. |
|
|
1259
|
+
| `rules` | `Record<string, unknown>` | -- | Validation rules for the editable cell. |
|
|
1260
|
+
| `class` | `string` | -- | CSS class applied to header and body cells. |
|
|
1261
|
+
| `headerClass` | `string` | -- | CSS class applied only to the header cell. |
|
|
1262
|
+
| `bodyClass` | `string` | -- | CSS class applied only to body cells. |
|
|
1263
|
+
| `lineClamp` | `number` | `2` | Max lines to display before truncating. `0` = no clamp. |
|
|
1264
|
+
| `selectionMode` | `"single" \| "multiple"` | -- | Renders a selection checkbox/radio column. |
|
|
1265
|
+
| `rowEditor` | `boolean` | `false` | Renders save/cancel buttons for row edit mode. |
|
|
1266
|
+
| `rowReorder` | `boolean` | `false` | Renders a drag handle for row reordering. |
|
|
1267
|
+
| `expander` | `boolean` | `false` | Renders an expand/collapse toggle. |
|
|
1268
|
+
| `mobileRole` | `"title" \| "image" \| "field" \| "status"` | -- | Role in mobile card layout. |
|
|
1269
|
+
| `mobileVisible` | `boolean` | `false` | Whether column is visible on mobile (hidden unless `mobileRole` set). |
|
|
1193
1270
|
|
|
1194
1271
|
### Slots
|
|
1195
1272
|
|
|
1196
|
-
| Slot
|
|
1197
|
-
|
|
1198
|
-
| `#body`
|
|
1199
|
-
| `#editor` | `{ data: T, field: string, index: number, editorCallback: Function }`
|
|
1200
|
-
| `#header` | `{ column: VcColumnProps }`
|
|
1201
|
-
| `#filter` | `{ field, value, updateValue, applyFilter, clearFilter, startDate, endDate, ... }` | Custom filter UI.
|
|
1273
|
+
| Slot | Props | Description |
|
|
1274
|
+
| --------- | ---------------------------------------------------------------------------------- | --------------------------- |
|
|
1275
|
+
| `#body` | `{ data: T, field: string, index: number }` | Custom cell rendering. |
|
|
1276
|
+
| `#editor` | `{ data: T, field: string, index: number, editorCallback: Function }` | Custom inline editor. |
|
|
1277
|
+
| `#header` | `{ column: VcColumnProps }` | Custom header cell content. |
|
|
1278
|
+
| `#filter` | `{ field, value, updateValue, applyFilter, clearFilter, startDate, endDate, ... }` | Custom filter UI. |
|
|
1202
1279
|
|
|
1203
1280
|
---
|
|
1204
1281
|
|
|
@@ -1206,146 +1283,146 @@ function onRowRemove(event: { data: Product; index: number; cancel: () => void }
|
|
|
1206
1283
|
|
|
1207
1284
|
### Data
|
|
1208
1285
|
|
|
1209
|
-
| Prop
|
|
1210
|
-
|
|
1211
|
-
| `items`
|
|
1212
|
-
| `dataKey`
|
|
1213
|
-
| `loading`
|
|
1214
|
-
| `skeletonRows` | `number`
|
|
1286
|
+
| Prop | Type | Default | Description |
|
|
1287
|
+
| -------------- | --------- | ------- | ----------------------------------------------- |
|
|
1288
|
+
| `items` | `T[]` | `[]` | Array of data items to display. |
|
|
1289
|
+
| `dataKey` | `string` | `"id"` | Field name used as unique row identifier. |
|
|
1290
|
+
| `loading` | `boolean` | `false` | Show loading overlay. |
|
|
1291
|
+
| `skeletonRows` | `number` | -- | Number of skeleton rows during initial loading. |
|
|
1215
1292
|
|
|
1216
1293
|
### Selection
|
|
1217
1294
|
|
|
1218
|
-
| Prop
|
|
1219
|
-
|
|
1220
|
-
| `selection`
|
|
1221
|
-
| `selectionMode`
|
|
1222
|
-
| `isRowSelectable`
|
|
1223
|
-
| `compareSelectionBy` | `"equals" \| "field"`
|
|
1224
|
-
| `selectAll`
|
|
1225
|
-
| `selectAllActive`
|
|
1226
|
-
| `activeItemId`
|
|
1295
|
+
| Prop | Type | Default | Description |
|
|
1296
|
+
| -------------------- | ------------------------ | ------- | ------------------------------------------------------------------------------------------------- |
|
|
1297
|
+
| `selection` | `T \| T[]` | -- | Selected item(s). Use with `v-model:selection`. |
|
|
1298
|
+
| `selectionMode` | `"single" \| "multiple"` | -- | Row selection mode. |
|
|
1299
|
+
| `isRowSelectable` | `(data: T) => boolean` | -- | Per-row function to disable selection. |
|
|
1300
|
+
| `compareSelectionBy` | `"equals" \| "field"` | -- | Compare items by deep equality or by `dataKey` field. |
|
|
1301
|
+
| `selectAll` | `boolean` | `false` | Enable "select all" header checkbox. |
|
|
1302
|
+
| `selectAllActive` | `boolean` | `false` | Whether "select all" (including non-visible items) is active. Use with `v-model:selectAllActive`. |
|
|
1303
|
+
| `activeItemId` | `string` | -- | ID of the highlighted row. Use with `v-model:activeItemId`. |
|
|
1227
1304
|
|
|
1228
1305
|
### Sorting
|
|
1229
1306
|
|
|
1230
|
-
| Prop
|
|
1231
|
-
|
|
1232
|
-
| `sortField`
|
|
1233
|
-
| `sortOrder`
|
|
1234
|
-
| `sortMode`
|
|
1235
|
-
| `multiSortMeta` | `SortMeta[]`
|
|
1236
|
-
| `removableSort` | `boolean`
|
|
1307
|
+
| Prop | Type | Default | Description |
|
|
1308
|
+
| --------------- | ------------------------ | ---------- | ------------------------------------------------------ |
|
|
1309
|
+
| `sortField` | `string` | -- | Currently sorted field. Use with `v-model:sortField`. |
|
|
1310
|
+
| `sortOrder` | `1 \| -1 \| 0` | `0` | Sort direction. Use with `v-model:sortOrder`. |
|
|
1311
|
+
| `sortMode` | `"single" \| "multiple"` | `"single"` | Single or multi-column sort. |
|
|
1312
|
+
| `multiSortMeta` | `SortMeta[]` | `[]` | Multi-sort metadata. Use with `v-model:multiSortMeta`. |
|
|
1313
|
+
| `removableSort` | `boolean` | `false` | Allow 3-state sort cycle (asc -> desc -> none). |
|
|
1237
1314
|
|
|
1238
1315
|
### Editing
|
|
1239
1316
|
|
|
1240
|
-
| Prop
|
|
1241
|
-
|
|
1242
|
-
| `editMode`
|
|
1243
|
-
| `editingRows`
|
|
1244
|
-
| `addRow`
|
|
1245
|
-
| `validationRules` | `Record<string, (value, row) => string \| true>` | --
|
|
1317
|
+
| Prop | Type | Default | Description |
|
|
1318
|
+
| ----------------- | ------------------------------------------------ | ------- | ------------------------------------------------------- |
|
|
1319
|
+
| `editMode` | `"cell" \| "row" \| "inline"` | -- | Inline editing mode. |
|
|
1320
|
+
| `editingRows` | `T[]` | -- | Currently editing rows. Use with `v-model:editingRows`. |
|
|
1321
|
+
| `addRow` | `AddRowConfig` | -- | Add-row button configuration for inline edit mode. |
|
|
1322
|
+
| `validationRules` | `Record<string, (value, row) => string \| true>` | -- | Field-level validators for inline editing. |
|
|
1246
1323
|
|
|
1247
1324
|
### Visual
|
|
1248
1325
|
|
|
1249
|
-
| Prop
|
|
1250
|
-
|
|
1251
|
-
| `striped`
|
|
1252
|
-
| `bordered`
|
|
1253
|
-
| `showGridlines` | `boolean`
|
|
1254
|
-
| `rowHover`
|
|
1255
|
-
| `size`
|
|
1256
|
-
| `variant`
|
|
1257
|
-
| `rowClass`
|
|
1258
|
-
| `rowStyle`
|
|
1326
|
+
| Prop | Type | Default | Description |
|
|
1327
|
+
| --------------- | -------------------------------------- | ----------- | ------------------------------ |
|
|
1328
|
+
| `striped` | `boolean` | `false` | Alternate row backgrounds. |
|
|
1329
|
+
| `bordered` | `boolean` | `false` | Border around the table. |
|
|
1330
|
+
| `showGridlines` | `boolean` | `false` | Grid lines between cells. |
|
|
1331
|
+
| `rowHover` | `boolean` | `true` | Highlight rows on hover. |
|
|
1332
|
+
| `size` | `"small" \| "normal" \| "large"` | `"normal"` | Row density. |
|
|
1333
|
+
| `variant` | `"default" \| "striped" \| "bordered"` | `"default"` | Visual variant. |
|
|
1334
|
+
| `rowClass` | `(data: T) => string \| object` | -- | Per-row CSS class function. |
|
|
1335
|
+
| `rowStyle` | `(data: T) => object` | -- | Per-row inline style function. |
|
|
1259
1336
|
|
|
1260
1337
|
### Column Management
|
|
1261
1338
|
|
|
1262
|
-
| Prop
|
|
1263
|
-
|
|
1264
|
-
| `resizableColumns`
|
|
1265
|
-
| `reorderableColumns` | `boolean`
|
|
1266
|
-
| `showAllColumns`
|
|
1267
|
-
| `columnSwitcher`
|
|
1339
|
+
| Prop | Type | Default | Description |
|
|
1340
|
+
| -------------------- | -------------------------------- | ------- | ----------------------------------------------------- |
|
|
1341
|
+
| `resizableColumns` | `boolean` | `true` | Allow column resize by dragging header borders. |
|
|
1342
|
+
| `reorderableColumns` | `boolean` | `true` | Allow column reorder by dragging headers. |
|
|
1343
|
+
| `showAllColumns` | `boolean` | `true` | When `false`, only `alwaysVisible` columns are shown. |
|
|
1344
|
+
| `columnSwitcher` | `boolean \| "auto" \| "defined"` | `true` | Column visibility toggle panel. |
|
|
1268
1345
|
|
|
1269
1346
|
### Scrolling
|
|
1270
1347
|
|
|
1271
|
-
| Prop
|
|
1272
|
-
|
|
1273
|
-
| `scrollable`
|
|
1274
|
-
| `scrollHeight`
|
|
1275
|
-
| `infiniteScroll`
|
|
1276
|
-
| `infiniteScrollDistance` | `number`
|
|
1348
|
+
| Prop | Type | Default | Description |
|
|
1349
|
+
| ------------------------ | --------- | ------- | ------------------------------------------------------- |
|
|
1350
|
+
| `scrollable` | `boolean` | `false` | Enable scroll within the table container. |
|
|
1351
|
+
| `scrollHeight` | `string` | -- | Fixed height for the scroll container (e.g. `"400px"`). |
|
|
1352
|
+
| `infiniteScroll` | `boolean` | `false` | Enable infinite scroll. |
|
|
1353
|
+
| `infiniteScrollDistance` | `number` | `100` | Distance in px from bottom to trigger `@load-more`. |
|
|
1277
1354
|
|
|
1278
1355
|
### Row Actions
|
|
1279
1356
|
|
|
1280
|
-
| Prop
|
|
1281
|
-
|
|
1282
|
-
| `rowActions`
|
|
1283
|
-
| `rowActionsMode`
|
|
1284
|
-
| `rowActionsPosition` | `"overlay" \| "column"`
|
|
1285
|
-
| `maxQuickActions`
|
|
1357
|
+
| Prop | Type | Default | Description |
|
|
1358
|
+
| -------------------- | ---------------------------- | ----------- | ------------------------------------------- |
|
|
1359
|
+
| `rowActions` | `(item: T) => TableAction[]` | -- | Per-row action items. |
|
|
1360
|
+
| `rowActionsMode` | `"inline" \| "dropdown"` | `"inline"` | Action display mode. |
|
|
1361
|
+
| `rowActionsPosition` | `"overlay" \| "column"` | `"overlay"` | Float over row or fixed column. |
|
|
1362
|
+
| `maxQuickActions` | `number` | `4` | Max quick actions before overflow dropdown. |
|
|
1286
1363
|
|
|
1287
1364
|
### Expandable Rows
|
|
1288
1365
|
|
|
1289
|
-
| Prop
|
|
1290
|
-
|
|
1291
|
-
| `expandedRows`
|
|
1292
|
-
| `expandedRowIcon`
|
|
1293
|
-
| `collapsedRowIcon` | `string`
|
|
1294
|
-
| `isRowExpandable`
|
|
1366
|
+
| Prop | Type | Default | Description |
|
|
1367
|
+
| ------------------ | ---------------------- | ------------------------ | ----------------------------------------------- |
|
|
1368
|
+
| `expandedRows` | `T[]` | `[]` | Expanded rows. Use with `v-model:expandedRows`. |
|
|
1369
|
+
| `expandedRowIcon` | `string` | `"lucide-chevron-down"` | Icon for expanded state. |
|
|
1370
|
+
| `collapsedRowIcon` | `string` | `"lucide-chevron-right"` | Icon for collapsed state. |
|
|
1371
|
+
| `isRowExpandable` | `(data: T) => boolean` | -- | Per-row predicate to hide the expand toggle. |
|
|
1295
1372
|
|
|
1296
1373
|
### Row Grouping
|
|
1297
1374
|
|
|
1298
|
-
| Prop
|
|
1299
|
-
|
|
1300
|
-
| `groupRowsBy`
|
|
1301
|
-
| `rowGroupMode`
|
|
1302
|
-
| `expandableRowGroups` | `boolean`
|
|
1303
|
-
| `expandedRowGroups`
|
|
1375
|
+
| Prop | Type | Default | Description |
|
|
1376
|
+
| --------------------- | -------------------------- | ------------- | ---------------------------------------------------------- |
|
|
1377
|
+
| `groupRowsBy` | `string \| string[]` | -- | Field(s) to group rows by. |
|
|
1378
|
+
| `rowGroupMode` | `"subheader" \| "rowspan"` | `"subheader"` | Group display mode. |
|
|
1379
|
+
| `expandableRowGroups` | `boolean` | `false` | Allow collapsing/expanding groups. |
|
|
1380
|
+
| `expandedRowGroups` | `string[]` | -- | Expanded group keys. Use with `v-model:expandedRowGroups`. |
|
|
1304
1381
|
|
|
1305
1382
|
### Pagination
|
|
1306
1383
|
|
|
1307
|
-
| Prop
|
|
1308
|
-
|
|
1309
|
-
| `pagination` | `DataTablePagination` | --
|
|
1310
|
-
| `totalCount` | `number`
|
|
1311
|
-
| `totalLabel` | `string`
|
|
1384
|
+
| Prop | Type | Default | Description |
|
|
1385
|
+
| ------------ | --------------------- | ------- | ------------------------------------------------------------ |
|
|
1386
|
+
| `pagination` | `DataTablePagination` | -- | `{ currentPage, pages, pageSize?, variant? }`. Omit to hide. |
|
|
1387
|
+
| `totalCount` | `number` | -- | Total item count (for "Showing X of Y" and select-all). |
|
|
1388
|
+
| `totalLabel` | `string` | -- | Label for the total counter. |
|
|
1312
1389
|
|
|
1313
1390
|
### Search
|
|
1314
1391
|
|
|
1315
|
-
| Prop
|
|
1316
|
-
|
|
1317
|
-
| `searchable`
|
|
1318
|
-
| `searchValue`
|
|
1319
|
-
| `searchPlaceholder` | `string`
|
|
1320
|
-
| `searchDebounce`
|
|
1392
|
+
| Prop | Type | Default | Description |
|
|
1393
|
+
| ------------------- | --------- | ------------- | --------------------------------------------------- |
|
|
1394
|
+
| `searchable` | `boolean` | `false` | Show search bar. |
|
|
1395
|
+
| `searchValue` | `string` | -- | Search input value. Use with `v-model:searchValue`. |
|
|
1396
|
+
| `searchPlaceholder` | `string` | `"Search..."` | Placeholder text. |
|
|
1397
|
+
| `searchDebounce` | `number` | `300` | Debounce delay in ms. |
|
|
1321
1398
|
|
|
1322
1399
|
### Filters
|
|
1323
1400
|
|
|
1324
|
-
| Prop
|
|
1325
|
-
|
|
1326
|
-
| `globalFilters` | `GlobalFilterConfig[]` | --
|
|
1401
|
+
| Prop | Type | Default | Description |
|
|
1402
|
+
| --------------- | ---------------------- | ------- | ---------------------------------- |
|
|
1403
|
+
| `globalFilters` | `GlobalFilterConfig[]` | -- | Global filter panel configuration. |
|
|
1327
1404
|
|
|
1328
1405
|
### State Persistence
|
|
1329
1406
|
|
|
1330
|
-
| Prop
|
|
1331
|
-
|
|
1332
|
-
| `stateKey`
|
|
1333
|
-
| `stateStorage` | `"local" \| "session"` | `"local"` | Storage backend.
|
|
1407
|
+
| Prop | Type | Default | Description |
|
|
1408
|
+
| -------------- | ---------------------- | --------- | ------------------------------------------------------ |
|
|
1409
|
+
| `stateKey` | `string` | -- | Key for persisting state. Omit to disable persistence. |
|
|
1410
|
+
| `stateStorage` | `"local" \| "session"` | `"local"` | Storage backend. |
|
|
1334
1411
|
|
|
1335
1412
|
### Empty States
|
|
1336
1413
|
|
|
1337
|
-
| Prop
|
|
1338
|
-
|
|
1339
|
-
| `emptyState`
|
|
1340
|
-
| `notFoundState` | `TableStateConfig` | --
|
|
1414
|
+
| Prop | Type | Default | Description |
|
|
1415
|
+
| --------------- | ------------------ | ------- | --------------------------------------------------------------- |
|
|
1416
|
+
| `emptyState` | `TableStateConfig` | -- | `{ icon?, title?, description?, actionLabel?, actionHandler? }` |
|
|
1417
|
+
| `notFoundState` | `TableStateConfig` | -- | Same shape, shown when search/filters are active. |
|
|
1341
1418
|
|
|
1342
1419
|
### Mobile
|
|
1343
1420
|
|
|
1344
|
-
| Prop
|
|
1345
|
-
|
|
1346
|
-
| `pullToRefresh`
|
|
1347
|
-
| `pullToRefreshText` | `PullToRefreshTextConfig` | --
|
|
1348
|
-
| `reorderableRows`
|
|
1421
|
+
| Prop | Type | Default | Description |
|
|
1422
|
+
| ------------------- | ------------------------- | ------- | ----------------------------------------------- |
|
|
1423
|
+
| `pullToRefresh` | `boolean` | `false` | Enable pull-to-refresh on mobile. |
|
|
1424
|
+
| `pullToRefreshText` | `PullToRefreshTextConfig` | -- | Custom text for pull/release/refreshing states. |
|
|
1425
|
+
| `reorderableRows` | `boolean` | `false` | Enable row drag-and-drop. |
|
|
1349
1426
|
|
|
1350
1427
|
---
|
|
1351
1428
|
|
|
@@ -1353,113 +1430,113 @@ function onRowRemove(event: { data: Product; index: number; cancel: () => void }
|
|
|
1353
1430
|
|
|
1354
1431
|
### Selection Events
|
|
1355
1432
|
|
|
1356
|
-
| Event
|
|
1357
|
-
|
|
1358
|
-
| `update:selection`
|
|
1359
|
-
| `update:selectAll`
|
|
1360
|
-
| `update:selectAllActive` | `boolean`
|
|
1361
|
-
| `row-select`
|
|
1362
|
-
| `row-unselect`
|
|
1363
|
-
| `row-select-all`
|
|
1364
|
-
| `row-unselect-all`
|
|
1365
|
-
| `select-all`
|
|
1433
|
+
| Event | Payload | Description |
|
|
1434
|
+
| ------------------------ | ------------------------------------- | -------------------------------------------------- |
|
|
1435
|
+
| `update:selection` | `T \| T[]` | v-model update for selection. |
|
|
1436
|
+
| `update:selectAll` | `boolean` | v-model update for select-all checkbox. |
|
|
1437
|
+
| `update:selectAllActive` | `boolean` | v-model update for "select all" active state. |
|
|
1438
|
+
| `row-select` | `{ data: T, originalEvent: Event }` | Row selected. |
|
|
1439
|
+
| `row-unselect` | `{ data: T, originalEvent: Event }` | Row deselected. |
|
|
1440
|
+
| `row-select-all` | `{ data: T[], originalEvent: Event }` | All visible rows selected. |
|
|
1441
|
+
| `row-unselect-all` | `{ data: T[], originalEvent: Event }` | All visible rows deselected. |
|
|
1442
|
+
| `select-all` | `{ selected: boolean }` | "Select all" banner toggle (includes non-visible). |
|
|
1366
1443
|
|
|
1367
1444
|
### Editing Events
|
|
1368
1445
|
|
|
1369
|
-
| Event
|
|
1370
|
-
|
|
1371
|
-
| `update:editingRows` | `T[]`
|
|
1372
|
-
| `cell-edit-init`
|
|
1373
|
-
| `cell-edit-complete` | `{ data: T, field: string, newValue: unknown, index: number }` | Cell edit committed.
|
|
1374
|
-
| `cell-edit-cancel`
|
|
1375
|
-
| `row-edit-init`
|
|
1376
|
-
| `row-edit-save`
|
|
1377
|
-
| `row-edit-cancel`
|
|
1378
|
-
| `edit-save`
|
|
1379
|
-
| `edit-cancel`
|
|
1380
|
-
| `row-add`
|
|
1381
|
-
| `row-remove`
|
|
1446
|
+
| Event | Payload | Description |
|
|
1447
|
+
| -------------------- | -------------------------------------------------------------- | ------------------------------------------ |
|
|
1448
|
+
| `update:editingRows` | `T[]` | v-model update for currently editing rows. |
|
|
1449
|
+
| `cell-edit-init` | `{ data: T, field: string, index: number }` | Cell entered edit mode. |
|
|
1450
|
+
| `cell-edit-complete` | `{ data: T, field: string, newValue: unknown, index: number }` | Cell edit committed. |
|
|
1451
|
+
| `cell-edit-cancel` | `{ data: T, field: string, index: number }` | Cell edit cancelled. |
|
|
1452
|
+
| `row-edit-init` | `{ data: T, index: number }` | Row entered edit mode. |
|
|
1453
|
+
| `row-edit-save` | `{ data: T, newData: T, index: number }` | Row edits saved. |
|
|
1454
|
+
| `row-edit-cancel` | `{ data: T, index: number }` | Row edits cancelled. |
|
|
1455
|
+
| `edit-save` | `{ changes: EditChange<T>[] }` | Bulk inline edits saved. |
|
|
1456
|
+
| `edit-cancel` | -- | Bulk inline editing cancelled. |
|
|
1457
|
+
| `row-add` | `{ defaults: Record<string, unknown>, cancel: () => void }` | New row being added. |
|
|
1458
|
+
| `row-remove` | `{ data: T, index: number, cancel: () => void }` | Row being removed. |
|
|
1382
1459
|
|
|
1383
1460
|
### Sorting Events
|
|
1384
1461
|
|
|
1385
|
-
| Event
|
|
1386
|
-
|
|
1387
|
-
| `update:sortField`
|
|
1388
|
-
| `update:sortOrder`
|
|
1389
|
-
| `update:multiSortMeta` | `SortMeta[]`
|
|
1390
|
-
| `sort`
|
|
1462
|
+
| Event | Payload | Description |
|
|
1463
|
+
| ---------------------- | -------------------------------------------- | -------------------------------------------- |
|
|
1464
|
+
| `update:sortField` | `string` | v-model update for sorted field. |
|
|
1465
|
+
| `update:sortOrder` | `number` | v-model update for sort direction. |
|
|
1466
|
+
| `update:multiSortMeta` | `SortMeta[]` | v-model update for multi-sort. |
|
|
1467
|
+
| `sort` | `{ sortField?, sortOrder?, multiSortMeta? }` | Sort changed -- use for server-side sorting. |
|
|
1391
1468
|
|
|
1392
1469
|
### Filtering Events
|
|
1393
1470
|
|
|
1394
|
-
| Event
|
|
1395
|
-
|
|
1471
|
+
| Event | Payload | Description |
|
|
1472
|
+
| -------- | ---------------------------------------------------------- | ------------------------- |
|
|
1396
1473
|
| `filter` | `{ filters: Record<string, unknown>, filteredValue: T[] }` | Any filter value changed. |
|
|
1397
1474
|
|
|
1398
1475
|
### Row Interaction Events
|
|
1399
1476
|
|
|
1400
|
-
| Event
|
|
1401
|
-
|
|
1402
|
-
| `row-click`
|
|
1403
|
-
| `row-action` | `{ action: TableAction, item: T, index: number }`
|
|
1477
|
+
| Event | Payload | Description |
|
|
1478
|
+
| ------------ | -------------------------------------------------- | --------------------- |
|
|
1479
|
+
| `row-click` | `{ data: T, index: number, originalEvent: Event }` | Row clicked. |
|
|
1480
|
+
| `row-action` | `{ action: TableAction, item: T, index: number }` | Row action triggered. |
|
|
1404
1481
|
|
|
1405
1482
|
### Reorder Events
|
|
1406
1483
|
|
|
1407
|
-
| Event
|
|
1408
|
-
|
|
1409
|
-
| `row-reorder`
|
|
1410
|
-
| `column-resize-end` | `{ columns: { id, width }[] }`
|
|
1411
|
-
| `column-reorder`
|
|
1484
|
+
| Event | Payload | Description |
|
|
1485
|
+
| ------------------- | -------------------------------------- | ---------------------------- |
|
|
1486
|
+
| `row-reorder` | `{ dragIndex, dropIndex, value: T[] }` | Row drag-and-drop completed. |
|
|
1487
|
+
| `column-resize-end` | `{ columns: { id, width }[] }` | Column resize completed. |
|
|
1488
|
+
| `column-reorder` | `{ columns: { id, ... }[] }` | Column reorder completed. |
|
|
1412
1489
|
|
|
1413
1490
|
### Expansion Events
|
|
1414
1491
|
|
|
1415
|
-
| Event
|
|
1416
|
-
|
|
1417
|
-
| `update:expandedRows`
|
|
1418
|
-
| `row-expand`
|
|
1419
|
-
| `row-collapse`
|
|
1420
|
-
| `update:expandedRowGroups` | `string[]`
|
|
1421
|
-
| `rowgroup-expand`
|
|
1422
|
-
| `rowgroup-collapse`
|
|
1492
|
+
| Event | Payload | Description |
|
|
1493
|
+
| -------------------------- | ---------------------------------------- | ----------------------------------- |
|
|
1494
|
+
| `update:expandedRows` | `T[]` | v-model update for expanded rows. |
|
|
1495
|
+
| `row-expand` | `{ data: T, originalEvent: Event }` | Row expanded. |
|
|
1496
|
+
| `row-collapse` | `{ data: T, originalEvent: Event }` | Row collapsed. |
|
|
1497
|
+
| `update:expandedRowGroups` | `string[]` | v-model update for expanded groups. |
|
|
1498
|
+
| `rowgroup-expand` | `{ data: string, originalEvent: Event }` | Row group expanded. |
|
|
1499
|
+
| `rowgroup-collapse` | `{ data: string, originalEvent: Event }` | Row group collapsed. |
|
|
1423
1500
|
|
|
1424
1501
|
### Other Events
|
|
1425
1502
|
|
|
1426
|
-
| Event
|
|
1427
|
-
|
|
1428
|
-
| `pagination-click`
|
|
1429
|
-
| `update:searchValue`
|
|
1430
|
-
| `search`
|
|
1431
|
-
| `load-more`
|
|
1432
|
-
| `pull-refresh`
|
|
1433
|
-
| `state-save`
|
|
1434
|
-
| `state-restore`
|
|
1435
|
-
| `update:activeItemId` | `string \| undefined`
|
|
1503
|
+
| Event | Payload | Description |
|
|
1504
|
+
| --------------------- | ------------------------- | ---------------------------------- |
|
|
1505
|
+
| `pagination-click` | `number` | Page button clicked. |
|
|
1506
|
+
| `update:searchValue` | `string` | v-model update for search input. |
|
|
1507
|
+
| `search` | `string` | Debounced search value. |
|
|
1508
|
+
| `load-more` | -- | Infinite scroll threshold reached. |
|
|
1509
|
+
| `pull-refresh` | -- | Mobile pull-to-refresh triggered. |
|
|
1510
|
+
| `state-save` | `DataTablePersistedState` | State saved to storage. |
|
|
1511
|
+
| `state-restore` | `DataTablePersistedState` | State restored from storage. |
|
|
1512
|
+
| `update:activeItemId` | `string \| undefined` | v-model update for active row. |
|
|
1436
1513
|
|
|
1437
1514
|
---
|
|
1438
1515
|
|
|
1439
1516
|
## VcDataTable Slots Reference
|
|
1440
1517
|
|
|
1441
|
-
| Slot
|
|
1442
|
-
|
|
1443
|
-
| `default`
|
|
1444
|
-
| `header`
|
|
1445
|
-
| `footer`
|
|
1446
|
-
| `search-header-actions` | --
|
|
1447
|
-
| `selection-banner`
|
|
1448
|
-
| `expansion`
|
|
1449
|
-
| `empty`
|
|
1450
|
-
| `not-found`
|
|
1451
|
-
| `loading`
|
|
1452
|
-
| `groupheader`
|
|
1453
|
-
| `groupfooter`
|
|
1454
|
-
| `pagination`
|
|
1518
|
+
| Slot | Props | Description |
|
|
1519
|
+
| ----------------------- | --------------------------------------------------------------- | ---------------------------------------------------------- |
|
|
1520
|
+
| `default` | -- | VcColumn declarations (required). |
|
|
1521
|
+
| `header` | -- | Custom header content above the table. |
|
|
1522
|
+
| `footer` | -- | Custom footer content below the table body. |
|
|
1523
|
+
| `search-header-actions` | -- | Extra buttons in the search toolbar (beside filter icon). |
|
|
1524
|
+
| `selection-banner` | `{ count, totalCount, isSelectAll, selectAll, clearSelection }` | Custom selection banner. |
|
|
1525
|
+
| `expansion` | `{ data: T, index: number }` | Content rendered below an expanded row. |
|
|
1526
|
+
| `empty` | -- | Custom empty state (no items, no search). |
|
|
1527
|
+
| `not-found` | -- | Custom not-found state (no items + active search/filters). |
|
|
1528
|
+
| `loading` | -- | Custom loading state. |
|
|
1529
|
+
| `groupheader` | `{ data: T, index: number }` | Custom row group header. |
|
|
1530
|
+
| `groupfooter` | `{ data: T, index: number }` | Custom row group footer. |
|
|
1531
|
+
| `pagination` | `{ pages, currentPage, onPageClick }` | Custom pagination replacing built-in VcPagination. |
|
|
1455
1532
|
|
|
1456
1533
|
---
|
|
1457
1534
|
|
|
1458
1535
|
## Recipes
|
|
1459
1536
|
|
|
1460
|
-
### Recipe 1:
|
|
1537
|
+
### Recipe 1: Entity List Blade
|
|
1461
1538
|
|
|
1462
|
-
A typical list blade with search, pagination, row actions, and empty states
|
|
1539
|
+
A typical list blade with search, pagination, row actions, and empty states.
|
|
1463
1540
|
|
|
1464
1541
|
```vue
|
|
1465
1542
|
<template>
|
|
@@ -1497,7 +1574,9 @@ A typical list blade with search, pagination, row actions, and empty states -- m
|
|
|
1497
1574
|
icon: 'lucide-search-x',
|
|
1498
1575
|
title: $t('PRODUCTS.LIST.NOT_FOUND'),
|
|
1499
1576
|
actionLabel: $t('PRODUCTS.LIST.CLEAR_SEARCH'),
|
|
1500
|
-
actionHandler: () => {
|
|
1577
|
+
actionHandler: () => {
|
|
1578
|
+
searchValue = '';
|
|
1579
|
+
},
|
|
1501
1580
|
}"
|
|
1502
1581
|
@search="onSearch"
|
|
1503
1582
|
@row-click="onRowClick"
|
|
@@ -1597,10 +1676,34 @@ Handle sorting and paging entirely on the backend:
|
|
|
1597
1676
|
@sort="onSort"
|
|
1598
1677
|
@pagination-click="onPage"
|
|
1599
1678
|
>
|
|
1600
|
-
<VcColumn
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1679
|
+
<VcColumn
|
|
1680
|
+
id="number"
|
|
1681
|
+
field="number"
|
|
1682
|
+
title="Order #"
|
|
1683
|
+
sortable
|
|
1684
|
+
/>
|
|
1685
|
+
<VcColumn
|
|
1686
|
+
id="customer"
|
|
1687
|
+
field="customerName"
|
|
1688
|
+
title="Customer"
|
|
1689
|
+
sortable
|
|
1690
|
+
sort-field="customer.name"
|
|
1691
|
+
/>
|
|
1692
|
+
<VcColumn
|
|
1693
|
+
id="total"
|
|
1694
|
+
field="total"
|
|
1695
|
+
title="Total"
|
|
1696
|
+
type="money"
|
|
1697
|
+
sortable
|
|
1698
|
+
align="end"
|
|
1699
|
+
/>
|
|
1700
|
+
<VcColumn
|
|
1701
|
+
id="date"
|
|
1702
|
+
field="createdDate"
|
|
1703
|
+
title="Date"
|
|
1704
|
+
type="datetime"
|
|
1705
|
+
sortable
|
|
1706
|
+
/>
|
|
1604
1707
|
</VcDataTable>
|
|
1605
1708
|
</template>
|
|
1606
1709
|
|
|
@@ -1611,7 +1714,11 @@ const page = ref(1);
|
|
|
1611
1714
|
|
|
1612
1715
|
async function fetchOrders() {
|
|
1613
1716
|
loading.value = true;
|
|
1614
|
-
const {
|
|
1717
|
+
const {
|
|
1718
|
+
items,
|
|
1719
|
+
totalCount: total,
|
|
1720
|
+
pages,
|
|
1721
|
+
} = await api.searchOrders({
|
|
1615
1722
|
sort: sortOrder.value !== 0 ? `${sortField.value}:${sortOrder.value === 1 ? "ASC" : "DESC"}` : undefined,
|
|
1616
1723
|
skip: (page.value - 1) * 20,
|
|
1617
1724
|
take: 20,
|
|
@@ -1622,8 +1729,14 @@ async function fetchOrders() {
|
|
|
1622
1729
|
loading.value = false;
|
|
1623
1730
|
}
|
|
1624
1731
|
|
|
1625
|
-
function onSort() {
|
|
1626
|
-
|
|
1732
|
+
function onSort() {
|
|
1733
|
+
page.value = 1;
|
|
1734
|
+
fetchOrders();
|
|
1735
|
+
}
|
|
1736
|
+
function onPage(p: number) {
|
|
1737
|
+
page.value = p;
|
|
1738
|
+
fetchOrders();
|
|
1739
|
+
}
|
|
1627
1740
|
</script>
|
|
1628
1741
|
```
|
|
1629
1742
|
|
|
@@ -1640,11 +1753,42 @@ function onPage(p: number) { page.value = p; fetchOrders(); }
|
|
|
1640
1753
|
@row-add="onRowAdd"
|
|
1641
1754
|
@row-remove="onRowRemove"
|
|
1642
1755
|
>
|
|
1643
|
-
<VcColumn
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1756
|
+
<VcColumn
|
|
1757
|
+
id="sku"
|
|
1758
|
+
field="sku"
|
|
1759
|
+
title="SKU"
|
|
1760
|
+
editable
|
|
1761
|
+
/>
|
|
1762
|
+
<VcColumn
|
|
1763
|
+
id="name"
|
|
1764
|
+
field="name"
|
|
1765
|
+
title="Product Name"
|
|
1766
|
+
editable
|
|
1767
|
+
/>
|
|
1768
|
+
<VcColumn
|
|
1769
|
+
id="listPrice"
|
|
1770
|
+
field="listPrice"
|
|
1771
|
+
title="List Price"
|
|
1772
|
+
type="money"
|
|
1773
|
+
editable
|
|
1774
|
+
align="end"
|
|
1775
|
+
/>
|
|
1776
|
+
<VcColumn
|
|
1777
|
+
id="salePrice"
|
|
1778
|
+
field="salePrice"
|
|
1779
|
+
title="Sale Price"
|
|
1780
|
+
type="money"
|
|
1781
|
+
editable
|
|
1782
|
+
align="end"
|
|
1783
|
+
/>
|
|
1784
|
+
<VcColumn
|
|
1785
|
+
id="minQuantity"
|
|
1786
|
+
field="minQuantity"
|
|
1787
|
+
title="Min Qty"
|
|
1788
|
+
type="number"
|
|
1789
|
+
editable
|
|
1790
|
+
align="end"
|
|
1791
|
+
/>
|
|
1648
1792
|
</VcDataTable>
|
|
1649
1793
|
</template>
|
|
1650
1794
|
|
|
@@ -1653,8 +1797,7 @@ const rules = {
|
|
|
1653
1797
|
sku: (v: unknown) => (v ? true : "SKU is required"),
|
|
1654
1798
|
name: (v: unknown) => (v ? true : "Name is required"),
|
|
1655
1799
|
listPrice: (v: unknown) => (Number(v) > 0 ? true : "Must be greater than 0"),
|
|
1656
|
-
salePrice: (v: unknown, row: any) =>
|
|
1657
|
-
Number(v) <= Number(row.listPrice) ? true : "Sale price cannot exceed list price",
|
|
1800
|
+
salePrice: (v: unknown, row: any) => (Number(v) <= Number(row.listPrice) ? true : "Sale price cannot exceed list price"),
|
|
1658
1801
|
};
|
|
1659
1802
|
|
|
1660
1803
|
function onSave(event: { changes: EditChange[] }) {
|
|
@@ -1798,13 +1941,13 @@ const isSelectable = (item) => item.stock > 0;
|
|
|
1798
1941
|
|
|
1799
1942
|
## Related Components
|
|
1800
1943
|
|
|
1801
|
-
| Component
|
|
1802
|
-
|
|
1944
|
+
| Component | Description |
|
|
1945
|
+
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
1803
1946
|
| **VcTableAdapter** (`VcTable`) | Legacy API wrapper around VcDataTable. Exported as `VcTable` for backward compatibility. Use VcDataTable directly for new code. |
|
|
1804
|
-
| **VcColumn**
|
|
1805
|
-
| **TableColumnSwitcher**
|
|
1806
|
-
| **VcPagination**
|
|
1807
|
-
| **TableSearchHeader**
|
|
1947
|
+
| **VcColumn** | Renderless column definition component. Must be a direct child of VcDataTable. |
|
|
1948
|
+
| **TableColumnSwitcher** | Column visibility panel -- built into VcDataTable, no separate usage needed. |
|
|
1949
|
+
| **VcPagination** | Pagination molecule -- used internally when the `pagination` prop is set. Can be used standalone. |
|
|
1950
|
+
| **TableSearchHeader** | Search bar + toolbar -- built into VcDataTable when `searchable` is `true`. |
|
|
1808
1951
|
|
|
1809
1952
|
---
|
|
1810
1953
|
|