@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
|
@@ -1,9 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: VcSelect
|
|
3
|
+
category: components
|
|
4
|
+
group: form
|
|
5
|
+
---
|
|
6
|
+
|
|
1
7
|
# VcSelect
|
|
2
8
|
|
|
3
9
|
A dropdown list component for selecting one or multiple values. Supports synchronous and asynchronous data sources, search with debounce, infinite scrolling, custom option templates, and full integration with the framework's validation system.
|
|
4
10
|
|
|
5
11
|
VcSelect is one of the most widely used components in vc-shell. It covers most selection scenarios: from a simple dropdown with a static list to searching via a server API with pagination.
|
|
6
12
|
|
|
13
|
+
!!! note "Large reference"
|
|
14
|
+
This page is over 200 lines. Use the section headings to jump directly to what you need: [Quick Start](#quick-start), [Data Sources](#data-sources), [Multiple Selection](#multiple-selection), [Slots](#slots), [Props](#props).
|
|
15
|
+
|
|
16
|
+
::storybook id="form-vcselect--basic"
|
|
17
|
+
|
|
7
18
|
## When to Use
|
|
8
19
|
|
|
9
20
|
| Scenario | Component |
|
|
@@ -82,6 +93,8 @@ In this case `optionValue` and `optionLabel` are not needed — the component us
|
|
|
82
93
|
|
|
83
94
|
### Async Function (Server API)
|
|
84
95
|
|
|
96
|
+
::storybook id="form-vcselect--async-options" height="450"
|
|
97
|
+
|
|
85
98
|
To load data from a server, pass a function instead of an array. This is the most powerful mode — it automatically provides:
|
|
86
99
|
|
|
87
100
|
- Search with debounce (500ms by default)
|
|
@@ -142,6 +155,8 @@ const loadProducts = async (keyword?: string, skip?: number, ids?: string[]) =>
|
|
|
142
155
|
|
|
143
156
|
## Multiple Selection
|
|
144
157
|
|
|
158
|
+
::storybook id="form-vcselect--multiple-selection"
|
|
159
|
+
|
|
145
160
|
Add `multiple` to enable selecting several values. The model becomes an array:
|
|
146
161
|
|
|
147
162
|
```vue
|
|
@@ -178,6 +193,8 @@ Selected values are displayed as chips with a remove button. The `clearable` but
|
|
|
178
193
|
|
|
179
194
|
## Search and Filtering
|
|
180
195
|
|
|
196
|
+
::storybook id="form-vcselect--searchable"
|
|
197
|
+
|
|
181
198
|
Enable `searchable` to add a search field to the dropdown:
|
|
182
199
|
|
|
183
200
|
```vue
|
|
@@ -192,6 +209,8 @@ Enable `searchable` to add a search field to the dropdown:
|
|
|
192
209
|
|
|
193
210
|
## Custom Option Rendering
|
|
194
211
|
|
|
212
|
+
::storybook id="form-vcselect--custom-option-slot" height="450"
|
|
213
|
+
|
|
195
214
|
Use the `#option` slot for full control over how each option is rendered:
|
|
196
215
|
|
|
197
216
|
```vue
|
|
@@ -678,3 +697,16 @@ Don't forget `:key` with cascading selects, otherwise the second select will ret
|
|
|
678
697
|
When placed inside a `VcBlade` with `loading=true`, the component automatically renders a skeleton placeholder matching its visual footprint — a label block (when the `label` prop is set) and an input-shaped block. No additional props or configuration needed.
|
|
679
698
|
|
|
680
699
|
This behavior is powered by `BladeLoadingKey` via Vue's provide/inject. The component injects the loading state from the nearest `VcBlade` ancestor.
|
|
700
|
+
|
|
701
|
+
<!-- internal:start -->
|
|
702
|
+
|
|
703
|
+
## Architecture Notes
|
|
704
|
+
|
|
705
|
+
- VcSelect is split into three layers: `vc-select.vue` (orchestrator), `SelectTrigger.vue` (trigger button + chips), `SelectDropdown.vue` (popup list).
|
|
706
|
+
- Composable split: `useSelectDataSource` (options loading, infinite scroll, search), `useSelectSelection` (model-to-option mapping, toggle, remove), `useSelectValueMapping` (optionValue/optionLabel getters), `useSelectDropdown` (Floating UI positioning), `useSelectVisibility` (IntersectionObserver for lazy open).
|
|
707
|
+
- `emitValue: true` (default) means `modelValue` is always a primitive (string/number/boolean). `emitValue: false` means full option object. The `mapOptions` flag controls whether resolved objects are stored in the cache for label resolution.
|
|
708
|
+
- Infinite scroll is driven by `useIntersectionObserver` on a 1px sentinel element inside the dropdown viewport.
|
|
709
|
+
- Keyboard navigation is managed by `useKeyboardNavigation` (`core/composables/`) — arrow keys, Enter, Escape. The composable attaches/detaches listeners when the dropdown opens/closes.
|
|
710
|
+
- Source files: `framework/ui/components/molecules/vc-select/`
|
|
711
|
+
|
|
712
|
+
<!-- internal:end -->
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: VcSlider
|
|
3
|
+
category: components
|
|
4
|
+
group: form
|
|
5
|
+
---
|
|
6
|
+
|
|
1
7
|
# VcSlider
|
|
2
8
|
|
|
3
9
|
A content carousel component built on Swiper.js for displaying slides with optional navigation buttons. Renders any content via the default slot.
|
|
4
10
|
|
|
11
|
+
::storybook id="form-vcslider--default"
|
|
12
|
+
|
|
5
13
|
## When to Use
|
|
6
14
|
|
|
7
15
|
- Image carousels (product galleries, banners)
|
|
@@ -65,6 +73,8 @@ const products = [
|
|
|
65
73
|
|
|
66
74
|
### Custom Navigation Buttons
|
|
67
75
|
|
|
76
|
+
::storybook id="form-vcslider--custom-navigation"
|
|
77
|
+
|
|
68
78
|
```vue
|
|
69
79
|
<VcSlider :slides="items" navigation>
|
|
70
80
|
<template #default="{ slide }">
|
|
@@ -123,3 +133,15 @@ const products = [
|
|
|
123
133
|
## Skeleton / Loading State
|
|
124
134
|
|
|
125
135
|
When placed inside a `VcBlade` with `loading=true`, the component automatically renders a skeleton placeholder matching its visual footprint. No additional props or configuration needed.
|
|
136
|
+
|
|
137
|
+
<!-- internal:start -->
|
|
138
|
+
|
|
139
|
+
## Architecture Notes
|
|
140
|
+
|
|
141
|
+
- VcSlider wraps the `swiper/vue` `<Swiper>` / `<SwiperSlide>` components with the `Navigation` module. Navigation buttons are custom DOM elements (`.vc-slider__prev` / `.vc-slider__next`) referenced by Swiper's `navigation.prevEl` / `nextEl` selectors.
|
|
142
|
+
- `overflow` prop toggles `overflow: visible` on the swiper container, allowing slides to bleed outside bounds — useful for "peek" effects.
|
|
143
|
+
- `slidesPerView="auto"` (default) lets each slide size itself from content. Pass a number for fixed-count layouts.
|
|
144
|
+
- The `slides` prop accepts any array. Each item is exposed as `{ slide }` in the default scoped slot.
|
|
145
|
+
- Source file: `framework/ui/components/molecules/vc-slider/vc-slider.vue`
|
|
146
|
+
|
|
147
|
+
<!-- internal:end -->
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: VcSwitch
|
|
3
|
+
category: components
|
|
4
|
+
group: form
|
|
5
|
+
---
|
|
6
|
+
|
|
1
7
|
# VcSwitch
|
|
2
8
|
|
|
3
9
|
A toggle switch component for binary on/off choices. Renders as a sliding track with a thumb indicator and supports labels, hints, validation, and value inversion.
|
|
4
10
|
|
|
11
|
+
!!! note "Large reference"
|
|
12
|
+
This page is over 200 lines. Use the section headings to jump directly to what you need: [Quick Start](#quick-start), [Features](#features), [Props](#props), [CSS Variables](#css-variables).
|
|
13
|
+
|
|
14
|
+
::storybook id="form-vcswitch--default"
|
|
15
|
+
|
|
5
16
|
## When to Use
|
|
6
17
|
|
|
7
18
|
- Toggling a feature or setting on/off (e.g., "Enable notifications", "Publish product")
|
|
@@ -46,6 +57,8 @@ The `label` prop renders text above the switch. Use `hint` for helper text below
|
|
|
46
57
|
|
|
47
58
|
### Value Inversion with trueValue / falseValue
|
|
48
59
|
|
|
60
|
+
::storybook id="form-vcswitch--variants"
|
|
61
|
+
|
|
49
62
|
By default, `v-model` maps `true` to the checked (on) state and `false` to unchecked (off). The `trueValue` and `falseValue` props let you invert the mapping when your data model uses opposite semantics.
|
|
50
63
|
|
|
51
64
|
```vue
|
|
@@ -294,3 +307,15 @@ const isActive = ref(true);
|
|
|
294
307
|
## Skeleton / Loading State
|
|
295
308
|
|
|
296
309
|
When placed inside a `VcBlade` with `loading=true`, the component renders a skeleton placeholder matching its shape — a control indicator and label block. No configuration needed.
|
|
310
|
+
|
|
311
|
+
<!-- internal:start -->
|
|
312
|
+
|
|
313
|
+
## Architecture Notes
|
|
314
|
+
|
|
315
|
+
- VcSwitch renders a hidden `<input type="checkbox">` with `role="switch"`. Visual state is driven by CSS (`:checked + .vc-switch__slider`). No JavaScript DOM manipulation needed for toggling.
|
|
316
|
+
- `invertValue` handles the `trueValue`/`falseValue` mapping — both on read (for rendering) and on write (for emitting). When `trueValue` is `false`, the display is inverted.
|
|
317
|
+
- The `tooltip` prop is kept for backward compatibility (legacy vc-shell code used it as hint text). A dev-mode `console.warn` nudges maintainers to migrate. The prop is mapped to `hintText` computed.
|
|
318
|
+
- `useFormField` injects validation context (error, disabled, name) from a parent form provider.
|
|
319
|
+
- Source file: `framework/ui/components/molecules/vc-switch/vc-switch.vue`
|
|
320
|
+
|
|
321
|
+
<!-- internal:end -->
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: VcTextarea
|
|
3
|
+
category: components
|
|
4
|
+
group: form
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
!!! note "Large reference page"
|
|
8
|
+
This page is long. Use the section links in the sidebar or your browser's in-page search (Ctrl/Cmd+F) to jump to the section you need.
|
|
9
|
+
|
|
1
10
|
# VcTextarea
|
|
2
11
|
|
|
3
12
|
A multi-line text input field for entering and editing large blocks of text. Provides label, placeholder, hint text, validation error display, character limits, and multilanguage support out of the box.
|
|
4
13
|
|
|
14
|
+
::storybook id="form-vctextarea--default"
|
|
15
|
+
|
|
5
16
|
## When to Use
|
|
6
17
|
|
|
7
18
|
- Multi-line free-form text: descriptions, comments, notes, addresses, bios
|
|
@@ -99,6 +110,8 @@ const form = reactive({
|
|
|
99
110
|
|
|
100
111
|
### States
|
|
101
112
|
|
|
113
|
+
::storybook id="form-vctextarea--with-error"
|
|
114
|
+
|
|
102
115
|
```vue
|
|
103
116
|
<!-- Required field -->
|
|
104
117
|
<VcTextarea v-model="value" label="Address" required />
|
|
@@ -112,6 +125,8 @@ const form = reactive({
|
|
|
112
125
|
|
|
113
126
|
## Recipes
|
|
114
127
|
|
|
128
|
+
::storybook id="form-vctextarea--with-max-length"
|
|
129
|
+
|
|
115
130
|
### Product Description in a Blade Form
|
|
116
131
|
|
|
117
132
|
A typical product-editing blade with a description textarea and character limit:
|
|
@@ -293,3 +308,15 @@ const description = ref<string>("");
|
|
|
293
308
|
When placed inside a `VcBlade` with `loading=true`, the component automatically renders a skeleton placeholder matching its visual footprint — a label block (when the `label` prop is set) and an input-shaped block. No additional props or configuration needed.
|
|
294
309
|
|
|
295
310
|
This behavior is powered by `BladeLoadingKey` via Vue's provide/inject. The component injects the loading state from the nearest `VcBlade` ancestor.
|
|
311
|
+
|
|
312
|
+
<!-- internal:start -->
|
|
313
|
+
|
|
314
|
+
## Architecture Notes
|
|
315
|
+
|
|
316
|
+
- The native `<textarea>` element is exposed via `defineExpose({ focus })` so parent components can call `focus()` programmatically.
|
|
317
|
+
- The `invalid` computed is `props.error || !!props.errorMessage` — either flag alone triggers error styling.
|
|
318
|
+
- There is no debounce on the textarea; all `input` events fire `update:modelValue` immediately.
|
|
319
|
+
- The `disabled` state is inherited from the nearest `VcInputGroup` ancestor via provide/inject (when used inside a group).
|
|
320
|
+
- Source file: `framework/ui/components/molecules/vc-textarea/vc-textarea.vue`
|
|
321
|
+
|
|
322
|
+
<!-- internal:end -->
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: VcToast
|
|
3
|
+
category: components
|
|
4
|
+
group: feedback
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
!!! tip "Quick reference"
|
|
8
|
+
Jump to [Props](#props-component) · [Events](#events) · [Notification Service Methods](#notification-service-methods) · [CSS Variables](#css-variables)
|
|
9
|
+
|
|
1
10
|
# VcToast
|
|
2
11
|
|
|
3
12
|
Toast notification component with type-based styling, auto-dismiss timer, swipe-to-dismiss on touch devices, and Sonner-style stacking animations. Most applications interact with toasts through the `notification` service rather than mounting the component directly.
|
|
@@ -17,6 +26,8 @@ When NOT to use:
|
|
|
17
26
|
|
|
18
27
|
## Quick Start
|
|
19
28
|
|
|
29
|
+
::storybook id="overlay-vctoast--notification-service"
|
|
30
|
+
|
|
20
31
|
The recommended approach is the `notification` service, not direct component usage:
|
|
21
32
|
|
|
22
33
|
```ts
|
|
@@ -98,6 +109,8 @@ Available positions: `"top-center"`, `"top-right"`, `"top-left"`, `"bottom-cente
|
|
|
98
109
|
|
|
99
110
|
### Notification Types
|
|
100
111
|
|
|
112
|
+
::storybook id="overlay-vctoast--success"
|
|
113
|
+
|
|
101
114
|
Each type displays a distinct icon and colored left accent border.
|
|
102
115
|
|
|
103
116
|
| Type | Icon | Accent Color | Use Case |
|
|
@@ -129,6 +142,8 @@ notification(OrderNotification, { timeout: 10000, pauseOnHover: true });
|
|
|
129
142
|
|
|
130
143
|
### Stacking, Swipe, and Auto-dismiss
|
|
131
144
|
|
|
145
|
+
::storybook id="overlay-vctoast--multiple-notifications"
|
|
146
|
+
|
|
132
147
|
Toasts use Sonner-style stacking: the newest toast is in front, older toasts scale down behind it, and hovering expands the full stack. Only 3 toasts are visible by default in the collapsed state.
|
|
133
148
|
|
|
134
149
|
On touch devices, horizontal swipe dismisses toasts (threshold: 45px or velocity > 0.11px/ms).
|
|
@@ -298,3 +313,16 @@ These props are used internally by the notification system. You rarely need to s
|
|
|
298
313
|
|
|
299
314
|
- [VcHint](../../atoms/vc-hint/) -- inline hint/error text for form fields
|
|
300
315
|
- [VcIcon](../../atoms/vc-icon/) -- used internally for type-specific icons
|
|
316
|
+
|
|
317
|
+
<!-- internal:start -->
|
|
318
|
+
|
|
319
|
+
## Architecture Notes
|
|
320
|
+
|
|
321
|
+
- `VcToast` is managed by the notification system's container component (in `framework/shell/_internal/notifications/`). Direct mounting is unusual and bypasses the stacking/positioning logic.
|
|
322
|
+
- Stacking CSS uses data attributes (`data-mounted`, `data-removed`, `data-expanded`, `data-front`, `data-y-position`, `data-visible`, `data-swiping`, `data-swiped-out`) rather than class bindings for animation state — this matches the Sonner pattern and avoids Vue transition conflicts.
|
|
323
|
+
- `TIME_BEFORE_UNMOUNT = 200ms` — the toast sets `data-removed="true"` to trigger CSS exit animation, then emits `close` after 200ms to remove it from the reactive list.
|
|
324
|
+
- The `Timer` helper (defined inline) is a pauseable/resumeable setTimeout — `pause()` records remaining time, `resume()` restarts from remaining. Used for `pauseOnHover`.
|
|
325
|
+
- Height reporting via `ResizeObserver` + `onReportHeight` callback allows the container to compute accurate stack offsets using `getBoundingClientRect()` on an `height: auto` snapshot.
|
|
326
|
+
- Swipe detection uses pointer capture (`setPointerCapture`) to track moves even when the pointer leaves the element. Threshold: 45px displacement or velocity > 0.11 px/ms.
|
|
327
|
+
|
|
328
|
+
<!-- internal:end -->
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: VcApp
|
|
3
|
+
category: components
|
|
4
|
+
group: layout
|
|
5
|
+
---
|
|
6
|
+
|
|
1
7
|
# VcApp
|
|
2
8
|
|
|
3
9
|
The root application shell that bootstraps the VirtoCommerce admin UI. It provides the desktop sidebar / mobile top bar layout, blade navigation workspace, popup container, module loading, and service registration. Every VirtoCommerce admin application must render exactly one `VcApp` at the root of its authenticated route tree.
|
|
4
10
|
|
|
11
|
+
::storybook id="layout-vcapp--desktop-expanded"
|
|
12
|
+
|
|
13
|
+
!!! note "One VcApp per application"
|
|
14
|
+
Every VirtoCommerce admin application must render exactly one `VcApp` at the root of its authenticated route tree. Multiple instances cause service registration conflicts.
|
|
15
|
+
|
|
5
16
|
## When to Use
|
|
6
17
|
|
|
7
18
|
- Every VirtoCommerce admin application must have exactly one `VcApp` at the root.
|
|
@@ -59,6 +70,8 @@ const user = reactive({ name: "John", role: "Admin" });
|
|
|
59
70
|
| `workspace` | `{ isAuthenticated }` | Override the blade navigation workspace. |
|
|
60
71
|
| `app-hub` | `{ appsList, switchApp }` | Custom content for the Applications section of the App Hub. |
|
|
61
72
|
|
|
73
|
+
<!-- internal:start -->
|
|
74
|
+
|
|
62
75
|
## Architecture
|
|
63
76
|
|
|
64
77
|
VcApp orchestrates several internal systems:
|
|
@@ -68,6 +81,8 @@ VcApp orchestrates several internal systems:
|
|
|
68
81
|
3. **Module Loading** -- consumes `DynamicModulesKey` for runtime module registration; shows error notifications on failure. Modules declare routes, menu items, and services.
|
|
69
82
|
4. **Services** -- bootstraps shell services (Menu, Toolbar, Settings, Dashboard, GlobalSearch, etc.) via `useShellBootstrap`. These services are available to all child components through provide/inject.
|
|
70
83
|
|
|
84
|
+
<!-- internal:end -->
|
|
85
|
+
|
|
71
86
|
## Features
|
|
72
87
|
|
|
73
88
|
### Responsive Layout Switching
|
|
@@ -76,6 +91,8 @@ On desktop viewports, VcApp renders a collapsible sidebar on the left with navig
|
|
|
76
91
|
|
|
77
92
|
### Sidebar Menu Search
|
|
78
93
|
|
|
94
|
+
::storybook id="layout-vcapp--with-sidebar-search" height="500"
|
|
95
|
+
|
|
79
96
|
When `showSearch` is `true`, a search input appears at the top of the sidebar (desktop) or mobile navigation panel. It filters menu items in real time (300ms debounce) by matching the search query against translated item titles:
|
|
80
97
|
|
|
81
98
|
- **Standalone items** — shown if their title contains the query.
|
|
@@ -134,6 +151,8 @@ The App Hub is a popover panel (desktop) or a swipeable tab (mobile) that combin
|
|
|
134
151
|
|
|
135
152
|
On desktop, the App Hub opens from the sidebar header menu button (`AppHubPopover`). On mobile, it appears as a second tab ("Hub") in the slide-out navigation panel — users can swipe between Menu and Hub tabs.
|
|
136
153
|
|
|
154
|
+
::storybook id="layout-vcapp--mobile" height="500"
|
|
155
|
+
|
|
137
156
|
## Recipe: Minimal App Setup
|
|
138
157
|
|
|
139
158
|
```vue
|
package/runtime/knowledge/docs/ui/components/organisms/vc-auth-layout/vc-auth-layout.docs.md
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: VcAuthLayout
|
|
3
|
+
category: components
|
|
4
|
+
group: layout
|
|
5
|
+
---
|
|
6
|
+
|
|
1
7
|
# VcAuthLayout
|
|
2
8
|
|
|
3
9
|
A full-page centered authentication layout for login, registration, password reset, and other auth-related screens. VcAuthLayout renders a vertically and horizontally centered card on top of an optional background image, with a logo, title, subtitle, form content area, and a footer slot for legal links. It is the standard layout for all pre-authentication pages in VirtoCommerce admin applications.
|
|
4
10
|
|
|
11
|
+
::storybook id="layout-vcauthlayout--default"
|
|
12
|
+
|
|
13
|
+
!!! warning "Use outside VcApp"
|
|
14
|
+
VcAuthLayout is a full-page layout meant to replace `VcApp`, not nest inside it. Your router should switch between VcAuthLayout (for auth routes) and VcApp (for authenticated routes) at the top level.
|
|
15
|
+
|
|
5
16
|
## When to Use
|
|
6
17
|
|
|
7
18
|
- Use for any authentication page: sign-in, sign-up, password reset, email verification
|
|
@@ -132,6 +143,8 @@ The layout uses a `<main>` element as the page landmark and an `<h2>` for the ca
|
|
|
132
143
|
</template>
|
|
133
144
|
```
|
|
134
145
|
|
|
146
|
+
::storybook id="layout-vcauthlayout--with-sso-providers" height="500"
|
|
147
|
+
|
|
135
148
|
## Recipe: Password Reset Page
|
|
136
149
|
|
|
137
150
|
```vue
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: VcBlade
|
|
3
|
+
category: components
|
|
4
|
+
group: layout
|
|
5
|
+
---
|
|
6
|
+
|
|
1
7
|
# VcBlade
|
|
2
8
|
|
|
3
9
|
The foundational container component of the VirtoCommerce admin shell. Blades are stacked panels -- inspired by the Azure Portal -- that form the primary navigation paradigm. Every screen in a vc-shell application is a blade.
|
|
@@ -34,6 +40,8 @@ Traditional admin panels use page-based routing: click a link, the entire viewpo
|
|
|
34
40
|
| Full-page route without blade stack | Vue Router view |
|
|
35
41
|
| Scrollable content section inside a blade | [VcContainer](../../molecules/vc-container/) |
|
|
36
42
|
|
|
43
|
+
::storybook id="navigation-vcblade--default"
|
|
44
|
+
|
|
37
45
|
Use VcBlade for every screen in a vc-shell application -- it is the standard container that integrates with the navigation system, toolbar, breadcrumbs, and unsaved-changes guards. **Do not use** VcBlade for transient dialogs (use `VcPopup` / `usePopup()`) or for content areas that do not need their own header and close button.
|
|
38
46
|
|
|
39
47
|
## Quick Start
|
|
@@ -54,7 +62,8 @@ defineOptions({ name: "MyFirstBlade", url: "/my-first-blade" });
|
|
|
54
62
|
</script>
|
|
55
63
|
```
|
|
56
64
|
|
|
57
|
-
|
|
65
|
+
!!! tip "Every blade needs a name"
|
|
66
|
+
Every blade must define a `name` in `defineOptions`. This is how other blades reference it: `openBlade({ name: "MyFirstBlade" })`. The `url` is optional and controls the URL segment.
|
|
58
67
|
|
|
59
68
|
## Blade Anatomy
|
|
60
69
|
|
|
@@ -374,6 +383,8 @@ interface IBladeToolbar {
|
|
|
374
383
|
|
|
375
384
|
## Loading State and Skeleton
|
|
376
385
|
|
|
386
|
+
::storybook id="navigation-vcblade--loading" height="500"
|
|
387
|
+
|
|
377
388
|
`loading` shows skeleton placeholders for header, toolbar, and content:
|
|
378
389
|
|
|
379
390
|
```vue
|
|
@@ -384,6 +395,10 @@ interface IBladeToolbar {
|
|
|
384
395
|
|
|
385
396
|
> **Tip:** Content is hidden (not unmounted) while loading, so `onMounted` hooks still fire.
|
|
386
397
|
|
|
398
|
+
> **Note:** During `loading=true`, the header keeps its **close/expand controls operational** — only the icon, title, and subtitle are replaced with skeleton placeholders. Users can always close or maximize a loading blade. The `actions` slot, breadcrumbs, and modified-status dot are hidden until loading finishes.
|
|
399
|
+
|
|
400
|
+
> **Note:** The toolbar zone uses an in-place skeleton: `BladeToolbar` itself renders skeleton buttons/widgets when its `loading` prop is true (no separate skeleton component is mounted). On mobile, the toolbar is omitted entirely while loading.
|
|
401
|
+
|
|
387
402
|
Merge multiple loading sources with `useLoading`:
|
|
388
403
|
|
|
389
404
|
```ts
|
|
@@ -409,6 +424,8 @@ useBeforeUnload(hasChanges); // Browser tab close warning
|
|
|
409
424
|
|
|
410
425
|
## Custom Banners
|
|
411
426
|
|
|
427
|
+
::storybook id="navigation-vcblade--custom-banners" height="500"
|
|
428
|
+
|
|
412
429
|
Add informational, warning, or success banners to a blade programmatically. Banners appear between the header and toolbar, sorted by severity.
|
|
413
430
|
|
|
414
431
|
```vue
|
|
@@ -675,6 +692,8 @@ openBlade({ name: "ProductsList" });
|
|
|
675
692
|
| `usePopup()` | Confirmation dialogs and error messages. |
|
|
676
693
|
| `useBladeWidgets()` | Register contextual widgets for the blade widget area. |
|
|
677
694
|
|
|
695
|
+
<!-- internal:start -->
|
|
696
|
+
|
|
678
697
|
## Content Skeleton Mode
|
|
679
698
|
|
|
680
699
|
When `loading=true`, VcBlade provides `BladeLoadingKey` to all descendant components via Vue's provide/inject. Each framework UI component automatically renders a skeleton placeholder matching its visual footprint.
|
|
@@ -704,3 +723,5 @@ import { useBladeLoading } from "@vc-shell/framework";
|
|
|
704
723
|
const bladeLoading = useBladeLoading();
|
|
705
724
|
// bladeLoading.value === true when parent VcBlade is loading
|
|
706
725
|
```
|
|
726
|
+
|
|
727
|
+
<!-- internal:end -->
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Table Composables
|
|
3
|
+
category: composables
|
|
4
|
+
group: data
|
|
5
|
+
slug: table-composables
|
|
6
|
+
---
|
|
7
|
+
|
|
1
8
|
# VcTable Composables
|
|
2
9
|
|
|
3
10
|
Composables that power VcDataTable's functionality. Each handles a single concern and is wired together by the table component. Module developers rarely use these directly -- they are consumed internally by `VcDataTable.vue`.
|
|
@@ -144,14 +151,32 @@ register({
|
|
|
144
151
|
|
|
145
152
|
- `useTableColumns` never removes entries from `columnState` — hidden columns preserve their weight and order for when they reappear. Use `engineOutput` (not `columnState` directly) to read computed pixel widths for rendering.
|
|
146
153
|
- Call `recompute()` (returned by `useTableColumns`) whenever the container width changes to force the engine to redistribute widths without altering weights.
|
|
147
|
-
- `useDataTableState` stores the v2 schema (weights, order, hidden/shown IDs). It
|
|
154
|
+
- `useDataTableState` stores the v2 schema (weights, order, hidden/shown IDs). It auto-migrates v1 state (pixel-based) on the first restore.
|
|
148
155
|
- `useColumnWidthEngine` functions are pure — pass immutable copies of `specs` when testing or previewing layouts without committing to state.
|
|
156
|
+
- `useVirtualScroll` requires a fixed `itemSize` (row height in pixels) for accurate positioning.
|
|
157
|
+
|
|
158
|
+
<!-- internal:start -->
|
|
159
|
+
|
|
160
|
+
### Contributor notes
|
|
161
|
+
|
|
162
|
+
- `useDataTableState`: Guard against save-during-restore loops with the `isRestoring` flag.
|
|
149
163
|
- `useTableRowReorder`: `event.preventDefault()` in `dragover` MUST be called on every event or `drop` never fires.
|
|
150
164
|
- `useTableColumnsResize` applies DOM-level px changes during drag for 60fps performance, then commits final weights to `columnState` on mouseup. No `ResizeObserver` scaling is involved.
|
|
151
|
-
|
|
165
|
+
|
|
166
|
+
<!-- internal:end -->
|
|
152
167
|
|
|
153
168
|
## Related
|
|
154
169
|
|
|
155
|
-
-
|
|
156
|
-
-
|
|
157
|
-
|
|
170
|
+
- [VcDataTable](../../vc-data-table) -- the main consumer of these composables
|
|
171
|
+
- [VcColumn](../../vc-data-table) -- declarative column definitions
|
|
172
|
+
|
|
173
|
+
<!-- internal:start -->
|
|
174
|
+
|
|
175
|
+
## Source references
|
|
176
|
+
|
|
177
|
+
- `framework/ui/components/organisms/vc-data-table/VcDataTable.vue` -- main consumer
|
|
178
|
+
- `framework/ui/components/organisms/vc-data-table/VcTableAdapter.vue` -- legacy API adapter
|
|
179
|
+
- `framework/ui/components/organisms/vc-data-table/components/` -- sub-components (TableHead, TableRow, cells)
|
|
180
|
+
- `framework/ui/components/organisms/vc-data-table/composables/` -- full composable list
|
|
181
|
+
|
|
182
|
+
<!-- internal:end -->
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: VcDataTable
|
|
3
|
+
category: components
|
|
4
|
+
group: data-display
|
|
5
|
+
---
|
|
6
|
+
|
|
1
7
|
# VcDataTable
|
|
2
8
|
|
|
3
9
|
The flagship data table component for VirtoCommerce admin shell. VcDataTable provides a fully declarative, template-driven API for building interactive tables with sorting, selection, inline editing, filtering, pagination, column management, row reordering, and more.
|
|
@@ -107,6 +113,8 @@ const products = ref([
|
|
|
107
113
|
|
|
108
114
|
> **Note:** Each item must have a unique identifier field. The default is `id` -- override with the `data-key` prop if your field is named differently (e.g., `data-key="sku"`).
|
|
109
115
|
|
|
116
|
+
::storybook id="data-display-vcdatatable--basic"
|
|
117
|
+
|
|
110
118
|
---
|
|
111
119
|
|
|
112
120
|
## Column Types
|
|
@@ -207,6 +215,8 @@ For any rendering not covered by built-in types, use the `#body` slot:
|
|
|
207
215
|
|
|
208
216
|
## Sorting
|
|
209
217
|
|
|
218
|
+
::storybook id="data-display-vcdatatable--with-sorting" height="500"
|
|
219
|
+
|
|
210
220
|
### Single Column Sort
|
|
211
221
|
|
|
212
222
|
Mark columns as sortable and bind the sort state:
|
|
@@ -293,6 +303,8 @@ When the backend sort field differs from the column id:
|
|
|
293
303
|
|
|
294
304
|
## Selection
|
|
295
305
|
|
|
306
|
+
::storybook id="data-display-vcdatatable--with-selection" height="450"
|
|
307
|
+
|
|
296
308
|
### Multiple Selection (checkboxes)
|
|
297
309
|
|
|
298
310
|
```vue
|
|
@@ -1015,6 +1027,9 @@ async function loadNextPage() {
|
|
|
1015
1027
|
|
|
1016
1028
|
## State Persistence
|
|
1017
1029
|
|
|
1030
|
+
!!! tip "Use unique state keys"
|
|
1031
|
+
Every table in your application must have a distinct `state-key`. Two tables sharing the same key will silently overwrite each other's persisted column widths, order, and sort state.
|
|
1032
|
+
|
|
1018
1033
|
Persist column widths, column order, hidden columns, sort, and filters across page reloads:
|
|
1019
1034
|
|
|
1020
1035
|
```vue
|
|
@@ -1862,6 +1877,9 @@ function onRowRemove(event: { data: PriceEntry; cancel: () => void }) {
|
|
|
1862
1877
|
|
|
1863
1878
|
## Common Mistakes
|
|
1864
1879
|
|
|
1880
|
+
!!! warning "Performance: avoid mutating the items array in-place"
|
|
1881
|
+
Always replace `items` with a new array reference instead of using `splice` or `push` directly on the reactive array. Vue cannot track in-place mutations reliably in all scenarios, and VcDataTable's row reorder logic depends on receiving a fresh array to reset the pending-reorder state.
|
|
1882
|
+
|
|
1865
1883
|
### 1. Missing `dataKey` with non-`id` identifiers
|
|
1866
1884
|
|
|
1867
1885
|
```vue
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: VcDynamicProperty
|
|
3
|
+
category: components
|
|
4
|
+
group: form
|
|
5
|
+
---
|
|
6
|
+
|
|
1
7
|
# VcDynamicProperty
|
|
2
8
|
|
|
3
9
|
Renders a VirtoCommerce platform dynamic property as the appropriate form control, automatically selecting the input component based on value type, dictionary, and multivalue flags. VcDynamicProperty eliminates the need for manual `v-if` chains when rendering properties whose type is determined at runtime — it maps each combination of `valueType`, `dictionary`, and `multivalue` to the correct input molecule and passes through all relevant props.
|
|
4
10
|
|
|
11
|
+
::storybook id="data-display-vcdynamicproperty--default"
|
|
12
|
+
|
|
5
13
|
## When to Use
|
|
6
14
|
|
|
7
15
|
- Use to render dynamic properties from the VirtoCommerce platform (catalog properties, member properties, store properties, etc.)
|
|
@@ -44,6 +52,8 @@ Renders a VirtoCommerce platform dynamic property as the appropriate form contro
|
|
|
44
52
|
| `measurementsGetter` | `Function` | - | Async loader for measurement units |
|
|
45
53
|
| `rules` | `object` | - | Validation rules: `{ min, max, regex }` |
|
|
46
54
|
|
|
55
|
+
::storybook id="data-display-vcdynamicproperty--property-form" height="500"
|
|
56
|
+
|
|
47
57
|
## Value Type to Component Mapping
|
|
48
58
|
|
|
49
59
|
| valueType | dictionary | multivalue | Component |
|
|
@@ -109,6 +119,8 @@ function handlePropertyUpdate(property: any, newValue: any) {
|
|
|
109
119
|
</template>
|
|
110
120
|
```
|
|
111
121
|
|
|
122
|
+
::storybook id="data-display-vcdynamicproperty--required-with-validation" height="300"
|
|
123
|
+
|
|
112
124
|
## Recipe: Dynamic Property with Validation
|
|
113
125
|
|
|
114
126
|
```vue
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: VcGallery
|
|
3
|
+
category: components
|
|
4
|
+
group: data-display
|
|
5
|
+
---
|
|
6
|
+
|
|
1
7
|
# VcGallery
|
|
2
8
|
|
|
3
9
|
A responsive multi-image gallery with drag-and-drop reorder, file upload, lightbox preview, and per-image actions. VcGallery renders images in a CSS grid that auto-fills based on the container width, with a built-in upload zone tile at the end of the grid. It is the standard component for managing collections of images such as product photos, media libraries, and document attachments.
|
|
4
10
|
|
|
11
|
+
::storybook id="data-display-vcgallery--default"
|
|
12
|
+
|
|
5
13
|
## When to Use
|
|
6
14
|
|
|
7
15
|
- Use **VcGallery** for multi-image fields (product images, media libraries, banner collections).
|
|
@@ -64,12 +72,16 @@ A responsive multi-image gallery with drag-and-drop reorder, file upload, lightb
|
|
|
64
72
|
<VcGallery label="Product Images" required :images="product.images" imagefit="cover" @upload="handleUpload" @sort="handleSort" @edit="handleEdit" @remove="handleRemove" />
|
|
65
73
|
```
|
|
66
74
|
|
|
75
|
+
::storybook id="data-display-vcgallery--filmstrip-default" height="400"
|
|
76
|
+
|
|
67
77
|
## Filmstrip Layout (Default)
|
|
68
78
|
|
|
69
79
|
```vue
|
|
70
80
|
<VcGallery label="Images" :images="product.images" imagefit="cover" @upload="handleUpload" @sort="handleSort" @remove="handleRemove" />
|
|
71
81
|
```
|
|
72
82
|
|
|
83
|
+
::storybook id="data-display-vcgallery--grid-layout" height="400"
|
|
84
|
+
|
|
73
85
|
## Classic Grid Layout
|
|
74
86
|
|
|
75
87
|
```vue
|
|
@@ -128,6 +140,8 @@ function handleRemove(image: ICommonAsset) {
|
|
|
128
140
|
</template>
|
|
129
141
|
```
|
|
130
142
|
|
|
143
|
+
::storybook id="data-display-vcgallery--disabled" height="300"
|
|
144
|
+
|
|
131
145
|
## Recipe: Read-Only Gallery (Disabled)
|
|
132
146
|
|
|
133
147
|
```vue
|
package/runtime/knowledge/docs/ui/components/organisms/vc-image-upload/vc-image-upload.docs.md
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: VcImageUpload
|
|
3
|
+
category: components
|
|
4
|
+
group: media
|
|
5
|
+
---
|
|
6
|
+
|
|
1
7
|
# VcImageUpload
|
|
2
8
|
|
|
3
9
|
A single-image upload organism that displays either a drag-and-drop upload zone or an image tile with preview and remove actions. VcImageUpload manages three visual states automatically: an interactive dropzone when no image is set, an image tile with action overlays when an image is provided, and a disabled empty state with a hint message. It integrates with vee-validate for file validation (size, format) and supports lightbox preview via the built-in VcImageTile component.
|
|
4
10
|
|
|
11
|
+
::storybook id="data-display-vcimageupload--empty"
|
|
12
|
+
|
|
5
13
|
## When to Use
|
|
6
14
|
|
|
7
15
|
- Use **VcImageUpload** for single-image fields (avatar, logo, thumbnail, hero image).
|
|
@@ -31,6 +39,8 @@ A single-image upload organism that displays either a drag-and-drop upload zone
|
|
|
31
39
|
| `upload` | `FileList` | Emitted when files are selected or dropped. |
|
|
32
40
|
| `remove` | `ICommonAsset` | Emitted when the remove button is clicked. |
|
|
33
41
|
|
|
42
|
+
::storybook id="data-display-vcimageupload--with-image" height="300"
|
|
43
|
+
|
|
34
44
|
## Visual States
|
|
35
45
|
|
|
36
46
|
The component has three visual states:
|
|
@@ -83,6 +93,8 @@ function handleRemove() {
|
|
|
83
93
|
</template>
|
|
84
94
|
```
|
|
85
95
|
|
|
96
|
+
::storybook id="data-display-vcimageupload--loading" height="250"
|
|
97
|
+
|
|
86
98
|
## Recipe: Conditional Upload with Loading State
|
|
87
99
|
|
|
88
100
|
```vue
|