@vc-shell/vc-app-skill 2.0.0-alpha.32 → 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 +59 -47
- package/README.md +18 -12
- package/package.json +4 -4
- package/runtime/VERSION +1 -1
- 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 +94 -0
- 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/_BUILD_HASH.md +1 -1
- 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 +75 -19
- 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 +102 -0
- 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 +104 -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 +59 -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 +96 -64
- package/runtime/knowledge/docs/ui/components/molecules/vc-checkbox-group/vc-checkbox-group.docs.md +26 -35
- package/runtime/knowledge/docs/ui/components/molecules/vc-color-input/vc-color-input.docs.md +69 -22
- package/runtime/knowledge/docs/ui/components/molecules/vc-date-picker/vc-date-picker.docs.md +58 -72
- 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 +60 -72
- package/runtime/knowledge/docs/ui/components/molecules/vc-field/vc-field.docs.md +65 -26
- package/runtime/knowledge/docs/ui/components/molecules/vc-file-upload/vc-file-upload.docs.md +46 -49
- 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 +115 -130
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-currency/vc-input-currency.docs.md +53 -87
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.docs.md +56 -63
- 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 +63 -64
- 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 +59 -19
- package/runtime/knowledge/docs/ui/components/molecules/vc-radio-group/vc-radio-group.docs.md +25 -34
- package/runtime/knowledge/docs/ui/components/molecules/vc-rating/vc-rating.docs.md +42 -32
- package/runtime/knowledge/docs/ui/components/molecules/vc-select/vc-select.docs.md +78 -82
- package/runtime/knowledge/docs/ui/components/molecules/vc-slider/vc-slider.docs.md +25 -15
- package/runtime/knowledge/docs/ui/components/molecules/vc-switch/vc-switch.docs.md +59 -63
- package/runtime/knowledge/docs/ui/components/molecules/vc-textarea/vc-textarea.docs.md +57 -69
- 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 +120 -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 +536 -365
- 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 +255 -0
- package/runtime/knowledge/migration-prompts/blade-props-migration.md +194 -0
- 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 +223 -0
- package/runtime/knowledge/migration-prompts/nswag-migration.md +244 -0
- 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 +178 -0
- 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 +354 -49
- package/runtime/knowledge/docs/core/constants/constants.docs.md +0 -185
|
@@ -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,16 +687,51 @@ 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
|
```
|
|
621
694
|
|
|
695
|
+
### Conditional expansion
|
|
696
|
+
|
|
697
|
+
Use `isRowExpandable` to control which rows show the expand toggle. Rows that fail the predicate cannot be expanded:
|
|
698
|
+
|
|
699
|
+
```vue
|
|
700
|
+
<template>
|
|
701
|
+
<VcDataTable
|
|
702
|
+
:items="orders"
|
|
703
|
+
v-model:expanded-rows="expandedRows"
|
|
704
|
+
:is-row-expandable="(order) => order.lineItems.length > 0"
|
|
705
|
+
>
|
|
706
|
+
<VcColumn
|
|
707
|
+
id="expand"
|
|
708
|
+
:expander="true"
|
|
709
|
+
:width="40"
|
|
710
|
+
/>
|
|
711
|
+
<VcColumn
|
|
712
|
+
id="orderNumber"
|
|
713
|
+
field="number"
|
|
714
|
+
title="Order #"
|
|
715
|
+
/>
|
|
716
|
+
|
|
717
|
+
<template #expansion="{ data }">
|
|
718
|
+
<div class="tw-p-4">
|
|
719
|
+
<p
|
|
720
|
+
v-for="item in data.lineItems"
|
|
721
|
+
:key="item.id"
|
|
722
|
+
>
|
|
723
|
+
{{ item.name }}
|
|
724
|
+
</p>
|
|
725
|
+
</div>
|
|
726
|
+
</template>
|
|
727
|
+
</VcDataTable>
|
|
728
|
+
</template>
|
|
729
|
+
|
|
730
|
+
<script setup lang="ts">
|
|
731
|
+
const expandedRows = ref<Order[]>([]);
|
|
732
|
+
</script>
|
|
733
|
+
```
|
|
734
|
+
|
|
622
735
|
---
|
|
623
736
|
|
|
624
737
|
## Row Grouping
|
|
@@ -633,8 +746,17 @@ Group rows by a field value. Each group gets a subheader row.
|
|
|
633
746
|
:expandable-row-groups="true"
|
|
634
747
|
v-model:expanded-row-groups="expandedGroups"
|
|
635
748
|
>
|
|
636
|
-
<VcColumn
|
|
637
|
-
|
|
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
|
+
/>
|
|
638
760
|
|
|
639
761
|
<template #groupheader="{ data }">
|
|
640
762
|
<strong>{{ data.category }}</strong> ({{ getCategoryCount(data.category) }} items)
|
|
@@ -701,13 +823,7 @@ Add the `filter` prop to a VcColumn to render a filter control in its header.
|
|
|
701
823
|
**Date range filter** -- start/end date pickers:
|
|
702
824
|
|
|
703
825
|
```vue
|
|
704
|
-
<VcColumn
|
|
705
|
-
id="createdDate"
|
|
706
|
-
field="createdDate"
|
|
707
|
-
title="Created"
|
|
708
|
-
type="datetime"
|
|
709
|
-
:filter="{ range: ['startDate', 'endDate'] }"
|
|
710
|
-
/>
|
|
826
|
+
<VcColumn id="createdDate" field="createdDate" title="Created" type="datetime" :filter="{ range: ['startDate', 'endDate'] }" />
|
|
711
827
|
```
|
|
712
828
|
|
|
713
829
|
The `range` tuple specifies the two backend field names emitted in the `@filter` event payload.
|
|
@@ -782,11 +898,7 @@ A filter icon button appears in the toolbar. Clicking it opens the global filter
|
|
|
782
898
|
Column filters and global filters work together. The `@filter` event merges all active filter values into a single flat object:
|
|
783
899
|
|
|
784
900
|
```vue
|
|
785
|
-
<VcDataTable
|
|
786
|
-
:items="products"
|
|
787
|
-
:global-filters="globalFilters"
|
|
788
|
-
@filter="handleFilter"
|
|
789
|
-
>
|
|
901
|
+
<VcDataTable :items="products" :global-filters="globalFilters" @filter="handleFilter">
|
|
790
902
|
<VcColumn id="name" field="name" title="Name" :filter="true" />
|
|
791
903
|
<VcColumn id="status" field="status" title="Status" :filter="{ options: statusOptions }" />
|
|
792
904
|
</VcDataTable>
|
|
@@ -804,14 +916,7 @@ function handleFilter(event: { filters: Record<string, unknown> }) {
|
|
|
804
916
|
## Search Bar
|
|
805
917
|
|
|
806
918
|
```vue
|
|
807
|
-
<VcDataTable
|
|
808
|
-
:items="products"
|
|
809
|
-
searchable
|
|
810
|
-
v-model:search-value="searchQuery"
|
|
811
|
-
search-placeholder="Search products..."
|
|
812
|
-
:search-debounce="300"
|
|
813
|
-
@search="onSearch"
|
|
814
|
-
>
|
|
919
|
+
<VcDataTable :items="products" searchable v-model:search-value="searchQuery" search-placeholder="Search products..." :search-debounce="300" @search="onSearch">
|
|
815
920
|
<VcColumn id="name" field="name" title="Name" />
|
|
816
921
|
</VcDataTable>
|
|
817
922
|
```
|
|
@@ -843,8 +948,17 @@ Load more data as the user scrolls down:
|
|
|
843
948
|
scroll-height="500px"
|
|
844
949
|
@load-more="loadNextPage"
|
|
845
950
|
>
|
|
846
|
-
<VcColumn
|
|
847
|
-
|
|
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
|
+
/>
|
|
848
962
|
</VcDataTable>
|
|
849
963
|
</template>
|
|
850
964
|
|
|
@@ -870,10 +984,7 @@ async function loadNextPage() {
|
|
|
870
984
|
Persist column widths, column order, hidden columns, sort, and filters across page reloads:
|
|
871
985
|
|
|
872
986
|
```vue
|
|
873
|
-
<VcDataTable
|
|
874
|
-
:items="products"
|
|
875
|
-
state-key="product-list"
|
|
876
|
-
>
|
|
987
|
+
<VcDataTable :items="products" state-key="product-list">
|
|
877
988
|
<VcColumn id="name" field="name" title="Name" sortable />
|
|
878
989
|
<VcColumn id="price" field="price" title="Price" type="money" sortable />
|
|
879
990
|
</VcDataTable>
|
|
@@ -892,12 +1003,7 @@ Use sessionStorage instead of localStorage:
|
|
|
892
1003
|
Listen to state events:
|
|
893
1004
|
|
|
894
1005
|
```vue
|
|
895
|
-
<VcDataTable
|
|
896
|
-
:items="products"
|
|
897
|
-
state-key="product-list"
|
|
898
|
-
@state-save="onStateSave"
|
|
899
|
-
@state-restore="onStateRestore"
|
|
900
|
-
>
|
|
1006
|
+
<VcDataTable :items="products" state-key="product-list" @state-save="onStateSave" @state-restore="onStateRestore">
|
|
901
1007
|
...
|
|
902
1008
|
</VcDataTable>
|
|
903
1009
|
```
|
|
@@ -915,13 +1021,7 @@ Per-row action buttons that appear on hover or in a dropdown menu.
|
|
|
915
1021
|
Quick action buttons appear on the right side of the row on hover. Extra actions overflow into a dropdown.
|
|
916
1022
|
|
|
917
1023
|
```vue
|
|
918
|
-
<VcDataTable
|
|
919
|
-
:items="products"
|
|
920
|
-
:row-actions="getActions"
|
|
921
|
-
row-actions-mode="inline"
|
|
922
|
-
:max-quick-actions="3"
|
|
923
|
-
@row-action="onAction"
|
|
924
|
-
>
|
|
1024
|
+
<VcDataTable :items="products" :row-actions="getActions" row-actions-mode="inline" :max-quick-actions="3" @row-action="onAction">
|
|
925
1025
|
<VcColumn id="name" field="name" title="Name" />
|
|
926
1026
|
<VcColumn id="price" field="price" title="Price" type="money" />
|
|
927
1027
|
</VcDataTable>
|
|
@@ -947,11 +1047,7 @@ function onAction(event: { action: TableAction; item: Product; index: number })
|
|
|
947
1047
|
All actions in a three-dot dropdown menu:
|
|
948
1048
|
|
|
949
1049
|
```vue
|
|
950
|
-
<VcDataTable
|
|
951
|
-
:items="products"
|
|
952
|
-
:row-actions="getActions"
|
|
953
|
-
row-actions-mode="dropdown"
|
|
954
|
-
>
|
|
1050
|
+
<VcDataTable :items="products" :row-actions="getActions" row-actions-mode="dropdown">
|
|
955
1051
|
...
|
|
956
1052
|
</VcDataTable>
|
|
957
1053
|
```
|
|
@@ -961,11 +1057,7 @@ All actions in a three-dot dropdown menu:
|
|
|
961
1057
|
Render actions in a dedicated column (always visible, not overlay):
|
|
962
1058
|
|
|
963
1059
|
```vue
|
|
964
|
-
<VcDataTable
|
|
965
|
-
:items="products"
|
|
966
|
-
:row-actions="getActions"
|
|
967
|
-
row-actions-position="column"
|
|
968
|
-
>
|
|
1060
|
+
<VcDataTable :items="products" :row-actions="getActions" row-actions-position="column">
|
|
969
1061
|
...
|
|
970
1062
|
</VcDataTable>
|
|
971
1063
|
```
|
|
@@ -1002,22 +1094,17 @@ On mobile screens, VcDataTable automatically switches from a table to a card lay
|
|
|
1002
1094
|
|
|
1003
1095
|
**Mobile roles:**
|
|
1004
1096
|
|
|
1005
|
-
| Role
|
|
1006
|
-
|
|
1007
|
-
| `"title"`
|
|
1008
|
-
| `"image"`
|
|
1009
|
-
| `"field"`
|
|
1010
|
-
| `"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 |
|
|
1011
1103
|
|
|
1012
1104
|
### Pull-to-Refresh (mobile)
|
|
1013
1105
|
|
|
1014
1106
|
```vue
|
|
1015
|
-
<VcDataTable
|
|
1016
|
-
:items="products"
|
|
1017
|
-
:pull-to-refresh="true"
|
|
1018
|
-
:pull-to-refresh-text="{ pull: 'Pull down', release: 'Release to refresh', refreshing: 'Loading...' }"
|
|
1019
|
-
@pull-refresh="reload"
|
|
1020
|
-
>
|
|
1107
|
+
<VcDataTable :items="products" :pull-to-refresh="true" :pull-to-refresh-text="{ pull: 'Pull down', release: 'Release to refresh', refreshing: 'Loading...' }" @pull-refresh="reload">
|
|
1021
1108
|
...
|
|
1022
1109
|
</VcDataTable>
|
|
1023
1110
|
```
|
|
@@ -1095,9 +1182,26 @@ For inline editing mode, enable adding/removing rows directly in the table:
|
|
|
1095
1182
|
@row-remove="onRowRemove"
|
|
1096
1183
|
@edit-save="onBulkSave"
|
|
1097
1184
|
>
|
|
1098
|
-
<VcColumn
|
|
1099
|
-
|
|
1100
|
-
|
|
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
|
+
/>
|
|
1101
1205
|
</VcDataTable>
|
|
1102
1206
|
</template>
|
|
1103
1207
|
|
|
@@ -1119,11 +1223,11 @@ function onRowRemove(event: { data: Product; index: number; cancel: () => void }
|
|
|
1119
1223
|
|
|
1120
1224
|
**Add button positions:**
|
|
1121
1225
|
|
|
1122
|
-
| Position
|
|
1123
|
-
|
|
1124
|
-
| `"header"` | Above the table body
|
|
1125
|
-
| `"footer"` | Below the table body
|
|
1126
|
-
| `"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) |
|
|
1127
1231
|
|
|
1128
1232
|
---
|
|
1129
1233
|
|
|
@@ -1131,47 +1235,47 @@ function onRowRemove(event: { data: Product; index: number; cancel: () => void }
|
|
|
1131
1235
|
|
|
1132
1236
|
### Props
|
|
1133
1237
|
|
|
1134
|
-
| Prop
|
|
1135
|
-
|
|
1136
|
-
| `id`
|
|
1137
|
-
| `field`
|
|
1138
|
-
| `title`
|
|
1139
|
-
| `type`
|
|
1140
|
-
| `currencyField`
|
|
1141
|
-
| `format`
|
|
1142
|
-
| `width`
|
|
1143
|
-
| `minWidth`
|
|
1144
|
-
| `maxWidth`
|
|
1145
|
-
| `align`
|
|
1146
|
-
| `headerAlign`
|
|
1147
|
-
| `sortable`
|
|
1148
|
-
| `sortField`
|
|
1149
|
-
| `filter`
|
|
1150
|
-
| `filterField`
|
|
1151
|
-
| `filterPlaceholder` | `string`
|
|
1152
|
-
| `visible`
|
|
1153
|
-
| `alwaysVisible`
|
|
1154
|
-
| `editable`
|
|
1155
|
-
| `rules`
|
|
1156
|
-
| `class`
|
|
1157
|
-
| `headerClass`
|
|
1158
|
-
| `bodyClass`
|
|
1159
|
-
| `lineClamp`
|
|
1160
|
-
| `selectionMode`
|
|
1161
|
-
| `rowEditor`
|
|
1162
|
-
| `rowReorder`
|
|
1163
|
-
| `expander`
|
|
1164
|
-
| `mobileRole`
|
|
1165
|
-
| `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). |
|
|
1166
1270
|
|
|
1167
1271
|
### Slots
|
|
1168
1272
|
|
|
1169
|
-
| Slot
|
|
1170
|
-
|
|
1171
|
-
| `#body`
|
|
1172
|
-
| `#editor` | `{ data: T, field: string, index: number, editorCallback: Function }`
|
|
1173
|
-
| `#header` | `{ column: VcColumnProps }`
|
|
1174
|
-
| `#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. |
|
|
1175
1279
|
|
|
1176
1280
|
---
|
|
1177
1281
|
|
|
@@ -1179,145 +1283,146 @@ function onRowRemove(event: { data: Product; index: number; cancel: () => void }
|
|
|
1179
1283
|
|
|
1180
1284
|
### Data
|
|
1181
1285
|
|
|
1182
|
-
| Prop
|
|
1183
|
-
|
|
1184
|
-
| `items`
|
|
1185
|
-
| `dataKey`
|
|
1186
|
-
| `loading`
|
|
1187
|
-
| `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. |
|
|
1188
1292
|
|
|
1189
1293
|
### Selection
|
|
1190
1294
|
|
|
1191
|
-
| Prop
|
|
1192
|
-
|
|
1193
|
-
| `selection`
|
|
1194
|
-
| `selectionMode`
|
|
1195
|
-
| `isRowSelectable`
|
|
1196
|
-
| `compareSelectionBy` | `"equals" \| "field"`
|
|
1197
|
-
| `selectAll`
|
|
1198
|
-
| `selectAllActive`
|
|
1199
|
-
| `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`. |
|
|
1200
1304
|
|
|
1201
1305
|
### Sorting
|
|
1202
1306
|
|
|
1203
|
-
| Prop
|
|
1204
|
-
|
|
1205
|
-
| `sortField`
|
|
1206
|
-
| `sortOrder`
|
|
1207
|
-
| `sortMode`
|
|
1208
|
-
| `multiSortMeta` | `SortMeta[]`
|
|
1209
|
-
| `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). |
|
|
1210
1314
|
|
|
1211
1315
|
### Editing
|
|
1212
1316
|
|
|
1213
|
-
| Prop
|
|
1214
|
-
|
|
1215
|
-
| `editMode`
|
|
1216
|
-
| `editingRows`
|
|
1217
|
-
| `addRow`
|
|
1218
|
-
| `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. |
|
|
1219
1323
|
|
|
1220
1324
|
### Visual
|
|
1221
1325
|
|
|
1222
|
-
| Prop
|
|
1223
|
-
|
|
1224
|
-
| `striped`
|
|
1225
|
-
| `bordered`
|
|
1226
|
-
| `showGridlines` | `boolean`
|
|
1227
|
-
| `rowHover`
|
|
1228
|
-
| `size`
|
|
1229
|
-
| `variant`
|
|
1230
|
-
| `rowClass`
|
|
1231
|
-
| `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. |
|
|
1232
1336
|
|
|
1233
1337
|
### Column Management
|
|
1234
1338
|
|
|
1235
|
-
| Prop
|
|
1236
|
-
|
|
1237
|
-
| `resizableColumns`
|
|
1238
|
-
| `reorderableColumns` | `boolean`
|
|
1239
|
-
| `showAllColumns`
|
|
1240
|
-
| `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. |
|
|
1241
1345
|
|
|
1242
1346
|
### Scrolling
|
|
1243
1347
|
|
|
1244
|
-
| Prop
|
|
1245
|
-
|
|
1246
|
-
| `scrollable`
|
|
1247
|
-
| `scrollHeight`
|
|
1248
|
-
| `infiniteScroll`
|
|
1249
|
-
| `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`. |
|
|
1250
1354
|
|
|
1251
1355
|
### Row Actions
|
|
1252
1356
|
|
|
1253
|
-
| Prop
|
|
1254
|
-
|
|
1255
|
-
| `rowActions`
|
|
1256
|
-
| `rowActionsMode`
|
|
1257
|
-
| `rowActionsPosition` | `"overlay" \| "column"`
|
|
1258
|
-
| `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. |
|
|
1259
1363
|
|
|
1260
1364
|
### Expandable Rows
|
|
1261
1365
|
|
|
1262
|
-
| Prop
|
|
1263
|
-
|
|
1264
|
-
| `expandedRows`
|
|
1265
|
-
| `expandedRowIcon`
|
|
1266
|
-
| `collapsedRowIcon` | `string`
|
|
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. |
|
|
1267
1372
|
|
|
1268
1373
|
### Row Grouping
|
|
1269
1374
|
|
|
1270
|
-
| Prop
|
|
1271
|
-
|
|
1272
|
-
| `groupRowsBy`
|
|
1273
|
-
| `rowGroupMode`
|
|
1274
|
-
| `expandableRowGroups` | `boolean`
|
|
1275
|
-
| `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`. |
|
|
1276
1381
|
|
|
1277
1382
|
### Pagination
|
|
1278
1383
|
|
|
1279
|
-
| Prop
|
|
1280
|
-
|
|
1281
|
-
| `pagination` | `DataTablePagination` | --
|
|
1282
|
-
| `totalCount` | `number`
|
|
1283
|
-
| `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. |
|
|
1284
1389
|
|
|
1285
1390
|
### Search
|
|
1286
1391
|
|
|
1287
|
-
| Prop
|
|
1288
|
-
|
|
1289
|
-
| `searchable`
|
|
1290
|
-
| `searchValue`
|
|
1291
|
-
| `searchPlaceholder` | `string`
|
|
1292
|
-
| `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. |
|
|
1293
1398
|
|
|
1294
1399
|
### Filters
|
|
1295
1400
|
|
|
1296
|
-
| Prop
|
|
1297
|
-
|
|
1298
|
-
| `globalFilters` | `GlobalFilterConfig[]` | --
|
|
1401
|
+
| Prop | Type | Default | Description |
|
|
1402
|
+
| --------------- | ---------------------- | ------- | ---------------------------------- |
|
|
1403
|
+
| `globalFilters` | `GlobalFilterConfig[]` | -- | Global filter panel configuration. |
|
|
1299
1404
|
|
|
1300
1405
|
### State Persistence
|
|
1301
1406
|
|
|
1302
|
-
| Prop
|
|
1303
|
-
|
|
1304
|
-
| `stateKey`
|
|
1305
|
-
| `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. |
|
|
1306
1411
|
|
|
1307
1412
|
### Empty States
|
|
1308
1413
|
|
|
1309
|
-
| Prop
|
|
1310
|
-
|
|
1311
|
-
| `emptyState`
|
|
1312
|
-
| `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. |
|
|
1313
1418
|
|
|
1314
1419
|
### Mobile
|
|
1315
1420
|
|
|
1316
|
-
| Prop
|
|
1317
|
-
|
|
1318
|
-
| `pullToRefresh`
|
|
1319
|
-
| `pullToRefreshText` | `PullToRefreshTextConfig` | --
|
|
1320
|
-
| `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. |
|
|
1321
1426
|
|
|
1322
1427
|
---
|
|
1323
1428
|
|
|
@@ -1325,113 +1430,113 @@ function onRowRemove(event: { data: Product; index: number; cancel: () => void }
|
|
|
1325
1430
|
|
|
1326
1431
|
### Selection Events
|
|
1327
1432
|
|
|
1328
|
-
| Event
|
|
1329
|
-
|
|
1330
|
-
| `update:selection`
|
|
1331
|
-
| `update:selectAll`
|
|
1332
|
-
| `update:selectAllActive` | `boolean`
|
|
1333
|
-
| `row-select`
|
|
1334
|
-
| `row-unselect`
|
|
1335
|
-
| `row-select-all`
|
|
1336
|
-
| `row-unselect-all`
|
|
1337
|
-
| `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). |
|
|
1338
1443
|
|
|
1339
1444
|
### Editing Events
|
|
1340
1445
|
|
|
1341
|
-
| Event
|
|
1342
|
-
|
|
1343
|
-
| `update:editingRows` | `T[]`
|
|
1344
|
-
| `cell-edit-init`
|
|
1345
|
-
| `cell-edit-complete` | `{ data: T, field: string, newValue: unknown, index: number }` | Cell edit committed.
|
|
1346
|
-
| `cell-edit-cancel`
|
|
1347
|
-
| `row-edit-init`
|
|
1348
|
-
| `row-edit-save`
|
|
1349
|
-
| `row-edit-cancel`
|
|
1350
|
-
| `edit-save`
|
|
1351
|
-
| `edit-cancel`
|
|
1352
|
-
| `row-add`
|
|
1353
|
-
| `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. |
|
|
1354
1459
|
|
|
1355
1460
|
### Sorting Events
|
|
1356
1461
|
|
|
1357
|
-
| Event
|
|
1358
|
-
|
|
1359
|
-
| `update:sortField`
|
|
1360
|
-
| `update:sortOrder`
|
|
1361
|
-
| `update:multiSortMeta` | `SortMeta[]`
|
|
1362
|
-
| `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. |
|
|
1363
1468
|
|
|
1364
1469
|
### Filtering Events
|
|
1365
1470
|
|
|
1366
|
-
| Event
|
|
1367
|
-
|
|
1471
|
+
| Event | Payload | Description |
|
|
1472
|
+
| -------- | ---------------------------------------------------------- | ------------------------- |
|
|
1368
1473
|
| `filter` | `{ filters: Record<string, unknown>, filteredValue: T[] }` | Any filter value changed. |
|
|
1369
1474
|
|
|
1370
1475
|
### Row Interaction Events
|
|
1371
1476
|
|
|
1372
|
-
| Event
|
|
1373
|
-
|
|
1374
|
-
| `row-click`
|
|
1375
|
-
| `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. |
|
|
1376
1481
|
|
|
1377
1482
|
### Reorder Events
|
|
1378
1483
|
|
|
1379
|
-
| Event
|
|
1380
|
-
|
|
1381
|
-
| `row-reorder`
|
|
1382
|
-
| `column-resize-end` | `{ columns: { id, width }[] }`
|
|
1383
|
-
| `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. |
|
|
1384
1489
|
|
|
1385
1490
|
### Expansion Events
|
|
1386
1491
|
|
|
1387
|
-
| Event
|
|
1388
|
-
|
|
1389
|
-
| `update:expandedRows`
|
|
1390
|
-
| `row-expand`
|
|
1391
|
-
| `row-collapse`
|
|
1392
|
-
| `update:expandedRowGroups` | `string[]`
|
|
1393
|
-
| `rowgroup-expand`
|
|
1394
|
-
| `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. |
|
|
1395
1500
|
|
|
1396
1501
|
### Other Events
|
|
1397
1502
|
|
|
1398
|
-
| Event
|
|
1399
|
-
|
|
1400
|
-
| `pagination-click`
|
|
1401
|
-
| `update:searchValue`
|
|
1402
|
-
| `search`
|
|
1403
|
-
| `load-more`
|
|
1404
|
-
| `pull-refresh`
|
|
1405
|
-
| `state-save`
|
|
1406
|
-
| `state-restore`
|
|
1407
|
-
| `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. |
|
|
1408
1513
|
|
|
1409
1514
|
---
|
|
1410
1515
|
|
|
1411
1516
|
## VcDataTable Slots Reference
|
|
1412
1517
|
|
|
1413
|
-
| Slot
|
|
1414
|
-
|
|
1415
|
-
| `default`
|
|
1416
|
-
| `header`
|
|
1417
|
-
| `footer`
|
|
1418
|
-
| `search-header-actions` | --
|
|
1419
|
-
| `selection-banner`
|
|
1420
|
-
| `expansion`
|
|
1421
|
-
| `empty`
|
|
1422
|
-
| `not-found`
|
|
1423
|
-
| `loading`
|
|
1424
|
-
| `groupheader`
|
|
1425
|
-
| `groupfooter`
|
|
1426
|
-
| `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. |
|
|
1427
1532
|
|
|
1428
1533
|
---
|
|
1429
1534
|
|
|
1430
1535
|
## Recipes
|
|
1431
1536
|
|
|
1432
|
-
### Recipe 1:
|
|
1537
|
+
### Recipe 1: Entity List Blade
|
|
1433
1538
|
|
|
1434
|
-
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.
|
|
1435
1540
|
|
|
1436
1541
|
```vue
|
|
1437
1542
|
<template>
|
|
@@ -1469,7 +1574,9 @@ A typical list blade with search, pagination, row actions, and empty states -- m
|
|
|
1469
1574
|
icon: 'lucide-search-x',
|
|
1470
1575
|
title: $t('PRODUCTS.LIST.NOT_FOUND'),
|
|
1471
1576
|
actionLabel: $t('PRODUCTS.LIST.CLEAR_SEARCH'),
|
|
1472
|
-
actionHandler: () => {
|
|
1577
|
+
actionHandler: () => {
|
|
1578
|
+
searchValue = '';
|
|
1579
|
+
},
|
|
1473
1580
|
}"
|
|
1474
1581
|
@search="onSearch"
|
|
1475
1582
|
@row-click="onRowClick"
|
|
@@ -1569,10 +1676,34 @@ Handle sorting and paging entirely on the backend:
|
|
|
1569
1676
|
@sort="onSort"
|
|
1570
1677
|
@pagination-click="onPage"
|
|
1571
1678
|
>
|
|
1572
|
-
<VcColumn
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
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
|
+
/>
|
|
1576
1707
|
</VcDataTable>
|
|
1577
1708
|
</template>
|
|
1578
1709
|
|
|
@@ -1583,7 +1714,11 @@ const page = ref(1);
|
|
|
1583
1714
|
|
|
1584
1715
|
async function fetchOrders() {
|
|
1585
1716
|
loading.value = true;
|
|
1586
|
-
const {
|
|
1717
|
+
const {
|
|
1718
|
+
items,
|
|
1719
|
+
totalCount: total,
|
|
1720
|
+
pages,
|
|
1721
|
+
} = await api.searchOrders({
|
|
1587
1722
|
sort: sortOrder.value !== 0 ? `${sortField.value}:${sortOrder.value === 1 ? "ASC" : "DESC"}` : undefined,
|
|
1588
1723
|
skip: (page.value - 1) * 20,
|
|
1589
1724
|
take: 20,
|
|
@@ -1594,8 +1729,14 @@ async function fetchOrders() {
|
|
|
1594
1729
|
loading.value = false;
|
|
1595
1730
|
}
|
|
1596
1731
|
|
|
1597
|
-
function onSort() {
|
|
1598
|
-
|
|
1732
|
+
function onSort() {
|
|
1733
|
+
page.value = 1;
|
|
1734
|
+
fetchOrders();
|
|
1735
|
+
}
|
|
1736
|
+
function onPage(p: number) {
|
|
1737
|
+
page.value = p;
|
|
1738
|
+
fetchOrders();
|
|
1739
|
+
}
|
|
1599
1740
|
</script>
|
|
1600
1741
|
```
|
|
1601
1742
|
|
|
@@ -1612,11 +1753,42 @@ function onPage(p: number) { page.value = p; fetchOrders(); }
|
|
|
1612
1753
|
@row-add="onRowAdd"
|
|
1613
1754
|
@row-remove="onRowRemove"
|
|
1614
1755
|
>
|
|
1615
|
-
<VcColumn
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
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
|
+
/>
|
|
1620
1792
|
</VcDataTable>
|
|
1621
1793
|
</template>
|
|
1622
1794
|
|
|
@@ -1625,8 +1797,7 @@ const rules = {
|
|
|
1625
1797
|
sku: (v: unknown) => (v ? true : "SKU is required"),
|
|
1626
1798
|
name: (v: unknown) => (v ? true : "Name is required"),
|
|
1627
1799
|
listPrice: (v: unknown) => (Number(v) > 0 ? true : "Must be greater than 0"),
|
|
1628
|
-
salePrice: (v: unknown, row: any) =>
|
|
1629
|
-
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"),
|
|
1630
1801
|
};
|
|
1631
1802
|
|
|
1632
1803
|
function onSave(event: { changes: EditChange[] }) {
|
|
@@ -1770,13 +1941,13 @@ const isSelectable = (item) => item.stock > 0;
|
|
|
1770
1941
|
|
|
1771
1942
|
## Related Components
|
|
1772
1943
|
|
|
1773
|
-
| Component
|
|
1774
|
-
|
|
1944
|
+
| Component | Description |
|
|
1945
|
+
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
1775
1946
|
| **VcTableAdapter** (`VcTable`) | Legacy API wrapper around VcDataTable. Exported as `VcTable` for backward compatibility. Use VcDataTable directly for new code. |
|
|
1776
|
-
| **VcColumn**
|
|
1777
|
-
| **TableColumnSwitcher**
|
|
1778
|
-
| **VcPagination**
|
|
1779
|
-
| **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`. |
|
|
1780
1951
|
|
|
1781
1952
|
---
|
|
1782
1953
|
|