UNPKG

@progress/kendo-react-scheduler

Version:

React Scheduler brings the functionality of Outlook's Calendar to a single UI component. KendoReact Scheduler package

59 lines (58 loc) 2.39 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 e from "react"; import { useLocalization as R } from "@progress/kendo-react-intl"; import { deleteTitle as m, messages as g } from "../messages/index.mjs"; import { classNames as I, IconWrap as r } from "@progress/kendo-react-common"; import { arrowRotateCwIcon as b, arrowsNoRepeatIcon as E, xIcon as N } from "@progress/kendo-svg-icons"; import { useEditable as w } from "../hooks/useEditable.mjs"; const x = e.forwardRef( (t, d) => { const { _ref: u, onRemoveClick: n } = t, a = e.useRef(null), i = e.useRef(null); e.useImperativeHandle(a, () => ({ props: t, element: i.current })), e.useImperativeHandle(d, () => a.current), e.useImperativeHandle(u, () => a.current); const k = w(t.editable), s = R().toLanguageString(m, g[m]), l = t.group.resources.find( (o) => !!(o.colorField && o[o.colorField] !== void 0) ), c = l && l.colorField && l[l.colorField], f = e.useCallback( (o) => { n && n.call(void 0, { syntheticEvent: o, target: a.current }); }, [n, a] ), v = e.useMemo(() => I("k-task", t.className), [t.className]); return /* @__PURE__ */ e.createElement( "div", { id: t.id, ref: i, style: t.style, className: v, tabIndex: t.tabIndex || void 0 }, c && /* @__PURE__ */ e.createElement("span", { className: "k-scheduler-mark", style: { color: c, backgroundColor: c } }), t.isRecurring && /* @__PURE__ */ e.createElement(r, { name: "arrow-rotate-cw", icon: b }), t.isException && /* @__PURE__ */ e.createElement(r, { name: "arrows-no-repeat", icon: E }), t.title, k.remove && /* @__PURE__ */ e.createElement( "a", { className: "k-link k-event-delete", title: s, "aria-label": s, onClick: f }, /* @__PURE__ */ e.createElement(r, { name: "x", icon: N }) ) ); } ); x.displayName = "KendoReactSchedulerTask"; export { x as SchedulerTask };