UNPKG

@progress/kendo-react-taskboard

Version:
50 lines (49 loc) 1.68 kB
/** * @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 r from "react"; import { TASKBOARD_ITEM_ID as s, TASKBOARD_ITEM_TYPE as u } from "./constants.mjs"; const p = (e, t, n) => { let l = -1, c = -1; for (let o = 0; o < n.length; o++) { const i = String(n[o].id); if (i === e && (c = o), i === t && (l = o), l !== -1 && c !== -1) return { dragIndex: c, dropIndex: l }; } return null; }, m = (e) => { for (; e; ) { if (!e.getAttribute) return null; const t = e.getAttribute(s); if (t) return { id: t, type: e.getAttribute(u) || "", element: e }; e = e.parentNode; } return null; }, d = (e, t) => { const n = t.dataItem.color, l = /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("span", { style: { backgroundColor: n } }, " "), e.props.children); return r.cloneElement(e, e.props, l); }, E = (e, t) => { if (!t) return e; const n = /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("span", { style: { backgroundColor: t.color } }, " "), /* @__PURE__ */ r.createElement("span", null, "  ", e.props.children)); return r.cloneElement(e, { ...e.props }, n); }; export { m as closestTaskBoardElement, p as findIndexes, d as itemRender, E as valueRender };