@nodeject/ui-components
Version:
UI library for non-trivial components
14 lines (13 loc) • 621 B
JavaScript
import * as React from 'react';
import { usePanzoom } from '../use-panzoom';
export var PanzoomWrapper = function (props) {
var children = props.children;
var _a = usePanzoom({
bounds: true,
boundsPadding: .6,
minZoom: 0.4,
maxZoom: 1
}), PanzoomWrapper = _a.PanzoomWrapper, panzoomRef = _a.panzoomRef, wrapperProps = _a.wrapperProps;
return (React.createElement(PanzoomWrapper, { wrapperProps: wrapperProps, style: { width: '100%', height: '100%' } },
React.createElement("div", { ref: panzoomRef, style: { display: 'inline-flex' } }, children)));
};