Skip to content

Commit

Permalink
GH-38 [ADD] Align for HorizontalLayout, no borders for read-only fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Artkrygin committed Oct 12, 2021
1 parent 4adc93b commit 401c634
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/Form.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.ant-input-disabled {
border: none;
}
1 change: 1 addition & 0 deletions src/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { UnknownRenderer } from './UnknownRenderer';
import { RankedTester } from './testers';
import { IViewDescr, IViewDescrElement, IViewKind, IViewKindElement } from './models/uischema';
import { JsObject } from '@agentlab/sparql-jsld-client';
import './Form.css';

export interface ControlComponent {
data: any;
Expand Down
5 changes: 3 additions & 2 deletions src/layouts/AntdHorizontalLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ export const AntdHorizontalLayoutRenderer: React.FC<LayoutComponent> = ({
</Col>
);
};
const justify: any = viewKindElement.options ? viewKindElement.options.justify : 'center';
const justify: any = viewKindElement.options?.justify || 'center';
const align: any = viewKindElement.options?.align || 'middle';
const rowStyle: any = { flexWrap: 'nowrap' };
if (viewKindElement.options && viewKindElement.options.width === 'all-empty-space') rowStyle.width = '100%';
return (
<Row justify={justify} style={rowStyle} align={'middle'}>
<Row justify={justify} style={rowStyle} align={align}>
{renderLayoutElements({ viewKind, viewKindElement, viewDescr, enabled, Render })}
</Row>
);
Expand Down
1 change: 1 addition & 0 deletions stories/FormWithColumns.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ const viewKinds = [
'@type': 'aldkg:HorizontalLayout',
options: {
justify: 'start', // start end center space-between space-around
align: 'flex-start',
//contentSize: true,
style: {
//flexGrow: '5',
Expand Down

0 comments on commit 401c634

Please sign in to comment.