first commit

This commit is contained in:
Stefan Hacker
2026-04-03 09:38:48 +02:00
commit 37ad745546
47450 changed files with 3120798 additions and 0 deletions
@@ -0,0 +1,48 @@
import * as React from 'react';
import type { IResizeGroupProps } from './ResizeGroup.types';
export interface IResizeGroupState {
/**
* Final data used to render proper sized component
*/
renderedData?: any;
/**
* Data to render in a hidden div for measurement
*/
dataToMeasure?: any;
/**
* Set to true when the content container might have new dimensions and should
* be remeasured.
*/
measureContainer?: boolean;
/**
* Are we resizing to accommodate having more or less available space?
* The 'grow' direction is when the container may have more room than the last render,
* such as when a window resize occurs. This means we will try to fit more content in the window.
* The 'shrink' direction is when the contents don't fit in the container and we need
* to find a transformation of the data that makes everything fit.
*/
resizeDirection?: 'grow' | 'shrink';
}
/**
* Returns a simple object is able to store measurements with a given key.
*/
export declare const getMeasurementCache: () => {
getCachedMeasurement: (data: any) => number | undefined;
addMeasurementToCache: (data: any, measurement: number) => void;
};
/**
* Returns a function that is able to compute the next state for the ResizeGroup given the current
* state and any measurement updates.
*/
export declare const getNextResizeGroupStateProvider: (measurementCache?: {
getCachedMeasurement: (data: any) => number | undefined;
addMeasurementToCache: (data: any, measurement: number) => void;
}) => {
getNextState: (props: IResizeGroupProps, currentState: IResizeGroupState, getElementToMeasureDimension: () => number, newContainerDimension?: number) => IResizeGroupState | undefined;
shouldRenderDataForMeasurement: (dataToMeasure: any | undefined) => boolean;
getInitialResizeGroupState: (data: any) => IResizeGroupState;
};
export declare const MeasuredContext: React.Context<{
isMeasured: boolean;
}>;
export declare const ResizeGroupBase: React.FunctionComponent<IResizeGroupProps>;
@@ -0,0 +1,358 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ResizeGroupBase = exports.MeasuredContext = exports.getNextResizeGroupStateProvider = exports.getMeasurementCache = void 0;
var tslib_1 = require("tslib");
var React = require("react");
var Utilities_1 = require("../../Utilities");
var ResizeGroup_types_1 = require("./ResizeGroup.types");
var react_hooks_1 = require("@fluentui/react-hooks");
var WindowProvider_1 = require("../../WindowProvider");
var RESIZE_DELAY = 16;
/**
* Returns a simple object is able to store measurements with a given key.
*/
var getMeasurementCache = function () {
var measurementsCache = {};
return {
/**
* Checks if the provided data has a cacheKey. If it has a cacheKey and there is a
* corresponding entry in the measurementsCache, then it will return that value.
* Returns undefined otherwise.
*/
getCachedMeasurement: function (data) {
if (data && data.cacheKey && measurementsCache.hasOwnProperty(data.cacheKey)) {
return measurementsCache[data.cacheKey];
}
return undefined;
},
/**
* Should be called whenever there is a new measurement associated with a given data object.
* If the data has a cacheKey, store that measurement in the measurementsCache.
*/
addMeasurementToCache: function (data, measurement) {
if (data.cacheKey) {
measurementsCache[data.cacheKey] = measurement;
}
},
};
};
exports.getMeasurementCache = getMeasurementCache;
/**
* Returns a function that is able to compute the next state for the ResizeGroup given the current
* state and any measurement updates.
*/
var getNextResizeGroupStateProvider = function (measurementCache) {
if (measurementCache === void 0) { measurementCache = (0, exports.getMeasurementCache)(); }
var _measurementCache = measurementCache;
var _containerDimension;
/**
* Gets the width/height of the data rendered in a hidden div.
* @param measuredData - The data corresponding to the measurement we wish to take.
* @param getElementToMeasureDimension - A function that returns the measurement of the rendered data.
* Only called when the measurement is not in the cache.
*/
function _getMeasuredDimension(measuredData, getElementToMeasureDimension) {
var cachedDimension = _measurementCache.getCachedMeasurement(measuredData);
if (cachedDimension !== undefined) {
return cachedDimension;
}
var measuredDimension = getElementToMeasureDimension();
_measurementCache.addMeasurementToCache(measuredData, measuredDimension);
return measuredDimension;
}
/**
* Will get the next IResizeGroupState based on the current data while trying to shrink contents
* to fit in the container.
* @param data - The initial data point to start measuring.
* @param onReduceData - Function that transforms the data into something that should render with less width/height.
* @param getElementToMeasureDimension - A function that returns the measurement of the rendered data.
* Only called when the measurement is not in the cache.
*/
function _shrinkContentsUntilTheyFit(data, onReduceData, getElementToMeasureDimension) {
var dataToMeasure = data;
var measuredDimension = _getMeasuredDimension(data, getElementToMeasureDimension);
while (measuredDimension > _containerDimension) {
var nextMeasuredData = onReduceData(dataToMeasure);
// We don't want to get stuck in an infinite render loop when there are no more
// scaling steps, so implementations of onReduceData should return undefined when
// there are no more scaling states to apply.
if (nextMeasuredData === undefined) {
return {
renderedData: dataToMeasure,
resizeDirection: undefined,
dataToMeasure: undefined,
};
}
measuredDimension = _measurementCache.getCachedMeasurement(nextMeasuredData);
// If the measurement isn't in the cache, we need to re-render with some data in a hidden div
if (measuredDimension === undefined) {
return {
dataToMeasure: nextMeasuredData,
resizeDirection: 'shrink',
};
}
dataToMeasure = nextMeasuredData;
}
return {
renderedData: dataToMeasure,
resizeDirection: undefined,
dataToMeasure: undefined,
};
}
/**
* This function should be called when the state changes in a manner that might allow for more content to fit
* on the screen, such as the window width/height growing.
* @param data - The initial data point to start measuring.
* @param onGrowData - Function that transforms the data into something that may take up more space when rendering.
* @param getElementToMeasureDimension - A function that returns the measurement of the rendered data.
* Only called when the measurement is not in the cache.
*/
function _growDataUntilItDoesNotFit(data, onGrowData, getElementToMeasureDimension, onReduceData) {
var dataToMeasure = data;
var measuredDimension = _getMeasuredDimension(data, getElementToMeasureDimension);
while (measuredDimension < _containerDimension) {
var nextMeasuredData = onGrowData(dataToMeasure);
// We don't want to get stuck in an infinite render loop when there are no more
// scaling steps, so implementations of onGrowData should return undefined when
// there are no more scaling states to apply.
if (nextMeasuredData === undefined) {
return {
renderedData: dataToMeasure,
resizeDirection: undefined,
dataToMeasure: undefined,
};
}
measuredDimension = _measurementCache.getCachedMeasurement(nextMeasuredData);
// If the measurement isn't in the cache, we need to re-render with some data in a hidden div
if (measuredDimension === undefined) {
return {
dataToMeasure: nextMeasuredData,
};
}
dataToMeasure = nextMeasuredData;
}
// Once the loop is done, we should now shrink until the contents fit.
return tslib_1.__assign({ resizeDirection: 'shrink' }, _shrinkContentsUntilTheyFit(dataToMeasure, onReduceData, getElementToMeasureDimension));
}
/**
* Handles an update to the container width/height.
* Should only be called when we knew the previous container width/height.
* @param newDimension - The new width/height of the container.
* @param fullDimensionData - The initial data passed in as a prop to resizeGroup.
* @param renderedData - The data that was rendered prior to the container size changing.
* @param onGrowData - Set to true if the Resize group has an onGrowData function.
*/
function _updateContainerDimension(newDimension, fullDimensionData, renderedData, onGrowData) {
var nextState;
if (newDimension > _containerDimension) {
if (onGrowData) {
nextState = {
resizeDirection: 'grow',
dataToMeasure: onGrowData(renderedData),
};
}
else {
nextState = {
resizeDirection: 'shrink',
dataToMeasure: fullDimensionData,
};
}
}
else {
nextState = {
resizeDirection: 'shrink',
dataToMeasure: renderedData,
};
}
_containerDimension = newDimension;
return tslib_1.__assign(tslib_1.__assign({}, nextState), { measureContainer: false });
}
function getNextState(props, currentState, getElementToMeasureDimension, newContainerDimension) {
// If there is no new container width/height or data to measure, there is no need for a new state update
if (newContainerDimension === undefined && currentState.dataToMeasure === undefined) {
return undefined;
}
if (newContainerDimension) {
// If we know the last container size and we rendered data at that width/height, we can do an optimized render
if (_containerDimension && currentState.renderedData && !currentState.dataToMeasure) {
return tslib_1.__assign(tslib_1.__assign({}, currentState), _updateContainerDimension(newContainerDimension, props.data, currentState.renderedData, props.onGrowData));
}
// If we are just setting the container width/height for the first time, we can't do any optimizations
_containerDimension = newContainerDimension;
}
var nextState = tslib_1.__assign(tslib_1.__assign({}, currentState), { measureContainer: false });
if (currentState.dataToMeasure) {
if (currentState.resizeDirection === 'grow' && props.onGrowData) {
nextState = tslib_1.__assign(tslib_1.__assign({}, nextState), _growDataUntilItDoesNotFit(currentState.dataToMeasure, props.onGrowData, getElementToMeasureDimension, props.onReduceData));
}
else {
nextState = tslib_1.__assign(tslib_1.__assign({}, nextState), _shrinkContentsUntilTheyFit(currentState.dataToMeasure, props.onReduceData, getElementToMeasureDimension));
}
}
return nextState;
}
/** Function that determines if we need to render content for measurement based on the measurement cache contents. */
function shouldRenderDataForMeasurement(dataToMeasure) {
if (!dataToMeasure || _measurementCache.getCachedMeasurement(dataToMeasure) !== undefined) {
return false;
}
return true;
}
function getInitialResizeGroupState(data) {
return {
dataToMeasure: tslib_1.__assign({}, data),
resizeDirection: 'grow',
measureContainer: true,
};
}
return {
getNextState: getNextState,
shouldRenderDataForMeasurement: shouldRenderDataForMeasurement,
getInitialResizeGroupState: getInitialResizeGroupState,
};
};
exports.getNextResizeGroupStateProvider = getNextResizeGroupStateProvider;
// Provides a context property that (if true) tells any child components that
// they are only being used for measurement purposes and will not be visible.
exports.MeasuredContext = React.createContext({ isMeasured: false });
// Styles for the hidden div used for measurement
var hiddenDivStyles = { position: 'fixed', visibility: 'hidden' };
var hiddenParentStyles = { position: 'relative' };
var COMPONENT_NAME = 'ResizeGroup';
/**
* Use useReducer instead of userState because React is not batching the state updates
* when state is set in callbacks of setTimeout or requestAnimationFrame.
* See issue: https://github.com/facebook/react/issues/14259
*/
function resizeDataReducer(state, action) {
var _a;
switch (action.type) {
case 'resizeData':
return tslib_1.__assign({}, action.value);
case 'dataToMeasure':
return tslib_1.__assign(tslib_1.__assign({}, state), { dataToMeasure: action.value, resizeDirection: 'grow', measureContainer: true });
default:
return tslib_1.__assign(tslib_1.__assign({}, state), (_a = {}, _a[action.type] = action.value, _a));
}
}
function useResizeState(props, nextResizeGroupStateProvider, rootRef) {
var initialStateData = (0, react_hooks_1.useConst)(function () { return nextResizeGroupStateProvider.getInitialResizeGroupState(props.data); });
var _a = React.useReducer(resizeDataReducer, initialStateData), resizeData = _a[0], dispatchResizeDataAction = _a[1];
// Reset state when new data is provided
React.useEffect(function () {
dispatchResizeDataAction({
type: 'dataToMeasure',
value: props.data,
});
}, [props.data]);
// Because it's possible that we may force more than one re-render per animation frame, we
// want to make sure that the RAF request is using the most recent data.
var stateRef = React.useRef(initialStateData);
stateRef.current = tslib_1.__assign({}, resizeData);
var updateResizeState = React.useCallback(function (nextState) {
if (nextState) {
dispatchResizeDataAction({
type: 'resizeData',
value: nextState,
});
}
}, []);
var remeasure = React.useCallback(function () {
if (rootRef.current) {
dispatchResizeDataAction({
type: 'measureContainer',
value: true,
});
}
}, [rootRef]);
return [stateRef, updateResizeState, remeasure];
}
function useResizingBehavior(props, rootRef) {
var nextResizeGroupStateProvider = (0, react_hooks_1.useConst)(exports.getNextResizeGroupStateProvider);
// A div that can be used for the initial measurement so that we can avoid mounting a second instance
// of the component being measured for the initial render.
var initialHiddenDiv = React.useRef(null);
// A hidden div that is used for mounting a new instance of the component for measurement in a hidden
// div without unmounting the currently visible content.
var updateHiddenDiv = React.useRef(null);
// Tracks if any content has been rendered to the user. This enables us to do some performance optimizations
// for the initial render.
var hasRenderedContent = React.useRef(false);
var async = (0, react_hooks_1.useAsync)();
var _a = useResizeState(props, nextResizeGroupStateProvider, rootRef), stateRef = _a[0], updateResizeState = _a[1], remeasure = _a[2];
React.useEffect(function () {
var _a;
if (stateRef.current.renderedData) {
hasRenderedContent.current = true;
(_a = props.dataDidRender) === null || _a === void 0 ? void 0 : _a.call(props, stateRef.current.renderedData);
}
});
React.useEffect(function () {
async.requestAnimationFrame(function () {
var containerDimension = undefined;
if (stateRef.current.measureContainer && rootRef.current) {
var boundingRect = rootRef.current.getBoundingClientRect();
containerDimension =
props.direction === ResizeGroup_types_1.ResizeGroupDirection.vertical ? boundingRect.height : boundingRect.width;
}
var nextState = nextResizeGroupStateProvider.getNextState(props, stateRef.current, function () {
var refToMeasure = !hasRenderedContent.current ? initialHiddenDiv : updateHiddenDiv;
if (!refToMeasure.current) {
return 0;
}
var measuredBoundingRect = refToMeasure.current.getBoundingClientRect();
return props.direction === ResizeGroup_types_1.ResizeGroupDirection.vertical
? measuredBoundingRect.height
: measuredBoundingRect.width;
}, containerDimension);
updateResizeState(nextState);
}, rootRef.current);
});
var win = (0, WindowProvider_1.useWindow)();
(0, react_hooks_1.useOnEvent)(win, 'resize', async.debounce(remeasure, RESIZE_DELAY, { leading: true }));
var dataNeedsMeasuring = nextResizeGroupStateProvider.shouldRenderDataForMeasurement(stateRef.current.dataToMeasure);
var isInitialMeasure = !hasRenderedContent.current && dataNeedsMeasuring;
return [
stateRef.current.dataToMeasure,
stateRef.current.renderedData,
remeasure,
initialHiddenDiv,
updateHiddenDiv,
dataNeedsMeasuring,
isInitialMeasure,
];
}
function useDebugWarnings(props) {
if (process.env.NODE_ENV !== 'production') {
// eslint-disable-next-line react-hooks/rules-of-hooks -- build-time conditional
(0, react_hooks_1.useWarnings)({
name: COMPONENT_NAME,
props: props,
deprecations: { styles: 'className' },
});
}
}
var measuredContextValue = { isMeasured: true };
exports.ResizeGroupBase = React.forwardRef(function (props, forwardedRef) {
var rootRef = React.useRef(null);
// The root div which is the container inside of which we are trying to fit content.
var mergedRootRef = (0, react_hooks_1.useMergedRefs)(rootRef, forwardedRef);
var _a = useResizingBehavior(props, rootRef), dataToMeasure = _a[0], renderedData = _a[1], remeasure = _a[2], initialHiddenDiv = _a[3], updateHiddenDiv = _a[4], dataNeedsMeasuring = _a[5], isInitialMeasure = _a[6];
React.useImperativeHandle(props.componentRef, function () { return ({ remeasure: remeasure }); }, [remeasure]);
useDebugWarnings(props);
var className = props.className, onRenderData = props.onRenderData;
var divProps = (0, Utilities_1.getNativeProps)(props, Utilities_1.divProperties, ['data']);
// We only ever render the final content to the user. All measurements are done in a hidden div.
// For the initial render, we want this to be as fast as possible, so we need to make sure that we only mount one
// version of the component for measurement and the final render. For renders that update what is on screen, we
// want to make sure that there are no jarring effects such as the screen flashing as we apply scaling steps for
// measurement. In the update case, we mount a second version of the component just for measurement purposes and
// leave the rendered content untouched until we know the next state to show to the user.
return (React.createElement("div", tslib_1.__assign({}, divProps, { className: className, ref: mergedRootRef }),
React.createElement("div", { style: hiddenParentStyles },
dataNeedsMeasuring && !isInitialMeasure && (React.createElement("div", { style: hiddenDivStyles, ref: updateHiddenDiv },
React.createElement(exports.MeasuredContext.Provider, { value: measuredContextValue }, onRenderData(dataToMeasure)))),
React.createElement("div", { ref: initialHiddenDiv, style: isInitialMeasure ? hiddenDivStyles : undefined, "data-automation-id": "visibleContent" }, isInitialMeasure ? onRenderData(dataToMeasure) : renderedData && onRenderData(renderedData)))));
});
exports.ResizeGroupBase.displayName = 'ResizeGroupBase';
//# sourceMappingURL=ResizeGroup.base.js.map
File diff suppressed because one or more lines are too long
@@ -0,0 +1,3 @@
import * as React from 'react';
import type { IResizeGroupProps } from './ResizeGroup.types';
export declare const ResizeGroup: React.FunctionComponent<IResizeGroupProps>;
@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ResizeGroup = void 0;
var ResizeGroup_base_1 = require("./ResizeGroup.base");
exports.ResizeGroup = ResizeGroup_base_1.ResizeGroupBase;
//# sourceMappingURL=ResizeGroup.js.map
@@ -0,0 +1 @@
{"version":3,"file":"ResizeGroup.js","sourceRoot":"../src/","sources":["components/ResizeGroup/ResizeGroup.tsx"],"names":[],"mappings":";;;AACA,uDAAqD;AAGxC,QAAA,WAAW,GAA+C,kCAAe,CAAC","sourcesContent":["import * as React from 'react';\nimport { ResizeGroupBase } from './ResizeGroup.base';\nimport type { IResizeGroupProps } from './ResizeGroup.types';\n\nexport const ResizeGroup: React.FunctionComponent<IResizeGroupProps> = ResizeGroupBase;\n"]}
@@ -0,0 +1,103 @@
import * as React from 'react';
import type { IStyle, ITheme } from '../../Styling';
import type { IRefObject, IStyleFunctionOrObject } from '../../Utilities';
import type { JSXElement } from '@fluentui/utilities';
/**
* {@docCategory ResizeGroup}
*/
export declare enum ResizeGroupDirection {
horizontal = 0,
vertical = 1
}
/**
* {@docCategory ResizeGroup}
*/
export interface IResizeGroup {
/**
* Remeasures the available space.
*/
remeasure(): void;
}
/**
* {@docCategory ResizeGroup}
*/
export interface IResizeGroupProps extends React.HTMLAttributes<HTMLDivElement>, React.RefAttributes<HTMLDivElement> {
/**
* Optional callback to access the IResizeGroup interface. Use this instead of ref for accessing
* the public methods and properties of the component.
*/
componentRef?: IRefObject<IResizeGroup>;
/**
* Call to provide customized styling that will layer on top of the variant rules
* @deprecated Removed to reduce bundle size. Please use `className` and add css rules to `className` instead.
*/
styles?: IStyleFunctionOrObject<IResizeGroupStyleProps, IResizeGroupStyles>;
/**
* Theme provided by HOC.
*/
theme?: ITheme;
/**
* Additional css class to apply to the Component
* @defaultvalue undefined
*/
className?: string;
/**
* Direction of this resize group, vertical or horizontal
* @defaultvalue ResizeGroupDirection.horizontal
*/
direction?: ResizeGroupDirection;
/**
* Initial data to be passed to the `onRenderData` function. When there is no `onGrowData` provided, this data should
* represent what should be passed to the render function when the parent container of the ResizeGroup is at its
* maximum supported width. A `cacheKey` property may optionally be included as part of the data. Two data objects
* with the same `cacheKey` will be assumed to take up the same width and will prevent measurements.
* The type of `cacheKey` is a string.
*/
data: any;
/**
* Function to render the data. Called when rendering the contents to the screen and when
* rendering in a hidden div to measure the size of the contents.
*/
onRenderData: (data: any) => JSXElement;
/**
* Function to be performed on the data in order to reduce its width and make it fit into the given space.
* If there are no more scaling steps to apply, it should return undefined to prevent
* an infinite render loop.
*/
onReduceData: (prevData: any) => any;
/**
* Function to be performed on the data in order to increase its width. It is called in scenarios where the
* container has more room than the previous render and we may be able to fit more content. If there are no more
* scaling operations to perform on teh data, it should return undefined to prevent an infinite render loop.
*/
onGrowData?: (prevData: any) => any;
/**
* Function to be called every time data is rendered. It provides the data that was actually rendered.
* A use case would be adding telemetry when a particular control is shown in an overflow well or
* dropped as a result of onReduceData or to count the number of renders that an implementation of
* onReduceData triggers.
*/
dataDidRender?: (renderedData: any) => void;
}
/**
* {@docCategory ResizeGroup}
*/
export interface IResizeGroupStyleProps {
/**
* Accept theme prop.
*/
theme: ITheme;
/**
* Accept custom classNames
*/
className?: string;
}
/**
* {@docCategory ResizeGroup}
*/
export interface IResizeGroupStyles {
/**
* Style for the root element.
*/
root: IStyle;
}
@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ResizeGroupDirection = void 0;
/**
* {@docCategory ResizeGroup}
*/
var ResizeGroupDirection;
(function (ResizeGroupDirection) {
ResizeGroupDirection[ResizeGroupDirection["horizontal"] = 0] = "horizontal";
ResizeGroupDirection[ResizeGroupDirection["vertical"] = 1] = "vertical";
})(ResizeGroupDirection || (exports.ResizeGroupDirection = ResizeGroupDirection = {}));
//# sourceMappingURL=ResizeGroup.types.js.map
@@ -0,0 +1 @@
{"version":3,"file":"ResizeGroup.types.js","sourceRoot":"../src/","sources":["components/ResizeGroup/ResizeGroup.types.ts"],"names":[],"mappings":";;;AAMA;;GAEG;AACH,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,2EAAc,CAAA;IACd,uEAAY,CAAA;AACd,CAAC,EAHW,oBAAoB,oCAApB,oBAAoB,QAG/B","sourcesContent":["import * as React from 'react';\nimport type { IStyle, ITheme } from '../../Styling';\nimport type { IRefObject, IStyleFunctionOrObject } from '../../Utilities';\n\nimport type { JSXElement } from '@fluentui/utilities';\n\n/**\n * {@docCategory ResizeGroup}\n */\nexport enum ResizeGroupDirection {\n horizontal = 0,\n vertical = 1,\n}\n\n/**\n * {@docCategory ResizeGroup}\n */\nexport interface IResizeGroup {\n /**\n * Remeasures the available space.\n */\n remeasure(): void;\n}\n\n/**\n * {@docCategory ResizeGroup}\n */\nexport interface IResizeGroupProps extends React.HTMLAttributes<HTMLDivElement>, React.RefAttributes<HTMLDivElement> {\n /**\n * Optional callback to access the IResizeGroup interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: IRefObject<IResizeGroup>;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules\n * @deprecated Removed to reduce bundle size. Please use `className` and add css rules to `className` instead.\n */\n styles?: IStyleFunctionOrObject<IResizeGroupStyleProps, IResizeGroupStyles>;\n\n /**\n * Theme provided by HOC.\n */\n theme?: ITheme;\n\n /**\n * Additional css class to apply to the Component\n * @defaultvalue undefined\n */\n className?: string;\n\n /**\n * Direction of this resize group, vertical or horizontal\n * @defaultvalue ResizeGroupDirection.horizontal\n */\n direction?: ResizeGroupDirection;\n\n /**\n * Initial data to be passed to the `onRenderData` function. When there is no `onGrowData` provided, this data should\n * represent what should be passed to the render function when the parent container of the ResizeGroup is at its\n * maximum supported width. A `cacheKey` property may optionally be included as part of the data. Two data objects\n * with the same `cacheKey` will be assumed to take up the same width and will prevent measurements.\n * The type of `cacheKey` is a string.\n */\n data: any;\n\n /**\n * Function to render the data. Called when rendering the contents to the screen and when\n * rendering in a hidden div to measure the size of the contents.\n */\n\n onRenderData: (data: any) => JSXElement;\n\n /**\n * Function to be performed on the data in order to reduce its width and make it fit into the given space.\n * If there are no more scaling steps to apply, it should return undefined to prevent\n * an infinite render loop.\n */\n onReduceData: (prevData: any) => any;\n\n /**\n * Function to be performed on the data in order to increase its width. It is called in scenarios where the\n * container has more room than the previous render and we may be able to fit more content. If there are no more\n * scaling operations to perform on teh data, it should return undefined to prevent an infinite render loop.\n */\n onGrowData?: (prevData: any) => any;\n\n /**\n * Function to be called every time data is rendered. It provides the data that was actually rendered.\n * A use case would be adding telemetry when a particular control is shown in an overflow well or\n * dropped as a result of onReduceData or to count the number of renders that an implementation of\n * onReduceData triggers.\n */\n dataDidRender?: (renderedData: any) => void;\n}\n\n/**\n * {@docCategory ResizeGroup}\n */\nexport interface IResizeGroupStyleProps {\n /**\n * Accept theme prop.\n */\n theme: ITheme;\n\n /**\n * Accept custom classNames\n */\n className?: string;\n}\n\n/**\n * {@docCategory ResizeGroup}\n */\nexport interface IResizeGroupStyles {\n /**\n * Style for the root element.\n */\n root: IStyle;\n}\n"]}
@@ -0,0 +1,3 @@
export * from './ResizeGroup';
export * from './ResizeGroup.base';
export * from './ResizeGroup.types';
@@ -0,0 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
tslib_1.__exportStar(require("./ResizeGroup"), exports);
tslib_1.__exportStar(require("./ResizeGroup.base"), exports);
tslib_1.__exportStar(require("./ResizeGroup.types"), exports);
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/ResizeGroup/index.ts"],"names":[],"mappings":";;;AAAA,wDAA8B;AAC9B,6DAAmC;AACnC,8DAAoC","sourcesContent":["export * from './ResizeGroup';\nexport * from './ResizeGroup.base';\nexport * from './ResizeGroup.types';\n"]}