feat(gui-v2): drawer registry + port RightDrawer to TypeScript
Adds composables/drawerRegistry.ts (boundary-safe register-by-call map: register/resolve, zero static component imports — composables zone may not import components, RFC-WS-GUI-REDESIGN AD-G5). Extends useRightDrawer with resolveDrawerComponent (thin facade, prior API/tests preserved). RightDrawer.vue: PrimeVue <Drawer position=right>, v-model:visible via a writable computed ↔ useRightDrawer isOpen/close; title/flush read from the open() props object (A4); dynamic <component :is> via resolveDrawerComponent with a graceful empty state on null; #actions header slot retained. 18 unit/component tests. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { storeToRefs } from 'pinia'
|
||||
import type { ComputedRef } from 'vue'
|
||||
import type { Component, ComputedRef } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
import { resolveDrawerComponent } from '@/composables/drawerRegistry'
|
||||
import { useShellUiStore } from '@/stores/useShellUiStore'
|
||||
|
||||
// Thin facade over useShellUiStore.drawer (RFC-WS-GUI-REDESIGN AD-G4,
|
||||
@@ -14,6 +15,7 @@ export interface UseRightDrawer {
|
||||
props: ComputedRef<Record<string, unknown>>
|
||||
open: (component: string, props?: Record<string, unknown>) => void
|
||||
close: () => void
|
||||
resolveDrawerComponent: (name: string | null | undefined) => Component | null
|
||||
}
|
||||
|
||||
export function useRightDrawer(): UseRightDrawer {
|
||||
@@ -26,5 +28,6 @@ export function useRightDrawer(): UseRightDrawer {
|
||||
props: computed(() => drawer.value.props),
|
||||
open: (component, props = {}) => store.openDrawer(component, props),
|
||||
close: () => store.closeDrawer(),
|
||||
resolveDrawerComponent,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user