Documentation ¶
Index ¶
- type Cell
- type CellBuilder
- type CellType
- type Column
- type ColumnKey
- type ColumnsInfo
- type CustomData
- type CustomInParams
- type CustomState
- type Data
- type ITable
- type ITableStdOps
- type ITypedCellBuilder
- func NewCompleteTextCell(text commodel.Text) ITypedCellBuilder
- func NewDropDownMenuCell(menu commodel.DropDownMenu) ITypedCellBuilder
- func NewDurationCell(duration commodel.Duration) ITypedCellBuilder
- func NewIconCell(icon commodel.Icon) ITypedCellBuilder
- func NewKVCell(k, v string) ITypedCellBuilder
- func NewLabelsCell(labels commodel.Labels) ITypedCellBuilder
- func NewMoreOperationsCell(moreOperations commodel.MoreOperations) ITypedCellBuilder
- func NewProgressBarCell(progressBar commodel.ProgressBar) ITypedCellBuilder
- func NewTextCell(text string) ITypedCellBuilder
- func NewUserCell(user commodel.User) ITypedCellBuilder
- func NewUserSelectorCell(selector commodel.UserSelector) ITypedCellBuilder
- type MergedColumn
- type OpBatchRowsHandle
- type OpBatchRowsHandleClientData
- type OpBatchRowsHandleOption
- type OpBatchRowsHandleServerData
- type OpRowAdd
- type OpRowAddClientData
- type OpRowAddServerData
- type OpRowDelete
- type OpRowDeleteClientData
- type OpRowDeleteServerData
- type OpRowEdit
- type OpRowEditClientData
- type OpRowEditServerData
- type OpRowSelect
- type OpRowSelectClientData
- type OpRowSelectServerData
- type OpTableChangePage
- type OpTableChangePageClientData
- type OpTableChangePageServerData
- type OpTableChangeSort
- type OpTableChangeSortClientData
- type OpTableChangeSortServerData
- type Row
- type RowID
- type Table
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 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 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 NewMoreOperationsCell ¶
func NewMoreOperationsCell(moreOperations commodel.MoreOperations) ITypedCellBuilder
NewMoreOperationsCell .
func NewProgressBarCell ¶
func NewProgressBarCell(progressBar commodel.ProgressBar) ITypedCellBuilder
NewProgressBarCell .
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 .
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 .
type OpRowAddClientData ¶
type OpRowAddClientData struct { LastRowID string `json:"lastRowID,omitempty"` NextRowID string `json:"nextRowID,omitempty"` NewRow *Row `json:"newRow,omitempty"` }
OpRowAddClientData .
type OpRowDelete ¶
type OpRowDelete struct { cptype.Operation ServerData OpRowDeleteServerData `json:"serverData,omitempty"` ClientData OpRowDeleteClientData `json:"clientData,omitempty"` }
OpRowDelete .
type OpRowDeleteClientData ¶
type OpRowDeleteClientData struct {
DataRef *Row `json:"dataRef,omitempty"`
}
OpRowDeleteClientData .
type OpRowEdit ¶
type OpRowEdit struct { cptype.Operation ServerData OpRowEditServerData `json:"serverData,omitempty"` ClientData OpRowEditClientData `json:"clientData,omitempty"` }
OpRowEdit .
type OpRowEditClientData ¶
type OpRowEditClientData struct { DataRef *Row `json:"dataRef,omitempty"` NewRow *Row `json:"newRow,omitempty"` }
OpRowEditClientData .
type OpRowSelect ¶
type OpRowSelect struct { cptype.Operation ServerData OpRowSelectServerData `json:"serverData,omitempty"` ClientData OpRowSelectClientData `json:"clientData,omitempty"` }
OpRowSelect .
type OpRowSelectClientData ¶
type OpRowSelectClientData struct {
DataRef *Row `json:"dataRef,omitempty"`
}
OpRowSelectClientData .
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.
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 .
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 .