@@ -21,7 +21,17 @@ import {
2121 Signal ,
2222} from '@angular/core' ;
2323import { Directionality } from '@angular/cdk/bidi' ;
24- import { GridPattern , GridRowPattern , GridCellPattern , GridCellWidgetPattern } from '../private' ;
24+ import {
25+ GridPattern ,
26+ GridRowPattern ,
27+ GridCellPattern ,
28+ GridCellWidgetPattern ,
29+ GridFocusMode ,
30+ GridWrapStrategy ,
31+ GridSelectionMode ,
32+ } from '../private' ;
33+
34+ export { GridFocusMode , GridWrapStrategy , GridSelectionMode } ;
2535
2636/**
2737 * A directive that provides grid-based navigation and selection behavior.
@@ -73,19 +83,19 @@ export class Grid {
7383 readonly softDisabled = input ( true , { transform : booleanAttribute } ) ;
7484
7585 /** The focus strategy used by the grid. */
76- readonly focusMode = input < 'roving' | 'activedescendant' > ( 'roving' ) ;
86+ readonly focusMode = input < GridFocusMode > ( 'roving' ) ;
7787
7888 /** The wrapping behavior for keyboard navigation along the row axis. */
79- readonly rowWrap = input < 'continuous' | 'loop' | 'nowrap' > ( 'loop' ) ;
89+ readonly rowWrap = input < GridWrapStrategy > ( 'loop' ) ;
8090
8191 /** The wrapping behavior for keyboard navigation along the column axis. */
82- readonly colWrap = input < 'continuous' | 'loop' | 'nowrap' > ( 'loop' ) ;
92+ readonly colWrap = input < GridWrapStrategy > ( 'loop' ) ;
8393
8494 /** Whether multiple cells in the grid can be selected. */
8595 readonly multi = input ( false , { transform : booleanAttribute } ) ;
8696
8797 /** The selection strategy used by the grid. */
88- readonly selectionMode = input < 'follow' | 'explicit' > ( 'follow' ) ;
98+ readonly selectionMode = input < GridSelectionMode > ( 'follow' ) ;
8999
90100 /** Whether enable range selections (with modifier keys or dragging). */
91101 readonly enableRangeSelection = input ( false , { transform : booleanAttribute } ) ;
@@ -123,6 +133,8 @@ export class Grid {
123133 }
124134}
125135
136+ export type GridRowRole = 'row' | 'rowheader' ;
137+
126138/**
127139 * A directive that represents a row in a grid.
128140 *
@@ -158,7 +170,7 @@ export class GridRow {
158170 readonly element = computed ( ( ) => this . _elementRef . nativeElement ) ;
159171
160172 /** The ARIA role for the row. */
161- readonly role = input < 'row' | 'rowheader' > ( 'row' ) ;
173+ readonly role = input < GridRowRole > ( 'row' ) ;
162174
163175 /** The index of this row within the grid. */
164176 readonly rowIndex = input < number > ( ) ;
@@ -170,6 +182,8 @@ export class GridRow {
170182 } ) ;
171183}
172184
185+ export type GridCellRole = 'gridcell' | 'columnheader' ;
186+
173187/**
174188 * A directive that represents a cell in a grid.
175189 *
@@ -217,7 +231,7 @@ export class GridCell {
217231 readonly element = computed ( ( ) => this . _elementRef . nativeElement ) ;
218232
219233 /** The ARIA role for the cell. */
220- readonly role = input < 'gridcell' | 'columnheader' > ( 'gridcell' ) ;
234+ readonly role = input < GridCellRole > ( 'gridcell' ) ;
221235
222236 /** The number of rows the cell should span. */
223237 readonly rowSpan = input < number > ( 1 ) ;
0 commit comments