Skip to content

Commit 900c13a

Browse files
committed
refactor(aria/grid): Add accessors for pattern properties
1 parent 64e929d commit 900c13a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/aria/grid/grid.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,21 @@ export class Grid {
7777
/** The wrapping behavior for keyboard navigation along the column axis. */
7878
readonly colWrap = input<'continuous' | 'loop' | 'nowrap'>('loop');
7979

80+
/** Whether multiple cells in the grid can be selected. */
81+
readonly multi = input(false, {transform: booleanAttribute});
82+
83+
/** The selection strategy used by the grid. */
84+
readonly selectionMode = input<'follow' | 'explicit'>('follow');
85+
86+
/** Whether enable range selections (with modifier keys or dragging). */
87+
readonly enableRangeSelection = input(false, {transform: booleanAttribute});
88+
89+
/** Whether the user is currently dragging to select a range of cells. */
90+
readonly dragging = computed(() => this._pattern.dragging());
91+
92+
/** Whether the focus is in the grid. */
93+
readonly isFocused = computed(() => this._pattern.isFocused());
94+
8095
/** The UI pattern for the grid. */
8196
readonly _pattern = new GridPattern({
8297
...this,

0 commit comments

Comments
 (0)