feat(master-detail): add cover sub-mode and providePane

- MasterDetail / MasterDetailPage: add `sub-mode` ("shift" | "cover", default
  "shift", so existing callers are unaffected). `cover` leaves the master pane
  untouched and puts the sub pane over the detail column: the case where the
  list must stay visible while drilling into another module. The detail pane
  fades out in place instead of sliding into the master column, so it stays
  mounted and keeps its scroll position and internal state.
- use-master-detail: export `providePane(context)` and return `close` from
  useMasterDetailPane. A page can now hand a derived pane context to its whole
  subtree, which is how a host rewrites sub view ids (prefixing them with the
  owning record). The alternative - a wrapper component - breaks the
  `.detail > .tui-page-layout` selectors in page-layout.less and sends the
  in-pane navbar back to `position: fixed`.
- docs: cover vs shift, and how to prefix sub view ids without a wrapper.
This commit is contained in:
Timi
2026-11-18 15:08:44 +08:00
parent a50f134b25
commit bdaee75b81
8 changed files with 200 additions and 35 deletions
+1 -1
View File
@@ -80,7 +80,7 @@ export {
};
export { createLayoutContext, provideLayout, useLayout } from "./app-shell";
export { useExpandToMaster, useMasterDetail, useMasterDetailPane, usePane } from "../composables/use-master-detail";
export { useExpandToMaster, useMasterDetail, useMasterDetailPane, usePane, providePane } from "../composables/use-master-detail";
export type { ExpandToMasterOptions, PaneContext, PaneDirection, UseMasterDetailOptions, UseMasterDetailPaneOptions, UseMasterDetailPaneReturn, UseMasterDetailReturn } from "../composables/use-master-detail";
export type {