Files
windmill/frontend/src/lib/components/apps/editor/componentsPanel/data.ts
T
Ádám KovácsandFaton Ramadani 5437eb52a5 feat: Update apps button component with colors (#936)
* feat: Update app component types

* fix: Typos

* feat: Add select input type to components

* fix: Remove width property from component types

* fix: Make button full width in editor

* fix: Types

Co-authored-by: Faton Ramadani <faton.ramadani14@gmail.com>
2022-11-23 19:45:19 +01:00

112 lines
2.0 KiB
TypeScript

import type { AppComponent, ComponentSet } from '../../types'
import { defaultAlignement, defaultProps } from './componentDefaultProps'
const windmillComponents = {
title: 'Windmill Components',
components: [
{
...defaultProps,
id: 'displaycomponent',
type: 'displaycomponent',
componentInputs: {
result: {
id: undefined,
name: undefined,
type: 'output',
defaultValue: undefined
}
}
}
] as AppComponent[]
}
const plainComponents: ComponentSet = {
title: 'Plain Components',
components: [
{
...defaultProps,
...defaultAlignement,
id: 'textcomponent',
type: 'textcomponent',
componentInputs: {
content: {
type: 'static',
visible: true,
value: 'Lorem ipsum',
fieldType: 'textarea'
}
}
},
{
...defaultProps,
id: 'buttoncomponent',
type: 'buttoncomponent',
componentInputs: {
label: {
type: 'static',
visible: true,
value: 'Lorem ipsum',
fieldType: 'textarea'
},
color: {
fieldType: 'select',
type: 'static',
visible: true,
value: 'blue',
optionValuesKey: 'buttonColorOptions',
}
},
runnable: true
}
]
}
const chartComponents = {
title: 'Charts',
components: [
{
...defaultProps,
id: 'piechartcomponent',
type: 'piechartcomponent',
runnable: true,
card: true
},
{
...defaultProps,
id: 'barchartcomponent',
type: 'barchartcomponent',
runnable: true,
card: true
}
] as AppComponent[]
}
const tableComponents = {
title: 'Table',
components: [
{
...defaultProps,
id: 'tablecomponent',
type: 'tablecomponent',
componentInputs: {
searchEnabled: {
type: 'static',
value: false,
fieldType: 'boolean'
},
paginationEnabled: {
type: 'static',
value: false,
fieldType: 'boolean'
}
},
runnable: true,
card: true
}
] as AppComponent[]
}
const componentSets = [windmillComponents, plainComponents, chartComponents, tableComponents]
export { componentSets }