UNPKG

@progress/kendo-react-scheduler

Version:

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

9 lines (8 loc) 2.16 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("react"),R=require("@progress/kendo-react-intl"),u=require("../messages/index.js"),s=require("@progress/kendo-react-common"),d=require("@progress/kendo-svg-icons"),y=require("../hooks/useEditable.js");function E(e){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(c,a,n.get?n:{enumerable:!0,get:()=>e[a]})}}return c.default=e,Object.freeze(c)}const t=E(I),f=t.forwardRef((e,c)=>{const{_ref:a,onRemoveClick:n}=e,o=t.useRef(null),m=t.useRef(null);t.useImperativeHandle(o,()=>({props:e,element:m.current})),t.useImperativeHandle(c,()=>o.current),t.useImperativeHandle(a,()=>o.current);const b=y.useEditable(e.editable),k=R.useLocalization().toLanguageString(u.deleteTitle,u.messages[u.deleteTitle]),r=e.group.resources.find(l=>!!(l.colorField&&l[l.colorField]!==void 0)),i=r&&r.colorField&&r[r.colorField],g=t.useCallback(l=>{n&&n.call(void 0,{syntheticEvent:l,target:o.current})},[n,o]),v=t.useMemo(()=>s.classNames("k-task",e.className),[e.className]);return t.createElement("div",{id:e.id,ref:m,style:e.style,className:v,tabIndex:e.tabIndex||void 0},i&&t.createElement("span",{className:"k-scheduler-mark",style:{color:i,backgroundColor:i}}),e.isRecurring&&t.createElement(s.IconWrap,{name:"arrow-rotate-cw",icon:d.arrowRotateCwIcon}),e.isException&&t.createElement(s.IconWrap,{name:"arrows-no-repeat",icon:d.arrowsNoRepeatIcon}),e.title,b.remove&&t.createElement("a",{className:"k-link k-event-delete",title:k,"aria-label":k,onClick:g},t.createElement(s.IconWrap,{name:"x",icon:d.xIcon})))});f.displayName="KendoReactSchedulerTask";exports.SchedulerTask=f;