diff --git a/src/layouts/AntdFormLayout.tsx b/src/layouts/AntdFormLayout.tsx index 8cb655a..0df446c 100644 --- a/src/layouts/AntdFormLayout.tsx +++ b/src/layouts/AntdFormLayout.tsx @@ -83,7 +83,7 @@ export const AntdFormLayout: React.FC = ({ {({ width, height }: any) => (
onEdit()}> - {title} + {title && {title}} {readOnly ? null : }
= ({ }) => { const style = viewKindElement.options?.style; const Render: React.FC = ({ idx, viewKind, viewKindElement, viewDescr, enabled }) => { - const options = viewKindElement.options || {}; + const height = viewKindElement.options?.style?.height; + console.log('OPT', viewKindElement, height); const newViewKindElement = { ...viewKindElement }; if (newViewKindElement.options) { newViewKindElement.options.style = {}; @@ -39,8 +40,8 @@ export const AntdVerticalLayoutRenderer: React.FC = ({ diff --git a/src/util/layout.tsx b/src/util/layout.tsx index 07bec8f..7230383 100644 --- a/src/util/layout.tsx +++ b/src/util/layout.tsx @@ -35,7 +35,7 @@ export const renderLayoutElements = ({ //const sort = id ? viewKind.properties && viewKind.properties[id] && viewKind.properties[id].order : undefined; if (!elements || elements.length === 0) return <>; return elements.map((el: IViewKindElement, idx: number) => { - el = { ...el, options: { ...el.options, readOnly } }; + el = { ...el, options: { readOnly, ...el.options } }; return ( ); diff --git a/stories/FormWithColumns.stories.tsx b/stories/FormWithColumns.stories.tsx index 9a8f8b9..58c89ad 100644 --- a/stories/FormWithColumns.stories.tsx +++ b/stories/FormWithColumns.stories.tsx @@ -102,10 +102,13 @@ const viewKinds = [ }, elements: [ { - '@id': 'rm:_83hd7f', + '@id': 'rm:_834hd7f', '@type': 'aldkg:FormLayout', options: { - readOnly: false, + style: { + height: '100%', + }, + readOnly: true, }, elements: [ {