mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-06 08:01:35 +00:00
* 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>
112 lines
2.0 KiB
TypeScript
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 }
|