@vc-shell/vc-app-skill 2.5.0 → 2.6.0-pr371.c384bbc
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/VERSION +1 -1
- package/runtime/knowledge/docs/_BUILD_HASH.md +1 -1
- package/runtime/knowledge/docs/core/blade-navigation/blade-nav-composables.docs.md +28 -1
- package/runtime/knowledge/docs/core/composables/useBlade/useBlade.docs.md +1 -1
- package/runtime/knowledge/docs/core/composables/useKeyboardNavigation/useKeyboardNavigation.docs.md +8 -8
- package/runtime/knowledge/docs/core/composables/useModificationTracker/useModificationTracker.docs.md +11 -0
- package/runtime/knowledge/docs/core/composables/usePopup/usePopup.docs.md +2 -0
- package/runtime/knowledge/docs/core/composables/useSidebarState/useSidebarState.docs.md +15 -4
- package/runtime/knowledge/docs/core/composables/useSlowNetworkDetection/useSlowNetworkDetection.docs.md +22 -18
- package/runtime/knowledge/docs/core/composables/useToolbar/useToolbar.docs.md +4 -0
- package/runtime/knowledge/docs/core/services/services.docs.md +0 -1
- package/runtime/knowledge/docs/ui/components/atoms/vc-button/vc-button.docs.md +1 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-color-input/vc-color-input.docs.md +10 -9
- package/runtime/knowledge/docs/ui/components/molecules/vc-date-picker/vc-date-picker.docs.md +21 -20
- package/runtime/knowledge/docs/ui/components/molecules/vc-input/vc-input.docs.md +27 -26
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.docs.md +1 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-popover/vc-popover.docs.md +3 -2
- package/runtime/knowledge/docs/ui/components/molecules/vc-rating/vc-rating.docs.md +16 -11
- package/runtime/knowledge/docs/ui/components/molecules/vc-textarea/vc-textarea.docs.md +1 -0
- package/runtime/knowledge/docs/ui/components/organisms/vc-app/vc-app.docs.md +1 -1
- package/runtime/knowledge/docs/ui/components/organisms/vc-data-table/vc-data-table.docs.md +77 -0
- package/runtime/knowledge/docs/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.docs.md +20 -19
- package/runtime/knowledge/docs/ui/components/organisms/vc-scheduler/vc-scheduler.docs.md +4 -2
- package/runtime/vc-app.md +4 -2
- package/runtime/knowledge/docs/core/composables/useKeyboardShortcuts/useKeyboardShortcuts.docs.md +0 -219
- package/runtime/knowledge/docs/core/composables/useLatestRequest/useLatestRequest.docs.md +0 -149
- package/runtime/knowledge/docs/core/composables/useMenuExpanded/index.docs.md +0 -93
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: useMenuExpanded
|
|
3
|
-
category: composables
|
|
4
|
-
group: ui-state
|
|
5
|
-
slug: useMenuExpanded
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# useMenuExpanded
|
|
9
|
-
|
|
10
|
-
Manages the sidebar menu expanded/collapsed and hover-expanded state with localStorage persistence. This is the low-level composable that powers the sidebar pin/unpin behavior in the vc-shell admin UI. It tracks two independent states: the permanent "pinned" state (persisted across sessions) and the transient "hover-expanded" state (active only while the user hovers over a collapsed sidebar).
|
|
11
|
-
|
|
12
|
-
## When to Use
|
|
13
|
-
|
|
14
|
-
- Low-level control over sidebar pin and hover state
|
|
15
|
-
- Building a custom sidebar component that needs expand/collapse persistence
|
|
16
|
-
- When NOT to use: prefer `useSidebarState` which wraps this composable and adds mobile menu support, derived `isExpanded` computed, and responsive breakpoint handling
|
|
17
|
-
|
|
18
|
-
## Basic Usage
|
|
19
|
-
|
|
20
|
-
```typescript
|
|
21
|
-
import { useMenuExpanded } from "@vc-shell/framework";
|
|
22
|
-
|
|
23
|
-
const { isExpanded, toggleExpanded, isHoverExpanded, toggleHoverExpanded } = useMenuExpanded();
|
|
24
|
-
|
|
25
|
-
// Toggle pin state (persisted to localStorage)
|
|
26
|
-
toggleExpanded();
|
|
27
|
-
|
|
28
|
-
// Hover expand with 200ms delay
|
|
29
|
-
toggleHoverExpanded(true); // opens after delay
|
|
30
|
-
toggleHoverExpanded(false); // closes immediately
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## API
|
|
34
|
-
|
|
35
|
-
### Returns
|
|
36
|
-
|
|
37
|
-
| Property | Type | Description |
|
|
38
|
-
| --------------------- | ---------------------------------- | ---------------------------------------------------------------- |
|
|
39
|
-
| `isExpanded` | `Ref<boolean>` | Pinned state, persisted via `useLocalStorage` |
|
|
40
|
-
| `toggleExpanded` | `() => void` | Toggle the pinned state |
|
|
41
|
-
| `isHoverExpanded` | `Ref<boolean>` | Temporary hover expansion (not persisted) |
|
|
42
|
-
| `toggleHoverExpanded` | `(shouldExpand?: boolean) => void` | Set hover state; opening has a 200ms delay, closing is immediate |
|
|
43
|
-
|
|
44
|
-
## Recipe: Custom Sidebar with Hover Expand
|
|
45
|
-
|
|
46
|
-
A common pattern is binding mouse events on the sidebar rail so the menu previews its full width on hover, without permanently pinning it open:
|
|
47
|
-
|
|
48
|
-
```vue
|
|
49
|
-
<script setup lang="ts">
|
|
50
|
-
import { computed } from "vue";
|
|
51
|
-
import { useMenuExpanded } from "@vc-shell/framework";
|
|
52
|
-
|
|
53
|
-
const { isExpanded, toggleExpanded, isHoverExpanded, toggleHoverExpanded } = useMenuExpanded();
|
|
54
|
-
|
|
55
|
-
// The sidebar is visually expanded if pinned OR hover-expanded
|
|
56
|
-
const isVisuallyExpanded = computed(() => isExpanded.value || isHoverExpanded.value);
|
|
57
|
-
</script>
|
|
58
|
-
|
|
59
|
-
<template>
|
|
60
|
-
<aside
|
|
61
|
-
:class="{ 'sidebar--expanded': isVisuallyExpanded }"
|
|
62
|
-
@mouseenter="toggleHoverExpanded(true)"
|
|
63
|
-
@mouseleave="toggleHoverExpanded(false)"
|
|
64
|
-
>
|
|
65
|
-
<nav>
|
|
66
|
-
<!-- menu items -->
|
|
67
|
-
</nav>
|
|
68
|
-
<button @click="toggleExpanded">
|
|
69
|
-
{{ isExpanded ? "Unpin" : "Pin" }}
|
|
70
|
-
</button>
|
|
71
|
-
</aside>
|
|
72
|
-
</template>
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
<!-- internal:start -->
|
|
76
|
-
|
|
77
|
-
## Details
|
|
78
|
-
|
|
79
|
-
- **Storage key scoping**: The key is scoped per application using the first URL path segment: `VC_APP_MENU_EXPANDED_{appName}`. For example, if the app is hosted at `/operations/`, the key is `VC_APP_MENU_EXPANDED_operations`. This allows multiple vc-shell apps on the same domain to maintain independent sidebar states.
|
|
80
|
-
- **Hover delay**: Opening uses a 200ms debounce to prevent accidental expansion when the cursor briefly passes over the sidebar. Closing is immediate to feel responsive.
|
|
81
|
-
- **Cleanup**: Pending hover timeouts are cleaned up via `onScopeDispose` to prevent memory leaks when the composable's effect scope is destroyed.
|
|
82
|
-
- **Default state**: The sidebar starts pinned open (`true`) on first visit, which is the most user-friendly default for new users.
|
|
83
|
-
<!-- internal:end -->
|
|
84
|
-
|
|
85
|
-
## Tips
|
|
86
|
-
|
|
87
|
-
- If you call `toggleHoverExpanded(true)` and then `toggleHoverExpanded(false)` within the 200ms window, the expansion is canceled -- the timeout is cleared before it fires.
|
|
88
|
-
- The composable does not handle mobile breakpoints. For responsive behavior, use `useSidebarState` instead, which combines `useMenuExpanded` with mobile detection.
|
|
89
|
-
- Each call to `useMenuExpanded()` creates a new instance with its own timeout tracking, but they share the same localStorage-backed `isExpanded` ref (via `useLocalStorage`). Multiple instances will stay in sync for the pinned state.
|
|
90
|
-
|
|
91
|
-
## Related
|
|
92
|
-
|
|
93
|
-
- `useSidebarState` -- higher-level composable that adds mobile menu and derived `isExpanded` computed
|