UNPKG

@progress/kendo-react-orgchart

Version:

React OrgChart renders a message to the user with information about the status of an app process. KendoReact OrgChart package

70 lines (69 loc) 2.37 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 t from "react"; import e from "prop-types"; import { packageMetadata as l } from "./package-metadata.mjs"; import { ServerOrgChart as g } from "./server/ServerOrgChart.mjs"; import { useId as m, validatePackage as u, getLicenseMessage as p, WatermarkOverlay as h } from "@progress/kendo-react-common"; import { ServerGroupedOrgChart as b } from "./server/ServerGroupedOrgChart.mjs"; import { ClientOrgChart as F } from "./client/ClientOrgChart.mjs"; const d = (r) => { const i = { tabIndex: 0, navigatable: !0, expandField: "expanded", ariaLabel: "Org Chart", idField: "id", childrenField: "items", avatarField: "avatar", avatarType: "image", titleField: "title", subtitleField: "subtitle", ...r }, { cardsColors: C, onExpandChange: f, onKeyDown: y, onItemAction: v, onGroupAction: O, onGroupBlur: x, onGroupFocus: E, id: a, ...n } = i, o = t.useRef(m()), s = !u(l, { component: "OrgChart" }), c = p(l); return /* @__PURE__ */ t.createElement(F, { style: { position: "relative", ...r.style }, ...i }, r.groupField ? /* @__PURE__ */ t.createElement(b, { id: a || o.current, ...n }, r.children) : /* @__PURE__ */ t.createElement(g, { id: a || o.current, ...n }, r.children), s && /* @__PURE__ */ t.createElement(h, { message: c })); }; d.propTypes = { className: e.string, style: e.object, id: e.string, ariaLabel: e.string, idField: e.string, childrenField: e.string, expandField: e.string, titleField: e.string, hasChildrenField: e.string, subtitleField: e.string, avatarField: e.string, cardsColors: e.array, data: e.array, groupField: e.string, cardHeight: e.number, cardWidth: e.number, groupTitleHeight: e.number, groupSubtitleHeight: e.number, verticalLine: e.number, height: e.oneOfType([e.string, e.number]), onExpandChange: e.func, onItemAction: e.func, onGroupAction: e.func }; d.displayName = "KendoOrgChart"; export { d as OrgChart };