@vc-shell/vc-app-skill 2.1.0-pr255.87acc71 → 2.1.0-pr256.34ebb1b
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/package.json +1 -1
- package/runtime/knowledge/docs/core/api/platform.docs.md +20 -18
- package/runtime/knowledge/docs/core/blade-navigation/blade-nav-composables.docs.md +43 -34
- package/runtime/knowledge/docs/core/blade-navigation/table-query-state/useTableQueryState.docs.md +95 -0
- package/runtime/knowledge/docs/core/composables/useAppBarMobileButtons/useAppBarMobileButtons.docs.md +5 -3
- package/runtime/knowledge/docs/core/composables/useAppBarWidget/useAppBarWidget.docs.md +12 -10
- package/runtime/knowledge/docs/core/composables/useAppInsights/useAppInsights.docs.md +7 -5
- package/runtime/knowledge/docs/core/composables/useAssets/useAssets.docs.md +8 -6
- package/runtime/knowledge/docs/core/composables/useAssetsManager/useAssetsManager.docs.md +3 -1
- package/runtime/knowledge/docs/core/composables/useAsync/useAsync.docs.md +1 -1
- package/runtime/knowledge/docs/core/composables/useBladeRegistry/useBladeRegistry.docs.md +8 -5
- package/runtime/knowledge/docs/core/composables/useBladeWidgets/index.docs.md +12 -12
- package/runtime/knowledge/docs/core/composables/useBreadcrumbs/useBreadcrumbs.docs.md +3 -3
- package/runtime/knowledge/docs/core/composables/useConnectionStatus/useConnectionStatus.docs.md +4 -3
- package/runtime/knowledge/docs/core/composables/useDynamicProperties/useDynamicProperties.docs.md +1 -0
- package/runtime/knowledge/docs/core/composables/useFunctions/useFunctions.docs.md +3 -3
- package/runtime/knowledge/docs/core/composables/useKeyboardNavigation/useKeyboardNavigation.docs.md +5 -4
- package/runtime/knowledge/docs/core/composables/useLanguages/useLanguages.docs.md +3 -3
- package/runtime/knowledge/docs/core/composables/useLoading/useLoading.docs.md +2 -0
- package/runtime/knowledge/docs/core/composables/useModificationTracker/useModificationTracker.docs.md +1 -2
- package/runtime/knowledge/docs/core/composables/useNotifications/useNotifications.docs.md +1 -1
- package/runtime/knowledge/docs/core/composables/usePermissions/usePermissions.docs.md +3 -3
- package/runtime/knowledge/docs/core/composables/usePlatformLocaleSync/usePlatformLocaleSync.docs.md +35 -0
- package/runtime/knowledge/docs/core/composables/usePopup/usePopup.docs.md +1 -1
- package/runtime/knowledge/docs/core/composables/useResponsive/useResponsive.docs.md +2 -2
- package/runtime/knowledge/docs/core/composables/useSettings/useSettings.docs.md +2 -1
- package/runtime/knowledge/docs/core/composables/useSettingsMenu/useSettingsMenu.docs.md +18 -18
- package/runtime/knowledge/docs/core/composables/useSidebarState/useSidebarState.docs.md +3 -3
- package/runtime/knowledge/docs/core/composables/useSlowNetworkDetection/useSlowNetworkDetection.docs.md +10 -7
- package/runtime/knowledge/docs/core/composables/useTheme/useTheme.docs.md +7 -7
- package/runtime/knowledge/docs/core/composables/useToolbar/useToolbar.docs.md +18 -12
- package/runtime/knowledge/docs/core/composables/useUser/useUser.docs.md +2 -2
- package/runtime/knowledge/docs/core/composables/useUserManagement/useUserManagement.docs.md +20 -20
- package/runtime/knowledge/docs/core/composables/useWidgets/useWidgets.docs.md +15 -24
- package/runtime/knowledge/docs/core/directives/loading/loading.docs.md +2 -2
- package/runtime/knowledge/docs/core/notifications/composables/useBladeNotifications.docs.md +183 -0
- package/runtime/knowledge/docs/core/notifications/composables/useBroadcastFilter.docs.md +117 -0
- package/runtime/knowledge/docs/core/notifications/composables/useNotificationContext.docs.md +150 -0
- package/runtime/knowledge/docs/core/notifications/composables/useNotificationStore.docs.md +114 -0
- package/runtime/knowledge/docs/core/notifications/notifications.docs.md +50 -30
- package/runtime/knowledge/docs/core/plugins/ai-agent/ai-agent.docs.md +30 -11
- package/runtime/knowledge/docs/core/plugins/extension-points/extension-points.docs.md +1 -1
- package/runtime/knowledge/docs/core/plugins/global-error-handler/global-error-handler.docs.md +2 -3
- package/runtime/knowledge/docs/core/plugins/modularity/modularity.docs.md +26 -26
- package/runtime/knowledge/docs/core/plugins/permissions/permissions.docs.md +2 -3
- package/runtime/knowledge/docs/core/plugins/signalR/signalR.docs.md +11 -50
- package/runtime/knowledge/docs/core/plugins/validation/validation.docs.md +9 -6
- package/runtime/knowledge/docs/core/services/services.docs.md +15 -13
- package/runtime/knowledge/docs/core/types/types.docs.md +37 -40
- package/runtime/knowledge/docs/core/utilities/date/date-utilities.docs.md +1 -2
- package/runtime/knowledge/docs/core/utilities/shared-utilities.docs.md +21 -30
- package/runtime/knowledge/docs/core/utilities/thumbnail/thumbnail.docs.md +2 -2
- package/runtime/knowledge/docs/core/utilities/utilities.docs.md +9 -8
- package/runtime/knowledge/docs/injection-keys.docs.md +6 -11
- package/runtime/knowledge/docs/modules/assets/assets-details.docs.md +123 -0
- package/runtime/knowledge/docs/modules/assets-manager/assets-manager.docs.md +1 -1
- package/runtime/knowledge/docs/shell/_internal/popup/common/popup-common.docs.md +20 -12
- package/runtime/knowledge/docs/shell/auth/ChangePasswordPage/change-password-page.docs.md +10 -10
- package/runtime/knowledge/docs/shell/auth/ForgotPasswordPage/forgot-password-page.docs.md +6 -6
- package/runtime/knowledge/docs/shell/auth/InvitePage/invite-page.docs.md +4 -4
- package/runtime/knowledge/docs/shell/auth/LoginPage/login-page.docs.md +16 -14
- package/runtime/knowledge/docs/shell/auth/ResetPasswordPage/reset-password-page.docs.md +1 -1
- package/runtime/knowledge/docs/shell/auth/sign-in/sign-in.docs.md +12 -11
- package/runtime/knowledge/docs/shell/components/change-password/change-password.docs.md +10 -3
- package/runtime/knowledge/docs/shell/components/change-password-button/change-password-button.docs.md +3 -3
- package/runtime/knowledge/docs/shell/components/error-interceptor/error-interceptor.docs.md +9 -2
- package/runtime/knowledge/docs/shell/components/language-selector/language-selector.docs.md +4 -2
- package/runtime/knowledge/docs/shell/components/logout-button/logout-button.docs.md +1 -1
- package/runtime/knowledge/docs/shell/components/notification-dropdown/notification-dropdown.docs.md +35 -31
- package/runtime/knowledge/docs/shell/components/notification-template/notification-template.docs.md +17 -11
- package/runtime/knowledge/docs/shell/components/settings-menu/settings-menu.docs.md +8 -7
- package/runtime/knowledge/docs/shell/components/settings-menu-item/settings-menu-item.docs.md +23 -21
- package/runtime/knowledge/docs/shell/components/sidebar/sidebar.docs.md +5 -3
- package/runtime/knowledge/docs/shell/components/theme-selector/theme-selector.docs.md +7 -7
- package/runtime/knowledge/docs/shell/components/user-dropdown-button/user-dropdown-button.docs.md +11 -11
- package/runtime/knowledge/docs/shell/dashboard/dashboard-charts/dashboard-charts.docs.md +28 -16
- package/runtime/knowledge/docs/shell/dashboard/dashboard-widget-card/dashboard-widget-card.docs.md +17 -19
- package/runtime/knowledge/docs/shell/dashboard/draggable-dashboard/dashboard-widget-skeleton.docs.md +33 -0
- package/runtime/knowledge/docs/shell/dashboard/draggable-dashboard/draggable-dashboard.docs.md +21 -0
- package/runtime/knowledge/docs/ui/components/atoms/vc-badge/vc-badge.docs.md +2 -1
- package/runtime/knowledge/docs/ui/components/atoms/vc-banner/vc-banner.docs.md +2 -2
- package/runtime/knowledge/docs/ui/components/atoms/vc-button/vc-button.docs.md +15 -14
- package/runtime/knowledge/docs/ui/components/atoms/vc-container/vc-container.docs.md +9 -6
- package/runtime/knowledge/docs/ui/components/atoms/vc-environment-banner/vc-environment-banner.docs.md +42 -0
- package/runtime/knowledge/docs/ui/components/atoms/vc-hint/vc-hint.docs.md +1 -1
- package/runtime/knowledge/docs/ui/components/atoms/vc-icon/vc-icon.docs.md +10 -9
- package/runtime/knowledge/docs/ui/components/atoms/vc-image/vc-image.docs.md +19 -4
- package/runtime/knowledge/docs/ui/components/atoms/vc-label/vc-label.docs.md +2 -2
- package/runtime/knowledge/docs/ui/components/atoms/vc-link/vc-link.docs.md +5 -4
- package/runtime/knowledge/docs/ui/components/atoms/vc-loading/vc-loading.docs.md +5 -4
- package/runtime/knowledge/docs/ui/components/atoms/vc-progress/vc-progress.docs.md +9 -8
- package/runtime/knowledge/docs/ui/components/atoms/vc-scrollable-container/vc-scrollable-container.docs.md +7 -0
- package/runtime/knowledge/docs/ui/components/atoms/vc-skeleton/vc-skeleton.docs.md +1 -1
- package/runtime/knowledge/docs/ui/components/atoms/vc-status/vc-status.docs.md +2 -2
- package/runtime/knowledge/docs/ui/components/atoms/vc-status-icon/vc-status-icon.docs.md +1 -1
- package/runtime/knowledge/docs/ui/components/atoms/vc-tooltip/vc-tooltip.docs.md +11 -10
- package/runtime/knowledge/docs/ui/components/atoms/vc-video/vc-video.docs.md +28 -8
- package/runtime/knowledge/docs/ui/components/atoms/vc-widget/vc-widget.docs.md +22 -19
- package/runtime/knowledge/docs/ui/components/molecules/multilanguage-selector/multilanguage-selector.docs.md +8 -8
- package/runtime/knowledge/docs/ui/components/molecules/vc-accordion/vc-accordion.docs.md +16 -6
- package/runtime/knowledge/docs/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.docs.md +9 -8
- package/runtime/knowledge/docs/ui/components/molecules/vc-checkbox/vc-checkbox.docs.md +42 -34
- package/runtime/knowledge/docs/ui/components/molecules/vc-checkbox-group/vc-checkbox-group.docs.md +1 -1
- package/runtime/knowledge/docs/ui/components/molecules/vc-color-input/vc-color-input.docs.md +14 -1
- package/runtime/knowledge/docs/ui/components/molecules/vc-date-picker/vc-date-picker.docs.md +3 -1
- package/runtime/knowledge/docs/ui/components/molecules/vc-dropdown/vc-dropdown.docs.md +34 -33
- package/runtime/knowledge/docs/ui/components/molecules/vc-editor/vc-editor.docs.md +26 -24
- package/runtime/knowledge/docs/ui/components/molecules/vc-field/vc-field.docs.md +12 -14
- package/runtime/knowledge/docs/ui/components/molecules/vc-file-upload/vc-file-upload.docs.md +30 -30
- package/runtime/knowledge/docs/ui/components/molecules/vc-input/vc-input.docs.md +2 -2
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-currency/vc-input-currency.docs.md +1 -1
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.docs.md +34 -31
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-group/vc-input-group.docs.md +14 -12
- package/runtime/knowledge/docs/ui/components/molecules/vc-menu/vc-menu.docs.md +1 -1
- package/runtime/knowledge/docs/ui/components/molecules/vc-multivalue/vc-multivalue.docs.md +36 -27
- package/runtime/knowledge/docs/ui/components/molecules/vc-pagination/vc-pagination.docs.md +5 -1
- package/runtime/knowledge/docs/ui/components/molecules/{vc-dropdown-panel/vc-dropdown-panel.docs.md → vc-popover/vc-popover.docs.md} +26 -25
- package/runtime/knowledge/docs/ui/components/molecules/vc-radio-button/vc-radio-button.docs.md +10 -9
- package/runtime/knowledge/docs/ui/components/molecules/vc-select/vc-select.docs.md +44 -19
- package/runtime/knowledge/docs/ui/components/molecules/vc-slider/vc-slider.docs.md +11 -11
- package/runtime/knowledge/docs/ui/components/molecules/vc-switch/vc-switch.docs.md +15 -14
- package/runtime/knowledge/docs/ui/components/molecules/vc-textarea/vc-textarea.docs.md +15 -15
- package/runtime/knowledge/docs/ui/components/molecules/vc-toast/vc-toast.docs.md +15 -13
- package/runtime/knowledge/docs/ui/components/organisms/vc-app/vc-app.docs.md +5 -1
- package/runtime/knowledge/docs/ui/components/organisms/vc-auth-layout/vc-auth-layout.docs.md +18 -0
- package/runtime/knowledge/docs/ui/components/organisms/vc-blade/vc-blade.docs.md +48 -78
- package/runtime/knowledge/docs/ui/components/organisms/vc-data-table/composables/table-composables.docs.md +9 -11
- package/runtime/knowledge/docs/ui/components/organisms/vc-data-table/vc-data-table.docs.md +71 -43
- package/runtime/knowledge/docs/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.docs.md +27 -20
- package/runtime/knowledge/docs/ui/components/organisms/vc-gallery/vc-gallery.docs.md +2 -2
- package/runtime/knowledge/docs/ui/components/organisms/vc-image-upload/vc-image-upload.docs.md +12 -12
- package/runtime/knowledge/docs/ui/components/organisms/vc-popup/vc-popup.docs.md +33 -24
- package/runtime/knowledge/docs/ui/components/organisms/vc-scheduler/vc-scheduler.docs.md +412 -0
- package/runtime/knowledge/docs/ui/components/organisms/vc-sidebar/vc-sidebar.docs.md +43 -26
- package/runtime/knowledge/docs/ui/composables/ui-composables.docs.md +15 -9
- package/runtime/knowledge/docs/ui/composables/useDataTableSort.docs.md +8 -6
- package/runtime/knowledge/docs/ui/composables/useTableSearch.docs.md +130 -0
- package/runtime/knowledge/docs/ui/composables/useTableSelection.docs.md +4 -4
- package/runtime/knowledge/docs/ui/composables/useTableSort.docs.md +2 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vc-shell/vc-app-skill",
|
|
3
|
-
"version": "2.1.0-
|
|
3
|
+
"version": "2.1.0-pr256.34ebb1b",
|
|
4
4
|
"description": "AI coding skill for scaffolding and generating VirtoCommerce Shell applications. Works with Claude Code, OpenCode, Gemini, Codex, Cursor.",
|
|
5
5
|
"bin": "./bin/install.cjs",
|
|
6
6
|
"files": [
|
|
@@ -31,9 +31,11 @@ All clients extend `AuthApiBase` and accept an optional `baseUrl` and `http` fet
|
|
|
31
31
|
| Client | Description |
|
|
32
32
|
| --------------------------- | -------------------------------------------------------- |
|
|
33
33
|
| `ExternalSignInClient` | External authentication provider sign-in |
|
|
34
|
+
| `AppManifestClient` | Application manifest descriptor operations |
|
|
34
35
|
| `AppsClient` | Application descriptor operations |
|
|
35
36
|
| `AuthorizationClient` | Permission and role checking |
|
|
36
37
|
| `ChangeLogClient` | Platform change log / audit trail |
|
|
38
|
+
| `DeveloperToolsClient` | Developer-tools endpoint |
|
|
37
39
|
| `DiagnosticsClient` | System diagnostics and health |
|
|
38
40
|
| `DynamicPropertiesClient` | Dynamic property CRUD and dictionary management |
|
|
39
41
|
| `JobsClient` | Background job management |
|
|
@@ -46,20 +48,20 @@ All clients extend `AuthApiBase` and accept an optional `baseUrl` and `http` fet
|
|
|
46
48
|
|
|
47
49
|
## Key DTOs (Interfaces)
|
|
48
50
|
|
|
49
|
-
| Interface | Description
|
|
50
|
-
| -------------------------------- |
|
|
51
|
-
| `PushNotification` | Push notification payload: `id`, `title`, `notifyType`, `isNew`, `
|
|
52
|
-
| `PushNotificationSearchCriteria` | Search criteria for notification queries
|
|
53
|
-
| `ApplicationUser` | Platform user with roles, permissions, logins
|
|
54
|
-
| `Role` | Security role with permissions
|
|
55
|
-
| `Permission` | Individual permission entry
|
|
56
|
-
| `DynamicProperty` | Dynamic property definition
|
|
57
|
-
| `DynamicObjectProperty` | Property value bound to an object
|
|
58
|
-
| `ModuleDescriptor` | Module metadata (id, version, dependencies)
|
|
59
|
-
| `ChangeLogSearchCriteria` | Audit log search parameters
|
|
60
|
-
| `ChangeLogSearchResult` | Paginated audit log results
|
|
61
|
-
| `ObjectSettingEntry` | Setting entry with value and metadata
|
|
62
|
-
| `License` | Platform license information
|
|
51
|
+
| Interface | Description |
|
|
52
|
+
| -------------------------------- | -------------------------------------------------------------------------------- |
|
|
53
|
+
| `PushNotification` | Push notification payload: `id`, `title`, `notifyType`, `isNew`, `created`, etc. |
|
|
54
|
+
| `PushNotificationSearchCriteria` | Search criteria for notification queries |
|
|
55
|
+
| `ApplicationUser` | Platform user with roles, permissions, logins |
|
|
56
|
+
| `Role` | Security role with permissions |
|
|
57
|
+
| `Permission` | Individual permission entry |
|
|
58
|
+
| `DynamicProperty` | Dynamic property definition |
|
|
59
|
+
| `DynamicObjectProperty` | Property value bound to an object |
|
|
60
|
+
| `ModuleDescriptor` | Module metadata (id, version, dependencies) |
|
|
61
|
+
| `ChangeLogSearchCriteria` | Audit log search parameters |
|
|
62
|
+
| `ChangeLogSearchResult` | Paginated audit log results |
|
|
63
|
+
| `ObjectSettingEntry` | Setting entry with value and metadata |
|
|
64
|
+
| `License` | Platform license information |
|
|
63
65
|
|
|
64
66
|
## Base Class
|
|
65
67
|
|
|
@@ -67,7 +69,7 @@ All clients extend `AuthApiBase` and accept an optional `baseUrl` and `http` fet
|
|
|
67
69
|
export class AuthApiBase {
|
|
68
70
|
authToken: string;
|
|
69
71
|
setAuthToken(token: string): void;
|
|
70
|
-
|
|
72
|
+
getBaseUrl(defaultUrl: string, baseUrl: string): string; // always returns ""
|
|
71
73
|
protected transformOptions(options: RequestInit): Promise<RequestInit>; // sets the Bearer header only if `authToken` is non-empty
|
|
72
74
|
}
|
|
73
75
|
```
|
|
@@ -86,7 +88,7 @@ const criteria: PushNotificationSearchCriteria = { take: 20, skip: 0 };
|
|
|
86
88
|
const result = await client.searchPushNotification(criteria);
|
|
87
89
|
|
|
88
90
|
console.log(`Found ${result.totalCount} notifications`);
|
|
89
|
-
for (const notification of result.
|
|
91
|
+
for (const notification of result.notifyEvents ?? []) {
|
|
90
92
|
console.log(`${notification.title} (${notification.notifyType})`);
|
|
91
93
|
}
|
|
92
94
|
```
|
|
@@ -100,7 +102,7 @@ const securityClient = new SecurityClient();
|
|
|
100
102
|
const user = await securityClient.getCurrentUser();
|
|
101
103
|
|
|
102
104
|
console.log(`Logged in as: ${user.userName}`);
|
|
103
|
-
console.log(`
|
|
105
|
+
console.log(`Permissions: ${user.permissions?.join(", ")}`);
|
|
104
106
|
console.log(`Is admin: ${user.isAdministrator}`);
|
|
105
107
|
```
|
|
106
108
|
|
|
@@ -142,7 +144,7 @@ import { SettingClient, ObjectSettingEntry } from "@vc-shell/framework";
|
|
|
142
144
|
const client = new SettingClient();
|
|
143
145
|
|
|
144
146
|
// Read a specific setting
|
|
145
|
-
const
|
|
147
|
+
const setting = await client.getGlobalSetting("VirtoCommerce.Notifications.SendGrid.ApiKey");
|
|
146
148
|
|
|
147
149
|
// Update a setting
|
|
148
150
|
const entry: ObjectSettingEntry = {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
title: Blade Navigation Composables
|
|
3
3
|
category: composables
|
|
4
4
|
group: blade-navigation
|
|
5
|
+
internal: true
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
# Blade Navigation Composables
|
|
@@ -27,11 +28,16 @@ Blade navigation manages an ordered stack of blade descriptors (plain data objec
|
|
|
27
28
|
## Exports
|
|
28
29
|
|
|
29
30
|
```typescript
|
|
30
|
-
export {
|
|
31
|
-
export {
|
|
32
|
-
export
|
|
31
|
+
export { useBladeStack } from "@core/blade-navigation/useBladeStack";
|
|
32
|
+
export { useBladeMessaging } from "@core/blade-navigation/useBladeMessaging";
|
|
33
|
+
export * from "@core/blade-navigation/types";
|
|
34
|
+
export { __registerBladeConfig, getBladeConfig, getAllBladeConfigs } from "@core/blade-navigation/bladeConfigRegistry";
|
|
35
|
+
export { useTableQueryState } from "@core/blade-navigation/table-query-state";
|
|
36
|
+
export type { UseTableQueryStateReturn, TableQueryPatch } from "@core/blade-navigation/table-query-state";
|
|
33
37
|
```
|
|
34
38
|
|
|
39
|
+
The `createBladeStack` / `createBladeMessaging` factories are internal (not re-exported); they are consumed directly by the framework rendering layer. `useBladeNavigation` is the adapter API documented below, which lives under `core/composables/useBladeNavigationAdapter/`, not in this package.
|
|
40
|
+
|
|
35
41
|
<!-- internal:end -->
|
|
36
42
|
|
|
37
43
|
## useBladeStack
|
|
@@ -44,27 +50,28 @@ Creates a new stack instance. Called once by the navigation plugin.
|
|
|
44
50
|
|
|
45
51
|
### API
|
|
46
52
|
|
|
47
|
-
| Method | Description
|
|
48
|
-
| ------------------------------------- |
|
|
49
|
-
| `openWorkspace(event)` | Sets the root blade (index 0). Closes all existing blades unconditionally.
|
|
50
|
-
| `openBlade(event)` | Opens a child blade after a parent. Closes any blades deeper than the parent (with guard checks).
|
|
51
|
-
| `closeBlade(bladeId)` | Closes a blade and all its children. Returns `true` if a guard prevented closing.
|
|
52
|
-
| `closeChildren(parentId)` | Closes all blades after the given parent.
|
|
53
|
-
| `replaceCurrentBlade(event)` | Destroys the current active blade and creates a new one at the same stack index with the same `parentId`.
|
|
54
|
-
| `coverCurrentBlade(event)` | Hides the current active blade (keeps it in the stack) and opens a new blade on top. Closing the covering blade restores the hidden blade.
|
|
55
|
-
| `registerBeforeClose(bladeId, guard)` | Registers a guard function. Return `true` from the guard to PREVENT closing.
|
|
56
|
-
| `unregisterBeforeClose(bladeId)` | Removes a close guard.
|
|
57
|
-
| `setBladeError(bladeId, error)` | Sets an error on a blade descriptor (displayed as error banner).
|
|
58
|
-
| `clearBladeError(bladeId)` | Clears a blade's error.
|
|
59
|
-
| `setBladeTitle(bladeId, title)` | Updates the blade's title in the descriptor.
|
|
53
|
+
| Method | Description |
|
|
54
|
+
| ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
55
|
+
| `openWorkspace(event)` | Sets the root blade (index 0). Closes all existing blades unconditionally. |
|
|
56
|
+
| `openBlade(event)` | Opens a child blade after a parent. Closes any blades deeper than the parent (with guard checks). |
|
|
57
|
+
| `closeBlade(bladeId)` | Closes a blade and all its children. Returns `true` if a guard prevented closing. |
|
|
58
|
+
| `closeChildren(parentId)` | Closes all blades after the given parent. |
|
|
59
|
+
| `replaceCurrentBlade(event)` | Destroys the current active blade and creates a new one at the same stack index with the same `parentId`. |
|
|
60
|
+
| `coverCurrentBlade(event)` | Hides the current active blade (keeps it in the stack) and opens a new blade on top. Closing the covering blade restores the hidden blade. |
|
|
61
|
+
| `registerBeforeClose(bladeId, guard)` | Registers a guard function. Return `true` from the guard to PREVENT closing. |
|
|
62
|
+
| `unregisterBeforeClose(bladeId)` | Removes a close guard. |
|
|
63
|
+
| `setBladeError(bladeId, error)` | Sets an error on a blade descriptor (displayed as error banner). |
|
|
64
|
+
| `clearBladeError(bladeId)` | Clears a blade's error. |
|
|
65
|
+
| `setBladeTitle(bladeId, title)` | Updates the blade's title in the descriptor. |
|
|
66
|
+
| `updateBladeQuery(bladeId, patch)` | Merges `patch` into the blade descriptor's `query`; keys with empty-string or nullish values are removed. Backs table URL-query-state persistence. |
|
|
60
67
|
|
|
61
68
|
### Computed
|
|
62
69
|
|
|
63
|
-
| Property | Type
|
|
64
|
-
| ------------- |
|
|
65
|
-
| `workspace` | `BladeDescriptor
|
|
66
|
-
| `blades` | `readonly BladeDescriptor[]
|
|
67
|
-
| `activeBlade` | `BladeDescriptor
|
|
70
|
+
| Property | Type | Description |
|
|
71
|
+
| ------------- | ------------------------------------------- | ------------------------ |
|
|
72
|
+
| `workspace` | `ComputedRef<BladeDescriptor \| undefined>` | The root blade (index 0) |
|
|
73
|
+
| `blades` | `ComputedRef<readonly BladeDescriptor[]>` | Full ordered stack |
|
|
74
|
+
| `activeBlade` | `ComputedRef<BladeDescriptor \| undefined>` | The last visible blade |
|
|
68
75
|
|
|
69
76
|
### Composable: `useBladeStack()`
|
|
70
77
|
|
|
@@ -134,18 +141,20 @@ openBlade({
|
|
|
134
141
|
|
|
135
142
|
The plain data object stored in the stack for each blade:
|
|
136
143
|
|
|
137
|
-
| Field
|
|
138
|
-
|
|
|
139
|
-
| `id`
|
|
140
|
-
| `name`
|
|
141
|
-
| `url`
|
|
142
|
-
| `param`
|
|
143
|
-
| `query`
|
|
144
|
-
| `options`
|
|
145
|
-
| `parentId`
|
|
146
|
-
| `visible`
|
|
147
|
-
| `error`
|
|
148
|
-
| `title`
|
|
144
|
+
| Field | Type | Description |
|
|
145
|
+
| ------------- | -------------------------- | -------------------------------------------------------------------------- |
|
|
146
|
+
| `id` | `string` | Unique instance ID (auto-generated) |
|
|
147
|
+
| `name` | `string` | Blade registration name |
|
|
148
|
+
| `url` | `string?` | URL segment for address bar sync |
|
|
149
|
+
| `param` | `string?` | Parameter passed when opening (e.g., entity ID) |
|
|
150
|
+
| `query` | `Record<string, string>?` | Query parameters |
|
|
151
|
+
| `options` | `Record<string, unknown>?` | Arbitrary options passed to the blade |
|
|
152
|
+
| `parentId` | `string?` | ID of the parent blade |
|
|
153
|
+
| `visible` | `boolean` | Whether the blade is rendered (false when covered via `coverCurrentBlade`) |
|
|
154
|
+
| `error` | `unknown?` | Error state for the error banner |
|
|
155
|
+
| `title` | `string?` | Dynamic title override |
|
|
156
|
+
| `maximized` | `boolean?` | Whether this blade is maximized (fullscreen) — set by VcBladeSlot |
|
|
157
|
+
| `breadcrumbs` | `Breadcrumbs[]?` | Navigation breadcrumbs — set by VcBladeSlot |
|
|
149
158
|
|
|
150
159
|
## Tips
|
|
151
160
|
|
|
@@ -163,6 +172,6 @@ The plain data object stored in the stack for each blade:
|
|
|
163
172
|
<!-- internal:start -->
|
|
164
173
|
|
|
165
174
|
- `framework/core/composables/useBlade/` -- `useBlade()`, `useBladeContext()` (new API)
|
|
166
|
-
- `framework/shell/_internal/blade-
|
|
175
|
+
- `framework/shell/_internal/blade-navigation/plugin-v2.ts` -- plugin that creates and provides the stack/messaging
|
|
167
176
|
- `framework/core/blade-navigation/types/index.ts` -- `BladeDescriptor`, `IBladeStack`, `IBladeMessaging`
|
|
168
177
|
<!-- internal:end -->
|
package/runtime/knowledge/docs/core/blade-navigation/table-query-state/useTableQueryState.docs.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: useTableQueryState
|
|
3
|
+
category: composables
|
|
4
|
+
group: data
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# useTableQueryState
|
|
8
|
+
|
|
9
|
+
Reads the table view state (`sort`, `search`, `page`) that `VcDataTable` persists to the URL query for URL-addressable blades. A list page calls `read()` in `setup` to seed its own refs from the restored state before its loader runs, so a reload makes one request.
|
|
10
|
+
|
|
11
|
+
Read-only: writing the view state to the URL stays inside `VcDataTable`. This composable only exposes the restored values to the page.
|
|
12
|
+
|
|
13
|
+
## When to Use
|
|
14
|
+
|
|
15
|
+
- A list blade is URL-addressable (workspace or routable) and uses `VcDataTable` with a `state-key`
|
|
16
|
+
- You want a single, coordinated load on reload (sort + search + page restored together)
|
|
17
|
+
- You are wiring the page's combined loader watcher and need the restored seed values
|
|
18
|
+
|
|
19
|
+
## When NOT to Use
|
|
20
|
+
|
|
21
|
+
- The table is standalone or its blade has no URL — there is nothing to restore (`read()` returns `{}`)
|
|
22
|
+
- You only need the live view state — that already lives in your own `sortField`/`searchValue`/`currentPage` refs
|
|
23
|
+
- You want to _write_ to the URL — that is automatic; do not persist manually
|
|
24
|
+
|
|
25
|
+
## Basic Usage
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import { ref, watch } from "vue";
|
|
29
|
+
import { useDataTableSort, useTableQueryState, useFunctions } from "@vc-shell/framework";
|
|
30
|
+
|
|
31
|
+
const PAGE_SIZE = 20;
|
|
32
|
+
const { debounce } = useFunctions();
|
|
33
|
+
const { sortField, sortOrder, sortExpression } = useDataTableSort({
|
|
34
|
+
initialField: "createdDate",
|
|
35
|
+
initialDirection: "DESC",
|
|
36
|
+
});
|
|
37
|
+
const searchValue = ref<string>();
|
|
38
|
+
const currentPage = ref(1);
|
|
39
|
+
|
|
40
|
+
// Seed refs from the URL before the loader runs.
|
|
41
|
+
const restored = useTableQueryState("offers_list").read();
|
|
42
|
+
if (restored.sort) {
|
|
43
|
+
const [field, dir] = restored.sort.split(":");
|
|
44
|
+
sortField.value = field;
|
|
45
|
+
sortOrder.value = dir === "DESC" ? -1 : 1;
|
|
46
|
+
}
|
|
47
|
+
if (restored.search) searchValue.value = restored.search;
|
|
48
|
+
if (restored.page) currentPage.value = restored.page;
|
|
49
|
+
|
|
50
|
+
function load() {
|
|
51
|
+
return loadItems({
|
|
52
|
+
sort: sortExpression.value,
|
|
53
|
+
keyword: searchValue.value || undefined,
|
|
54
|
+
skip: (currentPage.value - 1) * PAGE_SIZE,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
load();
|
|
59
|
+
watch(searchValue, () => (currentPage.value = 1));
|
|
60
|
+
watch([sortExpression, searchValue, currentPage], debounce(load, 300));
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## API
|
|
64
|
+
|
|
65
|
+
### Parameters
|
|
66
|
+
|
|
67
|
+
| Parameter | Type | Default | Description |
|
|
68
|
+
| ---------- | --------------------- | ----------- | ------------------------------------------------------------------------- |
|
|
69
|
+
| `stateKey` | `string \| undefined` | `undefined` | The same `state-key` passed to `VcDataTable` for this table (namespacing) |
|
|
70
|
+
|
|
71
|
+
### Returns
|
|
72
|
+
|
|
73
|
+
| Property | Type | Description |
|
|
74
|
+
| -------- | ----------------------- | ------------------------------------------------------------------------------------------------------ |
|
|
75
|
+
| `read` | `() => TableQueryPatch` | Reads the restored `{ sort?, search?, page? }` from the URL. Returns `{}` when no service is available |
|
|
76
|
+
|
|
77
|
+
`TableQueryPatch`: `{ sort?: string; search?: string; page?: number }` — `sort` is a `"field:ASC"` / `"field:DESC"` expression, `page` is 1-based.
|
|
78
|
+
|
|
79
|
+
## Details
|
|
80
|
+
|
|
81
|
+
- **Read in `setup`**: `VcDataTable` does not emit restore events on init; the page reads the state and seeds its refs in `setup`. This avoids a separate load per restored field.
|
|
82
|
+
- **No-op without a service**: When no blade provides the persistence service (standalone table, non-URL blade), `read()` returns `{}`, so you can call it unconditionally.
|
|
83
|
+
- **Write-back is automatic**: View state → URL (debounced `router.replace`) is handled by `VcDataTable` via `useTableQueryPersistence`. Pages do not persist manually.
|
|
84
|
+
|
|
85
|
+
## Tips
|
|
86
|
+
|
|
87
|
+
- Call `read()` once, synchronously, before the loader. Seeding after it runs causes an extra load.
|
|
88
|
+
- Use `useDataTablePagination`'s `setPage(n)` to seed the page without firing `onPageChange`.
|
|
89
|
+
- Pass the same `state-key` you give `VcDataTable`, so the URL keys match.
|
|
90
|
+
|
|
91
|
+
## Related
|
|
92
|
+
|
|
93
|
+
- [`useDataTableSort`](../../../ui/composables/useDataTableSort.docs.md) — sort state composable for `VcDataTable`
|
|
94
|
+
- [`useDataTablePagination`](../../../ui/composables/useDataTablePagination.docs.md) — pagination state composable (`setPage` for restore seed)
|
|
95
|
+
- `VcDataTable` → _URL query persistence_ — the write-back side of this contract
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
title: useAppBarMobileButtons
|
|
3
3
|
category: composables
|
|
4
4
|
group: services
|
|
5
|
+
internal: true
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
# useAppBarMobileButtons
|
|
@@ -19,7 +20,7 @@ Manages custom action buttons in the mobile app bar. Uses provide/inject to shar
|
|
|
19
20
|
|
|
20
21
|
```vue
|
|
21
22
|
<script setup lang="ts">
|
|
22
|
-
import { useAppBarMobileButtons } from "@
|
|
23
|
+
import { useAppBarMobileButtons } from "@core/composables/useAppBarMobileButtons";
|
|
23
24
|
import { onUnmounted, computed, ref } from "vue";
|
|
24
25
|
|
|
25
26
|
const { register, unregister } = useAppBarMobileButtons();
|
|
@@ -56,6 +57,7 @@ onUnmounted(() => unregister("notifications-btn"));
|
|
|
56
57
|
| Field | Type | Required | Description |
|
|
57
58
|
| ----------- | ------------------------- | -------- | ------------------------------------------------------------------------------------------------------- |
|
|
58
59
|
| `id` | `string` | Yes | Unique identifier. Used for register/unregister/lookup. |
|
|
60
|
+
| `title` | `string` | No | Accessible name for the icon-only button (used as its `aria-label`; falls back to `id`). |
|
|
59
61
|
| `icon` | `Component \| string` | No | Icon component or CSS class string (e.g., `'fas fa-bell'`). |
|
|
60
62
|
| `component` | `Component` | No | Custom Vue component to render instead of a default icon button. |
|
|
61
63
|
| `props` | `Record<string, unknown>` | No | Props passed to the custom `component`. |
|
|
@@ -84,7 +86,7 @@ provideAppBarMobileButtonsService();
|
|
|
84
86
|
|
|
85
87
|
```vue
|
|
86
88
|
<script setup lang="ts">
|
|
87
|
-
import { useAppBarMobileButtons } from "@
|
|
89
|
+
import { useAppBarMobileButtons } from "@core/composables/useAppBarMobileButtons";
|
|
88
90
|
import { ref, computed, onUnmounted } from "vue";
|
|
89
91
|
|
|
90
92
|
const { register, unregister } = useAppBarMobileButtons();
|
|
@@ -111,7 +113,7 @@ If you need more than an icon and a click handler (e.g., a dropdown or popover),
|
|
|
111
113
|
|
|
112
114
|
```vue
|
|
113
115
|
<script setup lang="ts">
|
|
114
|
-
import { useAppBarMobileButtons } from "@
|
|
116
|
+
import { useAppBarMobileButtons } from "@core/composables/useAppBarMobileButtons";
|
|
115
117
|
import { onUnmounted, markRaw } from "vue";
|
|
116
118
|
import LanguageSwitcher from "./LanguageSwitcher.vue";
|
|
117
119
|
|
|
@@ -57,16 +57,18 @@ None.
|
|
|
57
57
|
|
|
58
58
|
### registerAppBarWidgetOptions
|
|
59
59
|
|
|
60
|
-
| Field
|
|
61
|
-
|
|
|
62
|
-
| `id`
|
|
63
|
-
| `order`
|
|
64
|
-
| `title`
|
|
65
|
-
| `icon`
|
|
66
|
-
| `component`
|
|
67
|
-
| `props`
|
|
68
|
-
| `onClick`
|
|
69
|
-
| `slot`
|
|
60
|
+
| Field | Type | Required | Description |
|
|
61
|
+
| ------------- | ---------------------------- | -------- | ------------------------------------------------------------- |
|
|
62
|
+
| `id` | `string` | No | Custom ID; auto-generated if omitted |
|
|
63
|
+
| `order` | `number` | No | Sort order in the hub Widgets list (lower = appears first) |
|
|
64
|
+
| `title` | `string` | No | Tooltip or label text |
|
|
65
|
+
| `icon` | `Component \| string` | No | Lucide icon name or a Vue component |
|
|
66
|
+
| `component` | `Component` | No | Custom Vue component to render instead of default icon button |
|
|
67
|
+
| `props` | `Record<string, unknown>` | No | Props to pass to the custom component |
|
|
68
|
+
| `onClick` | `() => void` | No | Click handler for the default icon button |
|
|
69
|
+
| `slot` | `string` | No | Named slot target for placement control |
|
|
70
|
+
| `badge` | `boolean \| (() => boolean)` | No | Show a badge indicator; pass a getter for reactive state |
|
|
71
|
+
| `searchTerms` | `string[]` | No | Extra keywords used to match the widget in hub search |
|
|
70
72
|
|
|
71
73
|
### Additional Exports
|
|
72
74
|
|
|
@@ -50,9 +50,10 @@ export default router;
|
|
|
50
50
|
|
|
51
51
|
### Injection Key
|
|
52
52
|
|
|
53
|
-
| Key
|
|
54
|
-
|
|
|
55
|
-
| `AppInsightsOptionsKey`
|
|
53
|
+
| Key | Type | Description |
|
|
54
|
+
| ------------------------ | ------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
|
|
55
|
+
| `AppInsightsOptionsKey` | `InjectionKey<AppInsightsPluginOptions>` | Optional. Provide this at app level with `{ appName: 'Operations Console' }` to prefix all page names. |
|
|
56
|
+
| `AppInsightsInstanceKey` | `InjectionKey<ApplicationInsights \| null>` | Carries the Application Insights instance that `useAppInsights` injects (returned as `appInsights`). |
|
|
56
57
|
|
|
57
58
|
## How It Works
|
|
58
59
|
|
|
@@ -72,7 +73,8 @@ import { useAppInsights } from "@vc-shell/framework";
|
|
|
72
73
|
const { appInsights } = useAppInsights();
|
|
73
74
|
|
|
74
75
|
function trackOrderPlaced(orderId: string, total: number) {
|
|
75
|
-
appInsights
|
|
76
|
+
// appInsights is null when the AI plugin is not installed
|
|
77
|
+
appInsights?.trackEvent({
|
|
76
78
|
name: "OrderPlaced",
|
|
77
79
|
properties: { orderId },
|
|
78
80
|
measurements: { orderTotal: total },
|
|
@@ -80,7 +82,7 @@ function trackOrderPlaced(orderId: string, total: number) {
|
|
|
80
82
|
}
|
|
81
83
|
|
|
82
84
|
function trackSearchPerformed(query: string, resultCount: number) {
|
|
83
|
-
appInsights
|
|
85
|
+
appInsights?.trackEvent({
|
|
84
86
|
name: "SearchPerformed",
|
|
85
87
|
properties: { query },
|
|
86
88
|
measurements: { resultCount },
|
|
@@ -6,6 +6,8 @@ group: data
|
|
|
6
6
|
|
|
7
7
|
# useAssets
|
|
8
8
|
|
|
9
|
+
> **Deprecated.** `useAssets` is deprecated in favor of [`useAssetsManager(ref, options)`](../useAssetsManager/). Calling it logs a DEV console warning. This page is kept as legacy/migration guidance; new code should use `useAssetsManager`, which wraps `useAssets` with two-way sync.
|
|
10
|
+
|
|
9
11
|
Handles file upload, removal, and editing for `ICommonAsset` arrays (images, documents, etc.). This composable encapsulates the platform's asset storage API, handling multipart form upload with batched concurrency (max 4 simultaneous uploads), sort-order assignment, URL decoding, and immutable array operations for remove and edit. It returns a new array from every operation rather than mutating in place, which plays well with Vue's reactivity system and makes undo/redo patterns straightforward.
|
|
10
12
|
|
|
11
13
|
## When to Use
|
|
@@ -32,8 +34,8 @@ async function onFilesSelected(fileList: FileList) {
|
|
|
32
34
|
assets.value = [...assets.value, ...newAssets];
|
|
33
35
|
}
|
|
34
36
|
|
|
35
|
-
function
|
|
36
|
-
assets.value = remove(toDelete, assets.value);
|
|
37
|
+
function onRemoveAsset(toDelete: ICommonAsset) {
|
|
38
|
+
assets.value = remove([toDelete], assets.value);
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
function onUpdateAltText(asset: ICommonAsset, altText: string) {
|
|
@@ -47,9 +49,9 @@ function onUpdateAltText(asset: ICommonAsset, altText: string) {
|
|
|
47
49
|
:loading="loading"
|
|
48
50
|
>
|
|
49
51
|
<VcGallery
|
|
50
|
-
:
|
|
52
|
+
:images="assets"
|
|
51
53
|
@upload="onFilesSelected"
|
|
52
|
-
@
|
|
54
|
+
@remove="onRemoveAsset"
|
|
53
55
|
/>
|
|
54
56
|
</VcBlade>
|
|
55
57
|
</template>
|
|
@@ -62,7 +64,7 @@ function onUpdateAltText(asset: ICommonAsset, altText: string) {
|
|
|
62
64
|
| Property | Type | Description |
|
|
63
65
|
| --------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
64
66
|
| `upload` | `(files: FileList, uploadPath: string, startingSortOrder?: number) => Promise<ICommonAsset[]>` | Upload files in parallel batches (max 4 concurrent). Returns only successfully uploaded assets. Sort orders are assigned incrementally from `startingSortOrder + 1`. |
|
|
65
|
-
| `remove` | `(filesToDelete: ICommonAsset[], initialAssetArr: ICommonAsset[]) => ICommonAsset[]` | Return a new array with deleted items removed. Matching is done by `url
|
|
67
|
+
| `remove` | `(filesToDelete: ICommonAsset[], initialAssetArr: ICommonAsset[]) => ICommonAsset[]` | Return a new array with deleted items removed. Matching is done by `url`. The original array is not mutated. |
|
|
66
68
|
| `edit` | `(updatedFiles: ICommonAsset[], initialAssetArr: ICommonAsset[]) => ICommonAsset[]` | Merge updated fields into existing assets (matched by `url`). If `updatedFiles.length === initialAssetArr.length`, the entire array is replaced (reorder mode). |
|
|
67
69
|
| `loading` | `ComputedRef<boolean>` | Whether an upload or remove operation is currently in progress. |
|
|
68
70
|
|
|
@@ -130,7 +132,7 @@ async function handleUpload(files: FileList) {
|
|
|
130
132
|
|
|
131
133
|
## Tips
|
|
132
134
|
|
|
133
|
-
- **Sort order starts from `startingSortOrder + 1`.** If you pass `startingSortOrder: 5` and upload 3 files, they get sort orders 6, 7, and 8. Pass `0`
|
|
135
|
+
- **Sort order starts from `startingSortOrder + 1`.** If you pass `startingSortOrder: 5` and upload 3 files, they get sort orders 6, 7, and 8. Pass `0` to start from 1. Omitting `startingSortOrder` assigns `0` to every uploaded asset (no incremental ordering).
|
|
134
136
|
- **Failed uploads are silently filtered.** If one file in a batch fails, the others still succeed. The returned array only contains successfully uploaded assets. Check the browser console for error logs from the `use-assets` logger.
|
|
135
137
|
- **`remove` matches by `url`, not by `id`.** Assets may not have stable IDs before they are saved to the server. The `url` field is used as the matching key because it is always present after upload.
|
|
136
138
|
- **Each `useAssets()` call creates an independent instance.** Unlike singleton composables, calling `useAssets()` twice gives you two separate `loading` states. This is useful if different parts of your blade upload to different paths.
|
|
@@ -58,7 +58,7 @@ const assets = useAssetsManager(ref, options);
|
|
|
58
58
|
|
|
59
59
|
```typescript
|
|
60
60
|
import { useAssetsManager } from "@vc-shell/framework";
|
|
61
|
-
import {
|
|
61
|
+
import { computed } from "vue";
|
|
62
62
|
|
|
63
63
|
const assets = useAssetsManager(
|
|
64
64
|
computed({
|
|
@@ -89,6 +89,8 @@ const assets = useAssetsManager(
|
|
|
89
89
|
Wrap a single value in a computed array:
|
|
90
90
|
|
|
91
91
|
```typescript
|
|
92
|
+
import { computed } from "vue";
|
|
93
|
+
|
|
92
94
|
const photoAssets = computed({
|
|
93
95
|
get: () => (user.value?.iconUrl ? [{ url: user.value.iconUrl }] : []),
|
|
94
96
|
set: (val) => {
|
|
@@ -81,7 +81,7 @@ type AsyncAction<Payload = void, Result = void> = (payload?: Payload, ...rest: a
|
|
|
81
81
|
|
|
82
82
|
| Property | Type | Description |
|
|
83
83
|
| --------- | --------------------------------------------- | -------------------------------------------------------------- |
|
|
84
|
-
| `loading` | `
|
|
84
|
+
| `loading` | `Readonly<Ref<boolean>>` | Reactive loading state -- `true` while the action is executing |
|
|
85
85
|
| `error` | `DeepReadonly<Ref<DisplayableError \| null>>` | Reactive error -- set on failure, cleared on next invocation |
|
|
86
86
|
| `action` | `AsyncAction<Payload, Result>` | Wrapped function with the same signature as `innerAction` |
|
|
87
87
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
title: useBladeRegistry
|
|
3
3
|
category: composables
|
|
4
4
|
group: blade-navigation
|
|
5
|
+
internal: true
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
# useBladeRegistry
|
|
@@ -26,7 +27,7 @@ Internally, the registry maintains a reactive `Map<string, IBladeRegistrationDat
|
|
|
26
27
|
## Basic Usage
|
|
27
28
|
|
|
28
29
|
```typescript
|
|
29
|
-
import { useBladeRegistry } from "@
|
|
30
|
+
import { useBladeRegistry } from "@core/composables/useBladeRegistry";
|
|
30
31
|
|
|
31
32
|
const { getBlade, getBladeComponent } = useBladeRegistry();
|
|
32
33
|
|
|
@@ -61,7 +62,8 @@ const component = getBladeComponent("OrderDetails");
|
|
|
61
62
|
|
|
62
63
|
```typescript
|
|
63
64
|
<script setup lang="ts">
|
|
64
|
-
import { useBladeRegistry
|
|
65
|
+
import { useBladeRegistry } from "@core/composables/useBladeRegistry";
|
|
66
|
+
import { useBlade } from "@vc-shell/framework";
|
|
65
67
|
|
|
66
68
|
const { getBlade } = useBladeRegistry();
|
|
67
69
|
const { openBlade } = useBlade();
|
|
@@ -80,7 +82,7 @@ function navigateTo(bladeName: string, param?: string) {
|
|
|
80
82
|
### Deep link resolution
|
|
81
83
|
|
|
82
84
|
```typescript
|
|
83
|
-
import { useBladeRegistry } from "@
|
|
85
|
+
import { useBladeRegistry } from "@core/composables/useBladeRegistry";
|
|
84
86
|
|
|
85
87
|
const { getBladeByRoute } = useBladeRegistry();
|
|
86
88
|
|
|
@@ -105,7 +107,7 @@ resolveDeepLink("/orders"); // Same result
|
|
|
105
107
|
|
|
106
108
|
```typescript
|
|
107
109
|
<script setup lang="ts">
|
|
108
|
-
import { useBladeRegistry } from "@
|
|
110
|
+
import { useBladeRegistry } from "@core/composables/useBladeRegistry";
|
|
109
111
|
|
|
110
112
|
const { registeredBladesMap } = useBladeRegistry();
|
|
111
113
|
|
|
@@ -121,7 +123,8 @@ const workspaceBlades = computed(() =>
|
|
|
121
123
|
### Checking permissions before navigation
|
|
122
124
|
|
|
123
125
|
```typescript
|
|
124
|
-
import { useBladeRegistry
|
|
126
|
+
import { useBladeRegistry } from "@core/composables/useBladeRegistry";
|
|
127
|
+
import { usePermissions } from "@vc-shell/framework";
|
|
125
128
|
|
|
126
129
|
const { getBlade } = useBladeRegistry();
|
|
127
130
|
const { hasAccess } = usePermissions();
|
|
@@ -82,17 +82,17 @@ Inline `useBladeWidgets([...])` is fine for one-off widgets, but extracting beco
|
|
|
82
82
|
|
|
83
83
|
### HeadlessWidgetDeclaration
|
|
84
84
|
|
|
85
|
-
| Field | Type
|
|
86
|
-
| ----------- |
|
|
87
|
-
| `id` | `string`
|
|
88
|
-
| `icon` | `string`
|
|
89
|
-
| `title` | `string`
|
|
90
|
-
| `badge` | `Ref<number \| string>`
|
|
91
|
-
| `loading` | `Ref<boolean>`
|
|
92
|
-
| `disabled` | `Ref<boolean> \| boolean`
|
|
93
|
-
| `isVisible` | `ComputedRef<boolean> \| boolean`
|
|
94
|
-
| `onClick` | `() => void`
|
|
95
|
-
| `onRefresh` | `() => void \| Promise<void>`
|
|
85
|
+
| Field | Type | Required | Description |
|
|
86
|
+
| ----------- | -------------------------------------------------------- | -------- | ----------------------------------------- |
|
|
87
|
+
| `id` | `string` | Yes | Unique widget identifier |
|
|
88
|
+
| `icon` | `string` | Yes | Icon name (e.g., `"lucide-tag"`) |
|
|
89
|
+
| `title` | `string` | Yes | i18n key or display title |
|
|
90
|
+
| `badge` | `Ref<number \| string> \| ComputedRef<number \| string>` | No | Badge counter value |
|
|
91
|
+
| `loading` | `Ref<boolean> \| ComputedRef<boolean>` | No | Show loading indicator |
|
|
92
|
+
| `disabled` | `Ref<boolean> \| boolean` | No | Disable the widget |
|
|
93
|
+
| `isVisible` | `ComputedRef<boolean> \| Ref<boolean> \| boolean` | No | Toggle visibility |
|
|
94
|
+
| `onClick` | `() => void` | No | Action when widget is clicked |
|
|
95
|
+
| `onRefresh` | `() => void \| Promise<void>` | No | Called by `refresh(id)` or `refreshAll()` |
|
|
96
96
|
|
|
97
97
|
### Returns
|
|
98
98
|
|
|
@@ -331,5 +331,5 @@ const { refreshAll } = useBladeWidgets([]);
|
|
|
331
331
|
|
|
332
332
|
- `WidgetService` in `framework/core/services/widget-service/` -- underlying service
|
|
333
333
|
- `WidgetScope` in `framework/ui/components/organisms/vc-blade/_internal/widgets/WidgetScope.vue` -- provides `WidgetScopeKey` to widget components
|
|
334
|
-
- `VcBladeSlot` in `framework/shell/_internal/blade-
|
|
334
|
+
- `VcBladeSlot` in `framework/shell/_internal/blade-navigation/components/vc-blade-slot/` -- provides `BladeDescriptorKey` to blade components
|
|
335
335
|
<!-- internal:end -->
|
|
@@ -81,10 +81,10 @@ push({
|
|
|
81
81
|
|
|
82
82
|
```typescript
|
|
83
83
|
<script setup lang="ts">
|
|
84
|
-
import { useBreadcrumbs,
|
|
84
|
+
import { useBreadcrumbs, useBlade } from "@vc-shell/framework";
|
|
85
85
|
|
|
86
86
|
const { push } = useBreadcrumbs();
|
|
87
|
-
const { openBlade } =
|
|
87
|
+
const { openBlade } = useBlade();
|
|
88
88
|
|
|
89
89
|
// Level 1: Catalog
|
|
90
90
|
push({
|
|
@@ -183,4 +183,4 @@ onBeforeUnmount(() => remove([crumbId]));
|
|
|
183
183
|
|
|
184
184
|
- [useBlade](../useBlade/) -- blade navigation composable
|
|
185
185
|
- [VcBlade](../../../ui/components/organisms/vc-blade/) -- blade component that displays breadcrumbs
|
|
186
|
-
- `framework/
|
|
186
|
+
- `framework/core/types/breadcrumbs.ts` -- `Breadcrumbs` interface definition
|