UNPKG

@progress/kendo-react-layout

Version:

React Layout components enable you to create a perceptive and intuitive layout of web projects. KendoReact Layout package

56 lines (55 loc) 1.77 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2026 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import * as t from "react"; import { Draggable as o } from "@progress/kendo-react-common"; const r = (e) => /* @__PURE__ */ t.createElement( o, { onPress: e.onPress, onDrag: (n) => { e.onResize(n.event, !1, e.d); }, onRelease: (n) => { e.onResize(n.event, !0, e.d); } }, /* @__PURE__ */ t.createElement( "div", { className: "k-resize-handle k-cursor-" + e.d + "-resize", style: { bottom: 0, right: 0, ...e.style } } ) ), g = ({ resizable: e, onResize: n, onPress: l, rtl: i }) => { const a = t.useCallback( (h, s, d) => { h.originalEvent.preventDefault(), n(h, { end: s, direction: d }); }, [n] ); return e ? /* @__PURE__ */ t.createElement(t.Fragment, null, e !== "vertical" && /* @__PURE__ */ t.createElement( r, { onPress: l, onResize: a, d: "ew", style: i ? { top: 0, width: 9, left: 0, right: "" } : { top: 0, width: 9, right: 0, left: "" } } ), e !== "horizontal" && /* @__PURE__ */ t.createElement(r, { onPress: l, onResize: a, d: "ns", style: { left: 0, height: 9 } }), e === !0 && /* @__PURE__ */ t.createElement( r, { onResize: a, onPress: l, d: i ? "nesw" : "nwse", style: i ? { width: 9, height: 9, right: "", left: 0 } : { width: 9, height: 9, right: 0, left: "" } } )) : null; }; export { g as ResizeHandlers };