diff --git a/ordinis-admin-ui/src/components/record/RecordDrawer.tsx b/ordinis-admin-ui/src/components/record/RecordDrawer.tsx index 5ce7aa3..a2efc2d 100644 --- a/ordinis-admin-ui/src/components/record/RecordDrawer.tsx +++ b/ordinis-admin-ui/src/components/record/RecordDrawer.tsx @@ -88,6 +88,18 @@ export type RecordDrawerProps = { onDelete?: () => void /** Show [История] button + handler (только edit mode). */ onHistory?: () => void + /** Optional sticky toolbar per handoff line 279: search полей by name + + * "только заполненные" toggle + counter. Caller controls state. Pass + * undefined чтобы скрыть toolbar (e.g. create mode without filter context). */ + toolbar?: { + search: string + onSearchChange: (next: string) => void + onlyFilled: boolean + onOnlyFilledChange: (next: boolean) => void + /** "N / M полей" caption — visible / total. */ + counterVisible: number + counterTotal: number + } children: ReactNode } @@ -101,6 +113,7 @@ export function RecordDrawer({ isPending = false, onDelete, onHistory, + toolbar, children, }: RecordDrawerProps) { const { t } = useTranslation() @@ -177,10 +190,36 @@ export function RecordDrawer({ + {/* === TOOLBAR (sticky) per handoff line 279 === + * Optional — caller passes toolbar prop с search/onlyFilled state. */} + {toolbar && ( +
+ toolbar.onSearchChange(e.target.value)} + placeholder={t('drawer.searchPlaceholder', { defaultValue: 'Поиск полей' })} + className="flex-1 h-7 px-2.5 rounded-md border border-line bg-surface-2 text-body text-ink placeholder:text-mute focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" + /> + + + {toolbar.counterVisible}/{toolbar.counterTotal} + +
+ )} + {/* === BODY (scrolling) === - * Phase 2 здесь будет: sticky toolbar (search + filled-only toggle + - * counter) → section anchor chips strip → optional left ToC rail в - * wide mode (CSS grid 180px / 1fr). Пока children — SchemaDrivenForm. */} + * Phase B остатки (deferred — требует x-section schema metadata): + * - section anchor chips strip над form sections + * - wide-mode left ToC rail (180px) в CSS grid 180px/1fr layout */}
{children}
{/* === FOOTER (sticky bottom) === */}