@react-aria/grid
Advanced tools
Comparing version 3.0.0-nightly.2785 to 3.0.0-nightly.2791
@@ -442,6 +442,6 @@ var { | ||
* @param state - State for the grid, as returned by `useGridState`. | ||
* @param ref - The ref attached to the grid element. | ||
*/ | ||
function useGrid(props, state) { | ||
function useGrid(props, state, ref) { | ||
let { | ||
ref, | ||
isVirtualized, | ||
@@ -590,9 +590,6 @@ keyboardDelegate, | ||
*/ | ||
function useGridRow(props, state) { | ||
function useGridRow(props, state, ref) { | ||
let { | ||
node, | ||
ref, | ||
isVirtualized, | ||
isSelected, | ||
isDisabled, | ||
shouldSelectOnPressUp | ||
@@ -608,3 +605,5 @@ } = props; | ||
shouldSelectOnPressUp | ||
}); // TODO: move into useSelectableItem? | ||
}); | ||
let isSelected = state.selectionManager.isSelected(node.key); | ||
let isDisabled = state.disabledKeys.has(node.key); // TODO: move into useSelectableItem? | ||
@@ -638,8 +637,6 @@ let { | ||
*/ | ||
function useGridCell(props, state) { | ||
function useGridCell(props, state, ref) { | ||
let { | ||
node, | ||
ref, | ||
isVirtualized, | ||
isDisabled, | ||
focusMode = 'child', | ||
@@ -682,2 +679,3 @@ shouldSelectOnPressUp | ||
let isDisabled = state.disabledKeys.has(node.key) || state.disabledKeys.has(node.parentKey); | ||
let { | ||
@@ -684,0 +682,0 @@ pressProps |
@@ -401,6 +401,6 @@ import { focusSafely, getFocusableTreeWalker } from "@react-aria/focus"; | ||
* @param state - State for the grid, as returned by `useGridState`. | ||
* @param ref - The ref attached to the grid element. | ||
*/ | ||
export function useGrid(props, state) { | ||
export function useGrid(props, state, ref) { | ||
let { | ||
ref, | ||
isVirtualized, | ||
@@ -545,9 +545,6 @@ keyboardDelegate, | ||
*/ | ||
export function useGridRow(props, state) { | ||
export function useGridRow(props, state, ref) { | ||
let { | ||
node, | ||
ref, | ||
isVirtualized, | ||
isSelected, | ||
isDisabled, | ||
shouldSelectOnPressUp | ||
@@ -563,3 +560,5 @@ } = props; | ||
shouldSelectOnPressUp | ||
}); // TODO: move into useSelectableItem? | ||
}); | ||
let isSelected = state.selectionManager.isSelected(node.key); | ||
let isDisabled = state.disabledKeys.has(node.key); // TODO: move into useSelectableItem? | ||
@@ -591,8 +590,6 @@ let { | ||
*/ | ||
export function useGridCell(props, state) { | ||
export function useGridCell(props, state, ref) { | ||
let { | ||
node, | ||
ref, | ||
isVirtualized, | ||
isDisabled, | ||
focusMode = 'child', | ||
@@ -635,2 +632,3 @@ shouldSelectOnPressUp | ||
let isDisabled = state.disabledKeys.has(node.key) || state.disabledKeys.has(node.parentKey); | ||
let { | ||
@@ -637,0 +635,0 @@ pressProps |
@@ -39,4 +39,2 @@ import { Direction, KeyboardDelegate, Node, AriaLabelingProps, DOMProps } from "@react-types/shared"; | ||
export interface GridProps extends DOMProps, AriaLabelingProps { | ||
/** The ref attached to the grid element. */ | ||
ref: RefObject<HTMLElement>; | ||
/** Whether the grid uses virtual scrolling. */ | ||
@@ -69,4 +67,5 @@ isVirtualized?: boolean; | ||
* @param state - State for the grid, as returned by `useGridState`. | ||
* @param ref - The ref attached to the grid element. | ||
*/ | ||
export function useGrid<T>(props: GridProps, state: GridState<T, GridCollection<T>>): GridAria; | ||
export function useGrid<T>(props: GridProps, state: GridState<T, GridCollection<T>>, ref: RefObject<HTMLElement>): GridAria; | ||
interface GridRowGroupAria { | ||
@@ -83,10 +82,4 @@ /** Props for the row group element. */ | ||
node: Node<T>; | ||
/** The ref attached to the grid row. */ | ||
ref?: RefObject<HTMLElement>; | ||
/** Whether the grid row is contained in a virtual scroller. */ | ||
isVirtualized?: boolean; | ||
/** Whether the grid row is selected. */ | ||
isSelected?: boolean; | ||
/** Whether the grid row is disabled. */ | ||
isDisabled?: boolean; | ||
/** Whether selection should occur on press up instead of press down. */ | ||
@@ -104,12 +97,8 @@ shouldSelectOnPressUp?: boolean; | ||
*/ | ||
export function useGridRow<T, C extends GridCollection<T>, S extends GridState<T, C>>(props: GridRowProps<T>, state: S): GridRowAria; | ||
export function useGridRow<T, C extends GridCollection<T>, S extends GridState<T, C>>(props: GridRowProps<T>, state: S, ref: RefObject<HTMLElement>): GridRowAria; | ||
interface GridCellProps { | ||
/** An object representing the grid cell. Contains all the relevant information that makes up the grid cell. */ | ||
node: Node<unknown>; | ||
/** The ref attached to the grid cell element. */ | ||
ref: RefObject<HTMLElement>; | ||
/** Whether the grid cell is contained in a virtual scroller. */ | ||
isVirtualized?: boolean; | ||
/** Whether the grid cell is disabled. */ | ||
isDisabled?: boolean; | ||
/** Whether the cell or its first focusable child element should be focused when the grid cell is focused. */ | ||
@@ -129,4 +118,4 @@ focusMode?: 'child' | 'cell'; | ||
*/ | ||
export function useGridCell<T, C extends GridCollection<T>>(props: GridCellProps, state: GridState<T, C>): GridCellAria; | ||
export function useGridCell<T, C extends GridCollection<T>>(props: GridCellProps, state: GridState<T, C>, ref: RefObject<HTMLElement>): GridCellAria; | ||
//# sourceMappingURL=types.d.ts.map |
{ | ||
"name": "@react-aria/grid", | ||
"version": "3.0.0-nightly.2785+4ffc6447a", | ||
"version": "3.0.0-nightly.2791+4c94b3187", | ||
"description": "Spectrum UI components in React", | ||
@@ -21,12 +21,12 @@ "license": "Apache-2.0", | ||
"@babel/runtime": "^7.6.2", | ||
"@react-aria/focus": "3.0.0-nightly.1100+4ffc6447a", | ||
"@react-aria/i18n": "3.0.0-nightly.1100+4ffc6447a", | ||
"@react-aria/interactions": "3.0.0-nightly.1100+4ffc6447a", | ||
"@react-aria/live-announcer": "3.0.0-nightly.1100+4ffc6447a", | ||
"@react-aria/selection": "3.0.0-nightly.1100+4ffc6447a", | ||
"@react-aria/utils": "3.0.0-nightly.1100+4ffc6447a", | ||
"@react-stately/grid": "3.0.0-nightly.2785+4ffc6447a", | ||
"@react-stately/virtualizer": "3.1.5-nightly.2785+4ffc6447a", | ||
"@react-types/grid": "3.0.0-nightly.2785+4ffc6447a", | ||
"@react-types/shared": "3.0.0-nightly.1100+4ffc6447a" | ||
"@react-aria/focus": "3.0.0-nightly.1106+4c94b3187", | ||
"@react-aria/i18n": "3.0.0-nightly.1106+4c94b3187", | ||
"@react-aria/interactions": "3.0.0-nightly.1106+4c94b3187", | ||
"@react-aria/live-announcer": "3.0.0-nightly.1106+4c94b3187", | ||
"@react-aria/selection": "3.0.0-nightly.1106+4c94b3187", | ||
"@react-aria/utils": "3.0.0-nightly.1106+4c94b3187", | ||
"@react-stately/grid": "3.0.0-nightly.2791+4c94b3187", | ||
"@react-stately/virtualizer": "3.1.5-nightly.2791+4c94b3187", | ||
"@react-types/grid": "3.0.0-nightly.2791+4c94b3187", | ||
"@react-types/shared": "3.0.0-nightly.1106+4c94b3187" | ||
}, | ||
@@ -39,3 +39,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "4ffc6447a8f8b22e316383997e1d0b31d8602a56" | ||
"gitHead": "4c94b31875cc349a9dadb40a23aaf33a6334e7f8" | ||
} |
@@ -27,4 +27,2 @@ /* | ||
export interface GridProps extends DOMProps, AriaLabelingProps { | ||
/** The ref attached to the grid element. */ | ||
ref: RefObject<HTMLElement>, | ||
/** Whether the grid uses virtual scrolling. */ | ||
@@ -59,6 +57,6 @@ isVirtualized?: boolean, | ||
* @param state - State for the grid, as returned by `useGridState`. | ||
* @param ref - The ref attached to the grid element. | ||
*/ | ||
export function useGrid<T>(props: GridProps, state: GridState<T, GridCollection<T>>): GridAria { | ||
export function useGrid<T>(props: GridProps, state: GridState<T, GridCollection<T>>, ref: RefObject<HTMLElement>): GridAria { | ||
let { | ||
ref, | ||
isVirtualized, | ||
@@ -65,0 +63,0 @@ keyboardDelegate, |
@@ -27,8 +27,4 @@ /* | ||
node: RSNode<unknown>, | ||
/** The ref attached to the grid cell element. */ | ||
ref: RefObject<HTMLElement>, | ||
/** Whether the grid cell is contained in a virtual scroller. */ | ||
isVirtualized?: boolean, | ||
/** Whether the grid cell is disabled. */ | ||
isDisabled?: boolean, | ||
/** Whether the cell or its first focusable child element should be focused when the grid cell is focused. */ | ||
@@ -50,8 +46,6 @@ focusMode?: 'child' | 'cell', | ||
*/ | ||
export function useGridCell<T, C extends GridCollection<T>>(props: GridCellProps, state: GridState<T, C>): GridCellAria { | ||
export function useGridCell<T, C extends GridCollection<T>>(props: GridCellProps, state: GridState<T, C>, ref: RefObject<HTMLElement>): GridCellAria { | ||
let { | ||
node, | ||
ref, | ||
isVirtualized, | ||
isDisabled, | ||
focusMode = 'child', | ||
@@ -93,2 +87,3 @@ shouldSelectOnPressUp | ||
// TODO: move into useSelectableItem? | ||
let isDisabled = state.disabledKeys.has(node.key) || state.disabledKeys.has(node.parentKey); | ||
let {pressProps} = usePress({...itemProps, isDisabled}); | ||
@@ -95,0 +90,0 @@ |
@@ -23,10 +23,4 @@ /* | ||
node: Node<T>, | ||
/** The ref attached to the grid row. */ | ||
ref?: RefObject<HTMLElement>, | ||
/** Whether the grid row is contained in a virtual scroller. */ | ||
isVirtualized?: boolean, | ||
/** Whether the grid row is selected. */ | ||
isSelected?: boolean, | ||
/** Whether the grid row is disabled. */ | ||
isDisabled?: boolean, | ||
/** Whether selection should occur on press up instead of press down. */ | ||
@@ -46,9 +40,6 @@ shouldSelectOnPressUp?: boolean | ||
*/ | ||
export function useGridRow<T, C extends GridCollection<T>, S extends GridState<T, C>>(props: GridRowProps<T>, state: S): GridRowAria { | ||
export function useGridRow<T, C extends GridCollection<T>, S extends GridState<T, C>>(props: GridRowProps<T>, state: S, ref: RefObject<HTMLElement>): GridRowAria { | ||
let { | ||
node, | ||
ref, | ||
isVirtualized, | ||
isSelected, | ||
isDisabled, | ||
shouldSelectOnPressUp | ||
@@ -65,2 +56,5 @@ } = props; | ||
let isSelected = state.selectionManager.isSelected(node.key); | ||
let isDisabled = state.disabledKeys.has(node.key); | ||
// TODO: move into useSelectableItem? | ||
@@ -67,0 +61,0 @@ let {pressProps} = usePress({...itemProps, isDisabled}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
205385
2195