{editable ? (
editing ? (
|
diff --git a/src/data-controls/GridRenderer.tsx b/src/data-controls/GridRenderer.tsx
index e6c73e6..543f9f4 100644
--- a/src/data-controls/GridRenderer.tsx
+++ b/src/data-controls/GridRenderer.tsx
@@ -19,6 +19,8 @@ export const GridRenderer: React.FC
= (props) => {
const { viewKind, viewKindElement, viewDescr, viewDescrElement, child, schema } = props;
const grid = viewKindElement?.options?.grid || { gutter: 16, column: 4 };
const template = viewKindElement?.options?.elementTemplate || null;
+ const style = viewKindElement?.options?.style;
+
const createCell = (data: any, id: string | number) =>
template ? (
template.map((e: IViewKindElement, idx: number) => (
@@ -38,6 +40,11 @@ export const GridRenderer: React.FC = (props) => {
{data['@id']}
);
return (
- {createCell(item, idx)}} />
+ {createCell(item, idx)}}
+ />
);
};
diff --git a/stories/CardsGridList.stories.tsx b/stories/CardsGridList.stories.tsx
index 67dd6ea..88bf48e 100644
--- a/stories/CardsGridList.stories.tsx
+++ b/stories/CardsGridList.stories.tsx
@@ -65,10 +65,19 @@ const viewKinds = [
xl: 4,
xxl: 7,
},
+ style: {
+ minWidth: 460,
+ },
elementTemplate: [
{
'@id': 'mktp:_94hfT67',
'@type': 'aldkg:CardLayout',
+ options: {
+ style: {
+ maxWidth: 340,
+ minWidth: 220,
+ },
+ },
elements: [
{
'@id': 'mktp:_kje733js',
@@ -119,6 +128,9 @@ const viewKinds = [
textAlign: 'left',
fontFamily: 'Lato,Tahoma,sans-serif',
color: 'gray',
+ height: '1rem',
+ overflow: 'hidden',
+ textOverflow: 'ellipsis',
},
},
},
@@ -134,6 +146,9 @@ const viewKinds = [
textAlign: 'right',
fontFamily: 'Lato,Tahoma,sans-serif',
color: 'gray',
+ height: '1rem',
+ overflow: 'hidden',
+ textOverflow: 'ellipsis',
},
},
},
@@ -154,6 +169,9 @@ const viewKinds = [
textAlign: 'left',
fontFamily: 'Lato,Tahoma,sans-serif',
color: 'gray',
+ height: '1rem',
+ overflow: 'hidden',
+ textOverflow: 'ellipsis',
},
},
},
@@ -172,6 +190,9 @@ const viewKinds = [
textAlign: 'left',
fontFamily: 'Lato,Tahoma,sans-serif',
color: 'gray',
+ height: '1rem',
+ overflow: 'hidden',
+ textOverflow: 'ellipsis',
},
},
},
@@ -193,16 +214,17 @@ const viewKinds = [
options: {
style: {
border: '1.5px solid black',
+ padding: '0 3px 0 3px',
borderRadius: '2px',
height: '2em',
textAlign: 'center',
fontWeight: 500,
- width: '90px',
color: 'black',
},
specialImage: 'https://www.meme-arsenal.com/memes/f8e9bfb9fdf368272b21a5dac8f01ec1.jpg',
editable: false,
formatter: 'link',
+ relativeFont: 0.06,
dataToFormatter: {
link: '@id',
},
@@ -214,11 +236,12 @@ const viewKinds = [
'@type': 'aldkg:Button',
options: {
label: 'Добавить',
+ relativeFont: 0.06,
style: {
border: '1.5px solid black',
borderRadius: '2px',
- width: '90px',
fontWeight: 500,
+ backgroundColor: 'white',
color: 'black',
},
},
diff --git a/stories/CardsHorizontalScroller.stories.tsx b/stories/CardsHorizontalScroller.stories.tsx
index 53bb29f..02a4d82 100644
--- a/stories/CardsHorizontalScroller.stories.tsx
+++ b/stories/CardsHorizontalScroller.stories.tsx
@@ -54,7 +54,12 @@ const viewKinds = [
elements: [
{
'@id': 'mktp:_29kFg89',
- '@type': 'aldkg:VerticalLayout',
+ '@type': 'aldkg:PanelLayout',
+ options: {
+ style: {
+ width: '100%',
+ },
+ },
elements: [
{
'@id': 'mktp:_24Hdr78',
@@ -69,6 +74,12 @@ const viewKinds = [
{
'@id': 'mktp:_94hfT67',
'@type': 'aldkg:CardLayout',
+ options: {
+ style: {
+ maxWidth: 340,
+ minWidth: 220,
+ },
+ },
elements: [
{
'@id': 'mktp:_kje733js',
@@ -119,6 +130,9 @@ const viewKinds = [
textAlign: 'left',
fontFamily: 'Lato,Tahoma,sans-serif',
color: 'gray',
+ height: '1rem',
+ overflow: 'hidden',
+ textOverflow: 'ellipsis',
},
},
},
@@ -134,6 +148,9 @@ const viewKinds = [
textAlign: 'right',
fontFamily: 'Lato,Tahoma,sans-serif',
color: 'gray',
+ height: '1rem',
+ overflow: 'hidden',
+ textOverflow: 'ellipsis',
},
},
},
@@ -154,6 +171,9 @@ const viewKinds = [
textAlign: 'left',
fontFamily: 'Lato,Tahoma,sans-serif',
color: 'gray',
+ height: '1rem',
+ overflow: 'hidden',
+ textOverflow: 'ellipsis',
},
},
},
@@ -172,6 +192,9 @@ const viewKinds = [
textAlign: 'left',
fontFamily: 'Lato,Tahoma,sans-serif',
color: 'gray',
+ height: '1rem',
+ overflow: 'hidden',
+ textOverflow: 'ellipsis',
},
},
},
@@ -189,16 +212,17 @@ const viewKinds = [
options: {
style: {
border: '1.5px solid black',
+ padding: '0 3px 0 3px',
borderRadius: '2px',
height: '2em',
textAlign: 'center',
fontWeight: 500,
- width: '90px',
color: 'black',
},
specialImage: 'https://www.meme-arsenal.com/memes/f8e9bfb9fdf368272b21a5dac8f01ec1.jpg',
editable: false,
formatter: 'link',
+ relativeFont: 0.06,
dataToFormatter: {
link: '@id',
},
@@ -210,11 +234,12 @@ const viewKinds = [
'@type': 'aldkg:Button',
options: {
label: 'Добавить',
+ relativeFont: 0.06,
style: {
border: '1.5px solid black',
borderRadius: '2px',
- width: '90px',
fontWeight: 500,
+ backgroundColor: 'white',
color: 'black',
},
},