@progress/kendo-react-gantt 7.2.4-develop.3 → 7.2.4-develop.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Gantt.js +8 -0
- package/Gantt.mjs +411 -0
- package/cells/FilterCells/GanttBooleanFilter.js +8 -0
- package/cells/FilterCells/GanttBooleanFilter.mjs +27 -0
- package/cells/FilterCells/GanttDateFilter.js +8 -0
- package/cells/FilterCells/GanttDateFilter.mjs +27 -0
- package/cells/FilterCells/GanttNumericFilter.js +8 -0
- package/cells/FilterCells/GanttNumericFilter.mjs +27 -0
- package/cells/FilterCells/GanttTextFilter.js +8 -0
- package/cells/FilterCells/GanttTextFilter.mjs +27 -0
- package/cells/FilterCells/utils.js +8 -0
- package/cells/FilterCells/utils.mjs +59 -0
- package/components/BaseView.js +8 -0
- package/components/BaseView.mjs +239 -0
- package/components/GanttDependency.js +8 -0
- package/components/GanttDependency.mjs +58 -0
- package/components/GanttTask.js +8 -0
- package/components/GanttTask.mjs +169 -0
- package/components/GanttTreelist.js +8 -0
- package/components/GanttTreelist.mjs +571 -0
- package/components/toolbar/AddButton.js +8 -0
- package/components/toolbar/AddButton.mjs +56 -0
- package/components/toolbar/Toolbar.js +8 -0
- package/components/toolbar/Toolbar.mjs +34 -0
- package/components/toolbar/view-selector/ViewSelector.js +8 -0
- package/components/toolbar/view-selector/ViewSelector.mjs +32 -0
- package/components/toolbar/view-selector/ViewSelectorItem.js +8 -0
- package/components/toolbar/view-selector/ViewSelectorItem.mjs +39 -0
- package/components/toolbar/view-selector/ViewSelectorList.js +8 -0
- package/components/toolbar/view-selector/ViewSelectorList.mjs +36 -0
- package/constants/index.js +8 -0
- package/constants/index.mjs +52 -0
- package/context/GanttContext.js +8 -0
- package/context/GanttContext.mjs +103 -0
- package/context/GanttViewContext.js +8 -0
- package/context/GanttViewContext.mjs +38 -0
- package/dist/cdn/js/kendo-react-gantt.js +8 -5
- package/editors/FormDateTimePicker.js +8 -0
- package/editors/FormDateTimePicker.mjs +29 -0
- package/editors/FormDropDownList.js +8 -0
- package/editors/FormDropDownList.mjs +62 -0
- package/editors/FormInput.js +8 -0
- package/editors/FormInput.mjs +29 -0
- package/editors/FormNumericTextBox.js +8 -0
- package/editors/FormNumericTextBox.mjs +30 -0
- package/editors/GanttEditor.js +8 -0
- package/editors/GanttEditor.mjs +260 -0
- package/editors/GanttEditorPredecessors.js +8 -0
- package/editors/GanttEditorPredecessors.mjs +121 -0
- package/editors/GanttEditorSuccessors.js +8 -0
- package/editors/GanttEditorSuccessors.mjs +121 -0
- package/editors/GanttForm.js +8 -0
- package/editors/GanttForm.mjs +113 -0
- package/editors/GanttRemoveDialog.js +8 -0
- package/editors/GanttRemoveDialog.mjs +49 -0
- package/hooks/useControlledState.js +8 -0
- package/hooks/useControlledState.mjs +21 -0
- package/hooks/useDictionaryStore.js +8 -0
- package/hooks/useDictionaryStore.mjs +30 -0
- package/hooks/useGanttTask.js +8 -0
- package/hooks/useGanttTask.mjs +35 -0
- package/index.d.mts +1394 -5
- package/index.d.ts +1394 -32
- package/index.js +8 -5
- package/index.mjs +50 -3087
- package/interfaces/DependencyType.js +8 -0
- package/interfaces/DependencyType.mjs +12 -0
- package/messages/index.js +8 -0
- package/messages/index.mjs +137 -0
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +19 -0
- package/package.json +12 -12
- package/rows/GanttRow.js +8 -0
- package/rows/GanttRow.mjs +13 -0
- package/utils/data-operations.js +8 -0
- package/utils/data-operations.mjs +183 -0
- package/utils/index.js +8 -0
- package/utils/index.mjs +263 -0
- package/views/GanttDayView.js +8 -0
- package/views/GanttDayView.mjs +94 -0
- package/views/GanttMonthView.js +8 -0
- package/views/GanttMonthView.mjs +82 -0
- package/views/GanttWeekView.js +8 -0
- package/views/GanttWeekView.mjs +81 -0
- package/views/GanttYearView.js +8 -0
- package/views/GanttYearView.mjs +73 -0
- package/Gantt.d.ts +0 -29
- package/cells/FilterCells/GanttBooleanFilter.d.ts +0 -14
- package/cells/FilterCells/GanttDateFilter.d.ts +0 -14
- package/cells/FilterCells/GanttNumericFilter.d.ts +0 -14
- package/cells/FilterCells/GanttTextFilter.d.ts +0 -14
- package/cells/FilterCells/utils.d.ts +0 -42
- package/components/BaseView.d.ts +0 -24
- package/components/GanttDependency.d.ts +0 -13
- package/components/GanttTask.d.ts +0 -16
- package/components/GanttTreelist.d.ts +0 -143
- package/components/toolbar/AddButton.d.ts +0 -16
- package/components/toolbar/Toolbar.d.ts +0 -25
- package/components/toolbar/view-selector/ViewSelector.d.ts +0 -28
- package/components/toolbar/view-selector/ViewSelectorItem.d.ts +0 -15
- package/components/toolbar/view-selector/ViewSelectorList.d.ts +0 -7
- package/constants/index.d.ts +0 -57
- package/context/GanttContext.d.ts +0 -125
- package/context/GanttViewContext.d.ts +0 -44
- package/editors/FormDateTimePicker.d.ts +0 -9
- package/editors/FormDropDownList.d.ts +0 -9
- package/editors/FormInput.d.ts +0 -9
- package/editors/FormNumericTextBox.d.ts +0 -9
- package/editors/GanttEditor.d.ts +0 -21
- package/editors/GanttEditorPredecessors.d.ts +0 -25
- package/editors/GanttEditorSuccessors.d.ts +0 -25
- package/editors/GanttForm.d.ts +0 -70
- package/editors/GanttRemoveDialog.d.ts +0 -48
- package/hooks/useControlledState.d.ts +0 -8
- package/hooks/useDictionaryStore.d.ts +0 -22
- package/hooks/useGanttTask.d.ts +0 -8
- package/interfaces/AddDirection.d.ts +0 -10
- package/interfaces/DataItem.d.ts +0 -10
- package/interfaces/DateRange.d.ts +0 -12
- package/interfaces/DependencyModelFields.d.ts +0 -29
- package/interfaces/DependencyType.d.ts +0 -19
- package/interfaces/GanttBaseProps.d.ts +0 -66
- package/interfaces/GanttCellProps.d.ts +0 -45
- package/interfaces/GanttColumnProps.d.ts +0 -40
- package/interfaces/GanttDependency.d.ts +0 -30
- package/interfaces/GanttDependencyModelFields.d.ts +0 -29
- package/interfaces/GanttFilterCellProps.d.ts +0 -10
- package/interfaces/GanttFilterOperator.d.ts +0 -10
- package/interfaces/GanttHeaderCellProps.d.ts +0 -10
- package/interfaces/GanttNoRecordsProps.d.ts +0 -13
- package/interfaces/GanttProps.d.ts +0 -151
- package/interfaces/GanttRowProps.d.ts +0 -95
- package/interfaces/GanttSelectableSettings.d.ts +0 -22
- package/interfaces/GanttSlotType.d.ts +0 -8
- package/interfaces/GanttSortSettings.d.ts +0 -17
- package/interfaces/GanttTaskModelFields.d.ts +0 -64
- package/interfaces/GanttView.d.ts +0 -80
- package/interfaces/GanttViewTimelineHeaderCellProps.d.ts +0 -23
- package/interfaces/Rectangle.d.ts +0 -10
- package/interfaces/Slot.d.ts +0 -16
- package/interfaces/TaskModelFields.d.ts +0 -20
- package/interfaces/events.d.ts +0 -298
- package/messages/index.d.ts +0 -194
- package/package-metadata.d.ts +0 -9
- package/rows/GanttRow.d.ts +0 -8
- package/utils/data-operations.d.ts +0 -47
- package/utils/index.d.ts +0 -182
- package/views/GanttDayView.d.ts +0 -21
- package/views/GanttMonthView.d.ts +0 -17
- package/views/GanttWeekView.d.ts +0 -17
- package/views/GanttYearView.d.ts +0 -17
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
(function(b,Fe){typeof exports=="object"&&typeof module!="undefined"?Fe(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-date-math"),require("@progress/kendo-react-data-tools"),require("@progress/kendo-react-treelist"),require("@progress/kendo-react-intl"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-buttons"),require("react-dom"),require("@progress/kendo-react-form"),require("@progress/kendo-react-dialogs"),require("@progress/kendo-react-labels"),require("@progress/kendo-react-inputs"),require("@progress/kendo-react-layout"),require("@progress/kendo-react-dateinputs"),require("@progress/kendo-react-dropdowns"),require("@progress/kendo-react-grid"),require("@progress/kendo-data-query")):typeof define=="function"&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-date-math","@progress/kendo-react-data-tools","@progress/kendo-react-treelist","@progress/kendo-react-intl","@progress/kendo-svg-icons","@progress/kendo-react-buttons","react-dom","@progress/kendo-react-form","@progress/kendo-react-dialogs","@progress/kendo-react-labels","@progress/kendo-react-inputs","@progress/kendo-react-layout","@progress/kendo-react-dateinputs","@progress/kendo-react-dropdowns","@progress/kendo-react-grid","@progress/kendo-data-query"],Fe):(b=typeof globalThis!="undefined"?globalThis:b||self,Fe(b.KendoReactGantt={},b.React,b.PropTypes,b.KendoReactCommon,b.KendoDateMath,b.KendoReactDataTools,b.KendoReactTreelist,b.KendoReactIntl,b.KendoSvgIcons,b.KendoReactButtons,b.ReactDOM,b.KendoReactForm,b.KendoReactDialogs,b.KendoReactLabels,b.KendoReactInputs,b.KendoReactLayout,b.KendoReactDateinputs,b.KendoReactDropdowns,b.KendoReactGrid,b.KendoDataQuery))})(this,function(b,Fe,u,f,v,x,he,J,Ce,te,ba,ne,Ke,de,Yt,Be,ya,X,pe,$e){"use strict";"use client";function Zt(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const l=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(a,n,l.get?l:{enumerable:!0,get:()=>e[n]})}}return a.default=e,Object.freeze(a)}const t=Zt(Fe),Xt=Zt(ba),Ia=x.TABLE_ROW_INDEX_ATTRIBUTE,ka=x.TABLE_COL_INDEX_ATTRIBUTE,xa=x.TABLE_PREVENT_SELECTION_ELEMENT,jt=new Date().getTime(),Jt=7,Ta="hh:mm a",lt={skeleton:"MEd"},Na="MMM",Fa="yyyy",Me=100,Ma=6,qe="data-dependency-drag-handle",La="start",Ra="finish",Qt={[qe]:La},Pt={[qe]:Ra},Ue="data-task-id",en={id:"id",start:"start",end:"end",title:"title",percentComplete:"percentComplete",parentId:"parentId",isRollup:"isRollup",isExpanded:"isExpanded",isInEdit:"isInEdit",children:"children",isSelected:"isSelected"},tn={id:"id",fromId:"fromId",toId:"toId",type:"type"},Va=x.orderBy,Aa=x.filterBy,Le=f.mapTree,za=f.extendDataItem,Ha=he.createDataTree,Ga=e=>({fields:{...en,...e}}),Oa=e=>({fields:{...tn,...e}}),nn=e=>v.getDate(e),st=(e,a)=>v.getDate(v.addDays(e,a||1)),Wa=(e,a,n,l)=>n<a&&e<=l;function Ee(e){return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))}const fe=4,ot=10,_a=(e,a,n,l)=>{const s=[];let r=0,o=0;const i=ot,m=Math.floor(n/2),d=e.top<a.top,g=()=>s.push({left:o,top:r});if(l===0||l===3){const c=l===3?"start":"end";r=e.top,o=e[c],g(),o=Math[c==="start"?"min":"max"](e[c],a[c]),o=c==="start"?o-i:o+i,g(),r=a.top,g(),o=c==="start"?a[c]-fe:a[c]+fe,g(),an(r,o,s,c!=="start")}else{const c=l===2?"start":"end",h=l===2?"end":"start",D=l===2?e[c]-ot*2>=a[h]:e[c]+ot*2<=a[h];r=e.top,o=e[c],g(),o=c==="start"?o-i:o+i,g(),D||(r=d?r+m:r-m,g(),o=c==="start"?a[h]+i:a[h]-i,g()),r=a.top,g(),o=h==="start"?a[h]-fe:a[h]+fe,g(),an(r,o,s,h!=="start")}return s},an=(e,a,n,l)=>l?Ka(e,a,n):Ba(e,a,n),Ka=(e,a,n)=>{n.push({top:e-fe/2,left:a}),n.push({top:e,left:a-fe+1}),n.push({top:e+fe/2,left:a}),n.push({top:e,left:a})},Ba=(e,a,n)=>{n.push({top:e+fe/2,left:a}),n.push({top:e,left:a+fe-1}),n.push({top:e-fe/2,left:a}),n.push({top:e,left:a})},rn=e=>{if(e.workWeekStart===void 0||e.workWeekEnd===void 0)return[];const a=[];let n=e.workWeekStart;for(a.push(n);e.workWeekEnd!==n;)n>6?n-=7:n++,a.push(n);return a},$a=(e,a)=>{const n=e.getDay();return a.indexOf(n)>-1},ln=(e,{step:a,timezone:n})=>{const l=[],s=v.ZonedDate.fromLocalDate(e.start,n),r=v.ZonedDate.fromLocalDate(e.end,n);let o=s.clone();for(;o.getTime()<r.getTime();){const i=o.clone(),m=i.clone().addTime(a),d=new Date(i.getTime()),c={end:new Date(m.getTime()),start:d,zonedStart:i,zonedEnd:m};l.push(c),o=o.addTime(a)}return l},qa=(e,{timezone:a},n)=>{const l=[],s=v.ZonedDate.fromLocalDate(e.start,a),r=v.ZonedDate.fromLocalDate(e.end,a);for(let o=s.clone(),i=0;o.getTime()<r.getTime();i++){const m=o.clone(),d=st(v.firstDayInWeek(v.getDate(m),n.firstDay()),Jt),g=v.ZonedDate.fromUTCDate(Ee(d),a),c=g.getTime()>r.getTime()?r.clone():g;o=c.clone();const h=new Date(m.getTime()),C={end:new Date(c.getTime()),start:h,zonedStart:m,zonedEnd:c};l.push(C)}return l},Ua=(e,{timezone:a})=>{const n=[],l=v.ZonedDate.fromLocalDate(e.start,a),s=v.ZonedDate.fromLocalDate(e.end,a);for(let r=l.clone(),o=0;r.getTime()<s.getTime();o++){const i=r.clone(),m=v.ZonedDate.fromLocalDate(v.addMonths(new Date(i.getTime()),1),a);r=m.clone();const d=new Date(i.getTime()),c={end:new Date(m.getTime()),start:d,zonedStart:i,zonedEnd:m};n.push(c)}return n},Ya=(e,{timezone:a})=>{const n=[],l=v.ZonedDate.fromLocalDate(e.start,a),s=v.ZonedDate.fromLocalDate(e.end,a);for(let r=l.clone(),o=0;r.getTime()<s.getTime();o++){const i=r.clone(),m=v.ZonedDate.fromLocalDate(v.addMonths(new Date(i.getTime()),12),a);r=m.clone();const d=new Date(i.getTime()),c={end:new Date(m.getTime()),start:d,zonedStart:i,zonedEnd:m};n.push(c)}return n},Za=(e,a,n)=>{const l=n.parseDate(a.workDayStart).getHours(),s=n.parseDate(a.workDayEnd).getHours();return ln(e,{step:v.MS_PER_MINUTE*a.slotDuration,timezone:a.timezone}).map(o=>{const i=o.zonedStart.getHours();return{range:o,isWork:i>=l&&i<s,span:1,text:n.formatDate(o.zonedStart,Ta),type:"time"}})},sn=(e,a,n)=>ln(e,{step:v.MS_PER_DAY,timezone:a.timezone}).map(s=>({range:s,isWork:$a(s.start,a.workDays),span:1,text:n.formatDate(s.zonedStart,lt),type:"day"})),on=(e,a,n)=>qa(e,{timezone:a.timezone},n).map(s=>{const r=Math.round((s.zonedEnd.getTime()-s.zonedStart.getTime())/v.MS_PER_DAY);return{range:s,isWork:!1,span:r,text:`${n.formatDate(s.zonedStart,lt)} - ${n.formatDate(s.zonedEnd,lt)}`,type:"week"}}),cn=(e,a,n)=>Ua(e,{timezone:a.timezone}).map(s=>{const r=Math.round((s.zonedEnd.getTime()-s.zonedStart.getTime())/v.MS_PER_DAY);return{range:s,isWork:!1,span:r,text:n.formatDate(s.zonedStart,Na),type:"month"}}),Xa=(e,a,n)=>Ya(e,{timezone:a.timezone}).map(s=>{const r=Math.round((s.zonedEnd.getTime()-s.zonedStart.getTime())/v.MS_PER_DAY);return{range:s,isWork:!1,span:r,text:n.formatDate(s.zonedStart,Fa),type:"year"}}),ja=(e,a,n)=>{const l=n;return t.createElement("table",{className:"k-table k-table-md",ref:a,"aria-hidden":!0},t.createElement("tbody",{className:"k-table-tbody"},e.map((s,r)=>t.createElement("tr",{className:"k-table-row",key:r},s.map((o,i)=>t.createElement("td",{key:o.range.start.getTime(),colSpan:o.span,className:f.classNames("k-table-th",{"k-header":!0,"k-nonwork-hour":!o.isWork})},l?t.createElement(l,{rowIndex:r,index:i,range:o.range,text:o.text,isWork:o.isWork,type:o.type}):o.text))))))},Ja=(e,a)=>{const n=e[e.length-1];return t.createElement("table",{className:"k-table k-table-md k-gantt-columns",ref:a,"aria-hidden":!0},t.createElement("tbody",{className:"k-table-tbody"},t.createElement("tr",{className:"k-table-row"},n.map(l=>t.createElement("td",{key:l.range.start.getTime(),colSpan:l.span,className:f.classNames("k-table-td",{"k-nonwork-hour":!l.isWork})})))))},Qa=(e,a)=>{const n=e[e.length-1];let l=0,s=0;return n.forEach(r=>{const o=r.span;s+=o,o>l&&(l=o)}),Math.round(s*a/l)},it=(e,a)=>!!f.getter(a)(e),dn=(e,a)=>!!f.getter(a)(e),Pa=(e,a)=>n=>it(n,e)&&dn(n,a)?[...f.getter(a)(n)]:[],ct=t.createContext([]),er=()=>t.useContext(ct);ct.displayName="KendoReactGanttTaskDataContext";const dt=t.createContext([]),tr=()=>t.useContext(dt);dt.displayName="KendoReactGanttDependencyDataContext";const ut=t.createContext(en),gt=()=>t.useContext(ut);ut.displayName="KendoReactGanttTaskModelFieldsContext";const mt=t.createContext(tn),un=()=>t.useContext(mt);mt.displayName="KendoReactGanttDependencyModelFieldsContext";const ft=t.createContext({}),Re=()=>t.useContext(ft);ft.displayName="KendoReactGanttPropsContext";const ht=t.createContext({start:new Date,end:new Date,zonedStart:v.ZonedDate.fromLocalDate(new Date),zonedEnd:v.ZonedDate.fromLocalDate(new Date)}),Ve=()=>t.useContext(ht);ht.displayName="KendoReactGanttDateRangeContext";const Ct=t.createContext([]),nr=()=>t.useContext(Ct);Ct.displayName="KendoReactGanttViewsContext";const Et=t.createContext(["week",f.noop]),gn=()=>t.useContext(Et);Et.displayName="KendoReactGanttActiveViewContext";const Dt=t.createContext(0),mn=()=>t.useContext(Dt);Dt.displayName="KendoReactGanttRowHeightContext";const pt=t.createContext(0),ar=()=>t.useContext(pt);pt.displayName="KendoReactGanttToolbarHeightContext";const vt=t.createContext({onDataStateChange:f.noop,onSortChange:f.noop,onFilterChange:f.noop,onColumnMenuFilterChange:f.noop,onExpandChange:f.noop,onRowClick:f.noop,onRowDoubleClick:f.noop,onRowContextMenu:f.noop,onColumnResize:f.noop,onColumnReorder:f.noop,onDependencyCreate:f.noop,onKeyDown:f.noop,onSelectionChange:f.noop,onHeaderSelectionChange:f.noop}),rr=()=>t.useContext(vt);vt.displayName="KendoReactGanttEventsContext";const wt=t.createContext({onTaskClick:f.noop,onTaskDoubleClick:f.noop,onTaskContextMenu:f.noop}),lr=()=>t.useContext(wt);wt.displayName="KendoReactGanttTaskEventsContext";const fn=({children:e,taskData:a,dependencyData:n,taskModelFields:l,dependencyModelFields:s,props:r,dateRange:o,views:i,activeView:m,rowHeight:d,toolbarHeight:g,events:c,taskEvents:h})=>t.createElement(ft.Provider,{value:r},t.createElement(ct.Provider,{value:a},t.createElement(dt.Provider,{value:n},t.createElement(ut.Provider,{value:l},t.createElement(mt.Provider,{value:s},t.createElement(ht.Provider,{value:o},t.createElement(Ct.Provider,{value:i},t.createElement(Et.Provider,{value:m},t.createElement(Dt.Provider,{value:d},t.createElement(pt.Provider,{value:g},t.createElement(vt.Provider,{value:c},t.createElement(wt.Provider,{value:h},e))))))))))));fn.displayName="KendoReactGanttContext";const St=t.createContext([{current:{}},f.noop]),hn=()=>t.useContext(St);St.displayName="KendoReactGanttViewContext";const bt=t.createContext(0),sr=()=>t.useContext(bt);bt.displayName="KendoReactGanttViewTimelineWidthContext";const yt=t.createContext({onDependencyHandlePress:f.noop,onDependencyHandleDrag:f.noop,onDependencyHandleRelease:f.noop,isEnabled:!1,draggedId:null}),or=()=>t.useContext(yt);yt.displayName="KendoReactGanttViewDependencyDragContext";const Cn=({children:e,tasksStore:a,timelineWidth:n,dependencyDrag:l})=>t.createElement(St.Provider,{value:a},t.createElement(bt.Provider,{value:n},t.createElement(yt.Provider,{value:l},e)));Cn.displayName="KendoReactGanttViewContext";var It=(e=>(e[e.add=0]="add",e[e.remove=1]="remove",e))(It||{});const ir=()=>{const e=t.useRef({}),a=t.useCallback(n=>{switch(n.type){case 0:e.current[n.id]=n.itemRef;break;case 1:delete e.current[n.id];break}},[]);return[e,a]},cr=(e,a,n,l)=>{const s=t.useRef(null),[,r]=hn();t.useImperativeHandle(s,()=>({element:l.current,dataItem:e})),t.useImperativeHandle(n,()=>s.current),f.useIsomorphicLayoutEffect(()=>{const o=s.current;if(o)return r({type:It.add,itemRef:o,id:a}),()=>{r({type:It.remove,itemRef:o,id:a})}})},En=t.forwardRef((e,a)=>{const n=Ve(),l=gt(),s=sr(),r=or(),o=lr(),i=t.useRef(null),m=t.useRef(null);cr(e.dataItem,f.getter(l.id)(e.dataItem),a,i);const d=t.useRef(null),g=f.getter(l.id)(e.dataItem),c=f.getter(l.start)(e.dataItem),h=f.getter(l.end)(e.dataItem),D=f.getter(l.title)(e.dataItem),C=f.getter(l.percentComplete)(e.dataItem),p=f.getter(l.children)(e.dataItem),y=f.getter(l.isSelected)(e.dataItem),R=c&&c.getTime(),z=h&&h.getTime(),L=p&&p.length,_=!L&&R===z,N=R&&z&&Wa(n.start,n.end,c,h),[A,I]=t.useState(!1),k=t.useRef(null),U=t.useRef(null);f.useDraggable(k,{onPress:r.onDependencyHandlePress,onDrag:r.onDependencyHandleDrag,onRelease:r.onDependencyHandleRelease}),f.useDraggable(U,{onPress:r.onDependencyHandlePress,onDrag:r.onDependencyHandleDrag,onRelease:r.onDependencyHandleRelease});const K=t.useCallback(T=>{o.onTaskClick&&o.onTaskClick({dataItem:e.dataItem,level:e.level,nativeEvent:T&&T.nativeEvent,syntheticEvent:T,target:null})},[e.dataItem,e.level]),B=t.useCallback(T=>{o.onTaskDoubleClick&&o.onTaskDoubleClick({dataItem:e.dataItem,level:e.level,nativeEvent:T&&T.nativeEvent,syntheticEvent:T,target:null})},[e.dataItem,e.level]),Q=t.useCallback(T=>{o.onTaskContextMenu&&o.onTaskContextMenu({dataItem:e.dataItem,level:e.level,nativeEvent:T&&T.nativeEvent,syntheticEvent:T,target:null})},[e.dataItem,e.level]),w=t.useCallback(T=>{o.onTaskRemoveClick&&o.onTaskRemoveClick({dataItem:e.dataItem,level:e.level,nativeEvent:T&&T.nativeEvent,syntheticEvent:T,target:null})},[e.dataItem,e.level]),W=t.useCallback(()=>{const T=n.start,ae=n.end,F=d.current,V=i.current,P=m.current;if(!N||F===null||V===null)return;const re=F.clientWidth/(ae.getTime()-T.getTime()),$=(c.getTime()-T.getTime())*re,Z=(h.getTime()-c.getTime())*re,ve=(F.offsetHeight-V.offsetHeight)/2;V.style.left=`${Math.round(_?$-Ma:$)}px`,V.style.top=`${Math.round(ve)}px`,_||(V.style.width=`${Math.round(Z)}px`,P!==null&&(P.style.width=`${Math.round(Z*(C||0))}px`)),I(!0)},[n.start.getTime(),n.end.getTime(),R,z,N,C,s]);t.useEffect(W,[W]);const j={visibility:A?void 0:"hidden",display:N?void 0:"none"},Y={userSelect:"none",display:r.draggedId===String(g)?"block":void 0};return t.createElement("td",{ref:d,key:g,role:"presentation"},_?t.createElement("div",{"aria-hidden":!0,className:f.classNames({"k-task":!0,"k-task-milestone":!0,"k-selected":y&&!Array.isArray(y)}),style:j,ref:i,[Ue]:g,onClick:K,onDoubleClick:B,onContextMenu:Q},t.createElement("div",{className:"k-task-milestone-content"}),r.isEnabled&&t.createElement("div",{className:"k-task-dot k-task-start",ref:k,style:Y,...Qt}),r.isEnabled&&t.createElement("div",{className:"k-task-dot k-task-end",ref:U,style:Y,...Pt})):t.createElement("div",{"aria-hidden":!0,className:f.classNames({"k-task":!0,"k-task-summary":L,"k-task-single":!L,"k-selected":y&&!Array.isArray(y)}),ref:i,style:j,[Ue]:g,onClick:K,onDoubleClick:B,onContextMenu:Q},L?t.createElement("div",{className:"k-task-summary-progress",ref:m},t.createElement("div",{className:"k-task-summary-complete"})):t.createElement("div",{className:"k-task-complete",ref:m}),!L&&t.createElement(t.Fragment,null,t.createElement("div",{className:"k-task-content"},D),o.onTaskRemoveClick?t.createElement("span",{className:"k-task-actions"},t.createElement("span",{onClick:w,className:"k-link k-task-delete","aria-label":"Delete"},t.createElement(f.IconWrap,{name:"x",icon:Ce.xIcon}))):null),r.isEnabled&&t.createElement("div",{className:"k-task-dot k-task-start",ref:k,style:Y,...Qt}),r.isEnabled&&t.createElement("div",{className:"k-task-dot k-task-end",ref:U,style:Y,...Pt})))});En.displayName="KendoReactGanttTask";const Dn=e=>{const{dependency:a}=e,[n]=hn(),l=t.useRef(null),s=un(),r=mn(),[o,i]=t.useState(!1),m=()=>{if(l.current===null||n.current===null){i(!1);return}const d=n.current[f.getter(s.fromId)(a)],g=n.current[f.getter(s.toId)(a)];if(!d||!g){i(!1);return}const c=d.element,h=g.element;if(!c||!h){i(!1);return}if(o===!1){i(!0);return}const D={top:c.offsetTop+c.offsetHeight/2,start:c.offsetLeft,end:c.offsetLeft+c.offsetWidth},C={top:h.offsetTop+h.offsetHeight/2,start:h.offsetLeft,end:h.offsetLeft+h.offsetWidth},p=f.getter(s.type)(a),y=_a(D,C,r,p);y&&y.length&&l.current.setAttribute("points",y.map(R=>`${R.left},${R.top}`).join(" "))};return t.useEffect(m),t.createElement("polyline",{ref:l,style:{display:o?void 0:"none"}})};Dn.displayName="KendoReactGanttDependency";class kt extends t.Component{constructor(a){super(a),this.state={activeId:void 0,level:0},this.tableElement=null,this.tbodyElement=null,this.wrapperScrollLeft=0,this.wrapperScrollTop=0,this.updateOnScroll=!1,this.tbodyOffsetTop=0,this.prevData=[],this.flattedData=[],this.element=null,this.contextStateRef={current:void 0},this.navigationStateRef={current:void 0},this.scrollIntoView=n=>{if(!this.element)return;const{rowIndex:l=0}=n,{rowHeight:s=0}=this.props;this.element.scroll(0,(l-1)*s)},this.getColumns=n=>{const l=n.filter(r=>r.declarationIndex>=0&&r.parentIndex===-1),s=r=>(r.sort((o,i)=>o.declarationIndex-i.declarationIndex),r.map(o=>{const{declarationIndex:i,parentIndex:m,depth:d,colSpan:g,rowSpan:c,index:h,kFirst:D,groupable:C,children:p,...y}=o;return p.length?{children:s(p),...y}:y}));return s(l)},this.onKeyDown=n=>{if(x.tableKeyboardNavigation.onKeyDown(n,{contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef}),this.props.onKeyDown){const{mode:l,cell:s}=x.getSelectionOptions(this.props.selectable),r={dataItems:this.getLeafDataItems(),mode:l,cell:s,componentId:this.props.treelistId,selectedField:this.props.selectedField,...this.getEventArguments(n)};this.props.onKeyDown.call(void 0,r)}},this.onFocus=n=>{x.tableKeyboardNavigation.onFocus(n,{contextStateRef:this.contextStateRef})},this.onRowDrag=n=>{if(this.props.onRowDrag){const l={...n,target:this};this.props.onRowDrag.call(void 0,l)}},this.onRowDrop=n=>{if(this.props.onRowDrop){const l={...n,target:this};this.props.onRowDrop.call(void 0,l)}},this.onColumnReorder=(n,l,s)=>{const{extendedColumns:r}=this.props,o=r[n].depth,i=g=>{do g++;while(g<r.length&&r[g].depth>o);return g},m=[...r],d=m.splice(n,i(n)-n);if(m.splice(n<l?i(l-d.length):l,0,...d),m.filter(g=>g.declarationIndex>=0).forEach((g,c)=>g.orderIndex=c),this.props.onColumnReorder){const g={target:this,columns:this.getColumns(m),nativeEvent:s};this.props.onColumnReorder.call(void 0,g)}},this.onColumnResize=(n,l,s,r,o)=>{if(this.props.onColumnResize){const i=this.props.extendedColumns.filter(d=>d.children.length===0).reduce((d,g)=>d+=parseFloat(String(g.width)),0);this.tableElement&&(this.tableElement.style.width=i+"px");const m={columns:this.getColumns(this.props.extendedColumns),totalWidth:i,index:n,nativeEvent:r,newWidth:l,oldWidth:s,end:o,target:this};this.props.onColumnResize.call(void 0,m)}},this.onScroll=n=>{const l=n.currentTarget.scrollLeft,s=n.currentTarget.scrollTop,{columnVirtualization:r,scrollable:o,rowHeight:i=0}=this.props,m=i,d=0;let g=!1;r&&Math.abs(this.wrapperScrollLeft-l)>d&&(this.wrapperScrollLeft=l,g=!0),o==="virtual"&&Math.abs(this.wrapperScrollTop-s)>m&&(this.wrapperScrollTop=s,g=!0),g&&(this.updateOnScroll=!0,this.forceUpdate())},this.calculateSizes=n=>{if(!n||this.props.scrollable==="none")return;const l=Array.from(n.childNodes),s=l.find(i=>i.nodeName==="TABLE"),r=this.props.toolbar&&l.find(i=>i.nodeType===1&&i.classList.contains("k-grid-toolbar"));let o=0;if(r){const i=r.style.boxSizing;r.style.boxSizing="border-box",o=parseFloat(String(window.getComputedStyle(r).height))||r.offsetHeight,r.style.boxSizing=i,r.getAttribute("style")||r.removeAttribute("style")}this.tbodyOffsetTop=s.tBodies[0].offsetTop,he.setHeaderRowsTop(s,o)},this.onItemChange=n=>{if(n.field===this.props.expandField){const l=this.props.onExpandChange;if(l){const s={...this.getEventArguments(n.syntheticEvent),dataItem:n.dataItem,level:n.level,value:n.value};l.call(void 0,s)}return}if(this.props.onItemChange){const l={...this.getEventArguments(n.syntheticEvent),dataItem:n.dataItem,level:n.level,field:n.field,value:n.value};this.props.onItemChange.call(void 0,l)}},this.onHeaderSelectionChange=n=>{if(this.props.onHeaderSelectionChange){const l={field:n.field,nativeEvent:n.syntheticEvent&&n.syntheticEvent.nativeEvent,syntheticEvent:n.syntheticEvent,target:this,dataItems:this.getLeafDataItems()};this.props.onHeaderSelectionChange.call(void 0,l)}},this.selectionRelease=n=>{if(this.props.onSelectionChange){const l={syntheticEvent:void 0,target:this,selectedField:this.props.selectedField||"",componentId:this.props.treelistId,dataItems:this.getLeafDataItems(),dataItem:null,level:[],...n};this.props.onSelectionChange.call(void 0,l)}},this.onSortChange=(n,l,s)=>{this.onDataStateChange(this.props.onSortChange,{sort:l,field:s},n)},this.onFilterChange=n=>{const{filter:l,field:s}=n;this.onDataStateChange(this.props.onFilterChange,{filter:l,field:s},n.syntheticEvent)},this.onColumnMenuFilterChange=(n,l,s)=>{if(!s)return;const{onColumnMenuFilterChange:r}=this.props;if(!r)return;const o={syntheticEvent:n,filter:l,field:s,target:this,nativeEvent:n.nativeEvent};r.call(void 0,o)},this.onExpandChange=(n,l,s)=>{const{expandField:r,onExpandChange:o}=this.props;if(r&&o){const i={...this.getEventArguments(n),dataItem:l,level:s,value:it(l,this.props.expandField)};o.call(void 0,i)}},this.onRowClick=(n,l)=>{if(this.props.onRowClick&&n.target.nodeName==="TD"){const s={dataItem:l.dataItem,level:l.level,...this.getEventArguments(n)};this.props.onRowClick.call(void 0,s)}},this.rowDoubleClick=(n,l)=>{if(this.props.onRowDoubleClick&&n.target.nodeName==="TD"){const s={dataItem:l.dataItem,level:l.level,...this.getEventArguments(n)};this.props.onRowDoubleClick.call(void 0,s)}},this.rowContextMenu=(n,l)=>{if(this.props.onRowContextMenu&&n.target.nodeName==="TD"){const s={dataItem:l.dataItem,level:l.level,...this.getEventArguments(n)};this.props.onRowContextMenu.call(void 0,s)}},this.onPageChange=n=>{if(this.props.onPageChange){const l={...this.getEventArguments(n.syntheticEvent),skip:n.skip,take:n.take};this.props.onPageChange.call(void 0,l)}},this.onDataStateChange=(n,l,s)=>{if(n&&n.call(void 0,{...this.getEventArguments(s),...l}),this.props.onDataStateChange){const r={...this.getEventArguments(s),dataState:{...this.getDataState(),...l}};this.props.onDataStateChange.call(void 0,r)}},this.getDataState=()=>({filter:this.props.filter,sort:this.props.sort}),this.getEventArguments=n=>({nativeEvent:n&&n.nativeEvent,syntheticEvent:n,target:this}),this.getLeafDataItems=()=>this.flatData.map(n=>n.dataItem),this.dragLogic=new x.CommonDragLogic(this.onColumnReorder,f.noop,f.noop),this.columnResize=new x.ColumnResize(this.onColumnResize),x.tableKeyboardNavigation.onConstructor({navigatable:!!a.navigatable,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef,idPrefix:a.idPrefix})}get document(){if(f.canUseDOM)return this.element&&this.element.ownerDocument||document}componentDidMount(){this.calculateSizes(this.element),x.tableKeyboardNavigation.onComponentDidMount({scope:this.element||void 0,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef})}getSnapshotBeforeUpdate(){return x.tableKeyboardNavigation.onGetSnapshotBeforeUpdate({document:this.document,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef}),null}componentDidUpdate(a){a.columns!==this.props.columns&&this.calculateSizes(this.element),x.tableKeyboardNavigation.onComponentDidUpdate({scope:this.element||void 0,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef})}componentWillUnmount(){this.columnResize.columns=[],this.dragLogic.columns=[],this.prevData=[],this.flattedData=[],this.updateOnScroll=!1}render(){const{filterRow:a,scrollable:n="scrollable",resizable:l=!1,reorderable:s=!1,skip:r,take:o,afterContent:i,extendedColumns:m=[],columnsMap:d}=this.props,g=m.some(w=>!!w.filter)||a!==void 0,c=a||x.FilterRow,h=x.tableKeyboardNavigationTools.getIdPrefix(this.navigationStateRef);this.columnResize.columns=m,this.columnResize.resizable=l,this.dragLogic.columns=m,this.dragLogic.reorderable=s,this.dragLogic.groupable=!1;const D=m.filter(w=>w.children.length===0),C=t.createElement(x.Header,{headerRow:t.createElement(x.HeaderRow,{sort:this.props.sort,sortable:this.props.sortable,sortChange:this.onSortChange,selectionChange:this.onHeaderSelectionChange,columns:m,columnsMap:d,cellRender:this.props.headerCellRender,columnResize:this.columnResize,columnMenu:this.props.columnMenu,columnMenuFilter:this.props.columnMenuFilter,columnMenuFilterChange:this.onColumnMenuFilterChange,pressHandler:this.dragLogic.pressHandler,dragHandler:this.dragLogic.dragHandler,releaseHandler:this.dragLogic.releaseHandler}),filterRow:g&&t.createElement(c,{columns:D,filter:this.props.filter,filterChange:this.onFilterChange,sort:this.props.sort,ariaRowIndex:d.length+1})||void 0,columnResize:this.columnResize}),p=this.props.style||{},{colSpans:y,hiddenColumns:R}=x.tableColumnsVirtualization({enabled:this.props.columnVirtualization,columns:D,scrollLeft:this.wrapperScrollLeft,tableViewPortWidth:parseFloat((p.width||"").toString())}),z=(w,W,j,Y,T,ae)=>D.map((F,V)=>{if(R[V])return null;const P=F.id?F.id:V,re=`k-table-td ${F.className?F.className+" ":""}${F.locked?"k-grid-content-sticky":""}`,$={id:x.tableKeyboardNavigationTools.generateNavigatableId(`${j}-${String(V)}`,h),colSpan:y[V],dataItem:w.dataItem,field:F.field,format:F.format,className:re||void 0,render:this.props.cellRender,onChange:this.onItemChange,selectionChange:this.props.onSelectionChange?Z=>{this.onSelectionChange({event:Z,item:w,columnIndex:V,dataIndex:T})}:void 0,level:w.level,expandable:F.expandable,expanded:Y,hasChildren:dn(w.dataItem,this.props.subItemsField),colIndex:V,ariaColumnIndex:F.ariaColumnIndex,onExpandChange:this.onExpandChange,style:F.left!==void 0&&{left:F.left,right:F.right,borderRightWidth:F.rightBorder?"1px":""}||{},isSelected:Array.isArray(ae)&&ae.indexOf(V)>-1};return W&&F.editCell?t.createElement(F.editCell,{...$,onChange:this.onItemChange,key:P}):F.cell?t.createElement(F.cell,{key:P,...$}):t.createElement(he.TreeListCell,{key:P,...$})});let L=this.flatData;const _=L.length;r!==void 0&&o!==void 0&&(L=L.slice(r,r+o)),n==="virtual"&&(L=he.tableRowsVirtualization({rows:L,tableViewPortHeight:parseFloat((p.height||p.maxHeight||"").toString()),scrollTop:this.wrapperScrollTop}),this.updateOnScroll=!1);const N=L.map(w=>w.level),A=d.length+(g?1:0)+1,I=L.length>0&&L.map((w,W)=>{const j=f.getter(this.props.editField||"")(w.dataItem),Y=f.getter(this.props.dataItemKey)(w.dataItem),T=String(Y||w.level.join(".")),ae=it(w.dataItem,this.props.expandField),F=this.props.selectedField?f.getter(this.props.selectedField)(w.dataItem):void 0,V={key:T,level:w.level,levels:N,dataItem:w.dataItem,selectedField:this.props.selectedField,rowHeight:w.height,render:this.props.rowRender,onDrop:this.onRowDrop,onDrag:this.onRowDrag,onClick:Z=>this.onRowClick(Z,w),onDoubleClick:Z=>this.rowDoubleClick(Z,w),onContextMenu:Z=>this.rowContextMenu(Z,w),isAltRow:W%2!==0,expanded:ae,rowIndex:W,ariaRowIndex:A+W,ariaSetSize:w.levelCount,ariaPosInSet:w.level[w.level.length-1]+1,isSelected:typeof F=="boolean"&&F},P=this.props.editRow,re=this.props.row||he.TreeListRow,$=z(w,j,T,ae,W,F);return j&&P?t.createElement(P,{...V,key:V.key},$):t.createElement(re,{...V,key:V.key},$)})||t.createElement("tr",{className:"k-table-row k-grid-norecords"},t.createElement("td",{className:"k-table-td",colSpan:D.length},this.props.noRecords||t.createElement(he.TreeListNoRecords,null))),k=w=>this.props.sort&&this.props.sort.some(W=>W.field===w),U=t.createElement("colgroup",{ref:w=>{this.columnResize.colGroupMain=w}},D.map((w,W)=>t.createElement("col",{key:W.toString(),className:k(w.field)?"k-sorted":void 0,style:w.width!==void 0?{width:w.width}:void 0}))),K=this.props.columnVirtualization||this.props.scrollable==="virtual",B=this.props.selectable&&this.props.selectable.drag?"none":void 0,Q=this.props.tableProps||{};return t.createElement(x.TableKeyboardNavigationContext.Provider,{value:this.contextStateRef.current},t.createElement("div",{id:this.props.treelistId,style:this.props.style,className:f.classNames("k-grid k-grid-md",this.props.className,{"k-treelist-scrollable":n!=="none"}),ref:w=>this.element=w,onScroll:K?this.onScroll:void 0,onKeyDown:this.onKeyDown,onFocus:this.onFocus,"aria-rowcount":_,"aria-colcount":D.length,role:"treegrid",...x.tableKeyboardNavigationScopeAttributes},this.props.toolbar,t.createElement(x.TableSelection,{selectable:this.props.selectable,onRelease:this.selectionRelease,childRef:w=>{this.tableElement=w}},t.createElement("table",{className:"k-table k-table-md",...this.props.tableProps||{},style:{...Q.style||{},userSelect:B},role:"presentation"},U,C,t.createElement("tbody",{className:"k-table-tbody",...x.tableKeyboardNavigationBodyAttributes,ref:w=>this.tbodyElement=w,role:"presentation"},I))),this.props.pager&&t.createElement(this.props.pager,{className:"k-grid-pager",total:_,skip:r,take:o,onPageChange:this.onPageChange}),s&&t.createElement(t.Fragment,null,t.createElement(x.DropClue,{ref:this.dragLogic.refDropElementClue}),t.createElement(x.DragClue,{ref:this.dragLogic.refDragElementClue})),i))}get flatData(){const{data:a=[],rowHeight:n=0}=this.props;let l=0;const s=()=>{const o={height:n,offsetTop:l};return l+=o.height,o},r=this.updateOnScroll&&this.prevData===a&&this.tbodyOffsetTop>0&&this.flattedData.length?this.flattedData:a.map(o=>({...o,...s()}));return this.prevData=a,this.flattedData=r,r}onSelectionChange(a){if(this.props.onSelectionChange){const{event:n,item:l,dataIndex:s,columnIndex:r}=a,{mode:o,cell:i}=x.getSelectionOptions(this.props.selectable),m={...this.getEventArguments(n.syntheticEvent),dataItem:l.dataItem,level:l.level,startColIndex:r,endColIndex:r,startRowIndex:s,endRowIndex:s,dataItems:this.getLeafDataItems(),altKey:!1,ctrlKey:!1,shiftKey:!1,metaKey:!1,mode:o,cell:i,isDrag:!1,componentId:this.props.treelistId,selectedField:this.props.selectedField||""};this.props.onSelectionChange.call(void 0,m)}}}kt.propTypes={data:u.array,resizable:u.bool,reorderable:u.bool,sortable:u.oneOfType([u.bool,u.shape({mode:u.oneOf(["single","multiple"]),allowUnsort:u.bool})]),onSortChange:u.func,sort:u.array,columns:u.arrayOf(u.object),columnVirtualization:u.bool,filter:u.array,onFilterChange:u.func,filterRow:u.any,toolbar:u.any,noRecords:u.any,onExpandChange:u.func,expandField:u.string,subItemsField:u.string,selectedField:u.string,onSelectionChange:u.func,onHeaderSelectionChange:u.func,onRowClick:u.func,onItemChange:u.func,editField:u.string,scrollable:u.oneOf(["none","scrollable","virtual"]),rowHeight:u.number,style:u.object,tableProps:u.object,pager:u.any,skip:u.number,take:u.number,onPageChange:u.func,onDataStateChange:u.func,onColumnResize:u.func,onColumnReorder:u.func,extendedColumns:u.arrayOf(u.object),columnsMap:u.arrayOf(u.array),dataItemKey:u.string.isRequired,afterContent:u.any,navigatable:u.bool,idPrefix:u.string,treelistId:u.string},kt.contextType=x.TableKeyboardNavigationContext;const Ae=t.forwardRef((e,a)=>{const{slotLevels:n,slotWidth:l,timelineHeaderCell:s}=e,{columns:r,noRecords:o,resizable:i,reorderable:m,sortable:d,sort:g,filter:c,columnMenuFilter:h,columnMenu:D,navigatable:C,row:p,selectable:y}=Re(),{onDataStateChange:R,onSortChange:z,onFilterChange:L,onColumnMenuFilterChange:_,onExpandChange:N,onRowClick:A,onRowDoubleClick:I,onRowContextMenu:k,onColumnResize:U,onColumnReorder:K,onDependencyCreate:B,onKeyDown:Q,onSelectionChange:w,onHeaderSelectionChange:W}=rr(),j=mn(),Y=ar(),T=gt(),ae=un(),F=er(),V=tr(),P=t.useRef(null),re=t.useRef(null),$=t.useRef(null),Z=t.useRef(null),ve=t.useRef(0),we=t.useRef(f.useId()),O=t.useRef(f.useId()),ie=t.useRef(null),xe=t.useRef(null),Ge=t.useCallback(M=>{$.current&&$.current.scrollIntoView(M)},[]);t.useImperativeHandle(xe,()=>({scrollIntoView:Ge})),t.useImperativeHandle(a,()=>xe.current);const Se=t.useRef(0),E=t.useRef(0),H=t.useRef(0),q=t.useRef(0),me=t.useRef(null),be=t.useRef(null),[ue,Oe]=t.useState(null),Ot=ja(n,P,s),Wt=Ja(n,re),Te=Qa(n,l),{extendedColumns:_t,columnsWidth:Kt,columnsMap:Bt}=t.useMemo(()=>{const M=x.readColumns([...r,{title:"",sortable:!1,resizable:!1,reorderable:!1,width:Te,headerCell:()=>Ot,cell:En,orderIndex:Number.MAX_SAFE_INTEGER,navigatable:!1}],{prevId:0,idPrefix:we.current});let ee=0;return M.forEach((G,le,ce)=>{const se=le+1===ce.length,Ie=G.children.length===0;se?G.isAccessible=!1:(G.locked=!0,Ie&&(G.width=G.width||Me)),Ie&&(ee+=parseFloat(String(G.width)))}),{extendedColumns:M,columnsWidth:ee,columnsMap:x.mapColumns(M)}},[r,Te]),[$t,qt]=ir(),S=t.useCallback(()=>P.current&&P.current.parentElement,[]),De=()=>{const M=S(),ee=re.current,G=$.current&&$.current.tbodyElement;if(!M||!ee||!G)return;const le=G.offsetTop,ce=M.offsetLeft,se=Te;ee.style.top=le+"px",ee.style.left=ce+"px",ee.style.width=se+"px",ee.style.height=G.offsetHeight+"px"},ye=()=>{const M=S();M&&(ve.current=M.offsetLeft)};t.useEffect(De),t.useEffect(ye);const We=t.useCallback(M=>{if(!Z.current)return;const ee=M.columns.slice(0,M.columns.length-1);if(M.end)Z.current.style.left="0px";else{const G=S();if(!G)return;Z.current.style.left=G.offsetLeft-ve.current+"px",De()}U({...M,columns:ee})},[U]),_e=t.useCallback(M=>{const ee=M.columns.slice(0,M.columns.length-1);K({...M,columns:ee})},[U]),Ut=t.useCallback(M=>{const G=(ie.current&&ie.current.ownerDocument?ie.current.ownerDocument:document).elementFromPoint(M.clientX,M.clientY),le=ie.current;if(!G||!G.parentElement||!le)return;const ce=le.parentElement,se=le.firstElementChild;if(!ce||!se)return;const Ie=G.getAttribute(qe);if(Ie){const Wr=le.offsetTop,_r=le.offsetLeft,Kr=ce.offsetTop,Br=ce.offsetLeft,$r=se.scrollTop,qr=se.scrollLeft;H.current=_r+Br,q.current=Wr+Kr,Se.current=M.clientX-H.current+qr,E.current=M.clientY-q.current+$r,me.current=G.parentElement.getAttribute(Ue),be.current=Ie}},[]),Ne=t.useCallback(M=>{const ee=ie.current;if(!ee)return;const G=ee.firstElementChild;if(!G)return;const le=G.scrollTop,ce=G.scrollLeft,se=M.clientX-H.current+ce,Ie=M.clientY-q.current+le;Math.abs(Se.current-se)<10&&Math.abs(E.current-Ie)<10||Oe({startX:Se.current,startY:E.current,endX:se,endY:Ie})},[]),Or=t.useCallback(M=>{const G=(ie.current&&ie.current.ownerDocument?ie.current.ownerDocument:document).elementFromPoint(M.clientX,M.clientY);if(!G||!G.parentElement)return;const le=G.parentElement.getAttribute(Ue),ce=G.getAttribute(qe);if(ce&&le!==me.current&&B){let se;be.current==="start"?se=ce==="start"?3:2:se=ce==="start"?1:0,B({fromId:me.current,toId:le,type:se})}Se.current=0,E.current=0,H.current=0,q.current=0,me.current=null,be.current=null,Oe(null)},[B,Oe]);return t.createElement(Cn,{tasksStore:[$t,qt],timelineWidth:Te,dependencyDrag:{isEnabled:!!B,draggedId:me.current,onDependencyHandlePress:Ut,onDependencyHandleDrag:Ne,onDependencyHandleRelease:Or}},t.createElement("div",{className:"k-gantt-content",ref:ie,style:{height:`calc(100% - ${Y}px)`}},t.createElement(kt,{treelistId:O.current,ref:$,extendedColumns:_t,columnsMap:Bt,dataItemKey:T.id,data:F,idPrefix:we.current,navigatable:C,expandField:T.isExpanded,subItemsField:T.children,editField:T.isInEdit,selectedField:T.isSelected,onDataStateChange:R,onSortChange:z,onFilterChange:L,onExpandChange:N,onRowClick:A,onRowDoubleClick:I,onRowContextMenu:k,onColumnResize:We,onColumnReorder:_e,onColumnMenuFilterChange:_,onKeyDown:Q,onSelectionChange:w,onHeaderSelectionChange:W,tableProps:{style:{width:Kt},className:"k-table k-table-md k-table-layout-fixed"},noRecords:o,rowHeight:j,resizable:i,reorderable:m,sortable:d,sort:g,filter:c,columnMenuFilter:h,columnMenu:D,row:p,selectable:y,afterContent:t.createElement(t.Fragment,null,t.createElement("svg",{className:"k-gantt-dependencies-svg",ref:Z,style:{left:0,top:0}},V.map(M=>t.createElement(Dn,{key:f.getter(ae.id)(M),dependency:M}))),t.createElement("svg",{className:"k-gantt-dependencies-svg",style:{left:0,top:0,zIndex:3}},ue&&t.createElement("polyline",{points:`${ue.startX},${ue.startY} ${ue.endX},${ue.endY}`})),F&&F.length?Wt:null)})))});Ae.displayName="KendoReactGanttBaseView";const xt="gantt.weekViewTitle",Tt="gantt.dayViewTitle",Nt="gantt.monthViewTitle",Ft="gantt.yearViewTitle",Mt="gantt.filterClearButton",Ye="gantt.filterEqOperator",Ze="gantt.filterNotEqOperator",Xe="gantt.filterIsNullOperator",je="gantt.filterIsNotNullOperator",pn="gantt.filterIsEmptyOperator",vn="gantt.filterIsNotEmptyOperator",wn="gantt.filterStartsWithOperator",Sn="gantt.filterContainsOperator",bn="gantt.filterNotContainsOperator",yn="gantt.filterEndsWithOperator",In="gantt.filterGteOperator",kn="gantt.filterGtOperator",xn="gantt.filterLteOperator",Tn="gantt.filterLtOperator",Nn="gantt.filterIsTrue",Fn="gantt.filterIsFalse",Mn="gantt.filterBooleanAll",Ln="gantt.filterAfterOrEqualOperator",Rn="gantt.filterAfterOperator",Vn="gantt.filterBeforeOperator",An="gantt.filterBeforeOrEqualOperator",dr="gantt.noRecords",zn="gantt.editSave",Lt="gantt.editCancel",Rt="gantt.editAdd",Vt="gantt.editRemove",Hn="gantt.editTabGeneral",Gn="gantt.editTabPredecessors",On="gantt.editTabSuccessors",Wn="gantt.editorTitle",_n="gantt.editorTaskTitle",Kn="gantt.editorTaskStart",Bn="gantt.editorTaskEnd",ur="gantt.editorTaskPlannedStart",gr="gantt.editorTaskPlannedEnd",mr="gantt.editorTaskActualStart",fr="gantt.editorTaskActualEnd",$n="gantt.editorTaskComplete",qn="gantt.editorTaskParent",Un="gantt.editorValidationRequired",Yn="gantt.editorValidationStart",Zn="gantt.editorValidationEnd",Xn="gantt.editorValidationPercentCompleteRange",At="gantt.editorDependencyTypesFF",jn="gantt.editorDependencyTypesSF",Jn="gantt.editorDependencyTypesFS",Qn="gantt.editorDependencyTypesSS",Pn="gantt.addTask",ea="gantt.addChild",ta="gantt.addAbove",na="gantt.addBelow",aa="gantt.viewSelector",zt="gantt.editorDelete",ra="gantt.deleteConfirmation",la="gantt.deleteDialogTitle",Ht="gantt.editorDependencyNameLabel",Gt="gantt.editorDependencyTypeLabel",oe={[xt]:"Week",[Tt]:"Day",[Nt]:"Month",[Ft]:"Year",[Mt]:"Clear",[Ye]:"Is equal to",[Ze]:"Is not equal to",[Xe]:"Is null",[je]:"Is not null",[pn]:"Is empty",[vn]:"Is not empty",[wn]:"Starts with",[Sn]:"Contains",[bn]:"Does not contain",[yn]:"Ends with",[In]:"Is greater than or equal to",[kn]:"Is greater than",[xn]:"Is less than or equal to",[Tn]:"Is less than",[Nn]:"Is true",[Fn]:"Is false",[Mn]:"(All)",[Ln]:"Is after or equal to",[Rn]:"Is after",[Vn]:"Is before",[An]:"Is before or equal to",[dr]:"No records available",[zn]:"Save",[Lt]:"Cancel",[Rt]:"Add",[Vt]:"Remove",[Hn]:"General",[Gn]:"Predecessors",[On]:"Successors",[Wn]:"Edit task",[_n]:"Title",[Kn]:"Start",[Bn]:"End",[ur]:"Planned Start Date",[gr]:"Planned End Date",[mr]:"Actual Start Date",[fr]:"Actual End Date",[$n]:"Complete",[qn]:"Parent",[Un]:"Field is required.",[Yn]:"Start time must be be before End time.",[Zn]:"End time must be after Start time.",[Xn]:"Value should be between 0 and 100.",[At]:"Finish-Finish",[Jn]:"Finish-Start",[jn]:"Start-Finish",[Qn]:"Start-Start",[Pn]:"Add Task",[ea]:"Add Child",[ta]:"Add Above",[na]:"Add Below",[aa]:"View Selector",[zt]:"Delete",[ra]:"Are you sure you want to delete this event?",[la]:"Delete Event",[Ht]:"Name",[Gt]:"Type"},ze=t.forwardRef((e,a)=>{const{slotWidth:n=Je.slotWidth,firstSlotRangeRef:l,timelineHeaderCell:s}=e,{timezone:r}=Re(),o=J.useInternationalization(),i=t.useRef(null),m=t.useRef(null),d=t.useCallback(C=>{m.current&&m.current.scrollIntoView(C)},[]);t.useImperativeHandle(i,()=>({scrollIntoView:d})),t.useImperativeHandle(a,()=>i.current);const g=Ve(),c=e.workWeekStart||Je.workWeekStart,h=e.workWeekEnd||Je.workWeekEnd,D=t.useMemo(()=>{const C=rn({workWeekStart:c,workWeekEnd:h}),p=[],y=on(g,{timezone:r},o);return y.forEach(R=>{const z=sn(R.range,{workDays:C,timezone:r},o);p.push.apply(p,z)}),l&&p[0]&&(l.current=p[0].range),[y,p]},[r,g.start.getTime(),g.end.getTime(),o,c,h]);return t.createElement(Ae,{ref:m,slotWidth:n,slotLevels:D,timelineHeaderCell:s})}),Je={name:"week",dateRange:({intl:e,tasksStart:a,tasksEnd:n,timezone:l})=>{const s=v.ZonedDate.fromLocalDate(a,l),r=v.ZonedDate.fromLocalDate(n,l),o=nn(v.firstDayInWeek(v.getDate(s),e.firstDay())),i=st(v.firstDayInWeek(v.getDate(r),e.firstDay()),Jt),m=v.ZonedDate.fromUTCDate(Ee(o),l),d=v.ZonedDate.fromUTCDate(Ee(i),l);return{start:new Date(m.getTime()),end:new Date(d.getTime()),zonedStart:m,zonedEnd:d}},title:e=>e.toLanguageString(xt,oe[xt]),slotWidth:Me,workWeekStart:1,workWeekEnd:5,workDayStart:"08:00",workDayEnd:"17:00"};ze.defaultProps=Je,ze.propTypes={name:u.string,dateRange:u.oneOfType([u.func,u.object]),title:u.oneOfType([u.string,u.func]),slotWidth:u.number,workWeekStart:u.number,workWeekEnd:u.number,workDayStart:u.string,workDayEnd:u.string},ze.displayName="KendoReactGanttWeekView";const hr=(e,a,n)=>{const[l,s]=t.useState(a||e),r=t.useCallback((o,i)=>{s(o),n&&n.call(void 0,{...i,value:o})},[n,s]);return[a!==void 0?a:l,r]},sa=e=>{const[a,n]=gn(),l=J.useLocalization(),s=t.useMemo(()=>typeof e.view.title=="function"?e.view.title.call(void 0,l):e.view.title,[e.view.title,l]),r=t.useCallback(()=>{e.view.name&&n(e.view.name)},[n,e.view.name]);return t.createElement(te.Button,{role:"button",type:"button",tabIndex:-1,togglable:!0,selected:e.view.name===a,onClick:r},s)};sa.displayName="KendoReactGanttViewSelectorItem";const oa=t.forwardRef(()=>{const e=nr(),[a,n]=gn(),l=J.useLocalization(),s=o=>l.toLanguageString(o,oe[o]),r=t.useCallback(o=>{n&&(o.preventDefault(),n(o.target.value))},[n]);return t.createElement("div",{className:"k-gantt-views-wrapper"},t.createElement(te.ButtonGroup,{className:"k-gantt-views"},e.map(o=>t.createElement(sa,{key:o.props.name,view:o.props}))),t.createElement("select",{value:a,onChange:r,"aria-label":s(aa),className:"k-picker k-picker-solid k-dropdown-list k-dropdown k-views-dropdown k-rounded-md"},e.map(o=>t.createElement("option",{key:o.props.name,value:o.props.name},typeof o.props.title=="function"?o.props.title.call(void 0,l):o.props.title))))});oa.displayName="KendoReactGanttViewSelectorList";const ia=t.forwardRef((e,a)=>{const{className:n,...l}=e,s=t.useRef(null);return t.useImperativeHandle(a,()=>({element:s.current,props:e})),t.createElement(te.ToolbarItem,{ref:r=>{r&&(s.current=r.element)},className:f.classNames("k-gantt-views",n),...l},e.children)});ia.displayName="KendoReactGanttViewSelector";const ca=t.forwardRef((e,a)=>{const{className:n,...l}=e,s=t.useRef(null),r=t.useRef(null);t.useImperativeHandle(r,()=>({element:s.current,props:e})),t.useImperativeHandle(a,()=>r.current);const o=t.useMemo(()=>f.classNames("k-gantt-toolbar k-gantt-header",n),[n]);return t.createElement(te.Toolbar,{ref:i=>{i&&(s.current=i.element)},className:o,...l},e.children)});ca.displayName="KendoReactGanttToolbar";const da={name:"@progress/kendo-react-gantt",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},ua=t.forwardRef((e,a)=>{const n=J.useLocalization(),l=c=>n.toLanguageString(c,oe[c]),s=l(Pn),r=l(ea),o=l(ta),i=l(na),m=t.useCallback(c=>{c.syntheticEvent.preventDefault();const h=c.item&&c.item.direction?c.item.direction:"none";e.onClick&&e.onClick({nativeEvent:c.nativeEvent,syntheticEvent:c.syntheticEvent,direction:h})},[e.onClick]),d=t.useCallback(c=>{c.preventDefault(),e.onClick&&e.onClick({nativeEvent:c&&c.nativeEvent,syntheticEvent:c,direction:"none"})},[e.onClick]),g=t.createElement(t.Fragment,null,t.createElement(f.IconWrap,{name:"plus",icon:Ce.plusIcon}),s);return e.selectedTask?t.createElement(te.DropDownButton,{className:"k-views-dropdown",onItemClick:m,popupSettings:{popupClass:"k-gantt-toolbar"},textField:"title",items:[{title:r,direction:"child"},{title:o,direction:"above"},{title:i,direction:"below"}],text:g}):t.createElement(te.Button,{onClick:d},g)});ua.displayName="KendoReactGanttAddButton";const Qe=t.forwardRef((e,a)=>{f.validatePackage(da);const n=f.shouldShowValidationUI(da),{columns:l=He.columns,taskData:s=He.taskData,dependencyData:r=He.dependencyData,style:o,className:i,noRecords:m,timezone:d,rowHeight:g=He.rowHeight,resizable:c,reorderable:h,sortable:D,sort:C,filter:p,columnMenuFilter:y,columnMenu:R,navigatable:z,toolbar:L,row:_,selectable:N}=e,A=J.useInternationalization(),{fields:I}=t.useMemo(()=>Ga(e.taskModelFields),[e.taskModelFields]),{fields:k}=t.useMemo(()=>Oa(e.dependencyModelFields),[e.dependencyModelFields]),U=t.useCallback(Pa(I.isExpanded,I.children),[I.isExpanded,I.children]),K=t.useRef(null),B=t.useRef(null),Q=t.useRef(null),w=t.useRef(null),W=t.useRef(null),j=t.useCallback(S=>{const De=f.getter(I.start)(S),ye=f.getter(I.end)(S),We=f.getter(I.isSelected)(S);(!B.current||De<B.current)&&(B.current=De),(!Q.current||ye>Q.current)&&(Q.current=ye),We&&(w.current=S)},[I.start,I.end]),Y=t.useMemo(()=>(B.current=null,Q.current=null,w.current=null,he.flatData(s,U,j)),[s,U]);(!B.current||!Q.current)&&(B.current=new Date(jt),Q.current=new Date(jt));const T=t.Children.toArray(e.children||[t.createElement(ze,{key:"week",firstSlotRangeRef:W})]),[ae,F]=hr(e.defaultView||T[0].props.name,e.view,e.onViewChange),V=T.find(S=>S.props.name===ae)||T[0],P=typeof V.props.dateRange=="function"?V.props.dateRange.call(void 0,{intl:A,tasksStart:B.current,tasksEnd:Q.current,timezone:d}):V.props.dateRange,re=t.useRef(null),[$,Z]=t.useState(0);f.useIsomorphicLayoutEffect(()=>{re.current&&Z(re.current.element.offsetHeight)},[]);const ve=t.useCallback(S=>{K.current&&K.current.scrollIntoView(S)},[]),we=t.useRef(null),O=t.useRef(null);t.useImperativeHandle(O,()=>({props:e,element:we.current,scrollIntoView:ve})),t.useImperativeHandle(a,()=>O.current);const ie=t.useCallback(S=>{e.onDataStateChange&&e.onDataStateChange.call(void 0,{...S,target:O.current})},[e.onDataStateChange]),xe=t.useCallback(S=>{e.onSortChange&&e.onSortChange.call(void 0,{...S,target:O.current})},[e.onSortChange]),Ge=t.useCallback(S=>{e.onKeyDown&&e.onKeyDown.call(void 0,{...S,target:O.current})},[e.onKeyDown]),Se=t.useCallback(S=>{e.onSelectionChange&&e.onSelectionChange.call(void 0,{...S,target:O.current})},[e.onSelectionChange]),E=t.useCallback(S=>{e.onHeaderSelectionChange&&e.onHeaderSelectionChange.call(void 0,{...S,target:O.current})},[e.onHeaderSelectionChange]),H=t.useCallback(S=>{e.onFilterChange&&e.onFilterChange.call(void 0,{...S,target:O.current})},[e.onFilterChange]),q=t.useCallback(S=>{e.onColumnMenuFilterChange&&e.onColumnMenuFilterChange.call(void 0,{...S,target:O.current})},[e.onColumnMenuFilterChange]),me=t.useCallback(S=>{e.onExpandChange&&e.onExpandChange.call(void 0,{...S,target:O.current})},[e.onExpandChange]),be=t.useCallback(S=>{e.onAddClick&&e.onAddClick.call(void 0,{...S,target:O.current,selectedDataItem:w.current,slotStart:W.current&&new Date(W.current.start.getTime()),slotEnd:W.current&&new Date(W.current.end.getTime())})},[e.onAddClick]),ue=t.useCallback(S=>{e.onColumnResize&&e.onColumnResize.call(void 0,{...S,target:O.current})},[e.onColumnResize]),Oe=t.useCallback(S=>{e.onColumnReorder&&e.onColumnReorder.call(void 0,{...S,target:O.current})},[e.onColumnReorder]),Ot=t.useCallback(S=>{e.onRowClick&&e.onRowClick.call(void 0,{...S,target:O.current})},[e.onRowClick]),Wt=t.useCallback(S=>{e.onRowDoubleClick&&e.onRowDoubleClick.call(void 0,{...S,target:O.current})},[e.onRowClick]),Te=t.useCallback(S=>{e.onRowContextMenu&&e.onRowContextMenu.call(void 0,{...S,target:O.current})},[e.onRowClick]),_t=t.useCallback(S=>{e.onTaskClick&&e.onTaskClick.call(void 0,{...S,target:O.current})},[e.onTaskClick]),Kt=t.useCallback(S=>{e.onTaskDoubleClick&&e.onTaskDoubleClick.call(void 0,{...S,target:O.current})},[e.onTaskDoubleClick]),Bt=t.useCallback(S=>{e.onTaskContextMenu&&e.onTaskContextMenu.call(void 0,{...S,target:O.current})},[e.onTaskContextMenu]),$t=t.useCallback(S=>{e.onTaskRemoveClick&&e.onTaskRemoveClick.call(void 0,{...S,target:O.current})},[e.onTaskRemoveClick]),qt=t.useCallback(S=>{if(e.onDependencyCreate){let De,ye;const We=f.getter(I.id);for(let _e=0;_e<Y.length;_e++){const Ut=Y[_e],Ne=We(Ut.dataItem);if(String(Ne)===S.fromId&&(De=Ne),String(Ne)===S.toId&&(ye=Ne),De&&ye)break}e.onDependencyCreate.call(void 0,{fromId:De,toId:ye,target:O.current,type:S.type})}},[e.onDependencyCreate,I,Y]);return t.createElement(fn,{dateRange:P,taskData:Y,dependencyData:r,taskModelFields:I,dependencyModelFields:k,views:T,activeView:[ae,F],rowHeight:g,toolbarHeight:$,props:{columns:l,noRecords:m,timezone:d,resizable:c,reorderable:h,sortable:D,sort:C,filter:p,columnMenuFilter:y,columnMenu:R,navigatable:z,row:_,selectable:N},events:{onDataStateChange:ie,onSortChange:xe,onFilterChange:H,onColumnMenuFilterChange:q,onExpandChange:me,onRowClick:Ot,onRowDoubleClick:Wt,onRowContextMenu:Te,onColumnResize:ue,onColumnReorder:Oe,onDependencyCreate:e.onDependencyCreate&&qt,onKeyDown:Ge,onSelectionChange:Se,onHeaderSelectionChange:E},taskEvents:{onTaskClick:_t,onTaskDoubleClick:Kt,onTaskContextMenu:Bt,onTaskRemoveClick:e.onTaskRemoveClick&&$t}},t.createElement("div",{ref:we,role:"application",style:o,className:f.classNames("k-gantt",i)},t.createElement(ca,{ref:re},L&&L.addTaskButton?t.createElement(ua,{selectedTask:w.current,onClick:be}):null,t.createElement(te.ToolbarSpacer,null),t.createElement(ia,null,t.createElement(oa,null))),V&&t.createElement(V.type,{key:V.props.name,ref:K,...V.props,firstSlotRangeRef:W}),n&&t.createElement(f.WatermarkOverlay,null)))}),He={taskData:[],dependencyData:[],columns:[],rowHeight:40};Qe.propTypes={taskData:u.array,taskModelFields:u.shape({id:u.string,start:u.string,end:u.string,title:u.string,percentComplete:u.string,parentId:u.string,isRollup:u.string,isExpanded:u.string,children:u.string,isInEdit:u.string}),dependencyData:u.array,dependencyModelFields:u.shape({id:u.string,fromId:u.string,toId:u.string,type:u.string}),columns:u.arrayOf(u.shape({width:u.number,cell:u.any,editCell:u.any,headerCell:u.any,filter:u.any,children:u.any,field:u.string,title:u.string,sortable:u.any,expandable:u.bool,headerSelectionValue:u.bool,format:u.string,headerClassName:u.string,className:u.string,resizable:u.bool,reorderable:u.bool,minResizableWidth:u.number,orderIndex:u.number,columnMenu:u.any})),sort:u.array,filter:u.array,columnMenuFilter:u.array,columnMenu:u.any,style:u.object,className:u.string,children:u.any,timezone:u.string,defaultView:u.string,view:u.string,rowHeight:u.number,navigatable:u.bool,onViewChange:u.func,onDataStateChange:u.func,onSortChange:u.func,onFilterChange:u.func,onExpandChange:u.func,onRowClick:u.func,onColumnResize:u.func,onColumnReorder:u.func},Qe.defaultProps=He,Qe.displayName="KendoReactGantt";const Pe=t.forwardRef((e,a)=>{const{slotWidth:n=ke.slotWidth,slotDuration:l=ke.slotDuration,firstSlotRangeRef:s,timelineHeaderCell:r}=e,{timezone:o}=Re(),i=J.useInternationalization(),m=t.useRef(null),d=t.useRef(null),g=t.useCallback(R=>{d.current&&d.current.scrollIntoView(R)},[]);t.useImperativeHandle(m,()=>({scrollIntoView:g})),t.useImperativeHandle(a,()=>m.current);const c=Ve(),h=e.workWeekStart||ke.workWeekStart,D=e.workWeekEnd||ke.workWeekEnd,C=e.workDayStart||ke.workDayStart,p=e.workDayEnd||ke.workDayEnd,y=t.useMemo(()=>{const R=rn({workWeekStart:h,workWeekEnd:D}),z=[],L=sn(c,{workDays:R,timezone:o},i);return L.forEach(_=>{const N=Za(_.range,{workDayStart:C,workDayEnd:p,timezone:o,slotDuration:l},i);_.span=N.length,z.push.apply(z,N)}),s&&z[0]&&(s.current=z[0].range),[L,z]},[o,c.start.getTime(),c.end.getTime(),i,h,D,C,p]);return t.createElement(Ae,{ref:d,slotWidth:n,slotLevels:y,timelineHeaderCell:r})}),ke={name:"day",dateRange:({tasksStart:e,tasksEnd:a,timezone:n})=>{const l=v.ZonedDate.fromLocalDate(e,n),s=v.ZonedDate.fromLocalDate(a,n),r=nn(l),o=st(s),i=v.ZonedDate.fromUTCDate(Ee(r),n),m=v.ZonedDate.fromUTCDate(Ee(o),n);return{start:new Date(i.getTime()),end:new Date(m.getTime()),zonedStart:i,zonedEnd:m}},title:e=>e.toLanguageString(Tt,oe[Tt]),slotWidth:Me,slotDuration:60,workWeekStart:1,workWeekEnd:5,workDayStart:"08:00",workDayEnd:"17:00"};Pe.defaultProps=ke,Pe.propTypes={name:u.string,dateRange:u.oneOfType([u.func,u.object]),title:u.oneOfType([u.string,u.func]),slotWidth:u.number,slotDuration:u.number,workWeekStart:u.number,workWeekEnd:u.number,workDayStart:u.string,workDayEnd:u.string},Pe.displayName="KendoReactGanttDayView";const et=t.forwardRef((e,a)=>{const{slotWidth:n=ga.slotWidth,firstSlotRangeRef:l,timelineHeaderCell:s}=e,{timezone:r}=Re(),o=J.useInternationalization(),i=t.useRef(null),m=t.useRef(null),d=t.useCallback(h=>{m.current&&m.current.scrollIntoView(h)},[]);t.useImperativeHandle(i,()=>({scrollIntoView:d})),t.useImperativeHandle(a,()=>i.current);const g=Ve(),c=t.useMemo(()=>{const h=[],D=cn(g,{timezone:r},o);return D.forEach(C=>{const p=on(C.range,{timezone:r},o);h.push.apply(h,p)}),l&&h[0]&&(l.current=h[0].range),[D,h]},[r,g.start.getTime(),g.end.getTime(),o]);return t.createElement(Ae,{ref:m,slotWidth:n,slotLevels:c,timelineHeaderCell:s})}),ga={name:"month",dateRange:({tasksStart:e,tasksEnd:a,timezone:n})=>{const l=v.ZonedDate.fromLocalDate(e,n),s=v.ZonedDate.fromLocalDate(a,n),r=v.firstDayOfMonth(v.getDate(l)),o=v.addDays(v.lastDayOfMonth(v.getDate(s)),1),i=v.ZonedDate.fromUTCDate(Ee(r),n),m=v.ZonedDate.fromUTCDate(Ee(o),n);return{start:new Date(i.getTime()),end:new Date(m.getTime()),zonedStart:i,zonedEnd:m}},title:e=>e.toLanguageString(Nt,oe[Nt]),slotWidth:Me,workWeekStart:1,workWeekEnd:5,workDayStart:"08:00",workDayEnd:"17:00"};et.defaultProps=ga,et.propTypes={name:u.string,dateRange:u.oneOfType([u.func,u.object]),title:u.oneOfType([u.string,u.func]),slotWidth:u.number,workWeekStart:u.number,workWeekEnd:u.number,workDayStart:u.string,workDayEnd:u.string},et.displayName="GanttMonthView";const tt=t.forwardRef((e,a)=>{const{slotWidth:n=ma.slotWidth,firstSlotRangeRef:l,timelineHeaderCell:s}=e,{timezone:r}=Re(),o=J.useInternationalization(),i=t.useRef(null),m=t.useRef(null),d=t.useCallback(h=>{m.current&&m.current.scrollIntoView(h)},[]);t.useImperativeHandle(i,()=>({scrollIntoView:d})),t.useImperativeHandle(a,()=>i.current);const g=Ve(),c=t.useMemo(()=>{const h=Xa(g,{timezone:r},o),D=[];return h.forEach(C=>{const p=cn(C.range,{timezone:r},o);D.push.apply(D,p)}),l&&D[0]&&(l.current=D[0].range),[h,D]},[r,g.start.getTime(),g.end.getTime(),o]);return t.createElement(Ae,{slotWidth:n,slotLevels:c,timelineHeaderCell:s})}),ma={name:"year",dateRange:({tasksStart:e,tasksEnd:a,timezone:n})=>{const l=v.ZonedDate.fromLocalDate(e,n),s=v.ZonedDate.fromLocalDate(a,n),r=v.firstDayOfMonth(v.firstMonthOfYear(v.getDate(l))),o=v.addDays(v.lastDayOfMonth(v.lastMonthOfYear(v.getDate(s))),1),i=v.ZonedDate.fromUTCDate(Ee(r),n),m=v.ZonedDate.fromUTCDate(Ee(o),n);return{start:new Date(i.getTime()),end:new Date(m.getTime()),zonedStart:i,zonedEnd:m}},title:e=>e.toLanguageString(Ft,oe[Ft]),slotWidth:Me};tt.defaultProps=ma,tt.propTypes={name:u.string,dateRange:u.oneOfType([u.func,u.object]),title:u.oneOfType([u.string,u.func]),slotWidth:u.number},tt.displayName="GanttYearView";const Cr=[{text:Sn,operator:"contains"},{text:bn,operator:"doesnotcontain"},{text:Ye,operator:"eq"},{text:Ze,operator:"neq"},{text:wn,operator:"startswith"},{text:yn,operator:"endswith"},{text:Xe,operator:"isnull"},{text:je,operator:"isnotnull"},{text:pn,operator:"isempty"},{text:vn,operator:"isnotempty"}],Er=[{text:Ye,operator:"eq"},{text:Ze,operator:"neq"},{text:In,operator:"gte"},{text:kn,operator:"gt"},{text:xn,operator:"lte"},{text:Tn,operator:"lt"},{text:Xe,operator:"isnull"},{text:je,operator:"isnotnull"}],Dr=[{text:Ye,operator:"eq"},{text:Ze,operator:"neq"},{text:Ln,operator:"gte"},{text:Rn,operator:"gt"},{text:Vn,operator:"lt"},{text:An,operator:"lte"},{text:Xe,operator:"isnull"},{text:je,operator:"isnotnull"}],pr=[{text:Mn,operator:""},{text:Nn,operator:!0},{text:Fn,operator:!1}];function nt(e,a){return{clearButtonTitle:e.toLanguageString(Mt,oe[Mt]),operators:a.map(n=>({text:e.toLanguageString(n.text,oe[n.text]),operator:n.operator}))}}const fa=e=>{const{operators:a,...n}=e;return t.createElement(x.TextFilterCell,{ariaLabel:"text filter",...nt(J.useLocalization(),a||Cr),...n})};fa.displayName="KendoReactGanttTextFilter";const ha=e=>{const{operators:a,...n}=e;return t.createElement(x.NumericFilterCell,{ariaLabel:"numeric filter",...nt(J.useLocalization(),a||Er),...n})};ha.displayName="KendoReactGanttNumericFilter";const Ca=e=>{const{operators:a,...n}=e;return t.createElement(x.BooleanFilterCell,{ariaLabel:"boolean filter",...nt(J.useLocalization(),a||pr),...n})};Ca.displayName="KendoReactGanttBooleanFilter";const Ea=e=>{const{operators:a,...n}=e;return t.createElement(x.DateFilterCell,{ariaLabel:"date filter",...nt(J.useLocalization(),a||Dr),...n})};Ea.displayName="KendoReactGanttDateFilter";const vr=e=>{const{dependencyData:a,dependencyModelFields:n,defaultDataItem:l,fromId:s,toId:r,type:o}=e,i=a.map(h=>({...h})),m=f.setter(n.fromId),d=f.setter(n.toId),g=f.setter(n.type),c=l?{...l}:{};return m(c,s),d(c,r),g(c,o),i.push(c),i},wr=e=>{const{defaultDataItem:a,selectedDataItem:n,direction:l,taskModelFields:s,dataTree:r,slotStart:o,slotEnd:i}=e,m=Le(r,s.children,y=>({...y})),d=f.setter(s.start),g=f.setter(s.end),c=f.getter(s.start),h=f.getter(s.end),D=f.setter(s.parentId||""),C=a?{...a}:{},p=c(C)&&h(C);if(!n||l==="none")p||(d(C,o),g(C,i)),s.parentId&&D(C,null),m.unshift(C);else{const y=[{task:{[s.children]:m},childrenIndex:0}],R=f.getter(s.id),z=f.getter(s.children),L=f.setter(s.children),_=R(n);for(;y.length>0;){const N=y[y.length-1],A=N.task,I=R(A),k=z(A);if(I&&I===_)break;k&&k.length&&k.length>N.childrenIndex?(y.push({task:k[N.childrenIndex],childrenIndex:0}),N.childrenIndex++):y.pop()}if(y.length>1){const N=y[y.length-1].task,A=y[y.length-2].childrenIndex,k=y[y.length-2].task,U=z(k);switch(l){case"child":{let K=z(N);K||(K=[],L(N,K)),p||(d(C,new Date(c(N).getTime())),g(C,new Date(h(N).getTime()))),K.push(C),D(C,R(N)),at(y.splice(1,y.length-1).map(B=>B.task),s);break}case"above":{c(k)&&h(k)&&!p?(d(C,new Date(c(N).getTime())),g(C,new Date(h(N).getTime()))):(d(C,o),g(C,i)),U.splice(A-1,0,C),D(C,R(k)),at(y.splice(1,y.length-2).map(K=>K.task),s);break}case"below":{c(k)&&h(k)&&!p?(d(C,new Date(c(N).getTime())),g(C,new Date(h(N).getTime()))):(d(C,o),g(C,i)),U.splice(A,0,C),D(C,R(k)),at(y.splice(1,y.length-2).map(K=>K.task),s);break}}}}return m},Sr=e=>{const{updatedDataItem:a,taskModelFields:n,dataTree:l}=e,s=f.getter(n.id),r=f.getter(n.children),o=s(a);let i;const m=Le(l,n.children,g=>s(g)===o?(i=g,{...a}):{...g});let d=[{task:{[n.children]:m},childrenIndex:0}];for(;d.length>0;){const g=d[d.length-1],c=g.task,h=s(c),D=r(c);if(h&&h===o)break;D&&D.length&&D.length>g.childrenIndex?(d.push({task:D[g.childrenIndex],childrenIndex:0}),g.childrenIndex++):d.pop()}if(d.length>1){d=d.splice(1,d.length-2);const g=f.getter(n.start),c=f.getter(n.end),h=f.getter(n.percentComplete),D=f.getter(n.parentId||"");if(g(i).getTime()!==g(a).getTime()){Da(d.map(p=>p.task),n);const C=g(a).getTime()-g(i).getTime();kr(r(a),n,C)}if(c(i).getTime()!==c(a).getTime()&&pa(d.map(C=>C.task),n),h(i)!==h(a)&&va(d.map(C=>C.task),n),n.parentId&&D(i)!==D(a)){let C;return d.length?yr(d.map(p=>p.task),n,i):C=m.filter(p=>s(p)!==s(a)),Ir(C||m,n,a)}}return m},br=e=>{const{removedDataItem:a,taskModelFields:n,dataTree:l}=e,s=Le(l,n.children,d=>({...d}));let r=[{task:{[n.children]:s},childrenIndex:0}];const o=f.getter(n.id),i=f.getter(n.children),m=o(a);for(;r.length>0;){const d=r[r.length-1],g=d.task,c=o(g),h=i(g);if(c&&c===m)break;h&&h.length&&h.length>d.childrenIndex?(r.push({task:h[d.childrenIndex],childrenIndex:0}),d.childrenIndex++):r.pop()}if(r.length>1){const d=r[r.length-2],g=d.task;i(g).splice(d.childrenIndex-1,1),r=r.splice(1,r.length-2),at(r.map(h=>h.task),n)}return s},at=(e,a)=>{Da(e,a),pa(e,a),va(e,a)},yr=(e,a,n)=>{const l=f.getter(a.children),s=f.setter(a.children);for(let r=e.length-1;r>=0;r--){const o=e[r],i=l(o);if(n.parentId===o.id){const m=i.filter(d=>d.parentId===o.id);s(o,m)}}},Ir=(e,a,n)=>{const l=f.getter(a.children),s=f.setter(a.children);return n.parentId===null?[...e,n]:(e=Le(e,a.children,r=>{if(r.id===n.parentId){const o=l(r)||[];s(r,[...o,n])}return{...r}}),e)},Da=(e,a)=>{if(!e.length)return;const n=f.getter(a.children),l=f.getter(a.start),s=f.setter(a.start);for(let r=e.length-1;r>=0;r--){const o=e[r],i=n(o);if(i&&i.length){const m=i.reduce((d,g)=>Math.min(d,l(g).getTime()),l(i[0]).getTime());s(o,new Date(m))}}},pa=(e,a)=>{if(!e.length)return;const n=f.getter(a.children),l=f.getter(a.end),s=f.setter(a.end);for(let r=e.length-1;r>=0;r--){const o=e[r],i=n(o);if(i&&i.length){const m=i.reduce((d,g)=>Math.max(d,l(g).getTime()),l(i[0]).getTime());s(o,new Date(m))}}},va=(e,a)=>{if(!e.length)return;const n=f.getter(a.children),l=f.getter(a.percentComplete),s=f.setter(a.percentComplete),r=({avg:o,n:i},m)=>({avg:((l(m)||0)+i*o)/(i+1),n:i+1});for(let o=e.length-1;o>=0;o--){const i=e[o],m=n(i);if(m&&m.length){const d=m.reduce(r,{avg:0,n:0}).avg;s(i,d)}}},kr=(e,a,n)=>{if(!e)return;const l=f.getter(a.children),s=f.getter(a.start),r=f.setter(a.start),o=f.getter(a.end),i=f.setter(a.end),m=e.map(d=>({task:d,childrenIndex:0}));for(;m.length>0;){const d=m[m.length-1],g=d.task,c=l(g);c&&c.length&&c.length>d.childrenIndex?(m.push({task:c[d.childrenIndex],childrenIndex:0}),d.childrenIndex++):(m.pop(),r(g,new Date(s(g).getTime()+n)),i(g,new Date(o(g).getTime()+n)))}},wa=e=>{const{validationMessage:a,touched:n,label:l,id:s,valid:r,disabled:o,hint:i,type:m,optional:d,...g}=e,c=n&&a,h=!c&&i,D=h?`${s}_hint`:"",C=c?`${s}_error`:"";return t.createElement(ne.FieldWrapper,{className:"k-col-span-full"},t.createElement(de.Label,{editorId:s,editorValid:r,editorDisabled:o,optional:d},l),t.createElement("div",{className:"k-form-field-wrap"},t.createElement(Yt.Input,{valid:r,type:m,id:s,disabled:o,ariaDescribedBy:`${D} ${C}`,...g}),h&&t.createElement(de.Hint,{id:D},i),c&&t.createElement(de.Error,{id:C},a)))},rt=e=>{const{validationMessage:a,touched:n,label:l,id:s,valid:r,disabled:o,hint:i,wrapperStyle:m,...d}=e,g=n&&a,c=!g&&i,h=c?`${s}_hint`:"",D=g?`${s}_error`:"",C=l?`${s}_label`:"";return t.createElement(ne.FieldWrapper,{style:m,className:"k-col-span-2"},t.createElement(de.Label,{id:C,editorId:s,editorValid:r,editorDisabled:o},l),t.createElement("div",{className:"k-form-field-wrap"},t.createElement(ya.DateTimePicker,{ariaLabelledBy:C,ariaDescribedBy:`${h} ${D}`,valid:r,id:s,disabled:o,...d}),c&&t.createElement(de.Hint,{id:h},i),g&&t.createElement(de.Error,{id:D},a)))},Sa=e=>{const{validationMessage:a,visited:n,label:l,id:s,valid:r,disabled:o,hint:i,...m}=e,d=n&&a,g=!d&&i,c=g?`${s}_hint`:"",h=d?`${s}_error`:"";return t.createElement(ne.FieldWrapper,null,t.createElement(de.Label,{editorId:s,editorValid:r,editorDisabled:o},l),t.createElement("div",{className:"k-form-field-wrap"},t.createElement(Yt.NumericTextBox,{ariaDescribedBy:`${c} ${h}`,valid:r,id:s,disabled:o,format:"p0",step:.01,...m}),g&&t.createElement(de.Hint,{id:c},i),d&&t.createElement(de.Error,{id:h},a)))},xr=e=>{const{validationMessage:a,touched:n,label:l,id:s,valid:r,disabled:o,hint:i,idField:m,dataItem:d,...g}=e,c={id:null,title:"-None-",parentId:null},h=[],D=n&&a,C=!D&&i,p=C?`${s}_hint`:"",y=D?`${s}_error`:"",R=t.useCallback(A=>{if(!A||!A.children)return e.data;for(const k of A.children)h.push(k),k.children&&R(k);const I=h.map(k=>k.id);return e.data.filter(k=>!I.includes(k.id))},[e.data]),z=R(d),L=t.useMemo(()=>z.map(A=>{const I=new Date(A.start).toLocaleDateString(),k=new Date(A.end).toLocaleDateString();return{...A,title:`${A.title} (${I}-${k})`}}),[R]),_=t.useMemo(()=>X.findByFieldValue(L,m,e.value),[L,m,e.value]),N=A=>{A.value.id===null?e.onChange({value:null}):e.onChange({value:A.value[m]})};return t.createElement(ne.FieldWrapper,{className:"k-col-span-full"},t.createElement(de.Label,{editorId:s,editorValid:r,editorDisabled:o},l),t.createElement("div",{className:"k-form-field-wrap"},t.createElement(X.DropDownList,{textField:"title",ariaDescribedBy:`${p} ${y}`,valid:r,id:s,disabled:o,...g,value:_,data:L,onChange:N,defaultItem:c}),C&&t.createElement(de.Hint,{id:p},i),D&&t.createElement(de.Error,{id:y},a)))},Tr=(e,a,n,l)=>{const[s,r]=t.useState(e),o=t.useRef(null),i=c=>{l(a,"fromId",c.target.value.id)},m=()=>{if(n&&!a.uid)return n.id===a.id;if(n&&a.id===null)return n.uid===a.uid},d=t.useMemo(()=>X.findByFieldValue(e,"id",a.fromId),[e,a.fromId]),g=c=>{const h=$e.filterBy(e,c.filter);r(h)};return t.createElement("td",{ref:o,className:f.classNames(m()&&"k-selected")},t.createElement(X.DropDownList,{textField:"title",data:s,value:d,onChange:i,filterable:!0,onFilterChange:g,required:!0}))},Nr=(e,a,n,l)=>{const s=i=>{l(a,"type",i.target.value.type)},r=()=>{if(n&&!a.uid)return n.id===a.id;if(n&&a.id===null)return n.uid===a.uid},o=t.useMemo(()=>X.findByFieldValue(e,"type",a.type),[e,a.type]);return t.createElement("td",{className:f.classNames(r()&&"k-selected")},t.createElement(X.DropDownList,{textField:"name",data:e,value:o,onChange:s}))},Fr=e=>{var g;const[a,n]=t.useState([]),l=J.useLocalization(),s=c=>l.toLanguageString(c,oe[c]),r=s(Rt),o=s(Vt),i=s(Ht),m=s(Gt),d=t.useMemo(()=>{const c=e.predecessors.map(h=>{const D=X.findByFieldValue(e.flatTasks,"id",h.fromId),C=X.findByFieldValue(e.dependencyTypes,"type",h.type);return{...h,taskTitle:D?D.title:"",typeName:C?C.type:""}});return $e.orderBy(c,a)},[e.predecessors,e.dependencyTypes,e.flatTasks,a]);return t.createElement(pe.Grid,{data:d,sort:a,sortable:!0,onRowClick:e.onSelectRow,onSortChange:c=>{n(c.sort)},style:{height:"23em"}},t.createElement(pe.GridToolbar,null,t.createElement(te.Button,{icon:"plus",svgIcon:Ce.plusIcon,onClick:e.addPredecessorsDependency},r),t.createElement(te.Button,{icon:"minus",svgIcon:Ce.minusIcon,onClick:e.deleteDependency,disabled:((g=e.selectedItem)==null?void 0:g.id)===void 0},o)),t.createElement(pe.GridColumn,{field:"taskTitle",title:i,cell:c=>Tr(e.flatTasks,c.dataItem,e.selectedItem,e.updateDependency)}),t.createElement(pe.GridColumn,{field:"typeName",title:m,cell:c=>Nr(e.dependencyTypes,c.dataItem,e.selectedItem,e.updateDependency)}))},Mr=(e,a,n,l)=>{const[s,r]=t.useState(e),o=g=>{l(a,"toId",g.target.value.id)},i=()=>{if(n&&!a.uid)return n.id===a.id;if(n&&a.id===null)return n.uid===a.uid},m=t.useMemo(()=>X.findByFieldValue(e,"id",a.toId),[e,a.toId]),d=g=>{const c=$e.filterBy(e,g.filter);r(c)};return t.createElement("td",{className:f.classNames(i()&&"k-selected")},t.createElement(X.DropDownList,{textField:"title",data:s,value:m,onChange:o,filterable:!0,onFilterChange:d,required:!0}))},Lr=(e,a,n,l)=>{const s=i=>{l(a,"type",i.target.value.type)},r=()=>{if(n&&!a.uid)return n.id===a.id;if(n&&a.id===null)return n.uid===a.uid},o=t.useMemo(()=>X.findByFieldValue(e,"type",a.type),[e,a.type]);return t.createElement("td",{className:f.classNames(r()&&"k-selected")},t.createElement(X.DropDownList,{textField:"name",data:e,value:o,onChange:s}))},Rr=e=>{var g;const[a,n]=t.useState([]),l=J.useLocalization(),s=c=>l.toLanguageString(c,oe[c]),r=s(Rt),o=s(Vt),i=s(Ht),m=s(Gt),d=t.useMemo(()=>{const c=e.successors.map(h=>{const D=X.findByFieldValue(e.flatTasks,"id",h.toId),C=X.findByFieldValue(e.dependencyTypes,"type",h.type);return{...h,taskTitle:D?D.title:"",typeName:C?C.type:""}});return $e.orderBy(c,a)},[e.successors,e.dependencyTypes,e.flatTasks,a]);return t.createElement(pe.Grid,{data:d,sort:a,sortable:!0,onRowClick:e.onSelectRow,onSortChange:c=>{n(c.sort)},style:{height:"23em"}},t.createElement(pe.GridToolbar,null,t.createElement(te.Button,{icon:"plus",svgIcon:Ce.plusIcon,onClick:e.addSuccessorsDependency},r),t.createElement(te.Button,{icon:"minus",svgIcon:Ce.minusIcon,onClick:e.deleteDependency,disabled:((g=e.selectedItem)==null?void 0:g.id)===void 0},o)),t.createElement(pe.GridColumn,{field:"taskTitle",title:i,cell:c=>Mr(e.flatTasks,c.dataItem,e.selectedItem,e.updateDependency)}),t.createElement(pe.GridColumn,{field:"type",title:m,cell:c=>Lr(e.dependencyTypes,c.dataItem,e.selectedItem,e.updateDependency)}))};var ge=(e=>(e[e.FF=0]="FF",e[e.FS=1]="FS",e[e.SF=2]="SF",e[e.SS=3]="SS",e))(ge||{});const Vr=[{type:ge.FF},{type:ge.FS},{type:ge.SF},{type:ge.SS}],Ar=e=>{const[a,n]=t.useState(0),[l,s]=t.useState(),[r,o]=t.useState([...e.dependencyData||[]]),[i,m]=t.useState([]),d=gt(),g=J.useLocalization(),c=E=>g.toLanguageString(E,oe[E]),h=c(_n),D=c(Kn),C=c(Bn),p=c($n),y=c(qn),R=c(Hn),z=c(Gn),L=c(On),_=c(Un),N=c(Yn),A=c(Zn),I=c(Xn),k=t.useMemo(()=>he.flatData(e.taskData||[],E=>E.children||[],E=>{const H={title:E[d.title],id:E[d.id],start:E[d.start],end:E[d.end],parentId:null};return d.parentId&&(H.parentId=E[d.parentId]),H}),[e.taskData,d]),U=t.useMemo(()=>k.filter(E=>E.id!==e.dataItem.id),[k,e.dataItem]),K=t.useMemo(()=>r.filter(E=>E.toId===e.dataItem.id),[r,e.dataItem]),B=t.useMemo(()=>r.filter(E=>E.fromId===e.dataItem.id),[r,e.dataItem]),Q=t.useMemo(()=>r.filter(E=>E.id===null).map(E=>({id:E.id,fromId:E.fromId,toId:E.toId,type:E.type})),[r]),w=t.useMemo(()=>r.filter(E=>E.id!==null&&E.uid).map(E=>({id:E.id,fromId:E.fromId,toId:E.toId,type:E.type})),[r]),W=()=>{if(l){if(l.id){const E=r.filter(q=>q.id!==l.id);o(E);const H=r.filter(q=>q.id===l.id);m(q=>[...q,...H])}else{const E=r.filter(q=>q.uid!==l.uid);o(E);const H=r.filter(q=>q.uid===l.uid);m(q=>[...q,...H])}s(void 0)}},j=t.useCallback(E=>E||E===0?void 0:_,[_]),Y=t.useCallback(E=>E||E===0?E>=0&&E<=1?void 0:I:_,[_,I]),T=t.useCallback((E,H)=>E&&H(d.end)&&E.getTime()>H(d.end).getTime()?N:void 0,[d,N]),ae=t.useCallback((E,H)=>E&&H(d.start)&&E.getTime()<H(d.start).getTime()?A:void 0,[d,A]),F=t.useMemo(()=>[j,T],[j,T]),V=t.useMemo(()=>[j,ae],[j,ae]),P=t.useMemo(()=>X.findByFieldValue(r,"fromId",null)||X.findByFieldValue(r,"toId",null),[r]),re=E=>{P||(n(E.selected),s(void 0))},$=E=>{s(E.dataItem)},Z=()=>{const E={uid:f.guid(),id:null,fromId:null,toId:e.dataItem.id,type:ge.FS};o([...r,E])},ve=()=>{const E={uid:f.guid(),id:null,fromId:e.dataItem.id,toId:null,type:ge.FS};o([...r,E])},we=(E,H,q)=>{const me={...E,uid:E.uid||f.guid(),[H]:q},be=r.findIndex(ue=>ue.id&&ue.id===me.id||ue.uid&&ue.uid===me.uid);be>-1&&(r.splice(be,1,me),o([...r]))},O=t.useMemo(()=>Vr.map(E=>{let H;switch(E.type){case ge.FF:H=c(At);break;case ge.FS:H=c(Jn);break;case ge.SF:H=c(jn);break;case ge.SS:H=c(Qn);break;default:H=c(At);break}return{...E,name:H}}),[c]);t.useEffect(()=>{e.onDependencyCreate&&e.onDependencyCreate.call(void 0,{createdDependencies:Q,updatedDependencies:w,deletedDependencies:i})},[Q,w,i,e.onDependencyCreate]);const ie=e.dependencyData&&e.taskData,xe=t.createElement(ne.FormElement,{style:{width:400},horizontal:!0},t.createElement(ne.Field,{id:`${d.title}_gantteditor`,name:d.title,label:h,component:wa,validator:j}),t.createElement(ne.Field,{id:`${d.start}_gantteditor`,name:d.start,label:D,component:rt,validator:F}),t.createElement(ne.Field,{id:`${d.end}_gantteditor`,name:d.end,label:C,component:rt,validator:V}),t.createElement(ne.Field,{id:`${d.percentComplete}_gantteditor`,name:d.percentComplete,label:p,component:Sa,validator:Y})),Ge=t.createElement(ne.FormElement,{style:{paddingInline:"4px"}},t.createElement("div",{className:"k-form-fieldset"},t.createElement("div",{className:"k-form-layout k-d-grid k-grid-cols-4 k-gap-x-2"},t.createElement(ne.Field,{id:`${d.title}_gantteditor`,name:d.title,label:h,component:wa,validator:j}),t.createElement(ne.Field,{id:`${d.start}_gantteditor`,name:d.start,label:D,component:rt,validator:F}),t.createElement(ne.Field,{id:`${d.end}_gantteditor`,name:d.end,label:C,component:rt,validator:V}),t.createElement(ne.Field,{id:`${d.percentComplete}_gantteditor`,name:d.percentComplete,label:p,component:Sa,validator:Y}),d.parentId&&t.createElement(ne.Field,{id:`${d.parentId}_gantteditor`,name:d.parentId||"",idField:d.id,label:y,component:xr,data:U,dataItem:e.dataItem})))),Se=t.createElement(Be.TabStrip,{selected:a,onSelect:re},t.createElement(Be.TabStripTab,{title:R},Ge),t.createElement(Be.TabStripTab,{title:z},t.createElement(Fr,{flatTasks:k,predecessors:K,dependencyTypes:O,selectedItem:l,onSelectRow:$,addPredecessorsDependency:Z,deleteDependency:W,updateDependency:we})),t.createElement(Be.TabStripTab,{title:L},t.createElement(Rr,{flatTasks:k,successors:B,dependencyTypes:O,selectedItem:l,onSelectRow:$,addSuccessorsDependency:ve,deleteDependency:W,updateDependency:we})));return ie?Se:xe},zr=e=>{const{onCancel:a,onDelete:n,onClose:l,onSubmit:s,...r}=e,o=t.useRef(e.dataItem),[i,m]=t.useState({}),d=J.useLocalization(),g=I=>d.toLanguageString(I,oe[I]),c=g(zn),h=g(Lt),D=g(zt),C=g(Wn),p=t.useCallback(I=>{if(a){const k={syntheticEvent:I,nativeEvent:I.nativeEvent,dataItem:e.dataItem};a.call(void 0,k)}},[a,e.dataItem]),y=t.useCallback(I=>{if(n){const k={syntheticEvent:I,nativeEvent:I.nativeEvent,dataItem:e.dataItem};n.call(void 0,k)}},[n,e.dataItem]),R=t.useCallback(({syntheticEvent:I})=>{if(l){const k={syntheticEvent:I,nativeEvent:I.nativeEvent,dataItem:e.dataItem};l.call(void 0,k)}},[l,e.dataItem]),z=t.useCallback((I,k)=>{if(s){const U={dataItem:I,initialDataItem:o.current,syntheticEvent:k,nativeEvent:k&&k.nativeEvent,dependencies:i};s.call(void 0,U)}},[s,i]),L=t.useMemo(()=>X.findByFieldValue(i.createdDependencies,"fromId",null)||X.findByFieldValue(i.createdDependencies,"toId",null),[i]),_=t.useMemo(()=>i.createdDependencies&&i.createdDependencies.length&&L===void 0||i.updatedDependencies&&i.updatedDependencies.length||i.deletedDependencies&&i.deletedDependencies.length,[i,L]),N=t.useCallback(I=>{m(I)},[]),A=t.createElement(ne.Form,{initialValues:e.dataItem,onSubmit:z,render:I=>t.createElement(Ke.Window,{title:C,minWidth:90,width:554,modal:!0,height:0,onClose:R},t.createElement(Ar,{taskData:e.taskData,dependencyData:e.dependencyData,dataItem:e.dataItem,onDependencyCreate:N}),t.createElement(Ke.WindowActionsBar,{layout:"start"},t.createElement(te.Button,{disabled:!I.allowSubmit&&!_,onClick:I.allowSubmit?I.onSubmit:k=>z(e.dataItem,k),icon:"save",svgIcon:Ce.saveIcon,themeColor:"primary"},c),t.createElement(te.Button,{onClick:p,type:"button",icon:"cancel",svgIcon:Ce.cancelIcon},h),t.createElement("div",{className:"k-spacer"}),n&&t.createElement(te.Button,{onClick:y,icon:"trash",svgIcon:Ce.trashIcon,fillMode:"flat",themeColor:"primary"},D))),...r});return f.canUseDOM?Xt.createPortal(A,document&&document.body):null},Hr=e=>{const{onClose:a,onCancel:n,onConfirm:l,dataItem:s}=e,r=J.useLocalization(),o=p=>r.toLanguageString(p,oe[p]),i=o(zt),m=o(Lt),d=o(ra),g=o(la),c=t.useCallback(({syntheticEvent:p})=>{a&&a.call(void 0,{syntheticEvent:p,nativeEvent:p&&p.nativeEvent,dataItem:null})},[a]),h=t.useCallback(p=>{n&&n.call(void 0,{syntheticEvent:p,nativeEvent:p&&p.nativeEvent,dataItem:null})},[n]),D=t.useCallback(p=>{l&&l.call(void 0,{syntheticEvent:p,nativeEvent:p&&p.nativeEvent,dataItem:s})},[l,s]),C=t.createElement(Ke.Dialog,{title:g,onClose:c},d,t.createElement(Ke.DialogActionsBar,{layout:"end"},t.createElement(te.Button,{themeColor:"primary",onClick:D},i),t.createElement(te.Button,{onClick:h},m)));return f.canUseDOM?Xt.createPortal(C,document&&document.body):null},Gr=he.TreeListRow;Object.defineProperty(b,"getSelectedState",{enumerable:!0,get:()=>x.getSelectedState}),Object.defineProperty(b,"getSelectedStateFromKeyDown",{enumerable:!0,get:()=>x.getSelectedStateFromKeyDown}),Object.defineProperty(b,"setSelectedState",{enumerable:!0,get:()=>x.setSelectedState}),b.GANTT_COL_INDEX_ATTRIBUTE=ka,b.GANTT_PREVENT_SELECTION_ELEMENT=xa,b.GANTT_ROW_INDEX_ATTRIBUTE=Ia,b.Gantt=Qe,b.GanttBooleanFilter=Ca,b.GanttDateFilter=Ea,b.GanttDayView=Pe,b.GanttForm=zr,b.GanttMonthView=et,b.GanttNumericFilter=ha,b.GanttRemoveDialog=Hr,b.GanttRow=Gr,b.GanttTextFilter=fa,b.GanttWeekView=ze,b.GanttYearView=tt,b.addDependency=vr,b.addTask=wr,b.createDataTree=Ha,b.extendDataItem=za,b.filterBy=Aa,b.mapTree=Le,b.orderBy=Va,b.removeTask=br,b.updateTask=Sr,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-date-math"),require("@progress/kendo-react-data-tools"),require("@progress/kendo-react-treelist"),require("@progress/kendo-react-intl"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-buttons"),require("react-dom"),require("@progress/kendo-react-form"),require("@progress/kendo-react-dialogs"),require("@progress/kendo-react-labels"),require("@progress/kendo-react-inputs"),require("@progress/kendo-react-layout"),require("@progress/kendo-react-dateinputs"),require("@progress/kendo-react-dropdowns"),require("@progress/kendo-react-grid"),require("@progress/kendo-data-query")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-date-math","@progress/kendo-react-data-tools","@progress/kendo-react-treelist","@progress/kendo-react-intl","@progress/kendo-svg-icons","@progress/kendo-react-buttons","react-dom","@progress/kendo-react-form","@progress/kendo-react-dialogs","@progress/kendo-react-labels","@progress/kendo-react-inputs","@progress/kendo-react-layout","@progress/kendo-react-dateinputs","@progress/kendo-react-dropdowns","@progress/kendo-react-grid","@progress/kendo-data-query"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactGantt={},e.React,e.PropTypes,e.KendoReactCommon,e.KendoDateMath,e.KendoReactDataTools,e.KendoReactTreelist,e.KendoReactIntl,e.KendoSvgIcons,e.KendoReactButtons,e.ReactDOM,e.KendoReactForm,e.KendoReactDialogs,e.KendoReactLabels,e.KendoReactInputs,e.KendoReactLayout,e.KendoReactDateinputs,e.KendoReactDropdowns,e.KendoReactGrid,e.KendoDataQuery)}(this,(function(e,t,n,a,o,r,l,s,i,d,c,u,m,p,g,h,f,k,y,v){"use strict";function C(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var D=C(t),E=C(c);const b=r.TABLE_ROW_INDEX_ATTRIBUTE,I=r.TABLE_COL_INDEX_ATTRIBUTE,w=r.TABLE_PREVENT_SELECTION_ELEMENT,S=(new Date).getTime(),R={skeleton:"MEd"},T=100,x="data-dependency-drag-handle",F={[x]:"start"},N={[x]:"finish"},M="data-task-id",z={id:"id",start:"start",end:"end",title:"title",percentComplete:"percentComplete",parentId:"parentId",isRollup:"isRollup",isExpanded:"isExpanded",isInEdit:"isInEdit",children:"children",isSelected:"isSelected"},L={id:"id",fromId:"fromId",toId:"toId",type:"type"},W=r.orderBy,H=r.filterBy,K=a.mapTree,P=a.extendDataItem,V=l.createDataTree,O=e=>o.getDate(e),A=(e,t)=>o.getDate(o.addDays(e,t||1));function B(e){return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))}const G=(e,t,n,a)=>a?_(e,t,n):$(e,t,n),_=(e,t,n)=>{n.push({top:e-2,left:t}),n.push({top:e,left:t-4+1}),n.push({top:e+2,left:t}),n.push({top:e,left:t})},$=(e,t,n)=>{n.push({top:e+2,left:t}),n.push({top:e,left:t+4-1}),n.push({top:e-2,left:t}),n.push({top:e,left:t})},q=e=>{if(void 0===e.workWeekStart||void 0===e.workWeekEnd)return[];const t=[];let n=e.workWeekStart;for(t.push(n);e.workWeekEnd!==n;)n>6?n-=7:n++,t.push(n);return t},U=(e,t)=>{const n=e.getDay();return t.indexOf(n)>-1},Z=(e,{step:t,timezone:n})=>{const a=[],r=o.ZonedDate.fromLocalDate(e.start,n),l=o.ZonedDate.fromLocalDate(e.end,n);let s=r.clone();for(;s.getTime()<l.getTime();){const e=s.clone(),n=e.clone().addTime(t),o=new Date(e.getTime()),r={end:new Date(n.getTime()),start:o,zonedStart:e,zonedEnd:n};a.push(r),s=s.addTime(t)}return a},j=(e,t,n)=>Z(e,{step:o.MS_PER_DAY,timezone:t.timezone}).map((e=>({range:e,isWork:U(e.start,t.workDays),span:1,text:n.formatDate(e.zonedStart,R),type:"day"}))),Y=(e,t,n)=>((e,{timezone:t},n)=>{const a=[],r=o.ZonedDate.fromLocalDate(e.start,t),l=o.ZonedDate.fromLocalDate(e.end,t);for(let e=r.clone(),s=0;e.getTime()<l.getTime();s++){const r=e.clone(),s=A(o.firstDayInWeek(o.getDate(r),n.firstDay()),7),i=o.ZonedDate.fromUTCDate(B(s),t),d=i.getTime()>l.getTime()?l.clone():i;e=d.clone();const c=new Date(r.getTime()),u={end:new Date(d.getTime()),start:c,zonedStart:r,zonedEnd:d};a.push(u)}return a})(e,{timezone:t.timezone},n).map((e=>{const t=Math.round((e.zonedEnd.getTime()-e.zonedStart.getTime())/o.MS_PER_DAY);return{range:e,isWork:!1,span:t,text:`${n.formatDate(e.zonedStart,R)} - ${n.formatDate(e.zonedEnd,R)}`,type:"week"}})),X=(e,t,n)=>((e,{timezone:t})=>{const n=[],a=o.ZonedDate.fromLocalDate(e.start,t),r=o.ZonedDate.fromLocalDate(e.end,t);for(let e=a.clone(),l=0;e.getTime()<r.getTime();l++){const a=e.clone(),r=o.ZonedDate.fromLocalDate(o.addMonths(new Date(a.getTime()),1),t);e=r.clone();const l=new Date(a.getTime()),s={end:new Date(r.getTime()),start:l,zonedStart:a,zonedEnd:r};n.push(s)}return n})(e,{timezone:t.timezone}).map((e=>{const t=Math.round((e.zonedEnd.getTime()-e.zonedStart.getTime())/o.MS_PER_DAY);return{range:e,isWork:!1,span:t,text:n.formatDate(e.zonedStart,"MMM"),type:"month"}})),Q=(e,t,n)=>((e,{timezone:t})=>{const n=[],a=o.ZonedDate.fromLocalDate(e.start,t),r=o.ZonedDate.fromLocalDate(e.end,t);for(let e=a.clone(),l=0;e.getTime()<r.getTime();l++){const a=e.clone(),r=o.ZonedDate.fromLocalDate(o.addMonths(new Date(a.getTime()),12),t);e=r.clone();const l=new Date(a.getTime()),s={end:new Date(r.getTime()),start:l,zonedStart:a,zonedEnd:r};n.push(s)}return n})(e,{timezone:t.timezone}).map((e=>{const t=Math.round((e.zonedEnd.getTime()-e.zonedStart.getTime())/o.MS_PER_DAY);return{range:e,isWork:!1,span:t,text:n.formatDate(e.zonedStart,"yyyy"),type:"year"}})),J=(e,t)=>!!a.getter(t)(e),ee=(e,t)=>!!a.getter(t)(e),te=D.createContext([]);te.displayName="KendoReactGanttTaskDataContext";const ne=D.createContext([]);ne.displayName="KendoReactGanttDependencyDataContext";const ae=D.createContext(z),oe=()=>D.useContext(ae);ae.displayName="KendoReactGanttTaskModelFieldsContext";const re=D.createContext(L),le=()=>D.useContext(re);re.displayName="KendoReactGanttDependencyModelFieldsContext";const se=D.createContext({}),ie=()=>D.useContext(se);se.displayName="KendoReactGanttPropsContext";const de=D.createContext({start:new Date,end:new Date,zonedStart:o.ZonedDate.fromLocalDate(new Date),zonedEnd:o.ZonedDate.fromLocalDate(new Date)}),ce=()=>D.useContext(de);de.displayName="KendoReactGanttDateRangeContext";const ue=D.createContext([]);ue.displayName="KendoReactGanttViewsContext";const me=D.createContext(["week",a.noop]),pe=()=>D.useContext(me);me.displayName="KendoReactGanttActiveViewContext";const ge=D.createContext(0),he=()=>D.useContext(ge);ge.displayName="KendoReactGanttRowHeightContext";const fe=D.createContext(0);fe.displayName="KendoReactGanttToolbarHeightContext";const ke=D.createContext({onDataStateChange:a.noop,onSortChange:a.noop,onFilterChange:a.noop,onColumnMenuFilterChange:a.noop,onExpandChange:a.noop,onRowClick:a.noop,onRowDoubleClick:a.noop,onRowContextMenu:a.noop,onColumnResize:a.noop,onColumnReorder:a.noop,onDependencyCreate:a.noop,onKeyDown:a.noop,onSelectionChange:a.noop,onHeaderSelectionChange:a.noop});ke.displayName="KendoReactGanttEventsContext";const ye=D.createContext({onTaskClick:a.noop,onTaskDoubleClick:a.noop,onTaskContextMenu:a.noop});ye.displayName="KendoReactGanttTaskEventsContext";const ve=({children:e,taskData:t,dependencyData:n,taskModelFields:a,dependencyModelFields:o,props:r,dateRange:l,views:s,activeView:i,rowHeight:d,toolbarHeight:c,events:u,taskEvents:m})=>D.createElement(se.Provider,{value:r},D.createElement(te.Provider,{value:t},D.createElement(ne.Provider,{value:n},D.createElement(ae.Provider,{value:a},D.createElement(re.Provider,{value:o},D.createElement(de.Provider,{value:l},D.createElement(ue.Provider,{value:s},D.createElement(me.Provider,{value:i},D.createElement(ge.Provider,{value:d},D.createElement(fe.Provider,{value:c},D.createElement(ke.Provider,{value:u},D.createElement(ye.Provider,{value:m},e))))))))))));ve.displayName="KendoReactGanttContext";const Ce=D.createContext([{current:{}},a.noop]),De=()=>D.useContext(Ce);Ce.displayName="KendoReactGanttViewContext";const Ee=D.createContext(0);Ee.displayName="KendoReactGanttViewTimelineWidthContext";const be=D.createContext({onDependencyHandlePress:a.noop,onDependencyHandleDrag:a.noop,onDependencyHandleRelease:a.noop,isEnabled:!1,draggedId:null});be.displayName="KendoReactGanttViewDependencyDragContext";const Ie=({children:e,tasksStore:t,timelineWidth:n,dependencyDrag:a})=>D.createElement(Ce.Provider,{value:t},D.createElement(Ee.Provider,{value:n},D.createElement(be.Provider,{value:a},e)));Ie.displayName="KendoReactGanttViewContext";var we=(e=>(e[e.add=0]="add",e[e.remove=1]="remove",e))(we||{});const Se=D.forwardRef(((e,t)=>{const n=ce(),o=oe(),r=D.useContext(Ee),l=D.useContext(be),s=D.useContext(ye),d=D.useRef(null),c=D.useRef(null);((e,t,n,o)=>{const r=D.useRef(null),[,l]=De();D.useImperativeHandle(r,(()=>({element:o.current,dataItem:e}))),D.useImperativeHandle(n,(()=>r.current)),a.useIsomorphicLayoutEffect((()=>{const e=r.current;if(e)return l({type:we.add,itemRef:e,id:t}),()=>{l({type:we.remove,itemRef:e,id:t})}}))})(e.dataItem,a.getter(o.id)(e.dataItem),t,d);const u=D.useRef(null),m=a.getter(o.id)(e.dataItem),p=a.getter(o.start)(e.dataItem),g=a.getter(o.end)(e.dataItem),h=a.getter(o.title)(e.dataItem),f=a.getter(o.percentComplete)(e.dataItem),k=a.getter(o.children)(e.dataItem),y=a.getter(o.isSelected)(e.dataItem),v=p&&p.getTime(),C=g&&g.getTime(),E=k&&k.length,b=!E&&v===C,I=v&&C&&((e,t,n,a)=>n<t&&e<=a)(n.start,n.end,p,g),[w,S]=D.useState(!1),R=D.useRef(null),T=D.useRef(null);a.useDraggable(R,{onPress:l.onDependencyHandlePress,onDrag:l.onDependencyHandleDrag,onRelease:l.onDependencyHandleRelease}),a.useDraggable(T,{onPress:l.onDependencyHandlePress,onDrag:l.onDependencyHandleDrag,onRelease:l.onDependencyHandleRelease});const x=D.useCallback((t=>{s.onTaskClick&&s.onTaskClick({dataItem:e.dataItem,level:e.level,nativeEvent:t&&t.nativeEvent,syntheticEvent:t,target:null})}),[e.dataItem,e.level]),z=D.useCallback((t=>{s.onTaskDoubleClick&&s.onTaskDoubleClick({dataItem:e.dataItem,level:e.level,nativeEvent:t&&t.nativeEvent,syntheticEvent:t,target:null})}),[e.dataItem,e.level]),L=D.useCallback((t=>{s.onTaskContextMenu&&s.onTaskContextMenu({dataItem:e.dataItem,level:e.level,nativeEvent:t&&t.nativeEvent,syntheticEvent:t,target:null})}),[e.dataItem,e.level]),W=D.useCallback((t=>{s.onTaskRemoveClick&&s.onTaskRemoveClick({dataItem:e.dataItem,level:e.level,nativeEvent:t&&t.nativeEvent,syntheticEvent:t,target:null})}),[e.dataItem,e.level]),H=D.useCallback((()=>{const e=n.start,t=n.end,a=u.current,o=d.current,r=c.current;if(!I||null===a||null===o)return;const l=a.clientWidth/(t.getTime()-e.getTime()),s=(p.getTime()-e.getTime())*l,i=(g.getTime()-p.getTime())*l,m=(a.offsetHeight-o.offsetHeight)/2;o.style.left=`${Math.round(b?s-6:s)}px`,o.style.top=`${Math.round(m)}px`,b||(o.style.width=`${Math.round(i)}px`,null!==r&&(r.style.width=`${Math.round(i*(f||0))}px`)),S(!0)}),[n.start.getTime(),n.end.getTime(),v,C,I,f,r]);D.useEffect(H,[H]);const K={visibility:w?void 0:"hidden",display:I?void 0:"none"},P={userSelect:"none",display:l.draggedId===String(m)?"block":void 0};return D.createElement("td",{ref:u,key:m,role:"presentation"},b?D.createElement("div",{"aria-hidden":!0,className:a.classNames({"k-task":!0,"k-task-milestone":!0,"k-selected":y&&!Array.isArray(y)}),style:K,ref:d,[M]:m,onClick:x,onDoubleClick:z,onContextMenu:L},D.createElement("div",{className:"k-task-milestone-content"}),l.isEnabled&&D.createElement("div",{className:"k-task-dot k-task-start",ref:R,style:P,...F}),l.isEnabled&&D.createElement("div",{className:"k-task-dot k-task-end",ref:T,style:P,...N})):D.createElement("div",{"aria-hidden":!0,className:a.classNames({"k-task":!0,"k-task-summary":E,"k-task-single":!E,"k-selected":y&&!Array.isArray(y)}),ref:d,style:K,[M]:m,onClick:x,onDoubleClick:z,onContextMenu:L},E?D.createElement("div",{className:"k-task-summary-progress",ref:c},D.createElement("div",{className:"k-task-summary-complete"})):D.createElement("div",{className:"k-task-complete",ref:c}),!E&&D.createElement(D.Fragment,null,D.createElement("div",{className:"k-task-content"},h),s.onTaskRemoveClick?D.createElement("span",{className:"k-task-actions"},D.createElement("span",{onClick:W,className:"k-link k-task-delete","aria-label":"Delete"},D.createElement(a.IconWrap,{name:"x",icon:i.xIcon}))):null),l.isEnabled&&D.createElement("div",{className:"k-task-dot k-task-start",ref:R,style:P,...F}),l.isEnabled&&D.createElement("div",{className:"k-task-dot k-task-end",ref:T,style:P,...N})))}));Se.displayName="KendoReactGanttTask";const Re=e=>{const{dependency:t}=e,[n]=De(),o=D.useRef(null),r=le(),l=he(),[s,i]=D.useState(!1);return D.useEffect((()=>{if(null===o.current||null===n.current)return void i(!1);const e=n.current[a.getter(r.fromId)(t)],d=n.current[a.getter(r.toId)(t)];if(!e||!d)return void i(!1);const c=e.element,u=d.element;if(!c||!u)return void i(!1);if(!1===s)return void i(!0);const m={top:c.offsetTop+c.offsetHeight/2,start:c.offsetLeft,end:c.offsetLeft+c.offsetWidth},p={top:u.offsetTop+u.offsetHeight/2,start:u.offsetLeft,end:u.offsetLeft+u.offsetWidth},g=a.getter(r.type)(t),h=((e,t,n,a)=>{const o=[];let r=0,l=0;const s=10,i=Math.floor(n/2),d=e.top<t.top,c=()=>o.push({left:l,top:r});if(0===a||3===a){const n=3===a?"start":"end";r=e.top,l=e[n],c(),l=Math["start"===n?"min":"max"](e[n],t[n]),l="start"===n?l-s:l+s,c(),r=t.top,c(),l="start"===n?t[n]-4:t[n]+4,c(),G(r,l,o,"start"!==n)}else{const n=2===a?"start":"end",u=2===a?"end":"start",m=2===a?e[n]-20>=t[u]:e[n]+20<=t[u];r=e.top,l=e[n],c(),l="start"===n?l-s:l+s,c(),m||(r=d?r+i:r-i,c(),l="start"===n?t[u]+s:t[u]-s,c()),r=t.top,c(),l="start"===u?t[u]-4:t[u]+4,c(),G(r,l,o,"start"!==u)}return o})(m,p,l,g);h&&h.length&&o.current.setAttribute("points",h.map((e=>`${e.left},${e.top}`)).join(" "))})),D.createElement("polyline",{ref:o,style:{display:s?void 0:"none"}})};Re.displayName="KendoReactGanttDependency";const Te=class extends D.Component{constructor(e){super(e),this.state={activeId:void 0,level:0},this.tableElement=null,this.tbodyElement=null,this.wrapperScrollLeft=0,this.wrapperScrollTop=0,this.updateOnScroll=!1,this.tbodyOffsetTop=0,this.prevData=[],this.flattedData=[],this.element=null,this.contextStateRef={current:void 0},this.navigationStateRef={current:void 0},this.scrollIntoView=e=>{if(!this.element)return;const{rowIndex:t=0}=e,{rowHeight:n=0}=this.props;this.element.scroll(0,(t-1)*n)},this.getColumns=e=>{const t=e.filter((e=>e.declarationIndex>=0&&-1===e.parentIndex)),n=e=>(e.sort(((e,t)=>e.declarationIndex-t.declarationIndex)),e.map((e=>{const{declarationIndex:t,parentIndex:a,depth:o,colSpan:r,rowSpan:l,index:s,kFirst:i,groupable:d,children:c,...u}=e;return c.length?{children:n(c),...u}:u})));return n(t)},this.onKeyDown=e=>{if(r.tableKeyboardNavigation.onKeyDown(e,{contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef}),this.props.onKeyDown){const{mode:t,cell:n}=r.getSelectionOptions(this.props.selectable),a={dataItems:this.getLeafDataItems(),mode:t,cell:n,componentId:this.props.treelistId,selectedField:this.props.selectedField,...this.getEventArguments(e)};this.props.onKeyDown.call(void 0,a)}},this.onFocus=e=>{r.tableKeyboardNavigation.onFocus(e,{contextStateRef:this.contextStateRef})},this.onRowDrag=e=>{if(this.props.onRowDrag){const t={...e,target:this};this.props.onRowDrag.call(void 0,t)}},this.onRowDrop=e=>{if(this.props.onRowDrop){const t={...e,target:this};this.props.onRowDrop.call(void 0,t)}},this.onColumnReorder=(e,t,n)=>{const{extendedColumns:a}=this.props,o=a[e].depth,r=e=>{do{e++}while(e<a.length&&a[e].depth>o);return e},l=[...a],s=l.splice(e,r(e)-e);if(l.splice(e<t?r(t-s.length):t,0,...s),l.filter((e=>e.declarationIndex>=0)).forEach(((e,t)=>e.orderIndex=t)),this.props.onColumnReorder){const e={target:this,columns:this.getColumns(l),nativeEvent:n};this.props.onColumnReorder.call(void 0,e)}},this.onColumnResize=(e,t,n,a,o)=>{if(this.props.onColumnResize){const r=this.props.extendedColumns.filter((e=>0===e.children.length)).reduce(((e,t)=>e+parseFloat(String(t.width))),0);this.tableElement&&(this.tableElement.style.width=r+"px");const l={columns:this.getColumns(this.props.extendedColumns),totalWidth:r,index:e,nativeEvent:a,newWidth:t,oldWidth:n,end:o,target:this};this.props.onColumnResize.call(void 0,l)}},this.onScroll=e=>{const t=e.currentTarget.scrollLeft,n=e.currentTarget.scrollTop,{columnVirtualization:a,scrollable:o,rowHeight:r=0}=this.props,l=r;let s=!1;a&&Math.abs(this.wrapperScrollLeft-t)>0&&(this.wrapperScrollLeft=t,s=!0),"virtual"===o&&Math.abs(this.wrapperScrollTop-n)>l&&(this.wrapperScrollTop=n,s=!0),s&&(this.updateOnScroll=!0,this.forceUpdate())},this.calculateSizes=e=>{if(!e||"none"===this.props.scrollable)return;const t=Array.from(e.childNodes),n=t.find((e=>"TABLE"===e.nodeName)),a=this.props.toolbar&&t.find((e=>1===e.nodeType&&e.classList.contains("k-grid-toolbar")));let o=0;if(a){const e=a.style.boxSizing;a.style.boxSizing="border-box",o=parseFloat(String(window.getComputedStyle(a).height))||a.offsetHeight,a.style.boxSizing=e,a.getAttribute("style")||a.removeAttribute("style")}this.tbodyOffsetTop=n.tBodies[0].offsetTop,l.setHeaderRowsTop(n,o)},this.onItemChange=e=>{if(e.field!==this.props.expandField){if(this.props.onItemChange){const t={...this.getEventArguments(e.syntheticEvent),dataItem:e.dataItem,level:e.level,field:e.field,value:e.value};this.props.onItemChange.call(void 0,t)}}else{const t=this.props.onExpandChange;if(t){const n={...this.getEventArguments(e.syntheticEvent),dataItem:e.dataItem,level:e.level,value:e.value};t.call(void 0,n)}}},this.onHeaderSelectionChange=e=>{if(this.props.onHeaderSelectionChange){const t={field:e.field,nativeEvent:e.syntheticEvent&&e.syntheticEvent.nativeEvent,syntheticEvent:e.syntheticEvent,target:this,dataItems:this.getLeafDataItems()};this.props.onHeaderSelectionChange.call(void 0,t)}},this.selectionRelease=e=>{if(this.props.onSelectionChange){const t={syntheticEvent:void 0,target:this,selectedField:this.props.selectedField||"",componentId:this.props.treelistId,dataItems:this.getLeafDataItems(),dataItem:null,level:[],...e};this.props.onSelectionChange.call(void 0,t)}},this.onSortChange=(e,t,n)=>{this.onDataStateChange(this.props.onSortChange,{sort:t,field:n},e)},this.onFilterChange=e=>{const{filter:t,field:n}=e;this.onDataStateChange(this.props.onFilterChange,{filter:t,field:n},e.syntheticEvent)},this.onColumnMenuFilterChange=(e,t,n)=>{if(!n)return;const{onColumnMenuFilterChange:a}=this.props;if(!a)return;const o={syntheticEvent:e,filter:t,field:n,target:this,nativeEvent:e.nativeEvent};a.call(void 0,o)},this.onExpandChange=(e,t,n)=>{const{expandField:a,onExpandChange:o}=this.props;if(a&&o){const a={...this.getEventArguments(e),dataItem:t,level:n,value:J(t,this.props.expandField)};o.call(void 0,a)}},this.onRowClick=(e,t)=>{if(this.props.onRowClick&&"TD"===e.target.nodeName){const n={dataItem:t.dataItem,level:t.level,...this.getEventArguments(e)};this.props.onRowClick.call(void 0,n)}},this.rowDoubleClick=(e,t)=>{if(this.props.onRowDoubleClick&&"TD"===e.target.nodeName){const n={dataItem:t.dataItem,level:t.level,...this.getEventArguments(e)};this.props.onRowDoubleClick.call(void 0,n)}},this.rowContextMenu=(e,t)=>{if(this.props.onRowContextMenu&&"TD"===e.target.nodeName){const n={dataItem:t.dataItem,level:t.level,...this.getEventArguments(e)};this.props.onRowContextMenu.call(void 0,n)}},this.onPageChange=e=>{if(this.props.onPageChange){const t={...this.getEventArguments(e.syntheticEvent),skip:e.skip,take:e.take};this.props.onPageChange.call(void 0,t)}},this.onDataStateChange=(e,t,n)=>{if(e&&e.call(void 0,{...this.getEventArguments(n),...t}),this.props.onDataStateChange){const e={...this.getEventArguments(n),dataState:{...this.getDataState(),...t}};this.props.onDataStateChange.call(void 0,e)}},this.getDataState=()=>({filter:this.props.filter,sort:this.props.sort}),this.getEventArguments=e=>({nativeEvent:e&&e.nativeEvent,syntheticEvent:e,target:this}),this.getLeafDataItems=()=>this.flatData.map((e=>e.dataItem)),this.dragLogic=new r.CommonDragLogic(this.onColumnReorder,a.noop,a.noop),this.columnResize=new r.ColumnResize(this.onColumnResize),r.tableKeyboardNavigation.onConstructor({navigatable:!!e.navigatable,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef,idPrefix:e.idPrefix})}get document(){if(a.canUseDOM)return this.element&&this.element.ownerDocument||document}componentDidMount(){this.calculateSizes(this.element),r.tableKeyboardNavigation.onComponentDidMount({scope:this.element||void 0,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef})}getSnapshotBeforeUpdate(){return r.tableKeyboardNavigation.onGetSnapshotBeforeUpdate({document:this.document,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef}),null}componentDidUpdate(e){e.columns!==this.props.columns&&this.calculateSizes(this.element),r.tableKeyboardNavigation.onComponentDidUpdate({scope:this.element||void 0,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef})}componentWillUnmount(){this.columnResize.columns=[],this.dragLogic.columns=[],this.prevData=[],this.flattedData=[],this.updateOnScroll=!1}render(){const{filterRow:e,scrollable:t="scrollable",resizable:n=!1,reorderable:o=!1,skip:s,take:i,afterContent:d,extendedColumns:c=[],columnsMap:u}=this.props,m=c.some((e=>!!e.filter))||void 0!==e,p=e||r.FilterRow,g=r.tableKeyboardNavigationTools.getIdPrefix(this.navigationStateRef);this.columnResize.columns=c,this.columnResize.resizable=n,this.dragLogic.columns=c,this.dragLogic.reorderable=o,this.dragLogic.groupable=!1;const h=c.filter((e=>0===e.children.length)),f=D.createElement(r.Header,{headerRow:D.createElement(r.HeaderRow,{sort:this.props.sort,sortable:this.props.sortable,sortChange:this.onSortChange,selectionChange:this.onHeaderSelectionChange,columns:c,columnsMap:u,cellRender:this.props.headerCellRender,columnResize:this.columnResize,columnMenu:this.props.columnMenu,columnMenuFilter:this.props.columnMenuFilter,columnMenuFilterChange:this.onColumnMenuFilterChange,pressHandler:this.dragLogic.pressHandler,dragHandler:this.dragLogic.dragHandler,releaseHandler:this.dragLogic.releaseHandler}),filterRow:m&&D.createElement(p,{columns:h,filter:this.props.filter,filterChange:this.onFilterChange,sort:this.props.sort,ariaRowIndex:u.length+1})||void 0,columnResize:this.columnResize}),k=this.props.style||{},{colSpans:y,hiddenColumns:v}=r.tableColumnsVirtualization({enabled:this.props.columnVirtualization,columns:h,scrollLeft:this.wrapperScrollLeft,tableViewPortWidth:parseFloat((k.width||"").toString())}),C=(e,t,n,a,o,s)=>h.map(((i,d)=>{if(v[d])return null;const c=i.id?i.id:d,u=`k-table-td ${i.className?i.className+" ":""}${i.locked?"k-grid-content-sticky":""}`,m={id:r.tableKeyboardNavigationTools.generateNavigatableId(`${n}-${String(d)}`,g),colSpan:y[d],dataItem:e.dataItem,field:i.field,format:i.format,className:u||void 0,render:this.props.cellRender,onChange:this.onItemChange,selectionChange:this.props.onSelectionChange?t=>{this.onSelectionChange({event:t,item:e,columnIndex:d,dataIndex:o})}:void 0,level:e.level,expandable:i.expandable,expanded:a,hasChildren:ee(e.dataItem,this.props.subItemsField),colIndex:d,ariaColumnIndex:i.ariaColumnIndex,onExpandChange:this.onExpandChange,style:void 0!==i.left&&{left:i.left,right:i.right,borderRightWidth:i.rightBorder?"1px":""}||{},isSelected:Array.isArray(s)&&s.indexOf(d)>-1};return t&&i.editCell?D.createElement(i.editCell,{...m,onChange:this.onItemChange,key:c}):i.cell?D.createElement(i.cell,{key:c,...m}):D.createElement(l.TreeListCell,{key:c,...m})}));let E=this.flatData;const b=E.length;void 0!==s&&void 0!==i&&(E=E.slice(s,s+i)),"virtual"===t&&(E=l.tableRowsVirtualization({rows:E,tableViewPortHeight:parseFloat((k.height||k.maxHeight||"").toString()),scrollTop:this.wrapperScrollTop}),this.updateOnScroll=!1);const I=E.map((e=>e.level)),w=u.length+(m?1:0)+1,S=E.length>0&&E.map(((e,t)=>{const n=a.getter(this.props.editField||"")(e.dataItem),o=a.getter(this.props.dataItemKey)(e.dataItem),r=String(o||e.level.join(".")),s=J(e.dataItem,this.props.expandField),i=this.props.selectedField?a.getter(this.props.selectedField)(e.dataItem):void 0,d={key:r,level:e.level,levels:I,dataItem:e.dataItem,selectedField:this.props.selectedField,rowHeight:e.height,render:this.props.rowRender,onDrop:this.onRowDrop,onDrag:this.onRowDrag,onClick:t=>this.onRowClick(t,e),onDoubleClick:t=>this.rowDoubleClick(t,e),onContextMenu:t=>this.rowContextMenu(t,e),isAltRow:t%2!=0,expanded:s,rowIndex:t,ariaRowIndex:w+t,ariaSetSize:e.levelCount,ariaPosInSet:e.level[e.level.length-1]+1,isSelected:"boolean"==typeof i&&i},c=this.props.editRow,u=this.props.row||l.TreeListRow,m=C(e,n,r,s,t,i);return n&&c?D.createElement(c,{...d,key:d.key},m):D.createElement(u,{...d,key:d.key},m)}))||D.createElement("tr",{className:"k-table-row k-grid-norecords"},D.createElement("td",{className:"k-table-td",colSpan:h.length},this.props.noRecords||D.createElement(l.TreeListNoRecords,null))),R=e=>this.props.sort&&this.props.sort.some((t=>t.field===e)),T=D.createElement("colgroup",{ref:e=>{this.columnResize.colGroupMain=e}},h.map(((e,t)=>D.createElement("col",{key:t.toString(),className:R(e.field)?"k-sorted":void 0,style:void 0!==e.width?{width:e.width}:void 0})))),x=this.props.columnVirtualization||"virtual"===this.props.scrollable,F=this.props.selectable&&this.props.selectable.drag?"none":void 0,N=this.props.tableProps||{};return D.createElement(r.TableKeyboardNavigationContext.Provider,{value:this.contextStateRef.current},D.createElement("div",{id:this.props.treelistId,style:this.props.style,className:a.classNames("k-grid k-grid-md",this.props.className,{"k-treelist-scrollable":"none"!==t}),ref:e=>this.element=e,onScroll:x?this.onScroll:void 0,onKeyDown:this.onKeyDown,onFocus:this.onFocus,"aria-rowcount":b,"aria-colcount":h.length,role:"treegrid",...r.tableKeyboardNavigationScopeAttributes},this.props.toolbar,D.createElement(r.TableSelection,{selectable:this.props.selectable,onRelease:this.selectionRelease,childRef:e=>{this.tableElement=e}},D.createElement("table",{className:"k-table k-table-md",...this.props.tableProps||{},style:{...N.style||{},userSelect:F},role:"presentation"},T,f,D.createElement("tbody",{className:"k-table-tbody",...r.tableKeyboardNavigationBodyAttributes,ref:e=>this.tbodyElement=e,role:"presentation"},S))),this.props.pager&&D.createElement(this.props.pager,{className:"k-grid-pager",total:b,skip:s,take:i,onPageChange:this.onPageChange}),o&&D.createElement(D.Fragment,null,D.createElement(r.DropClue,{ref:this.dragLogic.refDropElementClue}),D.createElement(r.DragClue,{ref:this.dragLogic.refDragElementClue})),d))}get flatData(){const{data:e=[],rowHeight:t=0}=this.props;let n=0;const a=()=>{const e={height:t,offsetTop:n};return n+=e.height,e},o=this.updateOnScroll&&this.prevData===e&&this.tbodyOffsetTop>0&&this.flattedData.length?this.flattedData:e.map((e=>({...e,...a()})));return this.prevData=e,this.flattedData=o,o}onSelectionChange(e){if(this.props.onSelectionChange){const{event:t,item:n,dataIndex:a,columnIndex:o}=e,{mode:l,cell:s}=r.getSelectionOptions(this.props.selectable),i={...this.getEventArguments(t.syntheticEvent),dataItem:n.dataItem,level:n.level,startColIndex:o,endColIndex:o,startRowIndex:a,endRowIndex:a,dataItems:this.getLeafDataItems(),altKey:!1,ctrlKey:!1,shiftKey:!1,metaKey:!1,mode:l,cell:s,isDrag:!1,componentId:this.props.treelistId,selectedField:this.props.selectedField||""};this.props.onSelectionChange.call(void 0,i)}}};Te.propTypes={data:n.array,resizable:n.bool,reorderable:n.bool,sortable:n.oneOfType([n.bool,n.shape({mode:n.oneOf(["single","multiple"]),allowUnsort:n.bool})]),onSortChange:n.func,sort:n.array,columns:n.arrayOf(n.object),columnVirtualization:n.bool,filter:n.array,onFilterChange:n.func,filterRow:n.any,toolbar:n.any,noRecords:n.any,onExpandChange:n.func,expandField:n.string,subItemsField:n.string,selectedField:n.string,onSelectionChange:n.func,onHeaderSelectionChange:n.func,onRowClick:n.func,onItemChange:n.func,editField:n.string,scrollable:n.oneOf(["none","scrollable","virtual"]),rowHeight:n.number,style:n.object,tableProps:n.object,pager:n.any,skip:n.number,take:n.number,onPageChange:n.func,onDataStateChange:n.func,onColumnResize:n.func,onColumnReorder:n.func,extendedColumns:n.arrayOf(n.object),columnsMap:n.arrayOf(n.array),dataItemKey:n.string.isRequired,afterContent:n.any,navigatable:n.bool,idPrefix:n.string,treelistId:n.string},Te.contextType=r.TableKeyboardNavigationContext;let xe=Te;const Fe=D.forwardRef(((e,t)=>{const{slotLevels:n,slotWidth:o,timelineHeaderCell:l}=e,{columns:s,noRecords:i,resizable:d,reorderable:c,sortable:u,sort:m,filter:p,columnMenuFilter:g,columnMenu:h,navigatable:f,row:k,selectable:y}=ie(),{onDataStateChange:v,onSortChange:C,onFilterChange:E,onColumnMenuFilterChange:b,onExpandChange:I,onRowClick:w,onRowDoubleClick:S,onRowContextMenu:R,onColumnResize:F,onColumnReorder:N,onDependencyCreate:z,onKeyDown:L,onSelectionChange:W,onHeaderSelectionChange:H}=D.useContext(ke),K=he(),P=D.useContext(fe),V=oe(),O=le(),A=D.useContext(te),B=D.useContext(ne),G=D.useRef(null),_=D.useRef(null),$=D.useRef(null),q=D.useRef(null),U=D.useRef(0),Z=D.useRef(a.useId()),j=D.useRef(a.useId()),Y=D.useRef(null),X=D.useRef(null),Q=D.useCallback((e=>{$.current&&$.current.scrollIntoView(e)}),[]);D.useImperativeHandle(X,(()=>({scrollIntoView:Q}))),D.useImperativeHandle(t,(()=>X.current));const J=D.useRef(0),ee=D.useRef(0),ae=D.useRef(0),re=D.useRef(0),se=D.useRef(null),de=D.useRef(null),[ce,ue]=D.useState(null),me=((e,t,n)=>{const o=n;return D.createElement("table",{className:"k-table k-table-md",ref:t,"aria-hidden":!0},D.createElement("tbody",{className:"k-table-tbody"},e.map(((e,t)=>D.createElement("tr",{className:"k-table-row",key:t},e.map(((e,n)=>D.createElement("td",{key:e.range.start.getTime(),colSpan:e.span,className:a.classNames("k-table-th",{"k-header":!0,"k-nonwork-hour":!e.isWork})},o?D.createElement(o,{rowIndex:t,index:n,range:e.range,text:e.text,isWork:e.isWork,type:e.type}):e.text))))))))})(n,G,l),pe=((e,t)=>{const n=e[e.length-1];return D.createElement("table",{className:"k-table k-table-md k-gantt-columns",ref:t,"aria-hidden":!0},D.createElement("tbody",{className:"k-table-tbody"},D.createElement("tr",{className:"k-table-row"},n.map((e=>D.createElement("td",{key:e.range.start.getTime(),colSpan:e.span,className:a.classNames("k-table-td",{"k-nonwork-hour":!e.isWork})}))))))})(n,_),ge=((e,t)=>{const n=e[e.length-1];let a=0,o=0;return n.forEach((e=>{const t=e.span;o+=t,t>a&&(a=t)})),Math.round(o*t/a)})(n,o),{extendedColumns:ye,columnsWidth:ve,columnsMap:Ce}=D.useMemo((()=>{const e=r.readColumns([...s,{title:"",sortable:!1,resizable:!1,reorderable:!1,width:ge,headerCell:()=>me,cell:Se,orderIndex:Number.MAX_SAFE_INTEGER,navigatable:!1}],{prevId:0,idPrefix:Z.current});let t=0;return e.forEach(((e,n,a)=>{const o=n+1===a.length,r=0===e.children.length;o?e.isAccessible=!1:(e.locked=!0,r&&(e.width=e.width||T)),r&&(t+=parseFloat(String(e.width)))})),{extendedColumns:e,columnsWidth:t,columnsMap:r.mapColumns(e)}}),[s,ge]),[De,Ee]=(()=>{const e=D.useRef({}),t=D.useCallback((t=>{switch(t.type){case 0:e.current[t.id]=t.itemRef;break;case 1:delete e.current[t.id]}}),[]);return[e,t]})(),be=D.useCallback((()=>G.current&&G.current.parentElement),[]),we=()=>{const e=be(),t=_.current,n=$.current&&$.current.tbodyElement;if(!e||!t||!n)return;const a=n.offsetTop,o=e.offsetLeft,r=ge;t.style.top=a+"px",t.style.left=o+"px",t.style.width=r+"px",t.style.height=n.offsetHeight+"px"};D.useEffect(we),D.useEffect((()=>{const e=be();e&&(U.current=e.offsetLeft)}));const Te=D.useCallback((e=>{if(!q.current)return;const t=e.columns.slice(0,e.columns.length-1);if(e.end)q.current.style.left="0px";else{const e=be();if(!e)return;q.current.style.left=e.offsetLeft-U.current+"px",we()}F({...e,columns:t})}),[F]),Fe=D.useCallback((e=>{const t=e.columns.slice(0,e.columns.length-1);N({...e,columns:t})}),[F]),Ne=D.useCallback((e=>{const t=(Y.current&&Y.current.ownerDocument?Y.current.ownerDocument:document).elementFromPoint(e.clientX,e.clientY),n=Y.current;if(!t||!t.parentElement||!n)return;const a=n.parentElement,o=n.firstElementChild;if(!a||!o)return;const r=t.getAttribute(x);if(r){const l=n.offsetTop,s=n.offsetLeft,i=a.offsetTop,d=a.offsetLeft,c=o.scrollTop,u=o.scrollLeft;ae.current=s+d,re.current=l+i,J.current=e.clientX-ae.current+u,ee.current=e.clientY-re.current+c,se.current=t.parentElement.getAttribute(M),de.current=r}}),[]),Me=D.useCallback((e=>{const t=Y.current;if(!t)return;const n=t.firstElementChild;if(!n)return;const a=n.scrollTop,o=n.scrollLeft,r=e.clientX-ae.current+o,l=e.clientY-re.current+a;Math.abs(J.current-r)<10&&Math.abs(ee.current-l)<10||ue({startX:J.current,startY:ee.current,endX:r,endY:l})}),[]),ze=D.useCallback((e=>{const t=(Y.current&&Y.current.ownerDocument?Y.current.ownerDocument:document).elementFromPoint(e.clientX,e.clientY);if(!t||!t.parentElement)return;const n=t.parentElement.getAttribute(M),a=t.getAttribute(x);if(a&&n!==se.current&&z){let e;e="start"===de.current?"start"===a?3:2:"start"===a?1:0,z({fromId:se.current,toId:n,type:e})}J.current=0,ee.current=0,ae.current=0,re.current=0,se.current=null,de.current=null,ue(null)}),[z,ue]);return D.createElement(Ie,{tasksStore:[De,Ee],timelineWidth:ge,dependencyDrag:{isEnabled:!!z,draggedId:se.current,onDependencyHandlePress:Ne,onDependencyHandleDrag:Me,onDependencyHandleRelease:ze}},D.createElement("div",{className:"k-gantt-content",ref:Y,style:{height:`calc(100% - ${P}px)`}},D.createElement(xe,{treelistId:j.current,ref:$,extendedColumns:ye,columnsMap:Ce,dataItemKey:V.id,data:A,idPrefix:Z.current,navigatable:f,expandField:V.isExpanded,subItemsField:V.children,editField:V.isInEdit,selectedField:V.isSelected,onDataStateChange:v,onSortChange:C,onFilterChange:E,onExpandChange:I,onRowClick:w,onRowDoubleClick:S,onRowContextMenu:R,onColumnResize:Te,onColumnReorder:Fe,onColumnMenuFilterChange:b,onKeyDown:L,onSelectionChange:W,onHeaderSelectionChange:H,tableProps:{style:{width:ve},className:"k-table k-table-md k-table-layout-fixed"},noRecords:i,rowHeight:K,resizable:d,reorderable:c,sortable:u,sort:m,filter:p,columnMenuFilter:g,columnMenu:h,row:k,selectable:y,afterContent:D.createElement(D.Fragment,null,D.createElement("svg",{className:"k-gantt-dependencies-svg",ref:q,style:{left:0,top:0}},B.map((e=>D.createElement(Re,{key:a.getter(O.id)(e),dependency:e})))),D.createElement("svg",{className:"k-gantt-dependencies-svg",style:{left:0,top:0,zIndex:3}},ce&&D.createElement("polyline",{points:`${ce.startX},${ce.startY} ${ce.endX},${ce.endY}`})),A&&A.length?pe:null)})))}));Fe.displayName="KendoReactGanttBaseView";const Ne="gantt.weekViewTitle",Me="gantt.dayViewTitle",ze="gantt.monthViewTitle",Le="gantt.yearViewTitle",We="gantt.filterClearButton",He="gantt.filterEqOperator",Ke="gantt.filterNotEqOperator",Pe="gantt.filterIsNullOperator",Ve="gantt.filterIsNotNullOperator",Oe="gantt.filterIsEmptyOperator",Ae="gantt.filterIsNotEmptyOperator",Be="gantt.filterStartsWithOperator",Ge="gantt.filterContainsOperator",_e="gantt.filterNotContainsOperator",$e="gantt.filterEndsWithOperator",qe="gantt.filterGteOperator",Ue="gantt.filterGtOperator",Ze="gantt.filterLteOperator",je="gantt.filterLtOperator",Ye="gantt.filterIsTrue",Xe="gantt.filterIsFalse",Qe="gantt.filterBooleanAll",Je="gantt.filterAfterOrEqualOperator",et="gantt.filterAfterOperator",tt="gantt.filterBeforeOperator",nt="gantt.filterBeforeOrEqualOperator",at="gantt.editSave",ot="gantt.editCancel",rt="gantt.editAdd",lt="gantt.editRemove",st="gantt.editTabGeneral",it="gantt.editTabPredecessors",dt="gantt.editTabSuccessors",ct="gantt.editorTitle",ut="gantt.editorTaskTitle",mt="gantt.editorTaskStart",pt="gantt.editorTaskEnd",gt="gantt.editorTaskComplete",ht="gantt.editorTaskParent",ft="gantt.editorValidationRequired",kt="gantt.editorValidationStart",yt="gantt.editorValidationEnd",vt="gantt.editorValidationPercentCompleteRange",Ct="gantt.editorDependencyTypesFF",Dt="gantt.editorDependencyTypesSF",Et="gantt.editorDependencyTypesFS",bt="gantt.editorDependencyTypesSS",It="gantt.addTask",wt="gantt.addChild",St="gantt.addAbove",Rt="gantt.addBelow",Tt="gantt.viewSelector",xt="gantt.editorDelete",Ft="gantt.deleteConfirmation",Nt="gantt.deleteDialogTitle",Mt="gantt.editorDependencyNameLabel",zt="gantt.editorDependencyTypeLabel",Lt={[Ne]:"Week",[Me]:"Day",[ze]:"Month",[Le]:"Year",[We]:"Clear",[He]:"Is equal to",[Ke]:"Is not equal to",[Pe]:"Is null",[Ve]:"Is not null",[Oe]:"Is empty",[Ae]:"Is not empty",[Be]:"Starts with",[Ge]:"Contains",[_e]:"Does not contain",[$e]:"Ends with",[qe]:"Is greater than or equal to",[Ue]:"Is greater than",[Ze]:"Is less than or equal to",[je]:"Is less than",[Ye]:"Is true",[Xe]:"Is false",[Qe]:"(All)",[Je]:"Is after or equal to",[et]:"Is after",[tt]:"Is before",[nt]:"Is before or equal to","gantt.noRecords":"No records available",[at]:"Save",[ot]:"Cancel",[rt]:"Add",[lt]:"Remove",[st]:"General",[it]:"Predecessors",[dt]:"Successors",[ct]:"Edit task",[ut]:"Title",[mt]:"Start",[pt]:"End","gantt.editorTaskPlannedStart":"Planned Start Date","gantt.editorTaskPlannedEnd":"Planned End Date","gantt.editorTaskActualStart":"Actual Start Date","gantt.editorTaskActualEnd":"Actual End Date",[gt]:"Complete",[ht]:"Parent",[ft]:"Field is required.",[kt]:"Start time must be be before End time.",[yt]:"End time must be after Start time.",[vt]:"Value should be between 0 and 100.",[Ct]:"Finish-Finish",[Et]:"Finish-Start",[Dt]:"Start-Finish",[bt]:"Start-Start",[It]:"Add Task",[wt]:"Add Child",[St]:"Add Above",[Rt]:"Add Below",[Tt]:"View Selector",[xt]:"Delete",[Ft]:"Are you sure you want to delete this event?",[Nt]:"Delete Event",[Mt]:"Name",[zt]:"Type"},Wt=D.forwardRef(((e,t)=>{const{slotWidth:n=Ht.slotWidth,firstSlotRangeRef:a,timelineHeaderCell:o}=e,{timezone:r}=ie(),l=s.useInternationalization(),i=D.useRef(null),d=D.useRef(null),c=D.useCallback((e=>{d.current&&d.current.scrollIntoView(e)}),[]);D.useImperativeHandle(i,(()=>({scrollIntoView:c}))),D.useImperativeHandle(t,(()=>i.current));const u=ce(),m=e.workWeekStart||Ht.workWeekStart,p=e.workWeekEnd||Ht.workWeekEnd,g=D.useMemo((()=>{const e=q({workWeekStart:m,workWeekEnd:p}),t=[],n=Y(u,{timezone:r},l);return n.forEach((n=>{const a=j(n.range,{workDays:e,timezone:r},l);t.push.apply(t,a)})),a&&t[0]&&(a.current=t[0].range),[n,t]}),[r,u.start.getTime(),u.end.getTime(),l,m,p]);return D.createElement(Fe,{ref:d,slotWidth:n,slotLevels:g,timelineHeaderCell:o})})),Ht={name:"week",dateRange:({intl:e,tasksStart:t,tasksEnd:n,timezone:a})=>{const r=o.ZonedDate.fromLocalDate(t,a),l=o.ZonedDate.fromLocalDate(n,a),s=O(o.firstDayInWeek(o.getDate(r),e.firstDay())),i=A(o.firstDayInWeek(o.getDate(l),e.firstDay()),7),d=o.ZonedDate.fromUTCDate(B(s),a),c=o.ZonedDate.fromUTCDate(B(i),a);return{start:new Date(d.getTime()),end:new Date(c.getTime()),zonedStart:d,zonedEnd:c}},title:e=>e.toLanguageString(Ne,Lt[Ne]),slotWidth:T,workWeekStart:1,workWeekEnd:5,workDayStart:"08:00",workDayEnd:"17:00"};Wt.defaultProps=Ht,Wt.propTypes={name:n.string,dateRange:n.oneOfType([n.func,n.object]),title:n.oneOfType([n.string,n.func]),slotWidth:n.number,workWeekStart:n.number,workWeekEnd:n.number,workDayStart:n.string,workDayEnd:n.string},Wt.displayName="KendoReactGanttWeekView";const Kt=e=>{const[t,n]=pe(),a=s.useLocalization(),o=D.useMemo((()=>"function"==typeof e.view.title?e.view.title.call(void 0,a):e.view.title),[e.view.title,a]),r=D.useCallback((()=>{e.view.name&&n(e.view.name)}),[n,e.view.name]);return D.createElement(d.Button,{role:"button",type:"button",tabIndex:-1,togglable:!0,selected:e.view.name===t,onClick:r},o)};Kt.displayName="KendoReactGanttViewSelectorItem";const Pt=D.forwardRef((()=>{const e=D.useContext(ue),[t,n]=pe(),a=s.useLocalization(),o=D.useCallback((e=>{n&&(e.preventDefault(),n(e.target.value))}),[n]);return D.createElement("div",{className:"k-gantt-views-wrapper"},D.createElement(d.ButtonGroup,{className:"k-gantt-views"},e.map((e=>D.createElement(Kt,{key:e.props.name,view:e.props})))),D.createElement("select",{value:t,onChange:o,"aria-label":(e=>a.toLanguageString(e,Lt[e]))(Tt),className:"k-picker k-picker-solid k-dropdown-list k-dropdown k-views-dropdown k-rounded-md"},e.map((e=>D.createElement("option",{key:e.props.name,value:e.props.name},"function"==typeof e.props.title?e.props.title.call(void 0,a):e.props.title)))))}));Pt.displayName="KendoReactGanttViewSelectorList";const Vt=D.forwardRef(((e,t)=>{const{className:n,...o}=e,r=D.useRef(null);return D.useImperativeHandle(t,(()=>({element:r.current,props:e}))),D.createElement(d.ToolbarItem,{ref:e=>{e&&(r.current=e.element)},className:a.classNames("k-gantt-views",n),...o},e.children)}));Vt.displayName="KendoReactGanttViewSelector";const Ot=D.forwardRef(((e,t)=>{const{className:n,...o}=e,r=D.useRef(null),l=D.useRef(null);D.useImperativeHandle(l,(()=>({element:r.current,props:e}))),D.useImperativeHandle(t,(()=>l.current));const s=D.useMemo((()=>a.classNames("k-gantt-toolbar k-gantt-header",n)),[n]);return D.createElement(d.Toolbar,{ref:e=>{e&&(r.current=e.element)},className:s,...o},e.children)}));Ot.displayName="KendoReactGanttToolbar";const At={name:"@progress/kendo-react-gantt",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},Bt=D.forwardRef(((e,t)=>{const n=s.useLocalization(),o=e=>n.toLanguageString(e,Lt[e]),r=o(It),l=o(wt),c=o(St),u=o(Rt),m=D.useCallback((t=>{t.syntheticEvent.preventDefault();const n=t.item&&t.item.direction?t.item.direction:"none";e.onClick&&e.onClick({nativeEvent:t.nativeEvent,syntheticEvent:t.syntheticEvent,direction:n})}),[e.onClick]),p=D.useCallback((t=>{t.preventDefault(),e.onClick&&e.onClick({nativeEvent:t&&t.nativeEvent,syntheticEvent:t,direction:"none"})}),[e.onClick]),g=D.createElement(D.Fragment,null,D.createElement(a.IconWrap,{name:"plus",icon:i.plusIcon}),r);return e.selectedTask?D.createElement(d.DropDownButton,{className:"k-views-dropdown",onItemClick:m,popupSettings:{popupClass:"k-gantt-toolbar"},textField:"title",items:[{title:l,direction:"child"},{title:c,direction:"above"},{title:u,direction:"below"}],text:g}):D.createElement(d.Button,{onClick:p},g)}));Bt.displayName="KendoReactGanttAddButton";const Gt=D.forwardRef(((e,t)=>{a.validatePackage(At);const n=a.shouldShowValidationUI(At),{columns:o=_t.columns,taskData:r=_t.taskData,dependencyData:i=_t.dependencyData,style:c,className:u,noRecords:m,timezone:p,rowHeight:g=_t.rowHeight,resizable:h,reorderable:f,sortable:k,sort:y,filter:v,columnMenuFilter:C,columnMenu:E,navigatable:b,toolbar:I,row:w,selectable:R}=e,T=s.useInternationalization(),{fields:x}=D.useMemo((()=>(e=>({fields:{...z,...e}}))(e.taskModelFields)),[e.taskModelFields]),{fields:F}=D.useMemo((()=>(e=>({fields:{...L,...e}}))(e.dependencyModelFields)),[e.dependencyModelFields]),N=D.useCallback(((e,t)=>n=>J(n,e)&&ee(n,t)?[...a.getter(t)(n)]:[])(x.isExpanded,x.children),[x.isExpanded,x.children]),M=D.useRef(null),W=D.useRef(null),H=D.useRef(null),K=D.useRef(null),P=D.useRef(null),V=D.useCallback((e=>{const t=a.getter(x.start)(e),n=a.getter(x.end)(e),o=a.getter(x.isSelected)(e);(!W.current||t<W.current)&&(W.current=t),(!H.current||n>H.current)&&(H.current=n),o&&(K.current=e)}),[x.start,x.end]),O=D.useMemo((()=>(W.current=null,H.current=null,K.current=null,l.flatData(r,N,V))),[r,N]);(!W.current||!H.current)&&(W.current=new Date(S),H.current=new Date(S));const A=D.Children.toArray(e.children||[D.createElement(Wt,{key:"week",firstSlotRangeRef:P})]),[B,G]=((e,t,n)=>{const[a,o]=D.useState(t||e),r=D.useCallback(((e,t)=>{o(e),n&&n.call(void 0,{...t,value:e})}),[n,o]);return[void 0!==t?t:a,r]})(e.defaultView||A[0].props.name,e.view,e.onViewChange),_=A.find((e=>e.props.name===B))||A[0],$="function"==typeof _.props.dateRange?_.props.dateRange.call(void 0,{intl:T,tasksStart:W.current,tasksEnd:H.current,timezone:p}):_.props.dateRange,q=D.useRef(null),[U,Z]=D.useState(0);a.useIsomorphicLayoutEffect((()=>{q.current&&Z(q.current.element.offsetHeight)}),[]);const j=D.useCallback((e=>{M.current&&M.current.scrollIntoView(e)}),[]),Y=D.useRef(null),X=D.useRef(null);D.useImperativeHandle(X,(()=>({props:e,element:Y.current,scrollIntoView:j}))),D.useImperativeHandle(t,(()=>X.current));const Q=D.useCallback((t=>{e.onDataStateChange&&e.onDataStateChange.call(void 0,{...t,target:X.current})}),[e.onDataStateChange]),te=D.useCallback((t=>{e.onSortChange&&e.onSortChange.call(void 0,{...t,target:X.current})}),[e.onSortChange]),ne=D.useCallback((t=>{e.onKeyDown&&e.onKeyDown.call(void 0,{...t,target:X.current})}),[e.onKeyDown]),ae=D.useCallback((t=>{e.onSelectionChange&&e.onSelectionChange.call(void 0,{...t,target:X.current})}),[e.onSelectionChange]),oe=D.useCallback((t=>{e.onHeaderSelectionChange&&e.onHeaderSelectionChange.call(void 0,{...t,target:X.current})}),[e.onHeaderSelectionChange]),re=D.useCallback((t=>{e.onFilterChange&&e.onFilterChange.call(void 0,{...t,target:X.current})}),[e.onFilterChange]),le=D.useCallback((t=>{e.onColumnMenuFilterChange&&e.onColumnMenuFilterChange.call(void 0,{...t,target:X.current})}),[e.onColumnMenuFilterChange]),se=D.useCallback((t=>{e.onExpandChange&&e.onExpandChange.call(void 0,{...t,target:X.current})}),[e.onExpandChange]),ie=D.useCallback((t=>{e.onAddClick&&e.onAddClick.call(void 0,{...t,target:X.current,selectedDataItem:K.current,slotStart:P.current&&new Date(P.current.start.getTime()),slotEnd:P.current&&new Date(P.current.end.getTime())})}),[e.onAddClick]),de=D.useCallback((t=>{e.onColumnResize&&e.onColumnResize.call(void 0,{...t,target:X.current})}),[e.onColumnResize]),ce=D.useCallback((t=>{e.onColumnReorder&&e.onColumnReorder.call(void 0,{...t,target:X.current})}),[e.onColumnReorder]),ue=D.useCallback((t=>{e.onRowClick&&e.onRowClick.call(void 0,{...t,target:X.current})}),[e.onRowClick]),me=D.useCallback((t=>{e.onRowDoubleClick&&e.onRowDoubleClick.call(void 0,{...t,target:X.current})}),[e.onRowClick]),pe=D.useCallback((t=>{e.onRowContextMenu&&e.onRowContextMenu.call(void 0,{...t,target:X.current})}),[e.onRowClick]),ge=D.useCallback((t=>{e.onTaskClick&&e.onTaskClick.call(void 0,{...t,target:X.current})}),[e.onTaskClick]),he=D.useCallback((t=>{e.onTaskDoubleClick&&e.onTaskDoubleClick.call(void 0,{...t,target:X.current})}),[e.onTaskDoubleClick]),fe=D.useCallback((t=>{e.onTaskContextMenu&&e.onTaskContextMenu.call(void 0,{...t,target:X.current})}),[e.onTaskContextMenu]),ke=D.useCallback((t=>{e.onTaskRemoveClick&&e.onTaskRemoveClick.call(void 0,{...t,target:X.current})}),[e.onTaskRemoveClick]),ye=D.useCallback((t=>{if(e.onDependencyCreate){let n,o;const r=a.getter(x.id);for(let e=0;e<O.length;e++){const a=r(O[e].dataItem);if(String(a)===t.fromId&&(n=a),String(a)===t.toId&&(o=a),n&&o)break}e.onDependencyCreate.call(void 0,{fromId:n,toId:o,target:X.current,type:t.type})}}),[e.onDependencyCreate,x,O]);return D.createElement(ve,{dateRange:$,taskData:O,dependencyData:i,taskModelFields:x,dependencyModelFields:F,views:A,activeView:[B,G],rowHeight:g,toolbarHeight:U,props:{columns:o,noRecords:m,timezone:p,resizable:h,reorderable:f,sortable:k,sort:y,filter:v,columnMenuFilter:C,columnMenu:E,navigatable:b,row:w,selectable:R},events:{onDataStateChange:Q,onSortChange:te,onFilterChange:re,onColumnMenuFilterChange:le,onExpandChange:se,onRowClick:ue,onRowDoubleClick:me,onRowContextMenu:pe,onColumnResize:de,onColumnReorder:ce,onDependencyCreate:e.onDependencyCreate&&ye,onKeyDown:ne,onSelectionChange:ae,onHeaderSelectionChange:oe},taskEvents:{onTaskClick:ge,onTaskDoubleClick:he,onTaskContextMenu:fe,onTaskRemoveClick:e.onTaskRemoveClick&&ke}},D.createElement("div",{ref:Y,role:"application",style:c,className:a.classNames("k-gantt",u)},D.createElement(Ot,{ref:q},I&&I.addTaskButton?D.createElement(Bt,{selectedTask:K.current,onClick:ie}):null,D.createElement(d.ToolbarSpacer,null),D.createElement(Vt,null,D.createElement(Pt,null))),_&&D.createElement(_.type,{key:_.props.name,ref:M,..._.props,firstSlotRangeRef:P}),n&&D.createElement(a.WatermarkOverlay,null)))})),_t={taskData:[],dependencyData:[],columns:[],rowHeight:40};Gt.propTypes={taskData:n.array,taskModelFields:n.shape({id:n.string,start:n.string,end:n.string,title:n.string,percentComplete:n.string,parentId:n.string,isRollup:n.string,isExpanded:n.string,children:n.string,isInEdit:n.string}),dependencyData:n.array,dependencyModelFields:n.shape({id:n.string,fromId:n.string,toId:n.string,type:n.string}),columns:n.arrayOf(n.shape({width:n.number,cell:n.any,editCell:n.any,headerCell:n.any,filter:n.any,children:n.any,field:n.string,title:n.string,sortable:n.any,expandable:n.bool,headerSelectionValue:n.bool,format:n.string,headerClassName:n.string,className:n.string,resizable:n.bool,reorderable:n.bool,minResizableWidth:n.number,orderIndex:n.number,columnMenu:n.any})),sort:n.array,filter:n.array,columnMenuFilter:n.array,columnMenu:n.any,style:n.object,className:n.string,children:n.any,timezone:n.string,defaultView:n.string,view:n.string,rowHeight:n.number,navigatable:n.bool,onViewChange:n.func,onDataStateChange:n.func,onSortChange:n.func,onFilterChange:n.func,onExpandChange:n.func,onRowClick:n.func,onColumnResize:n.func,onColumnReorder:n.func},Gt.defaultProps=_t,Gt.displayName="KendoReactGantt";const $t=D.forwardRef(((e,t)=>{const{slotWidth:n=qt.slotWidth,slotDuration:a=qt.slotDuration,firstSlotRangeRef:r,timelineHeaderCell:l}=e,{timezone:i}=ie(),d=s.useInternationalization(),c=D.useRef(null),u=D.useRef(null),m=D.useCallback((e=>{u.current&&u.current.scrollIntoView(e)}),[]);D.useImperativeHandle(c,(()=>({scrollIntoView:m}))),D.useImperativeHandle(t,(()=>c.current));const p=ce(),g=e.workWeekStart||qt.workWeekStart,h=e.workWeekEnd||qt.workWeekEnd,f=e.workDayStart||qt.workDayStart,k=e.workDayEnd||qt.workDayEnd,y=D.useMemo((()=>{const e=q({workWeekStart:g,workWeekEnd:h}),t=[],n=j(p,{workDays:e,timezone:i},d);return n.forEach((e=>{const n=((e,t,n)=>{const a=n.parseDate(t.workDayStart).getHours(),r=n.parseDate(t.workDayEnd).getHours();return Z(e,{step:o.MS_PER_MINUTE*t.slotDuration,timezone:t.timezone}).map((e=>{const t=e.zonedStart.getHours();return{range:e,isWork:t>=a&&t<r,span:1,text:n.formatDate(e.zonedStart,"hh:mm a"),type:"time"}}))})(e.range,{workDayStart:f,workDayEnd:k,timezone:i,slotDuration:a},d);e.span=n.length,t.push.apply(t,n)})),r&&t[0]&&(r.current=t[0].range),[n,t]}),[i,p.start.getTime(),p.end.getTime(),d,g,h,f,k]);return D.createElement(Fe,{ref:u,slotWidth:n,slotLevels:y,timelineHeaderCell:l})})),qt={name:"day",dateRange:({tasksStart:e,tasksEnd:t,timezone:n})=>{const a=o.ZonedDate.fromLocalDate(e,n),r=o.ZonedDate.fromLocalDate(t,n),l=O(a),s=A(r),i=o.ZonedDate.fromUTCDate(B(l),n),d=o.ZonedDate.fromUTCDate(B(s),n);return{start:new Date(i.getTime()),end:new Date(d.getTime()),zonedStart:i,zonedEnd:d}},title:e=>e.toLanguageString(Me,Lt[Me]),slotWidth:T,slotDuration:60,workWeekStart:1,workWeekEnd:5,workDayStart:"08:00",workDayEnd:"17:00"};$t.defaultProps=qt,$t.propTypes={name:n.string,dateRange:n.oneOfType([n.func,n.object]),title:n.oneOfType([n.string,n.func]),slotWidth:n.number,slotDuration:n.number,workWeekStart:n.number,workWeekEnd:n.number,workDayStart:n.string,workDayEnd:n.string},$t.displayName="KendoReactGanttDayView";const Ut=D.forwardRef(((e,t)=>{const{slotWidth:n=Zt.slotWidth,firstSlotRangeRef:a,timelineHeaderCell:o}=e,{timezone:r}=ie(),l=s.useInternationalization(),i=D.useRef(null),d=D.useRef(null),c=D.useCallback((e=>{d.current&&d.current.scrollIntoView(e)}),[]);D.useImperativeHandle(i,(()=>({scrollIntoView:c}))),D.useImperativeHandle(t,(()=>i.current));const u=ce(),m=D.useMemo((()=>{const e=[],t=X(u,{timezone:r},l);return t.forEach((t=>{const n=Y(t.range,{timezone:r},l);e.push.apply(e,n)})),a&&e[0]&&(a.current=e[0].range),[t,e]}),[r,u.start.getTime(),u.end.getTime(),l]);return D.createElement(Fe,{ref:d,slotWidth:n,slotLevels:m,timelineHeaderCell:o})})),Zt={name:"month",dateRange:({tasksStart:e,tasksEnd:t,timezone:n})=>{const a=o.ZonedDate.fromLocalDate(e,n),r=o.ZonedDate.fromLocalDate(t,n),l=o.firstDayOfMonth(o.getDate(a)),s=o.addDays(o.lastDayOfMonth(o.getDate(r)),1),i=o.ZonedDate.fromUTCDate(B(l),n),d=o.ZonedDate.fromUTCDate(B(s),n);return{start:new Date(i.getTime()),end:new Date(d.getTime()),zonedStart:i,zonedEnd:d}},title:e=>e.toLanguageString(ze,Lt[ze]),slotWidth:T,workWeekStart:1,workWeekEnd:5,workDayStart:"08:00",workDayEnd:"17:00"};Ut.defaultProps=Zt,Ut.propTypes={name:n.string,dateRange:n.oneOfType([n.func,n.object]),title:n.oneOfType([n.string,n.func]),slotWidth:n.number,workWeekStart:n.number,workWeekEnd:n.number,workDayStart:n.string,workDayEnd:n.string},Ut.displayName="GanttMonthView";const jt=D.forwardRef(((e,t)=>{const{slotWidth:n=Yt.slotWidth,firstSlotRangeRef:a,timelineHeaderCell:o}=e,{timezone:r}=ie(),l=s.useInternationalization(),i=D.useRef(null),d=D.useRef(null),c=D.useCallback((e=>{d.current&&d.current.scrollIntoView(e)}),[]);D.useImperativeHandle(i,(()=>({scrollIntoView:c}))),D.useImperativeHandle(t,(()=>i.current));const u=ce(),m=D.useMemo((()=>{const e=Q(u,{timezone:r},l),t=[];return e.forEach((e=>{const n=X(e.range,{timezone:r},l);t.push.apply(t,n)})),a&&t[0]&&(a.current=t[0].range),[e,t]}),[r,u.start.getTime(),u.end.getTime(),l]);return D.createElement(Fe,{slotWidth:n,slotLevels:m,timelineHeaderCell:o})})),Yt={name:"year",dateRange:({tasksStart:e,tasksEnd:t,timezone:n})=>{const a=o.ZonedDate.fromLocalDate(e,n),r=o.ZonedDate.fromLocalDate(t,n),l=o.firstDayOfMonth(o.firstMonthOfYear(o.getDate(a))),s=o.addDays(o.lastDayOfMonth(o.lastMonthOfYear(o.getDate(r))),1),i=o.ZonedDate.fromUTCDate(B(l),n),d=o.ZonedDate.fromUTCDate(B(s),n);return{start:new Date(i.getTime()),end:new Date(d.getTime()),zonedStart:i,zonedEnd:d}},title:e=>e.toLanguageString(Le,Lt[Le]),slotWidth:T};jt.defaultProps=Yt,jt.propTypes={name:n.string,dateRange:n.oneOfType([n.func,n.object]),title:n.oneOfType([n.string,n.func]),slotWidth:n.number},jt.displayName="GanttYearView";const Xt=[{text:Ge,operator:"contains"},{text:_e,operator:"doesnotcontain"},{text:He,operator:"eq"},{text:Ke,operator:"neq"},{text:Be,operator:"startswith"},{text:$e,operator:"endswith"},{text:Pe,operator:"isnull"},{text:Ve,operator:"isnotnull"},{text:Oe,operator:"isempty"},{text:Ae,operator:"isnotempty"}],Qt=[{text:He,operator:"eq"},{text:Ke,operator:"neq"},{text:qe,operator:"gte"},{text:Ue,operator:"gt"},{text:Ze,operator:"lte"},{text:je,operator:"lt"},{text:Pe,operator:"isnull"},{text:Ve,operator:"isnotnull"}],Jt=[{text:He,operator:"eq"},{text:Ke,operator:"neq"},{text:Je,operator:"gte"},{text:et,operator:"gt"},{text:tt,operator:"lt"},{text:nt,operator:"lte"},{text:Pe,operator:"isnull"},{text:Ve,operator:"isnotnull"}],en=[{text:Qe,operator:""},{text:Ye,operator:!0},{text:Xe,operator:!1}];function tn(e,t){return{clearButtonTitle:e.toLanguageString(We,Lt[We]),operators:t.map((t=>({text:e.toLanguageString(t.text,Lt[t.text]),operator:t.operator})))}}const nn=e=>{const{operators:t,...n}=e;return D.createElement(r.TextFilterCell,{ariaLabel:"text filter",...tn(s.useLocalization(),t||Xt),...n})};nn.displayName="KendoReactGanttTextFilter";const an=e=>{const{operators:t,...n}=e;return D.createElement(r.NumericFilterCell,{ariaLabel:"numeric filter",...tn(s.useLocalization(),t||Qt),...n})};an.displayName="KendoReactGanttNumericFilter";const on=e=>{const{operators:t,...n}=e;return D.createElement(r.BooleanFilterCell,{ariaLabel:"boolean filter",...tn(s.useLocalization(),t||en),...n})};on.displayName="KendoReactGanttBooleanFilter";const rn=e=>{const{operators:t,...n}=e;return D.createElement(r.DateFilterCell,{ariaLabel:"date filter",...tn(s.useLocalization(),t||Jt),...n})};rn.displayName="KendoReactGanttDateFilter";const ln=(e,t)=>{cn(e,t),un(e,t),mn(e,t)},sn=(e,t,n)=>{const o=a.getter(t.children),r=a.setter(t.children);for(let t=e.length-1;t>=0;t--){const a=e[t],l=o(a);if(n.parentId===a.id){const e=l.filter((e=>e.parentId===a.id));r(a,e)}}},dn=(e,t,n)=>{const o=a.getter(t.children),r=a.setter(t.children);return null===n.parentId?[...e,n]:(e=K(e,t.children,(e=>{if(e.id===n.parentId){const t=o(e)||[];r(e,[...t,n])}return{...e}})),e)},cn=(e,t)=>{if(!e.length)return;const n=a.getter(t.children),o=a.getter(t.start),r=a.setter(t.start);for(let t=e.length-1;t>=0;t--){const a=e[t],l=n(a);if(l&&l.length){const e=l.reduce(((e,t)=>Math.min(e,o(t).getTime())),o(l[0]).getTime());r(a,new Date(e))}}},un=(e,t)=>{if(!e.length)return;const n=a.getter(t.children),o=a.getter(t.end),r=a.setter(t.end);for(let t=e.length-1;t>=0;t--){const a=e[t],l=n(a);if(l&&l.length){const e=l.reduce(((e,t)=>Math.max(e,o(t).getTime())),o(l[0]).getTime());r(a,new Date(e))}}},mn=(e,t)=>{if(!e.length)return;const n=a.getter(t.children),o=a.getter(t.percentComplete),r=a.setter(t.percentComplete),l=({avg:e,n:t},n)=>({avg:((o(n)||0)+t*e)/(t+1),n:t+1});for(let t=e.length-1;t>=0;t--){const a=e[t],o=n(a);if(o&&o.length){r(a,o.reduce(l,{avg:0,n:0}).avg)}}},pn=(e,t,n)=>{if(!e)return;const o=a.getter(t.children),r=a.getter(t.start),l=a.setter(t.start),s=a.getter(t.end),i=a.setter(t.end),d=e.map((e=>({task:e,childrenIndex:0})));for(;d.length>0;){const e=d[d.length-1],t=e.task,a=o(t);a&&a.length&&a.length>e.childrenIndex?(d.push({task:a[e.childrenIndex],childrenIndex:0}),e.childrenIndex++):(d.pop(),l(t,new Date(r(t).getTime()+n)),i(t,new Date(s(t).getTime()+n)))}},gn=e=>{const{validationMessage:t,touched:n,label:a,id:o,valid:r,disabled:l,hint:s,type:i,optional:d,...c}=e,m=n&&t,h=!m&&s,f=h?`${o}_hint`:"",k=m?`${o}_error`:"";return D.createElement(u.FieldWrapper,{className:"k-col-span-full"},D.createElement(p.Label,{editorId:o,editorValid:r,editorDisabled:l,optional:d},a),D.createElement("div",{className:"k-form-field-wrap"},D.createElement(g.Input,{valid:r,type:i,id:o,disabled:l,ariaDescribedBy:`${f} ${k}`,...c}),h&&D.createElement(p.Hint,{id:f},s),m&&D.createElement(p.Error,{id:k},t)))},hn=e=>{const{validationMessage:t,touched:n,label:a,id:o,valid:r,disabled:l,hint:s,wrapperStyle:i,...d}=e,c=n&&t,m=!c&&s,g=m?`${o}_hint`:"",h=c?`${o}_error`:"",k=a?`${o}_label`:"";return D.createElement(u.FieldWrapper,{style:i,className:"k-col-span-2"},D.createElement(p.Label,{id:k,editorId:o,editorValid:r,editorDisabled:l},a),D.createElement("div",{className:"k-form-field-wrap"},D.createElement(f.DateTimePicker,{ariaLabelledBy:k,ariaDescribedBy:`${g} ${h}`,valid:r,id:o,disabled:l,...d}),m&&D.createElement(p.Hint,{id:g},s),c&&D.createElement(p.Error,{id:h},t)))},fn=e=>{const{validationMessage:t,visited:n,label:a,id:o,valid:r,disabled:l,hint:s,...i}=e,d=n&&t,c=!d&&s,m=c?`${o}_hint`:"",h=d?`${o}_error`:"";return D.createElement(u.FieldWrapper,null,D.createElement(p.Label,{editorId:o,editorValid:r,editorDisabled:l},a),D.createElement("div",{className:"k-form-field-wrap"},D.createElement(g.NumericTextBox,{ariaDescribedBy:`${m} ${h}`,valid:r,id:o,disabled:l,format:"p0",step:.01,...i}),c&&D.createElement(p.Hint,{id:m},s),d&&D.createElement(p.Error,{id:h},t)))},kn=e=>{const{validationMessage:t,touched:n,label:a,id:o,valid:r,disabled:l,hint:s,idField:i,dataItem:d,...c}=e,m=[],g=n&&t,h=!g&&s,f=h?`${o}_hint`:"",y=g?`${o}_error`:"",v=D.useCallback((t=>{if(!t||!t.children)return e.data;for(const e of t.children)m.push(e),e.children&&v(e);const n=m.map((e=>e.id));return e.data.filter((e=>!n.includes(e.id)))}),[e.data]),C=v(d),E=D.useMemo((()=>C.map((e=>{const t=new Date(e.start).toLocaleDateString(),n=new Date(e.end).toLocaleDateString();return{...e,title:`${e.title} (${t}-${n})`}}))),[v]),b=D.useMemo((()=>k.findByFieldValue(E,i,e.value)),[E,i,e.value]);return D.createElement(u.FieldWrapper,{className:"k-col-span-full"},D.createElement(p.Label,{editorId:o,editorValid:r,editorDisabled:l},a),D.createElement("div",{className:"k-form-field-wrap"},D.createElement(k.DropDownList,{textField:"title",ariaDescribedBy:`${f} ${y}`,valid:r,id:o,disabled:l,...c,value:b,data:E,onChange:t=>{null===t.value.id?e.onChange({value:null}):e.onChange({value:t.value[i]})},defaultItem:{id:null,title:"-None-",parentId:null}}),h&&D.createElement(p.Hint,{id:f},s),g&&D.createElement(p.Error,{id:y},t)))},yn=e=>{var t;const[n,o]=D.useState([]),r=s.useLocalization(),l=e=>r.toLanguageString(e,Lt[e]),c=l(rt),u=l(lt),m=l(Mt),p=l(zt),g=D.useMemo((()=>{const t=e.predecessors.map((t=>{const n=k.findByFieldValue(e.flatTasks,"id",t.fromId),a=k.findByFieldValue(e.dependencyTypes,"type",t.type);return{...t,taskTitle:n?n.title:"",typeName:a?a.type:""}}));return v.orderBy(t,n)}),[e.predecessors,e.dependencyTypes,e.flatTasks,n]);return D.createElement(y.Grid,{data:g,sort:n,sortable:!0,onRowClick:e.onSelectRow,onSortChange:e=>{o(e.sort)},style:{height:"23em"}},D.createElement(y.GridToolbar,null,D.createElement(d.Button,{icon:"plus",svgIcon:i.plusIcon,onClick:e.addPredecessorsDependency},c),D.createElement(d.Button,{icon:"minus",svgIcon:i.minusIcon,onClick:e.deleteDependency,disabled:void 0===(null==(t=e.selectedItem)?void 0:t.id)},u)),D.createElement(y.GridColumn,{field:"taskTitle",title:m,cell:t=>((e,t,n,o)=>{const[r,l]=D.useState(e),s=D.useRef(null),i=D.useMemo((()=>k.findByFieldValue(e,"id",t.fromId)),[e,t.fromId]);return D.createElement("td",{ref:s,className:a.classNames((n&&!t.uid?n.id===t.id:n&&null===t.id?n.uid===t.uid:void 0)&&"k-selected")},D.createElement(k.DropDownList,{textField:"title",data:r,value:i,onChange:e=>{o(t,"fromId",e.target.value.id)},filterable:!0,onFilterChange:t=>{const n=v.filterBy(e,t.filter);l(n)},required:!0}))})(e.flatTasks,t.dataItem,e.selectedItem,e.updateDependency)}),D.createElement(y.GridColumn,{field:"typeName",title:p,cell:t=>((e,t,n,o)=>{const r=D.useMemo((()=>k.findByFieldValue(e,"type",t.type)),[e,t.type]);return D.createElement("td",{className:a.classNames((n&&!t.uid?n.id===t.id:n&&null===t.id?n.uid===t.uid:void 0)&&"k-selected")},D.createElement(k.DropDownList,{textField:"name",data:e,value:r,onChange:e=>{o(t,"type",e.target.value.type)}}))})(e.dependencyTypes,t.dataItem,e.selectedItem,e.updateDependency)}))},vn=e=>{var t;const[n,o]=D.useState([]),r=s.useLocalization(),l=e=>r.toLanguageString(e,Lt[e]),c=l(rt),u=l(lt),m=l(Mt),p=l(zt),g=D.useMemo((()=>{const t=e.successors.map((t=>{const n=k.findByFieldValue(e.flatTasks,"id",t.toId),a=k.findByFieldValue(e.dependencyTypes,"type",t.type);return{...t,taskTitle:n?n.title:"",typeName:a?a.type:""}}));return v.orderBy(t,n)}),[e.successors,e.dependencyTypes,e.flatTasks,n]);return D.createElement(y.Grid,{data:g,sort:n,sortable:!0,onRowClick:e.onSelectRow,onSortChange:e=>{o(e.sort)},style:{height:"23em"}},D.createElement(y.GridToolbar,null,D.createElement(d.Button,{icon:"plus",svgIcon:i.plusIcon,onClick:e.addSuccessorsDependency},c),D.createElement(d.Button,{icon:"minus",svgIcon:i.minusIcon,onClick:e.deleteDependency,disabled:void 0===(null==(t=e.selectedItem)?void 0:t.id)},u)),D.createElement(y.GridColumn,{field:"taskTitle",title:m,cell:t=>((e,t,n,o)=>{const[r,l]=D.useState(e),s=D.useMemo((()=>k.findByFieldValue(e,"id",t.toId)),[e,t.toId]);return D.createElement("td",{className:a.classNames((n&&!t.uid?n.id===t.id:n&&null===t.id?n.uid===t.uid:void 0)&&"k-selected")},D.createElement(k.DropDownList,{textField:"title",data:r,value:s,onChange:e=>{o(t,"toId",e.target.value.id)},filterable:!0,onFilterChange:t=>{const n=v.filterBy(e,t.filter);l(n)},required:!0}))})(e.flatTasks,t.dataItem,e.selectedItem,e.updateDependency)}),D.createElement(y.GridColumn,{field:"type",title:p,cell:t=>((e,t,n,o)=>{const r=D.useMemo((()=>k.findByFieldValue(e,"type",t.type)),[e,t.type]);return D.createElement("td",{className:a.classNames((n&&!t.uid?n.id===t.id:n&&null===t.id?n.uid===t.uid:void 0)&&"k-selected")},D.createElement(k.DropDownList,{textField:"name",data:e,value:r,onChange:e=>{o(t,"type",e.target.value.type)}}))})(e.dependencyTypes,t.dataItem,e.selectedItem,e.updateDependency)}))};var Cn=(e=>(e[e.FF=0]="FF",e[e.FS=1]="FS",e[e.SF=2]="SF",e[e.SS=3]="SS",e))(Cn||{});const Dn=[{type:Cn.FF},{type:Cn.FS},{type:Cn.SF},{type:Cn.SS}],En=e=>{const[t,n]=D.useState(0),[o,r]=D.useState(),[i,d]=D.useState([...e.dependencyData||[]]),[c,m]=D.useState([]),p=oe(),g=s.useLocalization(),f=e=>g.toLanguageString(e,Lt[e]),y=f(ut),v=f(mt),C=f(pt),E=f(gt),b=f(ht),I=f(st),w=f(it),S=f(dt),R=f(ft),T=f(kt),x=f(yt),F=f(vt),N=D.useMemo((()=>l.flatData(e.taskData||[],(e=>e.children||[]),(e=>{const t={title:e[p.title],id:e[p.id],start:e[p.start],end:e[p.end],parentId:null};return p.parentId&&(t.parentId=e[p.parentId]),t}))),[e.taskData,p]),M=D.useMemo((()=>N.filter((t=>t.id!==e.dataItem.id))),[N,e.dataItem]),z=D.useMemo((()=>i.filter((t=>t.toId===e.dataItem.id))),[i,e.dataItem]),L=D.useMemo((()=>i.filter((t=>t.fromId===e.dataItem.id))),[i,e.dataItem]),W=D.useMemo((()=>i.filter((e=>null===e.id)).map((e=>({id:e.id,fromId:e.fromId,toId:e.toId,type:e.type})))),[i]),H=D.useMemo((()=>i.filter((e=>null!==e.id&&e.uid)).map((e=>({id:e.id,fromId:e.fromId,toId:e.toId,type:e.type})))),[i]),K=()=>{if(o){if(o.id){const e=i.filter((e=>e.id!==o.id));d(e);const t=i.filter((e=>e.id===o.id));m((e=>[...e,...t]))}else{const e=i.filter((e=>e.uid!==o.uid));d(e);const t=i.filter((e=>e.uid===o.uid));m((e=>[...e,...t]))}r(void 0)}},P=D.useCallback((e=>e||0===e?void 0:R),[R]),V=D.useCallback((e=>e||0===e?e>=0&&e<=1?void 0:F:R),[R,F]),O=D.useCallback(((e,t)=>e&&t(p.end)&&e.getTime()>t(p.end).getTime()?T:void 0),[p,T]),A=D.useCallback(((e,t)=>e&&t(p.start)&&e.getTime()<t(p.start).getTime()?x:void 0),[p,x]),B=D.useMemo((()=>[P,O]),[P,O]),G=D.useMemo((()=>[P,A]),[P,A]),_=D.useMemo((()=>k.findByFieldValue(i,"fromId",null)||k.findByFieldValue(i,"toId",null)),[i]),$=e=>{r(e.dataItem)},q=(e,t,n)=>{const o={...e,uid:e.uid||a.guid(),[t]:n},r=i.findIndex((e=>e.id&&e.id===o.id||e.uid&&e.uid===o.uid));r>-1&&(i.splice(r,1,o),d([...i]))},U=D.useMemo((()=>Dn.map((e=>{let t;switch(e.type){case Cn.FF:t=f(Ct);break;case Cn.FS:t=f(Et);break;case Cn.SF:t=f(Dt);break;case Cn.SS:t=f(bt);break;default:t=f(Ct)}return{...e,name:t}}))),[f]);D.useEffect((()=>{e.onDependencyCreate&&e.onDependencyCreate.call(void 0,{createdDependencies:W,updatedDependencies:H,deletedDependencies:c})}),[W,H,c,e.onDependencyCreate]);const Z=e.dependencyData&&e.taskData,j=D.createElement(u.FormElement,{style:{width:400},horizontal:!0},D.createElement(u.Field,{id:`${p.title}_gantteditor`,name:p.title,label:y,component:gn,validator:P}),D.createElement(u.Field,{id:`${p.start}_gantteditor`,name:p.start,label:v,component:hn,validator:B}),D.createElement(u.Field,{id:`${p.end}_gantteditor`,name:p.end,label:C,component:hn,validator:G}),D.createElement(u.Field,{id:`${p.percentComplete}_gantteditor`,name:p.percentComplete,label:E,component:fn,validator:V})),Y=D.createElement(u.FormElement,{style:{paddingInline:"4px"}},D.createElement("div",{className:"k-form-fieldset"},D.createElement("div",{className:"k-form-layout k-d-grid k-grid-cols-4 k-gap-x-2"},D.createElement(u.Field,{id:`${p.title}_gantteditor`,name:p.title,label:y,component:gn,validator:P}),D.createElement(u.Field,{id:`${p.start}_gantteditor`,name:p.start,label:v,component:hn,validator:B}),D.createElement(u.Field,{id:`${p.end}_gantteditor`,name:p.end,label:C,component:hn,validator:G}),D.createElement(u.Field,{id:`${p.percentComplete}_gantteditor`,name:p.percentComplete,label:E,component:fn,validator:V}),p.parentId&&D.createElement(u.Field,{id:`${p.parentId}_gantteditor`,name:p.parentId||"",idField:p.id,label:b,component:kn,data:M,dataItem:e.dataItem}))));return Z?D.createElement(h.TabStrip,{selected:t,onSelect:e=>{_||(n(e.selected),r(void 0))}},D.createElement(h.TabStripTab,{title:I},Y),D.createElement(h.TabStripTab,{title:w},D.createElement(yn,{flatTasks:N,predecessors:z,dependencyTypes:U,selectedItem:o,onSelectRow:$,addPredecessorsDependency:()=>{const t={uid:a.guid(),id:null,fromId:null,toId:e.dataItem.id,type:Cn.FS};d([...i,t])},deleteDependency:K,updateDependency:q})),D.createElement(h.TabStripTab,{title:S},D.createElement(vn,{flatTasks:N,successors:L,dependencyTypes:U,selectedItem:o,onSelectRow:$,addSuccessorsDependency:()=>{const t={uid:a.guid(),id:null,fromId:e.dataItem.id,toId:null,type:Cn.FS};d([...i,t])},deleteDependency:K,updateDependency:q}))):j},bn=l.TreeListRow;Object.defineProperty(e,"getSelectedState",{enumerable:!0,get:function(){return r.getSelectedState}}),Object.defineProperty(e,"getSelectedStateFromKeyDown",{enumerable:!0,get:function(){return r.getSelectedStateFromKeyDown}}),Object.defineProperty(e,"setSelectedState",{enumerable:!0,get:function(){return r.setSelectedState}}),e.GANTT_COL_INDEX_ATTRIBUTE=I,e.GANTT_PREVENT_SELECTION_ELEMENT=w,e.GANTT_ROW_INDEX_ATTRIBUTE=b,e.Gantt=Gt,e.GanttBooleanFilter=on,e.GanttDateFilter=rn,e.GanttDayView=$t,e.GanttForm=e=>{const{onCancel:t,onDelete:n,onClose:o,onSubmit:r,...l}=e,c=D.useRef(e.dataItem),[p,g]=D.useState({}),h=s.useLocalization(),f=e=>h.toLanguageString(e,Lt[e]),y=f(at),v=f(ot),C=f(xt),b=f(ct),I=D.useCallback((n=>{if(t){const a={syntheticEvent:n,nativeEvent:n.nativeEvent,dataItem:e.dataItem};t.call(void 0,a)}}),[t,e.dataItem]),w=D.useCallback((t=>{if(n){const a={syntheticEvent:t,nativeEvent:t.nativeEvent,dataItem:e.dataItem};n.call(void 0,a)}}),[n,e.dataItem]),S=D.useCallback((({syntheticEvent:t})=>{if(o){const n={syntheticEvent:t,nativeEvent:t.nativeEvent,dataItem:e.dataItem};o.call(void 0,n)}}),[o,e.dataItem]),R=D.useCallback(((e,t)=>{if(r){const n={dataItem:e,initialDataItem:c.current,syntheticEvent:t,nativeEvent:t&&t.nativeEvent,dependencies:p};r.call(void 0,n)}}),[r,p]),T=D.useMemo((()=>k.findByFieldValue(p.createdDependencies,"fromId",null)||k.findByFieldValue(p.createdDependencies,"toId",null)),[p]),x=D.useMemo((()=>p.createdDependencies&&p.createdDependencies.length&&void 0===T||p.updatedDependencies&&p.updatedDependencies.length||p.deletedDependencies&&p.deletedDependencies.length),[p,T]),F=D.useCallback((e=>{g(e)}),[]),N=D.createElement(u.Form,{initialValues:e.dataItem,onSubmit:R,render:t=>D.createElement(m.Window,{title:b,minWidth:90,width:554,modal:!0,height:0,onClose:S},D.createElement(En,{taskData:e.taskData,dependencyData:e.dependencyData,dataItem:e.dataItem,onDependencyCreate:F}),D.createElement(m.WindowActionsBar,{layout:"start"},D.createElement(d.Button,{disabled:!t.allowSubmit&&!x,onClick:t.allowSubmit?t.onSubmit:t=>R(e.dataItem,t),icon:"save",svgIcon:i.saveIcon,themeColor:"primary"},y),D.createElement(d.Button,{onClick:I,type:"button",icon:"cancel",svgIcon:i.cancelIcon},v),D.createElement("div",{className:"k-spacer"}),n&&D.createElement(d.Button,{onClick:w,icon:"trash",svgIcon:i.trashIcon,fillMode:"flat",themeColor:"primary"},C))),...l});return a.canUseDOM?E.createPortal(N,document&&document.body):null},e.GanttMonthView=Ut,e.GanttNumericFilter=an,e.GanttRemoveDialog=e=>{const{onClose:t,onCancel:n,onConfirm:o,dataItem:r}=e,l=s.useLocalization(),i=e=>l.toLanguageString(e,Lt[e]),c=i(xt),u=i(ot),p=i(Ft),g=i(Nt),h=D.useCallback((({syntheticEvent:e})=>{t&&t.call(void 0,{syntheticEvent:e,nativeEvent:e&&e.nativeEvent,dataItem:null})}),[t]),f=D.useCallback((e=>{n&&n.call(void 0,{syntheticEvent:e,nativeEvent:e&&e.nativeEvent,dataItem:null})}),[n]),k=D.useCallback((e=>{o&&o.call(void 0,{syntheticEvent:e,nativeEvent:e&&e.nativeEvent,dataItem:r})}),[o,r]),y=D.createElement(m.Dialog,{title:g,onClose:h},p,D.createElement(m.DialogActionsBar,{layout:"end"},D.createElement(d.Button,{themeColor:"primary",onClick:k},c),D.createElement(d.Button,{onClick:f},u)));return a.canUseDOM?E.createPortal(y,document&&document.body):null},e.GanttRow=bn,e.GanttTextFilter=nn,e.GanttWeekView=Wt,e.GanttYearView=jt,e.addDependency=e=>{const{dependencyData:t,dependencyModelFields:n,defaultDataItem:o,fromId:r,toId:l,type:s}=e,i=t.map((e=>({...e}))),d=a.setter(n.fromId),c=a.setter(n.toId),u=a.setter(n.type),m=o?{...o}:{};return d(m,r),c(m,l),u(m,s),i.push(m),i},e.addTask=e=>{const{defaultDataItem:t,selectedDataItem:n,direction:o,taskModelFields:r,dataTree:l,slotStart:s,slotEnd:i}=e,d=K(l,r.children,(e=>({...e}))),c=a.setter(r.start),u=a.setter(r.end),m=a.getter(r.start),p=a.getter(r.end),g=a.setter(r.parentId||""),h=t?{...t}:{},f=m(h)&&p(h);if(n&&"none"!==o){const e=[{task:{[r.children]:d},childrenIndex:0}],t=a.getter(r.id),l=a.getter(r.children),k=a.setter(r.children),y=t(n);for(;e.length>0;){const n=e[e.length-1],a=n.task,o=t(a),r=l(a);if(o&&o===y)break;r&&r.length&&r.length>n.childrenIndex?(e.push({task:r[n.childrenIndex],childrenIndex:0}),n.childrenIndex++):e.pop()}if(e.length>1){const n=e[e.length-1].task,a=e[e.length-2].childrenIndex,d=e[e.length-2].task,y=l(d);switch(o){case"child":{let a=l(n);a||(a=[],k(n,a)),f||(c(h,new Date(m(n).getTime())),u(h,new Date(p(n).getTime()))),a.push(h),g(h,t(n)),ln(e.splice(1,e.length-1).map((e=>e.task)),r);break}case"above":m(d)&&p(d)&&!f?(c(h,new Date(m(n).getTime())),u(h,new Date(p(n).getTime()))):(c(h,s),u(h,i)),y.splice(a-1,0,h),g(h,t(d)),ln(e.splice(1,e.length-2).map((e=>e.task)),r);break;case"below":m(d)&&p(d)&&!f?(c(h,new Date(m(n).getTime())),u(h,new Date(p(n).getTime()))):(c(h,s),u(h,i)),y.splice(a,0,h),g(h,t(d)),ln(e.splice(1,e.length-2).map((e=>e.task)),r)}}}else f||(c(h,s),u(h,i)),r.parentId&&g(h,null),d.unshift(h);return d},e.createDataTree=V,e.extendDataItem=P,e.filterBy=H,e.mapTree=K,e.orderBy=W,e.removeTask=e=>{const{removedDataItem:t,taskModelFields:n,dataTree:o}=e,r=K(o,n.children,(e=>({...e})));let l=[{task:{[n.children]:r},childrenIndex:0}];const s=a.getter(n.id),i=a.getter(n.children),d=s(t);for(;l.length>0;){const e=l[l.length-1],t=e.task,n=s(t),a=i(t);if(n&&n===d)break;a&&a.length&&a.length>e.childrenIndex?(l.push({task:a[e.childrenIndex],childrenIndex:0}),e.childrenIndex++):l.pop()}if(l.length>1){const e=l[l.length-2];i(e.task).splice(e.childrenIndex-1,1),l=l.splice(1,l.length-2),ln(l.map((e=>e.task)),n)}return r},e.updateTask=e=>{const{updatedDataItem:t,taskModelFields:n,dataTree:o}=e,r=a.getter(n.id),l=a.getter(n.children),s=r(t);let i;const d=K(o,n.children,(e=>r(e)===s?(i=e,{...t}):{...e}));let c=[{task:{[n.children]:d},childrenIndex:0}];for(;c.length>0;){const e=c[c.length-1],t=e.task,n=r(t),a=l(t);if(n&&n===s)break;a&&a.length&&a.length>e.childrenIndex?(c.push({task:a[e.childrenIndex],childrenIndex:0}),e.childrenIndex++):c.pop()}if(c.length>1){c=c.splice(1,c.length-2);const e=a.getter(n.start),o=a.getter(n.end),s=a.getter(n.percentComplete),u=a.getter(n.parentId||"");if(e(i).getTime()!==e(t).getTime()){cn(c.map((e=>e.task)),n);const a=e(t).getTime()-e(i).getTime();pn(l(t),n,a)}if(o(i).getTime()!==o(t).getTime()&&un(c.map((e=>e.task)),n),s(i)!==s(t)&&mn(c.map((e=>e.task)),n),n.parentId&&u(i)!==u(t)){let e;return c.length?sn(c.map((e=>e.task)),n,i):e=d.filter((e=>r(e)!==r(t))),dn(e||d,n,t)}}return d}}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react"),y=require("@progress/kendo-react-form"),c=require("@progress/kendo-react-labels"),D=require("@progress/kendo-react-dateinputs");function h(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const a=h(k),E=e=>{const{validationMessage:t,touched:r,label:i,id:n,valid:l,disabled:s,hint:d,wrapperStyle:f,...g}=e,o=r&&t,u=!o&&d,m=u?`${n}_hint`:"",b=o?`${n}_error`:"",p=i?`${n}_label`:"";return a.createElement(y.FieldWrapper,{style:f,className:"k-col-span-2"},a.createElement(c.Label,{id:p,editorId:n,editorValid:l,editorDisabled:s},i),a.createElement("div",{className:"k-form-field-wrap"},a.createElement(D.DateTimePicker,{ariaLabelledBy:p,ariaDescribedBy:`${m} ${b}`,valid:l,id:n,disabled:s,...g}),u&&a.createElement(c.Hint,{id:m},d),o&&a.createElement(c.Error,{id:b},t)))};exports.FormDateTimePicker=E;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as e from "react";
|
|
10
|
+
import { FieldWrapper as f } from "@progress/kendo-react-form";
|
|
11
|
+
import { Label as $, Hint as k, Error as w } from "@progress/kendo-react-labels";
|
|
12
|
+
import { DateTimePicker as y } from "@progress/kendo-react-dateinputs";
|
|
13
|
+
const v = (p) => {
|
|
14
|
+
const { validationMessage: a, touched: b, label: i, id: t, valid: o, disabled: l, hint: s, wrapperStyle: h, ...E } = p, r = b && a, d = !r && s, n = d ? `${t}_hint` : "", c = r ? `${t}_error` : "", m = i ? `${t}_label` : "";
|
|
15
|
+
return /* @__PURE__ */ e.createElement(f, { style: h, className: "k-col-span-2" }, /* @__PURE__ */ e.createElement($, { id: m, editorId: t, editorValid: o, editorDisabled: l }, i), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement(
|
|
16
|
+
y,
|
|
17
|
+
{
|
|
18
|
+
ariaLabelledBy: m,
|
|
19
|
+
ariaDescribedBy: `${n} ${c}`,
|
|
20
|
+
valid: o,
|
|
21
|
+
id: t,
|
|
22
|
+
disabled: l,
|
|
23
|
+
...E
|
|
24
|
+
}
|
|
25
|
+
), d && /* @__PURE__ */ e.createElement(k, { id: n }, s), r && /* @__PURE__ */ e.createElement(w, { id: c }, a)));
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
v as FormDateTimePicker
|
|
29
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("react"),M=require("@progress/kendo-react-form"),h=require("@progress/kendo-react-labels"),k=require("@progress/kendo-react-dropdowns");function O(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const l=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,l.get?l:{enumerable:!0,get:()=>e[r]})}}return o.default=e,Object.freeze(o)}const n=O($),S=e=>{const{validationMessage:o,touched:r,label:l,id:i,valid:D,disabled:b,hint:f,idField:c,dataItem:y,...C}=e,E={id:null,title:"-None-",parentId:null},g=[],s=r&&o,v=!s&&f,p=v?`${i}_hint`:"",w=s?`${i}_error`:"",d=n.useCallback(t=>{if(!t||!t.children)return e.data;for(const a of t.children)g.push(a),a.children&&d(a);const m=g.map(a=>a.id);return e.data.filter(a=>!m.includes(a.id))},[e.data]),F=d(y),u=n.useMemo(()=>F.map(t=>{const m=new Date(t.start).toLocaleDateString(),a=new Date(t.end).toLocaleDateString();return{...t,title:`${t.title} (${m}-${a})`}}),[d]),I=n.useMemo(()=>k.findByFieldValue(u,c,e.value),[u,c,e.value]),L=t=>{t.value.id===null?e.onChange({value:null}):e.onChange({value:t.value[c]})};return n.createElement(M.FieldWrapper,{className:"k-col-span-full"},n.createElement(h.Label,{editorId:i,editorValid:D,editorDisabled:b},l),n.createElement("div",{className:"k-form-field-wrap"},n.createElement(k.DropDownList,{textField:"title",ariaDescribedBy:`${p} ${w}`,valid:D,id:i,disabled:b,...C,value:I,data:u,onChange:L,defaultItem:E}),v&&n.createElement(h.Hint,{id:p},f),s&&n.createElement(h.Error,{id:w},o)))};exports.FormDropDownList=S;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as a from "react";
|
|
10
|
+
import { FieldWrapper as L } from "@progress/kendo-react-form";
|
|
11
|
+
import { Label as k, Hint as M, Error as N } from "@progress/kendo-react-labels";
|
|
12
|
+
import { findByFieldValue as V, DropDownList as x } from "@progress/kendo-react-dropdowns";
|
|
13
|
+
const S = (n) => {
|
|
14
|
+
const {
|
|
15
|
+
validationMessage: d,
|
|
16
|
+
touched: p,
|
|
17
|
+
label: w,
|
|
18
|
+
id: o,
|
|
19
|
+
valid: u,
|
|
20
|
+
disabled: m,
|
|
21
|
+
hint: h,
|
|
22
|
+
idField: l,
|
|
23
|
+
dataItem: C,
|
|
24
|
+
...E
|
|
25
|
+
} = n, I = { id: null, title: "-None-", parentId: null }, v = [], i = p && d, D = !i && h, f = D ? `${o}_hint` : "", g = i ? `${o}_error` : "", r = a.useCallback((t) => {
|
|
26
|
+
if (!t || !t.children)
|
|
27
|
+
return n.data;
|
|
28
|
+
for (const e of t.children)
|
|
29
|
+
v.push(e), e.children && r(e);
|
|
30
|
+
const c = v.map((e) => e.id);
|
|
31
|
+
return n.data.filter((e) => !c.includes(e.id));
|
|
32
|
+
}, [n.data]), $ = r(C), s = a.useMemo(
|
|
33
|
+
() => $.map((t) => {
|
|
34
|
+
const c = new Date(t.start).toLocaleDateString(), e = new Date(t.end).toLocaleDateString();
|
|
35
|
+
return { ...t, title: `${t.title} (${c}-${e})` };
|
|
36
|
+
}),
|
|
37
|
+
[r]
|
|
38
|
+
), b = a.useMemo(
|
|
39
|
+
() => V(s, l, n.value),
|
|
40
|
+
[s, l, n.value]
|
|
41
|
+
), F = (t) => {
|
|
42
|
+
t.value.id === null ? n.onChange({ value: null }) : n.onChange({ value: t.value[l] });
|
|
43
|
+
};
|
|
44
|
+
return /* @__PURE__ */ a.createElement(L, { className: "k-col-span-full" }, /* @__PURE__ */ a.createElement(k, { editorId: o, editorValid: u, editorDisabled: m }, w), /* @__PURE__ */ a.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ a.createElement(
|
|
45
|
+
x,
|
|
46
|
+
{
|
|
47
|
+
textField: "title",
|
|
48
|
+
ariaDescribedBy: `${f} ${g}`,
|
|
49
|
+
valid: u,
|
|
50
|
+
id: o,
|
|
51
|
+
disabled: m,
|
|
52
|
+
...E,
|
|
53
|
+
value: b,
|
|
54
|
+
data: s,
|
|
55
|
+
onChange: F,
|
|
56
|
+
defaultItem: I
|
|
57
|
+
}
|
|
58
|
+
), D && /* @__PURE__ */ a.createElement(M, { id: f }, h), i && /* @__PURE__ */ a.createElement(N, { id: g }, d)));
|
|
59
|
+
};
|
|
60
|
+
export {
|
|
61
|
+
S as FormDropDownList
|
|
62
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react"),y=require("@progress/kendo-react-form"),i=require("@progress/kendo-react-labels"),E=require("@progress/kendo-react-inputs");function I(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const n=I(h),k=e=>{const{validationMessage:t,touched:r,label:o,id:a,valid:l,disabled:s,hint:d,type:b,optional:f,...g}=e,c=r&&t,u=!c&&d,m=u?`${a}_hint`:"",p=c?`${a}_error`:"";return n.createElement(y.FieldWrapper,{className:"k-col-span-full"},n.createElement(i.Label,{editorId:a,editorValid:l,editorDisabled:s,optional:f},o),n.createElement("div",{className:"k-form-field-wrap"},n.createElement(E.Input,{valid:l,type:b,id:a,disabled:s,ariaDescribedBy:`${m} ${p}`,...g}),u&&n.createElement(i.Hint,{id:m},d),c&&n.createElement(i.Error,{id:p},t)))};exports.FormInput=k;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as e from "react";
|
|
10
|
+
import { FieldWrapper as u } from "@progress/kendo-react-form";
|
|
11
|
+
import { Label as b, Hint as I, Error as $ } from "@progress/kendo-react-labels";
|
|
12
|
+
import { Input as v } from "@progress/kendo-react-inputs";
|
|
13
|
+
const y = (c) => {
|
|
14
|
+
const { validationMessage: o, touched: m, label: p, id: t, valid: a, disabled: i, hint: n, type: f, optional: h, ...E } = c, r = m && o, l = !r && n, s = l ? `${t}_hint` : "", d = r ? `${t}_error` : "";
|
|
15
|
+
return /* @__PURE__ */ e.createElement(u, { className: "k-col-span-full" }, /* @__PURE__ */ e.createElement(b, { editorId: t, editorValid: a, editorDisabled: i, optional: h }, p), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement(
|
|
16
|
+
v,
|
|
17
|
+
{
|
|
18
|
+
valid: a,
|
|
19
|
+
type: f,
|
|
20
|
+
id: t,
|
|
21
|
+
disabled: i,
|
|
22
|
+
ariaDescribedBy: `${s} ${d}`,
|
|
23
|
+
...E
|
|
24
|
+
}
|
|
25
|
+
), l && /* @__PURE__ */ e.createElement(I, { id: s }, n), r && /* @__PURE__ */ e.createElement($, { id: d }, o)));
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
y as FormInput
|
|
29
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react"),g=require("@progress/kendo-react-form"),c=require("@progress/kendo-react-labels"),E=require("@progress/kendo-react-inputs");function h(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const o=h(p),v=e=>{const{validationMessage:t,visited:r,label:n,id:i,valid:s,disabled:l,hint:d,...f}=e,a=r&&t,u=!a&&d,m=u?`${i}_hint`:"",b=a?`${i}_error`:"";return o.createElement(g.FieldWrapper,null,o.createElement(c.Label,{editorId:i,editorValid:s,editorDisabled:l},n),o.createElement("div",{className:"k-form-field-wrap"},o.createElement(E.NumericTextBox,{ariaDescribedBy:`${m} ${b}`,valid:s,id:i,disabled:l,format:"p0",step:.01,...f}),u&&o.createElement(c.Hint,{id:m},d),a&&o.createElement(c.Error,{id:b},t)))};exports.FormNumericTextBox=v;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as e from "react";
|
|
10
|
+
import { FieldWrapper as E } from "@progress/kendo-react-form";
|
|
11
|
+
import { Label as h, Hint as b, Error as u } from "@progress/kendo-react-labels";
|
|
12
|
+
import { NumericTextBox as x } from "@progress/kendo-react-inputs";
|
|
13
|
+
const B = (m) => {
|
|
14
|
+
const { validationMessage: i, visited: c, label: p, id: t, valid: o, disabled: a, hint: n, ...f } = m, r = c && i, s = !r && n, d = s ? `${t}_hint` : "", l = r ? `${t}_error` : "";
|
|
15
|
+
return /* @__PURE__ */ e.createElement(E, null, /* @__PURE__ */ e.createElement(h, { editorId: t, editorValid: o, editorDisabled: a }, p), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement(
|
|
16
|
+
x,
|
|
17
|
+
{
|
|
18
|
+
ariaDescribedBy: `${d} ${l}`,
|
|
19
|
+
valid: o,
|
|
20
|
+
id: t,
|
|
21
|
+
disabled: a,
|
|
22
|
+
format: "p0",
|
|
23
|
+
step: 0.01,
|
|
24
|
+
...f
|
|
25
|
+
}
|
|
26
|
+
), s && /* @__PURE__ */ e.createElement(b, { id: d }, n), r && /* @__PURE__ */ e.createElement(u, { id: l }, i)));
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
B as FormNumericTextBox
|
|
30
|
+
};
|