@ollap/gantt-vue3 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gantt-vue3.css +1 -1
- package/dist/gantt-vue3.d.ts +9 -0
- package/dist/gantt-vue3.js +167 -147
- package/dist/gantt-vue3.umd.cjs +1 -1
- package/package.json +7 -7
package/dist/gantt-vue3.css
CHANGED
|
@@ -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-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}
|
|
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)}.top-4{top:calc(var(--spacing)*4)}.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-1{left:calc(var(--spacing)*1)}.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}.gap-4{gap:calc(var(--spacing)*4)}.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-05d54120]::-webkit-scrollbar{display:none}.no-scrollbar[data-v-05d54120]{-ms-overflow-style:none;scrollbar-width:none}.overflow-auto[data-v-05d54120]::-webkit-scrollbar{width:6px;height:6px}.overflow-auto[data-v-05d54120]::-webkit-scrollbar-track{background:transparent}.overflow-auto[data-v-05d54120]::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:10px}.overflow-auto[data-v-05d54120]::-webkit-scrollbar-thumb:hover{background:#94a3b8}
|
package/dist/gantt-vue3.d.ts
CHANGED
|
@@ -57,6 +57,7 @@ declare function __VLS_template(): {
|
|
|
57
57
|
left: string;
|
|
58
58
|
width: string;
|
|
59
59
|
position: string;
|
|
60
|
+
getTimelinePos: (timeline: Timeline) => number | null;
|
|
60
61
|
};
|
|
61
62
|
}): any;
|
|
62
63
|
};
|
|
@@ -98,6 +99,14 @@ export declare type Task = {
|
|
|
98
99
|
color?: CSSProperties['color'];
|
|
99
100
|
children?: Task[];
|
|
100
101
|
expanded?: boolean;
|
|
102
|
+
timelines?: Timeline[];
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export declare type Timeline = {
|
|
106
|
+
id?: string | number;
|
|
107
|
+
name: string;
|
|
108
|
+
time: Date;
|
|
109
|
+
color: CSSProperties['color'];
|
|
101
110
|
};
|
|
102
111
|
|
|
103
112
|
export { }
|
package/dist/gantt-vue3.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const fe = "0.3.
|
|
1
|
+
import { defineComponent as ce, ref as f, watch as Z, computed as g, onMounted as ue, onUnmounted as pe, createElementBlock as r, openBlock as i, createElementVNode as a, createCommentVNode as A, normalizeStyle as l, renderSlot as _, createTextVNode as ve, Fragment as k, renderList as E, toDisplayString as y, withDirectives as ee, normalizeClass as te, vShow as se, withModifiers as he, nextTick as ae } from "vue";
|
|
2
|
+
const fe = "0.3.5", xe = {
|
|
3
3
|
version: fe
|
|
4
|
-
},
|
|
4
|
+
}, ge = { class: "bg-white border border-slate-200 overflow-hidden flex-1 flex flex-col" }, ye = { class: "flex border-b border-slate-200 bg-slate-50/50" }, be = { class: "text-[10px] tracking-wider text-slate-400" }, me = { class: "text-xs font-semibold text-slate-400" }, we = { class: "flex flex-1 overflow-hidden" }, _e = ["onClick"], ke = { class: "mr-2 w-4 h-4" }, De = { class: "min-w-0" }, Te = { class: "text-sm font-semibold text-slate-700 truncate" }, Se = ["onClick"], Ee = {
|
|
5
5
|
key: 1,
|
|
6
6
|
class: "mr-1.5 w-3 h-3 inline-block"
|
|
7
|
-
},
|
|
7
|
+
}, $e = { class: "text-xs truncate select-none flex gap-4" }, Ce = { class: "truncate" }, Ie = { class: "absolute top-0 bottom-2 left-0 right-0" }, Oe = { class: "absolute left-1 top-0 text-xs whitespace-nowrap" }, d = 60, h = 52, Re = 150, Le = 600, Me = 256, ze = /* @__PURE__ */ ce({
|
|
8
8
|
__name: "GanttChart",
|
|
9
9
|
props: {
|
|
10
10
|
list: {},
|
|
@@ -14,41 +14,41 @@ const fe = "0.3.4", he = {
|
|
|
14
14
|
defaultLeftPanelWidth: {}
|
|
15
15
|
},
|
|
16
16
|
emits: ["update:list", "toggle"],
|
|
17
|
-
setup(
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
() =>
|
|
17
|
+
setup(D, { expose: L, emit: $ }) {
|
|
18
|
+
const v = D, M = (t, s) => v.shouldCalculate ? v.shouldCalculate(t, s) : !0, ne = $, u = f([]), z = f(JSON.parse(JSON.stringify(v.list)));
|
|
19
|
+
Z(
|
|
20
|
+
() => v.list,
|
|
21
21
|
() => {
|
|
22
|
-
z.value = JSON.parse(JSON.stringify(
|
|
22
|
+
z.value = JSON.parse(JSON.stringify(v.list));
|
|
23
23
|
}
|
|
24
24
|
);
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
const s = t.clientX, e =
|
|
28
|
-
if (!
|
|
29
|
-
const
|
|
30
|
-
|
|
25
|
+
const C = f(v.defaultLeftPanelWidth ?? Me), P = f(!1), le = (t) => {
|
|
26
|
+
P.value = !0;
|
|
27
|
+
const s = t.clientX, e = C.value, n = (p) => {
|
|
28
|
+
if (!P.value) return;
|
|
29
|
+
const c = p.clientX - s, R = e + c;
|
|
30
|
+
C.value = Math.max(Re, Math.min(Le, R));
|
|
31
31
|
}, o = () => {
|
|
32
|
-
|
|
32
|
+
P.value = !1, document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
33
33
|
};
|
|
34
34
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", t.preventDefault();
|
|
35
|
-
},
|
|
36
|
-
backgroundImage: `linear-gradient(to right, transparent ${
|
|
35
|
+
}, b = g(() => u.value.length * d), oe = g(() => ({
|
|
36
|
+
backgroundImage: `linear-gradient(to right, transparent ${d - 1}px, #e8e8e8 ${d - 1}px, #e8e8e8 ${d}px)`,
|
|
37
37
|
// backgroundImage: `linear-gradient(to right, #e8e8e8 1px, transparent 1px)`,
|
|
38
|
-
backgroundSize: `${
|
|
38
|
+
backgroundSize: `${d}px 100%`,
|
|
39
39
|
// backgroundRepeat: 'repeat-y',
|
|
40
40
|
// backgroundPosition: `${CELL_WIDTH}px 0`,
|
|
41
|
-
width:
|
|
42
|
-
})),
|
|
41
|
+
width: b.value + "px"
|
|
42
|
+
})), re = g(() => {
|
|
43
43
|
const t = {}, s = (e, n) => {
|
|
44
|
-
if (!n.startDate || !n.endDate || !
|
|
44
|
+
if (!n.startDate || !n.endDate || !M(e, n)) return;
|
|
45
45
|
let o = new Date(n.startDate);
|
|
46
|
-
const
|
|
47
|
-
for (; o <=
|
|
48
|
-
const
|
|
49
|
-
t[e.id][
|
|
46
|
+
const p = new Date(n.endDate);
|
|
47
|
+
for (; o <= p; ) {
|
|
48
|
+
const c = o.toISOString().split("T")[0];
|
|
49
|
+
t[e.id][c] = (t[e.id][c] || 0) + 1, o.setDate(o.getDate() + 1);
|
|
50
50
|
}
|
|
51
|
-
n.children && n.children.forEach((
|
|
51
|
+
n.children && n.children.forEach((c) => s(e, c));
|
|
52
52
|
};
|
|
53
53
|
return z.value.forEach((e) => {
|
|
54
54
|
t[e.id] = {}, e.tasks.forEach((n) => {
|
|
@@ -57,11 +57,11 @@ const fe = "0.3.4", he = {
|
|
|
57
57
|
}), t;
|
|
58
58
|
}), F = () => {
|
|
59
59
|
const t = [];
|
|
60
|
-
let s = new Date(
|
|
61
|
-
const e = new Date(
|
|
60
|
+
let s = new Date(v.dateRange[0]);
|
|
61
|
+
const e = new Date(v.dateRange[1]);
|
|
62
62
|
for (; s <= e; )
|
|
63
63
|
t.push(s.toISOString().split("T")[0]), s.setDate(s.getDate() + 1);
|
|
64
|
-
|
|
64
|
+
u.value = t;
|
|
65
65
|
}, G = (t) => {
|
|
66
66
|
const s = new Date(t), e = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
|
|
67
67
|
return {
|
|
@@ -69,32 +69,36 @@ const fe = "0.3.4", he = {
|
|
|
69
69
|
weekday: e[s.getDay()]
|
|
70
70
|
};
|
|
71
71
|
}, B = (t) => {
|
|
72
|
-
const s =
|
|
73
|
-
return s > -1 ? s *
|
|
74
|
-
},
|
|
72
|
+
const s = u.value.indexOf(t);
|
|
73
|
+
return s > -1 ? s * d : -999;
|
|
74
|
+
}, T = (t) => {
|
|
75
75
|
if (!t.startDate || !t.endDate) return null;
|
|
76
|
-
const s = new Date(t.startDate), e = new Date(t.endDate), n = new Date(
|
|
76
|
+
const s = new Date(t.startDate), e = new Date(t.endDate), n = new Date(u.value[0]), o = new Date(u.value[u.value.length - 1]);
|
|
77
77
|
if (s < n && e > o)
|
|
78
78
|
return {
|
|
79
79
|
left: -4,
|
|
80
|
-
width:
|
|
80
|
+
width: b.value + 8
|
|
81
81
|
};
|
|
82
|
-
let
|
|
83
|
-
return
|
|
84
|
-
left:
|
|
85
|
-
width: (
|
|
82
|
+
let p = u.value.indexOf(t.startDate), c = u.value.indexOf(t.endDate), R = 4, Q = -8;
|
|
83
|
+
return p === -1 && c === -1 ? null : (p === -1 && (p = 0, R = -4), c === -1 && (c = u.value.length - 1, Q = 4), {
|
|
84
|
+
left: p * d + R,
|
|
85
|
+
width: (c - p + 1) * d + Q
|
|
86
86
|
});
|
|
87
|
-
},
|
|
88
|
-
|
|
87
|
+
}, V = (t) => {
|
|
88
|
+
if (!t.time) return null;
|
|
89
|
+
const s = new Date(t.time), e = u.value.indexOf(s.toISOString().split("T")[0]);
|
|
90
|
+
return e > -1 ? e * d : -999;
|
|
91
|
+
}, m = f(), N = f(), x = f(), I = g(() => {
|
|
92
|
+
const t = [], s = (e, n, o, p) => {
|
|
89
93
|
t.push({
|
|
90
94
|
type: "task",
|
|
91
95
|
data: e,
|
|
92
96
|
uniqueKey: `t-${n}-${o}-${e.id}`,
|
|
93
97
|
parentId: o,
|
|
94
98
|
groupId: n,
|
|
95
|
-
level:
|
|
96
|
-
}), e.expanded && e.children && e.children.forEach((
|
|
97
|
-
s(
|
|
99
|
+
level: p
|
|
100
|
+
}), e.expanded && e.children && e.children.forEach((c) => {
|
|
101
|
+
s(c, n, e.id, p + 1);
|
|
98
102
|
});
|
|
99
103
|
};
|
|
100
104
|
return z.value.forEach((e) => {
|
|
@@ -108,45 +112,45 @@ const fe = "0.3.4", he = {
|
|
|
108
112
|
s(n, e.id, e.id, 1);
|
|
109
113
|
});
|
|
110
114
|
}), t;
|
|
111
|
-
}),
|
|
112
|
-
const t = Math.floor(
|
|
115
|
+
}), S = f(0), H = f(600), j = g(() => I.value.length * h), q = g(() => {
|
|
116
|
+
const t = Math.floor(S.value / h), s = Math.ceil(H.value / h), e = 5;
|
|
113
117
|
return {
|
|
114
118
|
start: Math.max(0, t - e),
|
|
115
|
-
end: Math.min(
|
|
119
|
+
end: Math.min(I.value.length, t + s + e)
|
|
116
120
|
};
|
|
117
|
-
}),
|
|
118
|
-
const { start: t, end: s } =
|
|
119
|
-
return
|
|
120
|
-
}),
|
|
121
|
+
}), J = g(() => q.value.start * h), K = g(() => {
|
|
122
|
+
const { start: t, end: s } = q.value;
|
|
123
|
+
return I.value.slice(t, s);
|
|
124
|
+
}), X = () => {
|
|
121
125
|
x.value && (H.value = x.value.clientHeight - 1);
|
|
122
126
|
};
|
|
123
|
-
let
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
},
|
|
127
|
-
|
|
128
|
-
},
|
|
129
|
-
t.expanded = !t.expanded,
|
|
130
|
-
},
|
|
131
|
-
const t = (/* @__PURE__ */ new Date()).toISOString().split("T")[0], s =
|
|
132
|
-
return s === -1 ? null : s *
|
|
133
|
-
}), W =
|
|
134
|
-
let
|
|
135
|
-
return
|
|
136
|
-
F(),
|
|
137
|
-
|
|
138
|
-
}),
|
|
139
|
-
}),
|
|
140
|
-
() =>
|
|
127
|
+
let w = !1;
|
|
128
|
+
const ie = () => {
|
|
129
|
+
w || !m.value || !x.value || (w = !0, S.value = m.value.scrollTop, x.value.scrollTop = m.value.scrollTop, ae(() => w = !1));
|
|
130
|
+
}, de = () => {
|
|
131
|
+
w || !x.value || !m.value || (w = !0, S.value = x.value.scrollTop, m.value.scrollTop = x.value.scrollTop, N.value && (N.value.scrollLeft = x.value.scrollLeft), ae(() => w = !1));
|
|
132
|
+
}, U = (t) => {
|
|
133
|
+
t.expanded = !t.expanded, ne("toggle", t.id);
|
|
134
|
+
}, Y = g(() => {
|
|
135
|
+
const t = (/* @__PURE__ */ new Date()).toISOString().split("T")[0], s = u.value.indexOf(t);
|
|
136
|
+
return s === -1 ? null : s * d;
|
|
137
|
+
}), W = f();
|
|
138
|
+
let O = null;
|
|
139
|
+
return ue(() => {
|
|
140
|
+
F(), X(), W.value && (O = new ResizeObserver(() => {
|
|
141
|
+
X();
|
|
142
|
+
}), O.observe(W.value));
|
|
143
|
+
}), Z(
|
|
144
|
+
() => v.dateRange,
|
|
141
145
|
() => {
|
|
142
146
|
F();
|
|
143
147
|
}
|
|
144
|
-
),
|
|
145
|
-
|
|
146
|
-
}),
|
|
148
|
+
), pe(() => {
|
|
149
|
+
O && O.disconnect();
|
|
150
|
+
}), L({
|
|
147
151
|
getExpandedMapId: () => {
|
|
148
152
|
const t = /* @__PURE__ */ new Map();
|
|
149
|
-
return
|
|
153
|
+
return I.value.forEach((s) => {
|
|
150
154
|
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
155
|
}), t;
|
|
152
156
|
}
|
|
@@ -155,67 +159,67 @@ const fe = "0.3.4", he = {
|
|
|
155
159
|
ref: W,
|
|
156
160
|
class: "flex flex-col h-full bg-slate-50 font-sans antialiased select-none"
|
|
157
161
|
}, [
|
|
158
|
-
a("div",
|
|
159
|
-
a("div",
|
|
162
|
+
a("div", ge, [
|
|
163
|
+
a("div", ye, [
|
|
160
164
|
a("div", {
|
|
161
165
|
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)]",
|
|
162
|
-
style: l({ width:
|
|
166
|
+
style: l({ width: C.value + "px" })
|
|
163
167
|
}, [
|
|
164
|
-
|
|
165
|
-
s[0] || (s[0] =
|
|
168
|
+
_(t.$slots, "leftPanelHeader", {}, () => [
|
|
169
|
+
s[0] || (s[0] = ve("项目成员 / 任务状态", -1))
|
|
166
170
|
], !0),
|
|
167
171
|
a("div", {
|
|
168
172
|
class: "absolute top-0 right-0 bottom-0 w-1 cursor-col-resize hover:bg-blue-400 transition-colors z-20 group",
|
|
169
|
-
onMousedown:
|
|
173
|
+
onMousedown: le
|
|
170
174
|
}, null, 32)
|
|
171
175
|
], 4),
|
|
172
176
|
a("div", {
|
|
173
177
|
ref_key: "headerRef",
|
|
174
|
-
ref:
|
|
178
|
+
ref: N,
|
|
175
179
|
class: "flex-1 overflow-hidden pointer-events-none"
|
|
176
180
|
}, [
|
|
177
181
|
a("div", {
|
|
178
182
|
class: "flex h-full",
|
|
179
|
-
style: l({ width:
|
|
183
|
+
style: l({ width: b.value + "px" })
|
|
180
184
|
}, [
|
|
181
|
-
(i(!0), r(
|
|
185
|
+
(i(!0), r(k, null, E(u.value, (e) => (i(), r("div", {
|
|
182
186
|
key: e,
|
|
183
187
|
class: "shrink-0 flex flex-col items-center justify-center border-r border-slate-100 py-2 transition-colors",
|
|
184
|
-
style: l({ width:
|
|
188
|
+
style: l({ width: d + "px" })
|
|
185
189
|
}, [
|
|
186
|
-
|
|
187
|
-
a("span",
|
|
188
|
-
a("span",
|
|
190
|
+
_(t.$slots, "headerCell", { date: e }, () => [
|
|
191
|
+
a("span", be, y(G(e).weekday), 1),
|
|
192
|
+
a("span", me, y(G(e).monthDay), 1)
|
|
189
193
|
], !0)
|
|
190
194
|
], 4))), 128))
|
|
191
195
|
], 4)
|
|
192
196
|
], 512)
|
|
193
197
|
]),
|
|
194
|
-
a("div",
|
|
198
|
+
a("div", we, [
|
|
195
199
|
a("div", {
|
|
196
200
|
ref_key: "leftPanelRef",
|
|
197
|
-
ref:
|
|
201
|
+
ref: m,
|
|
198
202
|
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",
|
|
199
|
-
style: l({ width:
|
|
200
|
-
onScroll:
|
|
203
|
+
style: l({ width: C.value + "px" }),
|
|
204
|
+
onScroll: ie
|
|
201
205
|
}, [
|
|
202
206
|
a("div", {
|
|
203
|
-
style: l({ height:
|
|
207
|
+
style: l({ height: j.value + "px", position: "relative" })
|
|
204
208
|
}, [
|
|
205
209
|
a("div", {
|
|
206
|
-
style: l({ transform: `translateY(${
|
|
210
|
+
style: l({ transform: `translateY(${J.value}px)` })
|
|
207
211
|
}, [
|
|
208
|
-
(i(!0), r(
|
|
212
|
+
(i(!0), r(k, null, E(K.value, (e) => (i(), r("div", {
|
|
209
213
|
key: e.uniqueKey
|
|
210
214
|
}, [
|
|
211
215
|
e.type === "group" ? (i(), r("div", {
|
|
212
216
|
key: 0,
|
|
213
217
|
class: "flex items-center px-4 hover:bg-slate-50 cursor-pointer border-b border-slate-50 transition-colors",
|
|
214
|
-
style: l({ height:
|
|
215
|
-
onClick: (n) =>
|
|
218
|
+
style: l({ height: h + "px" }),
|
|
219
|
+
onClick: (n) => U(e.data)
|
|
216
220
|
}, [
|
|
217
|
-
|
|
218
|
-
class:
|
|
221
|
+
ee(a("span", {
|
|
222
|
+
class: te(["transform transition-transform duration-200 mr-2", e.data.expanded ? "rotate-90" : ""])
|
|
219
223
|
}, [...s[1] || (s[1] = [
|
|
220
224
|
a("svg", {
|
|
221
225
|
class: "w-4 h-4 text-slate-400",
|
|
@@ -231,27 +235,27 @@ const fe = "0.3.4", he = {
|
|
|
231
235
|
})
|
|
232
236
|
], -1)
|
|
233
237
|
])], 2), [
|
|
234
|
-
[
|
|
238
|
+
[se, e.data.tasks.length > 0]
|
|
235
239
|
]),
|
|
236
|
-
|
|
237
|
-
[
|
|
240
|
+
ee(a("span", ke, null, 512), [
|
|
241
|
+
[se, !e.data.tasks.length]
|
|
238
242
|
]),
|
|
239
|
-
a("div",
|
|
240
|
-
|
|
243
|
+
a("div", De, [
|
|
244
|
+
_(t.$slots, "leftPanelItem", {
|
|
241
245
|
item: e.data
|
|
242
246
|
}, () => [
|
|
243
|
-
a("div",
|
|
247
|
+
a("div", Te, y(e.data.name), 1)
|
|
244
248
|
], !0)
|
|
245
249
|
])
|
|
246
|
-
], 12,
|
|
250
|
+
], 12, _e)) : (i(), r("div", {
|
|
247
251
|
key: 1,
|
|
248
252
|
class: "flex items-center pr-4 border-b border-slate-100/50 text-slate-600 hover:bg-white transition-colors cursor-pointer",
|
|
249
|
-
style: l({ height:
|
|
250
|
-
onClick:
|
|
253
|
+
style: l({ height: h + "px", paddingLeft: e.level * 20 + 12 + "px" }),
|
|
254
|
+
onClick: he((n) => U(e.data), ["stop"])
|
|
251
255
|
}, [
|
|
252
256
|
e.data.children && e.data.children.length > 0 ? (i(), r("span", {
|
|
253
257
|
key: 0,
|
|
254
|
-
class:
|
|
258
|
+
class: te(["transform transition-transform duration-200 mr-1.5", e.data.expanded ? "rotate-90" : ""])
|
|
255
259
|
}, [...s[2] || (s[2] = [
|
|
256
260
|
a("svg", {
|
|
257
261
|
class: "w-3 h-3 text-slate-400",
|
|
@@ -266,13 +270,13 @@ const fe = "0.3.4", he = {
|
|
|
266
270
|
d: "M9 5l7 7-7 7"
|
|
267
271
|
})
|
|
268
272
|
], -1)
|
|
269
|
-
])], 2)) : (i(), r("span",
|
|
270
|
-
|
|
273
|
+
])], 2)) : (i(), r("span", Ee)),
|
|
274
|
+
_(t.$slots, "leftPanelItemTask", {
|
|
271
275
|
item: e.data
|
|
272
276
|
}, () => [
|
|
273
|
-
a("div",
|
|
277
|
+
a("div", $e, y(e.data.name), 1)
|
|
274
278
|
], !0)
|
|
275
|
-
], 12,
|
|
279
|
+
], 12, Se))
|
|
276
280
|
]))), 128))
|
|
277
281
|
], 4)
|
|
278
282
|
], 4)
|
|
@@ -280,13 +284,13 @@ const fe = "0.3.4", he = {
|
|
|
280
284
|
a("div", {
|
|
281
285
|
ref_key: "rightPanelRef",
|
|
282
286
|
ref: x,
|
|
283
|
-
onScroll:
|
|
287
|
+
onScroll: de,
|
|
284
288
|
class: "flex-1 overflow-auto relative select-none"
|
|
285
289
|
}, [
|
|
286
|
-
|
|
290
|
+
Y.value !== null && D.showToday ? (i(), r("div", {
|
|
287
291
|
key: 0,
|
|
288
292
|
class: "absolute top-0 z-10 pointer-events-none border-l-2 border-orange-400",
|
|
289
|
-
style: l({ left:
|
|
293
|
+
style: l({ left: Y.value + "px", bottom: -S.value + "px" })
|
|
290
294
|
}, [...s[3] || (s[3] = [
|
|
291
295
|
a("div", {
|
|
292
296
|
class: "sticky top-0 z-20",
|
|
@@ -299,73 +303,89 @@ const fe = "0.3.4", he = {
|
|
|
299
303
|
a("div", {
|
|
300
304
|
class: "absolute left-0 pointer-events-none",
|
|
301
305
|
style: l({
|
|
302
|
-
...
|
|
306
|
+
...oe.value,
|
|
303
307
|
height: H.value + "px",
|
|
304
|
-
top:
|
|
305
|
-
width:
|
|
308
|
+
top: S.value + "px",
|
|
309
|
+
width: b.value + "px"
|
|
306
310
|
})
|
|
307
311
|
}, null, 4),
|
|
308
312
|
a("div", {
|
|
309
|
-
style: l({ height:
|
|
313
|
+
style: l({ height: j.value + "px", position: "relative" })
|
|
310
314
|
}, [
|
|
311
315
|
a("div", {
|
|
312
|
-
style: l({ transform: `translateY(${
|
|
316
|
+
style: l({ transform: `translateY(${J.value}px)` })
|
|
313
317
|
}, [
|
|
314
|
-
(i(!0), r(
|
|
318
|
+
(i(!0), r(k, null, E(K.value, (e) => (i(), r(k, {
|
|
315
319
|
key: e.uniqueKey
|
|
316
320
|
}, [
|
|
317
321
|
e.type === "group" ? (i(), r("div", {
|
|
318
322
|
key: 0,
|
|
319
323
|
class: "relative border-b border-[#e8e8e8]",
|
|
320
|
-
style: l({ height:
|
|
324
|
+
style: l({ height: h + "px", width: b.value + "px" })
|
|
321
325
|
}, [
|
|
322
|
-
(i(!0), r(
|
|
326
|
+
(i(!0), r(k, null, E(re.value[e.data.id], (n, o) => _(t.$slots, "count", {
|
|
323
327
|
key: o,
|
|
324
328
|
item: e.data,
|
|
325
329
|
date: o,
|
|
326
330
|
count: n,
|
|
327
331
|
style: l({
|
|
328
332
|
left: B(o) + "px",
|
|
329
|
-
width:
|
|
330
|
-
height:
|
|
333
|
+
width: d + "px",
|
|
334
|
+
height: h + "px"
|
|
331
335
|
})
|
|
332
336
|
}, () => [
|
|
333
337
|
a("div", {
|
|
334
338
|
class: "absolute top-0 flex items-center justify-center text-sm",
|
|
335
339
|
style: l({
|
|
336
340
|
left: B(o) + "px",
|
|
337
|
-
width:
|
|
338
|
-
height:
|
|
341
|
+
width: d + "px",
|
|
342
|
+
height: h + "px",
|
|
339
343
|
contentVisibility: "auto",
|
|
340
|
-
containIntrinsicSize: `${
|
|
344
|
+
containIntrinsicSize: `${d}px ${h}px`
|
|
341
345
|
})
|
|
342
|
-
},
|
|
346
|
+
}, y(n), 5)
|
|
343
347
|
], !0)), 128))
|
|
344
348
|
], 4)) : (i(), r("div", {
|
|
345
349
|
key: 1,
|
|
346
350
|
class: "relative border-b border-[#e8e8e8] overflow-hidden",
|
|
347
|
-
style: l({ height:
|
|
351
|
+
style: l({ height: h + "px", width: b.value + "px" })
|
|
348
352
|
}, [
|
|
349
|
-
|
|
353
|
+
T(e.data) ? _(t.$slots, "task", {
|
|
350
354
|
key: 0,
|
|
351
355
|
style: l({
|
|
352
|
-
left:
|
|
353
|
-
width:
|
|
354
|
-
position: "absolute"
|
|
356
|
+
left: T(e.data).left + "px",
|
|
357
|
+
width: T(e.data).width + "px",
|
|
358
|
+
position: "absolute",
|
|
359
|
+
getTimelinePos: V
|
|
355
360
|
}),
|
|
356
361
|
task: e.data,
|
|
357
362
|
ganttItemId: e.groupId
|
|
358
363
|
}, () => [
|
|
359
364
|
a("div", {
|
|
360
|
-
class: "absolute bg-slate-400 top-
|
|
365
|
+
class: "absolute bg-slate-400 top-4 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",
|
|
361
366
|
style: l({
|
|
362
|
-
left:
|
|
363
|
-
width:
|
|
367
|
+
left: T(e.data).left + "px",
|
|
368
|
+
width: T(e.data).width + "px",
|
|
364
369
|
backgroundColor: e.data.color
|
|
365
370
|
})
|
|
366
371
|
}, [
|
|
367
|
-
a("span",
|
|
368
|
-
], 4)
|
|
372
|
+
a("span", Ce, y(e.data.name), 1)
|
|
373
|
+
], 4),
|
|
374
|
+
a("div", Ie, [
|
|
375
|
+
(i(!0), r(k, null, E(e.data.timelines, (n) => (i(), r("div", {
|
|
376
|
+
key: n.id,
|
|
377
|
+
style: l({
|
|
378
|
+
left: V(n) + "px",
|
|
379
|
+
width: "2px",
|
|
380
|
+
position: "absolute",
|
|
381
|
+
height: "100%",
|
|
382
|
+
backgroundColor: n.color,
|
|
383
|
+
color: n.color
|
|
384
|
+
})
|
|
385
|
+
}, [
|
|
386
|
+
a("span", Oe, y(n.name), 1)
|
|
387
|
+
], 4))), 128))
|
|
388
|
+
])
|
|
369
389
|
], !0) : A("", !0)
|
|
370
390
|
], 4))
|
|
371
391
|
], 64))), 128))
|
|
@@ -377,16 +397,16 @@ const fe = "0.3.4", he = {
|
|
|
377
397
|
A("", !0)
|
|
378
398
|
], 512));
|
|
379
399
|
}
|
|
380
|
-
}),
|
|
381
|
-
const
|
|
382
|
-
for (const [
|
|
383
|
-
|
|
384
|
-
return
|
|
385
|
-
},
|
|
400
|
+
}), Pe = (D, L) => {
|
|
401
|
+
const $ = D.__vccOpts || D;
|
|
402
|
+
for (const [v, M] of L)
|
|
403
|
+
$[v] = M;
|
|
404
|
+
return $;
|
|
405
|
+
}, He = /* @__PURE__ */ Pe(ze, [["__scopeId", "data-v-05d54120"]]), We = xe.version, Ae = () => {
|
|
386
406
|
console.log("Gantt Core Initialized");
|
|
387
407
|
};
|
|
388
408
|
export {
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
409
|
+
We as GANTT_VERSION,
|
|
410
|
+
He as GanttChart,
|
|
411
|
+
Ae as setupGantt
|
|
392
412
|
};
|
package/dist/gantt-vue3.umd.cjs
CHANGED
|
@@ -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 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"})}));
|
|
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 A={version:"0.3.5"},j={class:"bg-white border border-slate-200 overflow-hidden flex-1 flex flex-col"},q={class:"flex border-b border-slate-200 bg-slate-50/50"},J={class:"text-[10px] tracking-wider text-slate-400"},K={class:"text-xs font-semibold text-slate-400"},X={class:"flex flex-1 overflow-hidden"},U=["onClick"],Y={class:"mr-2 w-4 h-4"},Q={class:"min-w-0"},Z={class:"text-sm font-semibold text-slate-700 truncate"},ee=["onClick"],te={key:1,class:"mr-1.5 w-3 h-3 inline-block"},le={class:"text-xs truncate select-none flex gap-4"},ne={class:"truncate"},oe={class:"absolute top-0 bottom-2 left-0 right-0"},ae={class:"absolute left-1 top-0 text-xs whitespace-nowrap"},r=60,c=52,re=150,se=600,ie=256,de=((y,D)=>{const k=y.__vccOpts||y;for(const[p,N]of D)k[p]=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 p=y,N=(l,n)=>p.shouldCalculate?p.shouldCalculate(l,n):!0,fe=k,i=e.ref([]),V=e.ref(JSON.parse(JSON.stringify(p.list)));e.watch(()=>p.list,()=>{V.value=JSON.parse(JSON.stringify(p.list))});const E=e.ref(p.defaultLeftPanelWidth??ie),B=e.ref(!1),he=l=>{B.value=!0;const n=l.clientX,t=E.value,o=d=>{if(!B.value)return;const s=d.clientX-n,_=t+s;E.value=Math.max(re,Math.min(se,_))},a=()=>{B.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(()=>i.value.length*r),me=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"})),xe=e.computed(()=>{const l={},n=(t,o)=>{if(!o.startDate||!o.endDate||!N(t,o))return;let a=new Date(o.startDate);const d=new Date(o.endDate);for(;a<=d;){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 V.value.forEach(t=>{l[t.id]={},t.tasks.forEach(o=>{n(t,o)})}),l}),L=()=>{const l=[];let n=new Date(p.dateRange[0]);const t=new Date(p.dateRange[1]);for(;n<=t;)l.push(n.toISOString().split("T")[0]),n.setDate(n.getDate()+1);i.value=l},O=l=>{const n=new Date(l),t=["周日","周一","周二","周三","周四","周五","周六"];return{monthDay:`${String(n.getMonth()+1).padStart(2,"0")}/${n.getDate()}`,weekday:t[n.getDay()]}},$=l=>{const n=i.value.indexOf(l);return n>-1?n*r:-999},u=l=>{if(!l.startDate||!l.endDate)return null;const n=new Date(l.startDate),t=new Date(l.endDate),o=new Date(i.value[0]),a=new Date(i.value[i.value.length-1]);if(n<o&&t>a)return{left:-4,width:m.value+8};let d=i.value.indexOf(l.startDate),s=i.value.indexOf(l.endDate),_=4,G=-8;return d===-1&&s===-1?null:(d===-1&&(d=0,_=-4),s===-1&&(s=i.value.length-1,G=4),{left:d*r+_,width:(s-d+1)*r+G})},I=l=>{if(!l.time)return null;const n=new Date(l.time),t=i.value.indexOf(n.toISOString().split("T")[0]);return t>-1?t*r:-999},x=e.ref(),T=e.ref(),h=e.ref(),S=e.computed(()=>{const l=[],n=(t,o,a,d)=>{l.push({type:"task",data:t,uniqueKey:`t-${o}-${a}-${t.id}`,parentId:a,groupId:o,level:d}),t.expanded&&t.children&&t.children.forEach(s=>{n(s,o,t.id,d+1)})};return V.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),z=e.ref(600),R=e.computed(()=>S.value.length*c),M=e.computed(()=>{const l=Math.floor(b.value/c),n=Math.ceil(z.value/c),t=5;return{start:Math.max(0,l-t),end:Math.min(S.value.length,l+n+t)}}),P=e.computed(()=>M.value.start*c),v=e.computed(()=>{const{start:l,end:n}=M.value;return S.value.slice(l,n)}),F=()=>{h.value&&(z.value=h.value.clientHeight-1)};let g=!1;const ge=()=>{g||!x.value||!h.value||(g=!0,b.value=x.value.scrollTop,h.value.scrollTop=x.value.scrollTop,e.nextTick(()=>g=!1))},ye=()=>{g||!h.value||!x.value||(g=!0,b.value=h.value.scrollTop,x.value.scrollTop=h.value.scrollTop,T.value&&(T.value.scrollLeft=h.value.scrollLeft),e.nextTick(()=>g=!1))},H=l=>{l.expanded=!l.expanded,fe("toggle",l.id)},W=e.computed(()=>{const l=new Date().toISOString().split("T")[0],n=i.value.indexOf(l);return n===-1?null:n*r}),C=e.ref();let w=null;return e.onMounted(()=>{L(),F(),C.value&&(w=new ResizeObserver(()=>{F()}),w.observe(C.value))}),e.watch(()=>p.dateRange,()=>{L()}),e.onUnmounted(()=>{w&&w.disconnect()}),D({getExpandedMapId:()=>{const l=new Map;return S.value.forEach(n=>{n.type==="group"&&l.set(n.data.id,n.data.expanded),n.type==="task"&&l.set(`${n.groupId}-${n.data.id}`,n.data.expanded)}),l}}),(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",j,[e.createElementVNode("div",q,[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(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:he},null,32)],4),e.createElementVNode("div",{ref_key:"headerRef",ref:T,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(i.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(O(t).weekday),1),e.createElementVNode("span",K,e.toDisplayString(O(t).monthDay),1)],!0)],4))),128))],4)],512)]),e.createElementVNode("div",X,[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:ge},[e.createElementVNode("div",{style:e.normalizeStyle({height:R.value+"px",position:"relative"})},[e.createElementVNode("div",{style:e.normalizeStyle({transform:`translateY(${P.value}px)`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.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:c+"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":""])},[...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",Y,null,512),[[e.vShow,!t.data.tasks.length]]),e.createElementVNode("div",Q,[e.renderSlot(l.$slots,"leftPanelItem",{item:t.data},()=>[e.createElementVNode("div",Z,e.toDisplayString(t.data.name),1)],!0)])],12,U)):(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:c+"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":""])},[...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",te)),e.renderSlot(l.$slots,"leftPanelItemTask",{item:t.data},()=>[e.createElementVNode("div",le,e.toDisplayString(t.data.name),1)],!0)],12,ee))]))),128))],4)],4)],36),e.createElementVNode("div",{ref_key:"rightPanelRef",ref:h,onScroll:ye,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"})},[...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({...me.value,height:z.value+"px",top:b.value+"px",width:m.value+"px"})},null,4),e.createElementVNode("div",{style:e.normalizeStyle({height:R.value+"px",position:"relative"})},[e.createElementVNode("div",{style:e.normalizeStyle({transform:`translateY(${P.value}px)`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.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:c+"px",width:m.value+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xe.value[t.data.id],(o,a)=>e.renderSlot(l.$slots,"count",{key:a,item:t.data,date:a,count:o,style:e.normalizeStyle({left:$(a)+"px",width:r+"px",height:c+"px"})},()=>[e.createElementVNode("div",{class:"absolute top-0 flex items-center justify-center text-sm",style:e.normalizeStyle({left:$(a)+"px",width:r+"px",height:c+"px",contentVisibility:"auto",containIntrinsicSize:`${r}px ${c}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:c+"px",width:m.value+"px"})},[u(t.data)?e.renderSlot(l.$slots,"task",{key:0,style:e.normalizeStyle({left:u(t.data).left+"px",width:u(t.data).width+"px",position:"absolute",getTimelinePos:I}),task:t.data,ganttItemId:t.groupId},()=>[e.createElementVNode("div",{class:"absolute bg-slate-400 top-4 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:u(t.data).left+"px",width:u(t.data).width+"px",backgroundColor:t.data.color})},[e.createElementVNode("span",ne,e.toDisplayString(t.data.name),1)],4),e.createElementVNode("div",oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data.timelines,o=>(e.openBlock(),e.createElementBlock("div",{key:o.id,style:e.normalizeStyle({left:I(o)+"px",width:"2px",position:"absolute",height:"100%",backgroundColor:o.color,color:o.color})},[e.createElementVNode("span",ae,e.toDisplayString(o.name),1)],4))),128))])],!0):e.createCommentVNode("",!0)],4))],64))),128))],4)],4)],544)])]),e.createCommentVNode("",!0)],512))}}),[["__scopeId","data-v-05d54120"]]),ce=A.version,pe=()=>{console.log("Gantt Core Initialized")};f.GANTT_VERSION=ce,f.GanttChart=de,f.setupGantt=pe,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.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
},
|
|
17
17
|
"./dist/gantt-vue3.css": "./dist/gantt-vue3.css"
|
|
18
18
|
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"dev": "vite build --watch",
|
|
21
|
+
"build": "vite build",
|
|
22
|
+
"type-check": "vue-tsc --build"
|
|
23
|
+
},
|
|
19
24
|
"peerDependencies": {
|
|
20
25
|
"vue": "^3.5.26"
|
|
21
26
|
},
|
|
@@ -28,10 +33,5 @@
|
|
|
28
33
|
"vite-plugin-dts": "^4.5.4",
|
|
29
34
|
"vue": "^3.5.26",
|
|
30
35
|
"vue-tsc": "^3.2.1"
|
|
31
|
-
},
|
|
32
|
-
"scripts": {
|
|
33
|
-
"dev": "vite build --watch",
|
|
34
|
-
"build": "vite build",
|
|
35
|
-
"type-check": "vue-tsc --build"
|
|
36
36
|
}
|
|
37
|
-
}
|
|
37
|
+
}
|