UNPKG

@progress/kendo-react-gantt

Version:

React Gantt enables the display of self-referencing tabular data with many features. KendoReact Gantt package

9 lines (8 loc) 1.94 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 C=require("react"),v=require("@progress/kendo-react-intl"),d=require("@progress/kendo-react-buttons"),i=require("../../messages/index.js"),p=require("@progress/kendo-react-common"),B=require("@progress/kendo-svg-icons");function w(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const c in t)if(c!=="default"){const o=Object.getOwnPropertyDescriptor(t,c);Object.defineProperty(a,c,o.get?o:{enumerable:!0,get:()=>t[c]})}}return a.default=t,Object.freeze(a)}const n=w(C),r=n.forwardRef((t,a)=>{const c=v.useLocalization(),o=e=>c.toLanguageString(e,i.messages[e]),s=o(i.addTask),u=o(i.addChild),k=o(i.addAbove),m=o(i.addBelow),g=n.useCallback(e=>{e.syntheticEvent.preventDefault();const f=e.item&&e.item.direction?e.item.direction:"none";t.onClick&&t.onClick({nativeEvent:e.nativeEvent,syntheticEvent:e.syntheticEvent,direction:f})},[t.onClick]),b=n.useCallback(e=>{e.preventDefault(),t.onClick&&t.onClick({nativeEvent:e&&e.nativeEvent,syntheticEvent:e,direction:"none"})},[t.onClick]),l=n.createElement(n.Fragment,null,n.createElement(p.IconWrap,{name:"plus",icon:B.plusIcon}),s);return t.selectedTask?n.createElement(d.DropDownButton,{className:"k-views-dropdown",onItemClick:g,popupSettings:{popupClass:"k-gantt-toolbar"},textField:"title",items:[{title:u,direction:"child"},{title:k,direction:"above"},{title:m,direction:"below"}],text:l}):n.createElement(d.Button,{onClick:b},l)});r.displayName="KendoReactGanttAddButton";exports.AddButton=r;