From 706b4bd7688a8e823cfd7c663ad652345d976889 Mon Sep 17 00:00:00 2001 From: "Grigorii K. Shartsev" Date: Wed, 19 Nov 2025 09:22:05 +0100 Subject: [PATCH] fix(NcFormBox): properly support nested rows in form boxes Signed-off-by: Grigorii K. Shartsev --- src/components/NcFormBox/NcFormBox.vue | 208 +++++++++++++++++------ src/components/NcFormBox/useNcFormBox.ts | 3 + 2 files changed, 163 insertions(+), 48 deletions(-) diff --git a/src/components/NcFormBox/NcFormBox.vue b/src/components/NcFormBox/NcFormBox.vue index 6b8861e6f5..1b2ce21a44 100644 --- a/src/components/NcFormBox/NcFormBox.vue +++ b/src/components/NcFormBox/NcFormBox.vue @@ -6,87 +6,155 @@ ``` + +#### Row box + +Currently it is only used internally by other components like `NcRadioGroup`, but `row` prop can be used to display the items in a row instead of a column. + +```vue + +``` + +#### Nested form box + +Components with nested form boxes (like split buttons) are still under development, but nesting a row box inside the column boxes is already supported. + +```vue + +``` diff --git a/src/components/NcFormBox/useNcFormBox.ts b/src/components/NcFormBox/useNcFormBox.ts index 0c8a7eb149..a7462dec9b 100644 --- a/src/components/NcFormBox/useNcFormBox.ts +++ b/src/components/NcFormBox/useNcFormBox.ts @@ -9,9 +9,11 @@ import { inject } from 'vue' export const NC_FORM_BOX_CONTEXT_KEY: InjectionKey<{ isInFormBox: false + isInFormBoxRow: false formBoxItemClass: undefined } | { isInFormBox: true + isInFormBoxRow: boolean formBoxItemClass: string }> = Symbol.for('NcFormBox:context') @@ -22,6 +24,7 @@ export const NC_FORM_BOX_CONTEXT_KEY: InjectionKey<{ export function useNcFormBox() { return inject(NC_FORM_BOX_CONTEXT_KEY, { isInFormBox: false, + isInFormBoxRow: false, formBoxItemClass: undefined, }) }