selection

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arg

type Arg interface {
	Type() ArgType
	String() string
	Wrap(string) string
}

type ArgType

type ArgType int
const (
	ArgInt ArgType = iota
	ArgString
	ArgOperation
)

type BaseArg

type BaseArg string

func (BaseArg) String

func (b BaseArg) String() string

func (BaseArg) Wrap

func (b BaseArg) Wrap(s string) string

type Configuration

type Configuration struct {
	AdaptContainerCssClass string                 `json:"adaptContainerCssClass,omitempty"`
	AdaptDropdownCssClass  string                 `json:"adaptDropdownCssClass,omitempty"`
	Ajax                   map[string]interface{} `json:"ajax,omitempty"`
	AllowClear             bool                   `json:"allowClear,omitempty"`
	AmdBase                string                 `json:"amdBase,omitempty"`
	AmdLanguageBase        string                 `json:"amdLanguageBase,omitempty"`
	CloseOnSelect          bool                   `json:"closeOnSelect,omitempty"`
	ContainerCss           map[string]interface{} `json:"containerCss,omitempty"`
	ContainerCssClass      string                 `json:"containerCssClass,omitempty"`
	Data                   Options                `json:"data,omitempty"`
	Debug                  bool                   `json:"debug,omitempty"`
	Disabled               bool                   `json:"disabled,omitempty"`

	DropdownAutoWidth bool                   `json:"dropdownAutoWidth,omitempty"`
	DropdownCss       map[string]interface{} `json:"dropdownCss,omitempty"`
	DropdownCssClass  string                 `json:"dropdownCssClass,omitempty"`
	DropdownParent    string                 `json:"dropdownParent,omitempty"`

	EscapeMarkup  func()      `json:"escapeMarkup,omitempty"`
	InitSelection func()      `json:"initSelection,omitempty"`
	Language      interface{} `json:"language,omitempty"`
	Matcher       func()      `json:"matcher,omitempty"`

	MaximumInputLength      int `json:"maximumInputLength,omitempty"`
	MaximumSelectionLength  int `json:"maximumSelectionLength,omitempty"`
	MinimumInputLength      int `json:"minimumInputLength,omitempty"`
	MinimumResultsForSearch int `json:"minimumResultsForSearch,omitempty"`

	Multiple      bool        `json:"multiple,omitempty"`
	Placeholder   interface{} `json:"placeholder,omitempty"`
	Query         func()      `json:"query,omitempty"`
	SelectOnClose bool        `json:"selectOnClose,omitempty"`
	Sorter        func()      `json:"sorter,omitempty"`
	Tags          bool        `json:"tags,omitempty"`

	TemplateResultFns    []Function
	TemplateResult       string `json:"templateResult,omitempty"`
	TemplateSelectionFns []Function
	TemplateSelection    string `json:"templateSelection,omitempty"`

	Theme             string   `json:"theme,omitempty"`
	Tokenizer         func()   `json:"tokenizer,omitempty"`
	TokenSeparators   []string `json:"tokenSeparators,omitempty"`
	Width             string   `json:"width,omitempty"`
	ScrollAfterSelect bool     `json:"scrollAfterSelect,omitempty"`
}

type Data

type Data struct {
	Results    Options    `json:"results"`
	Pagination Pagination `json:"pagination"`
}

type Function

type Function struct {
	Format string
	Args   []Arg
	Next   *Function
	P      func(f string, args []Arg, next *Function) string
}

func Add

func Add(arg Arg) Function

func AddFront

func AddFront(arg Arg) Function

func If

func If(operation, arg Arg, next *Function) Function

func Return

func Return() Function

type IntArg

type IntArg BaseArg

func (IntArg) Type

func (s IntArg) Type() ArgType

type OperationArg

type OperationArg BaseArg

func (OperationArg) Type

func (s OperationArg) Type() ArgType

type Option

type Option struct {
	ID       interface{} `json:"id"`
	Text     string      `json:"text"`
	Selected bool        `json:"selected,omitempty"`
	Disabled bool        `json:"disabled,omitempty"`
}

type Options

type Options []Option

type Pagination

type Pagination struct {
	More bool `json:"more"`
}

type StringArg

type StringArg BaseArg

func (StringArg) Type

func (s StringArg) Type() ArgType

func (StringArg) Wrap

func (s StringArg) Wrap(ss string) string

Jump to

Keyboard shortcuts

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