@vc-shell/vc-app-skill 2.1.0-pr255.4dc5c0d → 2.1.0-pr256.0fe3abb
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/runtime/knowledge/docs/core/api/platform.docs.md +20 -18
- package/runtime/knowledge/docs/core/blade-navigation/blade-nav-composables.docs.md +43 -34
- package/runtime/knowledge/docs/core/blade-navigation/table-query-state/useTableQueryState.docs.md +95 -0
- package/runtime/knowledge/docs/core/composables/useAppBarMobileButtons/useAppBarMobileButtons.docs.md +5 -3
- package/runtime/knowledge/docs/core/composables/useAppBarWidget/useAppBarWidget.docs.md +12 -10
- package/runtime/knowledge/docs/core/composables/useAppInsights/useAppInsights.docs.md +7 -5
- package/runtime/knowledge/docs/core/composables/useAssets/useAssets.docs.md +8 -6
- package/runtime/knowledge/docs/core/composables/useAssetsManager/useAssetsManager.docs.md +3 -1
- package/runtime/knowledge/docs/core/composables/useAsync/useAsync.docs.md +1 -1
- package/runtime/knowledge/docs/core/composables/useBladeRegistry/useBladeRegistry.docs.md +8 -5
- package/runtime/knowledge/docs/core/composables/useBladeWidgets/index.docs.md +12 -12
- package/runtime/knowledge/docs/core/composables/useBreadcrumbs/useBreadcrumbs.docs.md +3 -3
- package/runtime/knowledge/docs/core/composables/useConnectionStatus/useConnectionStatus.docs.md +4 -3
- package/runtime/knowledge/docs/core/composables/useDynamicProperties/useDynamicProperties.docs.md +1 -0
- package/runtime/knowledge/docs/core/composables/useFunctions/useFunctions.docs.md +3 -3
- package/runtime/knowledge/docs/core/composables/useKeyboardNavigation/useKeyboardNavigation.docs.md +5 -4
- package/runtime/knowledge/docs/core/composables/useLanguages/useLanguages.docs.md +3 -3
- package/runtime/knowledge/docs/core/composables/useLoading/useLoading.docs.md +2 -0
- package/runtime/knowledge/docs/core/composables/useModificationTracker/useModificationTracker.docs.md +1 -2
- package/runtime/knowledge/docs/core/composables/useNotifications/useNotifications.docs.md +1 -1
- package/runtime/knowledge/docs/core/composables/usePermissions/usePermissions.docs.md +3 -3
- package/runtime/knowledge/docs/core/composables/usePlatformLocaleSync/usePlatformLocaleSync.docs.md +35 -0
- package/runtime/knowledge/docs/core/composables/usePopup/usePopup.docs.md +1 -1
- package/runtime/knowledge/docs/core/composables/useResponsive/useResponsive.docs.md +2 -2
- package/runtime/knowledge/docs/core/composables/useSettings/useSettings.docs.md +2 -1
- package/runtime/knowledge/docs/core/composables/useSettingsMenu/useSettingsMenu.docs.md +18 -18
- package/runtime/knowledge/docs/core/composables/useSidebarState/useSidebarState.docs.md +3 -3
- package/runtime/knowledge/docs/core/composables/useSlowNetworkDetection/useSlowNetworkDetection.docs.md +10 -7
- package/runtime/knowledge/docs/core/composables/useTheme/useTheme.docs.md +7 -7
- package/runtime/knowledge/docs/core/composables/useToolbar/useToolbar.docs.md +18 -12
- package/runtime/knowledge/docs/core/composables/useUser/useUser.docs.md +2 -2
- package/runtime/knowledge/docs/core/composables/useUserManagement/useUserManagement.docs.md +20 -20
- package/runtime/knowledge/docs/core/composables/useWidgets/useWidgets.docs.md +15 -24
- package/runtime/knowledge/docs/core/directives/loading/loading.docs.md +2 -2
- package/runtime/knowledge/docs/core/notifications/composables/useBladeNotifications.docs.md +183 -0
- package/runtime/knowledge/docs/core/notifications/composables/useBroadcastFilter.docs.md +117 -0
- package/runtime/knowledge/docs/core/notifications/composables/useNotificationContext.docs.md +150 -0
- package/runtime/knowledge/docs/core/notifications/composables/useNotificationStore.docs.md +114 -0
- package/runtime/knowledge/docs/core/notifications/notifications.docs.md +50 -30
- package/runtime/knowledge/docs/core/plugins/ai-agent/ai-agent.docs.md +30 -11
- package/runtime/knowledge/docs/core/plugins/extension-points/extension-points.docs.md +1 -1
- package/runtime/knowledge/docs/core/plugins/global-error-handler/global-error-handler.docs.md +2 -3
- package/runtime/knowledge/docs/core/plugins/modularity/modularity.docs.md +26 -26
- package/runtime/knowledge/docs/core/plugins/permissions/permissions.docs.md +2 -3
- package/runtime/knowledge/docs/core/plugins/signalR/signalR.docs.md +11 -50
- package/runtime/knowledge/docs/core/plugins/validation/validation.docs.md +9 -6
- package/runtime/knowledge/docs/core/services/services.docs.md +15 -13
- package/runtime/knowledge/docs/core/types/types.docs.md +37 -40
- package/runtime/knowledge/docs/core/utilities/date/date-utilities.docs.md +1 -2
- package/runtime/knowledge/docs/core/utilities/shared-utilities.docs.md +21 -30
- package/runtime/knowledge/docs/core/utilities/thumbnail/thumbnail.docs.md +2 -2
- package/runtime/knowledge/docs/core/utilities/utilities.docs.md +9 -8
- package/runtime/knowledge/docs/injection-keys.docs.md +6 -11
- package/runtime/knowledge/docs/modules/assets/assets-details.docs.md +123 -0
- package/runtime/knowledge/docs/modules/assets-manager/assets-manager.docs.md +1 -1
- package/runtime/knowledge/docs/shell/_internal/popup/common/popup-common.docs.md +20 -12
- package/runtime/knowledge/docs/shell/auth/ChangePasswordPage/change-password-page.docs.md +10 -10
- package/runtime/knowledge/docs/shell/auth/ForgotPasswordPage/forgot-password-page.docs.md +6 -6
- package/runtime/knowledge/docs/shell/auth/InvitePage/invite-page.docs.md +4 -4
- package/runtime/knowledge/docs/shell/auth/LoginPage/login-page.docs.md +16 -14
- package/runtime/knowledge/docs/shell/auth/ResetPasswordPage/reset-password-page.docs.md +1 -1
- package/runtime/knowledge/docs/shell/auth/sign-in/sign-in.docs.md +12 -11
- package/runtime/knowledge/docs/shell/components/change-password/change-password.docs.md +10 -3
- package/runtime/knowledge/docs/shell/components/change-password-button/change-password-button.docs.md +3 -3
- package/runtime/knowledge/docs/shell/components/error-interceptor/error-interceptor.docs.md +9 -2
- package/runtime/knowledge/docs/shell/components/language-selector/language-selector.docs.md +4 -2
- package/runtime/knowledge/docs/shell/components/logout-button/logout-button.docs.md +1 -1
- package/runtime/knowledge/docs/shell/components/notification-dropdown/notification-dropdown.docs.md +35 -31
- package/runtime/knowledge/docs/shell/components/notification-template/notification-template.docs.md +17 -11
- package/runtime/knowledge/docs/shell/components/settings-menu/settings-menu.docs.md +8 -7
- package/runtime/knowledge/docs/shell/components/settings-menu-item/settings-menu-item.docs.md +23 -21
- package/runtime/knowledge/docs/shell/components/sidebar/sidebar.docs.md +5 -3
- package/runtime/knowledge/docs/shell/components/theme-selector/theme-selector.docs.md +7 -7
- package/runtime/knowledge/docs/shell/components/user-dropdown-button/user-dropdown-button.docs.md +11 -11
- package/runtime/knowledge/docs/shell/dashboard/dashboard-charts/dashboard-charts.docs.md +28 -16
- package/runtime/knowledge/docs/shell/dashboard/dashboard-widget-card/dashboard-widget-card.docs.md +17 -19
- package/runtime/knowledge/docs/shell/dashboard/draggable-dashboard/dashboard-widget-skeleton.docs.md +33 -0
- package/runtime/knowledge/docs/shell/dashboard/draggable-dashboard/draggable-dashboard.docs.md +21 -0
- package/runtime/knowledge/docs/ui/components/atoms/vc-badge/vc-badge.docs.md +2 -1
- package/runtime/knowledge/docs/ui/components/atoms/vc-banner/vc-banner.docs.md +2 -2
- package/runtime/knowledge/docs/ui/components/atoms/vc-button/vc-button.docs.md +15 -14
- package/runtime/knowledge/docs/ui/components/atoms/vc-container/vc-container.docs.md +9 -6
- package/runtime/knowledge/docs/ui/components/atoms/vc-environment-banner/vc-environment-banner.docs.md +42 -0
- package/runtime/knowledge/docs/ui/components/atoms/vc-hint/vc-hint.docs.md +1 -1
- package/runtime/knowledge/docs/ui/components/atoms/vc-icon/vc-icon.docs.md +10 -9
- package/runtime/knowledge/docs/ui/components/atoms/vc-image/vc-image.docs.md +19 -4
- package/runtime/knowledge/docs/ui/components/atoms/vc-label/vc-label.docs.md +2 -2
- package/runtime/knowledge/docs/ui/components/atoms/vc-link/vc-link.docs.md +5 -4
- package/runtime/knowledge/docs/ui/components/atoms/vc-loading/vc-loading.docs.md +5 -4
- package/runtime/knowledge/docs/ui/components/atoms/vc-progress/vc-progress.docs.md +9 -8
- package/runtime/knowledge/docs/ui/components/atoms/vc-scrollable-container/vc-scrollable-container.docs.md +7 -0
- package/runtime/knowledge/docs/ui/components/atoms/vc-skeleton/vc-skeleton.docs.md +1 -1
- package/runtime/knowledge/docs/ui/components/atoms/vc-status/vc-status.docs.md +2 -2
- package/runtime/knowledge/docs/ui/components/atoms/vc-status-icon/vc-status-icon.docs.md +1 -1
- package/runtime/knowledge/docs/ui/components/atoms/vc-tooltip/vc-tooltip.docs.md +11 -10
- package/runtime/knowledge/docs/ui/components/atoms/vc-video/vc-video.docs.md +28 -8
- package/runtime/knowledge/docs/ui/components/atoms/vc-widget/vc-widget.docs.md +22 -19
- package/runtime/knowledge/docs/ui/components/molecules/multilanguage-selector/multilanguage-selector.docs.md +8 -8
- package/runtime/knowledge/docs/ui/components/molecules/vc-accordion/vc-accordion.docs.md +16 -6
- package/runtime/knowledge/docs/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.docs.md +9 -8
- package/runtime/knowledge/docs/ui/components/molecules/vc-checkbox/vc-checkbox.docs.md +42 -34
- package/runtime/knowledge/docs/ui/components/molecules/vc-checkbox-group/vc-checkbox-group.docs.md +1 -1
- package/runtime/knowledge/docs/ui/components/molecules/vc-color-input/vc-color-input.docs.md +14 -1
- package/runtime/knowledge/docs/ui/components/molecules/vc-date-picker/vc-date-picker.docs.md +3 -1
- package/runtime/knowledge/docs/ui/components/molecules/vc-dropdown/vc-dropdown.docs.md +34 -33
- package/runtime/knowledge/docs/ui/components/molecules/vc-editor/vc-editor.docs.md +26 -24
- package/runtime/knowledge/docs/ui/components/molecules/vc-field/vc-field.docs.md +12 -14
- package/runtime/knowledge/docs/ui/components/molecules/vc-file-upload/vc-file-upload.docs.md +30 -30
- package/runtime/knowledge/docs/ui/components/molecules/vc-input/vc-input.docs.md +2 -2
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-currency/vc-input-currency.docs.md +1 -1
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.docs.md +34 -31
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-group/vc-input-group.docs.md +14 -12
- package/runtime/knowledge/docs/ui/components/molecules/vc-menu/vc-menu.docs.md +1 -1
- package/runtime/knowledge/docs/ui/components/molecules/vc-multivalue/vc-multivalue.docs.md +36 -27
- package/runtime/knowledge/docs/ui/components/molecules/vc-pagination/vc-pagination.docs.md +5 -1
- package/runtime/knowledge/docs/ui/components/molecules/{vc-dropdown-panel/vc-dropdown-panel.docs.md → vc-popover/vc-popover.docs.md} +26 -25
- package/runtime/knowledge/docs/ui/components/molecules/vc-radio-button/vc-radio-button.docs.md +10 -9
- package/runtime/knowledge/docs/ui/components/molecules/vc-select/vc-select.docs.md +44 -19
- package/runtime/knowledge/docs/ui/components/molecules/vc-slider/vc-slider.docs.md +11 -11
- package/runtime/knowledge/docs/ui/components/molecules/vc-switch/vc-switch.docs.md +15 -14
- package/runtime/knowledge/docs/ui/components/molecules/vc-textarea/vc-textarea.docs.md +15 -15
- package/runtime/knowledge/docs/ui/components/molecules/vc-toast/vc-toast.docs.md +15 -13
- package/runtime/knowledge/docs/ui/components/organisms/vc-app/vc-app.docs.md +5 -1
- package/runtime/knowledge/docs/ui/components/organisms/vc-auth-layout/vc-auth-layout.docs.md +18 -0
- package/runtime/knowledge/docs/ui/components/organisms/vc-blade/vc-blade.docs.md +48 -78
- package/runtime/knowledge/docs/ui/components/organisms/vc-data-table/composables/table-composables.docs.md +9 -11
- package/runtime/knowledge/docs/ui/components/organisms/vc-data-table/vc-data-table.docs.md +71 -43
- package/runtime/knowledge/docs/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.docs.md +27 -20
- package/runtime/knowledge/docs/ui/components/organisms/vc-gallery/vc-gallery.docs.md +2 -2
- package/runtime/knowledge/docs/ui/components/organisms/vc-image-upload/vc-image-upload.docs.md +12 -12
- package/runtime/knowledge/docs/ui/components/organisms/vc-popup/vc-popup.docs.md +33 -24
- package/runtime/knowledge/docs/ui/components/organisms/vc-scheduler/vc-scheduler.docs.md +412 -0
- package/runtime/knowledge/docs/ui/components/organisms/vc-sidebar/vc-sidebar.docs.md +43 -26
- package/runtime/knowledge/docs/ui/composables/ui-composables.docs.md +15 -9
- package/runtime/knowledge/docs/ui/composables/useDataTableSort.docs.md +8 -6
- package/runtime/knowledge/docs/ui/composables/useTableSearch.docs.md +130 -0
- package/runtime/knowledge/docs/ui/composables/useTableSelection.docs.md +4 -4
- package/runtime/knowledge/docs/ui/composables/useTableSort.docs.md +2 -3
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: VcScheduler
|
|
3
|
+
category: components
|
|
4
|
+
group: data-display
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# VcScheduler
|
|
8
|
+
|
|
9
|
+
A calendar organism for planning date-bound periods -- promotions, pricelist windows, campaigns. It defaults to a Month grid where all-day events render as bars (stacking into lanes when they overlap, with a "+N more" overflow popover) and shorter events render as timed chips. It can also switch to a resource-by-time Timeline view.
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```vue
|
|
14
|
+
<template>
|
|
15
|
+
<div style="height: 640px">
|
|
16
|
+
<VcScheduler
|
|
17
|
+
v-model:view="view"
|
|
18
|
+
v-model:date="date"
|
|
19
|
+
:events="events"
|
|
20
|
+
editable
|
|
21
|
+
@event-update="onEventUpdate"
|
|
22
|
+
@event-create="onEventCreate"
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script setup lang="ts">
|
|
28
|
+
import { ref } from "vue";
|
|
29
|
+
import { VcScheduler } from "@vc-shell/framework";
|
|
30
|
+
import type { ISchedulerEvent, SchedulerView } from "@vc-shell/framework";
|
|
31
|
+
|
|
32
|
+
const view = ref<SchedulerView>("month");
|
|
33
|
+
const date = ref(new Date());
|
|
34
|
+
|
|
35
|
+
const events = ref<ISchedulerEvent[]>([{ id: "e1", title: "Summer Sale", start: new Date("2026-07-01"), end: new Date("2026-07-06"), allDay: true }]);
|
|
36
|
+
|
|
37
|
+
function onEventUpdate(u: { id: string; start: Date; end: Date }) {
|
|
38
|
+
const event = events.value.find((e) => e.id === u.id);
|
|
39
|
+
if (event) {
|
|
40
|
+
event.start = u.start;
|
|
41
|
+
event.end = u.end;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function onEventCreate(c: { start: Date; end: Date; allDay: boolean }) {
|
|
46
|
+
events.value.push({ id: crypto.randomUUID(), title: "New event", ...c });
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
`VcScheduler` needs an explicit height from its parent -- it fills `height: 100%` internally but does not impose one of its own.
|
|
52
|
+
|
|
53
|
+
## Table of Contents
|
|
54
|
+
|
|
55
|
+
1. [Views](#views)
|
|
56
|
+
2. [Event Model](#event-model)
|
|
57
|
+
3. [Editable Events](#editable-events)
|
|
58
|
+
4. [Overlapping Events and Overflow](#overlapping-events-and-overflow)
|
|
59
|
+
5. [Custom Slots](#custom-slots)
|
|
60
|
+
6. [Timeline View](#timeline-view)
|
|
61
|
+
7. [Props](#props)
|
|
62
|
+
8. [Events](#events)
|
|
63
|
+
9. [Slots](#slots)
|
|
64
|
+
10. [CSS Custom Properties](#css-custom-properties)
|
|
65
|
+
11. [Recipes](#recipes)
|
|
66
|
+
12. [Common Mistakes](#common-mistakes)
|
|
67
|
+
13. [Accessibility](#accessibility)
|
|
68
|
+
14. [Related Components](#related-components)
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Views
|
|
73
|
+
|
|
74
|
+
`view` selects the active calendar view and defaults to `"month"`. Bind it with `v-model:view` so the built-in toolbar's view switcher stays in sync with your state:
|
|
75
|
+
|
|
76
|
+
```vue
|
|
77
|
+
<VcScheduler v-model:view="view" v-model:date="date" :events="events" />
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
| View | Data props | Description |
|
|
81
|
+
| ------------ | ------------------- | ------------------------------------------------------------------------------------------ |
|
|
82
|
+
| `"month"` | `events` | Default. A 6-week grid; all-day events as bars, short events as chips. |
|
|
83
|
+
| `"timeline"` | `resources`, `bars` | Resource rows with date-bound bars packed into lanes. See [Timeline View](#timeline-view). |
|
|
84
|
+
|
|
85
|
+
`date` is the focused date (which month is shown, or the timeline anchor). Bind it with `v-model:date` so the toolbar's prev/next/today controls update your state:
|
|
86
|
+
|
|
87
|
+
```vue
|
|
88
|
+
<VcScheduler v-model:date="date" :events="events" />
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Both view and data props are independent -- passing `resources`/`bars` while `view` is (or defaults to) `"month"` renders nothing from them, and vice versa. See [Common Mistakes](#common-mistakes).
|
|
92
|
+
|
|
93
|
+
## Event Model
|
|
94
|
+
|
|
95
|
+
```ts
|
|
96
|
+
interface ISchedulerEvent {
|
|
97
|
+
id: string;
|
|
98
|
+
start: Date;
|
|
99
|
+
end: Date;
|
|
100
|
+
title: string;
|
|
101
|
+
/** Forces bar (true) or chip (false) rendering. Inferred from duration when omitted. */
|
|
102
|
+
allDay?: boolean;
|
|
103
|
+
/** CSS color or CSS var() reference; defaults to var(--primary-500). */
|
|
104
|
+
color?: string;
|
|
105
|
+
/** Per-event override of the global `editable` prop. */
|
|
106
|
+
editable?: boolean;
|
|
107
|
+
/** Free-form data for custom slots/handlers. */
|
|
108
|
+
meta?: Record<string, unknown>;
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
An event renders as a full-width **bar** spanning its day columns when `allDay` is `true`, or when omitted and `end - start >= 24h`. Anything shorter renders as a compact **chip** showing `HH:mm` plus the title, listed under its day cell.
|
|
113
|
+
|
|
114
|
+
## Editable Events
|
|
115
|
+
|
|
116
|
+
Set `editable` to allow drag-to-move and drag-to-resize on event bars in Month view, plus drag-to-create by pointer-dragging across empty day cells (commits via `event-create`). Moves and resizes commit on pointer-up via `event-update`.
|
|
117
|
+
|
|
118
|
+
```vue
|
|
119
|
+
<VcScheduler v-model:date="date" :events="events" editable @event-update="onEventUpdate" @event-create="onEventCreate" />
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
To make only _some_ events editable, use `isEventEditable` -- it is re-evaluated on every render, so an inline arrow function is safe:
|
|
123
|
+
|
|
124
|
+
```vue
|
|
125
|
+
<VcScheduler :events="events" editable :is-event-editable="(e) => e.meta?.locked !== true" />
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
An event can also opt out individually via its own `editable: false` field, independent of the global prop.
|
|
129
|
+
|
|
130
|
+
## Overlapping Events and Overflow
|
|
131
|
+
|
|
132
|
+
All-day events that overlap in time on the same days are packed into separate stacked lanes automatically -- no configuration needed. When a day would need more lanes than fit, the extra events collapse into a "+N more" link; clicking it opens a popover listing every all-day event on that date.
|
|
133
|
+
|
|
134
|
+
## Custom Slots
|
|
135
|
+
|
|
136
|
+
Override event content or the entire toolbar without losing built-in interaction:
|
|
137
|
+
|
|
138
|
+
```vue
|
|
139
|
+
<VcScheduler v-model:view="view" v-model:date="date" :events="events">
|
|
140
|
+
<template #event="{ event }">
|
|
141
|
+
<strong>{{ event.title }}</strong>
|
|
142
|
+
</template>
|
|
143
|
+
<template #toolbar="{ title, view }">
|
|
144
|
+
<div>{{ title }} -- {{ view }}</div>
|
|
145
|
+
</template>
|
|
146
|
+
</VcScheduler>
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Timeline view has its own set of slots (`resource`, `bar`, `header-cell`, `empty`) -- see [Timeline View](#timeline-view).
|
|
150
|
+
|
|
151
|
+
## Timeline View
|
|
152
|
+
|
|
153
|
+
Set `view="timeline"` and pass `resources`/`bars` (instead of `events`) to render a resource-by-time timeline: each resource is a row, and bars are periods placed on it via `bar.resourceId`. Overlapping bars on the same resource pack into stacked lanes, the same way Month-view events do.
|
|
154
|
+
|
|
155
|
+
```ts
|
|
156
|
+
interface ISchedulerResource {
|
|
157
|
+
id: string;
|
|
158
|
+
label: string;
|
|
159
|
+
meta?: Record<string, unknown>;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
interface ISchedulerBar {
|
|
163
|
+
id: string;
|
|
164
|
+
resourceId: string;
|
|
165
|
+
start: Date;
|
|
166
|
+
end: Date;
|
|
167
|
+
label?: string;
|
|
168
|
+
/** CSS color or CSS var() reference; defaults to var(--primary-500). */
|
|
169
|
+
color?: string;
|
|
170
|
+
/** Per-bar override of the global `editable` prop. */
|
|
171
|
+
editable?: boolean;
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
`zoom` controls tick granularity (`"hour" | "day" | "week" | "month" | "quarter" | "year"`, fine to coarse) -- bind with `v-model:zoom` so the toolbar's zoom in/out buttons stay in sync. `range` is the visible date window; when omitted it derives from the min/max span of `bars`, or `[now, now + 30 days]` when empty. `snap` (milliseconds, or `"auto"`) controls the drag/resize snap step, and `isBarEditable` is the per-bar analog of `isEventEditable`.
|
|
176
|
+
|
|
177
|
+
Timeline-only slots: `resource` (`{ resource }`, replaces a resource-panel cell), `bar` (`{ bar }`, replaces bar content), `header-cell` (`{ tick }`, replaces a fine-tick header cell), `empty` (replaces the empty-state shown when `bars` is empty).
|
|
178
|
+
|
|
179
|
+
See the [Timeline recipe](#timeline-promotions-with-per-pricelist-lock) below for a full example.
|
|
180
|
+
|
|
181
|
+
## Props
|
|
182
|
+
|
|
183
|
+
| Prop | Type | Default | Description |
|
|
184
|
+
| ----------------- | --------------------------------- | ------------ | --------------------------------------------------------------------------- |
|
|
185
|
+
| `events` | `ISchedulerEvent[]` | `[]` | Month view. Events to render. |
|
|
186
|
+
| `view` | `SchedulerView` | `"month"` | Active view (`"month"` \| `"timeline"`). Bind with `v-model:view`. |
|
|
187
|
+
| `date` | `Date` | `new Date()` | Focused date. Bind with `v-model:date`. |
|
|
188
|
+
| `editable` | `boolean` | `false` | Enables drag-to-move / drag-to-resize (and, in Month view, drag-to-create). |
|
|
189
|
+
| `firstDayOfWeek` | `number` | `1` | First column of the Month grid (0 = Sunday, 1 = Monday). |
|
|
190
|
+
| `isEventEditable` | `(e: ISchedulerEvent) => boolean` | `undefined` | Month view. Per-event override of `editable`. Re-evaluated every render. |
|
|
191
|
+
| `resources` | `ISchedulerResource[]` | `[]` | Timeline view. Rows of the timeline. |
|
|
192
|
+
| `bars` | `ISchedulerBar[]` | `[]` | Timeline view. Periods placed on the timeline via `bar.resourceId`. |
|
|
193
|
+
| `zoom` | `SchedulerZoom` | `"day"` | Timeline view. Tick granularity. Bind with `v-model:zoom`. |
|
|
194
|
+
| `range` | `{ start: Date; end: Date }` | auto-derived | Timeline view. Visible date window. |
|
|
195
|
+
| `snap` | `number \| "auto"` | `"auto"` | Timeline view. Snap step in milliseconds for drag/resize. |
|
|
196
|
+
| `isBarEditable` | `(bar: ISchedulerBar) => boolean` | `undefined` | Timeline view. Per-bar override of `editable`. Re-evaluated every render. |
|
|
197
|
+
| `resourceWidth` | `number \| undefined` | `200` | Timeline view. Width in pixels of the left resource panel. |
|
|
198
|
+
| `barMinWidth` | `number \| undefined` | `undefined` | Timeline view. Reserved for future use. |
|
|
199
|
+
|
|
200
|
+
## Events
|
|
201
|
+
|
|
202
|
+
| Event | Payload | Description |
|
|
203
|
+
| -------------- | --------------------------------------------- | -------------------------------------------------------------------------------- |
|
|
204
|
+
| `update:view` | `SchedulerView` | Fires when the toolbar's view switcher changes the active view. |
|
|
205
|
+
| `update:date` | `Date` | Fires when the toolbar's prev/next/today controls change the focused date. |
|
|
206
|
+
| `event-click` | `ISchedulerEvent` | Month view. Fires when an event bar or chip is activated (click or Enter). |
|
|
207
|
+
| `event-create` | `{ start: Date; end: Date; allDay: boolean }` | Month view. Fires when a drag-to-create gesture is committed. |
|
|
208
|
+
| `event-update` | `{ id: string; start: Date; end: Date }` | Month view. Fires after a drag-move or drag-resize is committed. |
|
|
209
|
+
| `bar-click` | `ISchedulerBar` | Timeline view. Fires when a bar is activated (click or Enter). |
|
|
210
|
+
| `bar-select` | `ISchedulerBar \| null` | Timeline view. Fires on selection change; `null` when cleared. |
|
|
211
|
+
| `bar-update` | `IBarUpdate` (`{ id, start, end }`) | Timeline view. Fires after a drag-move or drag-resize is committed. |
|
|
212
|
+
| `bar-create` | `IBarCreate` (`{ resourceId, start, end }`) | Timeline view. Fires from the mobile agenda's inline "+" action. |
|
|
213
|
+
| `bar-delete` | `{ id: string }` | Timeline view. Fires when Delete is tapped in the mobile bar-edit sheet. |
|
|
214
|
+
| `update:zoom` | `SchedulerZoom` | Timeline view. Fires when the toolbar zoom in/out buttons change the zoom level. |
|
|
215
|
+
| `range-change` | `{ start: Date; end: Date }` | Timeline view. Fires on horizontal scroll with the currently visible date range. |
|
|
216
|
+
|
|
217
|
+
## Slots
|
|
218
|
+
|
|
219
|
+
| Slot | Scope | Description |
|
|
220
|
+
| ------------- | ----------------- | ------------------------------------------------------------------------- |
|
|
221
|
+
| `event` | `{ event }` | Month view. Replaces an event's inner content. Defaults to `event.title`. |
|
|
222
|
+
| `toolbar` | `{ title, view }` | Replaces the entire built-in toolbar. |
|
|
223
|
+
| `resource` | `{ resource }` | Timeline view. Replaces a resource-panel cell's content. |
|
|
224
|
+
| `bar` | `{ bar }` | Timeline view. Replaces a bar's inner content. |
|
|
225
|
+
| `header-cell` | `{ tick }` | Timeline view. Replaces a fine-tick header cell's content. |
|
|
226
|
+
| `empty` | -- | Timeline view. Replaces the empty-state shown when `bars` is empty. |
|
|
227
|
+
|
|
228
|
+
## CSS Custom Properties
|
|
229
|
+
|
|
230
|
+
| Property | Default | Description |
|
|
231
|
+
| -------------------------- | --------------------- | ---------------------------------------------------------------------- |
|
|
232
|
+
| `--scheduler-border-color` | `var(--neutrals-200)` | Border color for the grid, header, resource panel, and row separators. |
|
|
233
|
+
| `--vc-scheduler-event-ink` | `#fff` | Text color on Month-view event bars/chips. |
|
|
234
|
+
| `--z-critical-popup` | (theme z-index scale) | Stacking context for the "+N more" overflow popover. |
|
|
235
|
+
| `--z-local-sticky` | (theme z-index scale) | Timeline view. Stacking context for the sticky resource panel. |
|
|
236
|
+
| `--z-critical-modal` | (theme z-index scale) | Timeline view. Stacking context for the mobile bottom-sheet editor. |
|
|
237
|
+
|
|
238
|
+
Event/bar fill color comes from `color` (any CSS color or `var(...)` reference) and defaults to `var(--primary-500)`. Bar/chip label text is white by default -- see [Common Mistakes](#common-mistakes).
|
|
239
|
+
|
|
240
|
+
## Recipes
|
|
241
|
+
|
|
242
|
+
### Month: promotions calendar with drag-to-create
|
|
243
|
+
|
|
244
|
+
```vue
|
|
245
|
+
<template>
|
|
246
|
+
<div style="height: 640px">
|
|
247
|
+
<VcScheduler
|
|
248
|
+
v-model:date="date"
|
|
249
|
+
:events="promotions"
|
|
250
|
+
editable
|
|
251
|
+
:is-event-editable="(e) => !lockedIds.has(e.id)"
|
|
252
|
+
@event-update="onEventUpdate"
|
|
253
|
+
@event-create="onEventCreate"
|
|
254
|
+
@event-click="(e) => (selectedPromotion = e)"
|
|
255
|
+
/>
|
|
256
|
+
</div>
|
|
257
|
+
</template>
|
|
258
|
+
|
|
259
|
+
<script setup lang="ts">
|
|
260
|
+
import { ref } from "vue";
|
|
261
|
+
import { VcScheduler } from "@vc-shell/framework";
|
|
262
|
+
import type { ISchedulerEvent } from "@vc-shell/framework";
|
|
263
|
+
|
|
264
|
+
const date = ref(new Date("2026-07-01"));
|
|
265
|
+
|
|
266
|
+
const promotions = ref<ISchedulerEvent[]>([
|
|
267
|
+
{ id: "p1", title: "Summer Sale", start: new Date("2026-07-01"), end: new Date("2026-07-14"), allDay: true },
|
|
268
|
+
{ id: "p2", title: "Loyalty pricing review", start: new Date("2026-07-15T09:00:00"), end: new Date("2026-07-15T10:00:00") },
|
|
269
|
+
]);
|
|
270
|
+
|
|
271
|
+
const lockedIds = new Set(["p1"]);
|
|
272
|
+
const selectedPromotion = ref<ISchedulerEvent | null>(null);
|
|
273
|
+
|
|
274
|
+
function onEventUpdate(u: { id: string; start: Date; end: Date }) {
|
|
275
|
+
const promo = promotions.value.find((p) => p.id === u.id);
|
|
276
|
+
if (promo) {
|
|
277
|
+
promo.start = u.start;
|
|
278
|
+
promo.end = u.end;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
function onEventCreate(c: { start: Date; end: Date; allDay: boolean }) {
|
|
283
|
+
promotions.value.push({ id: crypto.randomUUID(), title: "New promotion", ...c });
|
|
284
|
+
}
|
|
285
|
+
</script>
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
### Timeline: promotions with per-pricelist lock
|
|
289
|
+
|
|
290
|
+
```vue
|
|
291
|
+
<template>
|
|
292
|
+
<div style="height: 500px">
|
|
293
|
+
<VcScheduler
|
|
294
|
+
view="timeline"
|
|
295
|
+
:resources="pricelists"
|
|
296
|
+
:bars="promotions"
|
|
297
|
+
v-model:zoom="zoom"
|
|
298
|
+
editable
|
|
299
|
+
:is-bar-editable="(bar) => !lockedPricelistIds.has(bar.resourceId)"
|
|
300
|
+
@bar-update="onBarUpdate"
|
|
301
|
+
@bar-select="(bar) => (selectedPromotion = bar)"
|
|
302
|
+
/>
|
|
303
|
+
</div>
|
|
304
|
+
</template>
|
|
305
|
+
|
|
306
|
+
<script setup lang="ts">
|
|
307
|
+
import { ref } from "vue";
|
|
308
|
+
import { VcScheduler } from "@vc-shell/framework";
|
|
309
|
+
import type { ISchedulerResource, ISchedulerBar, SchedulerZoom, IBarUpdate } from "@vc-shell/framework";
|
|
310
|
+
|
|
311
|
+
const pricelists: ISchedulerResource[] = [
|
|
312
|
+
{ id: "pl-summer", label: "Summer Pricelist" },
|
|
313
|
+
{ id: "pl-loyalty", label: "Loyalty Pricelist" },
|
|
314
|
+
{ id: "pl-clearance", label: "Clearance" },
|
|
315
|
+
];
|
|
316
|
+
|
|
317
|
+
const promotions = ref<ISchedulerBar[]>([
|
|
318
|
+
{ id: "b1", resourceId: "pl-summer", start: new Date("2026-07-01"), end: new Date("2026-07-14"), label: "Summer Sale" },
|
|
319
|
+
{ id: "b2", resourceId: "pl-loyalty", start: new Date("2026-07-01"), end: new Date("2026-07-31"), label: "July Prices" },
|
|
320
|
+
]);
|
|
321
|
+
|
|
322
|
+
const lockedPricelistIds = new Set(["pl-clearance"]);
|
|
323
|
+
const zoom = ref<SchedulerZoom>("week");
|
|
324
|
+
const selectedPromotion = ref<ISchedulerBar | null>(null);
|
|
325
|
+
|
|
326
|
+
function onBarUpdate(u: IBarUpdate) {
|
|
327
|
+
const promo = promotions.value.find((p) => p.id === u.id);
|
|
328
|
+
if (promo) {
|
|
329
|
+
promo.start = u.start;
|
|
330
|
+
promo.end = u.end;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
</script>
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
## Common Mistakes
|
|
337
|
+
|
|
338
|
+
### 1. Forgetting `view="timeline"` -- `resources`/`bars` render nothing
|
|
339
|
+
|
|
340
|
+
`view` defaults to `"month"`, which only reads `events`. If you're migrating existing `resources`/`bars` usage (or copying an old timeline example), the grid renders empty unless you set the view explicitly.
|
|
341
|
+
|
|
342
|
+
```vue
|
|
343
|
+
<!-- WRONG: view defaults to "month", so resources/bars are silently ignored -->
|
|
344
|
+
<VcScheduler :resources="resources" :bars="bars" />
|
|
345
|
+
|
|
346
|
+
<!-- CORRECT -->
|
|
347
|
+
<VcScheduler view="timeline" :resources="resources" :bars="bars" />
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
### 2. Passing `isEventEditable`/`isBarEditable` as a value instead of a getter function
|
|
351
|
+
|
|
352
|
+
```vue
|
|
353
|
+
<!-- WRONG: evaluates once, becomes a static boolean-ish value -->
|
|
354
|
+
<VcScheduler :is-event-editable="someEvent.editable" ... />
|
|
355
|
+
|
|
356
|
+
<!-- CORRECT: pass a function; it is called per-event and re-evaluated on every interaction -->
|
|
357
|
+
<VcScheduler :is-event-editable="(e) => e.meta?.locked !== true" ... />
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
### 3. Using a light event color and failing color contrast
|
|
361
|
+
|
|
362
|
+
Event/bar labels default to white text (`--vc-scheduler-event-ink`, `#fff`). A light `color` fails readability with white text. Contrast is a **manual design responsibility** -- the `color-contrast` a11y rule is disabled repo-wide, so a poor color choice won't be caught automatically.
|
|
363
|
+
|
|
364
|
+
```vue
|
|
365
|
+
<!-- WRONG: light tint, white text on it fails 4.5:1 contrast -->
|
|
366
|
+
<script setup>
|
|
367
|
+
const events = [{ id: "a", title: "Promo", start, end, allDay: true, color: "var(--primary-300)" }];
|
|
368
|
+
</script>
|
|
369
|
+
|
|
370
|
+
<!-- CORRECT: use a dark color, e.g. var(--primary-600), var(--primary-700), or var(--accent-600). Or omit color to use the default var(--primary-500). -->
|
|
371
|
+
<script setup>
|
|
372
|
+
const events = [{ id: "a", title: "Promo", start, end, allDay: true, color: "var(--primary-600)" }];
|
|
373
|
+
</script>
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
### 4. Using `view`/`date` as one-way props and expecting the toolbar to work
|
|
377
|
+
|
|
378
|
+
```vue
|
|
379
|
+
<!-- WRONG: :view/:date without v-model -- the toolbar's prev/next/today and
|
|
380
|
+
view-switch controls emit update:view/update:date, but nothing listens -->
|
|
381
|
+
<VcScheduler :view="view" :date="date" :events="events" />
|
|
382
|
+
|
|
383
|
+
<!-- CORRECT -->
|
|
384
|
+
<VcScheduler v-model:view="view" v-model:date="date" :events="events" />
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
### 5. Forgetting to give the container a height
|
|
388
|
+
|
|
389
|
+
```vue
|
|
390
|
+
<!-- WRONG: no height -- the grid/scroll container collapses to 0px -->
|
|
391
|
+
<VcScheduler :events="events" />
|
|
392
|
+
|
|
393
|
+
<!-- CORRECT: wrap in (or size) a container with an explicit height -->
|
|
394
|
+
<div style="height: 640px">
|
|
395
|
+
<VcScheduler :events="events" />
|
|
396
|
+
</div>
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
## Accessibility
|
|
400
|
+
|
|
401
|
+
- The Month grid uses `role="grid"` / `role="row"` / `role="gridcell"` / `role="columnheader"` for the weekday header and day cells, each `gridcell` carrying a full formatted-date `aria-label`.
|
|
402
|
+
- Each event bar and timed chip is a focusable `role="button"` element (`tabindex="0"`) with an `aria-label` built from its title and formatted start/end dates -- activate with click or `Enter`.
|
|
403
|
+
- The "+N more" overflow popover uses `role="dialog"` with an `aria-label` set to the formatted date.
|
|
404
|
+
- The toolbar's prev/next buttons carry an explicit `aria-label` ("Previous" / "Next") since they are icon-only; the today/view-switch buttons show text labels.
|
|
405
|
+
- Event move/resize (and Timeline bar move/resize) is a pointer-drag interaction with no keyboard equivalent yet; use a form outside VcScheduler for keyboard-only date edits.
|
|
406
|
+
- Respects `prefers-reduced-motion` -- event/bar transitions and chip hover transitions are disabled.
|
|
407
|
+
|
|
408
|
+
## Related Components
|
|
409
|
+
|
|
410
|
+
- [VcDataTable](../vc-data-table/) -- for tabular (non-calendar) views of the same periods.
|
|
411
|
+
- [VcDatePicker](../../molecules/vc-date-picker/) -- used internally by the Timeline mobile bottom-sheet editor for date-range input.
|
|
412
|
+
- [VcGallery](../vc-gallery/) -- another organism with drag interaction, for image reordering rather than time-based events.
|
|
@@ -50,25 +50,33 @@ const open = ref(false);
|
|
|
50
50
|
|
|
51
51
|
## Props
|
|
52
52
|
|
|
53
|
-
| Prop | Type | Default
|
|
54
|
-
| ---------------- | -------------------------------------- |
|
|
55
|
-
| `modelValue` | `boolean` | _required_
|
|
56
|
-
| `position` | `"left" \| "right" \| "bottom"` | `"right"`
|
|
57
|
-
| `size` | `"sm" \| "md" \| "lg" \| "full"` | `"sm"`
|
|
58
|
-
| `variant` | `"default" \| "elevated" \| "minimal"` | `"default"`
|
|
59
|
-
| `width` | `number \| string` | --
|
|
60
|
-
| `height` | `number \| string` | --
|
|
61
|
-
| `title` | `string` | `""`
|
|
62
|
-
| `subtitle` | `string` | `""`
|
|
63
|
-
| `showOverlay` | `boolean` | `true`
|
|
64
|
-
| `closeOnOverlay` | `boolean` | `true`
|
|
65
|
-
| `closeOnEscape` | `boolean` | `true`
|
|
66
|
-
| `closeButton` | `boolean` | `true`
|
|
67
|
-
| `trapFocus` | `boolean` | `true`
|
|
68
|
-
| `lockScroll` | `boolean` | `true`
|
|
69
|
-
| `inset` | `boolean` | `true`
|
|
70
|
-
| `
|
|
71
|
-
| `
|
|
53
|
+
| Prop | Type | Default | Description |
|
|
54
|
+
| ---------------- | -------------------------------------- | ----------------- | ------------------------------------------------------------------------------------------- |
|
|
55
|
+
| `modelValue` | `boolean` | _required_ | Open/close state (v-model). |
|
|
56
|
+
| `position` | `"left" \| "right" \| "bottom"` | `"right"` | Slide-in direction. |
|
|
57
|
+
| `size` | `"sm" \| "md" \| "lg" \| "full"` | `"sm"` | Panel size preset. Width (left/right) 300/380/520px/100vw; height (bottom) 40/56/72/100dvh. |
|
|
58
|
+
| `variant` | `"default" \| "elevated" \| "minimal"` | `"default"` | Visual style. |
|
|
59
|
+
| `width` | `number \| string` | -- | Custom width override (left/right positions). |
|
|
60
|
+
| `height` | `number \| string` | -- | Custom height override (bottom position). |
|
|
61
|
+
| `title` | `string` | `""` | Header title text. |
|
|
62
|
+
| `subtitle` | `string` | `""` | Header subtitle text. |
|
|
63
|
+
| `showOverlay` | `boolean` | `true` | Show backdrop overlay. |
|
|
64
|
+
| `closeOnOverlay` | `boolean` | `true` | Close when clicking overlay. |
|
|
65
|
+
| `closeOnEscape` | `boolean` | `true` | Close on Escape key. |
|
|
66
|
+
| `closeButton` | `boolean` | `true` | Show close button in header. |
|
|
67
|
+
| `trapFocus` | `boolean` | `true` | Trap keyboard focus inside panel. |
|
|
68
|
+
| `lockScroll` | `boolean` | `true` | Prevent body scroll while open. |
|
|
69
|
+
| `inset` | `boolean` | `true` | Add rounded inset gap from viewport edges. |
|
|
70
|
+
| `returnFocus` | `boolean` | `true` | Restore focus to the trigger element on close. |
|
|
71
|
+
| `autoFocus` | `boolean` | `true` | Focus the first focusable element on open. |
|
|
72
|
+
| `teleport` | `boolean` | `true` | Teleport the panel to a target (disabled toggles it off). |
|
|
73
|
+
| `teleportTo` | `string \| HTMLElement` | -- | Teleport target selector or element. |
|
|
74
|
+
| `ariaLabel` | `string` | `""` | Accessible label for the dialog. |
|
|
75
|
+
| `closeAriaLabel` | `string` | `"Close sidebar"` | Accessible label for the close button. |
|
|
76
|
+
| `zIndex` | `number` | `9200` | Stacking order of the sidebar container. |
|
|
77
|
+
| `closeThreshold` | `number` | `0.3` | Swipe fraction of panel height needed to dismiss (bottom). |
|
|
78
|
+
| `draggable` | `boolean` | `false` | Enable swipe-to-dismiss (bottom only). |
|
|
79
|
+
| `dragHandle` | `boolean` | `false` | Show iOS-style drag handle bar. |
|
|
72
80
|
|
|
73
81
|
## Events
|
|
74
82
|
|
|
@@ -86,6 +94,15 @@ const open = ref(false);
|
|
|
86
94
|
| `actions` | `{ close }` | Extra buttons in the header actions area. |
|
|
87
95
|
| `footer` | -- | Sticky footer area. |
|
|
88
96
|
|
|
97
|
+
## Exposed Methods
|
|
98
|
+
|
|
99
|
+
Accessible via a template ref on the component:
|
|
100
|
+
|
|
101
|
+
| Method | Description |
|
|
102
|
+
| --------- | ------------------------------------------ |
|
|
103
|
+
| `open()` | Opens the sidebar (sets model true). |
|
|
104
|
+
| `close()` | Closes the sidebar with reason `"action"`. |
|
|
105
|
+
|
|
89
106
|
## Features
|
|
90
107
|
|
|
91
108
|
### Animated Transitions
|
|
@@ -102,14 +119,14 @@ When `position="bottom"` and `draggable` is true, users can swipe the panel down
|
|
|
102
119
|
|
|
103
120
|
### Size Presets
|
|
104
121
|
|
|
105
|
-
| Size | Width/Height
|
|
106
|
-
| ------ |
|
|
107
|
-
| `sm` | 300px
|
|
108
|
-
| `md` | 380px
|
|
109
|
-
| `lg` | 520px
|
|
110
|
-
| `full` |
|
|
122
|
+
| Size | Width (left/right) | Height (bottom) |
|
|
123
|
+
| ------ | ------------------ | --------------- |
|
|
124
|
+
| `sm` | 300px | 40dvh |
|
|
125
|
+
| `md` | 380px | 56dvh |
|
|
126
|
+
| `lg` | 520px | 72dvh |
|
|
127
|
+
| `full` | 100vw | 100dvh |
|
|
111
128
|
|
|
112
|
-
Override with the `width` or `height` prop for custom dimensions.
|
|
129
|
+
Width presets apply to `left`/`right` positions; height presets apply to `position="bottom"`. Override with the `width` or `height` prop for custom dimensions.
|
|
113
130
|
|
|
114
131
|
## Common Patterns
|
|
115
132
|
|
|
@@ -15,14 +15,20 @@ All composables are exported from `framework/ui/composables/index.ts` and availa
|
|
|
15
15
|
|
|
16
16
|
## Exports
|
|
17
17
|
|
|
18
|
-
| Composable
|
|
19
|
-
|
|
|
20
|
-
| `useAdaptiveItems`
|
|
21
|
-
| `useScrollArrows`
|
|
22
|
-
| `useFloatingPosition`
|
|
23
|
-
| `useTeleportTarget`
|
|
24
|
-
| `useFormField`
|
|
25
|
-
| `useCollapsible`
|
|
18
|
+
| Composable | Purpose |
|
|
19
|
+
| ------------------------ | -------------------------------------------------------------------------------------------- |
|
|
20
|
+
| `useAdaptiveItems` | Measures and distributes items into visible/hidden groups based on container width |
|
|
21
|
+
| `useScrollArrows` | Tracks scroll overflow state and provides animated scroll-by-arrow controls |
|
|
22
|
+
| `useFloatingPosition` | Wrapper around `@floating-ui/vue` with sensible defaults for dropdowns/tooltips |
|
|
23
|
+
| `useTeleportTarget` | Resolves a consistent teleport target (explicit target, app root, or body) |
|
|
24
|
+
| `useFormField` | Shared form field logic: unique IDs, ARIA attributes, InputGroup integration |
|
|
25
|
+
| `useCollapsible` | Expand/collapse panel with measured content height and CSS transitions |
|
|
26
|
+
| `useTableSort` | Sort state for `VcTable`/`VcDataTable` |
|
|
27
|
+
| `useTableSelection` | Row selection state (multi-select, select-all, programmatic) for tables |
|
|
28
|
+
| `useDataTableSort` | URL-persistent sort state for `VcDataTable` ([docs](./useDataTableSort.docs.md)) |
|
|
29
|
+
| `useDataTablePagination` | URL-persistent pagination state for `VcDataTable` ([docs](./useDataTablePagination.docs.md)) |
|
|
30
|
+
| `useTableSearch` | URL-persistent search keyword for `VcDataTable` ([docs](./useTableSearch.docs.md)) |
|
|
31
|
+
| `useBladeLoading` | Blade-scoped loading/skeleton state |
|
|
26
32
|
|
|
27
33
|
## API Details
|
|
28
34
|
|
|
@@ -104,4 +110,4 @@ const { isExpanded, toggle, wrapperStyle, contentRef, hasOverflow } = useCollaps
|
|
|
104
110
|
|
|
105
111
|
- `framework/ui/components/molecules/vc-dropdown/` -- uses `useFloatingPosition`
|
|
106
112
|
- `framework/ui/components/molecules/vc-input/` -- uses `useFormField`
|
|
107
|
-
- `framework/
|
|
113
|
+
- `framework/ui/components/atoms/vc-scrollable-container/` -- uses `useScrollArrows`
|
|
@@ -54,12 +54,14 @@ const { sortField, sortOrder, sortExpression, resetSort } = useDataTableSort({
|
|
|
54
54
|
|
|
55
55
|
### Returns
|
|
56
56
|
|
|
57
|
-
| Property | Type | Description
|
|
58
|
-
| ---------------- | ---------------------------------- |
|
|
59
|
-
| `sortField` | `Ref<string \| undefined>` | Current sort field; bind with `v-model:sort-field`
|
|
60
|
-
| `sortOrder` | `Ref<
|
|
61
|
-
| `sortExpression` | `ComputedRef<string \| undefined>` | Formatted string (e.g., `"name:ASC"`) or `undefined` when no sort is active
|
|
62
|
-
| `resetSort` | `() => void` | Reset to the initial field/direction passed to the composable
|
|
57
|
+
| Property | Type | Description |
|
|
58
|
+
| ---------------- | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
|
|
59
|
+
| `sortField` | `Ref<string \| undefined>` | Current sort field; bind with `v-model:sort-field` |
|
|
60
|
+
| `sortOrder` | `Ref<DataTableSortOrder>` | Sort order (`DataTableSortOrder = 0 \| 1 \| -1`): `1` = ASC, `-1` = DESC, `0` = none; bind with `v-model:sort-order` |
|
|
61
|
+
| `sortExpression` | `ComputedRef<string \| undefined>` | Formatted string (e.g., `"name:ASC"`) or `undefined` when no sort is active |
|
|
62
|
+
| `resetSort` | `() => void` | Reset to the initial field/direction passed to the composable |
|
|
63
|
+
|
|
64
|
+
The `DataTableSortOrder` (`0 | 1 | -1`) and `DataTableSortDirection` (`"ASC" | "DESC"`) types are exported alongside the composable.
|
|
63
65
|
|
|
64
66
|
## Direction Mapping
|
|
65
67
|
|