@ollap/gantt-vue3 0.3.2 → 0.3.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.
@@ -1 +1 @@
1
- /*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial}}}:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--color-orange-400:oklch(75% .183 55.934);--color-blue-400:oklch(70.7% .165 254.624);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wider:.05em;--radius-md:.375rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1)}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.-top-1{top:calc(var(--spacing)*-1)}.top-0{top:calc(var(--spacing)*0)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing)*2)}.right-0{right:calc(var(--spacing)*0)}.right-4{right:calc(var(--spacing)*4)}.bottom-0{bottom:calc(var(--spacing)*0)}.bottom-2{bottom:calc(var(--spacing)*2)}.bottom-4{bottom:calc(var(--spacing)*4)}.-left-\[6px\]{left:-6px}.left-0{left:calc(var(--spacing)*0)}.left-2{left:calc(var(--spacing)*2)}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.mr-1\.5{margin-right:calc(var(--spacing)*1.5)}.mr-2{margin-right:calc(var(--spacing)*2)}.flex{display:flex}.inline-block{display:inline-block}.h-0{height:calc(var(--spacing)*0)}.h-3{height:calc(var(--spacing)*3)}.h-4{height:calc(var(--spacing)*4)}.h-12{height:calc(var(--spacing)*12)}.h-full{height:100%}.w-0{width:calc(var(--spacing)*0)}.w-1{width:calc(var(--spacing)*1)}.w-3{width:calc(var(--spacing)*3)}.w-4{width:calc(var(--spacing)*4)}.min-w-0{min-width:calc(var(--spacing)*0)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.cursor-col-resize{cursor:col-resize}.cursor-pointer{cursor:pointer}.resize{resize:both}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-md{border-radius:var(--radius-md)}.rounded-l{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-t-\[6px\]{border-top-style:var(--tw-border-style);border-top-width:6px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-r-\[5px\]{border-right-style:var(--tw-border-style);border-right-width:5px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-l-\[5px\]{border-left-style:var(--tw-border-style);border-left-width:5px}.border-\[\#e8e8e8\]{border-color:#e8e8e8}.border-orange-400{border-color:var(--color-orange-400)}.border-slate-50{border-color:var(--color-slate-50)}.border-slate-100{border-color:var(--color-slate-100)}.border-slate-100\/50{border-color:#f1f5f980}@supports (color:color-mix(in lab,red,red)){.border-slate-100\/50{border-color:color-mix(in oklab,var(--color-slate-100)50%,transparent)}}.border-slate-200{border-color:var(--color-slate-200)}.border-t-orange-400{border-top-color:var(--color-orange-400)}.border-r-transparent{border-right-color:#0000}.border-l-transparent{border-left-color:#0000}.bg-black\/80{background-color:#000c}@supports (color:color-mix(in lab,red,red)){.bg-black\/80{background-color:color-mix(in oklab,var(--color-black)80%,transparent)}}.bg-orange-400{background-color:var(--color-orange-400)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-50\/50{background-color:#f8fafc80}@supports (color:color-mix(in lab,red,red)){.bg-slate-50\/50{background-color:color-mix(in oklab,var(--color-slate-50)50%,transparent)}}.bg-slate-300{background-color:var(--color-slate-300)}.bg-slate-400{background-color:var(--color-slate-400)}.bg-white{background-color:var(--color-white)}.p-2{padding:calc(var(--spacing)*2)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-4{padding-block:calc(var(--spacing)*4)}.pr-4{padding-right:calc(var(--spacing)*4)}.font-sans{font-family:var(--font-sans)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.whitespace-nowrap{white-space:nowrap}.text-slate-400{color:var(--color-slate-400)}.text-slate-600{color:var(--color-slate-600)}.text-slate-700{color:var(--color-slate-700)}.text-white{color:var(--color-white)}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-80{opacity:.8}.shadow-\[10px_0_15px_-3px_rgba\(0\,0\,0\,0\.1\)\]{--tw-shadow:10px 0 15px -3px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}@media(hover:hover){.group-hover\:bg-blue-400:is(:where(.group):hover *){background-color:var(--color-blue-400)}.hover\:-translate-y-0\.5:hover{--tw-translate-y:calc(var(--spacing)*-.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.hover\:bg-blue-400:hover{background-color:var(--color-blue-400)}.hover\:bg-slate-50:hover{background-color:var(--color-slate-50)}.hover\:bg-white:hover{background-color:var(--color-white)}.hover\:shadow-lg:hover{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}.no-scrollbar[data-v-907ac2d1]::-webkit-scrollbar{display:none}.no-scrollbar[data-v-907ac2d1]{-ms-overflow-style:none;scrollbar-width:none}.overflow-auto[data-v-907ac2d1]::-webkit-scrollbar{width:6px;height:6px}.overflow-auto[data-v-907ac2d1]::-webkit-scrollbar-track{background:transparent}.overflow-auto[data-v-907ac2d1]::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:10px}.overflow-auto[data-v-907ac2d1]::-webkit-scrollbar-thumb:hover{background:#94a3b8}
1
+ /*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial}}}:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--color-orange-400:oklch(75% .183 55.934);--color-blue-400:oklch(70.7% .165 254.624);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wider:.05em;--radius-md:.375rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1)}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.-top-1{top:calc(var(--spacing)*-1)}.top-0{top:calc(var(--spacing)*0)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing)*2)}.right-0{right:calc(var(--spacing)*0)}.right-4{right:calc(var(--spacing)*4)}.bottom-0{bottom:calc(var(--spacing)*0)}.bottom-2{bottom:calc(var(--spacing)*2)}.bottom-4{bottom:calc(var(--spacing)*4)}.-left-\[6px\]{left:-6px}.left-0{left:calc(var(--spacing)*0)}.left-2{left:calc(var(--spacing)*2)}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.mr-1\.5{margin-right:calc(var(--spacing)*1.5)}.mr-2{margin-right:calc(var(--spacing)*2)}.flex{display:flex}.inline-block{display:inline-block}.h-0{height:calc(var(--spacing)*0)}.h-3{height:calc(var(--spacing)*3)}.h-4{height:calc(var(--spacing)*4)}.h-12{height:calc(var(--spacing)*12)}.h-full{height:100%}.w-0{width:calc(var(--spacing)*0)}.w-1{width:calc(var(--spacing)*1)}.w-3{width:calc(var(--spacing)*3)}.w-4{width:calc(var(--spacing)*4)}.min-w-0{min-width:calc(var(--spacing)*0)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.cursor-col-resize{cursor:col-resize}.cursor-pointer{cursor:pointer}.resize{resize:both}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-md{border-radius:var(--radius-md)}.rounded-l{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-t-\[6px\]{border-top-style:var(--tw-border-style);border-top-width:6px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-r-\[5px\]{border-right-style:var(--tw-border-style);border-right-width:5px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-l-\[5px\]{border-left-style:var(--tw-border-style);border-left-width:5px}.border-\[\#e8e8e8\]{border-color:#e8e8e8}.border-orange-400{border-color:var(--color-orange-400)}.border-slate-50{border-color:var(--color-slate-50)}.border-slate-100{border-color:var(--color-slate-100)}.border-slate-100\/50{border-color:#f1f5f980}@supports (color:color-mix(in lab,red,red)){.border-slate-100\/50{border-color:color-mix(in oklab,var(--color-slate-100)50%,transparent)}}.border-slate-200{border-color:var(--color-slate-200)}.border-t-orange-400{border-top-color:var(--color-orange-400)}.border-r-transparent{border-right-color:#0000}.border-l-transparent{border-left-color:#0000}.bg-black\/80{background-color:#000c}@supports (color:color-mix(in lab,red,red)){.bg-black\/80{background-color:color-mix(in oklab,var(--color-black)80%,transparent)}}.bg-orange-400{background-color:var(--color-orange-400)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-50\/50{background-color:#f8fafc80}@supports (color:color-mix(in lab,red,red)){.bg-slate-50\/50{background-color:color-mix(in oklab,var(--color-slate-50)50%,transparent)}}.bg-slate-300{background-color:var(--color-slate-300)}.bg-slate-400{background-color:var(--color-slate-400)}.bg-white{background-color:var(--color-white)}.p-2{padding:calc(var(--spacing)*2)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-4{padding-block:calc(var(--spacing)*4)}.pr-4{padding-right:calc(var(--spacing)*4)}.font-sans{font-family:var(--font-sans)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.whitespace-nowrap{white-space:nowrap}.text-slate-400{color:var(--color-slate-400)}.text-slate-600{color:var(--color-slate-600)}.text-slate-700{color:var(--color-slate-700)}.text-white{color:var(--color-white)}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-80{opacity:.8}.shadow-\[10px_0_15px_-3px_rgba\(0\,0\,0\,0\.1\)\]{--tw-shadow:10px 0 15px -3px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}@media(hover:hover){.group-hover\:bg-blue-400:is(:where(.group):hover *){background-color:var(--color-blue-400)}.hover\:-translate-y-0\.5:hover{--tw-translate-y:calc(var(--spacing)*-.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.hover\:bg-blue-400:hover{background-color:var(--color-blue-400)}.hover\:bg-slate-50:hover{background-color:var(--color-slate-50)}.hover\:bg-white:hover{background-color:var(--color-white)}.hover\:shadow-lg:hover{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}.no-scrollbar[data-v-5298588d]::-webkit-scrollbar{display:none}.no-scrollbar[data-v-5298588d]{-ms-overflow-style:none;scrollbar-width:none}.overflow-auto[data-v-5298588d]::-webkit-scrollbar{width:6px;height:6px}.overflow-auto[data-v-5298588d]::-webkit-scrollbar-track{background:transparent}.overflow-auto[data-v-5298588d]::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:10px}.overflow-auto[data-v-5298588d]::-webkit-scrollbar-thumb:hover{background:#94a3b8}
@@ -4,7 +4,9 @@ import { CSSProperties } from 'vue';
4
4
  import { DefineComponent } from 'vue';
5
5
  import { PublicProps } from 'vue';
6
6
 
7
- declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
7
+ declare const __VLS_component: DefineComponent<__VLS_Props, {
8
+ getExpandedMapId: () => Map<any, any>;
9
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
8
10
  "update:list": (args_0: GanttItem[]) => any;
9
11
  toggle: (args_0: string | number) => any;
10
12
  }, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
@@ -35,6 +37,9 @@ declare function __VLS_template(): {
35
37
  leftPanelItem?(_: {
36
38
  item: any;
37
39
  }): any;
40
+ leftPanelItemTask?(_: {
41
+ item: any;
42
+ }): any;
38
43
  count?(_: {
39
44
  style: {
40
45
  left: string;
@@ -1,10 +1,10 @@
1
- import { defineComponent as re, ref as f, watch as ie, computed as g, onMounted as de, onUnmounted as ce, createElementBlock as r, openBlock as i, createElementVNode as n, createCommentVNode as A, normalizeStyle as a, renderSlot as T, createTextVNode as ue, Fragment as S, renderList as L, toDisplayString as w, withDirectives as Y, normalizeClass as Q, vShow as Z, withModifiers as ve, nextTick as ee } from "vue";
2
- const pe = "0.3.2", he = {
3
- version: pe
4
- }, fe = { class: "bg-white border border-slate-200 overflow-hidden flex-1 flex flex-col" }, xe = { class: "flex border-b border-slate-200 bg-slate-50/50" }, ge = { class: "text-[10px] tracking-wider text-slate-400" }, ye = { class: "text-xs font-semibold text-slate-400" }, be = { class: "flex flex-1 overflow-hidden" }, me = ["onClick"], we = { class: "mr-2 w-4 h-4" }, _e = { class: "min-w-0" }, De = { class: "text-sm font-semibold text-slate-700 truncate" }, ke = ["onClick"], Te = {
1
+ import { defineComponent as de, ref as h, watch as Q, computed as g, onMounted as ce, onUnmounted as ue, createElementBlock as r, openBlock as i, createElementVNode as a, createCommentVNode as A, normalizeStyle as l, renderSlot as w, createTextVNode as pe, Fragment as S, renderList as L, toDisplayString as _, withDirectives as Z, normalizeClass as ee, vShow as te, withModifiers as ve, nextTick as se } from "vue";
2
+ const fe = "0.3.4", he = {
3
+ version: fe
4
+ }, xe = { class: "bg-white border border-slate-200 overflow-hidden flex-1 flex flex-col" }, ge = { class: "flex border-b border-slate-200 bg-slate-50/50" }, ye = { class: "text-[10px] tracking-wider text-slate-400" }, be = { class: "text-xs font-semibold text-slate-400" }, me = { class: "flex flex-1 overflow-hidden" }, we = ["onClick"], _e = { class: "mr-2 w-4 h-4" }, ke = { class: "min-w-0" }, De = { class: "text-sm font-semibold text-slate-700 truncate" }, Te = ["onClick"], Se = {
5
5
  key: 1,
6
6
  class: "mr-1.5 w-3 h-3 inline-block"
7
- }, Se = { class: "text-xs truncate select-none" }, Ee = { class: "truncate" }, c = 60, h = 52, Ce = 150, $e = 600, Le = 256, Oe = /* @__PURE__ */ re({
7
+ }, Ee = { class: "text-xs truncate select-none" }, $e = { class: "truncate" }, c = 60, f = 52, Ce = 150, Ie = 600, Re = 256, Le = /* @__PURE__ */ de({
8
8
  __name: "GanttChart",
9
9
  props: {
10
10
  list: {},
@@ -14,204 +14,216 @@ const pe = "0.3.2", he = {
14
14
  defaultLeftPanelWidth: {}
15
15
  },
16
16
  emits: ["update:list", "toggle"],
17
- setup(_, { emit: O }) {
18
- const v = _, R = (t, s) => v.shouldCalculate ? v.shouldCalculate(t, s) : !0, I = O, p = f([]), M = f(JSON.parse(JSON.stringify(v.list)));
19
- ie(
20
- () => v.list,
17
+ setup(k, { expose: M, emit: E }) {
18
+ const p = k, O = (t, s) => p.shouldCalculate ? p.shouldCalculate(t, s) : !0, ae = E, v = h([]), z = h(JSON.parse(JSON.stringify(p.list)));
19
+ Q(
20
+ () => p.list,
21
21
  () => {
22
- M.value = JSON.parse(JSON.stringify(v.list));
22
+ z.value = JSON.parse(JSON.stringify(p.list));
23
23
  }
24
24
  );
25
- const E = f(v.defaultLeftPanelWidth ?? Le), z = f(!1), te = (t) => {
26
- z.value = !0;
27
- const s = t.clientX, e = E.value, l = (u) => {
28
- if (!z.value) return;
29
- const d = u.clientX - s, $ = e + d;
30
- E.value = Math.max(Ce, Math.min($e, $));
25
+ const $ = h(p.defaultLeftPanelWidth ?? Re), N = h(!1), ne = (t) => {
26
+ N.value = !0;
27
+ const s = t.clientX, e = $.value, n = (u) => {
28
+ if (!N.value) return;
29
+ const d = u.clientX - s, R = e + d;
30
+ $.value = Math.max(Ce, Math.min(Ie, R));
31
31
  }, o = () => {
32
- z.value = !1, document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", o), document.body.style.cursor = "", document.body.style.userSelect = "";
32
+ N.value = !1, document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), document.body.style.cursor = "", document.body.style.userSelect = "";
33
33
  };
34
- document.addEventListener("mousemove", l), document.addEventListener("mouseup", o), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", t.preventDefault();
35
- }, y = g(() => p.value.length * c), se = g(() => ({
34
+ document.addEventListener("mousemove", n), document.addEventListener("mouseup", o), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", t.preventDefault();
35
+ }, y = g(() => v.value.length * c), le = g(() => ({
36
36
  backgroundImage: `linear-gradient(to right, transparent ${c - 1}px, #e8e8e8 ${c - 1}px, #e8e8e8 ${c}px)`,
37
37
  // backgroundImage: `linear-gradient(to right, #e8e8e8 1px, transparent 1px)`,
38
38
  backgroundSize: `${c}px 100%`,
39
39
  // backgroundRepeat: 'repeat-y',
40
40
  // backgroundPosition: `${CELL_WIDTH}px 0`,
41
41
  width: y.value + "px"
42
- })), ne = g(() => {
43
- const t = {}, s = (e, l) => {
44
- if (!l.startDate || !l.endDate || !R(e, l)) return;
45
- let o = new Date(l.startDate);
46
- const u = new Date(l.endDate);
42
+ })), oe = g(() => {
43
+ const t = {}, s = (e, n) => {
44
+ if (!n.startDate || !n.endDate || !O(e, n)) return;
45
+ let o = new Date(n.startDate);
46
+ const u = new Date(n.endDate);
47
47
  for (; o <= u; ) {
48
48
  const d = o.toISOString().split("T")[0];
49
49
  t[e.id][d] = (t[e.id][d] || 0) + 1, o.setDate(o.getDate() + 1);
50
50
  }
51
- l.children && l.children.forEach((d) => s(e, d));
51
+ n.children && n.children.forEach((d) => s(e, d));
52
52
  };
53
- return M.value.forEach((e) => {
54
- t[e.id] = {}, e.tasks.forEach((l) => {
55
- s(e, l);
53
+ return z.value.forEach((e) => {
54
+ t[e.id] = {}, e.tasks.forEach((n) => {
55
+ s(e, n);
56
56
  });
57
57
  }), t;
58
- }), le = () => {
58
+ }), F = () => {
59
59
  const t = [];
60
- let s = new Date(v.dateRange[0]);
61
- const e = new Date(v.dateRange[1]);
60
+ let s = new Date(p.dateRange[0]);
61
+ const e = new Date(p.dateRange[1]);
62
62
  for (; s <= e; )
63
63
  t.push(s.toISOString().split("T")[0]), s.setDate(s.getDate() + 1);
64
- p.value = t;
65
- }, F = (t) => {
64
+ v.value = t;
65
+ }, G = (t) => {
66
66
  const s = new Date(t), e = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
67
67
  return {
68
68
  monthDay: `${String(s.getMonth() + 1).padStart(2, "0")}/${s.getDate()}`,
69
69
  weekday: e[s.getDay()]
70
70
  };
71
- }, G = (t) => {
72
- const s = p.value.indexOf(t);
71
+ }, B = (t) => {
72
+ const s = v.value.indexOf(t);
73
73
  return s > -1 ? s * c : -999;
74
74
  }, D = (t) => {
75
75
  if (!t.startDate || !t.endDate) return null;
76
- const s = new Date(t.startDate), e = new Date(t.endDate), l = new Date(p.value[0]), o = new Date(p.value[p.value.length - 1]);
77
- if (s < l && e > o)
76
+ const s = new Date(t.startDate), e = new Date(t.endDate), n = new Date(v.value[0]), o = new Date(v.value[v.value.length - 1]);
77
+ if (s < n && e > o)
78
78
  return {
79
79
  left: -4,
80
80
  width: y.value + 8
81
81
  };
82
- let u = p.value.indexOf(t.startDate), d = p.value.indexOf(t.endDate), $ = 4, U = -8;
83
- return u === -1 && d === -1 ? null : (u === -1 && (u = 0, $ = -4), d === -1 && (d = p.value.length - 1, U = 4), {
84
- left: u * c + $,
85
- width: (d - u + 1) * c + U
82
+ let u = v.value.indexOf(t.startDate), d = v.value.indexOf(t.endDate), R = 4, Y = -8;
83
+ return u === -1 && d === -1 ? null : (u === -1 && (u = 0, R = -4), d === -1 && (d = v.value.length - 1, Y = 4), {
84
+ left: u * c + R,
85
+ width: (d - u + 1) * c + Y
86
86
  });
87
- }, b = f(), N = f(), x = f(), P = g(() => {
88
- const t = [], s = (e, l, o, u) => {
87
+ }, b = h(), P = h(), x = h(), C = g(() => {
88
+ const t = [], s = (e, n, o, u) => {
89
89
  t.push({
90
90
  type: "task",
91
91
  data: e,
92
- uniqueKey: `t-${l}-${o}-${e.id}`,
92
+ uniqueKey: `t-${n}-${o}-${e.id}`,
93
93
  parentId: o,
94
- groupId: l,
94
+ groupId: n,
95
95
  level: u
96
96
  }), e.expanded && e.children && e.children.forEach((d) => {
97
- s(d, l, e.id, u + 1);
97
+ s(d, n, e.id, u + 1);
98
98
  });
99
99
  };
100
- return M.value.forEach((e) => {
100
+ return z.value.forEach((e) => {
101
101
  t.push({
102
102
  type: "group",
103
103
  data: e,
104
104
  uniqueKey: `g-${e.id}`,
105
105
  groupId: e.id,
106
106
  level: 0
107
- }), e.expanded && e.tasks.forEach((l) => {
108
- s(l, e.id, e.id, 1);
107
+ }), e.expanded && e.tasks.forEach((n) => {
108
+ s(n, e.id, e.id, 1);
109
109
  });
110
110
  }), t;
111
- }), k = f(0), H = f(600), B = g(() => P.value.length * h), V = g(() => {
112
- const t = Math.floor(k.value / h), s = Math.ceil(H.value / h), e = 5;
111
+ }), T = h(0), H = h(600), V = g(() => C.value.length * f), j = g(() => {
112
+ const t = Math.floor(T.value / f), s = Math.ceil(H.value / f), e = 5;
113
113
  return {
114
114
  start: Math.max(0, t - e),
115
- end: Math.min(P.value.length, t + s + e)
115
+ end: Math.min(C.value.length, t + s + e)
116
116
  };
117
- }), j = g(() => V.value.start * h), q = g(() => {
118
- const { start: t, end: s } = V.value;
119
- return P.value.slice(t, s);
120
- }), J = () => {
117
+ }), q = g(() => j.value.start * f), J = g(() => {
118
+ const { start: t, end: s } = j.value;
119
+ return C.value.slice(t, s);
120
+ }), K = () => {
121
121
  x.value && (H.value = x.value.clientHeight - 1);
122
122
  };
123
123
  let m = !1;
124
- const ae = () => {
125
- m || !b.value || !x.value || (m = !0, k.value = b.value.scrollTop, x.value.scrollTop = b.value.scrollTop, ee(() => m = !1));
126
- }, oe = () => {
127
- m || !x.value || !b.value || (m = !0, k.value = x.value.scrollTop, b.value.scrollTop = x.value.scrollTop, N.value && (N.value.scrollLeft = x.value.scrollLeft), ee(() => m = !1));
128
- }, K = (t) => {
129
- t.expanded = !t.expanded, I("toggle", t.id);
130
- }, X = g(() => {
131
- const t = (/* @__PURE__ */ new Date()).toISOString().split("T")[0], s = p.value.indexOf(t);
124
+ const re = () => {
125
+ m || !b.value || !x.value || (m = !0, T.value = b.value.scrollTop, x.value.scrollTop = b.value.scrollTop, se(() => m = !1));
126
+ }, ie = () => {
127
+ m || !x.value || !b.value || (m = !0, T.value = x.value.scrollTop, b.value.scrollTop = x.value.scrollTop, P.value && (P.value.scrollLeft = x.value.scrollLeft), se(() => m = !1));
128
+ }, X = (t) => {
129
+ t.expanded = !t.expanded, ae("toggle", t.id);
130
+ }, U = g(() => {
131
+ const t = (/* @__PURE__ */ new Date()).toISOString().split("T")[0], s = v.value.indexOf(t);
132
132
  return s === -1 ? null : s * c;
133
- }), W = f();
134
- let C = null;
135
- return de(() => {
136
- le(), J(), W.value && (C = new ResizeObserver(() => {
137
- J();
138
- }), C.observe(W.value));
139
- }), ce(() => {
140
- C && C.disconnect();
133
+ }), W = h();
134
+ let I = null;
135
+ return ce(() => {
136
+ F(), K(), W.value && (I = new ResizeObserver(() => {
137
+ K();
138
+ }), I.observe(W.value));
139
+ }), Q(
140
+ () => p.dateRange,
141
+ () => {
142
+ F();
143
+ }
144
+ ), ue(() => {
145
+ I && I.disconnect();
146
+ }), M({
147
+ getExpandedMapId: () => {
148
+ const t = /* @__PURE__ */ new Map();
149
+ return C.value.forEach((s) => {
150
+ s.type === "group" && t.set(s.data.id, s.data.expanded), s.type === "task" && t.set(`${s.groupId}-${s.data.id}`, s.data.expanded);
151
+ }), t;
152
+ }
141
153
  }), (t, s) => (i(), r("div", {
142
154
  ref_key: "containerRef",
143
155
  ref: W,
144
156
  class: "flex flex-col h-full bg-slate-50 font-sans antialiased select-none"
145
157
  }, [
146
- n("div", fe, [
147
- n("div", xe, [
148
- n("div", {
158
+ a("div", xe, [
159
+ a("div", ge, [
160
+ a("div", {
149
161
  class: "shrink-0 px-6 py-4 border-r border-slate-200 font-bold text-slate-700 relative z-20 shadow-[10px_0_15px_-3px_rgba(0,0,0,0.1)]",
150
- style: a({ width: E.value + "px" })
162
+ style: l({ width: $.value + "px" })
151
163
  }, [
152
- T(t.$slots, "leftPanelHeader", {}, () => [
153
- s[0] || (s[0] = ue("项目成员 / 任务状态", -1))
164
+ w(t.$slots, "leftPanelHeader", {}, () => [
165
+ s[0] || (s[0] = pe("项目成员 / 任务状态", -1))
154
166
  ], !0),
155
- n("div", {
167
+ a("div", {
156
168
  class: "absolute top-0 right-0 bottom-0 w-1 cursor-col-resize hover:bg-blue-400 transition-colors z-20 group",
157
- onMousedown: te
169
+ onMousedown: ne
158
170
  }, null, 32)
159
171
  ], 4),
160
- n("div", {
172
+ a("div", {
161
173
  ref_key: "headerRef",
162
- ref: N,
174
+ ref: P,
163
175
  class: "flex-1 overflow-hidden pointer-events-none"
164
176
  }, [
165
- n("div", {
177
+ a("div", {
166
178
  class: "flex h-full",
167
- style: a({ width: y.value + "px" })
179
+ style: l({ width: y.value + "px" })
168
180
  }, [
169
- (i(!0), r(S, null, L(p.value, (e) => (i(), r("div", {
181
+ (i(!0), r(S, null, L(v.value, (e) => (i(), r("div", {
170
182
  key: e,
171
183
  class: "shrink-0 flex flex-col items-center justify-center border-r border-slate-100 py-2 transition-colors",
172
- style: a({ width: c + "px" })
184
+ style: l({ width: c + "px" })
173
185
  }, [
174
- T(t.$slots, "headerCell", { date: e }, () => [
175
- n("span", ge, w(F(e).weekday), 1),
176
- n("span", ye, w(F(e).monthDay), 1)
186
+ w(t.$slots, "headerCell", { date: e }, () => [
187
+ a("span", ye, _(G(e).weekday), 1),
188
+ a("span", be, _(G(e).monthDay), 1)
177
189
  ], !0)
178
190
  ], 4))), 128))
179
191
  ], 4)
180
192
  ], 512)
181
193
  ]),
182
- n("div", be, [
183
- n("div", {
194
+ a("div", me, [
195
+ a("div", {
184
196
  ref_key: "leftPanelRef",
185
197
  ref: b,
186
198
  class: "shrink-0 border-r border-slate-200 overflow-y-auto overflow-x-hidden relative z-10 shadow-[10px_0_15px_-3px_rgba(0,0,0,0.1)] bg-white no-scrollbar",
187
- style: a({ width: E.value + "px" }),
188
- onScroll: ae
199
+ style: l({ width: $.value + "px" }),
200
+ onScroll: re
189
201
  }, [
190
- n("div", {
191
- style: a({ height: B.value + "px", position: "relative" })
202
+ a("div", {
203
+ style: l({ height: V.value + "px", position: "relative" })
192
204
  }, [
193
- n("div", {
194
- style: a({ transform: `translateY(${j.value}px)` })
205
+ a("div", {
206
+ style: l({ transform: `translateY(${q.value}px)` })
195
207
  }, [
196
- (i(!0), r(S, null, L(q.value, (e) => (i(), r("div", {
208
+ (i(!0), r(S, null, L(J.value, (e) => (i(), r("div", {
197
209
  key: e.uniqueKey
198
210
  }, [
199
211
  e.type === "group" ? (i(), r("div", {
200
212
  key: 0,
201
213
  class: "flex items-center px-4 hover:bg-slate-50 cursor-pointer border-b border-slate-50 transition-colors",
202
- style: a({ height: h + "px" }),
203
- onClick: (l) => K(e.data)
214
+ style: l({ height: f + "px" }),
215
+ onClick: (n) => X(e.data)
204
216
  }, [
205
- Y(n("span", {
206
- class: Q(["transform transition-transform duration-200 mr-2", e.data.expanded ? "rotate-90" : ""])
217
+ Z(a("span", {
218
+ class: ee(["transform transition-transform duration-200 mr-2", e.data.expanded ? "rotate-90" : ""])
207
219
  }, [...s[1] || (s[1] = [
208
- n("svg", {
220
+ a("svg", {
209
221
  class: "w-4 h-4 text-slate-400",
210
222
  fill: "none",
211
223
  stroke: "currentColor",
212
224
  viewBox: "0 0 24 24"
213
225
  }, [
214
- n("path", {
226
+ a("path", {
215
227
  "stroke-linecap": "round",
216
228
  "stroke-linejoin": "round",
217
229
  "stroke-width": "2",
@@ -219,120 +231,124 @@ const pe = "0.3.2", he = {
219
231
  })
220
232
  ], -1)
221
233
  ])], 2), [
222
- [Z, e.data.tasks.length > 0]
234
+ [te, e.data.tasks.length > 0]
223
235
  ]),
224
- Y(n("span", we, null, 512), [
225
- [Z, !e.data.tasks.length]
236
+ Z(a("span", _e, null, 512), [
237
+ [te, !e.data.tasks.length]
226
238
  ]),
227
- n("div", _e, [
228
- T(t.$slots, "leftPanelItem", {
239
+ a("div", ke, [
240
+ w(t.$slots, "leftPanelItem", {
229
241
  item: e.data
230
242
  }, () => [
231
- n("div", De, w(e.data.name), 1)
243
+ a("div", De, _(e.data.name), 1)
232
244
  ], !0)
233
245
  ])
234
- ], 12, me)) : (i(), r("div", {
246
+ ], 12, we)) : (i(), r("div", {
235
247
  key: 1,
236
248
  class: "flex items-center pr-4 border-b border-slate-100/50 text-slate-600 hover:bg-white transition-colors cursor-pointer",
237
- style: a({ height: h + "px", paddingLeft: e.level * 20 + 12 + "px" }),
238
- onClick: ve((l) => K(e.data), ["stop"])
249
+ style: l({ height: f + "px", paddingLeft: e.level * 20 + 12 + "px" }),
250
+ onClick: ve((n) => X(e.data), ["stop"])
239
251
  }, [
240
252
  e.data.children && e.data.children.length > 0 ? (i(), r("span", {
241
253
  key: 0,
242
- class: Q(["transform transition-transform duration-200 mr-1.5", e.data.expanded ? "rotate-90" : ""])
254
+ class: ee(["transform transition-transform duration-200 mr-1.5", e.data.expanded ? "rotate-90" : ""])
243
255
  }, [...s[2] || (s[2] = [
244
- n("svg", {
256
+ a("svg", {
245
257
  class: "w-3 h-3 text-slate-400",
246
258
  fill: "none",
247
259
  stroke: "currentColor",
248
260
  viewBox: "0 0 24 24"
249
261
  }, [
250
- n("path", {
262
+ a("path", {
251
263
  "stroke-linecap": "round",
252
264
  "stroke-linejoin": "round",
253
265
  "stroke-width": "2",
254
266
  d: "M9 5l7 7-7 7"
255
267
  })
256
268
  ], -1)
257
- ])], 2)) : (i(), r("span", Te)),
258
- n("div", Se, w(e.data.name), 1)
259
- ], 12, ke))
269
+ ])], 2)) : (i(), r("span", Se)),
270
+ w(t.$slots, "leftPanelItemTask", {
271
+ item: e.data
272
+ }, () => [
273
+ a("div", Ee, _(e.data.name), 1)
274
+ ], !0)
275
+ ], 12, Te))
260
276
  ]))), 128))
261
277
  ], 4)
262
278
  ], 4)
263
279
  ], 36),
264
- n("div", {
280
+ a("div", {
265
281
  ref_key: "rightPanelRef",
266
282
  ref: x,
267
- onScroll: oe,
283
+ onScroll: ie,
268
284
  class: "flex-1 overflow-auto relative select-none"
269
285
  }, [
270
- X.value !== null && _.showToday ? (i(), r("div", {
286
+ U.value !== null && k.showToday ? (i(), r("div", {
271
287
  key: 0,
272
288
  class: "absolute top-0 z-10 pointer-events-none border-l-2 border-orange-400",
273
- style: a({ left: X.value + "px", bottom: -k.value + "px" })
289
+ style: l({ left: U.value + "px", bottom: -T.value + "px" })
274
290
  }, [...s[3] || (s[3] = [
275
- n("div", {
291
+ a("div", {
276
292
  class: "sticky top-0 z-20",
277
293
  style: { height: "0", overflow: "visible" }
278
294
  }, [
279
- n("div", { class: "absolute -top-1 -left-[6px] w-0 h-0 border-l-[5px] border-l-transparent border-r-[5px] border-r-transparent border-t-[6px] border-t-orange-400" }),
280
- n("div", { class: "absolute top-2 left-2 px-1.5 py-0.5 bg-orange-400 text-[10px] text-white rounded shadow-sm opacity-80 whitespace-nowrap" }, " 今天 ")
295
+ a("div", { class: "absolute -top-1 -left-[6px] w-0 h-0 border-l-[5px] border-l-transparent border-r-[5px] border-r-transparent border-t-[6px] border-t-orange-400" }),
296
+ a("div", { class: "absolute top-2 left-2 px-1.5 py-0.5 bg-orange-400 text-[10px] text-white rounded shadow-sm opacity-80 whitespace-nowrap" }, " 今天 ")
281
297
  ], -1)
282
298
  ])], 4)) : A("", !0),
283
- n("div", {
299
+ a("div", {
284
300
  class: "absolute left-0 pointer-events-none",
285
- style: a({
286
- ...se.value,
301
+ style: l({
302
+ ...le.value,
287
303
  height: H.value + "px",
288
- top: k.value + "px",
304
+ top: T.value + "px",
289
305
  width: y.value + "px"
290
306
  })
291
307
  }, null, 4),
292
- n("div", {
293
- style: a({ height: B.value + "px", position: "relative" })
308
+ a("div", {
309
+ style: l({ height: V.value + "px", position: "relative" })
294
310
  }, [
295
- n("div", {
296
- style: a({ transform: `translateY(${j.value}px)` })
311
+ a("div", {
312
+ style: l({ transform: `translateY(${q.value}px)` })
297
313
  }, [
298
- (i(!0), r(S, null, L(q.value, (e) => (i(), r(S, {
314
+ (i(!0), r(S, null, L(J.value, (e) => (i(), r(S, {
299
315
  key: e.uniqueKey
300
316
  }, [
301
317
  e.type === "group" ? (i(), r("div", {
302
318
  key: 0,
303
319
  class: "relative border-b border-[#e8e8e8]",
304
- style: a({ height: h + "px", width: y.value + "px" })
320
+ style: l({ height: f + "px", width: y.value + "px" })
305
321
  }, [
306
- (i(!0), r(S, null, L(ne.value[e.data.id], (l, o) => T(t.$slots, "count", {
322
+ (i(!0), r(S, null, L(oe.value[e.data.id], (n, o) => w(t.$slots, "count", {
307
323
  key: o,
308
324
  item: e.data,
309
325
  date: o,
310
- count: l,
311
- style: a({
312
- left: G(o) + "px",
326
+ count: n,
327
+ style: l({
328
+ left: B(o) + "px",
313
329
  width: c + "px",
314
- height: h + "px"
330
+ height: f + "px"
315
331
  })
316
332
  }, () => [
317
- n("div", {
333
+ a("div", {
318
334
  class: "absolute top-0 flex items-center justify-center text-sm",
319
- style: a({
320
- left: G(o) + "px",
335
+ style: l({
336
+ left: B(o) + "px",
321
337
  width: c + "px",
322
- height: h + "px",
338
+ height: f + "px",
323
339
  contentVisibility: "auto",
324
- containIntrinsicSize: `${c}px ${h}px`
340
+ containIntrinsicSize: `${c}px ${f}px`
325
341
  })
326
- }, w(l), 5)
342
+ }, _(n), 5)
327
343
  ], !0)), 128))
328
344
  ], 4)) : (i(), r("div", {
329
345
  key: 1,
330
346
  class: "relative border-b border-[#e8e8e8] overflow-hidden",
331
- style: a({ height: h + "px", width: y.value + "px" })
347
+ style: l({ height: f + "px", width: y.value + "px" })
332
348
  }, [
333
- D(e.data) ? T(t.$slots, "task", {
349
+ D(e.data) ? w(t.$slots, "task", {
334
350
  key: 0,
335
- style: a({
351
+ style: l({
336
352
  left: D(e.data).left + "px",
337
353
  width: D(e.data).width + "px",
338
354
  position: "absolute"
@@ -340,15 +356,15 @@ const pe = "0.3.2", he = {
340
356
  task: e.data,
341
357
  ganttItemId: e.groupId
342
358
  }, () => [
343
- n("div", {
359
+ a("div", {
344
360
  class: "absolute bg-slate-400 top-2 bottom-2 rounded-md shadow-sm flex items-center px-3 text-[11px] text-white font-medium cursor-pointer hover:shadow-lg hover:-translate-y-0.5 transition-all duration-200",
345
- style: a({
361
+ style: l({
346
362
  left: D(e.data).left + "px",
347
363
  width: D(e.data).width + "px",
348
364
  backgroundColor: e.data.color
349
365
  })
350
366
  }, [
351
- n("span", Ee, w(e.data.name), 1)
367
+ a("span", $e, _(e.data.name), 1)
352
368
  ], 4)
353
369
  ], !0) : A("", !0)
354
370
  ], 4))
@@ -361,16 +377,16 @@ const pe = "0.3.2", he = {
361
377
  A("", !0)
362
378
  ], 512));
363
379
  }
364
- }), Re = (_, O) => {
365
- const v = _.__vccOpts || _;
366
- for (const [R, I] of O)
367
- v[R] = I;
368
- return v;
369
- }, Me = /* @__PURE__ */ Re(Oe, [["__scopeId", "data-v-907ac2d1"]]), ze = he.version, Ne = () => {
380
+ }), Me = (k, M) => {
381
+ const E = k.__vccOpts || k;
382
+ for (const [p, O] of M)
383
+ E[p] = O;
384
+ return E;
385
+ }, ze = /* @__PURE__ */ Me(Le, [["__scopeId", "data-v-5298588d"]]), Ne = he.version, Pe = () => {
370
386
  console.log("Gantt Core Initialized");
371
387
  };
372
388
  export {
373
- ze as GANTT_VERSION,
374
- Me as GanttChart,
375
- Ne as setupGantt
389
+ Ne as GANTT_VERSION,
390
+ ze as GanttChart,
391
+ Pe as setupGantt
376
392
  };
@@ -1 +1 @@
1
- (function(f,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(f=typeof globalThis<"u"?globalThis:f||self,e(f.GanttVue3={},f.Vue))})(this,(function(f,e){"use strict";const F={version:"0.3.2"},G={class:"bg-white border border-slate-200 overflow-hidden flex-1 flex flex-col"},A={class:"flex border-b border-slate-200 bg-slate-50/50"},j={class:"text-[10px] tracking-wider text-slate-400"},q={class:"text-xs font-semibold text-slate-400"},J={class:"flex flex-1 overflow-hidden"},K=["onClick"],X={class:"mr-2 w-4 h-4"},U={class:"min-w-0"},Y={class:"text-sm font-semibold text-slate-700 truncate"},Q=["onClick"],Z={key:1,class:"mr-1.5 w-3 h-3 inline-block"},ee={class:"text-xs truncate select-none"},te={class:"truncate"},r=60,d=52,le=150,ne=600,oe=256,ae=((y,_)=>{const c=y.__vccOpts||y;for(const[w,D]of _)c[w]=D;return c})(e.defineComponent({__name:"GanttChart",props:{list:{},dateRange:{},showToday:{type:Boolean},shouldCalculate:{type:Function},defaultLeftPanelWidth:{}},emits:["update:list","toggle"],setup(y,{emit:_}){const c=y,w=(l,n)=>c.shouldCalculate?c.shouldCalculate(l,n):!0,D=_,p=e.ref([]),N=e.ref(JSON.parse(JSON.stringify(c.list)));e.watch(()=>c.list,()=>{N.value=JSON.parse(JSON.stringify(c.list))});const k=e.ref(c.defaultLeftPanelWidth??oe),V=e.ref(!1),ie=l=>{V.value=!0;const n=l.clientX,t=k.value,o=i=>{if(!V.value)return;const s=i.clientX-n,S=t+s;k.value=Math.max(le,Math.min(ne,S))},a=()=>{V.value=!1,document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",a),document.body.style.cursor="",document.body.style.userSelect=""};document.addEventListener("mousemove",o),document.addEventListener("mouseup",a),document.body.style.cursor="col-resize",document.body.style.userSelect="none",l.preventDefault()},m=e.computed(()=>p.value.length*r),de=e.computed(()=>({backgroundImage:`linear-gradient(to right, transparent ${r-1}px, #e8e8e8 ${r-1}px, #e8e8e8 ${r}px)`,backgroundSize:`${r}px 100%`,width:m.value+"px"})),ce=e.computed(()=>{const l={},n=(t,o)=>{if(!o.startDate||!o.endDate||!w(t,o))return;let a=new Date(o.startDate);const i=new Date(o.endDate);for(;a<=i;){const s=a.toISOString().split("T")[0];l[t.id][s]=(l[t.id][s]||0)+1,a.setDate(a.getDate()+1)}o.children&&o.children.forEach(s=>n(t,s))};return N.value.forEach(t=>{l[t.id]={},t.tasks.forEach(o=>{n(t,o)})}),l}),pe=()=>{const l=[];let n=new Date(c.dateRange[0]);const t=new Date(c.dateRange[1]);for(;n<=t;)l.push(n.toISOString().split("T")[0]),n.setDate(n.getDate()+1);p.value=l},L=l=>{const n=new Date(l),t=["周日","周一","周二","周三","周四","周五","周六"];return{monthDay:`${String(n.getMonth()+1).padStart(2,"0")}/${n.getDate()}`,weekday:t[n.getDay()]}},v=l=>{const n=p.value.indexOf(l);return n>-1?n*r:-999},g=l=>{if(!l.startDate||!l.endDate)return null;const n=new Date(l.startDate),t=new Date(l.endDate),o=new Date(p.value[0]),a=new Date(p.value[p.value.length-1]);if(n<o&&t>a)return{left:-4,width:m.value+8};let i=p.value.indexOf(l.startDate),s=p.value.indexOf(l.endDate),S=4,W=-8;return i===-1&&s===-1?null:(i===-1&&(i=0,S=-4),s===-1&&(s=p.value.length-1,W=4),{left:i*r+S,width:(s-i+1)*r+W})},x=e.ref(),z=e.ref(),h=e.ref(),T=e.computed(()=>{const l=[],n=(t,o,a,i)=>{l.push({type:"task",data:t,uniqueKey:`t-${o}-${a}-${t.id}`,parentId:a,groupId:o,level:i}),t.expanded&&t.children&&t.children.forEach(s=>{n(s,o,t.id,i+1)})};return N.value.forEach(t=>{l.push({type:"group",data:t,uniqueKey:`g-${t.id}`,groupId:t.id,level:0}),t.expanded&&t.tasks.forEach(o=>{n(o,t.id,t.id,1)})}),l}),b=e.ref(0),B=e.ref(600),O=e.computed(()=>T.value.length*d),R=e.computed(()=>{const l=Math.floor(b.value/d),n=Math.ceil(B.value/d),t=5;return{start:Math.max(0,l-t),end:Math.min(T.value.length,l+n+t)}}),$=e.computed(()=>R.value.start*d),I=e.computed(()=>{const{start:l,end:n}=R.value;return T.value.slice(l,n)}),M=()=>{h.value&&(B.value=h.value.clientHeight-1)};let u=!1;const fe=()=>{u||!x.value||!h.value||(u=!0,b.value=x.value.scrollTop,h.value.scrollTop=x.value.scrollTop,e.nextTick(()=>u=!1))},he=()=>{u||!h.value||!x.value||(u=!0,b.value=h.value.scrollTop,x.value.scrollTop=h.value.scrollTop,z.value&&(z.value.scrollLeft=h.value.scrollLeft),e.nextTick(()=>u=!1))},P=l=>{l.expanded=!l.expanded,D("toggle",l.id)},H=e.computed(()=>{const l=new Date().toISOString().split("T")[0],n=p.value.indexOf(l);return n===-1?null:n*r}),C=e.ref();let E=null;return e.onMounted(()=>{pe(),M(),C.value&&(E=new ResizeObserver(()=>{M()}),E.observe(C.value))}),e.onUnmounted(()=>{E&&E.disconnect()}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:C,class:"flex flex-col h-full bg-slate-50 font-sans antialiased select-none"},[e.createElementVNode("div",G,[e.createElementVNode("div",A,[e.createElementVNode("div",{class:"shrink-0 px-6 py-4 border-r border-slate-200 font-bold text-slate-700 relative z-20 shadow-[10px_0_15px_-3px_rgba(0,0,0,0.1)]",style:e.normalizeStyle({width:k.value+"px"})},[e.renderSlot(l.$slots,"leftPanelHeader",{},()=>[n[0]||(n[0]=e.createTextVNode("项目成员 / 任务状态",-1))],!0),e.createElementVNode("div",{class:"absolute top-0 right-0 bottom-0 w-1 cursor-col-resize hover:bg-blue-400 transition-colors z-20 group",onMousedown:ie},null,32)],4),e.createElementVNode("div",{ref_key:"headerRef",ref:z,class:"flex-1 overflow-hidden pointer-events-none"},[e.createElementVNode("div",{class:"flex h-full",style:e.normalizeStyle({width:m.value+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,t=>(e.openBlock(),e.createElementBlock("div",{key:t,class:"shrink-0 flex flex-col items-center justify-center border-r border-slate-100 py-2 transition-colors",style:e.normalizeStyle({width:r+"px"})},[e.renderSlot(l.$slots,"headerCell",{date:t},()=>[e.createElementVNode("span",j,e.toDisplayString(L(t).weekday),1),e.createElementVNode("span",q,e.toDisplayString(L(t).monthDay),1)],!0)],4))),128))],4)],512)]),e.createElementVNode("div",J,[e.createElementVNode("div",{ref_key:"leftPanelRef",ref:x,class:"shrink-0 border-r border-slate-200 overflow-y-auto overflow-x-hidden relative z-10 shadow-[10px_0_15px_-3px_rgba(0,0,0,0.1)] bg-white no-scrollbar",style:e.normalizeStyle({width:k.value+"px"}),onScroll:fe},[e.createElementVNode("div",{style:e.normalizeStyle({height:O.value+"px",position:"relative"})},[e.createElementVNode("div",{style:e.normalizeStyle({transform:`translateY(${$.value}px)`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,t=>(e.openBlock(),e.createElementBlock("div",{key:t.uniqueKey},[t.type==="group"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"flex items-center px-4 hover:bg-slate-50 cursor-pointer border-b border-slate-50 transition-colors",style:e.normalizeStyle({height:d+"px"}),onClick:o=>P(t.data)},[e.withDirectives(e.createElementVNode("span",{class:e.normalizeClass(["transform transition-transform duration-200 mr-2",t.data.expanded?"rotate-90":""])},[...n[1]||(n[1]=[e.createElementVNode("svg",{class:"w-4 h-4 text-slate-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)])],2),[[e.vShow,t.data.tasks.length>0]]),e.withDirectives(e.createElementVNode("span",X,null,512),[[e.vShow,!t.data.tasks.length]]),e.createElementVNode("div",U,[e.renderSlot(l.$slots,"leftPanelItem",{item:t.data},()=>[e.createElementVNode("div",Y,e.toDisplayString(t.data.name),1)],!0)])],12,K)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"flex items-center pr-4 border-b border-slate-100/50 text-slate-600 hover:bg-white transition-colors cursor-pointer",style:e.normalizeStyle({height:d+"px",paddingLeft:t.level*20+12+"px"}),onClick:e.withModifiers(o=>P(t.data),["stop"])},[t.data.children&&t.data.children.length>0?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["transform transition-transform duration-200 mr-1.5",t.data.expanded?"rotate-90":""])},[...n[2]||(n[2]=[e.createElementVNode("svg",{class:"w-3 h-3 text-slate-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)])],2)):(e.openBlock(),e.createElementBlock("span",Z)),e.createElementVNode("div",ee,e.toDisplayString(t.data.name),1)],12,Q))]))),128))],4)],4)],36),e.createElementVNode("div",{ref_key:"rightPanelRef",ref:h,onScroll:he,class:"flex-1 overflow-auto relative select-none"},[H.value!==null&&y.showToday?(e.openBlock(),e.createElementBlock("div",{key:0,class:"absolute top-0 z-10 pointer-events-none border-l-2 border-orange-400",style:e.normalizeStyle({left:H.value+"px",bottom:-b.value+"px"})},[...n[3]||(n[3]=[e.createElementVNode("div",{class:"sticky top-0 z-20",style:{height:"0",overflow:"visible"}},[e.createElementVNode("div",{class:"absolute -top-1 -left-[6px] w-0 h-0 border-l-[5px] border-l-transparent border-r-[5px] border-r-transparent border-t-[6px] border-t-orange-400"}),e.createElementVNode("div",{class:"absolute top-2 left-2 px-1.5 py-0.5 bg-orange-400 text-[10px] text-white rounded shadow-sm opacity-80 whitespace-nowrap"}," 今天 ")],-1)])],4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"absolute left-0 pointer-events-none",style:e.normalizeStyle({...de.value,height:B.value+"px",top:b.value+"px",width:m.value+"px"})},null,4),e.createElementVNode("div",{style:e.normalizeStyle({height:O.value+"px",position:"relative"})},[e.createElementVNode("div",{style:e.normalizeStyle({transform:`translateY(${$.value}px)`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.uniqueKey},[t.type==="group"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"relative border-b border-[#e8e8e8]",style:e.normalizeStyle({height:d+"px",width:m.value+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ce.value[t.data.id],(o,a)=>e.renderSlot(l.$slots,"count",{key:a,item:t.data,date:a,count:o,style:e.normalizeStyle({left:v(a)+"px",width:r+"px",height:d+"px"})},()=>[e.createElementVNode("div",{class:"absolute top-0 flex items-center justify-center text-sm",style:e.normalizeStyle({left:v(a)+"px",width:r+"px",height:d+"px",contentVisibility:"auto",containIntrinsicSize:`${r}px ${d}px`})},e.toDisplayString(o),5)],!0)),128))],4)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"relative border-b border-[#e8e8e8] overflow-hidden",style:e.normalizeStyle({height:d+"px",width:m.value+"px"})},[g(t.data)?e.renderSlot(l.$slots,"task",{key:0,style:e.normalizeStyle({left:g(t.data).left+"px",width:g(t.data).width+"px",position:"absolute"}),task:t.data,ganttItemId:t.groupId},()=>[e.createElementVNode("div",{class:"absolute bg-slate-400 top-2 bottom-2 rounded-md shadow-sm flex items-center px-3 text-[11px] text-white font-medium cursor-pointer hover:shadow-lg hover:-translate-y-0.5 transition-all duration-200",style:e.normalizeStyle({left:g(t.data).left+"px",width:g(t.data).width+"px",backgroundColor:t.data.color})},[e.createElementVNode("span",te,e.toDisplayString(t.data.name),1)],4)],!0):e.createCommentVNode("",!0)],4))],64))),128))],4)],4)],544)])]),e.createCommentVNode("",!0)],512))}}),[["__scopeId","data-v-907ac2d1"]]),re=F.version,se=()=>{console.log("Gantt Core Initialized")};f.GANTT_VERSION=re,f.GanttChart=ae,f.setupGantt=se,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(f,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(f=typeof globalThis<"u"?globalThis:f||self,e(f.GanttVue3={},f.Vue))})(this,(function(f,e){"use strict";const G={version:"0.3.4"},A={class:"bg-white border border-slate-200 overflow-hidden flex-1 flex flex-col"},j={class:"flex border-b border-slate-200 bg-slate-50/50"},q={class:"text-[10px] tracking-wider text-slate-400"},J={class:"text-xs font-semibold text-slate-400"},K={class:"flex flex-1 overflow-hidden"},X=["onClick"],U={class:"mr-2 w-4 h-4"},Y={class:"min-w-0"},Q={class:"text-sm font-semibold text-slate-700 truncate"},Z=["onClick"],ee={key:1,class:"mr-1.5 w-3 h-3 inline-block"},te={class:"text-xs truncate select-none"},ne={class:"truncate"},r=60,d=52,le=150,oe=600,ae=256,re=((y,D)=>{const k=y.__vccOpts||y;for(const[c,N]of D)k[c]=N;return k})(e.defineComponent({__name:"GanttChart",props:{list:{},dateRange:{},showToday:{type:Boolean},shouldCalculate:{type:Function},defaultLeftPanelWidth:{}},emits:["update:list","toggle"],setup(y,{expose:D,emit:k}){const c=y,N=(n,l)=>c.shouldCalculate?c.shouldCalculate(n,l):!0,de=k,p=e.ref([]),V=e.ref(JSON.parse(JSON.stringify(c.list)));e.watch(()=>c.list,()=>{V.value=JSON.parse(JSON.stringify(c.list))});const E=e.ref(c.defaultLeftPanelWidth??ae),T=e.ref(!1),ce=n=>{T.value=!0;const l=n.clientX,t=E.value,o=i=>{if(!T.value)return;const s=i.clientX-l,_=t+s;E.value=Math.max(le,Math.min(oe,_))},a=()=>{T.value=!1,document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",a),document.body.style.cursor="",document.body.style.userSelect=""};document.addEventListener("mousemove",o),document.addEventListener("mouseup",a),document.body.style.cursor="col-resize",document.body.style.userSelect="none",n.preventDefault()},m=e.computed(()=>p.value.length*r),pe=e.computed(()=>({backgroundImage:`linear-gradient(to right, transparent ${r-1}px, #e8e8e8 ${r-1}px, #e8e8e8 ${r}px)`,backgroundSize:`${r}px 100%`,width:m.value+"px"})),fe=e.computed(()=>{const n={},l=(t,o)=>{if(!o.startDate||!o.endDate||!N(t,o))return;let a=new Date(o.startDate);const i=new Date(o.endDate);for(;a<=i;){const s=a.toISOString().split("T")[0];n[t.id][s]=(n[t.id][s]||0)+1,a.setDate(a.getDate()+1)}o.children&&o.children.forEach(s=>l(t,s))};return V.value.forEach(t=>{n[t.id]={},t.tasks.forEach(o=>{l(t,o)})}),n}),$=()=>{const n=[];let l=new Date(c.dateRange[0]);const t=new Date(c.dateRange[1]);for(;l<=t;)n.push(l.toISOString().split("T")[0]),l.setDate(l.getDate()+1);p.value=n},L=n=>{const l=new Date(n),t=["周日","周一","周二","周三","周四","周五","周六"];return{monthDay:`${String(l.getMonth()+1).padStart(2,"0")}/${l.getDate()}`,weekday:t[l.getDay()]}},I=n=>{const l=p.value.indexOf(n);return l>-1?l*r:-999},g=n=>{if(!n.startDate||!n.endDate)return null;const l=new Date(n.startDate),t=new Date(n.endDate),o=new Date(p.value[0]),a=new Date(p.value[p.value.length-1]);if(l<o&&t>a)return{left:-4,width:m.value+8};let i=p.value.indexOf(n.startDate),s=p.value.indexOf(n.endDate),_=4,F=-8;return i===-1&&s===-1?null:(i===-1&&(i=0,_=-4),s===-1&&(s=p.value.length-1,F=4),{left:i*r+_,width:(s-i+1)*r+F})},x=e.ref(),z=e.ref(),h=e.ref(),S=e.computed(()=>{const n=[],l=(t,o,a,i)=>{n.push({type:"task",data:t,uniqueKey:`t-${o}-${a}-${t.id}`,parentId:a,groupId:o,level:i}),t.expanded&&t.children&&t.children.forEach(s=>{l(s,o,t.id,i+1)})};return V.value.forEach(t=>{n.push({type:"group",data:t,uniqueKey:`g-${t.id}`,groupId:t.id,level:0}),t.expanded&&t.tasks.forEach(o=>{l(o,t.id,t.id,1)})}),n}),b=e.ref(0),B=e.ref(600),O=e.computed(()=>S.value.length*d),R=e.computed(()=>{const n=Math.floor(b.value/d),l=Math.ceil(B.value/d),t=5;return{start:Math.max(0,n-t),end:Math.min(S.value.length,n+l+t)}}),v=e.computed(()=>R.value.start*d),M=e.computed(()=>{const{start:n,end:l}=R.value;return S.value.slice(n,l)}),P=()=>{h.value&&(B.value=h.value.clientHeight-1)};let u=!1;const he=()=>{u||!x.value||!h.value||(u=!0,b.value=x.value.scrollTop,h.value.scrollTop=x.value.scrollTop,e.nextTick(()=>u=!1))},me=()=>{u||!h.value||!x.value||(u=!0,b.value=h.value.scrollTop,x.value.scrollTop=h.value.scrollTop,z.value&&(z.value.scrollLeft=h.value.scrollLeft),e.nextTick(()=>u=!1))},H=n=>{n.expanded=!n.expanded,de("toggle",n.id)},W=e.computed(()=>{const n=new Date().toISOString().split("T")[0],l=p.value.indexOf(n);return l===-1?null:l*r}),C=e.ref();let w=null;return e.onMounted(()=>{$(),P(),C.value&&(w=new ResizeObserver(()=>{P()}),w.observe(C.value))}),e.watch(()=>c.dateRange,()=>{$()}),e.onUnmounted(()=>{w&&w.disconnect()}),D({getExpandedMapId:()=>{const n=new Map;return S.value.forEach(l=>{l.type==="group"&&n.set(l.data.id,l.data.expanded),l.type==="task"&&n.set(`${l.groupId}-${l.data.id}`,l.data.expanded)}),n}}),(n,l)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:C,class:"flex flex-col h-full bg-slate-50 font-sans antialiased select-none"},[e.createElementVNode("div",A,[e.createElementVNode("div",j,[e.createElementVNode("div",{class:"shrink-0 px-6 py-4 border-r border-slate-200 font-bold text-slate-700 relative z-20 shadow-[10px_0_15px_-3px_rgba(0,0,0,0.1)]",style:e.normalizeStyle({width:E.value+"px"})},[e.renderSlot(n.$slots,"leftPanelHeader",{},()=>[l[0]||(l[0]=e.createTextVNode("项目成员 / 任务状态",-1))],!0),e.createElementVNode("div",{class:"absolute top-0 right-0 bottom-0 w-1 cursor-col-resize hover:bg-blue-400 transition-colors z-20 group",onMousedown:ce},null,32)],4),e.createElementVNode("div",{ref_key:"headerRef",ref:z,class:"flex-1 overflow-hidden pointer-events-none"},[e.createElementVNode("div",{class:"flex h-full",style:e.normalizeStyle({width:m.value+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,t=>(e.openBlock(),e.createElementBlock("div",{key:t,class:"shrink-0 flex flex-col items-center justify-center border-r border-slate-100 py-2 transition-colors",style:e.normalizeStyle({width:r+"px"})},[e.renderSlot(n.$slots,"headerCell",{date:t},()=>[e.createElementVNode("span",q,e.toDisplayString(L(t).weekday),1),e.createElementVNode("span",J,e.toDisplayString(L(t).monthDay),1)],!0)],4))),128))],4)],512)]),e.createElementVNode("div",K,[e.createElementVNode("div",{ref_key:"leftPanelRef",ref:x,class:"shrink-0 border-r border-slate-200 overflow-y-auto overflow-x-hidden relative z-10 shadow-[10px_0_15px_-3px_rgba(0,0,0,0.1)] bg-white no-scrollbar",style:e.normalizeStyle({width:E.value+"px"}),onScroll:he},[e.createElementVNode("div",{style:e.normalizeStyle({height:O.value+"px",position:"relative"})},[e.createElementVNode("div",{style:e.normalizeStyle({transform:`translateY(${v.value}px)`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,t=>(e.openBlock(),e.createElementBlock("div",{key:t.uniqueKey},[t.type==="group"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"flex items-center px-4 hover:bg-slate-50 cursor-pointer border-b border-slate-50 transition-colors",style:e.normalizeStyle({height:d+"px"}),onClick:o=>H(t.data)},[e.withDirectives(e.createElementVNode("span",{class:e.normalizeClass(["transform transition-transform duration-200 mr-2",t.data.expanded?"rotate-90":""])},[...l[1]||(l[1]=[e.createElementVNode("svg",{class:"w-4 h-4 text-slate-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)])],2),[[e.vShow,t.data.tasks.length>0]]),e.withDirectives(e.createElementVNode("span",U,null,512),[[e.vShow,!t.data.tasks.length]]),e.createElementVNode("div",Y,[e.renderSlot(n.$slots,"leftPanelItem",{item:t.data},()=>[e.createElementVNode("div",Q,e.toDisplayString(t.data.name),1)],!0)])],12,X)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"flex items-center pr-4 border-b border-slate-100/50 text-slate-600 hover:bg-white transition-colors cursor-pointer",style:e.normalizeStyle({height:d+"px",paddingLeft:t.level*20+12+"px"}),onClick:e.withModifiers(o=>H(t.data),["stop"])},[t.data.children&&t.data.children.length>0?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["transform transition-transform duration-200 mr-1.5",t.data.expanded?"rotate-90":""])},[...l[2]||(l[2]=[e.createElementVNode("svg",{class:"w-3 h-3 text-slate-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)])],2)):(e.openBlock(),e.createElementBlock("span",ee)),e.renderSlot(n.$slots,"leftPanelItemTask",{item:t.data},()=>[e.createElementVNode("div",te,e.toDisplayString(t.data.name),1)],!0)],12,Z))]))),128))],4)],4)],36),e.createElementVNode("div",{ref_key:"rightPanelRef",ref:h,onScroll:me,class:"flex-1 overflow-auto relative select-none"},[W.value!==null&&y.showToday?(e.openBlock(),e.createElementBlock("div",{key:0,class:"absolute top-0 z-10 pointer-events-none border-l-2 border-orange-400",style:e.normalizeStyle({left:W.value+"px",bottom:-b.value+"px"})},[...l[3]||(l[3]=[e.createElementVNode("div",{class:"sticky top-0 z-20",style:{height:"0",overflow:"visible"}},[e.createElementVNode("div",{class:"absolute -top-1 -left-[6px] w-0 h-0 border-l-[5px] border-l-transparent border-r-[5px] border-r-transparent border-t-[6px] border-t-orange-400"}),e.createElementVNode("div",{class:"absolute top-2 left-2 px-1.5 py-0.5 bg-orange-400 text-[10px] text-white rounded shadow-sm opacity-80 whitespace-nowrap"}," 今天 ")],-1)])],4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"absolute left-0 pointer-events-none",style:e.normalizeStyle({...pe.value,height:B.value+"px",top:b.value+"px",width:m.value+"px"})},null,4),e.createElementVNode("div",{style:e.normalizeStyle({height:O.value+"px",position:"relative"})},[e.createElementVNode("div",{style:e.normalizeStyle({transform:`translateY(${v.value}px)`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.uniqueKey},[t.type==="group"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"relative border-b border-[#e8e8e8]",style:e.normalizeStyle({height:d+"px",width:m.value+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value[t.data.id],(o,a)=>e.renderSlot(n.$slots,"count",{key:a,item:t.data,date:a,count:o,style:e.normalizeStyle({left:I(a)+"px",width:r+"px",height:d+"px"})},()=>[e.createElementVNode("div",{class:"absolute top-0 flex items-center justify-center text-sm",style:e.normalizeStyle({left:I(a)+"px",width:r+"px",height:d+"px",contentVisibility:"auto",containIntrinsicSize:`${r}px ${d}px`})},e.toDisplayString(o),5)],!0)),128))],4)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"relative border-b border-[#e8e8e8] overflow-hidden",style:e.normalizeStyle({height:d+"px",width:m.value+"px"})},[g(t.data)?e.renderSlot(n.$slots,"task",{key:0,style:e.normalizeStyle({left:g(t.data).left+"px",width:g(t.data).width+"px",position:"absolute"}),task:t.data,ganttItemId:t.groupId},()=>[e.createElementVNode("div",{class:"absolute bg-slate-400 top-2 bottom-2 rounded-md shadow-sm flex items-center px-3 text-[11px] text-white font-medium cursor-pointer hover:shadow-lg hover:-translate-y-0.5 transition-all duration-200",style:e.normalizeStyle({left:g(t.data).left+"px",width:g(t.data).width+"px",backgroundColor:t.data.color})},[e.createElementVNode("span",ne,e.toDisplayString(t.data.name),1)],4)],!0):e.createCommentVNode("",!0)],4))],64))),128))],4)],4)],544)])]),e.createCommentVNode("",!0)],512))}}),[["__scopeId","data-v-5298588d"]]),se=G.version,ie=()=>{console.log("Gantt Core Initialized")};f.GANTT_VERSION=se,f.GanttChart=re,f.setupGantt=ie,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ollap/gantt-vue3",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"