model

package
v1.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 0 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConditionBase

type ConditionBase struct {
	Key         string        `json:"key,omitempty"`
	Label       string        `json:"label,omitempty"`
	Type        ConditionType `json:"type,omitempty"`
	Placeholder string        `json:"placeholder,omitempty"`
	Disabled    bool          `json:"disabled,omitempty"`
	// condition relative location of filter form
	Outside bool `json:"outside,omitempty"`
}

ConditionBase .

func NewCondition

func NewCondition(key string, label string) *ConditionBase

NewCondition .

type ConditionType

type ConditionType string

ConditionType .

const (
	ConditionTypeSelect     ConditionType = "select"
	ConditionTypeInput      ConditionType = "input"
	ConditionTypeDateRange  ConditionType = "dateRange"
	ConditionTypeTagsSelect ConditionType = "tagsSelect"
)

ConditionTypeSelect .

type DateRangeCondition

type DateRangeCondition SelectCondition

DateRangeCondition .

func NewDateRangeCondition

func NewDateRangeCondition(key string, label string) *DateRangeCondition

NewDateRangeCondition .

func (DateRangeCondition) Type

Type .

type InputCondition

type InputCondition struct {
	ConditionBase
}

InputCondition .

func NewInputCondition

func NewInputCondition(key string, label string) *InputCondition

NewInputCondition initial condition

func (InputCondition) Type

func (o InputCondition) Type() ConditionType

Type .

type OptionBase

type OptionBase struct {
	Label string      `json:"label,omitempty"`
	Value interface{} `json:"value,omitempty"`
	Fix   bool        `json:"fix,omitempty"`
}

OptionBase .

type SelectCondition

type SelectCondition struct {
	ConditionBase
	Mode    string         `json:"mode,omitempty"`
	Options []SelectOption `json:"options,omitempty"`
}

SelectCondition .

func NewSelectCondition

func NewSelectCondition(key string, label string, options []SelectOption) *SelectCondition

NewSelectCondition initial condition with select option

func (SelectCondition) Type

func (o SelectCondition) Type() ConditionType

Type .

func (*SelectCondition) WithMode

func (o *SelectCondition) WithMode(mode string) *SelectCondition

WithMode .

func (*SelectCondition) WithPlaceHolder

func (o *SelectCondition) WithPlaceHolder(placeholder string) *SelectCondition

WithPlaceHolder .

type SelectConditionWithChildren

type SelectConditionWithChildren struct {
	ConditionBase
	Mode    string                     `json:"mode,omitempty"`
	Options []SelectOptionWithChildren `json:"options,omitempty"`
}

SelectConditionWithChildren .

func NewSelectConditionWithChildren

func NewSelectConditionWithChildren(key string, label string, options []SelectOptionWithChildren) *SelectConditionWithChildren

NewSelectConditionWithChildren initial condition with select option with children

func (SelectConditionWithChildren) Type

Type .

type SelectOption

type SelectOption OptionBase

SelectOption .

func NewSelectOption

func NewSelectOption(label string, value interface{}) *SelectOption

NewSelectOption .

func (*SelectOption) WithFix

func (o *SelectOption) WithFix(fix bool) *SelectOption

WithFix .

type SelectOptionWithChildren

type SelectOptionWithChildren struct {
	SelectOption
	Children []SelectOption `json:"children,omitempty"`
}

SelectOptionWithChildren .

func NewSelectChildrenOption

func NewSelectChildrenOption(label string, value interface{}, children []SelectOption) *SelectOptionWithChildren

NewSelectChildrenOption .

type TagsSelectCondition

type TagsSelectCondition struct {
	ConditionBase
	Mode    string             `json:"mode,omitempty"`
	Options []TagsSelectOption `json:"options,omitempty"`
}

TagsSelectCondition .

func NewTagsSelectCondition

func NewTagsSelectCondition(key string, label string, options []TagsSelectOption) *TagsSelectCondition

NewTagsSelectCondition .

func (TagsSelectCondition) Type

Type .

type TagsSelectOption

type TagsSelectOption struct {
	SelectOption
	Color string `json:"color,omitempty"`
}

TagsSelectOption .

func NewTagsSelectOption

func NewTagsSelectOption(label string, value interface{}, color string) *TagsSelectOption

NewTagsSelectOption .

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL