list

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: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// OpListChangePageKey list level
	OpListChangePageKey = "changePage"

	// OpItemStarKey item level
	OpItemStarKey = "star"
	// OpItemClickGotoKey item level
	OpItemClickGotoKey = "clickGoto"
	// OpItemClickKey .
	OpItemClickKey = "click"
	// OpBatchRowsHandleKey .
	OpBatchRowsHandleKey = "batchRowsHandle"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomData

type CustomData interface {
	CustomDataPtr() interface{}
	EncodeFromCustomData(customDataPtr interface{}, stdDataPtr *Data)
	DecodeToCustomData(stdDataPtr *Data, customDataPtr interface{})
}

CustomData is list's custom data handler.

type CustomInParams

type CustomInParams interface {
	CustomInParamsPtr() interface{}
	EncodeFromCustomInParams(customInParamsPtr interface{}, stdInParamsPtr *cptype.ExtraMap)
	DecodeToCustomInParams(stdInParamsPtr *cptype.ExtraMap, customInParamsPtr interface{})
}

CustomInParams is list's custom inParams handler.

type CustomState

type CustomState interface {
	CustomStatePtr() interface{}
	EncodeFromCustomState(customStatePtr interface{}, stdStatePtr *cptype.ExtraMap)
	DecodeToCustomState(stdStatePtr *cptype.ExtraMap, customStatePtr interface{})
}

CustomState is list's custom state handler.

type Data

type Data struct {
	Title        string                                   `json:"title,omitempty"`
	TitleSummary string                                   `json:"titleSummary,omitempty"`
	List         []Item                                   `json:"list,omitempty"`
	PageNo       uint64                                   `json:"pageNo,omitempty"`
	PageSize     uint64                                   `json:"pageSize,omitempty"`
	Total        uint64                                   `json:"total,omitempty"`
	Operations   map[cptype.OperationKey]cptype.Operation `json:"operations,omitempty"`
	UserIDs      []string                                 `json:"userIDs,omitempty"`
}

Data includes list of items.

type IList

type IList interface {
	cptype.IComponent
	IListStdOps
}

IList interface

type IListStdOps

type IListStdOps interface {
	RegisterChangePage(opData OpChangePage) (opFunc cptype.OperationFunc)
	RegisterItemStarOp(opData OpItemStar) (opFunc cptype.OperationFunc)
	RegisterItemClickGotoOp(opData OpItemClickGoto) (opFunc cptype.OperationFunc)
	RegisterItemClickOp(opData OpItemClick) (opFunc cptype.OperationFunc)
	RegisterBatchOp(opData OpBatchRowsHandle) (opFunc cptype.OperationFunc)
}

IListStdOps standard options

type Item

type Item struct {
	// uniq id of the item, e.g: appID, projID, ...
	ID           string `json:"id,omitempty"`
	Title        string `json:"title,omitempty"`
	TitleSummary string `json:"titleSummary,omitempty"`
	// logo link url of title
	//LogoURL          string      `json:"logoURL,omitempty"`
	Star             *bool       `json:"star,omitempty"`
	MainState        *StateInfo  `json:"mainState,omitempty"`
	TitleState       []StateInfo `json:"titleState,omitempty"`
	Description      string      `json:"description,omitempty"`
	BackgroundImgURL string      `json:"backgroundImgURL,omitempty"`
	KvInfos          []KvInfo    `json:"kvInfos,omitempty"`
	Selectable       bool        `json:"selectable"`
	// columns show in the item, e.g user, time
	ColumnsInfo map[string]interface{} `json:"columnsInfo,omitempty"`
	// operations on the frond
	Operations map[cptype.OperationKey]cptype.Operation `json:"operations,omitempty"`
	// operations folded
	MoreOperations []MoreOpItem   `json:"moreOperations,omitempty"`
	Icon           *commodel.Icon `json:"icon,omitempty"`
	cptype.Extra
}

Item minimum unit of list

type ItemCommStatus

type ItemCommStatus string

ItemCommStatus .

const (
	// ItemCommStatusDefault default status
	ItemCommStatusDefault ItemCommStatus = ""
	// ItemCommStatusSuccess success status
	ItemCommStatusSuccess ItemCommStatus = "success"
	// ItemCommStatusInfo info status
	ItemCommStatusInfo ItemCommStatus = "info"
	// ItemCommStatusWarning warning status
	ItemCommStatusWarning ItemCommStatus = "warning"
	// ItemCommStatusError error status
	ItemCommStatusError ItemCommStatus = "error"
)

type KvInfo

type KvInfo struct {
	ID    string `json:"id,omitempty"`
	Key   string `json:"key,omitempty"`
	Value string `json:"value,omitempty"`
	Icon  string `json:"icon,omitempty"`
	Tip   string `json:"tip,omitempty"`
	// red green etc.
	Color string `json:"color,omitempty"`
	// metaInfo related operations
	Operations map[cptype.OperationKey]cptype.Operation `json:"operations"`
}

KvInfo .

type MoreOpItem

type MoreOpItem struct {
	ID   string `json:"id,omitempty"`
	Text string `json:"text,omitempty"`
	Icon string `json:"icon,omitempty"`
	// more operation related operations
	Operations map[cptype.OperationKey]cptype.Operation `json:"operations"`
}

MoreOpItem more operation item info

type OpBatchRowsHandle

type OpBatchRowsHandle struct {
	cptype.Operation
	ServerData OpBatchRowsHandleServerData `json:"serverData,omitempty"`
	ClientData OpBatchRowsHandleClientData `json:"clientData,omitempty"`
}

OpBatchRowsHandle .

func (OpBatchRowsHandle) OpKey

OpKey .

type OpBatchRowsHandleBasicServerData

type OpBatchRowsHandleBasicServerData struct {
	Options []OpBatchRowsHandleOptionServerData
}

OpBatchRowsHandleBasicServerData .

type OpBatchRowsHandleClientData

type OpBatchRowsHandleClientData struct {
	DataRef           *Item    `json:"dataRef,omitempty"`
	SelectedOptionsID string   `json:"selectedOptionsID"`
	SelectedRowIDs    []string `json:"selectedRowIDs"`
}

OpBatchRowsHandleClientData data

type OpBatchRowsHandleOptionServerData

type OpBatchRowsHandleOptionServerData struct {
	// AllowedRowIDs which rows has this op
	AllowedRowIDs []string `json:"allowedRowIDs"`
	// Icon .
	Icon *commodel.Icon `json:"icon"`
	// ID of this op.
	ID string `json:"id"`
	// Text
	Text string `json:"text"`
}

OpBatchRowsHandleOptionServerData .

type OpBatchRowsHandleServerData

type OpBatchRowsHandleServerData struct {
	OpBatchRowsHandleBasicServerData
}

OpBatchRowsHandleServerData server data

type OpChangePage

type OpChangePage struct {
	cptype.Operation
	ServerData OpChangePageServerData `json:"serverData,omitempty"`
	ClientData OpChangePageClientData `json:"clientData,omitempty"`
}

OpChangePage paging operation data

func (OpChangePage) OpKey

func (o OpChangePage) OpKey() cptype.OperationKey

OpKey .

type OpChangePageClientData

type OpChangePageClientData struct {
	PageNo   uint64 `json:"pageNo,omitempty"`
	PageSize uint64 `json:"pageSize,omitempty"`
}

OpChangePageClientData data

type OpChangePageServerData

type OpChangePageServerData struct{}

OpChangePageServerData server data

type OpItemBasicServerData

type OpItemBasicServerData struct {
	// open a new fronted page
	JumpOut bool `json:"jumpOut,omitempty"`
	// the jump out target of the new opened fronted page, e.g: projectAllIssue page
	Target string `json:"target,omitempty"`
	// params needed for jumping to the new page, e.g: projectId
	Params map[string]interface{} `json:"params,omitempty"`
	// the query condition of the new page, e.g: issueFilter__urlQuery
	Query map[string]interface{} `json:"query,omitempty"`
}

OpItemBasicServerData .

type OpItemClick

type OpItemClick struct {
	cptype.Operation
	ServerData OpItemClickServerData `json:"serverData,omitempty"`
	ClientData OpItemClickClientData `json:"clientData,omitempty"`
}

OpItemClick .

func (OpItemClick) OpKey

func (o OpItemClick) OpKey() cptype.OperationKey

OpKey .

type OpItemClickClientData

type OpItemClickClientData struct {
	DataRef      *Item      `json:"dataRef,omitempty"`
	OperationRef MoreOpItem `json:"operationRef"`
}

OpItemClickClientData data

type OpItemClickGoto

type OpItemClickGoto struct {
	cptype.Operation
	ServerData OpItemClickGotoServerData `json:"serverData,omitempty"`
	ClientData OpItemClickGotoClientData `json:"clientData,omitempty"`
}

OpItemClickGoto .

func (OpItemClickGoto) OpKey

OpKey .

type OpItemClickGotoClientData

type OpItemClickGotoClientData struct{}

OpItemClickGotoClientData data

type OpItemClickGotoServerData

type OpItemClickGotoServerData struct {
	OpItemBasicServerData
}

OpItemClickGotoServerData server data

type OpItemClickServerData

type OpItemClickServerData struct {
	OpItemBasicServerData
}

OpItemClickServerData server data

type OpItemStar

type OpItemStar struct {
	cptype.Operation
	ServerData OpItemStarServerData `json:"serverData,omitempty"`
	ClientData OpItemStarClientData `json:"clientData,omitempty"`
}

OpItemStar .

func (OpItemStar) OpKey

func (o OpItemStar) OpKey() cptype.OperationKey

OpKey .

type OpItemStarClientData

type OpItemStarClientData struct {
	DataRef *Item `json:"dataRef,omitempty"`
}

OpItemStarClientData data

type OpItemStarServerData

type OpItemStarServerData struct{}

OpItemStarServerData server data

type StateInfo

type StateInfo struct {
	Text   string         `json:"text,omitempty"`
	Status ItemCommStatus `json:"status,omitempty"`
	// right or left
	SuffixIcon string                                   `json:"suffixIcon,omitempty"`
	Operations map[cptype.OperationKey]cptype.Operation `json:"operations"`
}

StateInfo .

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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