UNPKG

zmp-react

Version:

Build full featured iOS & Android apps using ZMP & React

53 lines (47 loc) 1.54 kB
import _extends from "@babel/runtime/helpers/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose"; import React, { forwardRef, useRef, useImperativeHandle } from 'react'; import Row from '../components/row'; import { classNames } from '../shared/utils'; import { FLEX_GAP_CLASSNAME } from '../../common/constants'; /* dts-imports import { FlexLayoutGap } from '../../common/components-enum-props'; */ /* dts-props id: string | number; className: string; style: React.CSSProperties; noGap? : boolean tag? : string resizable? : boolean resizableFixed? : boolean resizableAbsolute? : boolean resizableHandler? : boolean gap?: keyof typeof FlexLayoutGap; onClick? : (event?: any) => void onGridResize? : (...args: any[]) => void COLOR_PROPS ref?: React.MutableRefObject<{el: HTMLElement | null}>; CHILDREN_PROP */ var ZMPRow = /*#__PURE__*/forwardRef(function (props, ref) { var elRef = useRef(null); useImperativeHandle(ref, function () { return elRef.current; }); var gap = props.gap, className = props.className, noGap = props.noGap, others = _objectWithoutPropertiesLoose(props, ["gap", "className", "noGap"]); var classes = className; if (!noGap && gap) { classes = classNames(FLEX_GAP_CLASSNAME[gap] || '', classes); } return /*#__PURE__*/React.createElement(Row, _extends({ ref: elRef, className: classes, noGap: noGap }, others)); }); ZMPRow.displayName = 'zmp-row'; export default ZMPRow;