yao/widgets/field/types.go
Max 1a1ffabbd8 feat: Add hideLabel option to component and column DSL
Add the hideLabel option to the component and column DSLs. This allows hiding the label for the respective widgets. The hideLabel option is set to true in the component and column DSLs when necessary.
2024-05-23 06:48:12 +08:00

58 lines
1.7 KiB
Go

package field
import (
"github.com/yaoapp/yao/widgets/component"
)
// Filters the filters DSL
type Filters map[string]FilterDSL
// Columns the columns DSL
type Columns map[string]ColumnDSL
// ComputeFields the Compute filelds
type ComputeFields map[string]string
// CloudProps the cloud props
type CloudProps map[string]component.CloudPropsDSL
// ColumnDSL the field column dsl
type ColumnDSL struct {
ID string `json:"id,omitempty"`
Data *component.CloudPropsDSL `json:"$data,omitempty"`
Key string `json:"key,omitempty"`
Bind string `json:"bind,omitempty"`
Link string `json:"link,omitempty"`
HideLabel bool `json:"hideLabel,omitempty"`
View *component.DSL `json:"view,omitempty"`
Edit *component.DSL `json:"edit,omitempty"`
}
type aliasColumnDSL ColumnDSL
// FilterDSL the field filter dsl
type FilterDSL struct {
ID string `json:"id,omitempty"`
Key string `json:"key,omitempty"`
Bind string `json:"bind,omitempty"`
Edit *component.DSL `json:"edit,omitempty"`
}
type aliasFilterDSL FilterDSL
// Compute the compute filed
type Compute string
// Transform the field transform
type Transform struct {
Variables map[string]interface{} `json:"variables,omitempty"`
Aliases map[string]string `json:"aliases,omitempty"`
Fields map[string]TransformField `json:"fields,omitempty"`
}
// TransformField the transform.types[*]
type TransformField struct {
Filter *FilterDSL `json:"filter,omitempty"`
Form *ColumnDSL `json:"form,omitempty"`
Table *ColumnDSL `json:"table,omitempty"`
}