+
{renderLayoutElements({ viewKind, viewKindElement, viewDescr, enabled, Render, readOnly })}
diff --git a/stories/FormWithColumns.stories.tsx b/stories/FormWithColumns.stories.tsx
index 2abd662..0fb948e 100644
--- a/stories/FormWithColumns.stories.tsx
+++ b/stories/FormWithColumns.stories.tsx
@@ -105,15 +105,19 @@ const viewKinds = [
'@type': 'aldkg:VerticalLayout',
options: {
style: {
- width: '20%',
+ padding: '5px',
},
width: 'all-empty-space',
},
elements: [
{
'@id': 'mktp:_63JdF67',
- '@type': 'aldkg:Control',
+ '@type': 'aldkg:Image',
resultsScope: 'rm:Cards_Coll/imageUrl',
+ options: {
+ fallback:
+ 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEF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ChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==',
+ },
},
],
},
@@ -122,7 +126,7 @@ const viewKinds = [
'@type': 'aldkg:VerticalLayout',
options: {
style: {
- width: '20%',
+ padding: '5px',
},
width: 'all-empty-space',
},
@@ -169,7 +173,7 @@ const viewKinds = [
'@type': 'aldkg:VerticalLayout',
options: {
style: {
- width: '20%',
+ padding: '5px',
},
width: 'all-empty-space',
},
@@ -201,7 +205,7 @@ const viewKinds = [
'@type': 'aldkg:VerticalLayout',
options: {
style: {
- width: '20%',
+ padding: '5px',
},
width: 'all-empty-space',
},
@@ -243,7 +247,7 @@ const viewKinds = [
'@type': 'aldkg:VerticalLayout',
options: {
style: {
- width: '20%',
+ padding: '5px',
},
width: 'all-empty-space',
},
From 4adc93b7045acad5dc3fada4fb50074cf5c95483 Mon Sep 17 00:00:00 2001
From: Artkrygin <80037398+Artkrygin@users.noreply.github.com>
Date: Tue, 12 Oct 2021 12:33:25 +0300
Subject: [PATCH 2/8] GH-38 [ADD] Data filter
---
src/controls/AntdImageControl.tsx | 2 +-
stories/FormWithColumns.stories.tsx | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/controls/AntdImageControl.tsx b/src/controls/AntdImageControl.tsx
index 07de9a1..1a2c531 100644
--- a/src/controls/AntdImageControl.tsx
+++ b/src/controls/AntdImageControl.tsx
@@ -5,7 +5,7 @@ import { withStoreToControlProps } from '../util/ContextToProps';
export const AntdImageControl = (props: any): JSX.Element => {
const { uiOptions, data } = props;
- return
;
+ return
;
};
export const antdImageControlTester: RankedTester = rankWith(3, uiTypeIs('aldkg:Image'));
diff --git a/stories/FormWithColumns.stories.tsx b/stories/FormWithColumns.stories.tsx
index 0fb948e..5d14a33 100644
--- a/stories/FormWithColumns.stories.tsx
+++ b/stories/FormWithColumns.stories.tsx
@@ -80,6 +80,10 @@ const viewKinds = [
'@type': 'aldkg:EntConstr',
schema: 'hs:ProductCardShape',
service: mktpSchemaRepoIri,
+ conditions: {
+ '@id': 'mktp:Cards_Coll_Ent0_con',
+ identifier: 'https://huntersales.ru/catalog/products/18279449',
+ },
},
],
//orderBy: [{ expression: variable('identifier0'), descending: false }],
From 401c634973f001c9b903c6872e6e13e4a12b4c67 Mon Sep 17 00:00:00 2001
From: Artkrygin <80037398+Artkrygin@users.noreply.github.com>
Date: Tue, 12 Oct 2021 13:17:23 +0300
Subject: [PATCH 3/8] GH-38 [ADD] Align for HorizontalLayout, no borders for
read-only fields
---
src/Form.css | 3 +++
src/Form.tsx | 1 +
src/layouts/AntdHorizontalLayout.tsx | 5 +++--
stories/FormWithColumns.stories.tsx | 1 +
4 files changed, 8 insertions(+), 2 deletions(-)
create mode 100644 src/Form.css
diff --git a/src/Form.css b/src/Form.css
new file mode 100644
index 0000000..92c6611
--- /dev/null
+++ b/src/Form.css
@@ -0,0 +1,3 @@
+.ant-input-disabled {
+ border: none;
+}
diff --git a/src/Form.tsx b/src/Form.tsx
index 004d469..5ae4c6b 100644
--- a/src/Form.tsx
+++ b/src/Form.tsx
@@ -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;
diff --git a/src/layouts/AntdHorizontalLayout.tsx b/src/layouts/AntdHorizontalLayout.tsx
index 0b47508..c50d11c 100644
--- a/src/layouts/AntdHorizontalLayout.tsx
+++ b/src/layouts/AntdHorizontalLayout.tsx
@@ -47,11 +47,12 @@ export const AntdHorizontalLayoutRenderer: React.FC
= ({
);
};
- 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 (
-
+
{renderLayoutElements({ viewKind, viewKindElement, viewDescr, enabled, Render })}
);
diff --git a/stories/FormWithColumns.stories.tsx b/stories/FormWithColumns.stories.tsx
index 5d14a33..ddb3ac5 100644
--- a/stories/FormWithColumns.stories.tsx
+++ b/stories/FormWithColumns.stories.tsx
@@ -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',
From 42ed9e37809b0a16f1c4f8e3b6c7fbd5ac928473 Mon Sep 17 00:00:00 2001
From: Artkrygin <80037398+Artkrygin@users.noreply.github.com>
Date: Tue, 12 Oct 2021 15:29:09 +0300
Subject: [PATCH 4/8] GH-38 [FIX] More compact form
---
src/Form.css | 3 -
src/Form.tsx | 1 -
src/layouts/AntdFormLayout.tsx | 2 +-
src/layouts/AntdHorizontalLayout.tsx | 13 +-
src/layouts/AntdVerticalLayout.tsx | 2 +-
src/util/ContextToProps.tsx | 2 +-
stories/FormWithColumns.stories.tsx | 353 ++++++++++++++-------------
7 files changed, 190 insertions(+), 186 deletions(-)
delete mode 100644 src/Form.css
diff --git a/src/Form.css b/src/Form.css
deleted file mode 100644
index 92c6611..0000000
--- a/src/Form.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.ant-input-disabled {
- border: none;
-}
diff --git a/src/Form.tsx b/src/Form.tsx
index 5ae4c6b..004d469 100644
--- a/src/Form.tsx
+++ b/src/Form.tsx
@@ -22,7 +22,6 @@ 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;
diff --git a/src/layouts/AntdFormLayout.tsx b/src/layouts/AntdFormLayout.tsx
index 3fedf46..9e61ec0 100644
--- a/src/layouts/AntdFormLayout.tsx
+++ b/src/layouts/AntdFormLayout.tsx
@@ -82,7 +82,7 @@ export const AntdFormLayout: React.FC = ({
return (
{({ width, height }: any) => (
- onEdit()}>
+
onEdit()}>
{title}
{readOnly ? null :
}