@vc-shell/vc-app-skill 2.1.0 → 2.2.0-pr260.a8bd3a7

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.
Files changed (141) hide show
  1. package/package.json +1 -1
  2. package/runtime/VERSION +1 -1
  3. package/runtime/agents/migration-agent.md +4 -2
  4. package/runtime/knowledge/docs/_BUILD_HASH.md +1 -1
  5. package/runtime/knowledge/docs/core/api/platform.docs.md +20 -18
  6. package/runtime/knowledge/docs/core/blade-navigation/blade-nav-composables.docs.md +43 -34
  7. package/runtime/knowledge/docs/core/composables/useAppBarMobileButtons/useAppBarMobileButtons.docs.md +5 -3
  8. package/runtime/knowledge/docs/core/composables/useAppBarWidget/useAppBarWidget.docs.md +12 -10
  9. package/runtime/knowledge/docs/core/composables/useAppInsights/useAppInsights.docs.md +7 -5
  10. package/runtime/knowledge/docs/core/composables/useAssets/useAssets.docs.md +8 -6
  11. package/runtime/knowledge/docs/core/composables/useAssetsManager/useAssetsManager.docs.md +3 -1
  12. package/runtime/knowledge/docs/core/composables/useAsync/useAsync.docs.md +1 -1
  13. package/runtime/knowledge/docs/core/composables/useBladeRegistry/useBladeRegistry.docs.md +8 -5
  14. package/runtime/knowledge/docs/core/composables/useBladeWidgets/index.docs.md +12 -12
  15. package/runtime/knowledge/docs/core/composables/useBreadcrumbs/useBreadcrumbs.docs.md +3 -3
  16. package/runtime/knowledge/docs/core/composables/useConnectionStatus/useConnectionStatus.docs.md +4 -3
  17. package/runtime/knowledge/docs/core/composables/useDynamicProperties/useDynamicProperties.docs.md +1 -0
  18. package/runtime/knowledge/docs/core/composables/useFunctions/useFunctions.docs.md +3 -3
  19. package/runtime/knowledge/docs/core/composables/useKeyboardNavigation/useKeyboardNavigation.docs.md +5 -4
  20. package/runtime/knowledge/docs/core/composables/useLanguages/useLanguages.docs.md +3 -3
  21. package/runtime/knowledge/docs/core/composables/useLoading/useLoading.docs.md +2 -0
  22. package/runtime/knowledge/docs/core/composables/useModificationTracker/useModificationTracker.docs.md +1 -2
  23. package/runtime/knowledge/docs/core/composables/useNotifications/useNotifications.docs.md +1 -1
  24. package/runtime/knowledge/docs/core/composables/usePermissions/usePermissions.docs.md +3 -3
  25. package/runtime/knowledge/docs/core/composables/usePlatformLocaleSync/usePlatformLocaleSync.docs.md +1 -0
  26. package/runtime/knowledge/docs/core/composables/usePopup/usePopup.docs.md +1 -1
  27. package/runtime/knowledge/docs/core/composables/useResponsive/useResponsive.docs.md +2 -2
  28. package/runtime/knowledge/docs/core/composables/useSettings/useSettings.docs.md +2 -1
  29. package/runtime/knowledge/docs/core/composables/useSettingsMenu/useSettingsMenu.docs.md +18 -18
  30. package/runtime/knowledge/docs/core/composables/useSidebarState/useSidebarState.docs.md +3 -3
  31. package/runtime/knowledge/docs/core/composables/useSlowNetworkDetection/useSlowNetworkDetection.docs.md +10 -7
  32. package/runtime/knowledge/docs/core/composables/useTheme/useTheme.docs.md +7 -7
  33. package/runtime/knowledge/docs/core/composables/useToolbar/useToolbar.docs.md +18 -12
  34. package/runtime/knowledge/docs/core/composables/useUser/useUser.docs.md +2 -2
  35. package/runtime/knowledge/docs/core/composables/useUserManagement/useUserManagement.docs.md +20 -20
  36. package/runtime/knowledge/docs/core/composables/useWidgets/useWidgets.docs.md +15 -24
  37. package/runtime/knowledge/docs/core/directives/loading/loading.docs.md +2 -2
  38. package/runtime/knowledge/docs/core/notifications/composables/useBladeNotifications.docs.md +1 -2
  39. package/runtime/knowledge/docs/core/notifications/composables/useBroadcastFilter.docs.md +3 -3
  40. package/runtime/knowledge/docs/core/notifications/composables/useNotificationStore.docs.md +19 -18
  41. package/runtime/knowledge/docs/core/notifications/notifications.docs.md +50 -30
  42. package/runtime/knowledge/docs/core/plugins/ai-agent/ai-agent.docs.md +30 -11
  43. package/runtime/knowledge/docs/core/plugins/extension-points/extension-points.docs.md +1 -1
  44. package/runtime/knowledge/docs/core/plugins/global-error-handler/global-error-handler.docs.md +2 -3
  45. package/runtime/knowledge/docs/core/plugins/modularity/modularity.docs.md +26 -26
  46. package/runtime/knowledge/docs/core/plugins/permissions/permissions.docs.md +2 -3
  47. package/runtime/knowledge/docs/core/plugins/signalR/signalR.docs.md +11 -50
  48. package/runtime/knowledge/docs/core/plugins/validation/validation.docs.md +9 -6
  49. package/runtime/knowledge/docs/core/services/services.docs.md +15 -13
  50. package/runtime/knowledge/docs/core/types/types.docs.md +37 -40
  51. package/runtime/knowledge/docs/core/utilities/date/date-utilities.docs.md +1 -2
  52. package/runtime/knowledge/docs/core/utilities/shared-utilities.docs.md +21 -30
  53. package/runtime/knowledge/docs/core/utilities/thumbnail/thumbnail.docs.md +2 -2
  54. package/runtime/knowledge/docs/core/utilities/utilities.docs.md +9 -8
  55. package/runtime/knowledge/docs/injection-keys.docs.md +6 -11
  56. package/runtime/knowledge/docs/modules/assets/assets-details.docs.md +7 -7
  57. package/runtime/knowledge/docs/modules/assets-manager/assets-manager.docs.md +1 -1
  58. package/runtime/knowledge/docs/shell/_internal/popup/common/popup-common.docs.md +20 -12
  59. package/runtime/knowledge/docs/shell/auth/ChangePasswordPage/change-password-page.docs.md +10 -10
  60. package/runtime/knowledge/docs/shell/auth/ForgotPasswordPage/forgot-password-page.docs.md +6 -6
  61. package/runtime/knowledge/docs/shell/auth/InvitePage/invite-page.docs.md +4 -4
  62. package/runtime/knowledge/docs/shell/auth/LoginPage/login-page.docs.md +16 -14
  63. package/runtime/knowledge/docs/shell/auth/ResetPasswordPage/reset-password-page.docs.md +1 -1
  64. package/runtime/knowledge/docs/shell/auth/sign-in/sign-in.docs.md +12 -11
  65. package/runtime/knowledge/docs/shell/components/change-password/change-password.docs.md +10 -3
  66. package/runtime/knowledge/docs/shell/components/change-password-button/change-password-button.docs.md +3 -3
  67. package/runtime/knowledge/docs/shell/components/error-interceptor/error-interceptor.docs.md +9 -2
  68. package/runtime/knowledge/docs/shell/components/language-selector/language-selector.docs.md +4 -2
  69. package/runtime/knowledge/docs/shell/components/logout-button/logout-button.docs.md +1 -1
  70. package/runtime/knowledge/docs/shell/components/notification-dropdown/notification-dropdown.docs.md +35 -31
  71. package/runtime/knowledge/docs/shell/components/notification-template/notification-template.docs.md +17 -11
  72. package/runtime/knowledge/docs/shell/components/settings-menu/settings-menu.docs.md +8 -7
  73. package/runtime/knowledge/docs/shell/components/settings-menu-item/settings-menu-item.docs.md +23 -21
  74. package/runtime/knowledge/docs/shell/components/sidebar/sidebar.docs.md +5 -3
  75. package/runtime/knowledge/docs/shell/components/theme-selector/theme-selector.docs.md +7 -7
  76. package/runtime/knowledge/docs/shell/components/user-dropdown-button/user-dropdown-button.docs.md +11 -11
  77. package/runtime/knowledge/docs/shell/dashboard/dashboard-charts/dashboard-charts.docs.md +28 -16
  78. package/runtime/knowledge/docs/shell/dashboard/dashboard-widget-card/dashboard-widget-card.docs.md +17 -19
  79. package/runtime/knowledge/docs/shell/dashboard/draggable-dashboard/draggable-dashboard.docs.md +21 -0
  80. package/runtime/knowledge/docs/ui/components/atoms/vc-badge/vc-badge.docs.md +2 -1
  81. package/runtime/knowledge/docs/ui/components/atoms/vc-banner/vc-banner.docs.md +2 -2
  82. package/runtime/knowledge/docs/ui/components/atoms/vc-button/vc-button.docs.md +15 -14
  83. package/runtime/knowledge/docs/ui/components/atoms/vc-container/vc-container.docs.md +9 -6
  84. package/runtime/knowledge/docs/ui/components/atoms/vc-environment-banner/vc-environment-banner.docs.md +42 -0
  85. package/runtime/knowledge/docs/ui/components/atoms/vc-hint/vc-hint.docs.md +1 -1
  86. package/runtime/knowledge/docs/ui/components/atoms/vc-icon/vc-icon.docs.md +10 -9
  87. package/runtime/knowledge/docs/ui/components/atoms/vc-image/vc-image.docs.md +19 -4
  88. package/runtime/knowledge/docs/ui/components/atoms/vc-label/vc-label.docs.md +2 -2
  89. package/runtime/knowledge/docs/ui/components/atoms/vc-link/vc-link.docs.md +5 -4
  90. package/runtime/knowledge/docs/ui/components/atoms/vc-loading/vc-loading.docs.md +5 -4
  91. package/runtime/knowledge/docs/ui/components/atoms/vc-progress/vc-progress.docs.md +9 -8
  92. package/runtime/knowledge/docs/ui/components/atoms/vc-scrollable-container/vc-scrollable-container.docs.md +7 -0
  93. package/runtime/knowledge/docs/ui/components/atoms/vc-skeleton/vc-skeleton.docs.md +1 -1
  94. package/runtime/knowledge/docs/ui/components/atoms/vc-status/vc-status.docs.md +2 -2
  95. package/runtime/knowledge/docs/ui/components/atoms/vc-status-icon/vc-status-icon.docs.md +1 -1
  96. package/runtime/knowledge/docs/ui/components/atoms/vc-tooltip/vc-tooltip.docs.md +11 -10
  97. package/runtime/knowledge/docs/ui/components/atoms/vc-video/vc-video.docs.md +28 -8
  98. package/runtime/knowledge/docs/ui/components/atoms/vc-widget/vc-widget.docs.md +22 -19
  99. package/runtime/knowledge/docs/ui/components/molecules/multilanguage-selector/multilanguage-selector.docs.md +8 -8
  100. package/runtime/knowledge/docs/ui/components/molecules/vc-accordion/vc-accordion.docs.md +16 -6
  101. package/runtime/knowledge/docs/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.docs.md +9 -8
  102. package/runtime/knowledge/docs/ui/components/molecules/vc-checkbox/vc-checkbox.docs.md +42 -34
  103. package/runtime/knowledge/docs/ui/components/molecules/vc-checkbox-group/vc-checkbox-group.docs.md +1 -1
  104. package/runtime/knowledge/docs/ui/components/molecules/vc-color-input/vc-color-input.docs.md +14 -1
  105. package/runtime/knowledge/docs/ui/components/molecules/vc-date-picker/vc-date-picker.docs.md +3 -1
  106. package/runtime/knowledge/docs/ui/components/molecules/vc-dropdown/vc-dropdown.docs.md +34 -33
  107. package/runtime/knowledge/docs/ui/components/molecules/vc-editor/vc-editor.docs.md +26 -24
  108. package/runtime/knowledge/docs/ui/components/molecules/vc-field/vc-field.docs.md +12 -14
  109. package/runtime/knowledge/docs/ui/components/molecules/vc-file-upload/vc-file-upload.docs.md +30 -30
  110. package/runtime/knowledge/docs/ui/components/molecules/vc-input/vc-input.docs.md +2 -2
  111. package/runtime/knowledge/docs/ui/components/molecules/vc-input-currency/vc-input-currency.docs.md +1 -1
  112. package/runtime/knowledge/docs/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.docs.md +34 -31
  113. package/runtime/knowledge/docs/ui/components/molecules/vc-input-group/vc-input-group.docs.md +14 -12
  114. package/runtime/knowledge/docs/ui/components/molecules/vc-menu/vc-menu.docs.md +1 -1
  115. package/runtime/knowledge/docs/ui/components/molecules/vc-multivalue/vc-multivalue.docs.md +36 -27
  116. package/runtime/knowledge/docs/ui/components/molecules/vc-pagination/vc-pagination.docs.md +5 -1
  117. package/runtime/knowledge/docs/ui/components/molecules/{vc-dropdown-panel/vc-dropdown-panel.docs.md → vc-popover/vc-popover.docs.md} +24 -27
  118. package/runtime/knowledge/docs/ui/components/molecules/vc-radio-button/vc-radio-button.docs.md +10 -9
  119. package/runtime/knowledge/docs/ui/components/molecules/vc-select/vc-select.docs.md +44 -19
  120. package/runtime/knowledge/docs/ui/components/molecules/vc-slider/vc-slider.docs.md +11 -11
  121. package/runtime/knowledge/docs/ui/components/molecules/vc-switch/vc-switch.docs.md +15 -14
  122. package/runtime/knowledge/docs/ui/components/molecules/vc-textarea/vc-textarea.docs.md +15 -15
  123. package/runtime/knowledge/docs/ui/components/molecules/vc-toast/vc-toast.docs.md +15 -13
  124. package/runtime/knowledge/docs/ui/components/organisms/vc-app/vc-app.docs.md +5 -1
  125. package/runtime/knowledge/docs/ui/components/organisms/vc-auth-layout/vc-auth-layout.docs.md +18 -0
  126. package/runtime/knowledge/docs/ui/components/organisms/vc-blade/vc-blade.docs.md +48 -78
  127. package/runtime/knowledge/docs/ui/components/organisms/vc-data-table/composables/table-composables.docs.md +9 -11
  128. package/runtime/knowledge/docs/ui/components/organisms/vc-data-table/vc-data-table.docs.md +71 -43
  129. package/runtime/knowledge/docs/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.docs.md +27 -20
  130. package/runtime/knowledge/docs/ui/components/organisms/vc-gallery/vc-gallery.docs.md +2 -2
  131. package/runtime/knowledge/docs/ui/components/organisms/vc-image-upload/vc-image-upload.docs.md +12 -12
  132. package/runtime/knowledge/docs/ui/components/organisms/vc-popup/vc-popup.docs.md +33 -24
  133. package/runtime/knowledge/docs/ui/components/organisms/vc-scheduler/vc-scheduler.docs.md +509 -0
  134. package/runtime/knowledge/docs/ui/components/organisms/vc-sidebar/vc-sidebar.docs.md +43 -26
  135. package/runtime/knowledge/docs/ui/composables/ui-composables.docs.md +15 -9
  136. package/runtime/knowledge/docs/ui/composables/useDataTableSort.docs.md +8 -6
  137. package/runtime/knowledge/docs/ui/composables/useTableSearch.docs.md +3 -3
  138. package/runtime/knowledge/docs/ui/composables/useTableSelection.docs.md +4 -4
  139. package/runtime/knowledge/docs/ui/composables/useTableSort.docs.md +2 -3
  140. package/runtime/knowledge/migration-prompts/table-url-state-migration.md +221 -0
  141. package/runtime/vc-app.md +1 -0
@@ -50,25 +50,33 @@ const open = ref(false);
50
50
 
51
51
  ## Props
52
52
 
53
- | Prop | Type | Default | Description |
54
- | ---------------- | -------------------------------------- | ----------- | --------------------------------------------------- |
55
- | `modelValue` | `boolean` | _required_ | Open/close state (v-model). |
56
- | `position` | `"left" \| "right" \| "bottom"` | `"right"` | Slide-in direction. |
57
- | `size` | `"sm" \| "md" \| "lg" \| "full"` | `"sm"` | Panel size preset (300/380/520px or full viewport). |
58
- | `variant` | `"default" \| "elevated" \| "minimal"` | `"default"` | Visual style. |
59
- | `width` | `number \| string` | -- | Custom width override (left/right positions). |
60
- | `height` | `number \| string` | -- | Custom height override (bottom position). |
61
- | `title` | `string` | `""` | Header title text. |
62
- | `subtitle` | `string` | `""` | Header subtitle text. |
63
- | `showOverlay` | `boolean` | `true` | Show backdrop overlay. |
64
- | `closeOnOverlay` | `boolean` | `true` | Close when clicking overlay. |
65
- | `closeOnEscape` | `boolean` | `true` | Close on Escape key. |
66
- | `closeButton` | `boolean` | `true` | Show close button in header. |
67
- | `trapFocus` | `boolean` | `true` | Trap keyboard focus inside panel. |
68
- | `lockScroll` | `boolean` | `true` | Prevent body scroll while open. |
69
- | `inset` | `boolean` | `true` | Add rounded inset gap from viewport edges. |
70
- | `draggable` | `boolean` | `false` | Enable swipe-to-dismiss (bottom only). |
71
- | `dragHandle` | `boolean` | `false` | Show iOS-style drag handle bar. |
53
+ | Prop | Type | Default | Description |
54
+ | ---------------- | -------------------------------------- | ----------------- | ------------------------------------------------------------------------------------------- |
55
+ | `modelValue` | `boolean` | _required_ | Open/close state (v-model). |
56
+ | `position` | `"left" \| "right" \| "bottom"` | `"right"` | Slide-in direction. |
57
+ | `size` | `"sm" \| "md" \| "lg" \| "full"` | `"sm"` | Panel size preset. Width (left/right) 300/380/520px/100vw; height (bottom) 40/56/72/100dvh. |
58
+ | `variant` | `"default" \| "elevated" \| "minimal"` | `"default"` | Visual style. |
59
+ | `width` | `number \| string` | -- | Custom width override (left/right positions). |
60
+ | `height` | `number \| string` | -- | Custom height override (bottom position). |
61
+ | `title` | `string` | `""` | Header title text. |
62
+ | `subtitle` | `string` | `""` | Header subtitle text. |
63
+ | `showOverlay` | `boolean` | `true` | Show backdrop overlay. |
64
+ | `closeOnOverlay` | `boolean` | `true` | Close when clicking overlay. |
65
+ | `closeOnEscape` | `boolean` | `true` | Close on Escape key. |
66
+ | `closeButton` | `boolean` | `true` | Show close button in header. |
67
+ | `trapFocus` | `boolean` | `true` | Trap keyboard focus inside panel. |
68
+ | `lockScroll` | `boolean` | `true` | Prevent body scroll while open. |
69
+ | `inset` | `boolean` | `true` | Add rounded inset gap from viewport edges. |
70
+ | `returnFocus` | `boolean` | `true` | Restore focus to the trigger element on close. |
71
+ | `autoFocus` | `boolean` | `true` | Focus the first focusable element on open. |
72
+ | `teleport` | `boolean` | `true` | Teleport the panel to a target (disabled toggles it off). |
73
+ | `teleportTo` | `string \| HTMLElement` | -- | Teleport target selector or element. |
74
+ | `ariaLabel` | `string` | `""` | Accessible label for the dialog. |
75
+ | `closeAriaLabel` | `string` | `"Close sidebar"` | Accessible label for the close button. |
76
+ | `zIndex` | `number` | `9200` | Stacking order of the sidebar container. |
77
+ | `closeThreshold` | `number` | `0.3` | Swipe fraction of panel height needed to dismiss (bottom). |
78
+ | `draggable` | `boolean` | `false` | Enable swipe-to-dismiss (bottom only). |
79
+ | `dragHandle` | `boolean` | `false` | Show iOS-style drag handle bar. |
72
80
 
73
81
  ## Events
74
82
 
@@ -86,6 +94,15 @@ const open = ref(false);
86
94
  | `actions` | `{ close }` | Extra buttons in the header actions area. |
87
95
  | `footer` | -- | Sticky footer area. |
88
96
 
97
+ ## Exposed Methods
98
+
99
+ Accessible via a template ref on the component:
100
+
101
+ | Method | Description |
102
+ | --------- | ------------------------------------------ |
103
+ | `open()` | Opens the sidebar (sets model true). |
104
+ | `close()` | Closes the sidebar with reason `"action"`. |
105
+
89
106
  ## Features
90
107
 
91
108
  ### Animated Transitions
@@ -102,14 +119,14 @@ When `position="bottom"` and `draggable` is true, users can swipe the panel down
102
119
 
103
120
  ### Size Presets
104
121
 
105
- | Size | Width/Height |
106
- | ------ | ------------- |
107
- | `sm` | 300px |
108
- | `md` | 380px |
109
- | `lg` | 520px |
110
- | `full` | Full viewport |
122
+ | Size | Width (left/right) | Height (bottom) |
123
+ | ------ | ------------------ | --------------- |
124
+ | `sm` | 300px | 40dvh |
125
+ | `md` | 380px | 56dvh |
126
+ | `lg` | 520px | 72dvh |
127
+ | `full` | 100vw | 100dvh |
111
128
 
112
- Override with the `width` or `height` prop for custom dimensions.
129
+ Width presets apply to `left`/`right` positions; height presets apply to `position="bottom"`. Override with the `width` or `height` prop for custom dimensions.
113
130
 
114
131
  ## Common Patterns
115
132
 
@@ -15,14 +15,20 @@ All composables are exported from `framework/ui/composables/index.ts` and availa
15
15
 
16
16
  ## Exports
17
17
 
18
- | Composable | Purpose |
19
- | --------------------- | ---------------------------------------------------------------------------------- |
20
- | `useAdaptiveItems` | Measures and distributes items into visible/hidden groups based on container width |
21
- | `useScrollArrows` | Tracks scroll overflow state and provides animated scroll-by-arrow controls |
22
- | `useFloatingPosition` | Wrapper around `@floating-ui/vue` with sensible defaults for dropdowns/tooltips |
23
- | `useTeleportTarget` | Resolves a consistent teleport target (explicit target, app root, or body) |
24
- | `useFormField` | Shared form field logic: unique IDs, ARIA attributes, InputGroup integration |
25
- | `useCollapsible` | Expand/collapse panel with measured content height and CSS transitions |
18
+ | Composable | Purpose |
19
+ | ------------------------ | -------------------------------------------------------------------------------------------- |
20
+ | `useAdaptiveItems` | Measures and distributes items into visible/hidden groups based on container width |
21
+ | `useScrollArrows` | Tracks scroll overflow state and provides animated scroll-by-arrow controls |
22
+ | `useFloatingPosition` | Wrapper around `@floating-ui/vue` with sensible defaults for dropdowns/tooltips |
23
+ | `useTeleportTarget` | Resolves a consistent teleport target (explicit target, app root, or body) |
24
+ | `useFormField` | Shared form field logic: unique IDs, ARIA attributes, InputGroup integration |
25
+ | `useCollapsible` | Expand/collapse panel with measured content height and CSS transitions |
26
+ | `useTableSort` | Sort state for `VcTable`/`VcDataTable` |
27
+ | `useTableSelection` | Row selection state (multi-select, select-all, programmatic) for tables |
28
+ | `useDataTableSort` | URL-persistent sort state for `VcDataTable` ([docs](./useDataTableSort.docs.md)) |
29
+ | `useDataTablePagination` | URL-persistent pagination state for `VcDataTable` ([docs](./useDataTablePagination.docs.md)) |
30
+ | `useTableSearch` | URL-persistent search keyword for `VcDataTable` ([docs](./useTableSearch.docs.md)) |
31
+ | `useBladeLoading` | Blade-scoped loading/skeleton state |
26
32
 
27
33
  ## API Details
28
34
 
@@ -104,4 +110,4 @@ const { isExpanded, toggle, wrapperStyle, contentRef, hasOverflow } = useCollaps
104
110
 
105
111
  - `framework/ui/components/molecules/vc-dropdown/` -- uses `useFloatingPosition`
106
112
  - `framework/ui/components/molecules/vc-input/` -- uses `useFormField`
107
- - `framework/shared/components/sidebar/` -- uses `useScrollArrows`
113
+ - `framework/ui/components/atoms/vc-scrollable-container/` -- uses `useScrollArrows`
@@ -54,12 +54,14 @@ const { sortField, sortOrder, sortExpression, resetSort } = useDataTableSort({
54
54
 
55
55
  ### Returns
56
56
 
57
- | Property | Type | Description |
58
- | ---------------- | ---------------------------------- | -------------------------------------------------------------------------------------- |
59
- | `sortField` | `Ref<string \| undefined>` | Current sort field; bind with `v-model:sort-field` |
60
- | `sortOrder` | `Ref<number>` | Numeric sort order: `1` = ASC, `-1` = DESC, `0` = none; bind with `v-model:sort-order` |
61
- | `sortExpression` | `ComputedRef<string \| undefined>` | Formatted string (e.g., `"name:ASC"`) or `undefined` when no sort is active |
62
- | `resetSort` | `() => void` | Reset to the initial field/direction passed to the composable |
57
+ | Property | Type | Description |
58
+ | ---------------- | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
59
+ | `sortField` | `Ref<string \| undefined>` | Current sort field; bind with `v-model:sort-field` |
60
+ | `sortOrder` | `Ref<DataTableSortOrder>` | Sort order (`DataTableSortOrder = 0 \| 1 \| -1`): `1` = ASC, `-1` = DESC, `0` = none; bind with `v-model:sort-order` |
61
+ | `sortExpression` | `ComputedRef<string \| undefined>` | Formatted string (e.g., `"name:ASC"`) or `undefined` when no sort is active |
62
+ | `resetSort` | `() => void` | Reset to the initial field/direction passed to the composable |
63
+
64
+ The `DataTableSortOrder` (`0 | 1 | -1`) and `DataTableSortDirection` (`"ASC" | "DESC"`) types are exported alongside the composable.
63
65
 
64
66
  ## Direction Mapping
65
67
 
@@ -45,9 +45,9 @@ const { searchValue } = useTableSearch({
45
45
 
46
46
  ### Returns
47
47
 
48
- | Property | Type | Description |
49
- | ------------- | ------------- | -------------------------------------------------------- |
50
- | `searchValue` | `Ref<string>` | Current search keyword; bind with `v-model:search-value` |
48
+ | Property | Type | Description |
49
+ | ------------- | -------------------------- | -------------------------------------------------------- |
50
+ | `searchValue` | `Ref<string \| undefined>` | Current search keyword; bind with `v-model:search-value` |
51
51
 
52
52
  ## Details
53
53
 
@@ -43,9 +43,9 @@ async function deleteSelected() {
43
43
 
44
44
  ### Parameters (Options)
45
45
 
46
- | Option | Type | Default | Description |
47
- | --------- | -------------------------------- | ------- | ------------------------------------- |
48
- | `idField` | `keyof T \| (item: T) => string` | `"id"` | Field or function to extract item IDs |
46
+ | Option | Type | Default | Description |
47
+ | --------- | ----------------------------------------------- | ------- | ------------------------------------- |
48
+ | `idField` | `keyof T \| ((item: T) => string \| undefined)` | `"id"` | Field or function to extract item IDs |
49
49
 
50
50
  ### Returns
51
51
 
@@ -159,5 +159,5 @@ const selection2 = useTableSelection<CompositeItem>({
159
159
 
160
160
  ## Related
161
161
 
162
- - `VcDataTable` -- emits `selection-changed` and `select:all` events
162
+ - `VcTableAdapter` (exported as `VcTable`) -- emits `selection-changed` and `select:all` events
163
163
  - `useTableSort` -- often used alongside selection for list blade patterns
@@ -139,7 +139,7 @@ watch(sortExpression, () => loadItems(), { immediate: true });
139
139
  - **Sort expression format**: The `sortExpression` computed returns `"property:DIRECTION"` when active, or `undefined` when no sort is applied. This format is directly compatible with VirtoCommerce Platform search endpoints.
140
140
  - **Writable computed**: `currentSort` is a `WritableComputedRef`, so you can set it programmatically: `currentSort.value = { property: "name", direction: "ASC" }`.
141
141
  - **Reset behavior**: `resetSort()` returns to the initial options passed to the composable. If no initial options were provided, it clears the sort entirely.
142
- - **handleSortChange format**: Accepts either `"fieldName"` (triggers cycling) or `"fieldName:DIR"` (sets explicit direction). VcDataTable's `@header-click` event emits in the latter format when the adapter encodes direction.
142
+ - **handleSortChange format**: Accepts either `"fieldName"` (triggers cycling) or `"fieldName:DIR"` (sets explicit direction). `VcTableAdapter`'s `@header-click` event emits in the latter format when the adapter encodes direction.
143
143
 
144
144
  ## Tips
145
145
 
@@ -149,6 +149,5 @@ watch(sortExpression, () => loadItems(), { immediate: true });
149
149
 
150
150
  ## Related
151
151
 
152
- - `VcDataTable` -- emits header-click events consumed by `handleSortChange`
153
- - `VcTableAdapter` -- adapts legacy sort prop format
152
+ - `VcTableAdapter` (exported as `VcTable`) -- emits header-click events consumed by `handleSortChange`; adapts legacy sort prop format
154
153
  - `useTableSelection` -- often used alongside sort for list blade patterns
@@ -0,0 +1,221 @@
1
+ ---
2
+ name: table-url-state-migration
3
+ description: AI transformation rules for opting an existing VcDataTable list into URL-query state persistence (sort, search, page) via the composables' stateKey option.
4
+ ---
5
+
6
+ # Table URL State: persist sort / search / page in the blade URL
7
+
8
+ This retrofit applies to list blades that **already use `VcDataTable`** with the state
9
+ composables (`useDataTableSort`, `useDataTablePagination`, and search) but do **not** yet
10
+ persist the view to the URL. After it, sort, search keyword, and current page survive a
11
+ reload and travel in a shareable link.
12
+
13
+ It is independent of the VcTable→VcDataTable swap (`datatable-migration`) and of adopting
14
+ the pagination composable (`use-data-table-pagination-migration`). Run those first if the
15
+ file still uses `<VcTable>` or hand-rolled `pages`/`currentPage`.
16
+
17
+ ## Concept
18
+
19
+ Each state composable accepts an optional `stateKey`. With it set, the composable reads its
20
+ initial value from the blade URL query on creation and writes changes back:
21
+
22
+ - `useDataTableSort({ stateKey })` → `<stateKey>_sort` (e.g. `createdDate:DESC`)
23
+ - `useTableSearch({ stateKey })` → `<stateKey>_search`
24
+ - `useDataTablePagination({ stateKey })` → `<stateKey>_page` (page 1 is encoded as absent)
25
+
26
+ The `state-key` **prop** on `<VcDataTable>` is unrelated — it persists column layout to
27
+ `localStorage`. Leave it as-is. The composable `stateKey` is the URL query store.
28
+
29
+ ## Choosing the key
30
+
31
+ - One key per table, **the same string** across all three composables on that blade.
32
+ - Use snake_case, conventionally `<module>_list` (e.g. `orders_list`). It may equal the
33
+ table `state-key` prop — they are separate stores.
34
+ - The key must be unique among tables that can be visible simultaneously (a list plus a
35
+ child list in the same stack), so their query params do not collide.
36
+
37
+ ## Precondition: the blade must be URL-addressable
38
+
39
+ `stateKey` only does something when the blade has a `url` in `defineBlade`. For a
40
+ non-routable or nested blade (no `url`) the query service is a no-op — skip that file and
41
+ note it in the report rather than adding dead options.
42
+
43
+ ## RULE 1: Add `stateKey` to `useDataTableSort`
44
+
45
+ **BEFORE:**
46
+
47
+ ```ts
48
+ const { sortField, sortOrder, sortExpression } = useDataTableSort({
49
+ initialField: "createdDate",
50
+ initialDirection: "DESC",
51
+ });
52
+ ```
53
+
54
+ **AFTER:**
55
+
56
+ ```ts
57
+ const { sortField, sortOrder, sortExpression } = useDataTableSort({
58
+ stateKey: "orders_list",
59
+ initialField: "createdDate",
60
+ initialDirection: "DESC",
61
+ });
62
+ ```
63
+
64
+ ## RULE 2: Own the search keyword with `useTableSearch({ stateKey })`
65
+
66
+ The keyword must live in a ref that `useTableSearch` controls, bound to
67
+ `v-model:search-value`. Three starting shapes:
68
+
69
+ **2a — bare `ref("")` in the blade:** replace it.
70
+
71
+ ```ts
72
+ // BEFORE
73
+ const searchValue = ref("");
74
+ // AFTER
75
+ const { searchValue } = useTableSearch({ stateKey: "orders_list" });
76
+ ```
77
+
78
+ **2b — event-driven `@search` with no ref:** the table emits `@search` and a handler loads
79
+ directly. Convert to `v-model:search-value` + a watcher.
80
+
81
+ ```vue
82
+ <!-- BEFORE -->
83
+ <VcDataTable :searchable="true" @search="onSearchChange" />
84
+ <!-- AFTER -->
85
+ <VcDataTable :searchable="true" v-model:search-value="searchValue" />
86
+ ```
87
+
88
+ ```ts
89
+ // BEFORE
90
+ async function onSearchChange(keyword: string | undefined) {
91
+ await loadItems({ ...searchQuery.value, keyword, skip: 0 });
92
+ }
93
+ // AFTER — remove onSearchChange; drive load from the watcher (see RULE 5)
94
+ const { searchValue } = useTableSearch({ stateKey: "orders_list" });
95
+ ```
96
+
97
+ **2c — the deprecated `useTableQueryState().read()` preview form:** delete the manual
98
+ restore block entirely (see RULE 6); the three composables now seed themselves.
99
+
100
+ In all cases add `v-model:search-value="searchValue"` to the `<VcDataTable>` and keep
101
+ `:searchable="true"`.
102
+
103
+ ## RULE 3: Add `stateKey` to `useDataTablePagination`
104
+
105
+ If pagination is created in the blade, add the option directly:
106
+
107
+ ```ts
108
+ const pagination = useDataTablePagination({
109
+ stateKey: "orders_list",
110
+ pageSize: 20,
111
+ totalCount,
112
+ });
113
+ ```
114
+
115
+ If pagination is created **inside the list composable** (common when `onPageChange` drives
116
+ the load), thread `stateKey` through as a composable option — the blade still owns the key:
117
+
118
+ ```ts
119
+ // composable
120
+ export function useOrdersList(options?: { pageSize?: number; stateKey?: string }) {
121
+ // ...
122
+ const pagination = useDataTablePagination({
123
+ stateKey: options?.stateKey,
124
+ pageSize: options?.pageSize ?? 20,
125
+ totalCount: computed(() => searchResult.value?.totalCount ?? 0),
126
+ onPageChange: ({ skip }) => loadItems({ ...searchQuery.value, skip }),
127
+ });
128
+ }
129
+ ```
130
+
131
+ ```ts
132
+ // blade
133
+ const { items, pagination, loadItems } = useOrdersList({ stateKey: "orders_list" });
134
+ ```
135
+
136
+ Add the `stateKey?: string` field to the composable's options interface.
137
+
138
+ ## RULE 4: Seed the initial load from the restored values
139
+
140
+ The first load on mount must read the restored sort, keyword, and page — otherwise the URL
141
+ is restored into the refs but the first fetch ignores them and shows page 1 unfiltered.
142
+
143
+ ```ts
144
+ // BEFORE
145
+ onMounted(() => loadItems({ take: 20, sort: sortExpression.value }));
146
+ // AFTER
147
+ onMounted(() =>
148
+ loadItems({
149
+ take: 20,
150
+ sort: sortExpression.value,
151
+ keyword: searchValue.value || undefined,
152
+ skip: pagination.skip,
153
+ }),
154
+ );
155
+ ```
156
+
157
+ For a `reload()` helper, use `skip: pagination.skip` (not a recomputed skip).
158
+
159
+ ## RULE 5: Reset to page 1 when the search changes — REQUIRED
160
+
161
+ This is not optional. If the user is on page 3 and types a query that returns fewer pages,
162
+ leaving `_page=3` in the URL makes the next reload request page 3 of the filtered set:
163
+ `skip` overshoots and the table shows an empty "nothing found" state on reload. Resetting to
164
+ page 1 drops `_page` from the URL and keeps the `(search, page)` pair consistent.
165
+
166
+ ```ts
167
+ watch(searchValue, () => pagination.setPage(1));
168
+ // then the reload watcher (debounced) picks up the change:
169
+ watch([sortExpression, searchValue, () => pagination.skip], debounce(load, 300));
170
+ ```
171
+
172
+ If search loads through a separate handler (event-driven apps), call `pagination.setPage(1)`
173
+ at the top of that handler before loading with `skip: 0`. Apply the same reset when a global
174
+ filter changes.
175
+
176
+ ## RULE 6: Remove the deprecated preview API
177
+
178
+ Delete any `useTableQueryState().read()` or `useTableQueryPersistence` usage and the manual
179
+ ref-seeding it drove — the `stateKey` option replaces it.
180
+
181
+ ```ts
182
+ // DELETE this whole block:
183
+ const restored = useTableQueryState("orders_list").read();
184
+ if (restored.sort) {
185
+ /* ... */
186
+ }
187
+ if (restored.search) searchValue.value = restored.search;
188
+ if (restored.page) pagination.setPage(restored.page);
189
+ ```
190
+
191
+ Remove the now-unused `useTableQueryState` / `useTableQueryPersistence` import.
192
+
193
+ ## Advanced: a shared list base with two views
194
+
195
+ Some apps render two datasets (e.g. flat list vs. category tree) through one
196
+ `VcDataTable`-wrapping base component, each with its own `useDataTablePagination`. Pass the
197
+ same `stateKey` to **both** view paginations (only one view is active at a time, so they
198
+ never write the page param simultaneously) and reset the page on search via the unified
199
+ pagination object the base holds (`props.pagination.setPage(1)`).
200
+
201
+ ## What to add
202
+
203
+ - `stateKey` on `useDataTableSort`, `useDataTablePagination`, and `useTableSearch` (same key)
204
+ - `useTableSearch({ stateKey })` import + `v-model:search-value="searchValue"` binding
205
+ - `watch(searchValue, () => pagination.setPage(1))`
206
+ - `skip: pagination.skip` and `keyword: searchValue.value || undefined` in the initial load
207
+ - `stateKey?: string` on the list composable's options interface (when pagination is there)
208
+
209
+ ## What to remove
210
+
211
+ - `useTableQueryState().read()` / `useTableQueryPersistence` calls and their imports
212
+ - Event-driven `@search` handlers that only set a keyword and reload (replaced by RULE 2/5)
213
+ - Any manual `currentPage`/`skip` math used purely to restore a page from the URL
214
+
215
+ ## Verification
216
+
217
+ 1. `npx vue-tsc --noEmit` passes.
218
+ 2. Sort a column, search, go to page 2 — the URL gains `<key>_sort`, `<key>_search`,
219
+ `<key>_page`. Reload: the table restores the same view and shows results.
220
+ 3. On page 2, type a search — the URL drops `_page` (reset to page 1) and results show.
221
+ 4. No `useTableQueryState` / `useTableQueryPersistence` references remain.
package/runtime/vc-app.md CHANGED
@@ -1613,6 +1613,7 @@ Map topic headings to migration prompt files and pattern files:
1613
1613
  | Assets API / useAssets / useAssetsManager / use-assets-migration | `use-assets-migration` | `{KNOWLEDGE_BASE}/migration-prompts/use-assets-migration.md` | `{KNOWLEDGE_BASE}/patterns/assets-management.md` |
1614
1614
  | Manual Migration Audit / useExternalWidgets / moment / useFunctions / resolveBladeByName / onParentCall / manual-migration-audit | `manual-migration-audit` | `{KNOWLEDGE_BASE}/migration-prompts/manual-migration-audit.md` | — |
1615
1615
  | Pagination / useDataTablePagination / use-data-table-pagination-audit | `use-data-table-pagination-audit` | `{KNOWLEDGE_BASE}/migration-prompts/use-data-table-pagination-migration.md` | — |
1616
+ | Table URL State / stateKey / useTableQueryState / table-url-state-audit | `table-url-state-audit` | `{KNOWLEDGE_BASE}/migration-prompts/table-url-state-migration.md` | `{KNOWLEDGE_BASE}/patterns/list-blade-pattern.md` |
1616
1617
 
1617
1618
  Build the `topics` array for the migration-agent using the canonical topic names above.
1618
1619