@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
|
@@ -21,13 +21,13 @@ The service follows the same provide/inject singleton pattern as other framework
|
|
|
21
21
|
## Basic Usage
|
|
22
22
|
|
|
23
23
|
```typescript
|
|
24
|
-
import { useAppBarWidget } from
|
|
24
|
+
import { useAppBarWidget } from "@vc-shell/framework";
|
|
25
25
|
|
|
26
26
|
const appBarService = useAppBarWidget();
|
|
27
27
|
|
|
28
28
|
const widgetId = appBarService.register({
|
|
29
|
-
icon:
|
|
30
|
-
title:
|
|
29
|
+
icon: "bell",
|
|
30
|
+
title: "Notifications",
|
|
31
31
|
order: 10,
|
|
32
32
|
onClick: () => openNotifications(),
|
|
33
33
|
});
|
|
@@ -41,29 +41,29 @@ None.
|
|
|
41
41
|
|
|
42
42
|
### Returns (`IAppBarWidgetService`)
|
|
43
43
|
|
|
44
|
-
| Property / Method | Type
|
|
45
|
-
|
|
46
|
-
| `register`
|
|
47
|
-
| `unregister`
|
|
48
|
-
| `items`
|
|
44
|
+
| Property / Method | Type | Description |
|
|
45
|
+
| ----------------- | -------------------------------------------------- | ---------------------------------------------------------- |
|
|
46
|
+
| `register` | `(options: registerAppBarWidgetOptions) => string` | Registers a widget in the app bar, returns the assigned ID |
|
|
47
|
+
| `unregister` | `(id: string) => void` | Removes a widget from the app bar by ID |
|
|
48
|
+
| `items` | `ComputedRef<AppBarWidget[]>` | Reactive list of all registered app bar widgets |
|
|
49
49
|
|
|
50
50
|
### registerAppBarWidgetOptions
|
|
51
51
|
|
|
52
|
-
| Field
|
|
53
|
-
|
|
54
|
-
| `id`
|
|
55
|
-
| `order`
|
|
56
|
-
| `title`
|
|
57
|
-
| `icon`
|
|
58
|
-
| `component` | `Component`
|
|
59
|
-
| `props`
|
|
60
|
-
| `onClick`
|
|
61
|
-
| `slot`
|
|
52
|
+
| Field | Type | Required | Description |
|
|
53
|
+
| ----------- | ------------------------- | -------- | ------------------------------------------------------------- |
|
|
54
|
+
| `id` | `string` | No | Custom ID; auto-generated if omitted |
|
|
55
|
+
| `order` | `number` | No | Sort order in the app bar (lower = further left) |
|
|
56
|
+
| `title` | `string` | No | Tooltip or label text |
|
|
57
|
+
| `icon` | `Component \| string` | No | Lucide icon name or a Vue component |
|
|
58
|
+
| `component` | `Component` | No | Custom Vue component to render instead of default icon button |
|
|
59
|
+
| `props` | `Record<string, unknown>` | No | Props to pass to the custom component |
|
|
60
|
+
| `onClick` | `() => void` | No | Click handler for the default icon button |
|
|
61
|
+
| `slot` | `string` | No | Named slot target for placement control |
|
|
62
62
|
|
|
63
63
|
### Additional Exports
|
|
64
64
|
|
|
65
|
-
| Export
|
|
66
|
-
|
|
65
|
+
| Export | Description |
|
|
66
|
+
| ----------------------- | ----------------------------------------------------------------------- |
|
|
67
67
|
| `provideAppBarWidget()` | Creates and provides the service. Flushes pre-registered items on init. |
|
|
68
68
|
|
|
69
69
|
## Common Patterns
|
|
@@ -71,14 +71,14 @@ None.
|
|
|
71
71
|
### Simple icon button widget
|
|
72
72
|
|
|
73
73
|
```typescript
|
|
74
|
-
import { useAppBarWidget } from
|
|
74
|
+
import { useAppBarWidget } from "@vc-shell/framework";
|
|
75
75
|
|
|
76
76
|
const { register, unregister } = useAppBarWidget();
|
|
77
77
|
|
|
78
78
|
// Register a simple icon button
|
|
79
79
|
const id = register({
|
|
80
|
-
icon:
|
|
81
|
-
title:
|
|
80
|
+
icon: "lucide-refresh-cw",
|
|
81
|
+
title: "Sync Data",
|
|
82
82
|
order: 5,
|
|
83
83
|
onClick: () => syncAllData(),
|
|
84
84
|
});
|
|
@@ -87,16 +87,16 @@ const id = register({
|
|
|
87
87
|
### Registering a custom component widget
|
|
88
88
|
|
|
89
89
|
```typescript
|
|
90
|
-
import { useAppBarWidget } from
|
|
91
|
-
import { markRaw, onUnmounted } from
|
|
92
|
-
import LanguagePicker from
|
|
90
|
+
import { useAppBarWidget } from "@vc-shell/framework";
|
|
91
|
+
import { markRaw, onUnmounted } from "vue";
|
|
92
|
+
import LanguagePicker from "./LanguagePicker.vue";
|
|
93
93
|
|
|
94
94
|
const { register, unregister } = useAppBarWidget();
|
|
95
95
|
|
|
96
96
|
const id = register({
|
|
97
97
|
component: markRaw(LanguagePicker),
|
|
98
98
|
order: 20,
|
|
99
|
-
title:
|
|
99
|
+
title: "Language",
|
|
100
100
|
});
|
|
101
101
|
|
|
102
102
|
onUnmounted(() => unregister(id));
|
|
@@ -105,17 +105,17 @@ onUnmounted(() => unregister(id));
|
|
|
105
105
|
### Widget with dynamic props
|
|
106
106
|
|
|
107
107
|
```typescript
|
|
108
|
-
import { useAppBarWidget } from
|
|
109
|
-
import { markRaw } from
|
|
110
|
-
import SyncStatusIndicator from
|
|
108
|
+
import { useAppBarWidget } from "@vc-shell/framework";
|
|
109
|
+
import { markRaw } from "vue";
|
|
110
|
+
import SyncStatusIndicator from "./SyncStatusIndicator.vue";
|
|
111
111
|
|
|
112
112
|
const { register } = useAppBarWidget();
|
|
113
113
|
|
|
114
114
|
register({
|
|
115
115
|
component: markRaw(SyncStatusIndicator),
|
|
116
116
|
props: {
|
|
117
|
-
status: syncStatus,
|
|
118
|
-
lastSyncTime: lastSyncAt,
|
|
117
|
+
status: syncStatus, // Can be reactive
|
|
118
|
+
lastSyncTime: lastSyncAt, // Will be passed as props to the component
|
|
119
119
|
},
|
|
120
120
|
order: 1,
|
|
121
121
|
});
|
|
@@ -124,14 +124,14 @@ register({
|
|
|
124
124
|
### Listing all registered widgets
|
|
125
125
|
|
|
126
126
|
```typescript
|
|
127
|
-
import { useAppBarWidget } from
|
|
127
|
+
import { useAppBarWidget } from "@vc-shell/framework";
|
|
128
128
|
|
|
129
129
|
const { items } = useAppBarWidget();
|
|
130
130
|
|
|
131
131
|
// Iterate over all widgets (sorted by order)
|
|
132
132
|
watchEffect(() => {
|
|
133
133
|
console.log(`${items.value.length} widgets in app bar`);
|
|
134
|
-
items.value.forEach(w => console.log(` - ${w.title ?? w.id}`));
|
|
134
|
+
items.value.forEach((w) => console.log(` - ${w.title ?? w.id}`));
|
|
135
135
|
});
|
|
136
136
|
```
|
|
137
137
|
|
|
@@ -158,7 +158,7 @@ Widgets are not automatically removed when a component unmounts. If your module
|
|
|
158
158
|
```typescript
|
|
159
159
|
const { register, unregister } = useAppBarWidget();
|
|
160
160
|
|
|
161
|
-
const id = register({ icon:
|
|
161
|
+
const id = register({ icon: "lucide-bell", onClick: handleClick });
|
|
162
162
|
|
|
163
163
|
onUnmounted(() => {
|
|
164
164
|
unregister(id);
|
|
@@ -13,8 +13,8 @@ Integrates Azure Application Insights page-view tracking with Vue Router and the
|
|
|
13
13
|
The typical setup happens once in your app's router configuration:
|
|
14
14
|
|
|
15
15
|
```typescript
|
|
16
|
-
import { useAppInsights } from
|
|
17
|
-
import { createRouter, createWebHistory } from
|
|
16
|
+
import { useAppInsights } from "@vc-shell/framework";
|
|
17
|
+
import { createRouter, createWebHistory } from "vue-router";
|
|
18
18
|
|
|
19
19
|
const router = createRouter({ history: createWebHistory(), routes });
|
|
20
20
|
|
|
@@ -36,16 +36,16 @@ export default router;
|
|
|
36
36
|
|
|
37
37
|
### Returns
|
|
38
38
|
|
|
39
|
-
| Property
|
|
40
|
-
|
|
41
|
-
| `setupPageTracking.beforeEach` | `(route: { name: string }) => void`
|
|
42
|
-
| `setupPageTracking.afterEach`
|
|
43
|
-
| `appInsights`
|
|
39
|
+
| Property | Type | Description |
|
|
40
|
+
| ------------------------------ | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
|
|
41
|
+
| `setupPageTracking.beforeEach` | `(route: { name: string }) => void` | Call in router `beforeEach` to start page-view timing and generate a new trace ID |
|
|
42
|
+
| `setupPageTracking.afterEach` | `(route: { name: string; fullPath: string }) => void` | Call in router `afterEach` to stop page-view timing and flush the telemetry event |
|
|
43
|
+
| `appInsights` | `ApplicationInsights` | Raw Application Insights instance for custom telemetry (trackEvent, trackException, trackMetric, etc.) |
|
|
44
44
|
|
|
45
45
|
### Injection Key
|
|
46
46
|
|
|
47
|
-
| Key
|
|
48
|
-
|
|
47
|
+
| Key | Type | Description |
|
|
48
|
+
| ----------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------- |
|
|
49
49
|
| `AppInsightsOptionsKey` | `InjectionKey<AppInsightsPluginOptions>` | Optional. Provide this at app level with `{ appName: 'Vendor Portal' }` to prefix all page names. |
|
|
50
50
|
|
|
51
51
|
## How It Works
|
|
@@ -61,13 +61,13 @@ If `AppInsightsOptionsKey` is provided with an `appName`, page names are formatt
|
|
|
61
61
|
## Recipe: Tracking Custom Events Alongside Page Views
|
|
62
62
|
|
|
63
63
|
```typescript
|
|
64
|
-
import { useAppInsights } from
|
|
64
|
+
import { useAppInsights } from "@vc-shell/framework";
|
|
65
65
|
|
|
66
66
|
const { appInsights } = useAppInsights();
|
|
67
67
|
|
|
68
68
|
function trackOrderPlaced(orderId: string, total: number) {
|
|
69
69
|
appInsights.trackEvent({
|
|
70
|
-
name:
|
|
70
|
+
name: "OrderPlaced",
|
|
71
71
|
properties: { orderId },
|
|
72
72
|
measurements: { orderTotal: total },
|
|
73
73
|
});
|
|
@@ -75,7 +75,7 @@ function trackOrderPlaced(orderId: string, total: number) {
|
|
|
75
75
|
|
|
76
76
|
function trackSearchPerformed(query: string, resultCount: number) {
|
|
77
77
|
appInsights.trackEvent({
|
|
78
|
-
name:
|
|
78
|
+
name: "SearchPerformed",
|
|
79
79
|
properties: { query },
|
|
80
80
|
measurements: { resultCount },
|
|
81
81
|
});
|
|
@@ -87,13 +87,13 @@ function trackSearchPerformed(query: string, resultCount: number) {
|
|
|
87
87
|
In your app's entry point, provide the options so page names are prefixed:
|
|
88
88
|
|
|
89
89
|
```typescript
|
|
90
|
-
import { createApp, provide } from
|
|
91
|
-
import { AppInsightsOptionsKey } from
|
|
90
|
+
import { createApp, provide } from "vue";
|
|
91
|
+
import { AppInsightsOptionsKey } from "@vc-shell/framework";
|
|
92
92
|
|
|
93
93
|
const app = createApp(App);
|
|
94
94
|
|
|
95
95
|
app.provide(AppInsightsOptionsKey, {
|
|
96
|
-
appName:
|
|
96
|
+
appName: "Vendor Portal",
|
|
97
97
|
// ... other AppInsightsPluginOptions
|
|
98
98
|
});
|
|
99
99
|
```
|
|
@@ -13,16 +13,16 @@ Handles file upload, removal, and editing for `ICommonAsset` arrays (images, doc
|
|
|
13
13
|
|
|
14
14
|
```vue
|
|
15
15
|
<script setup lang="ts">
|
|
16
|
-
import { useAssets } from
|
|
17
|
-
import { ref } from
|
|
18
|
-
import type { ICommonAsset } from
|
|
16
|
+
import { useAssets } from "@vc-shell/framework";
|
|
17
|
+
import { ref } from "vue";
|
|
18
|
+
import type { ICommonAsset } from "@vc-shell/framework";
|
|
19
19
|
|
|
20
20
|
const { upload, remove, edit, loading } = useAssets();
|
|
21
21
|
const assets = ref<ICommonAsset[]>([]);
|
|
22
22
|
|
|
23
23
|
async function onFilesSelected(fileList: FileList) {
|
|
24
24
|
const maxSort = Math.max(0, ...assets.value.map((a) => a.sortOrder ?? 0));
|
|
25
|
-
const newAssets = await upload(fileList,
|
|
25
|
+
const newAssets = await upload(fileList, "catalog/products/images", maxSort);
|
|
26
26
|
assets.value = [...assets.value, ...newAssets];
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -36,7 +36,10 @@ function onUpdateAltText(asset: ICommonAsset, altText: string) {
|
|
|
36
36
|
</script>
|
|
37
37
|
|
|
38
38
|
<template>
|
|
39
|
-
<VcBlade
|
|
39
|
+
<VcBlade
|
|
40
|
+
title="Product Images"
|
|
41
|
+
:loading="loading"
|
|
42
|
+
>
|
|
40
43
|
<VcGallery
|
|
41
44
|
:assets="assets"
|
|
42
45
|
@upload="onFilesSelected"
|
|
@@ -50,12 +53,12 @@ function onUpdateAltText(asset: ICommonAsset, altText: string) {
|
|
|
50
53
|
|
|
51
54
|
### Returns
|
|
52
55
|
|
|
53
|
-
| Property
|
|
54
|
-
|
|
55
|
-
| `upload`
|
|
56
|
-
| `remove`
|
|
57
|
-
| `edit`
|
|
58
|
-
| `loading` | `ComputedRef<boolean>`
|
|
56
|
+
| Property | Type | Description |
|
|
57
|
+
| --------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
58
|
+
| `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`. |
|
|
59
|
+
| `remove` | `(filesToDelete: ICommonAsset[], initialAssetArr: ICommonAsset[]) => ICommonAsset[]` | Return a new array with deleted items removed. Matching is done by `url` field. The original array is not mutated. |
|
|
60
|
+
| `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). |
|
|
61
|
+
| `loading` | `ComputedRef<boolean>` | Whether an upload or remove operation is currently in progress. |
|
|
59
62
|
|
|
60
63
|
## How It Works
|
|
61
64
|
|
|
@@ -74,7 +77,7 @@ Both `remove` and `edit` use `lodash-es` `cloneDeep` to create a new array, so t
|
|
|
74
77
|
## Recipe: Drag-and-Drop Reorder with Sort Order Update
|
|
75
78
|
|
|
76
79
|
```typescript
|
|
77
|
-
import { useAssets } from
|
|
80
|
+
import { useAssets } from "@vc-shell/framework";
|
|
78
81
|
|
|
79
82
|
const { edit } = useAssets();
|
|
80
83
|
const assets = ref<ICommonAsset[]>([]);
|
|
@@ -95,25 +98,25 @@ function onDragEnd(reorderedList: ICommonAsset[]) {
|
|
|
95
98
|
|
|
96
99
|
```vue
|
|
97
100
|
<script setup lang="ts">
|
|
98
|
-
import { useAssets } from
|
|
99
|
-
import { ref, watch } from
|
|
101
|
+
import { useAssets } from "@vc-shell/framework";
|
|
102
|
+
import { ref, watch } from "vue";
|
|
100
103
|
|
|
101
104
|
const { upload, loading } = useAssets();
|
|
102
105
|
const assets = ref<ICommonAsset[]>([]);
|
|
103
|
-
const statusMessage = ref(
|
|
106
|
+
const statusMessage = ref("");
|
|
104
107
|
|
|
105
108
|
watch(loading, (isLoading) => {
|
|
106
|
-
statusMessage.value = isLoading ?
|
|
109
|
+
statusMessage.value = isLoading ? "Uploading files..." : "";
|
|
107
110
|
});
|
|
108
111
|
|
|
109
112
|
async function handleUpload(files: FileList) {
|
|
110
113
|
statusMessage.value = `Uploading ${files.length} file(s)...`;
|
|
111
114
|
try {
|
|
112
|
-
const uploaded = await upload(files,
|
|
115
|
+
const uploaded = await upload(files, "catalog/products/images");
|
|
113
116
|
assets.value = [...assets.value, ...uploaded];
|
|
114
117
|
statusMessage.value = `Successfully uploaded ${uploaded.length} file(s)`;
|
|
115
118
|
} catch (err) {
|
|
116
|
-
statusMessage.value =
|
|
119
|
+
statusMessage.value = "Upload failed. Please try again.";
|
|
117
120
|
}
|
|
118
121
|
}
|
|
119
122
|
</script>
|
|
@@ -20,31 +20,31 @@ const assets = useAssetsManager(ref, options);
|
|
|
20
20
|
|
|
21
21
|
### Parameters
|
|
22
22
|
|
|
23
|
-
| Parameter | Type
|
|
24
|
-
|
|
25
|
-
| `source`
|
|
26
|
-
| `options` | `UseAssetsManagerOptions`
|
|
23
|
+
| Parameter | Type | Description |
|
|
24
|
+
| --------- | --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
25
|
+
| `source` | `Ref<AssetLike[] \| undefined \| null>` | Reactive ref to the asset array. Accepts `ref()`, `toRef()`, or `computed({ get, set })`. `undefined`/`null` values are treated as empty array. The composable holds an internal copy and syncs both ways. |
|
|
26
|
+
| `options` | `UseAssetsManagerOptions` | Configuration (see below) |
|
|
27
27
|
|
|
28
28
|
### Options
|
|
29
29
|
|
|
30
|
-
| Option
|
|
31
|
-
|
|
32
|
-
| `uploadPath`
|
|
33
|
-
| `confirmRemove` | `() => Promise<boolean> \| boolean` | No
|
|
34
|
-
| `assetKey`
|
|
35
|
-
| `concurrency`
|
|
30
|
+
| Option | Type | Required | Description |
|
|
31
|
+
| --------------- | ----------------------------------- | -------- | ----------------------------------------------------------------------- |
|
|
32
|
+
| `uploadPath` | `() => string` | Yes | Upload destination path (function — evaluated at upload time) |
|
|
33
|
+
| `confirmRemove` | `() => Promise<boolean> \| boolean` | No | Called before remove. Return `false` to cancel. Omit for silent remove. |
|
|
34
|
+
| `assetKey` | `string` | No | Key for matching items (default: `"url"`) |
|
|
35
|
+
| `concurrency` | `number` | No | Max concurrent uploads (default: 4) |
|
|
36
36
|
|
|
37
37
|
### Return (`UseAssetsManagerReturn`)
|
|
38
38
|
|
|
39
|
-
| Property
|
|
40
|
-
|
|
41
|
-
| `items`
|
|
42
|
-
| `upload`
|
|
43
|
-
| `remove`
|
|
44
|
-
| `removeMany` | `(items: AssetLike[]) => Promise<void>`
|
|
45
|
-
| `reorder`
|
|
46
|
-
| `updateItem` | `(item: AssetLike) => void`
|
|
47
|
-
| `loading`
|
|
39
|
+
| Property | Type | Description |
|
|
40
|
+
| ------------ | ---------------------------------------------------------------- | -------------------------------------------------------------- |
|
|
41
|
+
| `items` | `Ref<AssetLike[]>` | Reactive asset array (internal ref, safe to bind to templates) |
|
|
42
|
+
| `upload` | `(files: FileList, startingSortOrder?: number) => Promise<void>` | Upload files, append to array |
|
|
43
|
+
| `remove` | `(item: AssetLike) => Promise<void>` | Remove single item (with confirmation if configured) |
|
|
44
|
+
| `removeMany` | `(items: AssetLike[]) => Promise<void>` | Remove multiple items (one confirmation for batch) |
|
|
45
|
+
| `reorder` | `(items: AssetLike[]) => void` | Replace array with new order |
|
|
46
|
+
| `updateItem` | `(item: AssetLike) => void` | Update single item metadata by `assetKey` |
|
|
47
|
+
| `loading` | `ComputedRef<boolean>` | True during upload |
|
|
48
48
|
|
|
49
49
|
## Usage Examples
|
|
50
50
|
|
|
@@ -56,12 +56,14 @@ import { toRef } from "vue";
|
|
|
56
56
|
|
|
57
57
|
const assets = useAssetsManager(
|
|
58
58
|
computed({
|
|
59
|
-
get: () =>
|
|
60
|
-
set: (val) => {
|
|
59
|
+
get: () => entity.value.images ?? [],
|
|
60
|
+
set: (val) => {
|
|
61
|
+
entity.value.images = val;
|
|
62
|
+
},
|
|
61
63
|
}),
|
|
62
64
|
{
|
|
63
|
-
uploadPath: () => `
|
|
64
|
-
confirmRemove: () => showConfirmation(t("
|
|
65
|
+
uploadPath: () => `entities/${entity.value?.id ?? "new"}`,
|
|
66
|
+
confirmRemove: () => showConfirmation(t("MODULE.ALERTS.IMAGE_DELETE")),
|
|
65
67
|
},
|
|
66
68
|
);
|
|
67
69
|
```
|
|
@@ -82,8 +84,10 @@ Wrap a single value in a computed array:
|
|
|
82
84
|
|
|
83
85
|
```typescript
|
|
84
86
|
const photoAssets = computed({
|
|
85
|
-
get: () => user.value?.iconUrl ? [{ url: user.value.iconUrl }] : [],
|
|
86
|
-
set: (val) => {
|
|
87
|
+
get: () => (user.value?.iconUrl ? [{ url: user.value.iconUrl }] : []),
|
|
88
|
+
set: (val) => {
|
|
89
|
+
user.value!.iconUrl = val[0]?.url;
|
|
90
|
+
},
|
|
87
91
|
});
|
|
88
92
|
|
|
89
93
|
const photo = useAssetsManager(photoAssets, {
|
|
@@ -109,7 +113,7 @@ const assets = useAssetsManager(productAssetsRef, {
|
|
|
109
113
|
openBlade({
|
|
110
114
|
name: "AssetsManager",
|
|
111
115
|
options: {
|
|
112
|
-
manager: markRaw(assets),
|
|
116
|
+
manager: markRaw(assets), // IMPORTANT: prevents reactive proxy unwrap
|
|
113
117
|
disabled: !canEdit.value,
|
|
114
118
|
},
|
|
115
119
|
});
|
|
@@ -137,7 +141,7 @@ interface AssetLike {
|
|
|
137
141
|
url?: string;
|
|
138
142
|
name?: string;
|
|
139
143
|
sortOrder?: number;
|
|
140
|
-
[key: string]: any;
|
|
144
|
+
[key: string]: any; // compatible with Image, ProductImage, Asset, etc.
|
|
141
145
|
}
|
|
142
146
|
```
|
|
143
147
|
|