diff --git a/frontend/src/lib/components/apps/components/AppDivider.svelte b/frontend/src/lib/components/apps/components/AppDivider.svelte new file mode 100644 index 0000000000..91984389fc --- /dev/null +++ b/frontend/src/lib/components/apps/components/AppDivider.svelte @@ -0,0 +1,24 @@ + + + + + + +
+
diff --git a/frontend/src/lib/components/apps/components/helpers/AlignWrapper.svelte b/frontend/src/lib/components/apps/components/helpers/AlignWrapper.svelte index 8f581017d3..63f14f81f0 100644 --- a/frontend/src/lib/components/apps/components/helpers/AlignWrapper.svelte +++ b/frontend/src/lib/components/apps/components/helpers/AlignWrapper.svelte @@ -1,30 +1,29 @@ diff --git a/frontend/src/lib/components/apps/editor/Component.svelte b/frontend/src/lib/components/apps/editor/Component.svelte index b4644bfcd8..717f3cff18 100644 --- a/frontend/src/lib/components/apps/editor/Component.svelte +++ b/frontend/src/lib/components/apps/editor/Component.svelte @@ -17,7 +17,9 @@ Code2, SlidersHorizontal, PlusSquare, - DollarSign + DollarSign, + SeparatorHorizontal, + SeparatorVertical } from 'lucide-svelte' import type { Size } from 'svelte-grid' @@ -68,6 +70,8 @@ export type SelectComponent = BaseComponent<'selectcomponent'> export type CheckboxComponent = BaseComponent<'checkboxcomponent'> export type RadioComponent = BaseComponent<'radiocomponent'> + export type HorizontalDividerComponent = BaseComponent<'horizontaldividercomponent'> + export type VerticalDividerComponent = BaseComponent<'verticaldividercomponent'> export type AppComponent = BaseAppComponent & ( @@ -94,6 +98,8 @@ | FormButtonComponent | VegaLiteComponent | PlotlyComponent + | HorizontalDividerComponent + | VerticalDividerComponent ) // Dimensions key formula: :-: @@ -918,7 +924,59 @@ }, card: false } - } + }, + horizontaldividercomponent: { + name: 'Divider X', + icon: SeparatorHorizontal, + dims: '3:1-12:1', + data: { + verticalAlignment: 'center', + id: '', + type: 'horizontaldividercomponent', + componentInput: undefined, + configuration: { + size: { + type: 'static', + value: 2, + fieldType: 'number', + onlyStatic: true, + }, + color: { + type: 'static', + value: '#00000060', + fieldType: 'text', + onlyStatic: true, + }, + }, + card: false + } + }, + verticaldividercomponent: { + name: 'Divider Y', + icon: SeparatorVertical, + dims: '1:4-1:6', + data: { + horizontalAlignment: 'center', + id: '', + type: 'verticaldividercomponent', + componentInput: undefined, + configuration: { + size: { + type: 'static', + value: 2, + fieldType: 'number', + onlyStatic: true, + }, + color: { + type: 'static', + value: '#00000060', + fieldType: 'text', + onlyStatic: true, + }, + }, + card: false + } + }, } const inputs: ComponentSet = { @@ -953,7 +1011,9 @@ 'barchartcomponent', 'scatterchartcomponent', 'timeseriescomponent', - 'displaycomponent' + 'displaycomponent', + 'horizontaldividercomponent', + 'verticaldividercomponent', ] } @@ -1316,6 +1376,7 @@ import { defaultAlignement } from './componentsPanel/componentDefaultProps' import AppRangeInput from '../components/numberInputs/AppRangeInput.svelte' import AppCurrencyInput from '../components/numberInputs/AppCurrencyInput.svelte' + import AppDivider from '../components/AppDivider.svelte' export let component: AppComponent export let selected: boolean @@ -1468,6 +1529,10 @@ {:else if component.type === 'slidercomponent'} + {:else if component.type === 'horizontaldividercomponent'} + + {:else if component.type === 'verticaldividercomponent'} + {:else if component.type === 'rangecomponent'} {/if} diff --git a/frontend/src/lib/components/apps/editor/componentsPanel/componentStaticValues.ts b/frontend/src/lib/components/apps/editor/componentsPanel/componentStaticValues.ts index e650790932..d910ef6aad 100644 --- a/frontend/src/lib/components/apps/editor/componentsPanel/componentStaticValues.ts +++ b/frontend/src/lib/components/apps/editor/componentsPanel/componentStaticValues.ts @@ -10,5 +10,4 @@ export const staticValues = { textStyleOptions: ['Title', 'Subtitle', 'Body', 'Label', 'Caption'], currencyOptions: ['USD', 'EUR', 'GBP', 'CAD', 'AUD', 'JPY', 'CNY', 'INR', 'BRL'], localeOptions: ['en-US', 'en-GB', 'en-IE', 'de-DE', 'fr-FR', 'br-FR', 'ja-JP', 'pt-TL', 'fr-CA', 'en-CA'] - } as const diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/AlignmentEditor.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/AlignmentEditor.svelte index 9dd5e5b1cd..5d80aac801 100644 --- a/frontend/src/lib/components/apps/editor/settingsPanel/AlignmentEditor.svelte +++ b/frontend/src/lib/components/apps/editor/settingsPanel/AlignmentEditor.svelte @@ -14,45 +14,43 @@ export let component: AppComponent -{#if component.verticalAlignment !== undefined} - -
- {#if component.horizontalAlignment} -
-
Horizontal
-
- - - - - - - - - - - -
+ +
+ {#if component.horizontalAlignment} +
+
Horizontal
+
+ + + + + + + + + + +
- {/if} - {#if component.type !== 'formcomponent' && component.verticalAlignment} -
-
Vertical
-
- - - - - - - - - - - -
+
+ {/if} + {#if component.type !== 'formcomponent' && component.verticalAlignment} +
+
Vertical
+
+ + + + + + + + + + +
- {/if} -
- -{/if} +
+ {/if} +
+