@vc-shell/vc-app-skill 2.0.0-alpha.33 → 2.0.0-alpha.34
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 +78 -54
- package/README.md +42 -12
- package/package.json +4 -4
- package/runtime/VERSION +1 -1
- package/runtime/agents/api-analyzer.md +31 -16
- package/runtime/agents/blade-enhancer.md +15 -9
- package/runtime/agents/details-blade-generator.md +47 -31
- package/runtime/agents/list-blade-generator.md +21 -37
- package/runtime/agents/locales-generator.md +3 -0
- package/runtime/agents/migration-agent.md +18 -7
- package/runtime/agents/module-analyzer.md +2 -0
- package/runtime/agents/module-assembler.md +15 -0
- package/runtime/agents/promote-agent.md +15 -4
- package/runtime/agents/type-checker.md +11 -0
- package/runtime/knowledge/docs/_BUILD_HASH.md +1 -1
- package/runtime/knowledge/docs/core/api/platform.docs.md +30 -30
- package/runtime/knowledge/docs/core/blade-navigation/blade-nav-composables.docs.md +41 -41
- package/runtime/knowledge/docs/core/composables/bladeContext/index.docs.md +12 -10
- package/runtime/knowledge/docs/core/composables/useApiClient/useApiClient.docs.md +11 -14
- package/runtime/knowledge/docs/core/composables/useAppBarMobileButtons/useAppBarMobileButtons.docs.md +35 -35
- package/runtime/knowledge/docs/core/composables/useAppBarWidget/useAppBarWidget.docs.md +35 -35
- package/runtime/knowledge/docs/core/composables/useAppInsights/useAppInsights.docs.md +15 -15
- package/runtime/knowledge/docs/core/composables/useAssets/useAssets.docs.md +21 -18
- package/runtime/knowledge/docs/core/composables/useAssetsManager/useAssetsManager.docs.md +28 -24
- package/runtime/knowledge/docs/core/composables/useAsync/useAsync.docs.md +90 -61
- package/runtime/knowledge/docs/core/composables/useBeforeUnload/useBeforeUnload.docs.md +19 -18
- package/runtime/knowledge/docs/core/composables/useBlade/useBlade.docs.md +89 -68
- package/runtime/knowledge/docs/core/composables/useBladeForm/useBladeForm.docs.md +27 -25
- package/runtime/knowledge/docs/core/composables/useBladeRegistry/useBladeRegistry.docs.md +15 -15
- package/runtime/knowledge/docs/core/composables/useBladeWidgets/index.docs.md +43 -47
- package/runtime/knowledge/docs/core/composables/useBreadcrumbs/useBreadcrumbs.docs.md +11 -11
- package/runtime/knowledge/docs/core/composables/useConnectionStatus/useConnectionStatus.docs.md +27 -15
- package/runtime/knowledge/docs/core/composables/useDashboard/useDashboard.docs.md +30 -30
- package/runtime/knowledge/docs/core/composables/useDynamicProperties/useDynamicProperties.docs.md +34 -36
- package/runtime/knowledge/docs/core/composables/useErrorHandler/useErrorHandler.docs.md +44 -23
- package/runtime/knowledge/docs/core/composables/useFunctions/useFunctions.docs.md +14 -11
- package/runtime/knowledge/docs/core/composables/useKeyboardNavigation/useKeyboardNavigation.docs.md +47 -38
- package/runtime/knowledge/docs/core/composables/useLanguages/useLanguages.docs.md +37 -28
- package/runtime/knowledge/docs/core/composables/useLoading/useLoading.docs.md +23 -17
- package/runtime/knowledge/docs/core/composables/useMenuExpanded/index.docs.md +9 -9
- package/runtime/knowledge/docs/core/composables/useMenuService/useMenuService.docs.md +42 -42
- package/runtime/knowledge/docs/core/composables/useModificationTracker/useModificationTracker.docs.md +22 -12
- package/runtime/knowledge/docs/core/composables/useNotifications/useNotifications.docs.md +33 -41
- package/runtime/knowledge/docs/core/composables/usePermissions/usePermissions.docs.md +16 -16
- package/runtime/knowledge/docs/core/composables/usePlatformLocaleSync/usePlatformLocaleSync.docs.md +28 -0
- package/runtime/knowledge/docs/core/composables/usePopup/usePopup.docs.md +32 -24
- package/runtime/knowledge/docs/core/composables/useResponsive/useResponsive.docs.md +32 -11
- package/runtime/knowledge/docs/core/composables/useSettings/useSettings.docs.md +22 -13
- package/runtime/knowledge/docs/core/composables/useSettingsMenu/useSettingsMenu.docs.md +7 -7
- package/runtime/knowledge/docs/core/composables/useSidebarState/useSidebarState.docs.md +32 -24
- package/runtime/knowledge/docs/core/composables/useSlowNetworkDetection/useSlowNetworkDetection.docs.md +21 -17
- package/runtime/knowledge/docs/core/composables/useTheme/useTheme.docs.md +24 -24
- package/runtime/knowledge/docs/core/composables/useToolbar/useToolbar.docs.md +28 -31
- package/runtime/knowledge/docs/core/composables/useUser/useUser.docs.md +43 -24
- package/runtime/knowledge/docs/core/composables/useUserManagement/useUserManagement.docs.md +68 -48
- package/runtime/knowledge/docs/core/composables/useWebVitals/useWebVitals.docs.md +19 -19
- package/runtime/knowledge/docs/core/composables/useWidgets/useWidgets.docs.md +42 -47
- package/runtime/knowledge/docs/core/directives/autofocus/autofocus.docs.md +10 -4
- package/runtime/knowledge/docs/core/directives/loading/loading.docs.md +35 -20
- package/runtime/knowledge/docs/core/notifications/notifications.docs.md +36 -35
- package/runtime/knowledge/docs/core/plugins/ai-agent/ai-agent.docs.md +38 -38
- package/runtime/knowledge/docs/core/plugins/extension-points/extension-points.docs.md +79 -62
- package/runtime/knowledge/docs/core/plugins/global-error-handler/global-error-handler.docs.md +10 -10
- package/runtime/knowledge/docs/core/plugins/i18n/i18n.docs.md +21 -23
- package/runtime/knowledge/docs/core/plugins/modularity/modularity.docs.md +91 -83
- package/runtime/knowledge/docs/core/plugins/permissions/permissions.docs.md +10 -16
- package/runtime/knowledge/docs/core/plugins/signalR/signalR.docs.md +9 -9
- package/runtime/knowledge/docs/core/plugins/validation/validation.docs.md +65 -22
- package/runtime/knowledge/docs/core/services/services.docs.md +19 -22
- package/runtime/knowledge/docs/core/types/types.docs.md +40 -40
- package/runtime/knowledge/docs/core/utilities/date/date-utilities.docs.md +27 -27
- package/runtime/knowledge/docs/core/utilities/shared-utilities.docs.md +23 -23
- package/runtime/knowledge/docs/core/utilities/thumbnail/thumbnail.docs.md +22 -25
- package/runtime/knowledge/docs/core/utilities/utilities.docs.md +64 -64
- package/runtime/knowledge/docs/injection-keys.docs.md +52 -51
- package/runtime/knowledge/docs/modules/assets-manager/assets-manager.docs.md +9 -9
- package/runtime/knowledge/docs/shell/_internal/popup/common/popup-common.docs.md +23 -43
- package/runtime/knowledge/docs/shell/auth/ChangePasswordPage/change-password-page.docs.md +5 -5
- package/runtime/knowledge/docs/shell/auth/ForgotPasswordPage/forgot-password-page.docs.md +5 -5
- package/runtime/knowledge/docs/shell/auth/InvitePage/invite-page.docs.md +8 -7
- package/runtime/knowledge/docs/shell/auth/LoginPage/login-page.docs.md +7 -7
- package/runtime/knowledge/docs/shell/auth/ResetPasswordPage/reset-password-page.docs.md +8 -7
- package/runtime/knowledge/docs/shell/auth/sign-in/sign-in.docs.md +29 -13
- package/runtime/knowledge/docs/shell/components/change-password/change-password.docs.md +13 -16
- package/runtime/knowledge/docs/shell/components/change-password-button/change-password-button.docs.md +1 -7
- package/runtime/knowledge/docs/shell/components/error-interceptor/error-interceptor.docs.md +5 -5
- package/runtime/knowledge/docs/shell/components/language-selector/language-selector.docs.md +1 -1
- package/runtime/knowledge/docs/shell/components/logout-button/logout-button.docs.md +1 -1
- package/runtime/knowledge/docs/shell/components/notification-template/notification-template.docs.md +17 -9
- package/runtime/knowledge/docs/shell/components/settings-menu/settings-menu.docs.md +11 -17
- package/runtime/knowledge/docs/shell/components/settings-menu-item/settings-menu-item.docs.md +34 -65
- package/runtime/knowledge/docs/shell/components/sidebar/sidebar.docs.md +16 -26
- package/runtime/knowledge/docs/shell/components/theme-selector/theme-selector.docs.md +2 -2
- package/runtime/knowledge/docs/shell/components/user-dropdown-button/user-dropdown-button.docs.md +7 -9
- package/runtime/knowledge/docs/shell/dashboard/dashboard-charts/dashboard-charts.docs.md +30 -40
- package/runtime/knowledge/docs/shell/dashboard/dashboard-widget-card/dashboard-widget-card.docs.md +26 -19
- package/runtime/knowledge/docs/shell/dashboard/draggable-dashboard/draggable-dashboard.docs.md +15 -12
- package/runtime/knowledge/docs/ui/components/atoms/vc-badge/vc-badge.docs.md +15 -26
- package/runtime/knowledge/docs/ui/components/atoms/vc-banner/vc-banner.docs.md +21 -19
- package/runtime/knowledge/docs/ui/components/atoms/vc-button/vc-button.docs.md +83 -67
- package/runtime/knowledge/docs/ui/components/atoms/vc-card/vc-card.docs.md +100 -59
- package/runtime/knowledge/docs/ui/components/atoms/vc-col/vc-col.docs.md +28 -11
- package/runtime/knowledge/docs/ui/components/atoms/vc-container/vc-container.docs.md +20 -17
- package/runtime/knowledge/docs/ui/components/atoms/vc-hint/vc-hint.docs.md +26 -17
- package/runtime/knowledge/docs/ui/components/atoms/vc-icon/vc-icon.docs.md +30 -32
- package/runtime/knowledge/docs/ui/components/atoms/vc-image/vc-image.docs.md +25 -48
- package/runtime/knowledge/docs/ui/components/atoms/vc-label/vc-label.docs.md +29 -24
- package/runtime/knowledge/docs/ui/components/atoms/vc-link/vc-link.docs.md +23 -15
- package/runtime/knowledge/docs/ui/components/atoms/vc-loading/vc-loading.docs.md +22 -13
- package/runtime/knowledge/docs/ui/components/atoms/vc-progress/vc-progress.docs.md +33 -18
- package/runtime/knowledge/docs/ui/components/atoms/vc-row/vc-row.docs.md +56 -15
- package/runtime/knowledge/docs/ui/components/atoms/vc-scrollable-container/vc-scrollable-container.docs.md +28 -15
- package/runtime/knowledge/docs/ui/components/atoms/vc-skeleton/vc-skeleton.docs.md +40 -20
- package/runtime/knowledge/docs/ui/components/atoms/vc-status/vc-status.docs.md +25 -14
- package/runtime/knowledge/docs/ui/components/atoms/vc-status-icon/vc-status-icon.docs.md +40 -14
- package/runtime/knowledge/docs/ui/components/atoms/vc-tooltip/vc-tooltip.docs.md +54 -42
- package/runtime/knowledge/docs/ui/components/atoms/vc-video/vc-video.docs.md +17 -17
- package/runtime/knowledge/docs/ui/components/atoms/vc-widget/vc-widget.docs.md +21 -21
- package/runtime/knowledge/docs/ui/components/molecules/multilanguage-selector/multilanguage-selector.docs.md +23 -10
- package/runtime/knowledge/docs/ui/components/molecules/vc-accordion/vc-accordion.docs.md +55 -44
- package/runtime/knowledge/docs/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.docs.md +23 -20
- package/runtime/knowledge/docs/ui/components/molecules/vc-checkbox/vc-checkbox.docs.md +92 -65
- package/runtime/knowledge/docs/ui/components/molecules/vc-checkbox-group/vc-checkbox-group.docs.md +22 -36
- package/runtime/knowledge/docs/ui/components/molecules/vc-color-input/vc-color-input.docs.md +65 -23
- package/runtime/knowledge/docs/ui/components/molecules/vc-date-picker/vc-date-picker.docs.md +52 -73
- package/runtime/knowledge/docs/ui/components/molecules/vc-dropdown/vc-dropdown.docs.md +91 -85
- package/runtime/knowledge/docs/ui/components/molecules/vc-dropdown-panel/vc-dropdown-panel.docs.md +38 -42
- package/runtime/knowledge/docs/ui/components/molecules/vc-editor/vc-editor.docs.md +56 -73
- package/runtime/knowledge/docs/ui/components/molecules/vc-field/vc-field.docs.md +61 -27
- package/runtime/knowledge/docs/ui/components/molecules/vc-file-upload/vc-file-upload.docs.md +42 -50
- package/runtime/knowledge/docs/ui/components/molecules/vc-form/vc-form.docs.md +35 -64
- package/runtime/knowledge/docs/ui/components/molecules/vc-image-tile/vc-image-tile.docs.md +38 -41
- package/runtime/knowledge/docs/ui/components/molecules/vc-input/vc-input.docs.md +109 -131
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-currency/vc-input-currency.docs.md +47 -88
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.docs.md +50 -64
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-group/vc-input-group.docs.md +29 -24
- package/runtime/knowledge/docs/ui/components/molecules/vc-menu/vc-menu.docs.md +32 -28
- package/runtime/knowledge/docs/ui/components/molecules/vc-multivalue/vc-multivalue.docs.md +57 -65
- package/runtime/knowledge/docs/ui/components/molecules/vc-pagination/vc-pagination.docs.md +28 -26
- package/runtime/knowledge/docs/ui/components/molecules/vc-radio-button/vc-radio-button.docs.md +55 -20
- package/runtime/knowledge/docs/ui/components/molecules/vc-radio-group/vc-radio-group.docs.md +21 -35
- package/runtime/knowledge/docs/ui/components/molecules/vc-rating/vc-rating.docs.md +38 -33
- package/runtime/knowledge/docs/ui/components/molecules/vc-select/vc-select.docs.md +72 -83
- package/runtime/knowledge/docs/ui/components/molecules/vc-slider/vc-slider.docs.md +21 -16
- package/runtime/knowledge/docs/ui/components/molecules/vc-switch/vc-switch.docs.md +55 -64
- package/runtime/knowledge/docs/ui/components/molecules/vc-textarea/vc-textarea.docs.md +51 -70
- package/runtime/knowledge/docs/ui/components/molecules/vc-toast/vc-toast.docs.md +58 -57
- package/runtime/knowledge/docs/ui/components/organisms/vc-app/vc-app.docs.md +49 -26
- package/runtime/knowledge/docs/ui/components/organisms/vc-auth-layout/vc-auth-layout.docs.md +82 -28
- package/runtime/knowledge/docs/ui/components/organisms/vc-blade/vc-blade.docs.md +90 -75
- package/runtime/knowledge/docs/ui/components/organisms/vc-data-table/composables/table-composables.docs.md +99 -48
- package/runtime/knowledge/docs/ui/components/organisms/vc-data-table/vc-data-table.docs.md +548 -367
- package/runtime/knowledge/docs/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.docs.md +35 -52
- package/runtime/knowledge/docs/ui/components/organisms/vc-gallery/vc-gallery.docs.md +33 -62
- package/runtime/knowledge/docs/ui/components/organisms/vc-image-upload/vc-image-upload.docs.md +17 -23
- package/runtime/knowledge/docs/ui/components/organisms/vc-popup/vc-popup.docs.md +109 -68
- package/runtime/knowledge/docs/ui/components/organisms/vc-sidebar/vc-sidebar.docs.md +82 -44
- package/runtime/knowledge/docs/ui/composables/ui-composables.docs.md +8 -8
- package/runtime/knowledge/docs/ui/composables/useDataTablePagination.docs.md +164 -0
- package/runtime/knowledge/docs/ui/composables/useDataTableSort.docs.md +34 -26
- package/runtime/knowledge/docs/ui/composables/useTableSelection.docs.md +48 -40
- package/runtime/knowledge/docs/ui/composables/useTableSort.docs.md +30 -17
- package/runtime/knowledge/docs/ui/types/ui-types.docs.md +40 -29
- package/runtime/knowledge/examples/offers-module.md +15 -13
- package/runtime/knowledge/examples/team-module.md +82 -119
- package/runtime/knowledge/examples/videos-module.md +44 -17
- package/runtime/knowledge/index.md +22 -0
- package/runtime/knowledge/migration-prompts/blade-form-migration.md +17 -8
- package/runtime/knowledge/migration-prompts/blade-props-migration.md +1 -2
- package/runtime/knowledge/migration-prompts/datatable-migration.md +801 -0
- package/runtime/knowledge/migration-prompts/icon-migration.md +97 -0
- package/runtime/knowledge/migration-prompts/manual-migration-audit.md +117 -0
- package/runtime/knowledge/migration-prompts/notifications-migration.md +8 -3
- package/runtime/knowledge/migration-prompts/nswag-migration.md +25 -29
- package/runtime/knowledge/migration-prompts/use-assets-migration.md +164 -0
- package/runtime/knowledge/migration-prompts/use-data-table-pagination-migration.md +176 -0
- package/runtime/knowledge/migration-prompts/widgets-migration.md +48 -27
- package/runtime/knowledge/patterns/assets-management.md +20 -20
- package/runtime/knowledge/patterns/blade-navigation.md +7 -14
- package/runtime/knowledge/patterns/blade-widget.md +19 -17
- package/runtime/knowledge/patterns/child-blade-flow.md +19 -7
- package/runtime/knowledge/patterns/composable-details.md +20 -50
- package/runtime/knowledge/patterns/composable-list.md +43 -31
- package/runtime/knowledge/patterns/dashboard-widget.md +14 -16
- package/runtime/knowledge/patterns/datatable-pattern.md +521 -0
- package/runtime/knowledge/patterns/details-blade-pattern.md +78 -116
- package/runtime/knowledge/patterns/extension-points-usage.md +53 -44
- package/runtime/knowledge/patterns/form-validation.md +28 -64
- package/runtime/knowledge/patterns/list-blade-pattern.md +33 -21
- package/runtime/knowledge/patterns/module-structure.md +7 -1
- package/runtime/knowledge/patterns/multilanguage-fields.md +8 -14
- package/runtime/knowledge/patterns/notification-template.md +21 -14
- package/runtime/knowledge/patterns/signalr-notifications.md +30 -32
- package/runtime/knowledge/patterns/toolbar-pattern.md +18 -20
- package/runtime/vc-app.md +241 -62
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# Form Validation Pattern
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
Secondary source: `apps/vendor-portal/src/modules/offers/pages/offers-details.vue`
|
|
3
|
+
Generic worked example for form validation in details blades.
|
|
5
4
|
|
|
6
5
|
## Overview
|
|
7
6
|
|
|
@@ -18,12 +17,7 @@ Every validated field follows the same three-part contract:
|
|
|
18
17
|
3. `handleChange` keeps vee-validate in sync on every update
|
|
19
18
|
|
|
20
19
|
```vue
|
|
21
|
-
<Field
|
|
22
|
-
v-slot="{ errorMessage, handleChange, errors }"
|
|
23
|
-
:model-value="item.name"
|
|
24
|
-
name="name"
|
|
25
|
-
rules="required"
|
|
26
|
-
>
|
|
20
|
+
<Field v-slot="{ errorMessage, handleChange, errors }" :model-value="item.name" name="name" rules="required">
|
|
27
21
|
<VcInput
|
|
28
22
|
v-model="item.name"
|
|
29
23
|
label="Name"
|
|
@@ -46,12 +40,7 @@ The same pattern applies to every vc-shell input. Only the inner component chang
|
|
|
46
40
|
### VcSelect
|
|
47
41
|
|
|
48
42
|
```vue
|
|
49
|
-
<Field
|
|
50
|
-
v-slot="{ errorMessage, handleChange, errors }"
|
|
51
|
-
:model-value="item.categoryId"
|
|
52
|
-
name="categoryId"
|
|
53
|
-
rules="required"
|
|
54
|
-
>
|
|
43
|
+
<Field v-slot="{ errorMessage, handleChange, errors }" :model-value="item.categoryId" name="categoryId" rules="required">
|
|
55
44
|
<VcSelect
|
|
56
45
|
v-model="item.categoryId"
|
|
57
46
|
label="Category"
|
|
@@ -70,12 +59,7 @@ The same pattern applies to every vc-shell input. Only the inner component chang
|
|
|
70
59
|
### VcEditor (Rich Text)
|
|
71
60
|
|
|
72
61
|
```vue
|
|
73
|
-
<Field
|
|
74
|
-
v-slot="{ errorMessage, handleChange, errors }"
|
|
75
|
-
:model-value="item.description"
|
|
76
|
-
name="description"
|
|
77
|
-
rules="required"
|
|
78
|
-
>
|
|
62
|
+
<Field v-slot="{ errorMessage, handleChange, errors }" :model-value="item.description" name="description" rules="required">
|
|
79
63
|
<VcEditor
|
|
80
64
|
v-model="item.description"
|
|
81
65
|
label="Description"
|
|
@@ -90,12 +74,7 @@ The same pattern applies to every vc-shell input. Only the inner component chang
|
|
|
90
74
|
### VcTextarea
|
|
91
75
|
|
|
92
76
|
```vue
|
|
93
|
-
<Field
|
|
94
|
-
v-slot="{ errorMessage, handleChange, errors }"
|
|
95
|
-
:model-value="item.notes"
|
|
96
|
-
name="notes"
|
|
97
|
-
rules="required|min:10"
|
|
98
|
-
>
|
|
77
|
+
<Field v-slot="{ errorMessage, handleChange, errors }" :model-value="item.notes" name="notes" rules="required|min:10">
|
|
99
78
|
<VcTextarea
|
|
100
79
|
v-model="item.notes"
|
|
101
80
|
label="Notes"
|
|
@@ -124,29 +103,29 @@ Rules are composed with `|` (pipe) in the `rules` string.
|
|
|
124
103
|
|
|
125
104
|
### Standard Rules (from @vee-validate/rules)
|
|
126
105
|
|
|
127
|
-
| Rule
|
|
128
|
-
|
|
129
|
-
| `required`
|
|
130
|
-
| `email`
|
|
131
|
-
| `min:N`
|
|
132
|
-
| `max:N`
|
|
133
|
-
| `min_value:N` | `"min_value:0"`
|
|
134
|
-
| `between:N,M` | `"between:1,100"`
|
|
135
|
-
| `numeric`
|
|
136
|
-
| `alpha_dash`
|
|
137
|
-
| `regex:P`
|
|
138
|
-
| `confirmed:F` | `"confirmed:password"` | Must match another field
|
|
139
|
-
| `url`
|
|
106
|
+
| Rule | Example | Description |
|
|
107
|
+
| ------------- | ---------------------- | ------------------------------------ |
|
|
108
|
+
| `required` | `"required"` | Must have a value |
|
|
109
|
+
| `email` | `"required\|email"` | Valid email format |
|
|
110
|
+
| `min:N` | `"required\|min:3"` | Minimum string length |
|
|
111
|
+
| `max:N` | `"max:255"` | Maximum string length |
|
|
112
|
+
| `min_value:N` | `"min_value:0"` | Minimum numeric value |
|
|
113
|
+
| `between:N,M` | `"between:1,100"` | Numeric range |
|
|
114
|
+
| `numeric` | `"numeric"` | Digits only |
|
|
115
|
+
| `alpha_dash` | `"alpha_dash"` | Letters, digits, dashes, underscores |
|
|
116
|
+
| `regex:P` | `"regex:^[A-Z]+"` | Custom regex match |
|
|
117
|
+
| `confirmed:F` | `"confirmed:password"` | Must match another field |
|
|
118
|
+
| `url` | `"url"` | Valid URL format |
|
|
140
119
|
|
|
141
120
|
### Custom vc-shell Rules
|
|
142
121
|
|
|
143
|
-
| Rule
|
|
144
|
-
|
|
145
|
-
| `bigint`
|
|
146
|
-
| `mindimensions` | `[width, height]` | Image meets minimum pixel dimensions
|
|
147
|
-
| `fileWeight`
|
|
148
|
-
| `before`
|
|
149
|
-
| `after`
|
|
122
|
+
| Rule | Params | Description |
|
|
123
|
+
| --------------- | ----------------- | ------------------------------------------------ |
|
|
124
|
+
| `bigint` | -- | Value is a safe integer (`Number.isSafeInteger`) |
|
|
125
|
+
| `mindimensions` | `[width, height]` | Image meets minimum pixel dimensions |
|
|
126
|
+
| `fileWeight` | `[sizeInKB]` | File size under limit (KB) |
|
|
127
|
+
| `before` | `[targetDate]` | Date is before target |
|
|
128
|
+
| `after` | `[targetDate]` | Date is after target |
|
|
150
129
|
|
|
151
130
|
---
|
|
152
131
|
|
|
@@ -197,12 +176,7 @@ When rules depend on reactive state, use a computed or `:rules` binding:
|
|
|
197
176
|
|
|
198
177
|
```vue
|
|
199
178
|
<!-- Conditionally required -->
|
|
200
|
-
<Field
|
|
201
|
-
:rules="item.trackInventory ? 'required|bigint|min_value:0' : 'bigint|min_value:0'"
|
|
202
|
-
:model-value="item.quantity"
|
|
203
|
-
name="quantity"
|
|
204
|
-
v-slot="{ errorMessage, handleChange, errors }"
|
|
205
|
-
>
|
|
179
|
+
<Field :rules="item.trackInventory ? 'required|bigint|min_value:0' : 'bigint|min_value:0'" :model-value="item.quantity" name="quantity" v-slot="{ errorMessage, handleChange, errors }">
|
|
206
180
|
<VcInput
|
|
207
181
|
v-model="item.quantity"
|
|
208
182
|
type="number"
|
|
@@ -277,12 +251,7 @@ const endDateRules = computed(() => `required|after:${startDate.value}`);
|
|
|
277
251
|
### Password Confirmation
|
|
278
252
|
|
|
279
253
|
```vue
|
|
280
|
-
<Field
|
|
281
|
-
v-slot="{ errorMessage, handleChange, errors }"
|
|
282
|
-
:model-value="password"
|
|
283
|
-
name="password"
|
|
284
|
-
rules="required|min:8"
|
|
285
|
-
>
|
|
254
|
+
<Field v-slot="{ errorMessage, handleChange, errors }" :model-value="password" name="password" rules="required|min:8">
|
|
286
255
|
<VcInput
|
|
287
256
|
v-model="password"
|
|
288
257
|
type="password"
|
|
@@ -294,12 +263,7 @@ const endDateRules = computed(() => `required|after:${startDate.value}`);
|
|
|
294
263
|
/>
|
|
295
264
|
</Field>
|
|
296
265
|
|
|
297
|
-
<Field
|
|
298
|
-
v-slot="{ errorMessage, handleChange, errors }"
|
|
299
|
-
:model-value="confirmPassword"
|
|
300
|
-
name="confirmPassword"
|
|
301
|
-
rules="required|confirmed:password"
|
|
302
|
-
>
|
|
266
|
+
<Field v-slot="{ errorMessage, handleChange, errors }" :model-value="confirmPassword" name="confirmPassword" rules="required|confirmed:password">
|
|
303
267
|
<VcInput
|
|
304
268
|
v-model="confirmPassword"
|
|
305
269
|
type="password"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Describes the full structure of a list blade: workspace entry point with `VcBlade` + `VcDataTable`, sort, pagination, toolbar, and child blade navigation.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Generic worked example for a typical list blade (search, sort, pagination, row actions).
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -80,11 +80,13 @@ Source: extracted from `apps/vendor-portal/src/modules/orders/pages/orders-list.
|
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
**CRITICAL: Do NOT use `v-for` to render columns.** Declare each `<VcColumn>` explicitly in the template. This is necessary for:
|
|
83
|
+
|
|
83
84
|
- Custom `#body` slots (status badges, images, formatted values)
|
|
84
85
|
- Per-column `mobile-role` / `mobile-position` attributes
|
|
85
86
|
- Readability and maintainability
|
|
86
87
|
|
|
87
88
|
**Key VcDataTable props:**
|
|
89
|
+
|
|
88
90
|
- `state-key` — unique string key for persisting column widths/order/visibility to localStorage. Use snake_case module name (e.g., `"team_list"`, `"catalog_list"`).
|
|
89
91
|
- `v-model:active-item-id` — highlights the currently open row. Bind to `selectedItemId` ref.
|
|
90
92
|
- `v-model:sort-field` and `v-model:sort-order` — two-way sort binding from `useDataTableSort`.
|
|
@@ -97,17 +99,17 @@ Source: extracted from `apps/vendor-portal/src/modules/orders/pages/orders-list.
|
|
|
97
99
|
|
|
98
100
|
VcColumn `type` prop determines built-in rendering:
|
|
99
101
|
|
|
100
|
-
| Type
|
|
101
|
-
|
|
102
|
-
|
|
|
103
|
-
| `"date-ago"`
|
|
104
|
-
| `"date"`
|
|
105
|
-
| `"datetime"`
|
|
106
|
-
| `"money"`
|
|
107
|
-
| `"number"`
|
|
108
|
-
| `"image"`
|
|
109
|
-
| `"status"`
|
|
110
|
-
| `"status-icon"` | Boolean icon
|
|
102
|
+
| Type | Renders as | When to use |
|
|
103
|
+
| --------------- | ----------------------------- | ------------------------------------------------------------ |
|
|
104
|
+
| _(none)_ | Plain text | Default for string fields |
|
|
105
|
+
| `"date-ago"` | Relative time ("2 hours ago") | Dates in list blades — preferred over `"date-time"` |
|
|
106
|
+
| `"date"` | Formatted date | Date-only fields |
|
|
107
|
+
| `"datetime"` | Formatted date+time | When full timestamp needed |
|
|
108
|
+
| `"money"` | Formatted currency | Monetary values (reads `currency` field from row by default) |
|
|
109
|
+
| `"number"` | Formatted number | Numeric fields |
|
|
110
|
+
| `"image"` | Thumbnail | Image URL fields |
|
|
111
|
+
| `"status"` | Status badge area | Status/state fields (use with `#body` slot + `VcStatus`) |
|
|
112
|
+
| `"status-icon"` | Boolean icon | Boolean on/off fields (e.g., `isActive`) |
|
|
111
113
|
|
|
112
114
|
**CRITICAL:** Use `"date-ago"` (NOT `"date-time"`) for dates in list blades. `"date-time"` is the legacy `ITableColumnsBase` format — VcColumn uses `"datetime"` or `"date-ago"`.
|
|
113
115
|
|
|
@@ -118,12 +120,14 @@ VcColumn `type` prop determines built-in rendering:
|
|
|
118
120
|
Each VcColumn can specify its position in the mobile card layout:
|
|
119
121
|
|
|
120
122
|
**`mobile-position`** — where the column appears in the card grid:
|
|
123
|
+
|
|
121
124
|
- `"top-left"` — primary identifier (name, title)
|
|
122
125
|
- `"top-right"` — secondary value (price, total)
|
|
123
126
|
- `"bottom-left"` — tertiary info (SKU, category)
|
|
124
127
|
- `"bottom-right"` — timestamp or date
|
|
125
128
|
|
|
126
129
|
**`mobile-role`** — special rendering roles:
|
|
130
|
+
|
|
127
131
|
- `"image"` — displayed as card thumbnail on the left
|
|
128
132
|
- `"status"` — displayed as status badge at bottom
|
|
129
133
|
- `"title"` — main card title
|
|
@@ -136,14 +140,7 @@ Each VcColumn can specify its position in the mobile card layout:
|
|
|
136
140
|
For fields that represent a status/state (e.g., order status, approval state), use `VcStatus` component in a `#body` slot:
|
|
137
141
|
|
|
138
142
|
```vue
|
|
139
|
-
<VcColumn
|
|
140
|
-
id="status"
|
|
141
|
-
:title="t('XXX.PAGES.LIST.TABLE.HEADER.STATUS')"
|
|
142
|
-
:always-visible="true"
|
|
143
|
-
:sortable="true"
|
|
144
|
-
type="status"
|
|
145
|
-
mobile-role="status"
|
|
146
|
-
>
|
|
143
|
+
<VcColumn id="status" :title="t('XXX.PAGES.LIST.TABLE.HEADER.STATUS')" :always-visible="true" :sortable="true" type="status" mobile-role="status">
|
|
147
144
|
<template #body="{ data }">
|
|
148
145
|
<VcStatus :variant="statusVariant(data.status)">
|
|
149
146
|
{{ data.status }}
|
|
@@ -203,7 +200,7 @@ defineBlade({
|
|
|
203
200
|
name: "XxxList",
|
|
204
201
|
url: "/xxx",
|
|
205
202
|
isWorkspace: true,
|
|
206
|
-
permissions: ["xxx:manage"],
|
|
203
|
+
permissions: ["xxx:manage"], // array of permission strings from your UserPermissions enum
|
|
207
204
|
menuItem: {
|
|
208
205
|
title: "XXX.MENU.TITLE",
|
|
209
206
|
icon: "lucide-<icon>",
|
|
@@ -330,43 +327,54 @@ exposeToChildren({ reload });
|
|
|
330
327
|
## Key Rules
|
|
331
328
|
|
|
332
329
|
### `defineBlade` placement
|
|
330
|
+
|
|
333
331
|
`defineBlade(...)` is a compiler macro (like `defineProps`). It must be called at the **top level of `<script setup>`**, not inside any function or conditional. The framework registers blade config at module parse time.
|
|
334
332
|
|
|
335
333
|
### `useDataTableSort` — three outputs
|
|
334
|
+
|
|
336
335
|
```ts
|
|
337
336
|
const { sortField, sortOrder, sortExpression } = useDataTableSort({
|
|
338
337
|
initialField: "createdDate",
|
|
339
338
|
initialDirection: "DESC",
|
|
340
339
|
});
|
|
341
340
|
```
|
|
341
|
+
|
|
342
342
|
- `sortField` — reactive ref, two-way bound to `VcDataTable` via `v-model:sort-field`
|
|
343
343
|
- `sortOrder` — reactive ref (`"ASC"` | `"DESC"`), two-way bound via `v-model:sort-order`
|
|
344
344
|
- `sortExpression` — computed string `"field:DIR"` (e.g., `"createdDate:DESC"`), passed to the API
|
|
345
345
|
|
|
346
346
|
### Sort watcher pattern
|
|
347
|
+
|
|
347
348
|
```ts
|
|
348
349
|
watch(sortExpression, async (value) => {
|
|
349
350
|
await getXxxs({ ...searchQuery.value, sort: value });
|
|
350
351
|
});
|
|
351
352
|
```
|
|
353
|
+
|
|
352
354
|
Watch `sortExpression` (not `sortField`/`sortOrder` separately) to trigger a reload whenever sort changes.
|
|
353
355
|
|
|
354
356
|
### `exposeToChildren`
|
|
357
|
+
|
|
355
358
|
```ts
|
|
356
359
|
exposeToChildren({ reload });
|
|
357
360
|
```
|
|
361
|
+
|
|
358
362
|
Call this ONCE at the end of setup. The details blade calls `callParent("reload")` after save/delete, which invokes this `reload` function.
|
|
359
363
|
|
|
360
364
|
### Column declaration — explicit, NOT v-for
|
|
365
|
+
|
|
361
366
|
**CRITICAL:** Always declare each `<VcColumn>` explicitly in the template. Do NOT use `v-for` with a computed array.
|
|
362
367
|
|
|
363
368
|
Why:
|
|
369
|
+
|
|
364
370
|
- Allows `#body` slots for custom rendering (VcStatus, images, formatted values)
|
|
365
371
|
- Allows per-column `mobile-role` and `mobile-position` attributes
|
|
366
372
|
- Makes the template self-documenting and easier to customize
|
|
367
373
|
|
|
368
374
|
### Column type selection rules
|
|
375
|
+
|
|
369
376
|
When choosing `type` for each column, apply these rules based on the field's data type from the API:
|
|
377
|
+
|
|
370
378
|
- **String enum / status field** (field name contains "status", "state") → `type="status"` + `#body` slot with `VcStatus`
|
|
371
379
|
- **Boolean field** (field name starts with "is", "has", "can") → `type="status-icon"`
|
|
372
380
|
- **Date/DateTime field** (field name contains "date", "created", "modified", "updated") → `type="date-ago"` for list blades
|
|
@@ -376,7 +384,9 @@ When choosing `type` for each column, apply these rules based on the field's dat
|
|
|
376
384
|
- **Everything else** → no type (plain text)
|
|
377
385
|
|
|
378
386
|
### Mobile layout assignment rules
|
|
387
|
+
|
|
379
388
|
Assign mobile attributes based on column semantic role:
|
|
389
|
+
|
|
380
390
|
- **Primary identifier** (name, number, title) → `mobile-position="top-left"`
|
|
381
391
|
- **Image** → `mobile-role="image"` + `:always-visible="true"`
|
|
382
392
|
- **Status** → `mobile-role="status"`
|
|
@@ -385,7 +395,9 @@ Assign mobile attributes based on column semantic role:
|
|
|
385
395
|
- **Date** → `mobile-position="bottom-right"`
|
|
386
396
|
|
|
387
397
|
### `state-key` naming
|
|
398
|
+
|
|
388
399
|
Use snake_case: `"team_list"`, `"catalog_items"`, `"orders_list"`. Must be unique across all modules in the app.
|
|
389
400
|
|
|
390
401
|
### List-only blades (no details)
|
|
402
|
+
|
|
391
403
|
For read-only list blades, omit `onItemClick` and the `addItem` toolbar button. Keep `exposeToChildren({ reload })` only if a parent blade might need to refresh this list.
|
|
@@ -72,6 +72,7 @@ export * from "./composables";
|
|
|
72
72
|
```
|
|
73
73
|
|
|
74
74
|
**Rules:**
|
|
75
|
+
|
|
75
76
|
- `blades: pages` — passes the pages namespace object (all named exports from `pages/index.ts`)
|
|
76
77
|
- `locales` — passes the locales namespace object
|
|
77
78
|
- Re-export `pages` and `composables` so callers can import blades/composables directly from the module package
|
|
@@ -89,6 +90,7 @@ export { default as XxxDetails } from "./xxx-details.vue";
|
|
|
89
90
|
```
|
|
90
91
|
|
|
91
92
|
Real example:
|
|
93
|
+
|
|
92
94
|
```ts
|
|
93
95
|
export { default as TeamList } from "./team-list.vue";
|
|
94
96
|
export { default as TeamMemberDetails } from "./team-member-details.vue";
|
|
@@ -106,12 +108,14 @@ export { default as useXxx } from "./useXxx";
|
|
|
106
108
|
```
|
|
107
109
|
|
|
108
110
|
Real example:
|
|
111
|
+
|
|
109
112
|
```ts
|
|
110
113
|
export { default as useTeamMembers } from "./useTeamMembers";
|
|
111
114
|
export { default as useTeamMember } from "./useTeamMember";
|
|
112
115
|
```
|
|
113
116
|
|
|
114
117
|
For list-only modules, only the plural composable is exported:
|
|
118
|
+
|
|
115
119
|
```ts
|
|
116
120
|
export { default as useCatalogItems } from "./useCatalogItems";
|
|
117
121
|
```
|
|
@@ -153,6 +157,7 @@ export * from "./composables";
|
|
|
153
157
|
```
|
|
154
158
|
|
|
155
159
|
`notifications/index.ts` barrel:
|
|
160
|
+
|
|
156
161
|
```ts
|
|
157
162
|
export { default as XxxCreatedDomainEvent } from "./XxxCreatedDomainEvent.vue";
|
|
158
163
|
```
|
|
@@ -191,10 +196,11 @@ The module assembler registers the new module in the app's module registry, typi
|
|
|
191
196
|
|
|
192
197
|
```ts
|
|
193
198
|
export { default as Orders } from "./orders";
|
|
194
|
-
export { default as Team } from "./team";
|
|
199
|
+
export { default as Team } from "./team"; // ← added by assembler
|
|
195
200
|
```
|
|
196
201
|
|
|
197
202
|
The assembler must:
|
|
203
|
+
|
|
198
204
|
1. Read existing `src/modules/index.ts`
|
|
199
205
|
2. Parse existing exports to avoid duplicates
|
|
200
206
|
3. Append a new named export for the new module
|
|
@@ -63,6 +63,7 @@ export function useMultilanguage() {
|
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
Key points:
|
|
66
|
+
|
|
66
67
|
- `currentLocale` and `languages` are module-level refs (shared across blades in the same module).
|
|
67
68
|
- Deduplicate concurrent `getLanguages` calls with a promise guard if multiple blades mount simultaneously.
|
|
68
69
|
- `useLanguages()` from the framework provides `getLocaleByTag` (display name) and `getFlag` (async flag URL).
|
|
@@ -75,7 +76,10 @@ Use the blade's `#actions` slot to position the language picker in the toolbar a
|
|
|
75
76
|
|
|
76
77
|
```vue
|
|
77
78
|
<template>
|
|
78
|
-
<VcBlade
|
|
79
|
+
<VcBlade
|
|
80
|
+
:title="bladeTitle"
|
|
81
|
+
:toolbar-items="bladeToolbar"
|
|
82
|
+
>
|
|
79
83
|
<template #actions>
|
|
80
84
|
<MultilanguageSelector
|
|
81
85
|
v-if="isMultilanguage"
|
|
@@ -131,19 +135,9 @@ Guard against undefined with `??` — when a language has no content yet, the fi
|
|
|
131
135
|
`VcInput` and `VcEditor` both accept `:multilanguage` and `:current-language` props. These add a visual language indicator on the field label.
|
|
132
136
|
|
|
133
137
|
```vue
|
|
134
|
-
<VcInput
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
multilanguage
|
|
138
|
-
:current-language="currentLocale"
|
|
139
|
-
/>
|
|
140
|
-
|
|
141
|
-
<VcEditor
|
|
142
|
-
v-model="localizedDescription"
|
|
143
|
-
:label="t('MY_MODULE.FIELDS.DESCRIPTION')"
|
|
144
|
-
multilanguage
|
|
145
|
-
:current-language="currentLocale"
|
|
146
|
-
/>
|
|
138
|
+
<VcInput v-model="localizedName" :label="t('MY_MODULE.FIELDS.NAME')" multilanguage :current-language="currentLocale" />
|
|
139
|
+
|
|
140
|
+
<VcEditor v-model="localizedDescription" :label="t('MY_MODULE.FIELDS.DESCRIPTION')" multilanguage :current-language="currentLocale" />
|
|
147
141
|
```
|
|
148
142
|
|
|
149
143
|
- `multilanguage` (boolean) — enables the language indicator badge on the label.
|
|
@@ -25,7 +25,10 @@ Push notifications are displayed in the notification dropdown. Each notification
|
|
|
25
25
|
:icon="style.icon"
|
|
26
26
|
:notification="notification"
|
|
27
27
|
>
|
|
28
|
-
<VcHint
|
|
28
|
+
<VcHint
|
|
29
|
+
v-if="notification.description"
|
|
30
|
+
class="tw-mb-1"
|
|
31
|
+
>
|
|
29
32
|
{{ notification.description }}
|
|
30
33
|
</VcHint>
|
|
31
34
|
</NotificationTemplate>
|
|
@@ -47,24 +50,24 @@ const style = {
|
|
|
47
50
|
|
|
48
51
|
### `NotificationTemplate` props
|
|
49
52
|
|
|
50
|
-
| Prop | Type
|
|
51
|
-
|
|
52
|
-
| `title` | `string`
|
|
53
|
+
| Prop | Type | Description |
|
|
54
|
+
| -------------- | ------------------- | ------------------------------------------------ |
|
|
55
|
+
| `title` | `string` | Notification title text |
|
|
53
56
|
| `notification` | `IPushNotification` | Full notification object (for timestamp display) |
|
|
54
|
-
| `icon` | `string`
|
|
55
|
-
| `color` | `string`
|
|
57
|
+
| `icon` | `string` | Lucide icon name, e.g., `"lucide-check"` |
|
|
58
|
+
| `color` | `string` | CSS color or variable for the icon background |
|
|
56
59
|
|
|
57
60
|
The default slot renders below the title/timestamp row. Use it for additional details.
|
|
58
61
|
|
|
59
62
|
### Icon + color conventions
|
|
60
63
|
|
|
61
|
-
| Event type
|
|
62
|
-
|
|
63
|
-
| Created
|
|
64
|
-
| Updated
|
|
65
|
-
| Deleted
|
|
66
|
-
| Error/Failed
|
|
67
|
-
| Processing
|
|
64
|
+
| Event type | Color | Icon |
|
|
65
|
+
| ------------ | -------------------- | ----------------- |
|
|
66
|
+
| Created | `var(--success-400)` | `lucide-check` |
|
|
67
|
+
| Updated | `var(--primary-500)` | `lucide-pencil` |
|
|
68
|
+
| Deleted | `var(--danger-500)` | `lucide-trash-2` |
|
|
69
|
+
| Error/Failed | `var(--danger-500)` | `lucide-x-circle` |
|
|
70
|
+
| Processing | `var(--warning-400)` | `lucide-loader` |
|
|
68
71
|
|
|
69
72
|
---
|
|
70
73
|
|
|
@@ -100,7 +103,10 @@ Full typed template example:
|
|
|
100
103
|
:icon="style.icon"
|
|
101
104
|
:notification="notification"
|
|
102
105
|
>
|
|
103
|
-
<VcHint
|
|
106
|
+
<VcHint
|
|
107
|
+
v-if="notification.orderId"
|
|
108
|
+
class="tw-mb-1"
|
|
109
|
+
>
|
|
104
110
|
Order #{{ notification.orderNumber }}
|
|
105
111
|
</VcHint>
|
|
106
112
|
</NotificationTemplate>
|
|
@@ -163,6 +169,7 @@ src/modules/xxx/
|
|
|
163
169
|
```
|
|
164
170
|
|
|
165
171
|
`notifications/index.ts` barrel:
|
|
172
|
+
|
|
166
173
|
```ts
|
|
167
174
|
export { default as XxxCreatedDomainEvent } from "./XxxCreatedDomainEvent.vue";
|
|
168
175
|
```
|
|
@@ -45,18 +45,17 @@ Each notification type can have a custom Vue SFC that controls how it renders in
|
|
|
45
45
|
:notification="notification"
|
|
46
46
|
@click="onClick"
|
|
47
47
|
>
|
|
48
|
-
<VcHint
|
|
48
|
+
<VcHint
|
|
49
|
+
v-if="notification.description"
|
|
50
|
+
class="tw-mb-1"
|
|
51
|
+
>
|
|
49
52
|
{{ notification.description }}
|
|
50
53
|
</VcHint>
|
|
51
54
|
</NotificationTemplate>
|
|
52
55
|
</template>
|
|
53
56
|
|
|
54
57
|
<script lang="ts" setup>
|
|
55
|
-
import {
|
|
56
|
-
NotificationTemplate,
|
|
57
|
-
useNotificationContext,
|
|
58
|
-
useBlade,
|
|
59
|
-
} from "@vc-shell/framework";
|
|
58
|
+
import { NotificationTemplate, useNotificationContext, useBlade } from "@vc-shell/framework";
|
|
60
59
|
import type { PushNotification } from "@vc-shell/framework";
|
|
61
60
|
import { computed } from "vue";
|
|
62
61
|
|
|
@@ -68,9 +67,7 @@ interface IOrderShippedNotification extends PushNotification {
|
|
|
68
67
|
const notificationRef = useNotificationContext<IOrderShippedNotification>();
|
|
69
68
|
const notification = computed(() => notificationRef.value);
|
|
70
69
|
|
|
71
|
-
const color = computed(() =>
|
|
72
|
-
notification.value.trackingNumber ? "var(--success-400)" : "var(--primary-500)"
|
|
73
|
-
);
|
|
70
|
+
const color = computed(() => (notification.value.trackingNumber ? "var(--success-400)" : "var(--primary-500)"));
|
|
74
71
|
|
|
75
72
|
const { openBlade } = useBlade();
|
|
76
73
|
|
|
@@ -82,12 +79,12 @@ async function onClick() {
|
|
|
82
79
|
|
|
83
80
|
### `NotificationTemplate` props
|
|
84
81
|
|
|
85
|
-
| Prop | Type | Description
|
|
86
|
-
|
|
87
|
-
| `title` | `string` | Notification title text
|
|
88
|
-
| `notification` | `PushNotification`
|
|
89
|
-
| `icon` | `string` | Lucide icon name, e.g. `"lucide-truck"`
|
|
90
|
-
| `color` | `string` | CSS color/variable for the icon circle
|
|
82
|
+
| Prop | Type | Description |
|
|
83
|
+
| -------------- | ------------------ | --------------------------------------------- |
|
|
84
|
+
| `title` | `string` | Notification title text |
|
|
85
|
+
| `notification` | `PushNotification` | Full notification object (used for timestamp) |
|
|
86
|
+
| `icon` | `string` | Lucide icon name, e.g. `"lucide-truck"` |
|
|
87
|
+
| `color` | `string` | CSS color/variable for the icon circle |
|
|
91
88
|
|
|
92
89
|
The default slot renders below the title/timestamp. Use it for description text, progress bars, or action links.
|
|
93
90
|
|
|
@@ -120,13 +117,13 @@ export default defineAppModule({
|
|
|
120
117
|
|
|
121
118
|
The `toast` object controls how the notification appears as a popup.
|
|
122
119
|
|
|
123
|
-
| Property | Type
|
|
124
|
-
|
|
125
|
-
| `mode` | `"auto" \| "progress" \| "silent"`
|
|
126
|
-
| `severity` | `Severity \| (msg) => Severity`
|
|
127
|
-
| `timeout` | `number`
|
|
128
|
-
| `isComplete` | `(msg) => boolean`
|
|
129
|
-
| `completedType` | `(msg) => string`
|
|
120
|
+
| Property | Type | Description |
|
|
121
|
+
| --------------- | ---------------------------------- | --------------------------------------------------------------------------------------- |
|
|
122
|
+
| `mode` | `"auto" \| "progress" \| "silent"` | `auto` = fire-and-forget; `progress` = persistent until complete; `silent` = no toast |
|
|
123
|
+
| `severity` | `Severity \| (msg) => Severity` | Static or dynamic: `"info"`, `"warning"`, `"error"`, `"critical"` |
|
|
124
|
+
| `timeout` | `number` | Override default timeout (ms). Defaults: info=5s, warning=8s, error/critical=persistent |
|
|
125
|
+
| `isComplete` | `(msg) => boolean` | For `"progress"` mode: returns true when the operation finishes |
|
|
126
|
+
| `completedType` | `(msg) => string` | For `"progress"` mode: final toast variant (`"success"` or `"error"`) |
|
|
130
127
|
|
|
131
128
|
#### Toast mode examples
|
|
132
129
|
|
|
@@ -186,19 +183,19 @@ const { messages, unreadCount, markAsRead } = useBladeNotifications({
|
|
|
186
183
|
|
|
187
184
|
**Parameters:**
|
|
188
185
|
|
|
189
|
-
| Field
|
|
190
|
-
|
|
191
|
-
| `types`
|
|
192
|
-
| `filter`
|
|
193
|
-
| `onMessage
|
|
186
|
+
| Field | Type | Description |
|
|
187
|
+
| ----------- | ------------------ | --------------------------------------------- |
|
|
188
|
+
| `types` | `string[]` | Notification type(s) to subscribe to |
|
|
189
|
+
| `filter` | `(msg) => boolean` | Optional: further filter by message fields |
|
|
190
|
+
| `onMessage` | `(msg) => void` | Callback fired for each matching notification |
|
|
194
191
|
|
|
195
192
|
**Returns:**
|
|
196
193
|
|
|
197
|
-
| Field
|
|
198
|
-
|
|
199
|
-
| `messages`
|
|
200
|
-
| `unreadCount
|
|
201
|
-
| `markAsRead`
|
|
194
|
+
| Field | Type | Description |
|
|
195
|
+
| ------------- | --------------------- | ------------------------------------------------ |
|
|
196
|
+
| `messages` | `ComputedRef<T[]>` | Matching unread messages from the realtime queue |
|
|
197
|
+
| `unreadCount` | `ComputedRef<number>` | Count of matching unread messages |
|
|
198
|
+
| `markAsRead` | `(msg) => void` | Mark a specific message as read |
|
|
202
199
|
|
|
203
200
|
---
|
|
204
201
|
|
|
@@ -215,6 +212,7 @@ src/modules/orders/
|
|
|
215
212
|
```
|
|
216
213
|
|
|
217
214
|
`notifications/index.ts` barrel:
|
|
215
|
+
|
|
218
216
|
```ts
|
|
219
217
|
export { default as OrderShippedEvent } from "./OrderShippedEvent.vue";
|
|
220
218
|
```
|