import * as React from "react" ; import { Utils } from "./common/utils" ; import type { TableProps } from "./tableProps" ; export function clampNumFrozenColumns ( props ) { const { numFrozenColumns } = props ; const numColumns = React . Children . count ( props . children ) ; return clampPotentiallyNullValue ( numFrozenColumns , numColumns ) ; } export function clampNumFrozenRows ( props ) { const { numFrozenRows , numRows } = props ; return clampPotentiallyNullValue ( numFrozenRows , numRows ) ; } function clampPotentiallyNullValue ( value , max ) { return value == null ? 0 : Utils . clamp ( value , 0 , max ) ; } export function hasLoadingOption ( loadingOptions , loadingOption ) { if ( loadingOptions == null ) { return undefined ; } return loadingOptions . indexOf ( loadingOption ) >= 0 ; }