UNPKG

@mui/x-charts

Version:

The community edition of MUI X Charts components.

21 lines (20 loc) 712 B
"use strict"; 'use client'; Object.defineProperty(exports, "__esModule", { value: true }); exports.useIsItemFocused = useIsItemFocused; var _useStore = require("../internals/store/useStore"); var _useChartKeyboardNavigation = require("../internals/plugins/featurePlugins/useChartKeyboardNavigation"); /** * A hook to check if an item has the focus. * * If you need to process multiple points, use the `useIsItemFocusedGetter` hook instead. * * @param {FocusedItemIdentifier} item is the item to check * @returns {boolean} the focus state */ function useIsItemFocused(item) { const store = (0, _useStore.useStore)(); return store.use(_useChartKeyboardNavigation.selectorChartsItemIsFocused, item); }