From adcfa34a3a19b91b003cb76268a04e91062044f3 Mon Sep 17 00:00:00 2001 From: Andrea Vesterhus Date: Thu, 8 Feb 2024 10:15:25 +0100 Subject: [PATCH] fix: correct directions --- packages/dm-core-plugins/src/stack/StackPlugin.tsx | 10 +++++----- packages/dm-core-plugins/src/stack/types.ts | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/dm-core-plugins/src/stack/StackPlugin.tsx b/packages/dm-core-plugins/src/stack/StackPlugin.tsx index b1567c66d..6aee14d64 100644 --- a/packages/dm-core-plugins/src/stack/StackPlugin.tsx +++ b/packages/dm-core-plugins/src/stack/StackPlugin.tsx @@ -11,11 +11,11 @@ export const StackPlugin = (props: IUIPlugin) => { // map plugin language to stack props/css language const configMap: { [name: string]: string } = { - horizontal: 'column', - vertical: 'row', - verticalPlacement: - config.direction === 'horizontal' ? 'alignItems' : 'justifyContent', + vertical: 'column', + horizontal: 'row', horizontalPlacement: + config.direction === 'horizontal' ? 'alignItems' : 'justifyContent', + verticalPlacement: config.direction === 'horizontal' ? 'justifyContent' : 'alignItems', left: 'flex-start', center: 'center', @@ -30,7 +30,7 @@ export const StackPlugin = (props: IUIPlugin) => { [configMap.verticalPlacement]: configMap[config.verticalPlacement], [configMap.horizontalPlacement]: configMap[config.horizontalPlacement], className: config.classNames?.join(' '), - spacing: config.spacing !== undefined ? config.spacing : 1.5, + spacing: config.spacing, wrap: config.wrap ? 'wrap' : 'no-wrap', style: { maxWidth: config.maxWidth }, } diff --git a/packages/dm-core-plugins/src/stack/types.ts b/packages/dm-core-plugins/src/stack/types.ts index de28ee9d2..6b46cb94d 100644 --- a/packages/dm-core-plugins/src/stack/types.ts +++ b/packages/dm-core-plugins/src/stack/types.ts @@ -3,8 +3,8 @@ import { TViewConfig } from '@development-framework/dm-core' export type StackPluginConfig = { items: TViewConfig[] direction: 'horizontal' | 'vertical' - verticalPlacement: 'left' | 'center' | 'right' | 'spaceItems' - horizontalPlacement: 'top' | 'center' | 'bottom' + horizontalPlacement: 'left' | 'center' | 'right' | 'spaceItems' + verticalPlacement: 'top' | 'center' | 'bottom' spacing: number maxWidth: string wrap: boolean @@ -13,9 +13,9 @@ export type StackPluginConfig = { export const defaultConfig: StackPluginConfig = { items: [], - direction: 'horizontal', - verticalPlacement: 'left', - horizontalPlacement: 'top', + direction: 'vertical', + horizontalPlacement: 'left', + verticalPlacement: 'top', spacing: 2, maxWidth: 'none', wrap: false,