UNPKG

react-native-sortables

Version:

Powerful Sortable Components for Flexible Content Reordering in React Native

56 lines (55 loc) 1.67 kB
"use strict"; import React from "react"; /* eslint-disable react/jsx-key */ import { useAnimatableValue } from '../../integrations/reanimated'; import { SharedProvider } from '../shared'; import { ContextProviderComposer } from '../utils'; import { AutoOffsetAdjustmentProvider } from './AutoOffsetAdjustmentProvider'; import { GridLayoutProvider } from './GridLayoutProvider'; import { jsx as _jsx } from "react/jsx-runtime"; export default function GridProvider({ autoAdjustOffsetDuringDrag, autoAdjustOffsetResetTimeout, autoAdjustOffsetScrollPadding, children, columnGap: columnGap_, isVertical, numGroups, rowGap: rowGap_, rowHeight, strategy, ...sharedProps }) { const rowGap = useAnimatableValue(rowGap_); const columnGap = useAnimatableValue(columnGap_); const sharedGridProviderProps = { columnGap, isVertical, numGroups, rowGap }; const providers = [ /*#__PURE__*/ // Provider with common sortables functionality _jsx(SharedProvider, { ...sharedProps }), // Provider with additional cross axis offset calculations to support // collapsible items autoAdjustOffsetDuringDrag && /*#__PURE__*/_jsx(AutoOffsetAdjustmentProvider, { ...sharedGridProviderProps, autoAdjustOffsetResetTimeout: autoAdjustOffsetResetTimeout, autoAdjustOffsetScrollPadding: autoAdjustOffsetScrollPadding }), /*#__PURE__*/ // Provider with grid layout calculations _jsx(GridLayoutProvider, { ...sharedGridProviderProps, rowHeight: rowHeight })]; return /*#__PURE__*/_jsx(ContextProviderComposer, { providers: providers, children: children }); } //# sourceMappingURL=GridProvider.js.map