diff --git a/frontend/src/lib/components/apps/components/common/ButtonComponent.svelte b/frontend/src/lib/components/apps/components/common/ButtonComponent.svelte
index 5a2c9843f7..f69ea6ab2e 100644
--- a/frontend/src/lib/components/apps/components/common/ButtonComponent.svelte
+++ b/frontend/src/lib/components/apps/components/common/ButtonComponent.svelte
@@ -1,5 +1,5 @@
+
{
runnableComponent?.runComponent()
}}
- btnClasses="h-full w-full"
+ btnClasses="w-full h-full"
+ {color}
>
{labelValue}
diff --git a/frontend/src/lib/components/apps/components/helpers/InputValue.svelte b/frontend/src/lib/components/apps/components/helpers/InputValue.svelte
index e5de65c772..76cb46ca3b 100644
--- a/frontend/src/lib/components/apps/components/helpers/InputValue.svelte
+++ b/frontend/src/lib/components/apps/components/helpers/InputValue.svelte
@@ -3,9 +3,10 @@
import type { StaticInput, DynamicInput, AppEditorContext, UserInput } from '../../types'
import { accessPropertyByPath } from '../../utils'
- type T = $$Generic
+ type T = string | number | boolean | Record | undefined
+
export let input: DynamicInput | StaticInput | UserInput
- export let value: T | undefined = undefined
+ export let value: T
const { worldStore } = getContext('AppEditorContext')
@@ -25,12 +26,12 @@
}
}
- function onValueChange(newValue: T): void {
+ function onValueChange(newValue: any): void {
if (input.type === 'output') {
if (input.name?.includes('.')) {
const path = input.name.split('.').slice(1).join('.')
- value = accessPropertyByPath(newValue, path)
+ value = accessPropertyByPath(newValue, path)
} else {
value = newValue
}
diff --git a/frontend/src/lib/components/apps/editor/componentsPanel/componentDefaultProps.ts b/frontend/src/lib/components/apps/editor/componentsPanel/componentDefaultProps.ts
index 63e5b3a6db..f9c88807ff 100644
--- a/frontend/src/lib/components/apps/editor/componentsPanel/componentDefaultProps.ts
+++ b/frontend/src/lib/components/apps/editor/componentsPanel/componentDefaultProps.ts
@@ -1,11 +1,13 @@
+import type { Aligned } from "../../types"
+
const defaultProps = {
inputs: {},
componentInputs: {}
}
-const defaultAlignement = {
- horizontalAlignement: 'center',
- verticalAlignement: 'center'
+const defaultAlignement: Aligned = {
+ horizontalAlignment: 'center',
+ verticalAlignment: 'center'
}
export { defaultProps, defaultAlignement }
diff --git a/frontend/src/lib/components/apps/editor/componentsPanel/componentStaticValues.ts b/frontend/src/lib/components/apps/editor/componentsPanel/componentStaticValues.ts
new file mode 100644
index 0000000000..bad464e2a5
--- /dev/null
+++ b/frontend/src/lib/components/apps/editor/componentsPanel/componentStaticValues.ts
@@ -0,0 +1,7 @@
+import { BUTTON_COLORS } from "../../../common";
+
+const buttonColorOptions = [...BUTTON_COLORS]
+
+export const staticValues = {
+ buttonColorOptions,
+} as const
\ No newline at end of file
diff --git a/frontend/src/lib/components/apps/editor/componentsPanel/data.ts b/frontend/src/lib/components/apps/editor/componentsPanel/data.ts
index efba3a2004..b687973a12 100644
--- a/frontend/src/lib/components/apps/editor/componentsPanel/data.ts
+++ b/frontend/src/lib/components/apps/editor/componentsPanel/data.ts
@@ -1,4 +1,4 @@
-import type { AppComponent } from '../../types'
+import type { AppComponent, ComponentSet } from '../../types'
import { defaultAlignement, defaultProps } from './componentDefaultProps'
const windmillComponents = {
@@ -20,7 +20,7 @@ const windmillComponents = {
] as AppComponent[]
}
-const plainComponents = {
+const plainComponents: ComponentSet = {
title: 'Plain Components',
components: [
{
@@ -47,11 +47,18 @@ const plainComponents = {
visible: true,
value: 'Lorem ipsum',
fieldType: 'textarea'
+ },
+ color: {
+ fieldType: 'select',
+ type: 'static',
+ visible: true,
+ value: 'blue',
+ optionValuesKey: 'buttonColorOptions',
}
},
runnable: true
}
- ] as AppComponent[]
+ ]
}
const chartComponents = {
diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/ComponentPanel.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/ComponentPanel.svelte
index 82357c2fd1..8aba6660b7 100644
--- a/frontend/src/lib/components/apps/editor/settingsPanel/ComponentPanel.svelte
+++ b/frontend/src/lib/components/apps/editor/settingsPanel/ComponentPanel.svelte
@@ -118,11 +118,11 @@
{/if}
- {#if component.verticalAlignement !== undefined}
-
- Horizontal alignement
+ {#if component.verticalAlignment !== undefined}
+
+ Horizontal alignment
-
+
@@ -133,9 +133,9 @@
- Vertical alignement
+ Vertical alignment
-
+
diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/StaticInputEditor.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/StaticInputEditor.svelte
index 29b9199130..7e111eee08 100644
--- a/frontend/src/lib/components/apps/editor/settingsPanel/StaticInputEditor.svelte
+++ b/frontend/src/lib/components/apps/editor/settingsPanel/StaticInputEditor.svelte
@@ -1,6 +1,7 @@