@ollap/gantt-vue3 0.1.2 → 0.2.0
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 +70 -2
- package/dist/gantt-vue3.js +240 -182
- package/dist/gantt-vue3.umd.cjs +1 -1
- package/package.json +8 -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-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;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0}}}: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-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-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-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}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.-top-1{top:calc(var(--spacing)*-1)}.top-0{top:calc(var(--spacing)*0)}.top-2{top:calc(var(--spacing)*2)}.bottom-0{bottom:calc(var(--spacing)*0)}.bottom-2{bottom:calc(var(--spacing)*2)}.-left-\[6px\]{left:-6px}.left-2{left:calc(var(--spacing)*2)}.z-10{z-index:10}.z-20{z-index:20}.mr-2{margin-right:calc(var(--spacing)*2)}.flex{display:flex}.h-0{height:calc(var(--spacing)*0)}.h-4{height:calc(var(--spacing)*4)}.h-full{height:100%}.w-0{width:calc(var(--spacing)*0)}.w-4{width:calc(var(--spacing)*4)}.w-64{width:calc(var(--spacing)*64)}.min-w-0{min-width:calc(var(--spacing)*0)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.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-pointer{cursor:pointer}.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-y-hidden{overflow-y:hidden}.rounded{border-radius:.25rem}.rounded-md{border-radius:var(--radius-md)}.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-orange-400{background-color:var(--color-orange-400)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-50\/30{background-color:#f8fafc4d}@supports (color:color-mix(in lab,red,red)){.bg-slate-50\/30{background-color:color-mix(in oklab,var(--color-slate-50)30%,transparent)}}.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-400{background-color:var(--color-slate-400)}.bg-white{background-color:var(--color-white)}.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)}.pl-12{padding-left:calc(var(--spacing)*12)}.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){.hover\:-translate-y-0\.5:hover{--tw-translate-y:calc(var(--spacing)*-.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.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-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}@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}.overflow-auto[data-v-815cd186]::-webkit-scrollbar{width:6px;height:6px}.overflow-auto[data-v-815cd186]::-webkit-scrollbar-track{background:transparent}.overflow-auto[data-v-815cd186]::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:10px}.overflow-auto[data-v-815cd186]::-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-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;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0}}}: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-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-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-2{top:calc(var(--spacing)*2)}.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-2{margin-right:calc(var(--spacing)*2)}.flex{display:flex}.h-0{height:calc(var(--spacing)*0)}.h-4{height:calc(var(--spacing)*4)}.h-full{height:100%}.w-0{width:calc(var(--spacing)*0)}.w-4{width:calc(var(--spacing)*4)}.w-64{width:calc(var(--spacing)*64)}.min-w-0{min-width:calc(var(--spacing)*0)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.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-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-y-hidden{overflow-y:hidden}.rounded{border-radius:.25rem}.rounded-md{border-radius:var(--radius-md)}.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-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)}.pl-12{padding-left:calc(var(--spacing)*12)}.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){.hover\:-translate-y-0\.5:hover{--tw-translate-y:calc(var(--spacing)*-.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.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-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}@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}.overflow-auto[data-v-a18bb0b0]::-webkit-scrollbar{width:6px;height:6px}.overflow-auto[data-v-a18bb0b0]::-webkit-scrollbar-track{background:transparent}.overflow-auto[data-v-a18bb0b0]::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:10px}.overflow-auto[data-v-a18bb0b0]::-webkit-scrollbar-thumb:hover{background:#94a3b8}
|
package/dist/gantt-vue3.d.ts
CHANGED
|
@@ -1,9 +1,77 @@
|
|
|
1
|
+
import { ComponentOptionsMixin } from 'vue';
|
|
2
|
+
import { ComponentProvideOptions } from 'vue';
|
|
1
3
|
import { CSSProperties } from 'vue';
|
|
2
|
-
import {
|
|
4
|
+
import { DefineComponent } from 'vue';
|
|
5
|
+
import { PublicProps } from 'vue';
|
|
6
|
+
|
|
7
|
+
declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
8
|
+
"update:list": (args_0: GanttItem[]) => any;
|
|
9
|
+
toggle: (args_0: string | number) => any;
|
|
10
|
+
}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
|
+
"onUpdate:list"?: ((args_0: GanttItem[]) => any) | undefined;
|
|
12
|
+
onToggle?: ((args_0: string | number) => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
14
|
+
containerRef: HTMLDivElement;
|
|
15
|
+
headerRef: HTMLDivElement;
|
|
16
|
+
leftPanelRef: HTMLDivElement;
|
|
17
|
+
rightPanelRef: HTMLDivElement;
|
|
18
|
+
}, HTMLDivElement>;
|
|
19
|
+
|
|
20
|
+
declare type __VLS_Props = {
|
|
21
|
+
list: GanttItem[];
|
|
22
|
+
dateRange: [string, string];
|
|
23
|
+
showToday?: boolean;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
declare function __VLS_template(): {
|
|
27
|
+
attrs: Partial<{}>;
|
|
28
|
+
slots: {
|
|
29
|
+
leftPanelHeader?(_: {}): any;
|
|
30
|
+
headerCell?(_: {
|
|
31
|
+
date: string;
|
|
32
|
+
}): any;
|
|
33
|
+
leftPanelItem?(_: {
|
|
34
|
+
item: any;
|
|
35
|
+
}): any;
|
|
36
|
+
count?(_: {
|
|
37
|
+
style: {
|
|
38
|
+
left: string;
|
|
39
|
+
width: string;
|
|
40
|
+
height: string;
|
|
41
|
+
};
|
|
42
|
+
item: any;
|
|
43
|
+
date: string;
|
|
44
|
+
count: number;
|
|
45
|
+
}): any;
|
|
46
|
+
task?(_: {
|
|
47
|
+
task: any;
|
|
48
|
+
style: {
|
|
49
|
+
left: string;
|
|
50
|
+
width: string;
|
|
51
|
+
position: string;
|
|
52
|
+
};
|
|
53
|
+
}): any;
|
|
54
|
+
};
|
|
55
|
+
refs: {
|
|
56
|
+
containerRef: HTMLDivElement;
|
|
57
|
+
headerRef: HTMLDivElement;
|
|
58
|
+
leftPanelRef: HTMLDivElement;
|
|
59
|
+
rightPanelRef: HTMLDivElement;
|
|
60
|
+
};
|
|
61
|
+
rootEl: HTMLDivElement;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
65
|
+
|
|
66
|
+
declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
67
|
+
new (): {
|
|
68
|
+
$slots: S;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
3
71
|
|
|
4
72
|
export declare const GANTT_VERSION = "0.1.0";
|
|
5
73
|
|
|
6
|
-
export
|
|
74
|
+
export declare const GanttChart: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
7
75
|
|
|
8
76
|
export declare type GanttItem = {
|
|
9
77
|
id: string | number;
|
package/dist/gantt-vue3.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
3
|
-
key: 0,
|
|
4
|
-
class: "bg-slate-50/30"
|
|
5
|
-
}, ne = { class: "text-xs truncate" }, le = { class: "truncate" }, a = 60, x = 52, re = /* @__PURE__ */ j({
|
|
1
|
+
import { defineComponent as Z, ref as v, computed as u, onMounted as ee, onUnmounted as te, createElementBlock as o, openBlock as r, createElementVNode as a, createCommentVNode as N, renderSlot as m, createTextVNode as se, normalizeStyle as l, Fragment as w, renderList as O, toDisplayString as g, withDirectives as Y, normalizeClass as ae, vShow as J } from "vue";
|
|
2
|
+
const le = { class: "bg-white border border-slate-200 overflow-hidden flex-1 flex flex-col" }, ne = { class: "flex border-b border-slate-200 bg-slate-50/50" }, oe = { class: "w-64 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)]" }, re = { class: "text-[10px] tracking-wider text-slate-400" }, ie = { class: "text-xs font-semibold text-slate-400" }, de = { class: "flex flex-1 overflow-hidden" }, ce = ["onClick"], ue = { class: "mr-2 w-4 h-4" }, pe = { class: "min-w-0" }, fe = { class: "text-sm font-semibold text-slate-700 truncate" }, ve = { class: "text-xs truncate" }, he = { class: "truncate" }, i = 60, d = 52, xe = /* @__PURE__ */ Z({
|
|
6
3
|
__name: "GanttChart",
|
|
7
4
|
props: {
|
|
8
5
|
list: {},
|
|
@@ -10,241 +7,302 @@ const F = { class: "flex flex-col h-full bg-slate-50 font-sans antialiased selec
|
|
|
10
7
|
showToday: { type: Boolean }
|
|
11
8
|
},
|
|
12
9
|
emits: ["update:list", "toggle"],
|
|
13
|
-
setup(
|
|
14
|
-
const
|
|
15
|
-
backgroundImage: `linear-gradient(to right, transparent ${
|
|
10
|
+
setup(b, { emit: R }) {
|
|
11
|
+
const h = b, $ = R, n = v([]), T = v(JSON.parse(JSON.stringify(h.list))), x = u(() => n.value.length * i), A = u(() => ({
|
|
12
|
+
backgroundImage: `linear-gradient(to right, transparent ${i - 1}px, #e8e8e8 ${i - 1}px, #e8e8e8 ${i}px)`,
|
|
16
13
|
// backgroundImage: `linear-gradient(to right, #e8e8e8 1px, transparent 1px)`,
|
|
17
|
-
backgroundSize: `${
|
|
14
|
+
backgroundSize: `${i}px 100%`,
|
|
18
15
|
// backgroundRepeat: 'repeat-y',
|
|
19
16
|
// backgroundPosition: `${CELL_WIDTH}px 0`,
|
|
20
|
-
width:
|
|
21
|
-
})),
|
|
17
|
+
width: x.value + "px"
|
|
18
|
+
})), F = u(() => {
|
|
22
19
|
const s = {};
|
|
23
|
-
return
|
|
20
|
+
return T.value.forEach((e) => {
|
|
24
21
|
s[e.id] = {}, e.tasks.forEach((t) => {
|
|
25
|
-
let
|
|
26
|
-
const
|
|
27
|
-
for (;
|
|
28
|
-
const
|
|
29
|
-
s[e.id][
|
|
22
|
+
let c = new Date(t.startDate);
|
|
23
|
+
const p = new Date(t.endDate);
|
|
24
|
+
for (; c <= p; ) {
|
|
25
|
+
const f = c.toISOString().split("T")[0];
|
|
26
|
+
s[e.id][f] = (s[e.id][f] || 0) + 1, c.setDate(c.getDate() + 1);
|
|
30
27
|
}
|
|
31
28
|
});
|
|
32
29
|
}), s;
|
|
33
|
-
}),
|
|
30
|
+
}), U = () => {
|
|
34
31
|
const s = [];
|
|
35
|
-
let e = new Date(
|
|
36
|
-
const t = new Date(
|
|
32
|
+
let e = new Date(h.dateRange[0]);
|
|
33
|
+
const t = new Date(h.dateRange[1]);
|
|
37
34
|
for (; e <= t; )
|
|
38
35
|
s.push(e.toISOString().split("T")[0]), e.setDate(e.getDate() + 1);
|
|
39
|
-
|
|
40
|
-
},
|
|
36
|
+
n.value = s;
|
|
37
|
+
}, P = (s) => {
|
|
41
38
|
const e = new Date(s), t = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
|
|
42
39
|
return {
|
|
43
40
|
monthDay: `${String(e.getMonth() + 1).padStart(2, "0")}/${e.getDate()}`,
|
|
44
41
|
weekday: t[e.getDay()]
|
|
45
42
|
};
|
|
46
|
-
},
|
|
47
|
-
const e =
|
|
48
|
-
return e > -1 ? e *
|
|
49
|
-
},
|
|
50
|
-
const e = new Date(s.startDate), t = new Date(s.endDate),
|
|
51
|
-
if (e <
|
|
43
|
+
}, G = (s) => {
|
|
44
|
+
const e = n.value.indexOf(s);
|
|
45
|
+
return e > -1 ? e * i : -999;
|
|
46
|
+
}, y = (s) => {
|
|
47
|
+
const e = new Date(s.startDate), t = new Date(s.endDate), c = new Date(n.value[0]), p = new Date(n.value[n.value.length - 1]);
|
|
48
|
+
if (e < c && t > p)
|
|
52
49
|
return {
|
|
53
50
|
left: -4,
|
|
54
|
-
width:
|
|
51
|
+
width: x.value + 8
|
|
55
52
|
};
|
|
56
|
-
let
|
|
57
|
-
return
|
|
58
|
-
left:
|
|
59
|
-
width: (
|
|
53
|
+
let f = n.value.indexOf(s.startDate), S = n.value.indexOf(s.endDate), j = 4, W = -8;
|
|
54
|
+
return f === -1 && S === -1 ? null : (f === -1 && (f = 0, j = -4), S === -1 && (S = n.value.length - 1, W = 4), {
|
|
55
|
+
left: f * i + j,
|
|
56
|
+
width: (S - f + 1) * i + W
|
|
60
57
|
});
|
|
61
|
-
}, I =
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
}, C = v(), I = v(), z = v(), E = u(() => {
|
|
59
|
+
const s = [];
|
|
60
|
+
return T.value.forEach((e) => {
|
|
61
|
+
s.push({
|
|
62
|
+
type: "group",
|
|
63
|
+
data: e,
|
|
64
|
+
uniqueKey: `g-${e.id}`
|
|
65
|
+
}), e.expanded && e.tasks.forEach((t) => {
|
|
66
|
+
s.push({
|
|
67
|
+
type: "task",
|
|
68
|
+
data: t,
|
|
69
|
+
uniqueKey: `t-${t.id}`,
|
|
70
|
+
parentId: e.id
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
}), s;
|
|
74
|
+
}), H = v(0), k = v(600), _ = u(() => E.value.length * d), L = u(() => {
|
|
75
|
+
const s = Math.floor(H.value / d), e = Math.ceil(k.value / d), t = 5;
|
|
76
|
+
return {
|
|
77
|
+
start: Math.max(0, s - t),
|
|
78
|
+
end: Math.min(E.value.length, s + e + t)
|
|
79
|
+
};
|
|
80
|
+
}), V = u(() => L.value.start * d), q = u(() => {
|
|
81
|
+
const { start: s, end: e } = L.value;
|
|
82
|
+
return E.value.slice(s, e);
|
|
83
|
+
}), B = () => {
|
|
84
|
+
z.value && (k.value = z.value.clientHeight - 1);
|
|
85
|
+
}, Q = (s) => {
|
|
86
|
+
const e = s.target, t = _.value - k.value;
|
|
87
|
+
e.scrollTop > t && (e.scrollTop = t), H.value = e.scrollTop, C.value && (C.value.scrollTop = e.scrollTop), I.value && (I.value.scrollLeft = e.scrollLeft);
|
|
88
|
+
}, X = (s) => {
|
|
89
|
+
const e = T.value.find((t) => t.id === s);
|
|
66
90
|
e && (e.expanded = !e.expanded), $("toggle", s);
|
|
67
|
-
},
|
|
68
|
-
const s = (/* @__PURE__ */ new Date()).toISOString().split("T")[0], e =
|
|
69
|
-
return e === -1 ? null : e *
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
91
|
+
}, K = u(() => {
|
|
92
|
+
const s = (/* @__PURE__ */ new Date()).toISOString().split("T")[0], e = n.value.indexOf(s);
|
|
93
|
+
return e === -1 ? null : e * i;
|
|
94
|
+
}), M = v();
|
|
95
|
+
let D = null;
|
|
96
|
+
return ee(() => {
|
|
97
|
+
U(), B(), M.value && (D = new ResizeObserver(() => {
|
|
98
|
+
console.log("resize"), B();
|
|
99
|
+
}), D.observe(M.value));
|
|
100
|
+
}), te(() => {
|
|
101
|
+
D && D.disconnect();
|
|
102
|
+
}), (s, e) => (r(), o("div", {
|
|
103
|
+
ref_key: "containerRef",
|
|
104
|
+
ref: M,
|
|
105
|
+
class: "flex flex-col h-full bg-slate-50 font-sans antialiased select-none"
|
|
106
|
+
}, [
|
|
107
|
+
a("div", le, [
|
|
108
|
+
a("div", ne, [
|
|
109
|
+
a("div", oe, [
|
|
110
|
+
m(s.$slots, "leftPanelHeader", {}, () => [
|
|
111
|
+
e[0] || (e[0] = se("项目成员 / 任务状态", -1))
|
|
79
112
|
], !0)
|
|
80
113
|
]),
|
|
81
|
-
|
|
114
|
+
a("div", {
|
|
82
115
|
ref_key: "headerRef",
|
|
83
|
-
ref:
|
|
116
|
+
ref: I,
|
|
84
117
|
class: "flex-1 overflow-hidden pointer-events-none"
|
|
85
118
|
}, [
|
|
86
|
-
|
|
119
|
+
a("div", {
|
|
87
120
|
class: "flex h-full",
|
|
88
|
-
style:
|
|
121
|
+
style: l({ width: x.value + "px" })
|
|
89
122
|
}, [
|
|
90
|
-
(r(!0),
|
|
123
|
+
(r(!0), o(w, null, O(n.value, (t) => (r(), o("div", {
|
|
91
124
|
key: t,
|
|
92
125
|
class: "shrink-0 flex flex-col items-center justify-center border-r border-slate-100 py-2 transition-colors",
|
|
93
|
-
style:
|
|
126
|
+
style: l({ width: i + "px" })
|
|
94
127
|
}, [
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
128
|
+
m(s.$slots, "headerCell", { date: t }, () => [
|
|
129
|
+
a("span", re, g(P(t).weekday), 1),
|
|
130
|
+
a("span", ie, g(P(t).monthDay), 1)
|
|
98
131
|
], !0)
|
|
99
132
|
], 4))), 128))
|
|
100
133
|
], 4)
|
|
101
134
|
], 512)
|
|
102
135
|
]),
|
|
103
|
-
|
|
104
|
-
|
|
136
|
+
a("div", de, [
|
|
137
|
+
a("div", {
|
|
105
138
|
ref_key: "leftPanelRef",
|
|
106
|
-
ref:
|
|
139
|
+
ref: C,
|
|
107
140
|
class: "w-64 shrink-0 border-r border-slate-200 overflow-y-hidden relative z-10 shadow-[10px_0_15px_-3px_rgba(0,0,0,0.1)] bg-white"
|
|
108
141
|
}, [
|
|
109
|
-
(
|
|
110
|
-
|
|
142
|
+
a("div", {
|
|
143
|
+
style: l({ height: _.value + "px", position: "relative" })
|
|
111
144
|
}, [
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
style: i({ height: x + "px" }),
|
|
115
|
-
onClick: (n) => M(t.id)
|
|
145
|
+
a("div", {
|
|
146
|
+
style: l({ transform: `translateY(${V.value}px)` })
|
|
116
147
|
}, [
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}, [...e[1] || (e[1] = [
|
|
120
|
-
o("svg", {
|
|
121
|
-
class: "w-4 h-4 text-slate-400",
|
|
122
|
-
fill: "none",
|
|
123
|
-
stroke: "currentColor",
|
|
124
|
-
viewBox: "0 0 24 24"
|
|
125
|
-
}, [
|
|
126
|
-
o("path", {
|
|
127
|
-
"stroke-linecap": "round",
|
|
128
|
-
"stroke-linejoin": "round",
|
|
129
|
-
"stroke-width": "2",
|
|
130
|
-
d: "M9 5l7 7-7 7"
|
|
131
|
-
})
|
|
132
|
-
], -1)
|
|
133
|
-
])], 2), [
|
|
134
|
-
[L, t.tasks.length > 0]
|
|
135
|
-
]),
|
|
136
|
-
G(o("span", ee, null, 512), [
|
|
137
|
-
[L, !t.tasks.length]
|
|
138
|
-
]),
|
|
139
|
-
o("div", te, [
|
|
140
|
-
b(s.$slots, "leftPanelItem", { item: t }, () => [
|
|
141
|
-
o("div", se, v(t.name), 1)
|
|
142
|
-
], !0)
|
|
143
|
-
])
|
|
144
|
-
], 12, Z),
|
|
145
|
-
t.expanded ? (r(), l("div", oe, [
|
|
146
|
-
(r(!0), l(p, null, h(t.tasks, (n) => (r(), l("div", {
|
|
147
|
-
key: n.id,
|
|
148
|
-
class: "flex items-center pl-12 pr-4 border-b border-slate-100/50 text-slate-600 hover:bg-white transition-colors",
|
|
149
|
-
style: i({ height: x + "px" })
|
|
148
|
+
(r(!0), o(w, null, O(q.value, (t) => (r(), o("div", {
|
|
149
|
+
key: t.uniqueKey
|
|
150
150
|
}, [
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
151
|
+
t.type === "group" ? (r(), o("div", {
|
|
152
|
+
key: 0,
|
|
153
|
+
class: "flex items-center px-4 hover:bg-slate-50 cursor-pointer border-b border-slate-50 transition-colors",
|
|
154
|
+
style: l({ height: d + "px" }),
|
|
155
|
+
onClick: (c) => X(t.data.id)
|
|
156
|
+
}, [
|
|
157
|
+
Y(a("span", {
|
|
158
|
+
class: ae(["transform transition-transform duration-200 mr-2", t.data.expanded ? "rotate-90" : ""])
|
|
159
|
+
}, [...e[1] || (e[1] = [
|
|
160
|
+
a("svg", {
|
|
161
|
+
class: "w-4 h-4 text-slate-400",
|
|
162
|
+
fill: "none",
|
|
163
|
+
stroke: "currentColor",
|
|
164
|
+
viewBox: "0 0 24 24"
|
|
165
|
+
}, [
|
|
166
|
+
a("path", {
|
|
167
|
+
"stroke-linecap": "round",
|
|
168
|
+
"stroke-linejoin": "round",
|
|
169
|
+
"stroke-width": "2",
|
|
170
|
+
d: "M9 5l7 7-7 7"
|
|
171
|
+
})
|
|
172
|
+
], -1)
|
|
173
|
+
])], 2), [
|
|
174
|
+
[J, t.data.tasks.length > 0]
|
|
175
|
+
]),
|
|
176
|
+
Y(a("span", ue, null, 512), [
|
|
177
|
+
[J, !t.data.tasks.length]
|
|
178
|
+
]),
|
|
179
|
+
a("div", pe, [
|
|
180
|
+
m(s.$slots, "leftPanelItem", {
|
|
181
|
+
item: t.data
|
|
182
|
+
}, () => [
|
|
183
|
+
a("div", fe, g(t.data.name), 1)
|
|
184
|
+
], !0)
|
|
185
|
+
])
|
|
186
|
+
], 12, ce)) : (r(), o("div", {
|
|
187
|
+
key: 1,
|
|
188
|
+
class: "flex items-center pl-12 pr-4 border-b border-slate-100/50 text-slate-600 hover:bg-white transition-colors",
|
|
189
|
+
style: l({ height: d + "px" })
|
|
190
|
+
}, [
|
|
191
|
+
a("div", ve, g(t.data.name), 1)
|
|
192
|
+
], 4))
|
|
193
|
+
]))), 128))
|
|
194
|
+
], 4)
|
|
195
|
+
], 4)
|
|
155
196
|
], 512),
|
|
156
|
-
|
|
157
|
-
|
|
197
|
+
a("div", {
|
|
198
|
+
ref_key: "rightPanelRef",
|
|
199
|
+
ref: z,
|
|
200
|
+
onScroll: Q,
|
|
158
201
|
class: "flex-1 overflow-auto relative select-none"
|
|
159
202
|
}, [
|
|
160
|
-
|
|
203
|
+
K.value !== null && b.showToday ? (r(), o("div", {
|
|
161
204
|
key: 0,
|
|
162
205
|
class: "absolute top-0 bottom-0 z-10 pointer-events-none border-l-2 border-orange-400",
|
|
163
|
-
style:
|
|
206
|
+
style: l({ left: K.value + "px", height: _.value + "px" })
|
|
164
207
|
}, [...e[2] || (e[2] = [
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
208
|
+
a("div", {
|
|
209
|
+
class: "sticky top-0 z-20",
|
|
210
|
+
style: { height: "0", overflow: "visible" }
|
|
211
|
+
}, [
|
|
212
|
+
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" }),
|
|
213
|
+
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" }, " 今天 ")
|
|
214
|
+
], -1)
|
|
215
|
+
])], 4)) : N("", !0),
|
|
216
|
+
a("div", {
|
|
217
|
+
class: "absolute left-0 pointer-events-none",
|
|
218
|
+
style: l({
|
|
219
|
+
...A.value,
|
|
220
|
+
height: k.value + "px",
|
|
221
|
+
top: H.value + "px",
|
|
222
|
+
width: x.value + "px"
|
|
223
|
+
})
|
|
171
224
|
}, null, 4),
|
|
172
|
-
|
|
173
|
-
style:
|
|
225
|
+
a("div", {
|
|
226
|
+
style: l({ height: _.value + "px", position: "relative" })
|
|
174
227
|
}, [
|
|
175
|
-
(
|
|
176
|
-
|
|
228
|
+
a("div", {
|
|
229
|
+
style: l({ transform: `translateY(${V.value}px)` })
|
|
177
230
|
}, [
|
|
178
|
-
o(
|
|
179
|
-
|
|
180
|
-
style: i({ height: x + "px" })
|
|
231
|
+
(r(!0), o(w, null, O(q.value, (t) => (r(), o(w, {
|
|
232
|
+
key: t.uniqueKey
|
|
181
233
|
}, [
|
|
182
|
-
|
|
183
|
-
key: c,
|
|
184
|
-
item: t,
|
|
185
|
-
date: c,
|
|
186
|
-
count: n,
|
|
187
|
-
style: i({
|
|
188
|
-
left: R(c) + "px",
|
|
189
|
-
width: a + "px",
|
|
190
|
-
height: x + "px"
|
|
191
|
-
})
|
|
192
|
-
}, () => [
|
|
193
|
-
o("div", {
|
|
194
|
-
class: "absolute top-0 flex items-center justify-center text-sm",
|
|
195
|
-
style: i({
|
|
196
|
-
left: R(c) + "px",
|
|
197
|
-
width: a + "px",
|
|
198
|
-
height: x + "px",
|
|
199
|
-
contentVisibility: "auto",
|
|
200
|
-
containIntrinsicSize: `${a}px ${x}px`
|
|
201
|
-
})
|
|
202
|
-
}, v(n), 5)
|
|
203
|
-
], !0)), 128))
|
|
204
|
-
], 4),
|
|
205
|
-
t.expanded ? (r(!0), l(p, { key: 0 }, h(t.tasks, (n) => (r(), l("div", {
|
|
206
|
-
key: n.id,
|
|
207
|
-
class: "relative border-b border-[#e8e8e8] overflow-hidden",
|
|
208
|
-
style: i({ height: x + "px" })
|
|
209
|
-
}, [
|
|
210
|
-
w(n) ? b(s.$slots, "task", {
|
|
234
|
+
t.type === "group" ? (r(), o("div", {
|
|
211
235
|
key: 0,
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
backgroundColor: n.color
|
|
236
|
+
class: "relative border-b border-[#e8e8e8]",
|
|
237
|
+
style: l({ height: d + "px", width: x.value + "px" })
|
|
238
|
+
}, [
|
|
239
|
+
(r(!0), o(w, null, O(F.value[t.data.id], (c, p) => m(s.$slots, "count", {
|
|
240
|
+
key: p,
|
|
241
|
+
item: t.data,
|
|
242
|
+
date: p,
|
|
243
|
+
count: c,
|
|
244
|
+
style: l({
|
|
245
|
+
left: G(p) + "px",
|
|
246
|
+
width: i + "px",
|
|
247
|
+
height: d + "px"
|
|
225
248
|
})
|
|
226
|
-
}, [
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
249
|
+
}, () => [
|
|
250
|
+
a("div", {
|
|
251
|
+
class: "absolute top-0 flex items-center justify-center text-sm",
|
|
252
|
+
style: l({
|
|
253
|
+
left: G(p) + "px",
|
|
254
|
+
width: i + "px",
|
|
255
|
+
height: d + "px",
|
|
256
|
+
contentVisibility: "auto",
|
|
257
|
+
containIntrinsicSize: `${i}px ${d}px`
|
|
258
|
+
})
|
|
259
|
+
}, g(c), 5)
|
|
260
|
+
], !0)), 128))
|
|
261
|
+
], 4)) : (r(), o("div", {
|
|
262
|
+
key: 1,
|
|
263
|
+
class: "relative border-b border-[#e8e8e8] overflow-hidden",
|
|
264
|
+
style: l({ height: d + "px", width: x.value + "px" })
|
|
265
|
+
}, [
|
|
266
|
+
y(t.data) ? m(s.$slots, "task", {
|
|
267
|
+
key: 0,
|
|
268
|
+
style: l({
|
|
269
|
+
left: y(t.data).left + "px",
|
|
270
|
+
width: y(t.data).width + "px",
|
|
271
|
+
position: "absolute"
|
|
272
|
+
}),
|
|
273
|
+
task: t.data
|
|
274
|
+
}, () => [
|
|
275
|
+
a("div", {
|
|
276
|
+
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",
|
|
277
|
+
style: l({
|
|
278
|
+
left: y(t.data).left + "px",
|
|
279
|
+
width: y(t.data).width + "px",
|
|
280
|
+
backgroundColor: t.data.color
|
|
281
|
+
})
|
|
282
|
+
}, [
|
|
283
|
+
a("span", he, g(t.data.name), 1)
|
|
284
|
+
], 4)
|
|
285
|
+
], !0) : N("", !0)
|
|
286
|
+
], 4))
|
|
287
|
+
], 64))), 128))
|
|
288
|
+
], 4)
|
|
232
289
|
], 4)
|
|
233
|
-
],
|
|
290
|
+
], 544)
|
|
234
291
|
])
|
|
235
|
-
])
|
|
236
|
-
|
|
292
|
+
]),
|
|
293
|
+
N("", !0)
|
|
294
|
+
], 512));
|
|
237
295
|
}
|
|
238
|
-
}),
|
|
239
|
-
const
|
|
240
|
-
for (const [$,
|
|
241
|
-
|
|
242
|
-
return
|
|
243
|
-
},
|
|
296
|
+
}), ge = (b, R) => {
|
|
297
|
+
const h = b.__vccOpts || b;
|
|
298
|
+
for (const [$, n] of R)
|
|
299
|
+
h[$] = n;
|
|
300
|
+
return h;
|
|
301
|
+
}, ye = /* @__PURE__ */ ge(xe, [["__scopeId", "data-v-a18bb0b0"]]), me = "0.1.0", we = () => {
|
|
244
302
|
console.log("Gantt Core Initialized");
|
|
245
303
|
};
|
|
246
304
|
export {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
305
|
+
me as GANTT_VERSION,
|
|
306
|
+
ye as GanttChart,
|
|
307
|
+
we as setupGantt
|
|
250
308
|
};
|
package/dist/gantt-vue3.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(i,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(i=typeof globalThis<"u"?globalThis:i||self,e(i.GanttVue3={},i.Vue))})(this,(function(i,e){"use strict";const L={class:"bg-white border border-slate-200 overflow-hidden flex-1 flex flex-col"},M={class:"flex border-b border-slate-200 bg-slate-50/50"},H={class:"w-64 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)]"},P={class:"text-[10px] tracking-wider text-slate-400"},j={class:"text-xs font-semibold text-slate-400"},q={class:"flex flex-1 overflow-hidden"},F=["onClick"],K={class:"mr-2 w-4 h-4"},v={class:"min-w-0"},W={class:"text-sm font-semibold text-slate-700 truncate"},Y={class:"text-xs truncate"},A={class:"truncate"},o=60,r=52,J=((h,k)=>{const p=h.__vccOpts||h;for(const[u,a]of k)p[u]=a;return p})(e.defineComponent({__name:"GanttChart",props:{list:{},dateRange:{},showToday:{type:Boolean}},emits:["update:list","toggle"],setup(h,{emit:k}){const p=h,u=k,a=e.ref([]),E=e.ref(JSON.parse(JSON.stringify(p.list))),f=e.computed(()=>a.value.length*o),X=e.computed(()=>({backgroundImage:`linear-gradient(to right, transparent ${o-1}px, #e8e8e8 ${o-1}px, #e8e8e8 ${o}px)`,backgroundSize:`${o}px 100%`,width:f.value+"px"})),Z=e.computed(()=>{const n={};return E.value.forEach(t=>{n[t.id]={},t.tasks.forEach(l=>{let s=new Date(l.startDate);const d=new Date(l.endDate);for(;s<=d;){const c=s.toISOString().split("T")[0];n[t.id][c]=(n[t.id][c]||0)+1,s.setDate(s.getDate()+1)}})}),n}),ee=()=>{const n=[];let t=new Date(p.dateRange[0]);const l=new Date(p.dateRange[1]);for(;t<=l;)n.push(t.toISOString().split("T")[0]),t.setDate(t.getDate()+1);a.value=n},B=n=>{const t=new Date(n),l=["周日","周一","周二","周三","周四","周五","周六"];return{monthDay:`${String(t.getMonth()+1).padStart(2,"0")}/${t.getDate()}`,weekday:l[t.getDay()]}},z=n=>{const t=a.value.indexOf(n);return t>-1?t*o:-999},m=n=>{const t=new Date(n.startDate),l=new Date(n.endDate),s=new Date(a.value[0]),d=new Date(a.value[a.value.length-1]);if(t<s&&l>d)return{left:-4,width:f.value+8};let c=a.value.indexOf(n.startDate),b=a.value.indexOf(n.endDate),I=4,G=-8;return c===-1&&b===-1?null:(c===-1&&(c=0,I=-4),b===-1&&(b=a.value.length-1,G=4),{left:c*o+I,width:(b-c+1)*o+G})},S=e.ref(),w=e.ref(),_=e.ref(),D=e.computed(()=>{const n=[];return E.value.forEach(t=>{n.push({type:"group",data:t,uniqueKey:`g-${t.id}`}),t.expanded&&t.tasks.forEach(l=>{n.push({type:"task",data:l,uniqueKey:`t-${l.id}`,parentId:t.id})})}),n}),N=e.ref(0),x=e.ref(600),g=e.computed(()=>D.value.length*r),T=e.computed(()=>{const n=Math.floor(N.value/r),t=Math.ceil(x.value/r),l=5;return{start:Math.max(0,n-l),end:Math.min(D.value.length,n+t+l)}}),O=e.computed(()=>T.value.start*r),R=e.computed(()=>{const{start:n,end:t}=T.value;return D.value.slice(n,t)}),$=()=>{_.value&&(x.value=_.value.clientHeight-1)},te=n=>{const t=n.target,l=g.value-x.value;t.scrollTop>l&&(t.scrollTop=l),N.value=t.scrollTop,S.value&&(S.value.scrollTop=t.scrollTop),w.value&&(w.value.scrollLeft=t.scrollLeft)},le=n=>{const t=E.value.find(l=>l.id===n);t&&(t.expanded=!t.expanded),u("toggle",n)},C=e.computed(()=>{const n=new Date().toISOString().split("T")[0],t=a.value.indexOf(n);return t===-1?null:t*o}),V=e.ref();let y=null;return e.onMounted(()=>{ee(),$(),V.value&&(y=new ResizeObserver(()=>{console.log("resize"),$()}),y.observe(V.value))}),e.onUnmounted(()=>{y&&y.disconnect()}),(n,t)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:V,class:"flex flex-col h-full bg-slate-50 font-sans antialiased select-none"},[e.createElementVNode("div",L,[e.createElementVNode("div",M,[e.createElementVNode("div",H,[e.renderSlot(n.$slots,"leftPanelHeader",{},()=>[t[0]||(t[0]=e.createTextVNode("项目成员 / 任务状态",-1))],!0)]),e.createElementVNode("div",{ref_key:"headerRef",ref:w,class:"flex-1 overflow-hidden pointer-events-none"},[e.createElementVNode("div",{class:"flex h-full",style:e.normalizeStyle({width:f.value+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,l=>(e.openBlock(),e.createElementBlock("div",{key:l,class:"shrink-0 flex flex-col items-center justify-center border-r border-slate-100 py-2 transition-colors",style:e.normalizeStyle({width:o+"px"})},[e.renderSlot(n.$slots,"headerCell",{date:l},()=>[e.createElementVNode("span",P,e.toDisplayString(B(l).weekday),1),e.createElementVNode("span",j,e.toDisplayString(B(l).monthDay),1)],!0)],4))),128))],4)],512)]),e.createElementVNode("div",q,[e.createElementVNode("div",{ref_key:"leftPanelRef",ref:S,class:"w-64 shrink-0 border-r border-slate-200 overflow-y-hidden relative z-10 shadow-[10px_0_15px_-3px_rgba(0,0,0,0.1)] bg-white"},[e.createElementVNode("div",{style:e.normalizeStyle({height:g.value+"px",position:"relative"})},[e.createElementVNode("div",{style:e.normalizeStyle({transform:`translateY(${O.value}px)`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,l=>(e.openBlock(),e.createElementBlock("div",{key:l.uniqueKey},[l.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:r+"px"}),onClick:s=>le(l.data.id)},[e.withDirectives(e.createElementVNode("span",{class:e.normalizeClass(["transform transition-transform duration-200 mr-2",l.data.expanded?"rotate-90":""])},[...t[1]||(t[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,l.data.tasks.length>0]]),e.withDirectives(e.createElementVNode("span",K,null,512),[[e.vShow,!l.data.tasks.length]]),e.createElementVNode("div",v,[e.renderSlot(n.$slots,"leftPanelItem",{item:l.data},()=>[e.createElementVNode("div",W,e.toDisplayString(l.data.name),1)],!0)])],12,F)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"flex items-center pl-12 pr-4 border-b border-slate-100/50 text-slate-600 hover:bg-white transition-colors",style:e.normalizeStyle({height:r+"px"})},[e.createElementVNode("div",Y,e.toDisplayString(l.data.name),1)],4))]))),128))],4)],4)],512),e.createElementVNode("div",{ref_key:"rightPanelRef",ref:_,onScroll:te,class:"flex-1 overflow-auto relative select-none"},[C.value!==null&&h.showToday?(e.openBlock(),e.createElementBlock("div",{key:0,class:"absolute top-0 bottom-0 z-10 pointer-events-none border-l-2 border-orange-400",style:e.normalizeStyle({left:C.value+"px",height:g.value+"px"})},[...t[2]||(t[2]=[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({...X.value,height:x.value+"px",top:N.value+"px",width:f.value+"px"})},null,4),e.createElementVNode("div",{style:e.normalizeStyle({height:g.value+"px",position:"relative"})},[e.createElementVNode("div",{style:e.normalizeStyle({transform:`translateY(${O.value}px)`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,l=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:l.uniqueKey},[l.type==="group"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"relative border-b border-[#e8e8e8]",style:e.normalizeStyle({height:r+"px",width:f.value+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.value[l.data.id],(s,d)=>e.renderSlot(n.$slots,"count",{key:d,item:l.data,date:d,count:s,style:e.normalizeStyle({left:z(d)+"px",width:o+"px",height:r+"px"})},()=>[e.createElementVNode("div",{class:"absolute top-0 flex items-center justify-center text-sm",style:e.normalizeStyle({left:z(d)+"px",width:o+"px",height:r+"px",contentVisibility:"auto",containIntrinsicSize:`${o}px ${r}px`})},e.toDisplayString(s),5)],!0)),128))],4)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"relative border-b border-[#e8e8e8] overflow-hidden",style:e.normalizeStyle({height:r+"px",width:f.value+"px"})},[m(l.data)?e.renderSlot(n.$slots,"task",{key:0,style:e.normalizeStyle({left:m(l.data).left+"px",width:m(l.data).width+"px",position:"absolute"}),task:l.data},()=>[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:m(l.data).left+"px",width:m(l.data).width+"px",backgroundColor:l.data.color})},[e.createElementVNode("span",A,e.toDisplayString(l.data.name),1)],4)],!0):e.createCommentVNode("",!0)],4))],64))),128))],4)],4)],544)])]),e.createCommentVNode("",!0)],512))}}),[["__scopeId","data-v-a18bb0b0"]]),U="0.1.0",Q=()=>{console.log("Gantt Core Initialized")};i.GANTT_VERSION=U,i.GanttChart=J,i.setupGantt=Q,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ollap/gantt-vue3",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -16,21 +16,22 @@
|
|
|
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
|
-
},
|
|
24
19
|
"peerDependencies": {
|
|
25
20
|
"vue": "^3.5.26"
|
|
26
21
|
},
|
|
27
22
|
"devDependencies": {
|
|
28
23
|
"@vitejs/plugin-vue": "^6.0.3",
|
|
29
24
|
"@vitejs/plugin-vue-jsx": "^5.1.3",
|
|
25
|
+
"csstype": "^3.2.3",
|
|
30
26
|
"typescript": "~5.9.3",
|
|
31
27
|
"vite": "^6.0.0",
|
|
32
28
|
"vite-plugin-dts": "^4.5.4",
|
|
33
29
|
"vue": "^3.5.26",
|
|
34
30
|
"vue-tsc": "^3.2.1"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"dev": "vite build --watch",
|
|
34
|
+
"build": "vite build",
|
|
35
|
+
"type-check": "vue-tsc --build"
|
|
35
36
|
}
|
|
36
|
-
}
|
|
37
|
+
}
|