@vc-shell/vc-app-skill 2.0.3 → 2.0.4
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 +4 -0
- package/package.json +1 -1
- package/runtime/VERSION +1 -1
- package/runtime/knowledge/docs/_BUILD_HASH.md +1 -1
- package/runtime/knowledge/docs/core/api/platform.docs.md +7 -0
- package/runtime/knowledge/docs/core/blade-navigation/blade-nav-composables.docs.md +20 -4
- package/runtime/knowledge/docs/core/composables/bladeContext/index.docs.md +15 -3
- package/runtime/knowledge/docs/core/composables/useApiClient/useApiClient.docs.md +13 -4
- package/runtime/knowledge/docs/core/composables/useAppBarMobileButtons/useAppBarMobileButtons.docs.md +10 -0
- package/runtime/knowledge/docs/core/composables/useAppBarWidget/useAppBarWidget.docs.md +6 -0
- package/runtime/knowledge/docs/core/composables/useAppInsights/useAppInsights.docs.md +6 -0
- package/runtime/knowledge/docs/core/composables/useAssets/useAssets.docs.md +8 -1
- package/runtime/knowledge/docs/core/composables/useAssetsManager/useAssetsManager.docs.md +15 -4
- package/runtime/knowledge/docs/core/composables/useAsync/useAsync.docs.md +13 -0
- package/runtime/knowledge/docs/core/composables/useBeforeUnload/useBeforeUnload.docs.md +6 -0
- package/runtime/knowledge/docs/core/composables/useBlade/useBlade.docs.md +13 -0
- package/runtime/knowledge/docs/core/composables/useBladeForm/useBladeForm.docs.md +12 -2
- package/runtime/knowledge/docs/core/composables/useBladeRegistry/useBladeRegistry.docs.md +14 -4
- package/runtime/knowledge/docs/core/composables/useBladeWidgets/index.docs.md +23 -9
- package/runtime/knowledge/docs/core/composables/useBreadcrumbs/useBreadcrumbs.docs.md +6 -0
- package/runtime/knowledge/docs/core/composables/useConnectionStatus/useConnectionStatus.docs.md +10 -0
- package/runtime/knowledge/docs/core/composables/useDashboard/useDashboard.docs.md +9 -0
- package/runtime/knowledge/docs/core/composables/useDynamicProperties/useDynamicProperties.docs.md +6 -0
- package/runtime/knowledge/docs/core/composables/useErrorHandler/useErrorHandler.docs.md +6 -0
- package/runtime/knowledge/docs/core/composables/useFunctions/useFunctions.docs.md +6 -0
- package/runtime/knowledge/docs/core/composables/useKeyboardNavigation/useKeyboardNavigation.docs.md +10 -0
- package/runtime/knowledge/docs/core/composables/useLanguages/useLanguages.docs.md +6 -0
- package/runtime/knowledge/docs/core/composables/useLoading/useLoading.docs.md +10 -0
- package/runtime/knowledge/docs/core/composables/useMenuExpanded/index.docs.md +10 -0
- package/runtime/knowledge/docs/core/composables/useMenuService/useMenuService.docs.md +9 -0
- package/runtime/knowledge/docs/core/composables/useModificationTracker/useModificationTracker.docs.md +6 -0
- package/runtime/knowledge/docs/core/composables/useNotifications/useNotifications.docs.md +6 -0
- package/runtime/knowledge/docs/core/composables/usePermissions/usePermissions.docs.md +9 -0
- package/runtime/knowledge/docs/core/composables/usePlatformLocaleSync/usePlatformLocaleSync.docs.md +6 -0
- package/runtime/knowledge/docs/core/composables/usePopup/usePopup.docs.md +9 -0
- package/runtime/knowledge/docs/core/composables/useResponsive/useResponsive.docs.md +10 -0
- package/runtime/knowledge/docs/core/composables/useSettings/useSettings.docs.md +6 -0
- package/runtime/knowledge/docs/core/composables/useSettingsMenu/useSettingsMenu.docs.md +6 -0
- package/runtime/knowledge/docs/core/composables/useSidebarState/useSidebarState.docs.md +10 -0
- package/runtime/knowledge/docs/core/composables/useSlowNetworkDetection/useSlowNetworkDetection.docs.md +9 -0
- package/runtime/knowledge/docs/core/composables/useTheme/useTheme.docs.md +9 -0
- package/runtime/knowledge/docs/core/composables/useToolbar/useToolbar.docs.md +9 -0
- package/runtime/knowledge/docs/core/composables/useUser/useUser.docs.md +6 -0
- package/runtime/knowledge/docs/core/composables/useUserManagement/useUserManagement.docs.md +7 -0
- package/runtime/knowledge/docs/core/composables/useWebVitals/useWebVitals.docs.md +6 -0
- package/runtime/knowledge/docs/core/composables/useWidgets/useWidgets.docs.md +10 -0
- package/runtime/knowledge/docs/core/directives/autofocus/autofocus.docs.md +7 -0
- package/runtime/knowledge/docs/core/directives/loading/loading.docs.md +7 -0
- package/runtime/knowledge/docs/core/notifications/notifications.docs.md +21 -0
- package/runtime/knowledge/docs/core/plugins/ai-agent/ai-agent.docs.md +7 -0
- package/runtime/knowledge/docs/core/plugins/extension-points/extension-points.docs.md +10 -0
- package/runtime/knowledge/docs/core/plugins/global-error-handler/global-error-handler.docs.md +7 -0
- package/runtime/knowledge/docs/core/plugins/i18n/i18n.docs.md +10 -0
- package/runtime/knowledge/docs/core/plugins/modularity/modularity.docs.md +10 -0
- package/runtime/knowledge/docs/core/plugins/permissions/permissions.docs.md +8 -1
- package/runtime/knowledge/docs/core/plugins/signalR/signalR.docs.md +7 -0
- package/runtime/knowledge/docs/core/plugins/validation/validation.docs.md +10 -0
- package/runtime/knowledge/docs/core/services/services.docs.md +16 -1
- package/runtime/knowledge/docs/core/types/types.docs.md +7 -0
- package/runtime/knowledge/docs/core/utilities/date/date-utilities.docs.md +7 -0
- package/runtime/knowledge/docs/core/utilities/shared-utilities.docs.md +7 -0
- package/runtime/knowledge/docs/core/utilities/thumbnail/thumbnail.docs.md +7 -0
- package/runtime/knowledge/docs/core/utilities/utilities.docs.md +7 -0
- package/runtime/knowledge/docs/injection-keys.docs.md +11 -0
- package/runtime/knowledge/docs/modules/assets/assets-details.docs.md +123 -0
- package/runtime/knowledge/docs/modules/assets-manager/assets-manager.docs.md +89 -12
- package/runtime/knowledge/docs/shell/_internal/popup/common/popup-common.docs.md +7 -0
- package/runtime/knowledge/docs/shell/auth/ChangePasswordPage/change-password-page.docs.md +7 -0
- package/runtime/knowledge/docs/shell/auth/ForgotPasswordPage/forgot-password-page.docs.md +7 -0
- package/runtime/knowledge/docs/shell/auth/InvitePage/invite-page.docs.md +7 -0
- package/runtime/knowledge/docs/shell/auth/LoginPage/login-page.docs.md +7 -0
- package/runtime/knowledge/docs/shell/auth/ResetPasswordPage/reset-password-page.docs.md +7 -0
- package/runtime/knowledge/docs/shell/auth/sign-in/sign-in.docs.md +7 -0
- package/runtime/knowledge/docs/shell/components/change-password/change-password.docs.md +7 -0
- package/runtime/knowledge/docs/shell/components/change-password-button/change-password-button.docs.md +7 -0
- package/runtime/knowledge/docs/shell/components/error-interceptor/error-interceptor.docs.md +7 -0
- package/runtime/knowledge/docs/shell/components/language-selector/language-selector.docs.md +7 -0
- package/runtime/knowledge/docs/shell/components/logout-button/logout-button.docs.md +7 -0
- package/runtime/knowledge/docs/shell/components/notification-dropdown/notification-dropdown.docs.md +7 -0
- package/runtime/knowledge/docs/shell/components/notification-template/notification-template.docs.md +7 -0
- package/runtime/knowledge/docs/shell/components/settings-menu/settings-menu.docs.md +7 -0
- package/runtime/knowledge/docs/shell/components/settings-menu-item/settings-menu-item.docs.md +7 -0
- package/runtime/knowledge/docs/shell/components/sidebar/sidebar.docs.md +7 -0
- package/runtime/knowledge/docs/shell/components/theme-selector/theme-selector.docs.md +7 -0
- package/runtime/knowledge/docs/shell/components/user-dropdown-button/user-dropdown-button.docs.md +7 -0
- package/runtime/knowledge/docs/shell/dashboard/dashboard-charts/dashboard-charts.docs.md +7 -0
- package/runtime/knowledge/docs/shell/dashboard/dashboard-widget-card/dashboard-widget-card.docs.md +7 -0
- package/runtime/knowledge/docs/shell/dashboard/draggable-dashboard/dashboard-widget-skeleton.docs.md +7 -0
- package/runtime/knowledge/docs/shell/dashboard/draggable-dashboard/draggable-dashboard.docs.md +7 -0
- package/runtime/knowledge/docs/ui/components/atoms/vc-badge/vc-badge.docs.md +24 -0
- package/runtime/knowledge/docs/ui/components/atoms/vc-banner/vc-banner.docs.md +20 -0
- package/runtime/knowledge/docs/ui/components/atoms/vc-button/vc-button.docs.md +32 -5
- package/runtime/knowledge/docs/ui/components/atoms/vc-card/vc-card.docs.md +15 -2
- package/runtime/knowledge/docs/ui/components/atoms/vc-col/vc-col.docs.md +11 -1
- package/runtime/knowledge/docs/ui/components/atoms/vc-container/vc-container.docs.md +10 -0
- package/runtime/knowledge/docs/ui/components/atoms/vc-hint/vc-hint.docs.md +20 -0
- package/runtime/knowledge/docs/ui/components/atoms/vc-icon/vc-icon.docs.md +24 -0
- package/runtime/knowledge/docs/ui/components/atoms/vc-image/vc-image.docs.md +26 -0
- package/runtime/knowledge/docs/ui/components/atoms/vc-label/vc-label.docs.md +24 -0
- package/runtime/knowledge/docs/ui/components/atoms/vc-link/vc-link.docs.md +22 -0
- package/runtime/knowledge/docs/ui/components/atoms/vc-loading/vc-loading.docs.md +21 -0
- package/runtime/knowledge/docs/ui/components/atoms/vc-progress/vc-progress.docs.md +20 -0
- package/runtime/knowledge/docs/ui/components/atoms/vc-row/vc-row.docs.md +11 -1
- package/runtime/knowledge/docs/ui/components/atoms/vc-scrollable-container/vc-scrollable-container.docs.md +11 -1
- package/runtime/knowledge/docs/ui/components/atoms/vc-skeleton/vc-skeleton.docs.md +20 -0
- package/runtime/knowledge/docs/ui/components/atoms/vc-status/vc-status.docs.md +20 -0
- package/runtime/knowledge/docs/ui/components/atoms/vc-status-icon/vc-status-icon.docs.md +20 -0
- package/runtime/knowledge/docs/ui/components/atoms/vc-tooltip/vc-tooltip.docs.md +25 -1
- package/runtime/knowledge/docs/ui/components/atoms/vc-video/vc-video.docs.md +25 -0
- package/runtime/knowledge/docs/ui/components/atoms/vc-widget/vc-widget.docs.md +22 -0
- package/runtime/knowledge/docs/ui/components/molecules/multilanguage-selector/multilanguage-selector.docs.md +10 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-accordion/vc-accordion.docs.md +17 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.docs.md +27 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-checkbox/vc-checkbox.docs.md +27 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-checkbox-group/vc-checkbox-group.docs.md +23 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-color-input/vc-color-input.docs.md +24 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-date-picker/vc-date-picker.docs.md +27 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-dropdown/vc-dropdown.docs.md +27 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-dropdown-panel/vc-dropdown-panel.docs.md +22 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-editor/vc-editor.docs.md +17 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-field/vc-field.docs.md +17 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-file-upload/vc-file-upload.docs.md +17 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-form/vc-form.docs.md +15 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-image-tile/vc-image-tile.docs.md +12 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-input/vc-input.docs.md +30 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-currency/vc-input-currency.docs.md +27 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.docs.md +26 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-group/vc-input-group.docs.md +21 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-menu/vc-menu.docs.md +24 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-multivalue/vc-multivalue.docs.md +28 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-pagination/vc-pagination.docs.md +25 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-radio-button/vc-radio-button.docs.md +25 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-radio-group/vc-radio-group.docs.md +22 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-rating/vc-rating.docs.md +17 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-select/vc-select.docs.md +32 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-slider/vc-slider.docs.md +22 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-switch/vc-switch.docs.md +25 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-textarea/vc-textarea.docs.md +27 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-toast/vc-toast.docs.md +28 -0
- package/runtime/knowledge/docs/ui/components/organisms/vc-app/vc-app.docs.md +19 -0
- package/runtime/knowledge/docs/ui/components/organisms/vc-auth-layout/vc-auth-layout.docs.md +13 -0
- package/runtime/knowledge/docs/ui/components/organisms/vc-blade/vc-blade.docs.md +22 -1
- package/runtime/knowledge/docs/ui/components/organisms/vc-data-table/composables/table-composables.docs.md +30 -5
- package/runtime/knowledge/docs/ui/components/organisms/vc-data-table/vc-data-table.docs.md +18 -0
- package/runtime/knowledge/docs/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.docs.md +12 -0
- package/runtime/knowledge/docs/ui/components/organisms/vc-gallery/vc-gallery.docs.md +14 -0
- package/runtime/knowledge/docs/ui/components/organisms/vc-image-upload/vc-image-upload.docs.md +12 -0
- package/runtime/knowledge/docs/ui/components/organisms/vc-popup/vc-popup.docs.md +14 -1
- package/runtime/knowledge/docs/ui/components/organisms/vc-sidebar/vc-sidebar.docs.md +13 -0
- package/runtime/knowledge/docs/ui/composables/ui-composables.docs.md +7 -0
- package/runtime/knowledge/docs/ui/composables/useDataTablePagination.docs.md +9 -3
- package/runtime/knowledge/docs/ui/composables/useDataTableSort.docs.md +6 -0
- package/runtime/knowledge/docs/ui/composables/useTableSelection.docs.md +6 -0
- package/runtime/knowledge/docs/ui/composables/useTableSort.docs.md +6 -0
- package/runtime/knowledge/docs/ui/types/ui-types.docs.md +7 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Assets Module
|
|
3
|
+
category: reference
|
|
4
|
+
group: modules
|
|
5
|
+
slug: assets
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Assets Details Module
|
|
9
|
+
|
|
10
|
+
A built-in child blade for editing a single asset's metadata: display name, alt text (images only), and description. Opened by `AssetsManager` when the user clicks a table row, but also usable standalone from any parent blade that needs single-asset editing.
|
|
11
|
+
|
|
12
|
+
## Overview
|
|
13
|
+
|
|
14
|
+
The blade reads an `AssetLike` instance from `options.asset`, exposes a form pre-populated from it, and delegates persistence back to the caller through two callbacks (`assetEditHandler`, `assetRemoveHandler`). The blade itself never mutates the original asset and never talks to the network — the caller decides what saving and removing means.
|
|
15
|
+
|
|
16
|
+
The module is registered as `AssetsDetailsModule` and exposes the `AssetsDetails` blade (registered globally under the name `"AssetsDetails"`).
|
|
17
|
+
|
|
18
|
+
## Module Registration
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import { AssetsDetailsModule } from "@vc-shell/framework";
|
|
22
|
+
|
|
23
|
+
// Registered automatically when the framework loads
|
|
24
|
+
// Exposes: AssetsDetails blade component
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Options (via `useBlade`)
|
|
28
|
+
|
|
29
|
+
The blade reads its configuration from `options` via `useBlade<AssetsDetailsOptions>()` (not props):
|
|
30
|
+
|
|
31
|
+
| Option | Type | Description |
|
|
32
|
+
| -------------------- | --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
33
|
+
| `asset` | `AssetLike` | The asset to edit. The blade clones it into local state — the source object is never mutated until `assetEditHandler` is called. |
|
|
34
|
+
| `disabled` | `boolean?` | When true, every input is read-only and the toolbar Save/Delete buttons are disabled. |
|
|
35
|
+
| `hiddenFields` | `string[]?` | Field names to hide. Supported values: `"name"`, `"altText"`, `"description"`. The header (preview, size, created date, URL) is always shown. |
|
|
36
|
+
| `assetEditHandler` | `(asset: AssetLike) => void \| Promise<void>` | Called by the toolbar Save button with the edited copy. The blade closes itself after the handler resolves. |
|
|
37
|
+
| `assetRemoveHandler` | `(asset: AssetLike) => Promise<void>` | Called by the toolbar Delete button. The blade closes itself after the handler resolves. |
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
### Direct invocation
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
import { useBlade } from "@vc-shell/framework";
|
|
45
|
+
|
|
46
|
+
const { openBlade } = useBlade();
|
|
47
|
+
|
|
48
|
+
openBlade({
|
|
49
|
+
name: "AssetsDetails",
|
|
50
|
+
options: {
|
|
51
|
+
asset: selectedAsset,
|
|
52
|
+
disabled: !canEdit.value,
|
|
53
|
+
hiddenFields: ["altText"],
|
|
54
|
+
assetEditHandler: async (edited) => {
|
|
55
|
+
await api.updateAsset(edited);
|
|
56
|
+
},
|
|
57
|
+
assetRemoveHandler: async (asset) => {
|
|
58
|
+
await api.deleteAsset(asset.id);
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Used by AssetsManager
|
|
65
|
+
|
|
66
|
+
When `AssetsManager` opens this blade on row click, it wires the manager's mutation methods into the handlers automatically:
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
// inside AssetsManager
|
|
70
|
+
openBlade({
|
|
71
|
+
name: "AssetsDetails",
|
|
72
|
+
options: {
|
|
73
|
+
asset,
|
|
74
|
+
disabled: readonly.value,
|
|
75
|
+
hiddenFields: options.value?.hiddenFields,
|
|
76
|
+
assetEditHandler: (asset) => manager.updateItem(asset),
|
|
77
|
+
assetRemoveHandler: (asset) => manager.remove(asset),
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Header
|
|
83
|
+
|
|
84
|
+
The header is always rendered above the editable form and is not configurable through `hiddenFields`:
|
|
85
|
+
|
|
86
|
+
| Element | Source |
|
|
87
|
+
| ------------ | -------------------------------------------------------------------------------------------------- |
|
|
88
|
+
| Preview | `VcImage` thumbnail for image extensions (png/jpg/jpeg/svg/gif), colored extension badge otherwise |
|
|
89
|
+
| Size | `readableSize(asset.size)` — formatted as `KB`/`MB`/`GB` |
|
|
90
|
+
| Created date | `asset.createdDate` rendered with `type="date-ago"` |
|
|
91
|
+
| URL | `asset.url` displayed as a copyable link with `asset.name` as the visible label |
|
|
92
|
+
|
|
93
|
+
## Form fields
|
|
94
|
+
|
|
95
|
+
All fields are bound to a local clone of `asset`. They can be hidden individually via `hiddenFields`.
|
|
96
|
+
|
|
97
|
+
| Field | Visibility | Notes |
|
|
98
|
+
| ------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
|
99
|
+
| `name` | Hidden if `hiddenFields` includes `"name"` | Required. Edits the **base name only** — the original extension is preserved on save (e.g. editing `report.pdf` keeps `.pdf`). |
|
|
100
|
+
| `altText` | Image assets only; hide via `"altText"` | Plain string. Shown only when `asset.typeId === "Image"`. |
|
|
101
|
+
| `description` | Hidden if `hiddenFields` includes `"description"` | Multiline textarea. |
|
|
102
|
+
|
|
103
|
+
## Toolbar
|
|
104
|
+
|
|
105
|
+
| Button | Disabled condition | Action |
|
|
106
|
+
| ------ | ------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
|
|
107
|
+
| Save | `disabled === true`, the form is invalid, or the form is not dirty (vee-validate `useIsFormValid`/`useIsFormDirty`) | `await assetEditHandler(editedAsset)`, then `closeSelf()` |
|
|
108
|
+
| Delete | `disabled === true` | `await assetRemoveHandler(editedAsset)`, then `closeSelf()` |
|
|
109
|
+
|
|
110
|
+
## Tips
|
|
111
|
+
|
|
112
|
+
- **Extension is locked.** The `name` input only edits the base name; the original extension is reattached on save. Renaming `photo.png` to `cover` produces `cover.png`.
|
|
113
|
+
- **Required name validation** uses vee-validate's `required` rule. The Save button stays disabled until validation passes.
|
|
114
|
+
- **`assetEditHandler`** is invoked with the edited clone — the original `options.asset` reference is never mutated. Callers should treat the argument as the new state.
|
|
115
|
+
- **`disabled` makes the blade fully read-only:** inputs are disabled and toolbar Save/Delete are disabled regardless of dirtiness.
|
|
116
|
+
- **`hiddenFields` does not enforce required-ness.** Hiding `"name"` skips the validated `<Field>`, so the Save button only depends on form dirtiness.
|
|
117
|
+
|
|
118
|
+
## Related
|
|
119
|
+
|
|
120
|
+
- `framework/modules/assets-manager/` -- parent `AssetsManager` blade that opens `AssetsDetails` on row click
|
|
121
|
+
- `framework/core/composables/useAssetsManager/` -- `AssetLike` type definition
|
|
122
|
+
- `framework/core/utilities/assets.ts` -- `isImage`, `readableSize`, `getExtensionColor`, `getExtensionLabel`
|
|
123
|
+
- `framework/ui/components/molecules/vc-field/` -- `VcField` used by the header for size/date/url
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Assets Manager
|
|
3
|
+
category: reference
|
|
4
|
+
group: modules
|
|
5
|
+
slug: assets-manager
|
|
6
|
+
---
|
|
7
|
+
|
|
1
8
|
# Assets Manager Module
|
|
2
9
|
|
|
3
10
|
A built-in blade module for managing file assets (images, documents, archives). Provides upload, delete, reorder, and preview functionality via a table-based UI.
|
|
@@ -32,17 +39,27 @@ The blade reads its configuration from `options` via `useBlade<AssetsManagerOpti
|
|
|
32
39
|
|
|
33
40
|
## Usage
|
|
34
41
|
|
|
35
|
-
|
|
42
|
+
The canonical pattern is to bind the manager to a writable `computed` over a field of the parent entity, so that uploads/removes/reorders propagate back into the form. `confirmRemove` is wired to the framework's popup service rather than `window.confirm`.
|
|
36
43
|
|
|
37
44
|
```typescript
|
|
38
|
-
import { markRaw } from "vue";
|
|
39
|
-
import { useBlade, useAssetsManager } from "@vc-shell/framework";
|
|
45
|
+
import { computed, markRaw } from "vue";
|
|
46
|
+
import { useBlade, useAssetsManager, usePopup } from "@vc-shell/framework";
|
|
40
47
|
|
|
41
48
|
const { openBlade } = useBlade();
|
|
49
|
+
const { showConfirmation } = usePopup();
|
|
50
|
+
|
|
51
|
+
// Two-way binding: the manager mutates `productAssets.value`, which writes
|
|
52
|
+
// straight back to `item.value.productData.assets`.
|
|
53
|
+
const productAssets = computed({
|
|
54
|
+
get: () => item.value?.productData?.assets ?? [],
|
|
55
|
+
set: (val) => {
|
|
56
|
+
if (item.value?.productData) item.value.productData.assets = val;
|
|
57
|
+
},
|
|
58
|
+
});
|
|
42
59
|
|
|
43
|
-
const assetsManager = useAssetsManager(
|
|
44
|
-
uploadPath: () => `/catalog/${
|
|
45
|
-
confirmRemove: () =>
|
|
60
|
+
const assetsManager = useAssetsManager(productAssets, {
|
|
61
|
+
uploadPath: () => `/catalog/${item.value?.id}`,
|
|
62
|
+
confirmRemove: () => showConfirmation("Are you sure you want to delete the selected assets?"),
|
|
46
63
|
});
|
|
47
64
|
|
|
48
65
|
openBlade({
|
|
@@ -54,7 +71,6 @@ openBlade({
|
|
|
54
71
|
// manager.items.value and manager.loading.value access.
|
|
55
72
|
manager: markRaw(assetsManager),
|
|
56
73
|
disabled: !canEdit.value,
|
|
57
|
-
hiddenFields: ["sortOrder"],
|
|
58
74
|
},
|
|
59
75
|
});
|
|
60
76
|
```
|
|
@@ -66,8 +82,8 @@ openBlade({
|
|
|
66
82
|
- **Delete**: Toolbar delete button (requires selection) and per-row action button.
|
|
67
83
|
- **Reorder**: Drag-and-drop row reordering when not in readonly mode.
|
|
68
84
|
- **Detail view**: Clicking a row opens an `AssetsDetails` child blade for single-asset editing.
|
|
69
|
-
- **
|
|
70
|
-
- **Empty state**: Shows upload prompt when no assets exist
|
|
85
|
+
- **Non-image assets**: Files without an image extension render a colored badge with the uppercased extension (`PDF`, `DOCX`, `ZIP`, ...) instead of a thumbnail.
|
|
86
|
+
- **Empty state**: Shows upload prompt when no assets exist; the empty-state action button opens the file picker.
|
|
71
87
|
|
|
72
88
|
## Toolbar
|
|
73
89
|
|
|
@@ -81,11 +97,72 @@ openBlade({
|
|
|
81
97
|
- **Always use `markRaw()` when passing manager through blade options.** Blade descriptors are stored in `ref<BladeDescriptor[]>()`, which creates a deep reactive proxy. Vue auto-unwraps `Ref` values inside reactive objects, so `manager.items` would become a plain array instead of `Ref<AssetLike[]>` — breaking `.value` access. `markRaw()` prevents this by telling Vue not to make the manager reactive.
|
|
82
98
|
- The `manager` object (from `useAssetsManager()`) owns the reactive asset list and all mutation methods. The blade reads `manager.items` and calls `manager.upload()`, `manager.remove()`, `manager.removeMany()`, `manager.reorder()`, and `manager.updateItem()`.
|
|
83
99
|
- The `disabled` prop makes the entire blade readonly: no upload, no delete, no reorder.
|
|
84
|
-
- Asset thumbnails use `isImage()` from
|
|
100
|
+
- Asset thumbnails use `isImage()` from `@core/utilities/assets` to decide between an image preview (`VcImage`) and a colored extension badge (`getExtensionColor` + `getExtensionLabel`).
|
|
85
101
|
- The module uses `useBlade()` internally to open the detail sub-blade.
|
|
102
|
+
- The `manager` instance can be reused as a `useBladeWidgets` badge source — its `items.value.length` updates reactively as uploads/removes happen inside the blade, so a parent widget showing the asset count refreshes without an extra round-trip.
|
|
103
|
+
|
|
104
|
+
## Recipes
|
|
105
|
+
|
|
106
|
+
### Open from a blade widget
|
|
107
|
+
|
|
108
|
+
Most callers don't open `AssetsManager` directly — they expose it as one of the parent blade's widgets. The widget shows the asset count as a live badge and opens the manager on click. The manager is created once per parent blade and reused across openings.
|
|
109
|
+
|
|
110
|
+
```typescript
|
|
111
|
+
import { computed, markRaw, type Ref, type ComputedRef } from "vue";
|
|
112
|
+
import { useBlade, useBladeWidgets, useAssetsManager, usePopup } from "@vc-shell/framework";
|
|
113
|
+
|
|
114
|
+
interface Entity {
|
|
115
|
+
id?: string;
|
|
116
|
+
productData?: { assets?: Asset[] };
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export function useEntityWidgets(opts: { item: Ref<Entity | undefined>; disabled: ComputedRef<boolean>; isVisible: ComputedRef<boolean> }) {
|
|
120
|
+
const { item, disabled, isVisible } = opts;
|
|
121
|
+
const { openBlade } = useBlade();
|
|
122
|
+
const { showConfirmation } = usePopup();
|
|
123
|
+
|
|
124
|
+
const entityAssets = computed({
|
|
125
|
+
get: () => item.value?.productData?.assets ?? [],
|
|
126
|
+
set: (val) => {
|
|
127
|
+
if (item.value?.productData) item.value.productData.assets = val;
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
const assetsManager = useAssetsManager(entityAssets, {
|
|
132
|
+
uploadPath: () => `/catalog/${item.value?.id}`,
|
|
133
|
+
confirmRemove: () => showConfirmation("Are you sure you want to delete the selected assets?"),
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
const assetsCount = computed(() => entityAssets.value.length);
|
|
137
|
+
|
|
138
|
+
return useBladeWidgets([
|
|
139
|
+
{
|
|
140
|
+
id: "AssetsWidget",
|
|
141
|
+
icon: "lucide-file",
|
|
142
|
+
title: "WIDGETS.ASSETS",
|
|
143
|
+
badge: assetsCount,
|
|
144
|
+
isVisible,
|
|
145
|
+
onClick: () =>
|
|
146
|
+
openBlade({
|
|
147
|
+
name: "AssetsManager",
|
|
148
|
+
options: {
|
|
149
|
+
manager: markRaw(assetsManager),
|
|
150
|
+
disabled: disabled.value,
|
|
151
|
+
},
|
|
152
|
+
}),
|
|
153
|
+
},
|
|
154
|
+
]);
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Key points:
|
|
159
|
+
|
|
160
|
+
- `useAssetsManager` is invoked once at widget-setup time, not inside `onClick`. Recreating it per click would lose pending state and break optimistic updates.
|
|
161
|
+
- `disabled.value` is unwrapped at click time. Passing the raw `ComputedRef` would work too, but the blade reads `options.value?.disabled` as a plain value.
|
|
162
|
+
- `assetsCount` reads from the source array (not from `assetsManager.items`), but both stay in sync because the manager mutates the same array via the setter.
|
|
86
163
|
|
|
87
164
|
## Related
|
|
88
165
|
|
|
89
166
|
- `framework/core/composables/useAssetsManager/` -- `useAssetsManager`, `AssetLike`, `UseAssetsManagerReturn`
|
|
90
|
-
- `framework/
|
|
91
|
-
- `framework/
|
|
167
|
+
- `framework/core/utilities/assets.ts` -- `isImage`, `readableSize`, `getExtensionColor`, `getExtensionLabel`
|
|
168
|
+
- `framework/modules/assets/components/assets-details/` -- `AssetsDetails` child blade opened on row click
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: PopupCommon
|
|
3
|
+
category: composables
|
|
4
|
+
group: utilities
|
|
5
|
+
internal: true
|
|
6
|
+
---
|
|
7
|
+
|
|
1
8
|
# Popup Common Components
|
|
2
9
|
|
|
3
10
|
Pre-configured popup variants for warning, error, and info dialogs. Built on a shared `VcPopupBase` component that wraps the `VcPopup` organism.
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ChangePasswordPage
|
|
3
|
+
category: composables
|
|
4
|
+
group: utilities
|
|
5
|
+
internal: true
|
|
6
|
+
---
|
|
7
|
+
|
|
1
8
|
# ChangePasswordPage
|
|
2
9
|
|
|
3
10
|
Change password page with current, new, and confirm password fields. Supports a `forced` mode for expired passwords that displays an info banner and is triggered by post-login redirect. This full-page variant is used when the user must change their password before accessing the application (e.g., expired password policy). For voluntary password changes from within the app, the `ChangePasswordButton` in the settings menu opens a popup instead.
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ForgotPasswordPage
|
|
3
|
+
category: composables
|
|
4
|
+
group: utilities
|
|
5
|
+
internal: true
|
|
6
|
+
---
|
|
7
|
+
|
|
1
8
|
# ForgotPasswordPage
|
|
2
9
|
|
|
3
10
|
Password recovery page where the user enters their email to receive a reset link. Shows a masked-email confirmation on success. This page is part of the standard authentication flow in vc-shell and handles the first step of password recovery: collecting the user's email address and dispatching a reset email through the platform API.
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: InvitePage
|
|
3
|
+
category: composables
|
|
4
|
+
group: utilities
|
|
5
|
+
internal: true
|
|
6
|
+
---
|
|
7
|
+
|
|
1
8
|
# InvitePage
|
|
2
9
|
|
|
3
10
|
Invitation acceptance page where an invited user sets their password. Validates the invitation token on mount, displays the pre-filled email, and provides password/confirm fields. On successful acceptance, the user is automatically signed in and redirected to the main application. This page is the final step in the user invitation flow initiated from the VirtoCommerce Platform admin.
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: LoginPage
|
|
3
|
+
category: composables
|
|
4
|
+
group: utilities
|
|
5
|
+
internal: true
|
|
6
|
+
---
|
|
7
|
+
|
|
1
8
|
# LoginPage
|
|
2
9
|
|
|
3
10
|
Full-page login screen with username/password form, SSO external provider support, and forgot-password navigation. Wraps `VcAuthLayout` and uses `useUserManagement` for authentication. This is the primary entry point for user authentication in vc-shell applications, supporting both standard credential-based login and SSO/external provider authentication.
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ResetPasswordPage
|
|
3
|
+
category: composables
|
|
4
|
+
group: utilities
|
|
5
|
+
internal: true
|
|
6
|
+
---
|
|
7
|
+
|
|
1
8
|
# ResetPasswordPage
|
|
2
9
|
|
|
3
10
|
Password reset page reached via an email link containing a token. Validates the token on mount, then shows password and confirm-password fields. On success, the user is automatically signed in and redirected to the main application. This page is the second step of the password recovery flow, following the `ForgotPasswordPage` which dispatches the reset email.
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: SignIn
|
|
3
|
+
category: composables
|
|
4
|
+
group: utilities
|
|
5
|
+
internal: true
|
|
6
|
+
---
|
|
7
|
+
|
|
1
8
|
# SignIn (External Providers)
|
|
2
9
|
|
|
3
10
|
Components and composable for SSO / external authentication provider integration. Renders provider buttons on the login page and handles the external sign-in redirect flow. This module supports any OAuth2/OpenID Connect provider configured on the VirtoCommerce Platform (Google, Azure AD, ADFS, Okta, etc.) and provides a clean abstraction over the redirect-based authentication flow.
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ChangePasswordButton
|
|
3
|
+
category: composables
|
|
4
|
+
group: utilities
|
|
5
|
+
internal: true
|
|
6
|
+
---
|
|
7
|
+
|
|
1
8
|
# ChangePasswordButton
|
|
2
9
|
|
|
3
10
|
Settings menu action that opens the change-password popup through the popup handler system. This component bridges the settings menu and the password change form: it injects `CloseSettingsMenuKey` to dismiss the parent menu before showing the password popup, ensuring a clean transition. The popup itself renders a form with current password, new password, and confirm password fields, with real-time password policy validation.
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: LanguageSelector
|
|
3
|
+
category: composables
|
|
4
|
+
group: utilities
|
|
5
|
+
internal: true
|
|
6
|
+
---
|
|
7
|
+
|
|
1
8
|
# LanguageSelector
|
|
2
9
|
|
|
3
10
|
Settings menu entry that displays the current UI language and opens a cascading submenu for switching between available locales. Uses the framework `useLanguages` composable and the global vue-i18n locale list. When the user selects a different language, the entire application UI updates immediately without a page reload.
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: LogoutButton
|
|
3
|
+
category: composables
|
|
4
|
+
group: utilities
|
|
5
|
+
internal: true
|
|
6
|
+
---
|
|
7
|
+
|
|
1
8
|
# LogoutButton
|
|
2
9
|
|
|
3
10
|
Settings menu action that signs the user out, closes all open blades, and redirects to the login page. This component encapsulates the full sign-out flow: it injects `CloseSettingsMenuKey` to dismiss the parent menu before navigation, calls `useUserManagement().signOut()` to clear the authentication token, and uses `useBladeStack()` to close open child blades so the user does not return to stale blade state on next login.
|
package/runtime/knowledge/docs/shell/components/notification-dropdown/notification-dropdown.docs.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: NotificationDropdown
|
|
3
|
+
category: composables
|
|
4
|
+
group: utilities
|
|
5
|
+
internal: true
|
|
6
|
+
---
|
|
7
|
+
|
|
1
8
|
# NotificationDropdown
|
|
2
9
|
|
|
3
10
|
Dropdown panel that displays the push notification history in reverse chronological order. This component renders a scrollable list of all received push notifications, backed by the `useNotifications()` composable. It automatically marks unread notifications as read when the dropdown is closed (unmounted), updating the unread badge count in the toolbar.
|
package/runtime/knowledge/docs/shell/components/notification-template/notification-template.docs.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: NotificationTemplate
|
|
3
|
+
category: composables
|
|
4
|
+
group: utilities
|
|
5
|
+
internal: true
|
|
6
|
+
---
|
|
7
|
+
|
|
1
8
|
# NotificationTemplate
|
|
2
9
|
|
|
3
10
|
Base template for rendering a single push notification with title, relative timestamp, optional icon, and a default slot for extra detail content. This component provides the standard layout that all notification types share, while allowing domain-specific content to be injected through the default slot.
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: SettingsMenu
|
|
3
|
+
category: composables
|
|
4
|
+
group: utilities
|
|
5
|
+
internal: true
|
|
6
|
+
---
|
|
7
|
+
|
|
1
8
|
# SettingsMenu
|
|
2
9
|
|
|
3
10
|
Container component that renders registered settings menu items grouped by category and sorted by order. Items are registered through the `useSettingsMenu` service, not through component props. This decoupled architecture allows any module in the application to contribute settings entries without modifying the menu component itself.
|
package/runtime/knowledge/docs/shell/components/settings-menu-item/settings-menu-item.docs.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: SettingsMenuItem
|
|
3
|
+
category: composables
|
|
4
|
+
group: utilities
|
|
5
|
+
internal: true
|
|
6
|
+
---
|
|
7
|
+
|
|
1
8
|
# SettingsMenuItem
|
|
2
9
|
|
|
3
10
|
Individual menu row used inside the settings menu. Displays an icon, title, optional current value, and a chevron indicator for sub-menus. Supports click and hover trigger actions.
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ThemeSelector
|
|
3
|
+
category: composables
|
|
4
|
+
group: utilities
|
|
5
|
+
internal: true
|
|
6
|
+
---
|
|
7
|
+
|
|
1
8
|
# ThemeSelector
|
|
2
9
|
|
|
3
10
|
Settings menu entry that shows the current theme and opens a cascading submenu to switch between registered themes. Uses the `useTheme()` composable for theme management and shows a toast notification when the theme changes, confirming the switch to the user.
|
package/runtime/knowledge/docs/shell/components/user-dropdown-button/user-dropdown-button.docs.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: UserDropdownButton
|
|
3
|
+
category: composables
|
|
4
|
+
group: utilities
|
|
5
|
+
internal: true
|
|
6
|
+
---
|
|
7
|
+
|
|
1
8
|
# UserDropdownButton
|
|
2
9
|
|
|
3
10
|
User account trigger displayed in the shell sidebar footer. Shows the user's avatar, display name, and role. On desktop it opens a floating settings menu dropdown anchored to the button; on mobile it opens a full sidebar panel that slides in from the left. The component automatically adapts its layout based on the sidebar's expanded/collapsed state.
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: DashboardCharts
|
|
3
|
+
category: composables
|
|
4
|
+
group: utilities
|
|
5
|
+
internal: true
|
|
6
|
+
---
|
|
7
|
+
|
|
1
8
|
# DashboardCharts
|
|
2
9
|
|
|
3
10
|
Suite of dashboard chart components (line, bar, donut) built on Unovis. Each chart accepts a generic data array, a `ChartConfig` for series colors/labels, and supports hover tooltips, legends, and optional range filtering.
|
package/runtime/knowledge/docs/shell/dashboard/dashboard-widget-card/dashboard-widget-card.docs.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: DashboardWidgetCard
|
|
3
|
+
category: composables
|
|
4
|
+
group: utilities
|
|
5
|
+
internal: true
|
|
6
|
+
---
|
|
7
|
+
|
|
1
8
|
# DashboardWidgetCard
|
|
2
9
|
|
|
3
10
|
Modern dashboard widget card with header, optional KPI stats area, action buttons, content body, and footer. Used within the GridStack dashboard layout for displaying metrics, feeds, and charts.
|
package/runtime/knowledge/docs/shell/dashboard/draggable-dashboard/dashboard-widget-skeleton.docs.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: DashboardWidgetSkeleton
|
|
3
|
+
category: composables
|
|
4
|
+
group: utilities
|
|
5
|
+
internal: true
|
|
6
|
+
---
|
|
7
|
+
|
|
1
8
|
# DashboardWidgetSkeleton
|
|
2
9
|
|
|
3
10
|
Internal placeholder card used by `GridstackDashboard` while remote modules are still loading. Mimics the shape of `DashboardWidgetCard` (header with icon + title, stats row, content lines) with a shimmer animation. Not exported from `@vc-shell/framework` — consumed only inside the dashboard organism.
|
package/runtime/knowledge/docs/shell/dashboard/draggable-dashboard/draggable-dashboard.docs.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: DraggableDashboard
|
|
3
|
+
category: composables
|
|
4
|
+
group: utilities
|
|
5
|
+
internal: true
|
|
6
|
+
---
|
|
7
|
+
|
|
1
8
|
# DraggableDashboard
|
|
2
9
|
|
|
3
10
|
Gridstack.js-powered dashboard container that renders registered widgets in a drag-and-drop grid layout. Automatically persists layout changes to localStorage and supports widget resizing. This is the main dashboard component used as the landing page in vc-shell applications, providing a customizable overview with KPI widgets, charts, quick actions, and data summaries.
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: VcBadge
|
|
3
|
+
category: components
|
|
4
|
+
group: misc
|
|
5
|
+
---
|
|
6
|
+
|
|
1
7
|
# VcBadge
|
|
2
8
|
|
|
3
9
|
A small indicator component for displaying counts, status dots, or short text labels. Supports two rendering modes: **positioned overlay** on a slotted element (e.g., notification count on a bell icon), or **standalone inline** badge (e.g., a tag/pill label in a list). Inline badges use a softer color palette with tinted backgrounds, while overlay badges use solid fills for maximum contrast.
|
|
4
10
|
|
|
11
|
+
::storybook id="data-display-vcbadge--default"
|
|
12
|
+
|
|
5
13
|
## When to Use
|
|
6
14
|
|
|
7
15
|
- Show unread notification counts on icons or buttons
|
|
@@ -18,6 +26,8 @@ A small indicator component for displaying counts, status dots, or short text la
|
|
|
18
26
|
</VcBadge>
|
|
19
27
|
```
|
|
20
28
|
|
|
29
|
+
::storybook id="data-display-vcbadge--variants" height="300"
|
|
30
|
+
|
|
21
31
|
## Key Props
|
|
22
32
|
|
|
23
33
|
| Prop | Type | Default | Description |
|
|
@@ -34,6 +44,8 @@ A small indicator component for displaying counts, status dots, or short text la
|
|
|
34
44
|
| `right` | `string` | -- | Custom right offset (requires `customPosition`) |
|
|
35
45
|
| `ariaLabel` | `string` | -- | Custom accessible label for the badge |
|
|
36
46
|
|
|
47
|
+
::storybook id="data-display-vcbadge--use-cases" height="350"
|
|
48
|
+
|
|
37
49
|
## Common Patterns
|
|
38
50
|
|
|
39
51
|
### Notification Count on an Icon
|
|
@@ -125,3 +137,15 @@ Fine-tune the badge position relative to its parent:
|
|
|
125
137
|
- [VcIcon](../vc-icon/) -- commonly used as slotted content inside badges
|
|
126
138
|
- [VcBanner](../vc-banner/) -- for longer contextual messages and alerts
|
|
127
139
|
- [VcStatus](../vc-status/) -- labeled multi-variant status indicator
|
|
140
|
+
|
|
141
|
+
<!-- internal:start -->
|
|
142
|
+
|
|
143
|
+
## Architecture notes
|
|
144
|
+
|
|
145
|
+
- VcBadge lives in `framework/ui/components/atoms/vc-badge/`.
|
|
146
|
+
- Overlay mode uses `position: absolute` on the badge element; the parent slot wrapper is set to `position: relative` via the `.vc-badge` CSS class.
|
|
147
|
+
- The `inline` prop switches the root element from `<span class="vc-badge">` (overlay) to `<span class="vc-badge--inline">` with no position context.
|
|
148
|
+
- Color palette tokens: overlay uses `--{variant}-500` fills; inline uses `--{variant}-50` background + `--{variant}-700` text, defined in `framework/assets/styles/theme/colors.scss`.
|
|
149
|
+
- Clickable mode integrates `role="button"` and keyboard handlers directly in the component — no separate button wrapper — to preserve the overlay stacking context.
|
|
150
|
+
|
|
151
|
+
<!-- internal:end -->
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: VcBanner
|
|
3
|
+
category: components
|
|
4
|
+
group: feedback
|
|
5
|
+
---
|
|
6
|
+
|
|
1
7
|
# VcBanner
|
|
2
8
|
|
|
3
9
|
A contextual alert component for displaying important messages, warnings, or status information. VcBanner supports four semantic variants (`info`, `warning`, `danger`, `success`), each with a distinct accent color and left border stripe. Long content is automatically collapsed behind a "Show more" toggle, keeping the blade layout clean while still giving users access to the full message.
|
|
4
10
|
|
|
11
|
+
::storybook id="action-vcbanner--default"
|
|
12
|
+
|
|
5
13
|
## When to Use
|
|
6
14
|
|
|
7
15
|
- Display validation errors or decline reasons on detail blades
|
|
@@ -19,6 +27,8 @@ A contextual alert component for displaying important messages, warnings, or sta
|
|
|
19
27
|
</VcBanner>
|
|
20
28
|
```
|
|
21
29
|
|
|
30
|
+
::storybook id="action-vcbanner--all-variants" height="500"
|
|
31
|
+
|
|
22
32
|
## Key Props
|
|
23
33
|
|
|
24
34
|
| Prop | Type | Default | Description |
|
|
@@ -157,3 +167,13 @@ Override the default "Show more" button with a custom trigger:
|
|
|
157
167
|
- [VcCard](../vc-card/) -- for general-purpose content containers
|
|
158
168
|
- [VcIcon](../vc-icon/) -- used internally for the leading icon
|
|
159
169
|
- [VcBadge](../vc-badge/) -- for inline status pill labels
|
|
170
|
+
|
|
171
|
+
<!-- internal:start -->
|
|
172
|
+
|
|
173
|
+
## Architecture notes
|
|
174
|
+
|
|
175
|
+
- Legacy variants `"light-danger"`, `"info-dark"`, and `"primary"` are mapped in `vc-banner.vue` via a computed `resolvedVariant`. A `console.warn` is emitted in development mode only.
|
|
176
|
+
- The collapse animation is driven by `max-height` CSS transition with a JS-measured `scrollHeight`. The `--vc-banner-collapsed-height` CSS variable is injected inline as a style binding.
|
|
177
|
+
- Source: `framework/ui/components/atoms/vc-banner/vc-banner.vue`
|
|
178
|
+
|
|
179
|
+
<!-- internal:end -->
|