feat/add support for setting collapsable fields (array, block, collapsable… (#1057)

Co-authored-by: liorix <liorix@gmail.com>
Co-authored-by: Elliot DeNolf <denolfe@gmail.com>
This commit is contained in:
Dan Ribbens
2022-09-12 13:39:49 -04:00
committed by GitHub
parent ca434b8a92
commit 834f4ebd38
12 changed files with 191 additions and 77 deletions

View File

@@ -11,6 +11,7 @@ export const baseAdminFields = joi.object().keys({
style: joi.object().unknown(),
className: joi.string(),
readOnly: joi.boolean().default(false),
initCollapsed: joi.boolean().default(false),
hidden: joi.boolean().default(false),
disabled: joi.boolean().default(false),
condition: joi.func(),

View File

@@ -184,6 +184,9 @@ export type CollapsibleField = Omit<FieldBase, 'name'> & {
type: 'collapsible';
label: string
fields: Field[];
admin?: Admin & {
initCollapsed?: boolean | false;
}
}
export type TabsAdmin = Omit<Admin, 'description'>;
@@ -327,6 +330,9 @@ export type ArrayField = FieldBase & {
maxRows?: number;
labels?: Labels;
fields: Field[];
admin?: Admin & {
initCollapsed?: boolean | false;
}
}
export type RadioField = FieldBase & {
@@ -352,6 +358,10 @@ export type BlockField = FieldBase & {
blocks: Block[];
defaultValue?: unknown
labels?: Labels
admin?: Admin & {
initCollapsed?: boolean | false;
}
}
export type PointField = FieldBase & {