@progress/kendo-react-layout
Version:
React Layout components enable you to create a perceptive and intuitive layout of web projects. KendoReact Layout package
59 lines (58 loc) • 1.94 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import * as n from "react";
import { Draggable as l } from "@progress/kendo-react-common";
const i = (t) => /* @__PURE__ */ n.createElement(
l,
{
onPress: t.onPress,
onDrag: (e) => {
t.onResize(e.event, !1, t.d);
},
onRelease: (e) => {
t.onResize(e.event, !0, t.d);
}
},
/* @__PURE__ */ n.createElement(
"div",
{
className: "k-resize-handle k-cursor-" + t.d + "-resize",
style: { bottom: 0, right: 0, ...t.style }
}
)
);
class h extends n.Component {
constructor() {
super(...arguments), this.handleResize = (e, s, r) => {
e.originalEvent.preventDefault(), this.props.onResize(e, { end: s, direction: r });
};
}
render() {
const { resizable: e, onPress: s, rtl: r } = this.props;
return e ? /* @__PURE__ */ n.createElement(n.Fragment, null, e !== "vertical" && /* @__PURE__ */ n.createElement(
i,
{
onPress: s,
onResize: this.handleResize,
d: "ew",
style: r ? { top: 0, width: 9, left: 0, right: "" } : { top: 0, width: 9, right: 0, left: "" }
}
), e !== "horizontal" && /* @__PURE__ */ n.createElement(i, { onPress: s, onResize: this.handleResize, d: "ns", style: { left: 0, height: 9 } }), e === !0 && /* @__PURE__ */ n.createElement(
i,
{
onPress: s,
onResize: this.handleResize,
d: r ? "nesw" : "nwse",
style: r ? { width: 9, height: 9, right: "", left: 0 } : { width: 9, height: 9, right: 0, left: "" }
}
)) : null;
}
}
export {
h as ResizeHandlers
};