Documentation ¶
Index ¶
- func DeepCopyWithoutPrimitivePointer[T Component](src T, dst T)
- type Array
- type BaseComponent
- type BaseComponentOptions
- type Checkbox
- type CheckboxSet
- type Component
- type DateRangePicker
- type DateTimePicker
- type Form
- type Grid
- type Input
- type JsonEditor
- type LabeledOption
- type LabeledOptions
- type Map
- type Message
- type MultiString
- type OneOf
- type OneOfForm
- type OneOfForms
- type Radio
- type RadioSet
- type Select
- type SimpleOptions
- type Switch
- type Table
- type TextArea
- type VenusOptions
- type VenusOptionsOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeepCopyWithoutPrimitivePointer ¶
func DeepCopyWithoutPrimitivePointer[T Component](src T, dst T)
DeepCopyWithoutPrimitivePointer is a deep copy function for component But limitations of gob package, it can't copy primitive pointer Example: copy to {min *int = &0} will be {min *int = nil} Cause golang assume {*int=&0} >= 0 means default value => pointer's default value is nil => nil Thus we need to use DeepCopyWithoutPrimitivePointer carefully
Types ¶
type Array ¶
type Array struct { BaseComponent `json:",inline"` Min *int `json:"min,omitempty"` Max *int `json:"max,omitempty"` Form Form `json:"form"` }
func NewArray ¶
func NewArray(base BaseComponentOptions) *Array
type BaseComponent ¶
type BaseComponent struct { Component string `json:"component"` PropertyName string `json:"propertyName"` Label string `json:"label"` Placeholder string `json:"placeholder"` Required bool `json:"required"` State string `json:"state,omitempty"` DefaultValue any `json:"defaultValue,omitempty"` Messages []Message `json:"messages,omitempty"` // Width of component conflict with grid Width string `json:"width,omitempty"` // Grid of component conflict with width Grid *Grid `json:"grid,omitempty"` /** * Not useful options */ // No Message? IDK NoMsg *bool `json:"no-msg,omitempty"` // Disable component Disabled *bool `json:"disabled,omitempty"` // Component is visible or not Visible *bool `json:"visible,omitempty"` // Cannot modify input form Readonly *bool `json:"readonly,omitempty"` // No Label? IDK, It doesn't work to my expected NoLabel *bool `json:"no-label,omitempty"` // No Clear? IDK NoClear *bool `json:"no-clear,omitempty"` }
func NewBaseComponent ¶
func NewBaseComponent(component string, option BaseComponentOptions) BaseComponent
func (*BaseComponent) DeepCopy ¶
func (c *BaseComponent) DeepCopy() Component
func (*BaseComponent) SetPropertyName ¶
func (c *BaseComponent) SetPropertyName(propertyName string)
type BaseComponentOptions ¶
type Checkbox ¶
type Checkbox struct {
BaseComponent `json:",inline"`
}
func NewCheckbox ¶
func NewCheckbox(base BaseComponentOptions) *Checkbox
type CheckboxSet ¶
type CheckboxSet struct { BaseComponent `json:",inline"` *VenusOptions `json:",inline"` Column bool `json:"column"` }
func NewCheckboxSet ¶
func NewCheckboxSet(base BaseComponentOptions, options *VenusOptions) *CheckboxSet
func (*CheckboxSet) DeepCopy ¶
func (c *CheckboxSet) DeepCopy() Component
type DateRangePicker ¶
type DateRangePicker struct {
BaseComponent `json:",inline"`
}
func NewDateRangePicker ¶
func NewDateRangePicker(base BaseComponentOptions) *DateRangePicker
func (*DateRangePicker) DeepCopy ¶
func (c *DateRangePicker) DeepCopy() Component
type DateTimePicker ¶
type DateTimePicker struct {
BaseComponent `json:",inline"`
}
func NewDateTimePicker ¶
func NewDateTimePicker(base BaseComponentOptions) *DateTimePicker
func (*DateTimePicker) DeepCopy ¶
func (c *DateTimePicker) DeepCopy() Component
type Grid ¶
type Input ¶
type Input struct { BaseComponent `json:",inline"` // text or number Type string `json:"type,omitempty"` // When type is text, min length of input text // When type is number, min value of input number Min *int `json:"min,omitempty"` // When type is text, max length of input text // When type is number, max value of input number Max *int `json:"max,omitempty"` Regex string `json:"regex,omitempty"` }
func NewInput ¶
func NewInput(base BaseComponentOptions) *Input
type JsonEditor ¶
type JsonEditor struct { BaseComponent `json:",inline"` // Example: 400px Height string `json:"height,omitempty"` }
func NewJsonEditor ¶
func NewJsonEditor(base BaseComponentOptions) *JsonEditor
func (*JsonEditor) DeepCopy ¶
func (c *JsonEditor) DeepCopy() Component
type LabeledOption ¶
LabeledOption Start
type LabeledOptions ¶
type LabeledOptions []LabeledOption
func (LabeledOptions) DeepCopy ¶
func (o LabeledOptions) DeepCopy() VenusOptionsOptions
type Map ¶
type Map struct { BaseComponent `json:",inline"` Key Component `json:"key"` Values Form `json:"values"` }
func NewMap ¶
func NewMap(base BaseComponentOptions) *Map
type MultiString ¶
type MultiString struct { BaseComponent `json:",inline"` // Delimeter Delimeter string `json:"delimeter"` // Value max length Max *int `json:"max"` // Hide chips NoChips bool `json:"no-chips"` // Show copy button Copy bool `json:"copy"` }
func NewMultiString ¶
func NewMultiString(base BaseComponentOptions) *MultiString
func (*MultiString) DeepCopy ¶
func (c *MultiString) DeepCopy() Component
type OneOf ¶
type OneOf struct { BaseComponent `json:",inline"` Forms OneOfForms `json:"form"` }
func NewOneOf ¶
func NewOneOf(base BaseComponentOptions, forms OneOfForms) *OneOf
type OneOfForms ¶
type OneOfForms []OneOfForm
type Radio ¶
type Radio struct { BaseComponent `json:",inline"` RadioLabel string `json:"radio-label"` Name string `json:"name"` Option any `json:"option"` }
func NewRadio ¶
func NewRadio(base BaseComponentOptions, name string) *Radio
type RadioSet ¶
type RadioSet struct { BaseComponent `json:",inline"` *VenusOptions `json:",inline"` Column bool `json:"column"` }
func NewRadioSet ¶
func NewRadioSet(base BaseComponentOptions, options *VenusOptions) *RadioSet
type Select ¶
type Select struct { BaseComponent `json:",inline"` *VenusOptions `json:",inline"` // Apply autocomplete Autocomplete bool `json:"autocomplete"` // Can choose multiple options Multiple bool `json:"multiple"` // Can choose multiple options SelectAll bool `json:"select-all"` // Express chips briefly CollapseChips bool `json:"collapse-chips"` // Can erase chip(s) ClosableChips bool `json:"closable-chips"` // Change infinite load count InfiniteLoad *int `json:"infinite-load,omitempty"` }
func NewSelect ¶
func NewSelect(base BaseComponentOptions, options *VenusOptions) *Select
type SimpleOptions ¶
type SimpleOptions []string
SimpleOptions Start
func (SimpleOptions) DeepCopy ¶
func (o SimpleOptions) DeepCopy() VenusOptionsOptions
type Switch ¶
type Switch struct {
BaseComponent `json:",inline"`
}
func NewSwitch ¶
func NewSwitch(base BaseComponentOptions) *Switch
type Table ¶
type Table struct { BaseComponent `json:",inline"` Key Component `json:"key"` Values []Component `json:"values"` }
func NewTable ¶
func NewTable(base BaseComponentOptions) *Table
type TextArea ¶
type TextArea struct { BaseComponent `json:",inline"` Min *int `json:"min,omitempty"` Max *int `json:"max,omitempty"` Regex string `json:"regex,omitempty"` }
func NewTextArea ¶
func NewTextArea(base BaseComponentOptions) *TextArea
type VenusOptions ¶
type VenusOptions struct { Options VenusOptionsOptions `json:"options,omitempty"` OptionLabel string `json:"option-label,omitempty"` OptionValue string `json:"option-value,omitempty"` }
func NewVenusOptions ¶
func NewVenusOptions() *VenusOptions
func (*VenusOptions) DeepCopy ¶
func (o *VenusOptions) DeepCopy() *VenusOptions
func (*VenusOptions) SetLabeledOptions ¶
func (o *VenusOptions) SetLabeledOptions(options LabeledOptions)
func (*VenusOptions) SetSimpleOptions ¶
func (o *VenusOptions) SetSimpleOptions(options SimpleOptions)
type VenusOptionsOptions ¶
type VenusOptionsOptions interface { DeepCopy() VenusOptionsOptions // contains filtered or unexported methods }
VenusOptionsOptions Start
Click to show internal directories.
Click to hide internal directories.