import{_ as e,c as t,o as d,N as o}from"./chunks/framework.0799945b.js";const u=JSON.parse('{"title":"Module: features/grids/grid","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/modules/features/grid.md","lastUpdated":null}'),a={name:"api/modules/features/grid.md"},l=o('
• BaseGrid: Object
The properties that are added onto a processed BoardOptions to create a Board.
Name | Type | Description |
---|---|---|
[Component] | GenericComponent | The Vue component used to render this feature. |
[GatherProps] | () => Record <string , unknown > | A function to gather the props the vue component requires for this feature. |
cellState | Persistent <Record <string | number , State >> | The persistent state of this grid, which is a dictionary of cell states. |
cells | Record <string | number , GridCell > | A dictionary of cells within this grid. |
getID | (id : string | number , state : State ) => string | Get the auto-generated ID for identifying a specific cell of this grid that appears in the DOM. Will not persist between refreshes or updates. |
getState | (id : string | number ) => State | Get the persistent state of the given cell. |
id | string | An auto-generated ID for identifying features that appear in the DOM. Will not persist between refreshes or updates. |
setState | (id : string | number , state : State ) => void | Set the persistent state of the given cell. |
type | typeof GridType | A symbol that helps identify features of the same type. |
profectus/src/features/grids/grid.ts:254
• GridCell: Object
Represents a cell within a grid. These properties will typically be accessed via a cell proxy that calls functions on the grid to get the properties for a specific cell.
See
createGridProxy
Name | Type | Description |
---|---|---|
canClick | boolean | Whether this cell can be clicked. |
classes? | Record <string , boolean > | Dictionary of CSS classes to apply to this feature. |
display | CoercableComponent | The main text that appears in the display. |
id | string | A unique identifier for the grid cell. |
onClick? | (e? : MouseEvent | TouchEvent ) => void | A function that is called when the cell is clicked. |
onHold? | VoidFunction | A function that is called when the cell is held down. |
startState | State | The initial persistent state of this cell. |
state | State | The persistent state of this cell. |
style? | StyleValue | CSS to apply to this feature. |
title? | CoercableComponent | A header to appear at the top of the display. |
visibility | boolean | Visibility | Whether this cell should be visible. |
profectus/src/features/grids/grid.ts:196
• GridOptions: Object
An object that configures a Grid.
Name | Type | Description |
---|---|---|
cols | Computable <number > | The number of columns in the grid. |
getCanClick? | CellComputable <boolean > | A computable to determine if a cell can be clicked. |
getClasses? | CellComputable <Record <string , boolean >> | A computable to get the CSS classes for a cell. |
getDisplay | CellComputable <CoercableComponent > | A computable to get the display component for a cell. |
getStartState | Computable <State > | (id : string | number ) => State | A computable to get the initial persistent state of a cell. |
getStyle? | CellComputable <StyleValue > | A computable to get the CSS styles for a cell. |
getTitle? | CellComputable <CoercableComponent > | A computable to get the title component for a cell. |
getVisibility? | CellComputable <boolean | Visibility > | A computable to determine the visibility of a cell. |
onClick? | (id : string | number , state : State , e? : MouseEvent | TouchEvent ) => void | A function that is called when a cell is clicked. |
onHold? | (id : string | number , state : State ) => void | A function that is called when a cell is held down. |
rows | Computable <number > | The number of rows in the grid. |
visibility? | Computable <boolean | Visibility > | Whether this grid should be visible. |
profectus/src/features/grids/grid.ts:224
Ƭ CellComputable<T
>: Computable
<T
> | (id
: string
| number
, state
: State
) => T
A type representing a computable value for a cell in the grid.
Name |
---|
T |
profectus/src/features/grids/grid.ts:28
Ƭ GenericGrid: Replace
<Grid
<GridOptions
>, { getCanClick
: ProcessedComputable
<boolean
> ; getVisibility
: ProcessedComputable
<Visibility
| boolean
> ; visibility
: ProcessedComputable
<Visibility
| boolean
> }>
A type that matches any valid Grid object.
profectus/src/features/grids/grid.ts:293
Ƭ Grid<T
>: Replace
<T
& BaseGrid
, { cols
: GetComputableType
<T
["cols"
]> ; getCanClick
: GetComputableTypeWithDefault
<T
["getCanClick"
], true
> ; getClasses
: GetComputableType
<T
["getClasses"
]> ; getDisplay
: GetComputableType
<T
["getDisplay"
]> ; getStartState
: GetComputableType
<T
["getStartState"
]> ; getStyle
: GetComputableType
<T
["getStyle"
]> ; getTitle
: GetComputableType
<T
["getTitle"
]> ; getVisibility
: GetComputableTypeWithDefault
<T
["getVisibility"
], Visible
> ; rows
: GetComputableType
<T
["rows"
]> ; visibility
: GetComputableTypeWithDefault
<T
["visibility"
], Visible
> }>
An object that represents a feature that is a grid of cells that all behave according to the same rules.
Name | Type |
---|---|
T | extends GridOptions |
profectus/src/features/grids/grid.ts:276
• Const
GridType: typeof GridType
A symbol used to identify Grid features.
profectus/src/features/grids/grid.ts:25
▸ createGrid<T
>(optionsFunc
): Grid
<T
>
Lazily creates a grid with the given options.
Name | Type |
---|---|
T | extends GridOptions |
Name | Type | Description |
---|---|---|
optionsFunc | OptionsFunc <T , BaseGrid , GenericGrid > | Grid options. |
Grid
<T
>
profectus/src/features/grids/grid.ts:306
Name | Type |
---|---|
visibility * | processedPropType<Visibility | boolean>(Number, Boolean) |
onClick | (e?: MouseEvent | TouchEvent) => void |
onHold | VoidFunction |
display * | processedPropType<CoercableComponent>(Object, String, Function) |
title | processedPropType<CoercableComponent>(Object, String, Function) |
style | processedPropType<StyleValue>(String, Object, Array) |
canClick * | processedPropType<boolean>(Boolean) |
id * | string |
Name | Type |
---|---|
visibility * | processedPropType<Visibility | boolean>(Number, Boolean) |
rows * | processedPropType<number>(Number) |
cols * | processedPropType<number>(Number) |
cells * | processedPropType<Record<string, GridCell>>(Object) |