sprintify-ui 0.11.33 → 0.11.34

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.
@@ -25,6 +25,18 @@ interface Props {
25
25
  * Flatten the Gantt chart by removing the hierarchy of rows and displaying all items in a single list. This is useful when there's only one level of rows and you want to maximize the vertical space.
26
26
  */
27
27
  flatten?: boolean;
28
+ /**
29
+ * Start with every row collapsed (items hidden) by default.
30
+ */
31
+ rowsCollapsedByDefault?: boolean;
32
+ /**
33
+ * Show row bar labels rendered outside the bar.
34
+ */
35
+ showRowBarLabels?: boolean;
36
+ /**
37
+ * Show item bar labels rendered outside the bar.
38
+ */
39
+ showItemBarLabels?: boolean;
28
40
  /**
29
41
  * Relationships between items, drawn as arrows from one item to another.
30
42
  */
@@ -55,6 +67,9 @@ declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {},
55
67
  sidebarWidth: number;
56
68
  rowHeight: number;
57
69
  includeToday: boolean;
70
+ rowsCollapsedByDefault: boolean;
71
+ showRowBarLabels: boolean;
72
+ showItemBarLabels: boolean;
58
73
  relationships: GanttRelationship[];
59
74
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
60
75
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprintify-ui",
3
- "version": "0.11.33",
3
+ "version": "0.11.34",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "generate-llm-txt": "node scripts/generate-llm-txt.js",
@@ -46,7 +46,6 @@ for (let i = 0; i < 10; i++) {
46
46
  id: i + 1,
47
47
  name: `Project sdf sdfg sdf gsdf gsdf gsdf g sdf sdf sdfg dsfg dsfg ${i + 1}`,
48
48
  items: items,
49
- height: 30,
50
49
  });
51
50
  }
52
51
 
@@ -55,7 +54,7 @@ export default {
55
54
  component: BaseGantt,
56
55
  args: {
57
56
  rows,
58
- maxHeight: 300,
57
+ maxHeight: 400,
59
58
  },
60
59
  };
61
60
 
@@ -62,7 +62,7 @@
62
62
  :row="row"
63
63
  >
64
64
  <div class="px-1 py-1 h-full flex items-center">
65
- <p class="font-semibold leading-tight truncate text-xs">
65
+ <p class="font-medium leading-tight truncate text-[13px]">
66
66
  {{ row.name }}
67
67
  </p>
68
68
  </div>
@@ -86,7 +86,7 @@
86
86
  :item="item"
87
87
  >
88
88
  <div class="pr-1 pl-4 py-1 h-full flex items-center">
89
- <p class="leading-tight truncate text-slate-600 text-xs">
89
+ <p class="leading-tight truncate text-slate-600 text-[13px]">
90
90
  {{ item.name }}
91
91
  </p>
92
92
  </div>
@@ -204,7 +204,7 @@
204
204
  >
205
205
  <button
206
206
  type="button"
207
- class="absolute flex"
207
+ class="absolute flex overflow-visible"
208
208
  :style="{
209
209
  transform: `translate(${row.x}px, ${row.y}px)`,
210
210
  height: row.barHeight + 'px',
@@ -218,19 +218,19 @@
218
218
  :row="row"
219
219
  >
220
220
  <div
221
- :style="{
222
- backgroundColor: 'gray',
223
- }"
224
- class="flex w-full h-full items-center rounded hover:opacity-80 duration-200"
221
+ class="relative w-full h-full hover:opacity-80 duration-200 text-slate-500"
225
222
  >
226
- <p
227
- class="text-white text-xs px-2 py-1 truncate"
228
- style="text-shadow: 0.5px 0.5px rgba(0,0,0,0.1);"
229
- >
230
- {{ row.name }}
231
- </p>
223
+ <div class="absolute left-0 right-0 top-1/2 -translate-y-1/2 border-t-2 border-current" />
224
+ <div class="absolute left-0 top-1/2 -translate-y-1/2 h-3 border-l-2 border-current" />
225
+ <div class="absolute right-0 top-1/2 -translate-y-1/2 h-3 border-r-2 border-current" />
232
226
  </div>
233
227
  </slot>
228
+ <p
229
+ v-if="props.showRowBarLabels"
230
+ class="absolute left-full ml-2 top-1/2 -translate-y-1/2 text-[13px] leading-tight font-semibold text-slate-900 whitespace-nowrap max-w-[320px] truncate"
231
+ >
232
+ {{ row.name }}
233
+ </p>
234
234
  </button>
235
235
  </div>
236
236
 
@@ -245,7 +245,7 @@
245
245
  >
246
246
  <button
247
247
  type="button"
248
- class="absolute flex"
248
+ class="absolute flex overflow-visible"
249
249
  :style="{
250
250
  transform: `translate(${item.x}px, ${item.y}px)`,
251
251
  height: item.barHeight + 'px',
@@ -263,15 +263,14 @@
263
263
  backgroundColor: item.color,
264
264
  }"
265
265
  class="flex w-full h-full items-center rounded hover:opacity-80 duration-200"
266
- >
267
- <p
268
- class="text-white text-xs px-2 py-1 truncate"
269
- style="text-shadow: 0.5px 0.5px rgba(0,0,0,0.1);"
270
- >
271
- {{ item.name }}
272
- </p>
273
- </div>
266
+ />
274
267
  </slot>
268
+ <p
269
+ v-if="props.showItemBarLabels"
270
+ class="absolute left-full ml-2 top-1/2 -translate-y-1/2 text-[13px] leading-tight text-slate-700 whitespace-nowrap max-w-[320px] truncate"
271
+ >
272
+ {{ item.name }}
273
+ </p>
275
274
  </button>
276
275
  </div>
277
276
  </div>
@@ -427,6 +426,18 @@ interface Props {
427
426
  * Flatten the Gantt chart by removing the hierarchy of rows and displaying all items in a single list. This is useful when there's only one level of rows and you want to maximize the vertical space.
428
427
  */
429
428
  flatten?: boolean;
429
+ /**
430
+ * Start with every row collapsed (items hidden) by default.
431
+ */
432
+ rowsCollapsedByDefault?: boolean;
433
+ /**
434
+ * Show row bar labels rendered outside the bar.
435
+ */
436
+ showRowBarLabels?: boolean;
437
+ /**
438
+ * Show item bar labels rendered outside the bar.
439
+ */
440
+ showItemBarLabels?: boolean;
430
441
  /**
431
442
  * Relationships between items, drawn as arrows from one item to another.
432
443
  */
@@ -438,6 +449,9 @@ const props = withDefaults(defineProps<Props>(), {
438
449
  rowHeight: 40,
439
450
  maxHeight: undefined,
440
451
  includeToday: true,
452
+ rowsCollapsedByDefault: false,
453
+ showRowBarLabels: true,
454
+ showItemBarLabels: true,
441
455
  relationships: () => [],
442
456
  });
443
457
 
@@ -494,7 +508,9 @@ function init() {
494
508
 
495
509
  nowLine.value = format.nowLine;
496
510
 
497
- expandedRows.value = new Set(props.rows.map((r) => r.id));
511
+ expandedRows.value = props.rowsCollapsedByDefault
512
+ ? new Set<string | number>()
513
+ : new Set(props.rows.map((r) => r.id));
498
514
 
499
515
  // Scroll to now line
500
516
 
@@ -4,6 +4,7 @@ import { Timescale } from "./timescale";
4
4
  import { sum } from "lodash";
5
5
 
6
6
  const PADDING_Y_ROW = 4;
7
+ const ITEM_LABEL_TIMELINE_PADDING_X = 800;
7
8
 
8
9
  export class Format {
9
10
 
@@ -23,8 +24,18 @@ export class Format {
23
24
  // Get min and max
24
25
  let { min, max } = this.getMinMax(rowsFormatted);
25
26
 
26
- // Get timescale
27
- const timescale = (new Timescale(this.config.minWidth, min, max)).handle();
27
+ // Get baseline timescale before expanding the visible range for outside item labels.
28
+ const baselineTimescale = (new Timescale(this.config.minWidth, min, max)).handle();
29
+
30
+ const timelinePaddingMilliseconds = baselineTimescale.millisecondToPixel > 0
31
+ ? ITEM_LABEL_TIMELINE_PADDING_X / baselineTimescale.millisecondToPixel
32
+ : 0;
33
+
34
+ const paddedMin = baselineTimescale.min.minus({ milliseconds: timelinePaddingMilliseconds });
35
+ const paddedMax = baselineTimescale.max.plus({ milliseconds: timelinePaddingMilliseconds });
36
+
37
+ // Rebuild timescale with left/right timeline padding so labels can render outside bars by default.
38
+ const timescale = (new Timescale(this.config.minWidth, paddedMin, paddedMax)).handle();
28
39
 
29
40
  // Padded min and max
30
41
  min = timescale.min;