Files
Iliyan Angelov 306b20e24a Frontend start
2025-09-14 00:54:48 +03:00

95 lines
2.3 KiB
JavaScript

"use strict";
'use client';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.useRadarChartProps = void 0;
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
const _excluded = ["apiRef", "series", "radar", "width", "height", "margin", "colors", "sx", "children", "slots", "slotProps", "skipAnimation", "loading", "highlightedItem", "onHighlightChange", "hideLegend", "divisions", "shape", "stripeColor", "highlight", "showToolbar", "onAxisClick", "onAreaClick", "onMarkClick"];
/**
* A helper function that extracts RadarChartProps from the input props
* and returns an object with props for the children components of RadarChart.
*
* @param props The input props for RadarChart
* @returns An object with props for the children components of RadarChart
*/
const useRadarChartProps = props => {
const {
apiRef,
series,
radar,
width,
height,
margin,
colors,
sx,
children,
slots,
slotProps,
skipAnimation,
loading,
highlightedItem,
onHighlightChange,
divisions,
shape,
stripeColor,
highlight = 'axis',
onAxisClick,
onAreaClick,
onMarkClick
} = props,
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
const radarDataProviderProps = {
apiRef,
series,
radar,
highlight,
width,
height,
margin,
colors,
highlightedItem,
onHighlightChange,
skipAnimation,
onAxisClick
};
const overlayProps = {
slots,
slotProps,
loading
};
const legendProps = {
slots,
slotProps
};
const chartsWrapperProps = {
sx
};
const radarGrid = {
divisions,
shape,
stripeColor
};
const radarSeriesAreaProps = {
onItemClick: onAreaClick
};
const radarSeriesMarksProps = {
onItemClick: onMarkClick
};
const chartsSurfaceProps = other;
return {
highlight,
chartsWrapperProps,
chartsSurfaceProps,
radarDataProviderProps,
radarGrid,
radarSeriesAreaProps,
radarSeriesMarksProps,
overlayProps,
legendProps,
children
};
};
exports.useRadarChartProps = useRadarChartProps;