UNPKG

@guestbell/react-page-plugins

Version:

Plugins we use in GuestBell for working with amazing react-page package

45 lines (44 loc) 1.76 kB
/* * This file is part of ORY Editor. * * ORY Editor is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * ORY Editor is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with ORY Editor. If not, see <http://www.gnu.org/licenses/>. * * @license LGPL-3.0 * @copyright 2016-2018 Aeneas Rekkas * @author Aeneas Rekkas <aeneas+oss@aeneas.io> * */ import * as React from 'react'; import { defaultSpacerState } from '../default/state'; import Text from 'guestbell-forms/build/components/text'; var Form = function Form(props) { var readOnly = props.readOnly, onChange = props.onChange, _props$data = props.data, _props$data2 = _props$data === void 0 ? defaultSpacerState : _props$data, _props$data2$height = _props$data2.height, height = _props$data2$height === void 0 ? 24 : _props$data2$height; var handleHeightChange = React.useCallback(function (height) { return onChange({ height: height }); }, [onChange]); return !readOnly ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, { number: height, label: props.translations.elementHeightLabel, onNumberChange: handleHeightChange })) : null; }; export default Form; //# sourceMappingURL=SpacerDefaultControls.js.map