UNPKG

react-gantt-lightweight

Version:
33 lines (29 loc) 47.2 kB
(function(ve,M){typeof exports=="object"&&typeof module<"u"?M(exports,require("react"),require("tslib")):typeof define=="function"&&define.amd?define(["exports","react","tslib"],M):(ve=typeof globalThis<"u"?globalThis:ve||self,M(ve["react-gantt-lightweight"]={},ve.React,ve.tslib))})(this,function(ve,M,q){"use strict";var Se=document.createElement("style");Se.textContent=`.ganttOverview{position:relative;transition:all .15s linear;height:100%;overflow:hidden}.ganttOverview-box{position:relative;height:100%}.ganttOverview-box .ganttOverview-arrrow{transform:rotate(90deg) translateY(3px)}.ganttOverview-arrrow-box{position:absolute;top:50%;right:-15px;z-index:20;display:flex;align-items:center;justify-content:center;width:15px;height:50px;cursor:pointer;background:#dadbde;border-top-right-radius:12px;border-bottom-right-radius:12px;transform:translateY(-50%)}.ganttOverview-close{position:relative;width:0!important;transition:all .15s linear;overflow:hidden}.ganttOverview-head{height:60px;display:flex;line-height:60px;padding:0 10px;overflow:hidden;background-color:#fff;border-bottom:1px solid var(--borderColor)}.ganttOverview-head .ganttOverview-head-item{flex:1;font-weight:500;font-size:15px;text-align:center}.ganttOverview-body-height{height:100%;box-sizing:border-box;overflow-y:hidden}.ganttOverview-body-height::-webkit-scrollbar{display:none;width:0}.ganttOverview-body{flex:1;overflow:hidden;background:#f6f7f9;display:flex;flex-direction:column}.ganttOverview-body-cell{margin-bottom:10px}.ganttOverview-body-cell:last-child{margin-bottom:0}.ganttOverview-body-cell-filed{display:flex;padding:0 10px;background:#fff;box-shadow:0 1px 6px 1px #0000000d}.ganttOverview-body-cell-open{position:relative;padding:0 10px;overflow:hidden}.ganttOverview-body-cell-open-cell{position:relative;display:flex;width:100%;height:30px;padding-left:10px;line-height:30px}.ganttOverview-body-cell-open-cell:before{position:absolute;bottom:15px;left:0;width:1px;height:100%;content:" ";background-color:#7e868e3d}.ganttOverview-body-cell .ganttOverview-body-cell-open-cell:first-child{margin-top:15px}.ganttOverview-body-cell-open-cell-item{flex:1;font-size:13px}.ganttOverview-body-cell-open-cell-item-first{display:flex;align-items:center}.ganttOverview-body-cell-item{flex:1;height:40px;font-size:14px;line-height:40px;text-align:center}.quan{position:relative;width:4px;height:4px;margin-right:2px;background:#007fff;border-radius:50%}.quan:before{position:absolute;top:50%;left:-10px;width:10px;height:1px;content:" ";background-color:#7e868e3d;transform:translateY(-50%)}.main-arrow{--bg-color: transparent;width:20px;height:20px;display:inline-block;position:relative}.main-arrow:before{position:absolute;top:10px;left:4px;width:8px;height:2px;content:"";background:var(--bg-color);transition:transform .3s;transform:rotate(45deg)}.main-arrow:after{position:absolute;top:10px;left:8px;width:8px;height:2px;content:"";background:var(--bg-color);transition:transform .3s;transform:rotate(-45deg)}.main-arrow.arrow_open:before{transform:rotate(-45deg) translateY(-1px) translate(1px)}.main-arrow.arrow_open:after{transform:rotate(45deg) translateY(-1px) translate(-1px)}.gantt{--borderColor: rgba(126 134 142 /16%);--progressColor: #007fff;--finishColor: #00b042;--waitColor: #e0e2e4;--overtimeColor: #f54040;--finishOvertimeColor: #00b042;-webkit-user-select:none;user-select:none;display:flex;overflow:hidden;border:1px solid var(--borderColor);border-radius:8px}.timeLine-finish{background:var(--finishColor)}.timeLine-wait{background:var(--waitColor)}.timeLine-overtime,.timeLine-progress{background:var(--progressColor)}.timeLine-finishOvertime{background:var(--finishColor)}.timeLine-finishOvertime2,.timeLine-overtime2{background:var(--overtimeColor)}.gantt-right{flex:1;border-left:1px solid var(--borderColor);overflow:hidden}.gantt-right-body{height:100%;overflow:hidden;display:flex;flex-direction:column}.gantt-right-body-head{display:flex;flex-direction:column;height:60px;overflow:hidden;flex:1;position:relative}.gantt-right-body-content{height:100%;overflow-y:auto;position:relative}.gantt-right-head-scrollBarWidth{border-left:1px solid var(--borderColor)}.gantt-right-body-head::-webkit-scrollbar{display:none}.gantt-right-body-body{height:100%;overflow-y:hidden;display:flex;flex-direction:column;flex:1}.gantt-right-body-head .gantt-right-body-head-list{display:flex;flex:1}.gantt-right-body-head .gantt-right-body-head-list .gantt-right-head-item-day{display:flex;align-items:center;justify-content:center;height:100%;font-size:14px;border-left:1px solid rgba(126 134 142 / 16%);box-sizing:border-box}.gantt-right-body-head .gantt-right-body-head-list .gantt-right-head-item-day:first-child{border-left:0}.gantt-right-body-item{padding:3px 10px;cursor:pointer;background-color:transparent;border-left:1px solid rgba(126 134 142 / 16%)}.gantt-right-body-cell .gantt-right-body-item:first-child{border-left:0}.gantt-right-body-cell{position:relative;display:flex}.gantt-right-body-cell:last-child .gantt-right-body-item{border-bottom:0}.progressBar{position:absolute;top:50%;left:0;z-index:2;display:flex;align-items:center;padding:5px;border-radius:6px;opacity:1;transition:opacity .2s linear;transform:translateY(-50%)}.progressBar-finish,.progressBar-finishOvertime{background:#d9f5e5;border:1px solid #9ce2c3}.progressBar-wait{background:#f6f6f6;border:1px solid var(--waitColor)}.progressBar-progress{background:#ebf3ff;border:1px solid #c2d9ff}.progressBar-overtime{background:#fdd9d9;border:1px solid #fbb2b2}.progressBar-default{height:30px;background:var(--progressColor);border-radius:4px}.progressBar-active{z-index:2;height:30px;background:var(--progressColor);border-radius:4px}.progressBar-box{position:relative;display:flex;cursor:pointer}.progress-text{min-width:70px;margin-left:5px;line-height:30px;color:var(--finishColor);font-size:14px;text-align:center;background:#9ce2c3;border-radius:4px;cursor:pointer}.progressBar-overtime .progress-text{color:var(--overtimeColor);background:#fbb2b2}.progressBar-overtime .progressBar-default{background:var(--overtimeColor)}.progressBar-overtime .progressBar-active{position:absolute;left:0;background:var(--progressColor)}.progressBar-progress .progress-text{color:var(--progressColor);background:#c2d9ff}.progressBar-progress .progressBar-default{background:#c2d9ff}.progressBar-progress .progressBar-active{position:absolute;left:0;background:var(--progressColor)}.progressBar-wait .progress-text{color:#171a1d;background:var(--waitColor)}.progressBar-wait .progressBar-default{background:var(--waitColor)}.progressBar-wait .progressBar-active{position:absolute;top:0;left:0;background:var(--waitColor)}.progressBar-finish .progressBar-default{background:#9ce2c3}.progressBar-finish .progressBar-active,.progressBar-finishOvertime .progressBar-active{position:absolute;top:0;left:0;background:var(--finishColor)}.progressBar-overTimeWidth{z-index:2;background:var(--overtimeColor);border-top-right-radius:3px;border-bottom-right-radius:3px}.gantt-right-body-content-mark{position:absolute;top:0;left:0;display:flex;height:100%}.gantt-right-body-head-box{display:flex;border-bottom:1px solid var(--borderColor)}.gantt-right-body-content-mark-item{border-left:1px solid var(--borderColor);box-sizing:border-box}.gantt-right-body-content-mark-item:first-child{border-left:0}.progressBar-default-child,.progressBar-active-child{height:18px;border-radius:2px}.progressBar-overTimeWidth-child{position:relative;height:18px;border-top-right-radius:2px;border-bottom-right-radius:2px}.gantt-right-body-head-year-item{box-sizing:border-box;display:flex;align-items:center;justify-content:center;height:100%;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-bottom:1px solid var(--borderColor);border-left:1px solid var(--borderColor)}.gantt-right-body-head-year-item:first-child{border-left:0}.helpLine-line{display:none;position:absolute;z-index:10;border-left:1px solid var(--progressColor);z-index:99}.progressBar:hover~.helpLine-line{display:block}.helpLine-line-finish{border-left-color:var(--finishColor)}.helpLine-line-overtime,.helpLine-line-progress{border-left-color:var(--progressColor)}.helpLine-line-wait{border-left-color:var(--waitColor)}.helpLine-line-finishOvertime{border-left-color:var(--finishColor)}.gantt-animation{opacity:.3;transition:all .2s linear}.overtimeRender{position:absolute;top:0;left:50%;width:100%;transform:translate(-50%)}.progressBar-render{position:absolute;top:0;left:0;z-index:7;display:flex;align-items:center;height:30px}.progressBar-render-child{height:18px}.gantt-right-body-cell-isEmpty{height:15px}.gantt-right-body-cell-parentIsEmpty{height:10px}.gantt-right-body-cell-isParent-true{height:40px}.gantt-right-body-cell-isParent-false{height:30px}.gantt-loading{display:flex;align-items:center;justify-content:center;width:100%;height:100%;background:#0000001a}.gantt-loading-svg{width:45px;height:45px;fill:currentcolor;animation:rotate-loading .9s linear infinite}@keyframes rotate-loading{0%{transform:rotate(0)}to{transform:rotate(360deg)}}#top-time-width{display:flex}#top-time-width .top-time-width-item .top-time-width-item-child{height:100%}#top-time-width .top-time-width-item{opacity:.3;display:flex;position:absolute;height:30px;bottom:0} `,document.head.appendChild(Se);var Xe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ze(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var je={exports:{}},we={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Re;function Ke(){if(Re)return we;Re=1;var a=M,r=Symbol.for("react.element"),c=Symbol.for("react.fragment"),w=Object.prototype.hasOwnProperty,v=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,x={key:!0,ref:!0,__self:!0,__source:!0};function h(k,O,C){var E,T={},D=null,A=null;C!==void 0&&(D=""+C),O.key!==void 0&&(D=""+O.key),O.ref!==void 0&&(A=O.ref);for(E in O)w.call(O,E)&&!x.hasOwnProperty(E)&&(T[E]=O[E]);if(k&&k.defaultProps)for(E in O=k.defaultProps,O)T[E]===void 0&&(T[E]=O[E]);return{$$typeof:r,type:k,key:D,ref:A,props:T,_owner:v.current}}return we.Fragment=c,we.jsx=h,we.jsxs=h,we}var De={};/** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Pe;function Qe(){return Pe||(Pe=1,process.env.NODE_ENV!=="production"&&function(){var a=M,r=Symbol.for("react.element"),c=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),k=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),A=Symbol.for("react.offscreen"),N=Symbol.iterator,oe="@@iterator";function $(e){if(e===null||typeof e!="object")return null;var t=N&&e[N]||e[oe];return typeof t=="function"?t:null}var ee=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function z(e){{for(var t=arguments.length,s=new Array(t>1?t-1:0),b=1;b<t;b++)s[b-1]=arguments[b];X("error",e,s)}}function X(e,t,s){{var b=ee.ReactDebugCurrentFrame,W=b.getStackAddendum();W!==""&&(t+="%s",s=s.concat([W]));var H=s.map(function(R){return String(R)});H.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,H)}}var ue=!1,re=!1,ae=!1,fe=!1,he=!1,se;se=Symbol.for("react.module.reference");function F(e){return!!(typeof e=="string"||typeof e=="function"||e===w||e===x||he||e===v||e===C||e===E||fe||e===A||ue||re||ae||typeof e=="object"&&e!==null&&(e.$$typeof===D||e.$$typeof===T||e.$$typeof===h||e.$$typeof===k||e.$$typeof===O||e.$$typeof===se||e.getModuleId!==void 0))}function B(e,t,s){var b=e.displayName;if(b)return b;var W=t.displayName||t.name||"";return W!==""?s+"("+W+")":s}function le(e){return e.displayName||"Context"}function te(e){if(e==null)return null;if(typeof e.tag=="number"&&z("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case c:return"Portal";case x:return"Profiler";case v:return"StrictMode";case C:return"Suspense";case E:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case k:var t=e;return le(t)+".Consumer";case h:var s=e;return le(s._context)+".Provider";case O:return B(e,e.render,"ForwardRef");case T:var b=e.displayName||null;return b!==null?b:te(e.type)||"Memo";case D:{var W=e,H=W._payload,R=W._init;try{return te(R(H))}catch{return null}}}return null}var u=Object.assign,o=0,i,f,l,m,p,d,y;function S(){}S.__reactDisabledLog=!0;function _(){{if(o===0){i=console.log,f=console.info,l=console.warn,m=console.error,p=console.group,d=console.groupCollapsed,y=console.groupEnd;var e={configurable:!0,enumerable:!0,value:S,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}o++}}function P(){{if(o--,o===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:u({},e,{value:i}),info:u({},e,{value:f}),warn:u({},e,{value:l}),error:u({},e,{value:m}),group:u({},e,{value:p}),groupCollapsed:u({},e,{value:d}),groupEnd:u({},e,{value:y})})}o<0&&z("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var g=ee.ReactCurrentDispatcher,V;function K(e,t,s){{if(V===void 0)try{throw Error()}catch(W){var b=W.stack.trim().match(/\n( *(at )?)/);V=b&&b[1]||""}return` `+V+e}}var U=!1,L;{var G=typeof WeakMap=="function"?WeakMap:Map;L=new G}function j(e,t){if(!e||U)return"";{var s=L.get(e);if(s!==void 0)return s}var b;U=!0;var W=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var H;H=g.current,g.current=null,_();try{if(t){var R=function(){throw Error()};if(Object.defineProperty(R.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(R,[])}catch(ge){b=ge}Reflect.construct(e,[],R)}else{try{R.call()}catch(ge){b=ge}e.call(R.prototype)}}else{try{throw Error()}catch(ge){b=ge}e()}}catch(ge){if(ge&&b&&typeof ge.stack=="string"){for(var Y=ge.stack.split(` `),ne=b.stack.split(` `),J=Y.length-1,Z=ne.length-1;J>=1&&Z>=0&&Y[J]!==ne[Z];)Z--;for(;J>=1&&Z>=0;J--,Z--)if(Y[J]!==ne[Z]){if(J!==1||Z!==1)do if(J--,Z--,Z<0||Y[J]!==ne[Z]){var de=` `+Y[J].replace(" at new "," at ");return e.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",e.displayName)),typeof e=="function"&&L.set(e,de),de}while(J>=1&&Z>=0);break}}}finally{U=!1,g.current=H,P(),Error.prepareStackTrace=W}var xe=e?e.displayName||e.name:"",Je=xe?K(xe):"";return typeof e=="function"&&L.set(e,Je),Je}function Q(e,t,s){return j(e,!1)}function me(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function ie(e,t,s){if(e==null)return"";if(typeof e=="function")return j(e,me(e));if(typeof e=="string")return K(e);switch(e){case C:return K("Suspense");case E:return K("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case O:return Q(e.render);case T:return ie(e.type,t,s);case D:{var b=e,W=b._payload,H=b._init;try{return ie(H(W),t,s)}catch{}}}return""}var ce=Object.prototype.hasOwnProperty,pe={},Oe=ee.ReactDebugCurrentFrame;function _e(e){if(e){var t=e._owner,s=ie(e.type,e._source,t?t.type:null);Oe.setExtraStackFrame(s)}else Oe.setExtraStackFrame(null)}function ft(e,t,s,b,W){{var H=Function.call.bind(ce);for(var R in e)if(H(e,R)){var Y=void 0;try{if(typeof e[R]!="function"){var ne=Error((b||"React class")+": "+s+" type `"+R+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[R]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ne.name="Invariant Violation",ne}Y=e[R](t,R,b,s,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(J){Y=J}Y&&!(Y instanceof Error)&&(_e(W),z("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",b||"React class",s,R,typeof Y),_e(null)),Y instanceof Error&&!(Y.message in pe)&&(pe[Y.message]=!0,_e(W),z("Failed %s type: %s",s,Y.message),_e(null))}}}var ht=Array.isArray;function Ce(e){return ht(e)}function gt(e){{var t=typeof Symbol=="function"&&Symbol.toStringTag,s=t&&e[Symbol.toStringTag]||e.constructor.name||"Object";return s}}function vt(e){try{return We(e),!1}catch{return!0}}function We(e){return""+e}function Ie(e){if(vt(e))return z("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",gt(e)),We(e)}var Ee=ee.ReactCurrentOwner,pt={key:!0,ref:!0,__self:!0,__source:!0},He,$e,Ye;Ye={};function mt(e){if(ce.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return e.ref!==void 0}function yt(e){if(ce.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function bt(e,t){if(typeof e.ref=="string"&&Ee.current&&t&&Ee.current.stateNode!==t){var s=te(Ee.current.type);Ye[s]||(z('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',te(Ee.current.type),e.ref),Ye[s]=!0)}}function xt(e,t){{var s=function(){He||(He=!0,z("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};s.isReactWarning=!0,Object.defineProperty(e,"key",{get:s,configurable:!0})}}function wt(e,t){{var s=function(){$e||($e=!0,z("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};s.isReactWarning=!0,Object.defineProperty(e,"ref",{get:s,configurable:!0})}}var Dt=function(e,t,s,b,W,H,R){var Y={$$typeof:r,type:e,key:t,ref:s,props:R,_owner:H};return Y._store={},Object.defineProperty(Y._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Y,"_self",{configurable:!1,enumerable:!1,writable:!1,value:b}),Object.defineProperty(Y,"_source",{configurable:!1,enumerable:!1,writable:!1,value:W}),Object.freeze&&(Object.freeze(Y.props),Object.freeze(Y)),Y};function Ot(e,t,s,b,W){{var H,R={},Y=null,ne=null;s!==void 0&&(Ie(s),Y=""+s),yt(t)&&(Ie(t.key),Y=""+t.key),mt(t)&&(ne=t.ref,bt(t,W));for(H in t)ce.call(t,H)&&!pt.hasOwnProperty(H)&&(R[H]=t[H]);if(e&&e.defaultProps){var J=e.defaultProps;for(H in J)R[H]===void 0&&(R[H]=J[H])}if(Y||ne){var Z=typeof e=="function"?e.displayName||e.name||"Unknown":e;Y&&xt(R,Z),ne&&wt(R,Z)}return Dt(e,Y,ne,W,b,Ee.current,R)}}var Me=ee.ReactCurrentOwner,Fe=ee.ReactDebugCurrentFrame;function be(e){if(e){var t=e._owner,s=ie(e.type,e._source,t?t.type:null);Fe.setExtraStackFrame(s)}else Fe.setExtraStackFrame(null)}var ke;ke=!1;function Be(e){return typeof e=="object"&&e!==null&&e.$$typeof===r}function Ae(){{if(Me.current){var e=te(Me.current.type);if(e)return` Check the render method of \``+e+"`."}return""}}function Et(e){{if(e!==void 0){var t=e.fileName.replace(/^.*[\\\/]/,""),s=e.lineNumber;return` Check your code at `+t+":"+s+"."}return""}}var ze={};function Tt(e){{var t=Ae();if(!t){var s=typeof e=="string"?e:e.displayName||e.name;s&&(t=` Check the top-level render call using <`+s+">.")}return t}}function Ue(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var s=Tt(t);if(ze[s])return;ze[s]=!0;var b="";e&&e._owner&&e._owner!==Me.current&&(b=" It was passed a child from "+te(e._owner.type)+"."),be(e),z('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',s,b),be(null)}}function Ve(e,t){{if(typeof e!="object")return;if(Ce(e))for(var s=0;s<e.length;s++){var b=e[s];Be(b)&&Ue(b,t)}else if(Be(e))e._store&&(e._store.validated=!0);else if(e){var W=$(e);if(typeof W=="function"&&W!==e.entries)for(var H=W.call(e),R;!(R=H.next()).done;)Be(R.value)&&Ue(R.value,t)}}}function _t(e){{var t=e.type;if(t==null||typeof t=="string")return;var s;if(typeof t=="function")s=t.propTypes;else if(typeof t=="object"&&(t.$$typeof===O||t.$$typeof===T))s=t.propTypes;else return;if(s){var b=te(t);ft(s,e.props,"prop",b,e)}else if(t.PropTypes!==void 0&&!ke){ke=!0;var W=te(t);z("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",W||"Unknown")}typeof t.getDefaultProps=="function"&&!t.getDefaultProps.isReactClassApproved&&z("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function jt(e){{for(var t=Object.keys(e.props),s=0;s<t.length;s++){var b=t[s];if(b!=="children"&&b!=="key"){be(e),z("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",b),be(null);break}}e.ref!==null&&(be(e),z("Invalid attribute `ref` supplied to `React.Fragment`."),be(null))}}function Ge(e,t,s,b,W,H){{var R=F(e);if(!R){var Y="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(Y+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ne=Et(W);ne?Y+=ne:Y+=Ae();var J;e===null?J="null":Ce(e)?J="array":e!==void 0&&e.$$typeof===r?(J="<"+(te(e.type)||"Unknown")+" />",Y=" Did you accidentally export a JSX literal instead of a component?"):J=typeof e,z("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",J,Y)}var Z=Ot(e,t,s,W,H);if(Z==null)return Z;if(R){var de=t.children;if(de!==void 0)if(b)if(Ce(de)){for(var xe=0;xe<de.length;xe++)Ve(de[xe],e);Object.freeze&&Object.freeze(de)}else z("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ve(de,e)}return e===w?jt(Z):_t(Z),Z}}function Ct(e,t,s){return Ge(e,t,s,!0)}function Yt(e,t,s){return Ge(e,t,s,!1)}var Mt=Yt,kt=Ct;De.Fragment=w,De.jsx=Mt,De.jsxs=kt}()),De}process.env.NODE_ENV==="production"?je.exports=Ke():je.exports=Qe();var n=je.exports,qe=function(a){var r=a.isOpen,c=a.color,w=c===void 0?"#000000":c,v=M.useRef(null);return M.useEffect(function(){v.current&&w&&v.current.style.setProperty("--bg-color",w)},[v,w]),n.jsx("div",{ref:v,className:"w-[20px] h-[20px] inline-block relative main-arrow"+(r?" arrow_open":"")})},et=function(a){var r=a.head,c=a.list,w=a.headWidth,v=a.headBodyPaddingY,x=a.headBodyPaddingX,h=a.open,k=a.scrollBarHeight,O=a.onChange,C=M.useState(h),E=C[0],T=C[1];return n.jsxs("div",{className:"ganttOverview-box",children:[h&&n.jsx("div",{className:"ganttOverview-arrrow-box",onClick:function(){T(!E),O(!E)},children:n.jsx("div",{className:"ganttOverview-arrrow",children:n.jsx(qe,{isOpen:!E,color:"#696B6C"})})}),n.jsx("div",{style:{width:w},className:E?"ganttOverview":"ganttOverview-close",children:n.jsxs("div",{style:{width:w,height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},children:[n.jsx("div",{className:"ganttOverview-head",children:r.map(function(D,A){return n.jsx("div",{className:"ganttOverview-head-item",style:{textAlign:D.align?D.align:"center",width:D.width?D.width:"auto",maxWidth:D.width?D.width:"auto",minWidth:D.width?D.width:"auto"},children:D.renderTableHead?D.renderTableHead():D.title},A)})}),n.jsxs("div",{className:"ganttOverview-body",children:[n.jsx("div",{style:{flex:1,overflow:"hidden"},children:n.jsx("div",{className:"ganttOverview-body-height",style:{paddingLeft:x+"px",paddingRight:x+"px",paddingTop:v+"px",paddingBottom:v+"px"},children:c.map(function(D,A){return n.jsxs("div",{className:"ganttOverview-body-cell",children:[n.jsx("div",{className:"ganttOverview-body-cell-filed",children:D.renderHead?n.jsx("div",{className:"ganttOverview-body-cell-item",children:D.renderHead()}):r.map(function(N,oe){return n.jsx("div",{style:{textAlign:N.align?N.align:"center",width:N.width?N.width:"auto",maxWidth:N.width?N.width:"auto",minWidth:N.width?N.width:"auto"},className:"ganttOverview-body-cell-item",children:N.key?D[N.key]:""},oe)})},A),D.children&&n.jsx("div",{className:"ganttOverview-body-cell-open",children:D.children.map(function(N,oe){return n.jsx("div",{className:"ganttOverview-body-cell-open-cell",children:N.renderHeadChild?n.jsxs("div",{className:"ganttOverview-body-cell-open-cell-item-first ganttOverview-body-cell-open-cell-item",children:[n.jsx("div",{className:"quan"}),n.jsx("div",{className:"",children:N.renderHeadChild()})]}):r.map(function($,ee){return ee===0?n.jsxs("div",{className:"ganttOverview-body-cell-open-cell-item ganttOverview-body-cell-open-cell-item-first",children:[n.jsx("div",{className:"quan"}),n.jsx("div",{style:{width:$.width?$.width:"auto",maxWidth:$.width?$.width:"auto",minWidth:$.width?$.width:"auto"},children:$.key?N[$.key]:""})]},ee):n.jsx("div",{style:{width:$.width?$.width:"auto",maxWidth:$.width?$.width:"auto",minWidth:$.width?$.width:"auto"},className:"ganttOverview-body-cell-open-cell-item",children:n.jsx("div",{children:$.key?N[$.key]:""})},ee)})},oe)})})]},A)})})}),n.jsx("div",{style:{height:k+"px"}})]})]})})]})},Ne={exports:{}};(function(a,r){(function(c,w){a.exports=w()})(Xe,function(){var c=1e3,w=6e4,v=36e5,x="millisecond",h="second",k="minute",O="hour",C="day",E="week",T="month",D="quarter",A="year",N="date",oe="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,ee=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,z={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(u){var o=["th","st","nd","rd"],i=u%100;return"["+u+(o[(i-20)%10]||o[i]||o[0])+"]"}},X=function(u,o,i){var f=String(u);return!f||f.length>=o?u:""+Array(o+1-f.length).join(i)+u},ue={s:X,z:function(u){var o=-u.utcOffset(),i=Math.abs(o),f=Math.floor(i/60),l=i%60;return(o<=0?"+":"-")+X(f,2,"0")+":"+X(l,2,"0")},m:function u(o,i){if(o.date()<i.date())return-u(i,o);var f=12*(i.year()-o.year())+(i.month()-o.month()),l=o.clone().add(f,T),m=i-l<0,p=o.clone().add(f+(m?-1:1),T);return+(-(f+(i-l)/(m?l-p:p-l))||0)},a:function(u){return u<0?Math.ceil(u)||0:Math.floor(u)},p:function(u){return{M:T,y:A,w:E,d:C,D:N,h:O,m:k,s:h,ms:x,Q:D}[u]||String(u||"").toLowerCase().replace(/s$/,"")},u:function(u){return u===void 0}},re="en",ae={};ae[re]=z;var fe="$isDayjsObject",he=function(u){return u instanceof le||!(!u||!u[fe])},se=function u(o,i,f){var l;if(!o)return re;if(typeof o=="string"){var m=o.toLowerCase();ae[m]&&(l=m),i&&(ae[m]=i,l=m);var p=o.split("-");if(!l&&p.length>1)return u(p[0])}else{var d=o.name;ae[d]=o,l=d}return!f&&l&&(re=l),l||!f&&re},F=function(u,o){if(he(u))return u.clone();var i=typeof o=="object"?o:{};return i.date=u,i.args=arguments,new le(i)},B=ue;B.l=se,B.i=he,B.w=function(u,o){return F(u,{locale:o.$L,utc:o.$u,x:o.$x,$offset:o.$offset})};var le=function(){function u(i){this.$L=se(i.locale,null,!0),this.parse(i),this.$x=this.$x||i.x||{},this[fe]=!0}var o=u.prototype;return o.parse=function(i){this.$d=function(f){var l=f.date,m=f.utc;if(l===null)return new Date(NaN);if(B.u(l))return new Date;if(l instanceof Date)return new Date(l);if(typeof l=="string"&&!/Z$/i.test(l)){var p=l.match($);if(p){var d=p[2]-1||0,y=(p[7]||"0").substring(0,3);return m?new Date(Date.UTC(p[1],d,p[3]||1,p[4]||0,p[5]||0,p[6]||0,y)):new Date(p[1],d,p[3]||1,p[4]||0,p[5]||0,p[6]||0,y)}}return new Date(l)}(i),this.init()},o.init=function(){var i=this.$d;this.$y=i.getFullYear(),this.$M=i.getMonth(),this.$D=i.getDate(),this.$W=i.getDay(),this.$H=i.getHours(),this.$m=i.getMinutes(),this.$s=i.getSeconds(),this.$ms=i.getMilliseconds()},o.$utils=function(){return B},o.isValid=function(){return this.$d.toString()!==oe},o.isSame=function(i,f){var l=F(i);return this.startOf(f)<=l&&l<=this.endOf(f)},o.isAfter=function(i,f){return F(i)<this.startOf(f)},o.isBefore=function(i,f){return this.endOf(f)<F(i)},o.$g=function(i,f,l){return B.u(i)?this[f]:this.set(l,i)},o.unix=function(){return Math.floor(this.valueOf()/1e3)},o.valueOf=function(){return this.$d.getTime()},o.startOf=function(i,f){var l=this,m=!!B.u(f)||f,p=B.p(i),d=function(U,L){var G=B.w(l.$u?Date.UTC(l.$y,L,U):new Date(l.$y,L,U),l);return m?G:G.endOf(C)},y=function(U,L){return B.w(l.toDate()[U].apply(l.toDate("s"),(m?[0,0,0,0]:[23,59,59,999]).slice(L)),l)},S=this.$W,_=this.$M,P=this.$D,g="set"+(this.$u?"UTC":"");switch(p){case A:return m?d(1,0):d(31,11);case T:return m?d(1,_):d(0,_+1);case E:var V=this.$locale().weekStart||0,K=(S<V?S+7:S)-V;return d(m?P-K:P+(6-K),_);case C:case N:return y(g+"Hours",0);case O:return y(g+"Minutes",1);case k:return y(g+"Seconds",2);case h:return y(g+"Milliseconds",3);default:return this.clone()}},o.endOf=function(i){return this.startOf(i,!1)},o.$set=function(i,f){var l,m=B.p(i),p="set"+(this.$u?"UTC":""),d=(l={},l[C]=p+"Date",l[N]=p+"Date",l[T]=p+"Month",l[A]=p+"FullYear",l[O]=p+"Hours",l[k]=p+"Minutes",l[h]=p+"Seconds",l[x]=p+"Milliseconds",l)[m],y=m===C?this.$D+(f-this.$W):f;if(m===T||m===A){var S=this.clone().set(N,1);S.$d[d](y),S.init(),this.$d=S.set(N,Math.min(this.$D,S.daysInMonth())).$d}else d&&this.$d[d](y);return this.init(),this},o.set=function(i,f){return this.clone().$set(i,f)},o.get=function(i){return this[B.p(i)]()},o.add=function(i,f){var l,m=this;i=Number(i);var p=B.p(f),d=function(_){var P=F(m);return B.w(P.date(P.date()+Math.round(_*i)),m)};if(p===T)return this.set(T,this.$M+i);if(p===A)return this.set(A,this.$y+i);if(p===C)return d(1);if(p===E)return d(7);var y=(l={},l[k]=w,l[O]=v,l[h]=c,l)[p]||1,S=this.$d.getTime()+i*y;return B.w(S,this)},o.subtract=function(i,f){return this.add(-1*i,f)},o.format=function(i){var f=this,l=this.$locale();if(!this.isValid())return l.invalidDate||oe;var m=i||"YYYY-MM-DDTHH:mm:ssZ",p=B.z(this),d=this.$H,y=this.$m,S=this.$M,_=l.weekdays,P=l.months,g=l.meridiem,V=function(L,G,j,Q){return L&&(L[G]||L(f,m))||j[G].slice(0,Q)},K=function(L){return B.s(d%12||12,L,"0")},U=g||function(L,G,j){var Q=L<12?"AM":"PM";return j?Q.toLowerCase():Q};return m.replace(ee,function(L,G){return G||function(j){switch(j){case"YY":return String(f.$y).slice(-2);case"YYYY":return B.s(f.$y,4,"0");case"M":return S+1;case"MM":return B.s(S+1,2,"0");case"MMM":return V(l.monthsShort,S,P,3);case"MMMM":return V(P,S);case"D":return f.$D;case"DD":return B.s(f.$D,2,"0");case"d":return String(f.$W);case"dd":return V(l.weekdaysMin,f.$W,_,2);case"ddd":return V(l.weekdaysShort,f.$W,_,3);case"dddd":return _[f.$W];case"H":return String(d);case"HH":return B.s(d,2,"0");case"h":return K(1);case"hh":return K(2);case"a":return U(d,y,!0);case"A":return U(d,y,!1);case"m":return String(y);case"mm":return B.s(y,2,"0");case"s":return String(f.$s);case"ss":return B.s(f.$s,2,"0");case"SSS":return B.s(f.$ms,3,"0");case"Z":return p}return null}(L)||p.replace(":","")})},o.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},o.diff=function(i,f,l){var m,p=this,d=B.p(f),y=F(i),S=(y.utcOffset()-this.utcOffset())*w,_=this-y,P=function(){return B.m(p,y)};switch(d){case A:m=P()/12;break;case T:m=P();break;case D:m=P()/3;break;case E:m=(_-S)/6048e5;break;case C:m=(_-S)/864e5;break;case O:m=_/v;break;case k:m=_/w;break;case h:m=_/c;break;default:m=_}return l?m:B.a(m)},o.daysInMonth=function(){return this.endOf(T).$D},o.$locale=function(){return ae[this.$L]},o.locale=function(i,f){if(!i)return this.$L;var l=this.clone(),m=se(i,f,!0);return m&&(l.$L=m),l},o.clone=function(){return B.w(this.$d,this)},o.toDate=function(){return new Date(this.valueOf())},o.toJSON=function(){return this.isValid()?this.toISOString():null},o.toISOString=function(){return this.$d.toISOString()},o.toString=function(){return this.$d.toUTCString()},u}(),te=le.prototype;return F.prototype=te,[["$ms",x],["$s",h],["$m",k],["$H",O],["$W",C],["$M",T],["$y",A],["$D",N]].forEach(function(u){te[u[1]]=function(o){return this.$g(o,u[0],u[1])}}),F.extend=function(u,o){return u.$i||(u(o,le,F),u.$i=!0),F},F.locale=se,F.isDayjs=he,F.unix=function(u){return F(1e3*u)},F.en=ae[re],F.Ls=ae,F.p={},F})})(Ne);var tt=Ne.exports;const I=Ze(tt);var rt=[{status:"finish",text:"已完成"},{status:"finishOvertime",text:"已完成"},{status:"overtime",text:"已超时"},{status:"progress",text:"进行中"},{status:"wait",text:"待接受"}],nt=function(a,r){for(var c=new Date(a.slice(0,8)),w=new Date(r.slice(0,8)),v=[];c<=w;)v.push(I(c).format("YYYY-MM")),c.setMonth(c.getMonth()+1);return v},at=function(a,r,c){var w=new Date(a),v=c==="day"?new Date(r):new Date(new Date(r).getTime()+864e5*30),x=w,h=[];if(c==="day"){var k=nt(a,r);k.forEach(function(C,E){var T=Number(C.split("-")[0]),D=Number(C.split("-")[1]);E===0?h.push({year:"".concat(T,"-").concat(D),length:I(a).endOf("month").date()-I(a).date()+1}):E===k.length-1?h.push({year:"".concat(T,"-").concat(D),length:new Date(r).getDate()}):h.push({year:"".concat(T,"-").concat(D),length:new Date(T,D,0).getDate()})})}else if(c==="month"){for(var O=[];x<=v;)O.push(I(x).format("YYYY-MM")),x.setMonth(x.getMonth()+1);O.forEach(function(C){var E=Number(C.split("-")[0]),T=Number(C.split("-")[1]);h.push({year:"".concat(E,"-").concat(T),length:new Date(E,T,0).getDate()})})}return h},it=function(a,r){for(var c=I(a),w=I(r),v=[],x=c;x.isBefore(w);x=x.add(1,"day"))v.push(x.format("YYYY-MM-DD"));return v.push(r),v},ye=function(a,r){return a?(new Date(a).getTime()-new Date(r).getTime())/1e3/3600:(new Date().getTime()-new Date(r).getTime())/1e3/3600};function ot(a,r){var c;return function(){for(var w=this,v=[],x=0;x<arguments.length;x++)v[x]=arguments[x];clearTimeout(c),c=setTimeout(function(){a.apply(w,v)},r)}}function Te(){for(var a="",r="0123456789abcdef",c=0;c<36;c++)if(c===8||c===13||c===18||c===23)a+="-";else if(c===14)a+="4";else{var w=Math.floor(Math.random()*16);a+=r[c===19?w&3|8:w]}return a}var st=M.memo(function(a){var r=a.days,c=a.width,w=a.bodyRect;return n.jsx("div",{className:"gantt-right-body-content-mark",children:r.map(function(v,x){return n.jsx("div",{style:{width:c*v.length+"px",minWidth:c*v.length+"px",height:w.scrollHeight?w.scrollHeight+"px":"100%"},className:"gantt-right-body-content-mark-item"},x)})})}),Le=M.memo(function(a){var r=a.item,c=a.ganttProgressBarId,w=M.useState({top:0,left:0,bottom:0,height:0}),v=w[0],x=w[1];return M.useEffect(function(){var h=document.getElementsByClassName("progressBar");document.getElementById("top-time-width").innerHTML=` <div class="top-time-width-item" style="left:`.concat(r.left+5,`px;"> <div class="top-time-width-item-child" style="width:`).concat(r.width+1,"px; background:var(--").concat(r.status==="overtime"?"progress":r.status,`Color)"></div> `).concat((r.status==="finishOvertime"||r.status==="overtime")&&r.overtimeWidth?'<div style="width:'.concat(r.overtimeWidth,'px; background:var(--overtimeColor)"></div>'):"",` </div>`);for(var k=0;k<h.length;k++){var O=h[k];O.id!=c&&O.classList.add("gantt-animation")}return function(){for(var C=document.getElementsByClassName("progressBar"),E=0;E<C.length;E++){var T=C[E];T.classList.remove("gantt-animation")}document.getElementById("top-time-width").innerHTML=""}},[c]),M.useEffect(function(){var h=document.getElementById("gantt-right-body-content"),k=document.getElementById(r.ganttProgressBarId);if(h&&k){var O=h.getBoundingClientRect().top-k.getBoundingClientRect().top;x(q.__assign(q.__assign({},v),{top:O-1,height:h.clientHeight||0}))}},[r]),n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"helpLine-line helpLine-line-".concat(r.status),style:{top:v.top+"px",left:r.left+5+"px",height:v.height+"px"}}),n.jsx("div",{className:"helpLine-line helpLine-line-".concat(r.status),style:{left:r.left+5+r.width+"px",top:v.top+"px",height:v.height+"px"}}),(r.status==="finishOvertime"||r.status==="overtime")&&r.overtimeWidth&&n.jsx("div",{className:"helpLine-line helpLine-line-".concat(r.status),style:{top:v.top+"px",borderColor:"#f54040",left:r.left+v.left+5+r.width+r.overtimeWidth+"px",height:v.height+"px"}})]})}),lt=M.memo(function(a){var r=a.item,c=a.index,w=a.showLine,v=a.statusList,x=a.onClickText,h=M.useState(r)[0],k=M.useState(""),O=k[0],C=k[1],E=function(D){C(D)},T=function(){C("")};return n.jsxs("div",{className:"gantt-right-body-cell gantt-right-body-cell-isParent-true",children:[n.jsxs("div",{id:"gantt-progressBar-Id"+c,onMouseEnter:function(){return E("gantt-progressBar-Id"+c)},onMouseLeave:T,className:"progressBar progressBar-".concat(h.status),style:{left:h.left+"px"},children:[n.jsxs("div",{className:"progressBar-box",children:[n.jsx("div",{className:"progressBar-render",children:h.renderoBar&&h.renderoBar(h.width,h.width*h.progress,h.width-h.width*h.progress,h.overtimeWidth)}),n.jsx("div",{className:"progressBar-default",style:{width:h.width+"px"},children:n.jsx("div",{className:"progressBar-active",style:{width:h.progress*100+"%"}})}),(h.status==="overtime"||h.status==="finishOvertime")&&h.overtimeWidth&&n.jsx("div",{className:"progressBar-overTimeWidth",style:{width:h.overtimeWidth+"px"},children:n.jsx("div",{className:"overtimeRender"})})]}),n.jsx("div",{className:"progress-text",onClick:function(){return x(r)},children:v.filter(function(D){return h.status===D.status})[0].text})]}),w&&O==="gantt-progressBar-Id".concat(c)&&n.jsx(Le,{ganttProgressBarId:O,item:q.__assign(q.__assign({},r),{ganttProgressBarId:"gantt-progressBar-Id"+c})})]},c)}),dt=M.memo(function(a){var r=a.item,c=a.index,w=a.showLine,v=M.useState(""),x=v[0],h=v[1],k=function(C){h(C)},O=function(){h("")};return n.jsxs("div",{className:"gantt-right-body-cell gantt-right-body-cell-isParent-false",children:[n.jsx("div",{id:"gantt-progressBar-Id"+c,onMouseEnter:function(){return k("gantt-progressBar-Id"+c)},onMouseLeave:O,className:"progressBar progressBar-".concat(r.status),style:{padding:"5px",border:"0",background:"transparent",left:r.left+"px"},children:n.jsxs("div",{className:"progressBar-box",children:[n.jsx("div",{className:"progressBar-render progressBar-render-child",children:r.renderoBar&&r.renderoBar(r.width,r.width*r.progress,r.width-r.width*r.progress,r.overtimeWidth)}),n.jsx("div",{className:"progressBar-default progressBar-default-child",style:{width:r.width+"px"},children:n.jsx("div",{className:"progressBar-active progressBar-active-child",style:{width:r.progress*100+"%"}})}),(r.status==="overtime"||r.status==="finishOvertime")&&r.overtimeWidth&&n.jsx("div",{className:"progressBar-overTimeWidth progressBar-overTimeWidth-child",style:{width:r.overtimeWidth+"px"},children:n.jsx("div",{className:"overtimeRender"})})]})}),w&&x==="gantt-progressBar-Id".concat(c)&&n.jsx(Le,{ganttProgressBarId:x,item:q.__assign(q.__assign({},r),{ganttProgressBarId:"gantt-progressBar-Id"+c})})]},c)}),ct=function(a){var r=a.list,c=a.headBodyPaddingY,w=a.refresh,v=a.showLine,x=a.ganttType,h=a.statusList,k=h===void 0?rt:h,O=a.onChangeScrollBarHeight,C=a.onClickText,E=M.useState([]),T=E[0],D=E[1],A=M.useState([]),N=A[0],oe=A[1],$=M.useState([]),ee=$[0],z=$[1],X=M.useRef(null),ue=M.useState(0),re=ue[0],ae=ue[1],fe=M.useState(0),he=fe[0],se=fe[1],F=M.useState({height:0,scrollWidth:0,scrollHeight:0}),B=F[0],le=F[1],te=function(d,y,S){var _=d/24,P=S.map(function(g){var V=I(g.startTime),K=V.diff(y.startDate,"day"),U=new Date(g.startTime).getHours(),L=ye("",g.startTime),G=ye(g.endTime,g.startTime),j=0;g.status==="finishOvertime"?(L=G,j=g.finishTime?ye(g.finishTime,g.endTime):0):g.status==="overtime"?(L=G,j=ye("",g.endTime)):g.status==="finish"?L=g.finishTime?ye(g.finishTime,g.startTime):0:g.status==="wait"?L=G:new Date(g.startTime).getTime()>new Date().getTime()?L=0:L=ye("",g.startTime);var Q=L/G;return q.__assign(q.__assign({},g),{startTime:g.startTime,endTime:g.endTime,finishTime:g.finishTime,overtimeWidth:j*_,progress:Q,status:g.status,width:Math.abs(G*_),left:K*d+U*_-5})});z(P)},u=function(d,y){var S,_=(S=document.getElementById("gantt-right"))===null||S===void 0?void 0:S.offsetWidth,P=c*2;if(y.forEach(function(ie){P+=ie.height}),_){var g=at(d.startDate,d.endDate,x),V=0;if(D(g),x==="day"){var K=it(d.startDate,d.endDate),U=_/K.length;V=U>40?U:40;var L=K.map(function(ie){return{year:ie,length:1}});se(_),oe(L)}else if(x==="month"){var G=0;g.forEach(function(ce){return G+=ce.length});var U=_/G;V=U>3?U:3;var j={},Q=[];g.forEach(function(ce){var pe=Number(ce.year.split("-")[0]),Oe=Number(ce.year.split("-")[1]);j[pe]?j[pe].length+=new Date(pe,Oe,0).getDate():j[pe]={length:new Date(pe,Oe,0).getDate(),year:ce.year.slice(0,4)}});for(var me in j)Q.push(j[me]);se(_),oe(g),D(Q)}te(V,d,y),ae(V)}},o=function(){z([]),i()},i=function(){var d=[];r.forEach(function(y,S){S>0&&d.push(q.__assign(q.__assign({},y),{ganttId:Te(),isParent:!0,isEmpty:!1,parentIsEmpty:!0,left:0,width:0,progress:0})),d.push(q.__assign(q.__assign({},y),{ganttId:Te(),isParent:!0,isEmpty:!1,parentIsEmpty:!1,left:0,width:0,progress:0})),y.children&&y.children.forEach(function(_,P){P===0&&d.push(q.__assign(q.__assign({},_),{ganttId:Te(),isParent:!1,parentIsEmpty:!1,isEmpty:!0,left:0,width:0,progress:0})),d.push(q.__assign(q.__assign({},_),{ganttId:Te(),parentIsEmpty:!1,isParent:!1,isEmpty:!1,left:0,width:0,progress:0}))})}),f(d)},f=function(d){var y=!1,S=q.__spreadArray([],d,!0);S.forEach(function(j){if(j.start){var Q=new Date(j.startTime).getTime(),me=new Date(j.endTime).getTime(),ie=j.finishTime?new Date(j.finishTime).getTime():null;ie?Q<ie&&ie<=me?j.status="finish":Q<ie&&ie>me&&(j.status="finishOvertime"):new Date().getTime()>me?(j.status="overtime",y=!0):j.status="progress"}else j.status="wait"});var _=S.map(function(j){return new Date(j.startTime).getTime()}).sort(function(j,Q){return j-Q}),P=S.map(function(j){return new Date(j.endTime).getTime()}).sort(function(j,Q){return Q-j}),g={startDate:"",endDate:""};if(x==="day")if(I(_[0]).format("YYYY-MM")===I(P[0]).format("YYYY-MM")){var V=I(P[0]+1728e5).format("YYYY-MM"),K=I(P[0]).format("YYYY-MM"),U=I(P[0]+864e5*2).endOf("month").format("YYYY-MM-DD");g.startDate=I(_[0]).format("YYYY-MM")+"-01",g.endDate=V===K?U:I(P[0]+864e5*2).format("YYYY-MM-DD")}else g.startDate=I(_[0]-864e5).format("YYYY-MM-DD"),g.endDate=I(P[0]+864e5*2).format("YYYY-MM-DD");else if(x==="month"){var L=I(_[0]),G=L.subtract(1,"month");if(I(_[0]).format("YYYY")===I(P[0]).format("YYYY")){var V=I(P[0]+432e6).format("YYYY-MM-DD"),K=I(P[0]).format("YYYY-MM-DD"),U=I(P[0]+864e5*5).endOf("month").format("YYYY-MM-DD");g.startDate=I(_[0]).format("YYYY")+"-"+G.format("MM")+"-01",g.endDate=V===K?U:I(P[0]).format("YYYY-MM-DD")}else g.startDate=I(_[0]).format("YYYY")+"-"+G.format("MM")+"-01",g.endDate=I(P[0]+864e5*5).format("YYYY-MM-DD")}y&&new Date(g.endDate).getTime()<new Date().getTime()&&(g.endDate=I(new Date().getTime()+864e5*3).format("YYYY-MM-DD")),u(g,S)},l=function(d){document.getElementsByClassName("gantt-right-body-head")[0].scrollLeft=d.target.scrollLeft,document.getElementsByClassName("ganttOverview-body-height")[0].scrollTop=d.target.scrollTop};M.useEffect(function(){return r.length&&(o(),window.addEventListener("resize",ot(o,200))),function(){window.removeEventListener("resize",o)}},[r,w,x]),M.useEffect(function(){if(X.current){var d=X.current.offsetHeight-X.current.clientHeight;le({scrollHeight:X.current.scrollHeight>X.current.clientHeight?X.current.scrollHeight:0,height:X.current.offsetHeight,scrollWidth:X.current.offsetWidth-X.current.clientWidth}),O(d)}},[X.current]);var m=M.useMemo(function(){return n.jsx(n.Fragment,{children:ee.map(function(d,y){return d.isEmpty?n.jsx("div",{className:"gantt-right-body-cell gantt-right-body-cell-isEmpty"},y):d.parentIsEmpty?n.jsx("div",{className:"gantt-right-body-cell gantt-right-body-cell-parentIsEmpty"},y):d.isParent?d.isParent?n.jsx(lt,{item:d,index:y,showLine:v,statusList:k,onClickText:C},d.ganttId):n.jsx(n.Fragment,{}):n.jsx(dt,{item:d,index:y,showLine:v},d.ganttId)})})},[ee]),p=M.useMemo(function(){return n.jsx("div",{className:"gantt-right-body-cell",style:{height:c+"px"}})},[c]);return n.jsx(n.Fragment,{children:n.jsx("div",{className:"gantt-right",id:"gantt-right",children:n.jsxs("div",{className:"gantt-right-body",id:"gantt-right-body",style:{width:he+"px"},children:[n.jsxs("div",{className:"gantt-right-body-head-box ",children:[n.jsxs("div",{className:"gantt-right-body-head",children:[n.jsx("div",{id:"top-time-width"}),n.jsx("div",{className:"gantt-right-body-head-list gantt-right-body-head-year",children:T.map(function(d,y){return n.jsx("div",{style:{width:re*d.length+"px",minWidth:re*d.length+"px"},className:"gantt-right-body-head-year-item",children:d.year},y)})}),n.jsx("div",{className:"gantt-right-body-head-list",children:N.map(function(d,y){return n.jsx("div",{style:{width:re*d.length+"px",minWidth:re*d.length+"px"},className:"gantt-right-head-item-day",children:x==="day"?d.year.split("-")[2]:d.year.split("-")[1]},y)})})]}),n.jsx("div",{className:"gantt-right-head-scrollBarWidth",style:{width:B.scrollWidth}})]}),n.jsx("div",{className:"gantt-right-body-body",children:n.jsx("div",{style:{flex:1,overflow:"hidden"},children:n.jsxs("div",{className:"gantt-right-body-content",ref:X,onScroll:l,id:"gantt-right-body-content",children:[n.jsx(st,{days:N,width:re,bodyRect:B}),p,m,p]})})})]})})})},ut=M.forwardRef(function(a,r){var c=a.data,w=a.head,v=a.showLine,x=v===void 0?!0:v,h=a.headWidth,k=h===void 0?"400px":h,O=a.height,C=O===void 0?"auto":O,E=a.ganttType,T=E===void 0?"day":E,D=a.headBodyPaddingY,A=D===void 0?10:D,N=a.headBodyPaddingX,oe=N===void 0?0:N,$=a.open,ee=$===void 0?!0:$,z=a.onClickText,X=M.useState(!1),ue=X[0],re=X[1],ae=M.useState(T),fe=ae[0],he=ae[1],se=M.useState(0),F=se[0],B=se[1];M.useImperativeHandle(r,function(){return{initGantt:le,setGanttType:te}});var le=function(){setTimeout(function(){re(!ue)},300)},te=function(u){he(u)};return n.jsxs("div",{className:"gantt",style:{height:C},children:[n.jsx(et,{head:w,list:c,open:ee,headBodyPaddingY:A,headBodyPaddingX:oe,headWidth:k,scrollBarHeight:F,onChange:le}),n.jsx(ct,{showLine:x,refresh:ue,ganttType:fe,list:c,headBodyPaddingY:A,onChangeScrollBarHeight:B,onClickText:function(u){return z&&z(u)}})]})});ve.Gantt=ut,Object.defineProperty(ve,Symbol.toStringTag,{value:"Module"})});