table

package
v0.0.0-...-9146478 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cell

type Cell struct {
	ID   string          `json:"id,omitempty"`
	Tip  string          `json:"tip,omitempty"`
	Type CellType        `json:"type,omitempty"`
	Data cptype.ExtraMap `json:"data,omitempty"`

	Operations map[cptype.OperationKey]cptype.Operation `json:"operations,omitempty"`
	cptype.Extra
}

Cell .

type CellBuilder

type CellBuilder struct {
	*Cell
}

CellBuilder .

type CellType

type CellType string

CellType .

type Column

type Column struct {
	Title string `json:"title,omitempty"`
	Tip   string `json:"tip,omitempty"`

	FieldBindToOrder string `json:"fieldBindToOrder,omitempty"` // bind which field to order
	AscOrder         *bool  `json:"ascOrder,omitempty"`         // true for asc, false for desc, nil for no sort
	EnableSort       bool   `json:"enableSort"`                 // true can sort
	Hidden           bool   `json:"hidden,omitempty"`           // true can hidden
	cptype.Extra
}

Column .

type ColumnKey

type ColumnKey string

ColumnKey .

type ColumnsInfo

type ColumnsInfo struct {
	// Merges merge some columns into one.
	// +optional
	Merges map[ColumnKey]MergedColumn `json:"merges,omitempty"`

	// Orders is the order of columns.
	// If some columns is merged, just put the columnKey for exhibition.
	Orders []ColumnKey `json:"orders,omitempty"`

	// ColumnsMap contains all columns.
	ColumnsMap map[ColumnKey]Column `json:"columnsMap,omitempty"`
}

ColumnsInfo .

type CustomData

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

CustomData is table'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 table'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 table's custom state handler.

type Data

type Data struct {
	Table      Table                                    `json:"table,omitempty"`
	Operations map[cptype.OperationKey]cptype.Operation `json:"operations,omitempty"`
}

Data .

type ITable

type ITable interface {
	cptype.IComponent
	ITableStdOps
}

ITable is user-level interface for table.

type ITableStdOps

type ITableStdOps interface {
	// table-level
	RegisterTableChangePageOp(opData OpTableChangePage) (opFunc cptype.OperationFunc)
	RegisterTableSortOp(opData OpTableChangeSort) (opFunc cptype.OperationFunc)
	RegisterBatchRowsHandleOp(opData OpBatchRowsHandle) (opFunc cptype.OperationFunc)
	// row-level
	RegisterRowSelectOp(opData OpRowSelect) (opFunc cptype.OperationFunc)
	RegisterRowAddOp(opData OpRowAdd) (opFunc cptype.OperationFunc)
	RegisterRowEditOp(opData OpRowEdit) (opFunc cptype.OperationFunc)
	RegisterRowDeleteOp(opData OpRowDelete) (opFunc cptype.OperationFunc)
}

ITableStdOps defines all standard operations of table.

type ITypedCellBuilder

type ITypedCellBuilder interface {
	Build() Cell
	// contains filtered or unexported methods
}

ITypedCellBuilder used to not export typedCellBuilder

func NewCompleteTextCell

func NewCompleteTextCell(text commodel.Text) ITypedCellBuilder

NewCompleteTextCell .

func NewDropDownMenuCell

func NewDropDownMenuCell(menu commodel.DropDownMenu) ITypedCellBuilder

NewDropDownMenuCell .

func NewDurationCell

func NewDurationCell(duration commodel.Duration) ITypedCellBuilder

NewDurationCell .

func NewIconCell

func NewIconCell(icon commodel.Icon) ITypedCellBuilder

NewIconCell .

func NewKVCell

func NewKVCell(k, v string) ITypedCellBuilder

NewKVCell .

func NewLabelsCell

func NewLabelsCell(labels commodel.Labels) ITypedCellBuilder

NewLabelsCell .

func NewMoreOperationsCell

func NewMoreOperationsCell(moreOperations commodel.MoreOperations) ITypedCellBuilder

NewMoreOperationsCell .

func NewProgressBarCell

func NewProgressBarCell(progressBar commodel.ProgressBar) ITypedCellBuilder

NewProgressBarCell .

func NewTextCell

func NewTextCell(text string) ITypedCellBuilder

NewTextCell .

func NewUserCell

func NewUserCell(user commodel.User) ITypedCellBuilder

NewUserCell .

func NewUserSelectorCell

func NewUserSelectorCell(selector commodel.UserSelector) ITypedCellBuilder

NewUserSelectorCell .

type MergedColumn

type MergedColumn struct {
	Orders []ColumnKey `json:"orders,omitempty"`
}

MergedColumn .

type OpBatchRowsHandle

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

OpBatchRowsHandle .

func (OpBatchRowsHandle) OpKey

OpKey .

type OpBatchRowsHandleClientData

type OpBatchRowsHandleClientData struct {
	DataRef          *OpBatchRowsHandleOption `json:"dataRef,omitempty"`
	SelectedOptionID string                   `json:"selectedOptionID,omitempty"`
	SelectedRowIDs   []string                 `json:"selectedRowIDs,omitempty"`
}

OpBatchRowsHandleClientData .

type OpBatchRowsHandleOption

type OpBatchRowsHandleOption struct {
	ID              string         `json:"id,omitempty"`
	Text            string         `json:"text,omitempty"`
	Icon            *commodel.Icon `json:"icon,omitempty"`
	AllowedRowIDs   []string       `json:"allowedRowIDs,omitempty"`
	ForbiddenRowIDs []string       `json:"forbiddenRowIDs,omitempty"`
}

OpBatchRowsHandleOption .

type OpBatchRowsHandleServerData

type OpBatchRowsHandleServerData struct {
	Options []OpBatchRowsHandleOption `json:"options,omitempty"`
}

OpBatchRowsHandleServerData .

type OpRowAdd

type OpRowAdd struct {
	cptype.Operation
	ServerData OpRowAddServerData `json:"serverData,omitempty"`
	ClientData OpRowAddClientData `json:"clientData,omitempty"`
}

OpRowAdd .

func (OpRowAdd) OpKey

func (o OpRowAdd) OpKey() cptype.OperationKey

OpKey .

type OpRowAddClientData

type OpRowAddClientData struct {
	LastRowID string `json:"lastRowID,omitempty"`
	NextRowID string `json:"nextRowID,omitempty"`
	NewRow    *Row   `json:"newRow,omitempty"`
}

OpRowAddClientData .

type OpRowAddServerData

type OpRowAddServerData struct {
}

OpRowAddServerData .

type OpRowDelete

type OpRowDelete struct {
	cptype.Operation
	ServerData OpRowDeleteServerData `json:"serverData,omitempty"`
	ClientData OpRowDeleteClientData `json:"clientData,omitempty"`
}

OpRowDelete .

func (OpRowDelete) OpKey

func (o OpRowDelete) OpKey() cptype.OperationKey

OpKey .

type OpRowDeleteClientData

type OpRowDeleteClientData struct {
	DataRef *Row `json:"dataRef,omitempty"`
}

OpRowDeleteClientData .

type OpRowDeleteServerData

type OpRowDeleteServerData struct {
}

OpRowDeleteServerData .

type OpRowEdit

type OpRowEdit struct {
	cptype.Operation
	ServerData OpRowEditServerData `json:"serverData,omitempty"`
	ClientData OpRowEditClientData `json:"clientData,omitempty"`
}

OpRowEdit .

func (OpRowEdit) OpKey

func (o OpRowEdit) OpKey() cptype.OperationKey

OpKey .

type OpRowEditClientData

type OpRowEditClientData struct {
	DataRef *Row `json:"dataRef,omitempty"`
	NewRow  *Row `json:"newRow,omitempty"`
}

OpRowEditClientData .

type OpRowEditServerData

type OpRowEditServerData struct {
}

OpRowEditServerData .

type OpRowSelect

type OpRowSelect struct {
	cptype.Operation
	ServerData OpRowSelectServerData `json:"serverData,omitempty"`
	ClientData OpRowSelectClientData `json:"clientData,omitempty"`
}

OpRowSelect .

func (OpRowSelect) OpKey

func (o OpRowSelect) OpKey() cptype.OperationKey

OpKey .

type OpRowSelectClientData

type OpRowSelectClientData struct {
	DataRef *Row `json:"dataRef,omitempty"`
}

OpRowSelectClientData .

type OpRowSelectServerData

type OpRowSelectServerData struct {
}

OpRowSelectServerData .

type OpTableChangePage

type OpTableChangePage struct {
	cptype.Operation
	ServerData OpTableChangePageServerData `json:"serverData,omitempty"`
	ClientData OpTableChangePageClientData `json:"clientData,omitempty"`
}

OpTableChangePage includes std op and server&client data.

func (OpTableChangePage) OpKey

OpKey .

type OpTableChangePageClientData

type OpTableChangePageClientData struct {
	PageNo   uint64 `json:"pageNo"`
	PageSize uint64 `json:"pageSize"`
}

OpTableChangePageClientData .

type OpTableChangePageServerData

type OpTableChangePageServerData struct {
}

OpTableChangePageServerData .

type OpTableChangeSort

type OpTableChangeSort struct {
	cptype.Operation
	ServerData OpTableChangePageServerData `json:"serverData,omitempty"`
	ClientData OpTableChangeSortClientData `json:"clientData,omitempty"`
}

OpTableChangeSort .

func (OpTableChangeSort) OpKey

OpKey .

type OpTableChangeSortClientData

type OpTableChangeSortClientData struct {
	DataRef *Column `json:"dataRef,omitempty"`
}

OpTableChangeSortClientData .

type OpTableChangeSortServerData

type OpTableChangeSortServerData struct {
}

OpTableChangeSortServerData .

type Row

type Row struct {
	ID         RowID              `json:"id,omitempty"` // row id, used for row-level operations
	Selectable bool               `json:"selectable,omitempty"`
	Selected   bool               `json:"selected,omitempty"`
	CellsMap   map[ColumnKey]Cell `json:"cellsMap,omitempty"`

	Operations map[cptype.OperationKey]cptype.Operation `json:"operations,omitempty"`
}

Row .

type RowID

type RowID string

RowID .

type Table

type Table struct {
	Columns ColumnsInfo `json:"columns,omitempty"`
	Rows    []Row       `json:"rows,omitempty"`

	PageNo   uint64 `json:"pageNo,omitempty"`
	PageSize uint64 `json:"pageSize,omitempty"`
	Total    uint64 `json:"total,omitempty"`
}

Table .

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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