vlite3 1.4.32 → 1.4.33

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.
Files changed (43) hide show
  1. package/components/CategoryManager/CategoryManager.vue2.js +1 -1
  2. package/components/CategoryManager/CategoryNode.vue.js +30 -30
  3. package/components/CategoryMenu/CategoryMenu.vue.js +9 -11
  4. package/components/Chart/GanttChart.vue.d.ts +5 -1
  5. package/components/Chart/GanttChart.vue.js +2 -2
  6. package/components/Chart/GanttChart.vue2.js +977 -812
  7. package/components/Chart/GanttChartConnectorRouting.d.ts +83 -0
  8. package/components/Chart/GanttChartConnectorRouting.js +405 -0
  9. package/components/Chart/GanttChartDependencyUtils.js +43 -47
  10. package/components/Chart/types.d.ts +16 -1
  11. package/components/ColorPicker/ColorIro.vue2.js +78 -64
  12. package/components/ColorPicker/ColorPicker.vue.d.ts +5 -0
  13. package/components/ColorPicker/ColorPicker.vue.js +110 -64
  14. package/components/ColorPicker/constants.d.ts +2 -0
  15. package/components/ColorPicker/constants.js +4 -0
  16. package/components/ColorPicker/index.d.ts +1 -0
  17. package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
  18. package/components/CommandPalette/{CommandPaletteItem.vue.js → CommandPaletteItem.vue2.js} +1 -1
  19. package/components/Dropdown/Dropdown.vue.js +100 -97
  20. package/components/Dropdown/DropdownMenu.vue.js +1 -1
  21. package/components/Form/{AccordionView.vue2.js → AccordionView.vue.js} +1 -1
  22. package/components/Form/FormField.vue.js +9 -8
  23. package/components/Form/index.vue2.js +1 -1
  24. package/components/Kanban/Kanban.vue.d.ts +16 -2
  25. package/components/Kanban/Kanban.vue.js +2 -2
  26. package/components/Kanban/Kanban.vue2.js +150 -86
  27. package/components/Kanban/types.d.ts +37 -0
  28. package/components/NavbarCommandPalette.vue.js +1 -1
  29. package/components/Screen/ScreenFilter.vue.js +1 -1
  30. package/components/ToastNotification.vue.js +1 -1
  31. package/components/ToastNotification.vue2.js +3 -3
  32. package/components/index.d.ts +1 -1
  33. package/composables/useKeyStroke.d.ts +18 -0
  34. package/composables/useKeyStroke.js +103 -77
  35. package/composables/useTheme.js +1 -1
  36. package/index.d.ts +1 -0
  37. package/index.js +235 -233
  38. package/package.json +10 -3
  39. package/style.css +1 -1
  40. package/utils/environment.d.ts +29 -0
  41. package/utils/environment.js +4 -0
  42. package/utils/functions.js +14 -13
  43. /package/components/Dropdown/{DropdownMenu.vue2.js → DropdownMenu.vue3.js} +0 -0
@@ -1,42 +1,51 @@
1
- import { defineComponent as mn, ref as k, computed as $, watch as he, onMounted as xn, onUnmounted as wn, openBlock as v, createElementBlock as g, createElementVNode as u, createStaticVNode as bn, createCommentVNode as m, normalizeStyle as R, Fragment as C, renderList as z, normalizeClass as ke, toDisplayString as M, unref as N, withDirectives as Dn, vShow as $n, withKeys as It, withModifiers as Mt, createBlock as In, Teleport as Mn, createTextVNode as Lt, nextTick as Ye } from "vue";
2
- import { CHART_COLORS as Ln, getColor as Sn, animateProgress as Cn } from "./utils.js";
3
- import { resolveGanttScheduleDependencyEdges as St, ganttDependencyEdgeKey as Tn, getGanttDependencyEdgeMidpoint as En, ganttDependencyTypeLabel as Ct, getGanttDependencyEdgeScrollDelta as Tt, getGanttDependencyConnectorPosition as Wn, validateGanttDependencyLink as Qe, describeGanttDependencyLinkValidation as Je, findGanttDependencyBarAtPoint as Rn } from "./GanttChartDependencyUtils.js";
4
- import { parseGanttDate as me, ganttAddDays as An, ganttStartOfWeek as Pn, ganttStartOfMonth as _n, ganttDateToX as Bn, ganttCalendarDaysBetween as Hn, ganttDaysToPx as zn, ganttPxToDays as Gn } from "./GanttChartDateUtils.js";
5
- import { ganttPreviewBarGeometry as Fn, computeGanttInteractionPreview as Xn } from "./GanttChartResizePreviewUtils.js";
6
- import { placeGanttTaskTooltip as qn, isGanttPointerNearConnector as On } from "./GanttChartTooltipUtils.js";
7
- const Vn = {
1
+ import { defineComponent as Wn, ref as m, computed as D, watch as me, onMounted as An, onUnmounted as En, openBlock as d, createElementBlock as v, createElementVNode as s, createCommentVNode as p, createStaticVNode as Rn, normalizeStyle as E, Fragment as C, renderList as z, normalizeClass as xe, toDisplayString as I, unref as X, withDirectives as Bn, vShow as Pn, withKeys as je, withModifiers as zt, createBlock as Hn, Teleport as _n, createTextVNode as Xt, nextTick as Ue } from "vue";
2
+ import { CHART_COLORS as zn, getColor as Xn, animateProgress as Gn } from "./utils.js";
3
+ import { resolveGanttScheduleDependencyEdges as Gt, ganttDependencyEdgeKey as qn, ganttDependencyTypeLabel as qt, getGanttDependencyEdgeScrollDelta as Ft, getGanttDependencyConnectorPosition as Fn, validateGanttDependencyLink as Je, describeGanttDependencyLinkValidation as Qe, findGanttDependencyBarAtPoint as Yn } from "./GanttChartDependencyUtils.js";
4
+ import { routeGanttDependencyConnectors as On, ganttConnectorPreviewPath as Vn, ganttConnectorArrowPath as Kn } from "./GanttChartConnectorRouting.js";
5
+ import { parseGanttDate as we, ganttAddDays as Nn, ganttStartOfWeek as Zn, ganttStartOfMonth as jn, ganttDateToX as Un, ganttCalendarDaysBetween as Jn, ganttDaysToPx as Qn, ganttPxToDays as eo } from "./GanttChartDateUtils.js";
6
+ import { ganttPreviewBarGeometry as to, computeGanttInteractionPreview as no } from "./GanttChartResizePreviewUtils.js";
7
+ import { placeGanttTaskTooltip as oo, isGanttPointerNearConnector as ao } from "./GanttChartTooltipUtils.js";
8
+ const lo = {
8
9
  key: 0,
9
10
  class: "vlite-gantt-toolbar"
10
- }, Kn = {
11
+ }, ro = {
11
12
  key: 0,
13
+ class: "vlite-gantt-legend-blocked",
14
+ role: "note",
15
+ "aria-label": "Legend: blocked task"
16
+ }, so = {
17
+ key: 1,
12
18
  class: "vlite-gantt-zoom-controls"
13
- }, Zn = ["disabled"], Nn = ["disabled"], jn = { class: "vlite-gantt-wrapper" }, Un = ["onClick"], Yn = { class: "text-xs font-bold text-foreground uppercase tracking-wide" }, Qn = { class: "vlite-gantt-group-count" }, Jn = ["onClick"], eo = { class: "truncate text-xs font-medium text-foreground" }, to = {
19
+ }, io = ["disabled"], uo = ["disabled"], co = { class: "vlite-gantt-wrapper" }, vo = ["onClick"], fo = { class: "text-xs font-bold text-foreground uppercase tracking-wide" }, go = { class: "vlite-gantt-group-count" }, yo = ["onClick"], po = { class: "truncate text-xs font-medium text-foreground" }, ho = {
14
20
  key: 0,
15
21
  class: "vlite-gantt-progress-badge"
16
- }, no = ["width", "height"], oo = ["x1", "x2", "y2"], ao = ["x", "y"], lo = ["x", "y"], ro = ["width", "height"], so = ["id"], io = ["stop-color"], uo = ["stop-color"], co = ["id"], vo = ["stop-color"], fo = ["stop-color"], go = ["x1", "x2", "y2"], yo = ["y1", "x2", "y2"], po = ["y", "width", "height"], ho = ["d", "onClick"], ko = ["d", "stroke", "stroke-width", "stroke-opacity"], mo = ["d", "fill", "fill-opacity"], xo = ["transform", "aria-label", "onKeydown"], wo = ["onMouseenter"], bo = ["d", "fill", "stroke", "opacity", "onMouseenter", "onMousemove", "onClick"], Do = ["d", "fill"], $o = ["d", "fill"], Io = ["d", "fill"], Mo = ["x", "y", "width", "height", "onMouseenter", "onMousemove", "onMousedown", "onClick"], Lo = ["x", "y", "width", "height", "rx", "ry"], So = ["x", "y", "height"], Co = ["x", "y", "height"], To = ["x", "y", "fill", "opacity"], Eo = ["transform", "aria-label", "onPointerdown", "onKeydown", "onFocus", "onMouseenter"], Wo = {
22
+ }, ko = ["width", "height"], mo = ["x1", "x2", "y2"], xo = ["x", "y"], wo = ["x", "y"], bo = ["width", "height"], Do = ["id"], Io = ["stop-color"], $o = ["stop-color"], Mo = ["id"], So = ["stop-color"], Lo = ["stop-color"], Co = ["id"], To = ["x1", "x2", "y2"], Wo = ["y1", "x2", "y2"], Ao = ["y", "width", "height"], Eo = ["aria-label"], Ro = ["d", "tabindex", "onClick", "onKeydown", "onMouseenter", "onFocus"], Bo = ["d", "stroke", "stroke-width", "stroke-opacity"], Po = ["d", "fill", "fill-opacity"], Ho = ["transform", "aria-label", "onKeydown"], _o = ["onMouseenter"], zo = ["d", "fill", "stroke", "opacity", "onMouseenter", "onMousemove", "onClick"], Xo = ["d", "fill"], Go = ["d", "fill"], qo = ["d", "fill"], Fo = ["d", "fill"], Yo = ["d"], Oo = ["transform"], Vo = ["x", "y", "width", "height", "onMouseenter", "onMousemove", "onMousedown", "onClick"], Ko = ["x", "y", "width", "height", "rx", "ry"], No = ["x", "y", "height"], Zo = ["x", "y", "height"], jo = ["data-name", "x", "y", "fill", "opacity"], Uo = ["transform", "aria-label", "onPointerdown", "onKeydown", "onFocus", "onMouseenter"], Jo = {
17
23
  key: 3,
18
24
  class: "pointer-events-none"
19
- }, Ro = ["x", "y", "width", "height", "rx", "stroke", "stroke-dasharray"], Ao = ["x", "y", "fill"], Po = {
25
+ }, Qo = ["x", "y", "width", "height", "rx", "stroke", "stroke-dasharray"], ea = ["x", "y", "fill"], ta = {
20
26
  key: 2,
21
27
  class: "vlite-gantt-link-preview pointer-events-none"
22
- }, _o = ["x1", "y1", "x2", "y2", "stroke", "stroke-dasharray", "stroke-opacity"], Bo = ["cx", "cy", "fill", "fill-opacity"], Ho = { key: 3 }, zo = ["x1", "x2", "y2", "stroke"], Go = ["cx", "fill"], Fo = ["x", "fill"], Xo = {
28
+ }, na = ["x1", "y1", "x2", "y2", "stroke", "stroke-dasharray", "stroke-opacity"], oa = ["cx", "cy", "fill", "fill-opacity"], aa = { key: 3 }, la = ["x1", "x2", "y2", "stroke"], ra = ["cx", "fill"], sa = ["x", "fill"], ia = {
23
29
  class: "sr-only",
24
30
  role: "status",
25
31
  "aria-live": "polite",
26
32
  "aria-atomic": "true"
27
- }, qo = { class: "font-semibold text-xs mb-1.5" }, Oo = { class: "flex items-center gap-1.5 text-[11px] text-muted-foreground mb-1" }, Vo = { class: "text-[10px] text-muted-foreground" }, Ko = {
33
+ }, ua = { class: "font-semibold text-xs mb-1.5" }, ca = { class: "flex items-center gap-1.5 text-[11px] text-muted-foreground mb-1" }, da = { class: "text-[10px] text-muted-foreground" }, va = {
28
34
  key: 0,
29
35
  class: "mt-1.5 flex items-center gap-2"
30
- }, Zo = { class: "vlite-gantt-tooltip-progress-track" }, No = { class: "text-[10px] font-semibold" }, jo = {
36
+ }, fa = { class: "vlite-gantt-tooltip-progress-track" }, ga = { class: "text-[10px] font-semibold" }, ya = {
31
37
  key: 1,
32
- class: "text-[10px] text-muted-foreground mt-1 opacity-60"
33
- }, Uo = {
38
+ class: "vlite-gantt-tooltip-blocked mt-1.5"
39
+ }, pa = {
34
40
  key: 2,
35
- class: "text-[9px] text-muted-foreground mt-1.5 opacity-40"
36
- }, Yo = {
41
+ class: "text-[10px] text-muted-foreground mt-1 opacity-60"
42
+ }, ha = {
37
43
  key: 3,
44
+ class: "text-[9px] text-muted-foreground mt-1.5 opacity-40"
45
+ }, ka = {
46
+ key: 4,
38
47
  class: "text-[9px] text-muted-foreground mt-1 opacity-40"
39
- }, Qo = 16, Ae = 5, Jo = 4, et = "#eab308", Et = 8, ea = 7, sa = /* @__PURE__ */ mn({
48
+ }, et = "#eab308", Yt = 8, ma = 7, Ot = 6.5, xa = 10, La = /* @__PURE__ */ Wn({
40
49
  __name: "GanttChart",
41
50
  props: {
42
51
  tasks: {},
@@ -54,7 +63,7 @@ const Vn = {
54
63
  showTodayLine: { type: Boolean, default: !0 },
55
64
  showHeader: { type: Boolean, default: !0 },
56
65
  animate: { type: Boolean, default: !0 },
57
- colors: { default: () => Ln },
66
+ colors: { default: () => zn },
58
67
  todayColor: { default: "var(--color-danger)" },
59
68
  locale: { default: "en-US" },
60
69
  draggable: { type: Boolean, default: !0 },
@@ -63,274 +72,304 @@ const Vn = {
63
72
  zoom: { type: Boolean, default: !0 }
64
73
  },
65
74
  emits: ["task-click", "task-hover", "task-update", "dependency-create", "dependency-delete"],
66
- setup(d, { emit: Wt }) {
67
- const i = d, X = Wt;
75
+ setup(c, { emit: Vt }) {
76
+ const u = c, J = Vt;
68
77
  function tt(e) {
69
- return me(e);
78
+ return we(e);
70
79
  }
71
80
  function nt(e, n) {
72
- return Hn(e, n);
81
+ return Jn(e, n);
73
82
  }
74
- function B(e, n) {
75
- return An(e, n);
83
+ function O(e, n) {
84
+ return Nn(e, n);
76
85
  }
77
- function Rt(e) {
78
- return Pn(e);
86
+ function Kt(e) {
87
+ return Zn(e);
79
88
  }
80
- function At(e) {
81
- return _n(e);
89
+ function Nt(e) {
90
+ return jn(e);
82
91
  }
83
- const xe = k(), A = k(), le = k(800);
92
+ const be = m(), R = m(), re = m(800);
84
93
  let Pe = null;
85
- function Pt() {
86
- xe.value && (Pe = new ResizeObserver((e) => {
94
+ function Zt() {
95
+ be.value && (Pe = new ResizeObserver((e) => {
87
96
  const n = Math.round(e[0].contentRect.width || 800);
88
- Math.abs(le.value - n) > 0.5 && (le.value = n);
89
- }), Pe.observe(xe.value), le.value = Math.round(xe.value.clientWidth || 800));
97
+ Math.abs(re.value - n) > 0.5 && (re.value = n);
98
+ }), Pe.observe(be.value), re.value = Math.round(be.value.clientWidth || 800));
90
99
  }
91
- const w = $(
92
- () => i.tasks.map((e, n) => ({
100
+ const x = D(
101
+ () => u.tasks.map((e, n) => ({
93
102
  ...e,
94
103
  _start: tt(e.start),
95
104
  _end: tt(e.end),
96
- _color: e.color ?? Sn(i.colors, n),
105
+ _color: e.color ?? Xn(u.colors, n),
97
106
  _index: n
98
107
  }))
99
- ), we = k(/* @__PURE__ */ new Set());
100
- function _t(e) {
101
- const n = new Set(we.value);
102
- n.has(e) ? n.delete(e) : n.add(e), we.value = n;
108
+ ), ot = D(() => x.value.some((e) => e.blocked)), De = m(/* @__PURE__ */ new Set());
109
+ function jt(e) {
110
+ const n = new Set(De.value);
111
+ n.has(e) ? n.delete(e) : n.add(e), De.value = n;
103
112
  }
104
- const _e = $(() => {
113
+ const He = D(() => {
105
114
  const e = /* @__PURE__ */ new Map(), n = [];
106
- for (const t of w.value)
115
+ for (const t of x.value)
107
116
  t.group ? (e.has(t.group) || e.set(t.group, []), e.get(t.group).push(t)) : n.push(t);
108
117
  return { grouped: e, ungrouped: n };
109
- }), re = $(() => {
118
+ }), se = D(() => {
110
119
  const e = [];
111
- for (const [n, t] of _e.value.grouped)
112
- if (e.push({ type: "group-header", group: n }), !we.value.has(n)) for (const o of t) e.push({ type: "task", group: n, task: o });
113
- for (const n of _e.value.ungrouped) e.push({ type: "task", task: n });
120
+ for (const [n, t] of He.value.grouped)
121
+ if (e.push({ type: "group-header", group: n }), !De.value.has(n)) for (const o of t) e.push({ type: "task", group: n, task: o });
122
+ for (const n of He.value.ungrouped) e.push({ type: "task", task: n });
114
123
  return e;
115
- }), be = $(() => {
116
- if (!w.value.length) {
117
- const s = me(/* @__PURE__ */ new Date());
118
- return { start: B(s, -7), end: B(s, 30) };
124
+ }), Ie = D(() => {
125
+ if (!x.value.length) {
126
+ const l = we(/* @__PURE__ */ new Date());
127
+ return { start: O(l, -7), end: O(l, 30) };
119
128
  }
120
- let e = w.value[0]._start, n = w.value[0]._end;
121
- for (const s of w.value)
122
- s._start < e && (e = s._start), s._end > n && (n = s._end);
123
- const t = i.viewMode === "day" ? 2 : i.viewMode === "week" ? 5 : 15;
124
- let o = B(e, -t), a = B(n, t);
125
- return i.viewMode === "week" ? o = Rt(o) : i.viewMode === "month" ? o = At(o) : o = me(o), { start: o, end: a };
126
- }), D = k(1);
127
- let j = null;
128
- function Bt(e) {
129
- if (i.zoom && (e.ctrlKey || e.metaKey)) {
129
+ let e = x.value[0]._start, n = x.value[0]._end;
130
+ for (const l of x.value)
131
+ l._start < e && (e = l._start), l._end > n && (n = l._end);
132
+ const t = u.viewMode === "day" ? 2 : u.viewMode === "week" ? 5 : 15;
133
+ let o = O(e, -t), a = O(n, t);
134
+ return u.viewMode === "week" ? o = Kt(o) : u.viewMode === "month" ? o = Nt(o) : o = we(o), { start: o, end: a };
135
+ }), $ = m(1);
136
+ let Q = null;
137
+ function Ut(e) {
138
+ if (u.zoom && (e.ctrlKey || e.metaKey)) {
130
139
  e.preventDefault();
131
- const n = A.value;
140
+ const n = R.value;
132
141
  if (!n) return;
133
- const t = n.getBoundingClientRect(), o = e.clientX - t.left, s = (j !== null ? j : n.scrollLeft) + o, c = D.value;
134
- let f = c * Math.exp(-e.deltaY * 5e-3);
135
- if (f = Math.max(0.2, Math.min(f, 5)), f === c) return;
136
- D.value = f;
137
- const y = f / c;
138
- j = s * y - o, Ye(() => {
139
- A.value && j !== null && (A.value.scrollLeft = j, j = null);
142
+ const t = n.getBoundingClientRect(), o = e.clientX - t.left, l = (Q !== null ? Q : n.scrollLeft) + o, f = $.value;
143
+ let g = f * Math.exp(-e.deltaY * 5e-3);
144
+ if (g = Math.max(0.2, Math.min(g, 5)), g === f) return;
145
+ $.value = g;
146
+ const k = g / f;
147
+ Q = l * k - o, Ue(() => {
148
+ R.value && Q !== null && (R.value.scrollLeft = Q, Q = null);
140
149
  });
141
150
  }
142
151
  }
143
- function Ht() {
144
- const e = A.value;
152
+ function Jt() {
153
+ const e = R.value;
145
154
  if (!e) {
146
- D.value = Math.min(D.value + 0.2, 5);
155
+ $.value = Math.min($.value + 0.2, 5);
147
156
  return;
148
157
  }
149
- const n = e.clientWidth / 2, t = e.scrollLeft + n, o = D.value;
150
- D.value = Math.min(o + 0.2, 5);
151
- const a = D.value / o;
152
- Ye(() => e.scrollLeft = t * a - n);
158
+ const n = e.clientWidth / 2, t = e.scrollLeft + n, o = $.value;
159
+ $.value = Math.min(o + 0.2, 5);
160
+ const a = $.value / o;
161
+ Ue(() => e.scrollLeft = t * a - n);
153
162
  }
154
- function zt() {
155
- const e = A.value;
163
+ function Qt() {
164
+ const e = R.value;
156
165
  if (!e) {
157
- D.value = Math.max(D.value - 0.2, 0.2);
166
+ $.value = Math.max($.value - 0.2, 0.2);
158
167
  return;
159
168
  }
160
- const n = e.clientWidth / 2, t = e.scrollLeft + n, o = D.value;
161
- D.value = Math.max(o - 0.2, 0.2);
162
- const a = D.value / o;
163
- Ye(() => e.scrollLeft = t * a - n);
169
+ const n = e.clientWidth / 2, t = e.scrollLeft + n, o = $.value;
170
+ $.value = Math.max(o - 0.2, 0.2);
171
+ const a = $.value / o;
172
+ Ue(() => e.scrollLeft = t * a - n);
164
173
  }
165
- const Be = $(() => {
166
- const e = [], { start: n, end: t } = be.value;
174
+ const _e = D(() => {
175
+ const e = [], { start: n, end: t } = Ie.value;
167
176
  let o = new Date(n);
168
- if (i.viewMode === "day")
177
+ if (u.viewMode === "day")
169
178
  for (; o <= t; )
170
- e.push(o), o = B(o, 1);
171
- else if (i.viewMode === "week")
179
+ e.push(o), o = O(o, 1);
180
+ else if (u.viewMode === "week")
172
181
  for (; o <= t; )
173
- e.push(o), o = B(o, 7);
182
+ e.push(o), o = O(o, 7);
174
183
  else
175
184
  for (; o <= t; )
176
185
  e.push(o), o = new Date(o.getFullYear(), o.getMonth() + 1, 1);
177
186
  return e;
178
- }), se = $(() => {
179
- let n = { day: 40, week: 120, month: 180 }[i.viewMode] * D.value;
180
- const t = Math.max(0, le.value - i.sidebarWidth), o = Be.value.length;
187
+ }), ie = D(() => {
188
+ let n = { day: 40, week: 120, month: 180 }[u.viewMode] * $.value;
189
+ const t = Math.max(0, re.value - u.sidebarWidth), o = _e.value.length;
181
190
  return o > 0 && n * o < t && (n = t / o), n;
182
- }), ot = $(() => {
183
- const e = se.value;
184
- return Be.value.map((n, t) => {
191
+ }), at = D(() => {
192
+ const e = ie.value;
193
+ return _e.value.map((n, t) => {
185
194
  let o = "", a = "";
186
- return i.viewMode === "day" ? (o = n.toLocaleDateString(i.locale, { day: "numeric" }), a = n.toLocaleDateString(i.locale, { weekday: "short" })) : i.viewMode === "week" ? (o = n.toLocaleDateString(i.locale, { month: "short", day: "numeric" }), a = `W${Gt(n)}`) : (o = n.toLocaleDateString(i.locale, { month: "long" }), a = String(n.getFullYear())), { label: o, sublabel: a, x: t * e, width: e };
195
+ return u.viewMode === "day" ? (o = n.toLocaleDateString(u.locale, { day: "numeric" }), a = n.toLocaleDateString(u.locale, { weekday: "short" })) : u.viewMode === "week" ? (o = n.toLocaleDateString(u.locale, { month: "short", day: "numeric" }), a = `W${en(n)}`) : (o = n.toLocaleDateString(u.locale, { month: "long" }), a = String(n.getFullYear())), { label: o, sublabel: a, x: t * e, width: e };
187
196
  });
188
197
  });
189
- function Gt(e) {
198
+ function en(e) {
190
199
  const n = new Date(e.getTime());
191
200
  n.setHours(0, 0, 0, 0), n.setDate(n.getDate() + 3 - (n.getDay() + 6) % 7);
192
201
  const t = new Date(n.getFullYear(), 0, 4);
193
202
  return 1 + Math.round(((n.getTime() - t.getTime()) / 864e5 - 3 + (t.getDay() + 6) % 7) / 7);
194
203
  }
195
- const ie = $(() => Be.value.length * se.value), U = $(() => i.showHeader ? 56 : 0), ue = $(() => {
196
- const e = re.value.length * i.rowHeight;
197
- return Math.max(i.height || e, e);
204
+ const ee = D(() => _e.value.length * ie.value), te = D(() => u.showHeader ? 56 : 0), ne = D(() => {
205
+ const e = se.value.length * u.rowHeight;
206
+ return Math.max(u.height || e, e);
198
207
  });
199
- function De(e) {
200
- return Bn(e, be.value.start, i.viewMode, se.value);
208
+ function $e(e) {
209
+ return Un(e, Ie.value.start, u.viewMode, ie.value);
201
210
  }
202
- function Ft(e) {
203
- return Gn(e, i.viewMode, se.value);
211
+ function tn(e) {
212
+ return eo(e, u.viewMode, ie.value);
204
213
  }
205
- function Xt(e) {
206
- return zn(e, i.viewMode, se.value);
214
+ function nn(e) {
215
+ return Qn(e, u.viewMode, ie.value);
207
216
  }
208
- const b = $(() => {
209
- const e = We.value;
210
- return re.value.reduce((n, t, o) => {
217
+ const w = D(() => {
218
+ const e = Re.value;
219
+ return se.value.reduce((n, t, o) => {
211
220
  if (t.type !== "task" || !t.task) return n;
212
- const a = t.task, s = De(a._start), c = De(a._end), f = Math.max(8, c - s), y = f * e, x = o * i.rowHeight + (i.rowHeight - i.barHeight) / 2, W = a.progress != null ? f * Math.min(100, a.progress) / 100 * e : 0;
213
- return n.push({ task: a, x: s, y: x, fullW: f, w: y, progressW: W, rowIndex: o }), n;
221
+ const a = t.task, l = $e(a._start), f = $e(a._end), g = Math.max(8, f - l), k = g * e, b = o * u.rowHeight + (u.rowHeight - u.barHeight) / 2, A = a.progress != null ? g * Math.min(100, a.progress) / 100 * e : 0;
222
+ return n.push({ task: a, x: l, y: b, fullW: g, w: k, progressW: A, rowIndex: o }), n;
214
223
  }, []);
215
- }), He = $(() => {
216
- if (!i.showDependencies) return [];
224
+ }), lt = D(() => {
217
225
  const e = /* @__PURE__ */ new Map();
218
- for (const t of b.value) e.set(t.task.id, t);
219
- const n = [];
220
- for (const t of St(w.value)) {
221
- const o = e.get(t.predecessorId), a = e.get(t.successorId);
222
- if (!o || !a) continue;
223
- const s = o.x + o.fullW, c = o.y + i.barHeight / 2, f = a.x, y = a.y + i.barHeight / 2, x = En(s, c, f, y);
224
- n.push({
225
- key: Tn(t.predecessorId, t.successorId),
226
- predecessorId: t.predecessorId,
227
- successorId: t.successorId,
228
- d: Zt(s, c, f, y),
229
- ad: Nt(f, y),
230
- midX: x.x,
231
- midY: x.y
226
+ for (const n of w.value) e.set(n.task.id, n);
227
+ return e;
228
+ }), V = D(() => {
229
+ if (!u.showDependencies) return [];
230
+ const e = /* @__PURE__ */ new Map();
231
+ for (const t of w.value)
232
+ e.set(t.task.id, {
233
+ id: t.task.id,
234
+ x: t.x,
235
+ y: t.y,
236
+ w: t.fullW,
237
+ h: u.barHeight,
238
+ row: t.rowIndex,
239
+ milestone: t.task.milestone
232
240
  });
241
+ const n = Gt(x.value).map((t) => ({
242
+ predecessorId: t.predecessorId,
243
+ successorId: t.successorId,
244
+ key: qn(t.predecessorId, t.successorId)
245
+ }));
246
+ return On(n, e, {
247
+ rowHeight: u.rowHeight,
248
+ barHeight: u.barHeight,
249
+ chartWidth: ee.value,
250
+ chartHeight: ne.value,
251
+ cornerRadius: 5
252
+ });
253
+ }), G = m(null);
254
+ function rt(e) {
255
+ i.active || r.active || h.value || (G.value = e);
256
+ }
257
+ function st() {
258
+ G.value = null;
259
+ }
260
+ const it = /* @__PURE__ */ new Map();
261
+ function on(e, n) {
262
+ it.set(n, e ?? null);
263
+ }
264
+ function ut(e, n, t) {
265
+ const o = it.get(e);
266
+ if (!o) return;
267
+ const a = o.querySelector('[data-dep-part="hit"]');
268
+ a && a.setAttribute("d", n);
269
+ const l = o.querySelector('[data-dep-part="line"]');
270
+ l && l.setAttribute("d", n);
271
+ const f = o.querySelector('[data-dep-part="arrow"]');
272
+ f && f.setAttribute("d", t);
273
+ }
274
+ function ct(e) {
275
+ if (!u.showDependencies || !V.value.length) return;
276
+ const n = u.barHeight * 0.4;
277
+ for (const t of V.value) {
278
+ const o = e.get(t.predecessorId), a = e.get(t.successorId);
279
+ if (!o && !a) continue;
280
+ const l = lt.value.get(t.predecessorId), f = lt.value.get(t.successorId);
281
+ if (!l || !f) continue;
282
+ const g = (o?.geo?.x ?? l.x) + (o?.dx ?? 0), k = o?.geo?.fullW ?? l.fullW, b = (a?.geo?.x ?? f.x) + (a?.dx ?? 0), A = a?.geo?.fullW ?? f.fullW, pe = l.task.milestone ? g + k / 2 + n : g + k, he = l.y + u.barHeight / 2, ae = f.task.milestone ? b + A / 2 - n : b, le = f.y + u.barHeight / 2;
283
+ ut(
284
+ t.key,
285
+ Vn(pe, he, ae, le, u.rowHeight, u.barHeight),
286
+ Kn(ae, le)
287
+ );
233
288
  }
234
- return n;
235
- }), S = k(null), ce = $(() => S.value ? He.value.find((e) => e.key === S.value) ?? null : null), qt = $(() => {
236
- const e = ce.value;
289
+ }
290
+ function ze() {
291
+ for (const e of V.value)
292
+ ut(e.key, e.d, e.ad);
293
+ }
294
+ const L = m(null), ue = D(() => L.value ? V.value.find((e) => e.key === L.value) ?? null : null), an = D(() => {
295
+ const e = ue.value;
237
296
  if (!e) return "Delete dependency";
238
- const n = w.value.find((o) => o.id === e.predecessorId)?.name ?? e.predecessorId, t = w.value.find((o) => o.id === e.successorId)?.name ?? e.successorId;
297
+ const n = x.value.find((o) => o.id === e.predecessorId)?.name ?? e.predecessorId, t = x.value.find((o) => o.id === e.successorId)?.name ?? e.successorId;
239
298
  return `Delete dependency from ${n} to ${t}`;
299
+ }), dt = D(() => {
300
+ const e = /* @__PURE__ */ new Map();
301
+ for (const n of x.value) e.set(n.id, n.name);
302
+ return e;
240
303
  });
241
- function Y(e) {
242
- return S.value === e;
304
+ function vt(e) {
305
+ const n = dt.value.get(e.predecessorId) ?? e.predecessorId, t = dt.value.get(e.successorId) ?? e.successorId;
306
+ return `${t} is waiting on ${n} · ${n} is blocking ${t}`;
307
+ }
308
+ function K(e) {
309
+ return L.value === e;
243
310
  }
244
- function de(e = !1) {
245
- S.value && (S.value = null, e && E("Dependency deselected"));
311
+ function ce(e = !1) {
312
+ L.value && (L.value = null, e && W("Dependency deselected"));
246
313
  }
247
- function Ot(e, n) {
248
- if (!i.editableDependencies || l.active || r.active) return;
249
- e.preventDefault(), e.stopPropagation(), S.value = n.key;
250
- const t = w.value.find((a) => a.id === n.predecessorId), o = w.value.find((a) => a.id === n.successorId);
251
- E(
314
+ function ft(e, n) {
315
+ if (!u.editableDependencies || r.active || i.active) return;
316
+ e.preventDefault(), e.stopPropagation(), L.value = n.key;
317
+ const t = x.value.find((a) => a.id === n.predecessorId), o = x.value.find((a) => a.id === n.successorId);
318
+ W(
252
319
  `Dependency selected from ${t?.name ?? n.predecessorId} to ${o?.name ?? n.successorId}. Press Delete to remove, or Escape to deselect.`
253
320
  );
254
321
  }
255
- function Vt(e) {
256
- e.preventDefault(), e.stopPropagation(), $e();
322
+ function ln(e) {
323
+ e.preventDefault(), e.stopPropagation(), Me();
257
324
  }
258
- function $e() {
259
- const e = ce.value;
260
- if (!e || !i.editableDependencies) return;
261
- const n = w.value.find((a) => a.id === e.predecessorId), t = w.value.find((a) => a.id === e.successorId);
325
+ function Me() {
326
+ const e = ue.value;
327
+ if (!e || !u.editableDependencies) return;
328
+ const n = x.value.find((a) => a.id === e.predecessorId), t = x.value.find((a) => a.id === e.successorId);
262
329
  if (!n || !t) {
263
- de();
330
+ ce();
264
331
  return;
265
332
  }
266
333
  const o = {
267
334
  predecessorId: e.predecessorId,
268
335
  successorId: e.successorId,
269
- predecessor: Te(n),
270
- successor: Te(t),
336
+ predecessor: Ae(n),
337
+ successor: Ae(t),
271
338
  type: "waiting-on",
272
- typeLabel: Ct("waiting-on")
339
+ typeLabel: qt("waiting-on")
273
340
  };
274
- S.value = null, E(`Dependency removed from ${n.name} to ${t.name}`), X("dependency-delete", o);
341
+ L.value = null, W(`Dependency removed from ${n.name} to ${t.name}`), J("dependency-delete", o);
275
342
  }
276
- function Kt(e) {
277
- !S.value || e.target?.closest?.(".vlite-gantt-dep-group, .vlite-gantt-dep-delete, .vlite-gantt-dep-connector") || de();
343
+ function rn(e) {
344
+ !L.value || e.target?.closest?.(".vlite-gantt-dep-group, .vlite-gantt-dep-delete, .vlite-gantt-dep-connector") || ce();
278
345
  }
279
- function ze(e) {
280
- if (!(!S.value || l.active || h.value)) {
346
+ function Xe(e) {
347
+ if (!(!L.value || r.active || h.value)) {
281
348
  if (e.key === "Escape") {
282
- e.preventDefault(), de(!0);
349
+ e.preventDefault(), ce(!0);
283
350
  return;
284
351
  }
285
352
  if (e.key === "Delete" || e.key === "Backspace") {
286
353
  const n = e.target?.tagName;
287
354
  if (n === "INPUT" || n === "TEXTAREA" || e.target?.isContentEditable) return;
288
- e.preventDefault(), $e();
355
+ e.preventDefault(), Me();
289
356
  }
290
357
  }
291
358
  }
292
- he(S, (e, n) => {
293
- e && !n && document.addEventListener("keydown", ze), !e && n && document.removeEventListener("keydown", ze);
359
+ me(L, (e, n) => {
360
+ e && !n && document.addEventListener("keydown", Xe), !e && n && document.removeEventListener("keydown", Xe);
294
361
  });
295
- function Zt(e, n, t, o) {
296
- const a = Qo, s = Jo;
297
- if (t > e + a * 2) {
298
- if (Math.abs(n - o) < 2) return `M ${e} ${n} L ${t} ${o}`;
299
- const f = e + (t - e) / 2;
300
- return Ge([[e, n], [f, n], [f, o], [t, o]], s);
301
- }
302
- const c = e + a;
303
- if (Math.abs(n - o) < i.rowHeight * 0.5) {
304
- const f = Math.max(n, o) + i.barHeight / 2 + a;
305
- return Ge([[e, n], [c, n], [c, f], [t - a, f], [t - a, o], [t, o]], s);
306
- }
307
- return Ge([[e, n], [c, n], [c, o], [t, o]], s);
308
- }
309
- function Ge(e, n) {
310
- if (e.length < 2) return "";
311
- if (e.length === 2) return `M ${e[0][0]} ${e[0][1]} L ${e[1][0]} ${e[1][1]}`;
312
- const t = [`M ${e[0][0]} ${e[0][1]}`];
313
- for (let a = 1; a < e.length - 1; a++) {
314
- const [s, c] = e[a - 1], [f, y] = e[a], [x, W] = e[a + 1], te = f - s, ne = y - c, oe = x - f, ae = W - y, Z = Math.hypot(te, ne), Ue = Math.hypot(oe, ae), Re = Math.min(n, Z / 2, Ue / 2);
315
- t.push(`L ${f - te / Z * Re} ${y - ne / Z * Re}`), t.push(`Q ${f} ${y} ${f + oe / Ue * Re} ${y + ae / Ue * Re}`);
316
- }
317
- const o = e[e.length - 1];
318
- return t.push(`L ${o[0]} ${o[1]}`), t.join(" ");
319
- }
320
- function Nt(e, n) {
321
- return `M ${e} ${n} L ${e - Ae} ${n - Ae * 0.6} L ${e - Ae} ${n + Ae * 0.6} Z`;
322
- }
323
- const ve = $(() => {
324
- const e = me(/* @__PURE__ */ new Date());
325
- return De(e);
326
- }), Ie = $(() => {
327
- const e = me(/* @__PURE__ */ new Date());
328
- return e >= be.value.start && e <= be.value.end;
362
+ const de = D(() => {
363
+ const e = we(/* @__PURE__ */ new Date());
364
+ return $e(e);
365
+ }), Se = D(() => {
366
+ const e = we(/* @__PURE__ */ new Date());
367
+ return e >= Ie.value.start && e <= Ie.value.end;
329
368
  });
330
- function jt() {
331
- !A.value || !Ie.value || A.value.scrollTo({ left: Math.max(0, ve.value - (le.value - i.sidebarWidth) / 2), behavior: "smooth" });
369
+ function sn() {
370
+ !R.value || !Se.value || R.value.scrollTo({ left: Math.max(0, de.value - (re.value - u.sidebarWidth) / 2), behavior: "smooth" });
332
371
  }
333
- let r = {
372
+ let i = {
334
373
  active: !1,
335
374
  barIndex: -1,
336
375
  taskId: "",
@@ -342,7 +381,7 @@ const Vn = {
342
381
  affectedIds: /* @__PURE__ */ new Set(),
343
382
  // cascade set
344
383
  rafId: 0
345
- }, l = {
384
+ }, r = {
346
385
  active: !1,
347
386
  sourceId: "",
348
387
  sourceIndex: -1,
@@ -355,221 +394,230 @@ const Vn = {
355
394
  keyboard: !1,
356
395
  keyboardTargetIndex: -1
357
396
  };
358
- const P = k(!1), q = k(""), G = k(null), Me = k(null), fe = k("default"), h = k(!1), Q = k(""), ge = k(null), L = k("none"), T = k(null), Fe = k(""), Le = k(null), I = k(!1), O = k([]), H = k(null);
359
- function Ut(e, n) {
360
- O.value[n] = e;
397
+ const B = m(!1), N = m(""), q = m(null), Le = m(null), ve = m("default"), h = m(!1), oe = m(""), fe = m(null), S = m("none"), T = m(null), Ge = m(""), Ce = m(null), M = m(!1), Z = m([]), _ = m(null);
398
+ function un(e, n) {
399
+ Z.value[n] = e;
361
400
  }
362
- function Yt(e) {
401
+ function cn(e) {
363
402
  const n = /* @__PURE__ */ new Set();
364
- if (!i.cascadeDependencies) return n;
365
- const t = St(w.value), o = [e];
403
+ if (!u.cascadeDependencies) return n;
404
+ const t = Gt(x.value), o = [e];
366
405
  for (; o.length; ) {
367
406
  const a = o.shift();
368
- for (const s of t)
369
- s.predecessorId === a && !n.has(s.successorId) && (n.add(s.successorId), o.push(s.successorId));
407
+ for (const l of t)
408
+ l.predecessorId === a && !n.has(l.successorId) && (n.add(l.successorId), o.push(l.successorId));
370
409
  }
371
410
  return n;
372
411
  }
373
- function at(e, n) {
374
- if (!i.draggable || n.task.milestone) return "move";
412
+ function gt(e, n) {
413
+ if (!u.draggable || n.task.milestone) return "move";
375
414
  const t = e.currentTarget.closest("svg");
376
415
  if (!t) return "move";
377
416
  const o = e.clientX - t.getBoundingClientRect().left;
378
- return o < n.x + Et ? "resize-left" : o > n.x + n.fullW - Et ? "resize-right" : "move";
417
+ return o < n.x + Yt ? "resize-left" : o > n.x + n.fullW - Yt ? "resize-right" : "move";
379
418
  }
380
- function Qt(e, n) {
381
- if (!i.draggable || l.active || h.value) return;
382
- const t = b.value[n];
419
+ function dn(e, n) {
420
+ if (!u.draggable || r.active || h.value) return;
421
+ const t = w.value[n];
383
422
  if (!t || t.task.milestone) return;
384
423
  e.preventDefault(), e.stopPropagation();
385
- const o = at(e, t);
386
- r.active = !0, r.barIndex = n, r.taskId = t.task.id, r.mode = o, r.startMouseX = e.clientX, r.pxDelta = 0, r.origStart = new Date(t.task._start), r.origEnd = new Date(t.task._end), r.affectedIds = o === "move" ? Yt(t.task.id) : /* @__PURE__ */ new Set(), P.value = !0, q.value = t.task.id, p.value = null, I.value = !1, _.value = n, ye = "", document.addEventListener("mousemove", rt), document.addEventListener("mouseup", yt), document.addEventListener("pointercancel", it), document.addEventListener("keydown", st), document.body.style.cursor = o === "move" ? "grabbing" : "ew-resize", document.body.style.userSelect = "none", E(
424
+ const o = gt(e, t);
425
+ i.active = !0, i.barIndex = n, i.taskId = t.task.id, i.mode = o, i.startMouseX = e.clientX, i.pxDelta = 0, i.origStart = new Date(t.task._start), i.origEnd = new Date(t.task._end), i.affectedIds = o === "move" ? cn(t.task.id) : /* @__PURE__ */ new Set(), B.value = !0, N.value = t.task.id, y.value = null, M.value = !1, G.value = null, H.value = n, ge = "", document.addEventListener("mousemove", pt), document.addEventListener("mouseup", $t), document.addEventListener("pointercancel", kt), document.addEventListener("keydown", ht), document.body.style.cursor = o === "move" ? "grabbing" : "ew-resize", document.body.style.userSelect = "none", W(
387
426
  o === "move" ? `Moving ${t.task.name}` : `Resizing ${t.task.name}. Preview dates update as you drag.`
388
427
  );
389
428
  }
390
- function lt() {
391
- if (!r.origStart || !r.origEnd) return null;
392
- const e = nt(r.origStart, r.origEnd);
393
- return Xn({
394
- mode: r.mode,
395
- pxDelta: r.pxDelta,
396
- origStart: r.origStart,
397
- origEnd: r.origEnd,
429
+ function yt() {
430
+ if (!i.origStart || !i.origEnd) return null;
431
+ const e = nt(i.origStart, i.origEnd);
432
+ return no({
433
+ mode: i.mode,
434
+ pxDelta: i.pxDelta,
435
+ origStart: i.origStart,
436
+ origEnd: i.origEnd,
398
437
  origDurationDays: e,
399
- pxToDays: Ft,
400
- daysToPx: Xt,
401
- addDays: B
438
+ pxToDays: tn,
439
+ daysToPx: nn,
440
+ addDays: O
402
441
  });
403
442
  }
404
- function rt(e) {
405
- if (!r.active) return;
406
- r.pxDelta = e.clientX - r.startMouseX;
407
- const n = A.value;
443
+ function pt(e) {
444
+ if (!i.active) return;
445
+ i.pxDelta = e.clientX - i.startMouseX;
446
+ const n = R.value;
408
447
  if (n) {
409
- const t = n.getBoundingClientRect(), { dx: o, dy: a } = Tt(e.clientX, e.clientY, {
448
+ const t = n.getBoundingClientRect(), { dx: o, dy: a } = Ft(e.clientX, e.clientY, {
410
449
  left: t.left,
411
450
  top: t.top,
412
451
  right: t.right,
413
452
  bottom: t.bottom
414
453
  });
415
- (o || a) && (n.scrollLeft += o, n.scrollTop += a, K.value && (K.value.scrollTop = n.scrollTop));
454
+ (o || a) && (n.scrollLeft += o, n.scrollTop += a, U.value && (U.value.scrollTop = n.scrollTop));
455
+ }
456
+ cancelAnimationFrame(i.rafId), i.rafId = requestAnimationFrame(vn);
457
+ }
458
+ function ht(e) {
459
+ i.active && e.key === "Escape" && (e.preventDefault(), We(i.mode === "move" ? "Move cancelled" : "Resize cancelled"));
460
+ }
461
+ function kt() {
462
+ We(i.mode === "move" ? "Move cancelled" : "Resize cancelled");
463
+ }
464
+ function mt(e, n) {
465
+ const { x: t, y: o, fullW: a, progressW: l } = n, f = u.barHeight, g = u.barRadius, k = e.querySelector('[data-gantt-part="bg"]');
466
+ k && k.setAttribute("d", P(t, o, a, f, g));
467
+ const b = e.querySelector('[data-gantt-part="progress"]');
468
+ b && (l > 0 ? (b.setAttribute("d", P(t, o, Math.min(l, a), f, g)), b.style.display = "") : b.style.display = "none");
469
+ const A = e.querySelector('[data-gantt-part="fill"]');
470
+ A && A.setAttribute("d", P(t, o, a, f, g));
471
+ const pe = e.querySelector('[data-gantt-part="hitbox"]');
472
+ pe && (pe.setAttribute("x", String(t)), pe.setAttribute("width", String(a)));
473
+ const he = e.querySelector('[data-gantt-part="highlight"]');
474
+ he && (he.setAttribute("x", String(t)), he.setAttribute("width", String(a)));
475
+ const ae = e.querySelector('[data-gantt-part="handle-left"]');
476
+ ae && (ae.setAttribute("x", String(t)), ae.style.display = "");
477
+ const le = e.querySelector('[data-gantt-part="handle-right"]');
478
+ le && (le.setAttribute("x", String(t + a - 4)), le.style.display = "");
479
+ const Pt = e.querySelector('[data-gantt-part="blocked-hatch"]');
480
+ Pt && Pt.setAttribute("d", P(t, o, a, f, g));
481
+ const Ht = e.querySelector('[data-gantt-part="blocked-outline"]');
482
+ Ht && Ht.setAttribute("d", P(t, o, a, f, g));
483
+ const Be = e.querySelector('[data-gantt-part="blocked-lock"]');
484
+ Be && Be.setAttribute("transform", `translate(${t + 10}, ${o + f / 2})`);
485
+ const ke = e.querySelector('[data-gantt-part="label"]');
486
+ if (ke) {
487
+ ke.setAttribute("x", String(t + (Be ? 24 : 12))), ke.style.display = a > 60 ? "" : "none";
488
+ const _t = ke.getAttribute("data-name");
489
+ _t && (ke.textContent = Et(_t, a, !!Be));
416
490
  }
417
- cancelAnimationFrame(r.rafId), r.rafId = requestAnimationFrame(Jt);
418
- }
419
- function st(e) {
420
- r.active && e.key === "Escape" && (e.preventDefault(), Ce(r.mode === "move" ? "Move cancelled" : "Resize cancelled"));
421
- }
422
- function it() {
423
- Ce(r.mode === "move" ? "Move cancelled" : "Resize cancelled");
424
- }
425
- function ut(e, n) {
426
- const { x: t, y: o, fullW: a, progressW: s } = n, c = i.barHeight, f = i.barRadius, y = e.querySelector('[data-gantt-part="bg"]');
427
- y && y.setAttribute("d", J(t, o, a, c, f));
428
- const x = e.querySelector('[data-gantt-part="progress"]');
429
- x && (s > 0 ? (x.setAttribute("d", J(t, o, Math.min(s, a), c, f)), x.style.display = "") : x.style.display = "none");
430
- const W = e.querySelector('[data-gantt-part="fill"]');
431
- W && W.setAttribute("d", J(t, o, a, c, f));
432
- const te = e.querySelector('[data-gantt-part="hitbox"]');
433
- te && (te.setAttribute("x", String(t)), te.setAttribute("width", String(a)));
434
- const ne = e.querySelector('[data-gantt-part="highlight"]');
435
- ne && (ne.setAttribute("x", String(t)), ne.setAttribute("width", String(a)));
436
- const oe = e.querySelector('[data-gantt-part="handle-left"]');
437
- oe && (oe.setAttribute("x", String(t)), oe.style.display = "");
438
- const ae = e.querySelector('[data-gantt-part="handle-right"]');
439
- ae && (ae.setAttribute("x", String(t + a - 4)), ae.style.display = "");
440
- const Z = e.querySelector('[data-gantt-part="label"]');
441
- Z && (Z.setAttribute("x", String(t + 12)), Z.style.display = a > 60 ? "" : "none");
442
491
  }
443
- function ct(e) {
444
- const n = b.value[e], t = O.value[e];
492
+ function xt(e) {
493
+ const n = w.value[e], t = Z.value[e];
445
494
  if (!n || !t || n.task.milestone) return;
446
495
  t.style.transform = "", t.removeAttribute("data-resize-px");
447
496
  const o = n.task.progress != null ? n.fullW * Math.min(100, n.task.progress) / 100 : 0;
448
- ut(t, {
497
+ mt(t, {
449
498
  x: n.x,
450
499
  y: n.y,
451
500
  fullW: n.fullW,
452
501
  progressW: o
453
502
  });
454
503
  }
455
- const dt = { month: "short", day: "numeric", year: "numeric" };
456
- function Se(e, n) {
457
- return `${e.toLocaleDateString(i.locale, dt)} — ${n.toLocaleDateString(i.locale, dt)}`;
458
- }
459
- function vt(e, n, t, o, a) {
460
- if (!H.value) return;
461
- const s = Se(e, n), c = t + a / 2, f = o - 22, y = Math.max(148, s.length * 6.2);
462
- H.value.style.display = "";
463
- const x = H.value.querySelector("rect"), W = H.value.querySelector("text");
464
- x && (x.setAttribute("x", String(c - y / 2)), x.setAttribute("y", String(f - 8)), x.setAttribute("width", String(y))), W && (W.setAttribute("x", String(c)), W.setAttribute("y", String(f + 2)), W.textContent = s);
465
- }
466
- let ye = "";
467
- function ft(e) {
468
- e !== ye && (ye = e, E(e));
469
- }
470
- function Jt() {
471
- const e = b.value[r.barIndex], n = O.value[r.barIndex];
472
- if (!e || !n || !r.origStart || !r.origEnd) return;
473
- const t = lt();
504
+ const wt = { month: "short", day: "numeric", year: "numeric" };
505
+ function Te(e, n) {
506
+ return `${e.toLocaleDateString(u.locale, wt)} — ${n.toLocaleDateString(u.locale, wt)}`;
507
+ }
508
+ function bt(e, n, t, o, a) {
509
+ if (!_.value) return;
510
+ const l = Te(e, n), f = t + a / 2, g = o - 22, k = Math.max(148, l.length * 6.2);
511
+ _.value.style.display = "";
512
+ const b = _.value.querySelector("rect"), A = _.value.querySelector("text");
513
+ b && (b.setAttribute("x", String(f - k / 2)), b.setAttribute("y", String(g - 8)), b.setAttribute("width", String(k))), A && (A.setAttribute("x", String(f)), A.setAttribute("y", String(g + 2)), A.textContent = l);
514
+ }
515
+ let ge = "";
516
+ function Dt(e) {
517
+ e !== ge && (ge = e, W(e));
518
+ }
519
+ function vn() {
520
+ const e = w.value[i.barIndex], n = Z.value[i.barIndex];
521
+ if (!e || !n || !i.origStart || !i.origEnd) return;
522
+ const t = yt();
474
523
  if (!t) return;
475
- if (r.mode === "move") {
476
- const s = t.clampedPxDelta;
477
- if (n.style.transform = `translateX(${s}px)`, r.affectedIds.size > 0) {
478
- for (let c = 0; c < b.value.length; c++)
479
- if (r.affectedIds.has(b.value[c].task.id)) {
480
- const f = O.value[c];
481
- f && (f.style.transform = `translateX(${s}px)`);
524
+ if (i.mode === "move") {
525
+ const l = t.clampedPxDelta;
526
+ if (n.style.transform = `translateX(${l}px)`, i.affectedIds.size > 0) {
527
+ for (let g = 0; g < w.value.length; g++)
528
+ if (i.affectedIds.has(w.value[g].task.id)) {
529
+ const k = Z.value[g];
530
+ k && (k.style.transform = `translateX(${l}px)`);
482
531
  }
483
532
  }
484
- vt(
533
+ const f = /* @__PURE__ */ new Map([[e.task.id, { dx: l }]]);
534
+ for (const g of i.affectedIds) f.set(g, { dx: l });
535
+ ct(f), bt(
485
536
  t.start,
486
537
  t.end,
487
- e.x + s,
538
+ e.x + l,
488
539
  e.y,
489
540
  e.fullW
490
- ), ft(`${e.task.name}: ${Se(t.start, t.end)}`);
541
+ ), Dt(`${e.task.name}: ${Te(t.start, t.end)}`);
491
542
  return;
492
543
  }
493
544
  n.style.transform = "";
494
- const o = Fn({
545
+ const o = to({
495
546
  start: t.start,
496
547
  end: t.end,
497
- dateToX: De
548
+ dateToX: $e
498
549
  }), a = e.fullW > 0 ? e.progressW / e.fullW : 0;
499
- ut(n, {
550
+ mt(n, {
500
551
  x: o.x,
501
552
  y: e.y,
502
553
  fullW: o.fullW,
503
554
  progressW: o.fullW * a
504
- }), vt(t.start, t.end, o.x, e.y, o.fullW), ft(`${e.task.name}: ${Se(t.start, t.end)}`);
555
+ }), ct(/* @__PURE__ */ new Map([[e.task.id, { geo: { x: o.x, fullW: o.fullW } }]])), bt(t.start, t.end, o.x, e.y, o.fullW), Dt(`${e.task.name}: ${Te(t.start, t.end)}`);
505
556
  }
506
- function gt() {
507
- document.removeEventListener("mousemove", rt), document.removeEventListener("mouseup", yt), document.removeEventListener("pointercancel", it), document.removeEventListener("keydown", st), document.body.style.cursor = "", document.body.style.userSelect = "", cancelAnimationFrame(r.rafId);
557
+ function It() {
558
+ document.removeEventListener("mousemove", pt), document.removeEventListener("mouseup", $t), document.removeEventListener("pointercancel", kt), document.removeEventListener("keydown", ht), document.body.style.cursor = "", document.body.style.userSelect = "", cancelAnimationFrame(i.rafId);
508
559
  }
509
- function Ce(e) {
510
- if (!r.active) return;
511
- gt();
512
- const n = r.barIndex;
513
- if (r.mode === "move")
514
- for (const t of O.value)
560
+ function We(e) {
561
+ if (!i.active) return;
562
+ It();
563
+ const n = i.barIndex;
564
+ if (i.mode === "move")
565
+ for (const t of Z.value)
515
566
  t && (t.style.transform = "", t.removeAttribute("data-resize-px"));
516
- else n >= 0 && ct(n);
517
- H.value && (H.value.style.display = "none"), r.active = !1, r.barIndex = -1, r.taskId = "", r.pxDelta = 0, r.origStart = null, r.origEnd = null, r.affectedIds.clear(), P.value = !1, q.value = "", _.value = null, ye = "", e && E(e);
518
- }
519
- function yt() {
520
- if (!r.active) return;
521
- const e = lt(), n = r.mode, t = r.taskId, o = new Set(r.affectedIds), a = r.barIndex;
522
- if (gt(), !!e && Math.abs(e.snappedDays) > 0.1 && e) {
523
- const c = w.value.find((f) => f.id === t);
524
- if (c && (X("task-update", c, { start: e.start, end: e.end }), E(`Updated ${c.name} to ${Se(e.start, e.end)}`), n === "move" && o.size > 0))
525
- for (const f of o) {
526
- const y = w.value.find((x) => x.id === f);
527
- y && X("task-update", y, {
528
- start: B(y._start, e.snappedDays),
529
- end: B(y._end, e.snappedDays)
530
- });
531
- }
532
- if (n === "move")
533
- for (const f of O.value)
567
+ else n >= 0 && xt(n);
568
+ ze(), _.value && (_.value.style.display = "none"), i.active = !1, i.barIndex = -1, i.taskId = "", i.pxDelta = 0, i.origStart = null, i.origEnd = null, i.affectedIds.clear(), B.value = !1, N.value = "", H.value = null, ge = "", e && W(e);
569
+ }
570
+ function $t() {
571
+ if (!i.active) return;
572
+ const e = yt(), n = i.mode, t = i.taskId, o = i.barIndex;
573
+ if (It(), !!e && Math.abs(e.snappedDays) > 0.1 && e) {
574
+ const l = x.value.find((f) => f.id === t);
575
+ if (l && (J("task-update", l, { start: e.start, end: e.end }), W(`Updated ${l.name} to ${Te(e.start, e.end)}`)), n === "move") {
576
+ for (const f of Z.value)
534
577
  f && (f.style.transform = "", f.removeAttribute("data-resize-px"));
535
- } else if (n === "move")
536
- for (const c of O.value)
537
- c && (c.style.transform = "", c.removeAttribute("data-resize-px"));
538
- else a >= 0 && ct(a);
539
- H.value && (H.value.style.display = "none"), r.active = !1, r.barIndex = -1, r.taskId = "", r.pxDelta = 0, r.origStart = null, r.origEnd = null, r.affectedIds.clear(), P.value = !1, q.value = "", _.value = null, ye = "";
540
- }
541
- function Xe(e, n) {
542
- if (l.active || h.value) {
543
- fe.value = "crosshair";
578
+ ze();
579
+ }
580
+ } else {
581
+ if (n === "move")
582
+ for (const l of Z.value)
583
+ l && (l.style.transform = "", l.removeAttribute("data-resize-px"));
584
+ else o >= 0 && xt(o);
585
+ ze();
586
+ }
587
+ _.value && (_.value.style.display = "none"), i.active = !1, i.barIndex = -1, i.taskId = "", i.pxDelta = 0, i.origStart = null, i.origEnd = null, i.affectedIds.clear(), B.value = !1, N.value = "", H.value = null, ge = "";
588
+ }
589
+ function qe(e, n) {
590
+ if (r.active || h.value) {
591
+ ve.value = "crosshair";
544
592
  return;
545
593
  }
546
- if (r.active || !i.draggable || n.task.milestone) {
547
- fe.value = r.active ? "grabbing" : "pointer";
594
+ if (i.active || !u.draggable || n.task.milestone) {
595
+ ve.value = i.active ? "grabbing" : "pointer";
548
596
  return;
549
597
  }
550
- fe.value = at(e, n) === "move" ? "grab" : "ew-resize";
598
+ ve.value = gt(e, n) === "move" ? "grab" : "ew-resize";
551
599
  }
552
- function Te(e) {
553
- const { _start: n, _end: t, _color: o, _index: a, ...s } = e;
554
- return s;
600
+ function Ae(e) {
601
+ const { _start: n, _end: t, _color: o, _index: a, ...l } = e;
602
+ return l;
555
603
  }
556
- function qe(e, n) {
557
- const t = Le.value;
604
+ function Fe(e, n) {
605
+ const t = Ce.value;
558
606
  if (!t) return { x: 0, y: 0 };
559
607
  const o = t.getBoundingClientRect();
560
608
  return { x: e - o.left, y: n - o.top };
561
609
  }
562
610
  function F(e) {
563
- return Wn(
611
+ return Fn(
564
612
  { id: e.task.id, x: e.x, y: e.y, fullW: e.fullW, milestone: e.task.milestone },
565
- i.barHeight
613
+ u.barHeight
566
614
  );
567
615
  }
568
- function en(e) {
569
- return !i.editableDependencies || r.active || P.value ? !1 : h.value && Q.value === b.value[e]?.task.id ? !0 : G.value === e || Me.value === e;
616
+ function fn(e) {
617
+ return !u.editableDependencies || i.active || B.value ? !1 : h.value && oe.value === w.value[e]?.task.id ? !0 : q.value === e || Le.value === e;
570
618
  }
571
- function tn() {
572
- return b.value.map((e) => ({
619
+ function gn() {
620
+ return w.value.map((e) => ({
573
621
  id: e.task.id,
574
622
  x: e.x,
575
623
  y: e.y,
@@ -577,13 +625,13 @@ const Vn = {
577
625
  milestone: e.task.milestone
578
626
  }));
579
627
  }
580
- function E(e) {
581
- Fe.value = "", requestAnimationFrame(() => {
582
- Fe.value = e;
628
+ function W(e) {
629
+ Ge.value = "", requestAnimationFrame(() => {
630
+ Ge.value = e;
583
631
  });
584
632
  }
585
- function pe() {
586
- const e = b.value.find((t) => t.task.id === l.sourceId);
633
+ function ye() {
634
+ const e = w.value.find((t) => t.task.id === r.sourceId);
587
635
  if (!e) {
588
636
  T.value = null;
589
637
  return;
@@ -592,178 +640,184 @@ const Vn = {
592
640
  T.value = {
593
641
  x1: n.cx,
594
642
  y1: n.cy,
595
- x2: l.pointerX,
596
- y2: l.pointerY
643
+ x2: r.pointerX,
644
+ y2: r.pointerY
597
645
  };
598
646
  }
599
647
  function Ee(e) {
600
- if (l.targetId = e, ge.value = e, !e || e === l.sourceId) {
601
- l.targetValid = !1, L.value = e ? "invalid" : "none";
648
+ if (r.targetId = e, fe.value = e, !e || e === r.sourceId) {
649
+ r.targetValid = !1, S.value = e ? "invalid" : "none";
602
650
  return;
603
651
  }
604
- const n = Qe(w.value, l.sourceId, e);
605
- l.targetValid = n.valid, L.value = n.valid ? "valid" : "invalid";
606
- }
607
- function Oe(e, n) {
608
- const t = qe(e, n);
609
- l.pointerX = t.x, l.pointerY = t.y;
610
- const o = Rn(tn(), t.x, t.y, i.barHeight), a = o && o.id !== l.sourceId ? o.id : o?.id === l.sourceId ? l.sourceId : null;
611
- Ee(a), pe();
612
- const s = A.value;
613
- if (s) {
614
- const c = s.getBoundingClientRect(), { dx: f, dy: y } = Tt(e, n, {
615
- left: c.left,
616
- top: c.top,
617
- right: c.right,
618
- bottom: c.bottom
652
+ const n = Je(x.value, r.sourceId, e);
653
+ r.targetValid = n.valid, S.value = n.valid ? "valid" : "invalid";
654
+ }
655
+ function Ye(e, n) {
656
+ const t = Fe(e, n);
657
+ r.pointerX = t.x, r.pointerY = t.y;
658
+ const o = Yn(gn(), t.x, t.y, u.barHeight), a = o && o.id !== r.sourceId ? o.id : o?.id === r.sourceId ? r.sourceId : null;
659
+ Ee(a), ye();
660
+ const l = R.value;
661
+ if (l) {
662
+ const f = l.getBoundingClientRect(), { dx: g, dy: k } = Ft(e, n, {
663
+ left: f.left,
664
+ top: f.top,
665
+ right: f.right,
666
+ bottom: f.bottom
619
667
  });
620
- (f || y) && (cancelAnimationFrame(l.scrollRafId), l.scrollRafId = requestAnimationFrame(() => {
621
- s.scrollLeft += f, s.scrollTop += y, K.value && (K.value.scrollTop = s.scrollTop);
622
- const x = qe(e, n);
623
- l.pointerX = x.x, l.pointerY = x.y, pe();
668
+ (g || k) && (cancelAnimationFrame(r.scrollRafId), r.scrollRafId = requestAnimationFrame(() => {
669
+ l.scrollLeft += g, l.scrollTop += k, U.value && (U.value.scrollTop = l.scrollTop);
670
+ const b = Fe(e, n);
671
+ r.pointerX = b.x, r.pointerY = b.y, ye();
624
672
  }));
625
673
  }
626
674
  }
627
- function pt() {
628
- document.removeEventListener("pointermove", mt), document.removeEventListener("pointerup", xt), document.removeEventListener("pointercancel", wt), document.removeEventListener("keydown", bt);
629
- }
630
- function V(e) {
631
- !l.active && !h.value || (pt(), cancelAnimationFrame(l.rafId), cancelAnimationFrame(l.scrollRafId), document.body.style.cursor = "", document.body.style.userSelect = "", l.active = !1, l.sourceId = "", l.sourceIndex = -1, l.targetId = null, l.targetValid = !1, l.keyboard = !1, l.keyboardTargetIndex = -1, h.value = !1, Q.value = "", ge.value = null, L.value = "none", T.value = null, I.value = !1, e && E(e));
632
- }
633
- function ht() {
634
- if (!l.active) return;
635
- const e = l.sourceId, n = l.targetId;
636
- if (!(l.targetValid && !!n) || !n) {
637
- V(
638
- n ? Je(
639
- Qe(w.value, e, n),
640
- w.value.find((c) => c.id === e)?.name ?? e,
641
- w.value.find((c) => c.id === n)?.name ?? n
675
+ function Mt() {
676
+ document.removeEventListener("pointermove", Ct), document.removeEventListener("pointerup", Tt), document.removeEventListener("pointercancel", Wt), document.removeEventListener("keydown", At);
677
+ }
678
+ function j(e) {
679
+ !r.active && !h.value || (Mt(), cancelAnimationFrame(r.rafId), cancelAnimationFrame(r.scrollRafId), document.body.style.cursor = "", document.body.style.userSelect = "", r.active = !1, r.sourceId = "", r.sourceIndex = -1, r.targetId = null, r.targetValid = !1, r.keyboard = !1, r.keyboardTargetIndex = -1, h.value = !1, oe.value = "", fe.value = null, S.value = "none", T.value = null, M.value = !1, e && W(e));
680
+ }
681
+ function St() {
682
+ if (!r.active) return;
683
+ const e = r.sourceId, n = r.targetId;
684
+ if (!(r.targetValid && !!n) || !n) {
685
+ j(
686
+ n ? Qe(
687
+ Je(x.value, e, n),
688
+ x.value.find((f) => f.id === e)?.name ?? e,
689
+ x.value.find((f) => f.id === n)?.name ?? n
642
690
  ) : "Dependency linking cancelled"
643
691
  );
644
692
  return;
645
693
  }
646
- const o = w.value.find((c) => c.id === e), a = w.value.find((c) => c.id === n);
694
+ const o = x.value.find((f) => f.id === e), a = x.value.find((f) => f.id === n);
647
695
  if (!o || !a) {
648
- V("Dependency linking cancelled");
696
+ j("Dependency linking cancelled");
649
697
  return;
650
698
  }
651
- const s = {
699
+ const l = {
652
700
  predecessorId: e,
653
701
  successorId: n,
654
- predecessor: Te(o),
655
- successor: Te(a),
702
+ predecessor: Ae(o),
703
+ successor: Ae(a),
656
704
  type: "waiting-on",
657
- typeLabel: Ct("waiting-on")
705
+ typeLabel: qt("waiting-on")
658
706
  };
659
- E(
660
- Je(
707
+ W(
708
+ Qe(
661
709
  { valid: !0 },
662
710
  o.name,
663
711
  a.name
664
712
  )
665
- ), pt(), cancelAnimationFrame(l.rafId), cancelAnimationFrame(l.scrollRafId), document.body.style.cursor = "", document.body.style.userSelect = "", l.active = !1, l.sourceId = "", l.sourceIndex = -1, l.targetId = null, l.targetValid = !1, l.keyboard = !1, l.keyboardTargetIndex = -1, h.value = !1, Q.value = "", ge.value = null, L.value = "none", T.value = null, I.value = !1, X("dependency-create", s);
713
+ ), Mt(), cancelAnimationFrame(r.rafId), cancelAnimationFrame(r.scrollRafId), document.body.style.cursor = "", document.body.style.userSelect = "", r.active = !1, r.sourceId = "", r.sourceIndex = -1, r.targetId = null, r.targetValid = !1, r.keyboard = !1, r.keyboardTargetIndex = -1, h.value = !1, oe.value = "", fe.value = null, S.value = "none", T.value = null, M.value = !1, J("dependency-create", l);
666
714
  }
667
- function kt(e, n, t, o = !1) {
668
- if (!i.editableDependencies || r.active || P.value) return;
669
- const a = b.value[e];
715
+ function Lt(e, n, t, o = !1) {
716
+ if (!u.editableDependencies || i.active || B.value) return;
717
+ const a = w.value[e];
670
718
  if (!a) return;
671
- de(), l.active = !0, l.sourceId = a.task.id, l.sourceIndex = e, l.keyboard = o, l.keyboardTargetIndex = -1, h.value = !0, Q.value = a.task.id, p.value = null, I.value = !0, _.value = e;
672
- const s = F(a);
673
- o ? (l.pointerX = s.cx + 40, l.pointerY = s.cy, Ee(null)) : Oe(n, t), pe(), E(`Linking from ${a.task.name}. Drop on a target task, or press Escape to cancel.`), document.addEventListener("pointermove", mt), document.addEventListener("pointerup", xt), document.addEventListener("pointercancel", wt), document.addEventListener("keydown", bt), document.body.style.cursor = "crosshair", document.body.style.userSelect = "none";
719
+ ce(), r.active = !0, r.sourceId = a.task.id, r.sourceIndex = e, r.keyboard = o, r.keyboardTargetIndex = -1, h.value = !0, oe.value = a.task.id, y.value = null, M.value = !0, G.value = null, H.value = e;
720
+ const l = F(a);
721
+ o ? (r.pointerX = l.cx + 40, r.pointerY = l.cy, Ee(null)) : Ye(n, t), ye(), W(`Linking from ${a.task.name}. Drop on a target task, or press Escape to cancel.`), document.addEventListener("pointermove", Ct), document.addEventListener("pointerup", Tt), document.addEventListener("pointercancel", Wt), document.addEventListener("keydown", At), document.body.style.cursor = "crosshair", document.body.style.userSelect = "none";
674
722
  }
675
- function mt(e) {
676
- !l.active || l.keyboard || (cancelAnimationFrame(l.rafId), l.rafId = requestAnimationFrame(() => Oe(e.clientX, e.clientY)));
723
+ function Ct(e) {
724
+ !r.active || r.keyboard || (cancelAnimationFrame(r.rafId), r.rafId = requestAnimationFrame(() => Ye(e.clientX, e.clientY)));
677
725
  }
678
- function xt(e) {
679
- !l.active || l.keyboard || (Oe(e.clientX, e.clientY), ht());
726
+ function Tt(e) {
727
+ !r.active || r.keyboard || (Ye(e.clientX, e.clientY), St());
680
728
  }
681
- function wt() {
682
- V("Dependency linking cancelled");
729
+ function Wt() {
730
+ j("Dependency linking cancelled");
683
731
  }
684
- function Ve(e) {
685
- const n = b.value;
732
+ function Oe(e) {
733
+ const n = w.value;
686
734
  if (!n.length) return;
687
- const t = n.map((y, x) => ({ b: y, i: x })).filter(({ b: y }) => y.task.id !== l.sourceId);
735
+ const t = n.map((k, b) => ({ b: k, i: b })).filter(({ b: k }) => k.task.id !== r.sourceId);
688
736
  if (!t.length) {
689
- Ee(null), pe();
737
+ Ee(null), ye();
690
738
  return;
691
739
  }
692
- let o = t.findIndex(({ b: y }) => y.task.id === l.targetId);
740
+ let o = t.findIndex(({ b: k }) => k.task.id === r.targetId);
693
741
  o < 0 && (o = e === 1 ? -1 : 0), o = (o + e + t.length) % t.length;
694
742
  const a = t[o];
695
- l.keyboardTargetIndex = a.i;
696
- const s = F(a.b);
697
- l.pointerX = a.b.task.milestone ? a.b.x + a.b.fullW / 2 : a.b.x, l.pointerY = s.cy, Ee(a.b.task.id), pe();
698
- const c = Qe(w.value, l.sourceId, a.b.task.id), f = w.value.find((y) => y.id === l.sourceId)?.name ?? l.sourceId;
699
- E(
700
- c.valid ? `Target ${a.b.task.name}. Press Enter to create dependency.` : Je(c, f, a.b.task.name)
743
+ r.keyboardTargetIndex = a.i;
744
+ const l = F(a.b);
745
+ r.pointerX = a.b.task.milestone ? a.b.x + a.b.fullW / 2 : a.b.x, r.pointerY = l.cy, Ee(a.b.task.id), ye();
746
+ const f = Je(x.value, r.sourceId, a.b.task.id), g = x.value.find((k) => k.id === r.sourceId)?.name ?? r.sourceId;
747
+ W(
748
+ f.valid ? `Target ${a.b.task.name}. Press Enter to create dependency.` : Qe(f, g, a.b.task.name)
701
749
  );
702
750
  }
703
- function bt(e) {
704
- if (l.active) {
751
+ function At(e) {
752
+ if (r.active) {
705
753
  if (e.key === "Escape") {
706
- e.preventDefault(), V("Dependency linking cancelled");
754
+ e.preventDefault(), j("Dependency linking cancelled");
707
755
  return;
708
756
  }
709
- l.keyboard && (e.key === "ArrowDown" || e.key === "ArrowRight" ? (e.preventDefault(), Ve(1)) : e.key === "ArrowUp" || e.key === "ArrowLeft" ? (e.preventDefault(), Ve(-1)) : (e.key === "Enter" || e.key === " ") && (e.preventDefault(), ht()));
757
+ r.keyboard && (e.key === "ArrowDown" || e.key === "ArrowRight" ? (e.preventDefault(), Oe(1)) : e.key === "ArrowUp" || e.key === "ArrowLeft" ? (e.preventDefault(), Oe(-1)) : (e.key === "Enter" || e.key === " ") && (e.preventDefault(), St()));
710
758
  }
711
759
  }
712
- function nn(e, n) {
713
- !i.editableDependencies || r.active || (e.preventDefault(), e.stopPropagation(), p.value = null, I.value = !0, kt(n, e.clientX, e.clientY, !1));
760
+ function yn(e, n) {
761
+ !u.editableDependencies || i.active || (e.preventDefault(), e.stopPropagation(), y.value = null, M.value = !0, Lt(n, e.clientX, e.clientY, !1));
714
762
  }
715
- function on(e, n) {
716
- if (!(!i.editableDependencies || r.active || h.value) && (e.key === "Enter" || e.key === " ")) {
763
+ function pn(e, n) {
764
+ if (!(!u.editableDependencies || i.active || h.value) && (e.key === "Enter" || e.key === " ")) {
717
765
  e.preventDefault(), e.stopPropagation();
718
- const t = b.value[n];
766
+ const t = w.value[n];
719
767
  if (!t) return;
720
- p.value = null;
721
- const o = F(t), s = Le.value?.getBoundingClientRect(), c = (s?.left ?? 0) + o.cx, f = (s?.top ?? 0) + o.cy;
722
- kt(n, c, f, !0), Ve(1);
768
+ y.value = null;
769
+ const o = F(t), l = Ce.value?.getBoundingClientRect(), f = (l?.left ?? 0) + o.cx, g = (l?.top ?? 0) + o.cy;
770
+ Lt(n, f, g, !0), Oe(1);
723
771
  }
724
772
  }
725
- function an(e) {
726
- Me.value = e, G.value = e, p.value = null;
727
- }
728
- function ln() {
729
- Me.value = null, I.value = !1, h.value || (G.value = null);
730
- }
731
- function rn(e) {
732
- return !h.value || Q.value === e ? "" : ge.value !== e ? "vlite-gantt-link-candidate" : L.value === "valid" ? "vlite-gantt-link-target-valid" : "vlite-gantt-link-target-invalid";
733
- }
734
- const We = k(i.animate ? 0 : 1);
735
- let Ke = null;
736
- function Ze() {
737
- Ke?.(), We.value = 0, Ke = Cn(900, (e) => We.value = e);
738
- }
739
- xn(() => {
740
- Pt(), i.animate && Ze();
741
- }), he(() => i.viewMode, () => {
742
- D.value = 1, i.animate && Ze();
743
- }), he(() => i.tasks.length, () => {
744
- i.animate && Ze();
745
- }), he(() => i.tasks, () => {
746
- r.active && (i.tasks.some((n) => n.id === r.taskId) || Ce(r.mode === "move" ? "Move cancelled because task was removed" : "Resize cancelled because task was removed")), (l.active || h.value) && V("Dependency linking cancelled because tasks changed"), S.value && !He.value.some((e) => e.key === S.value) && (S.value = null);
747
- }), he(() => i.editableDependencies, (e) => {
748
- e || ((l.active || h.value) && V("Dependency linking cancelled"), de());
749
- }), wn(() => {
750
- Ke?.(), Pe?.disconnect(), Ce(), document.removeEventListener("keydown", ze), V();
773
+ function hn(e) {
774
+ Le.value = e, q.value = e, y.value = null;
775
+ }
776
+ function kn() {
777
+ Le.value = null, M.value = !1, h.value || (q.value = null);
778
+ }
779
+ function mn(e) {
780
+ return !h.value || oe.value === e ? "" : fe.value !== e ? "vlite-gantt-link-candidate" : S.value === "valid" ? "vlite-gantt-link-target-valid" : "vlite-gantt-link-target-invalid";
781
+ }
782
+ const Re = m(u.animate ? 0 : 1);
783
+ let Ve = null;
784
+ function Ke() {
785
+ Ve?.(), Re.value = 0, Ve = Gn(900, (e) => Re.value = e);
786
+ }
787
+ An(() => {
788
+ Zt(), u.animate && Ke();
789
+ }), me(() => u.viewMode, () => {
790
+ $.value = 1, u.animate && Ke();
791
+ }), me(() => u.tasks.length, () => {
792
+ u.animate && Ke();
793
+ }), me(() => u.tasks, () => {
794
+ i.active && (u.tasks.some((n) => n.id === i.taskId) || We(i.mode === "move" ? "Move cancelled because task was removed" : "Resize cancelled because task was removed")), (r.active || h.value) && j("Dependency linking cancelled because tasks changed"), L.value && !V.value.some((e) => e.key === L.value) && (L.value = null), G.value && !V.value.some((e) => e.key === G.value) && (G.value = null);
795
+ }), me(() => u.editableDependencies, (e) => {
796
+ e || ((r.active || h.value) && j("Dependency linking cancelled"), ce());
797
+ }), En(() => {
798
+ Ve?.(), Pe?.disconnect(), We(), document.removeEventListener("keydown", Xe), j();
751
799
  });
752
- function J(e, n, t, o, a) {
753
- const s = Math.min(a, t / 2, o / 2);
754
- return s <= 0 || t <= 0 ? `M${e},${n}h${t}v${o}h${-t}Z` : `M${e + s},${n}h${t - 2 * s}q${s},0 ${s},${s}v${o - 2 * s}q0,${s} ${-s},${s}h${-(t - 2 * s)}q${-s},0 ${-s},${-s}v${-(o - 2 * s)}q0,${-s} ${s},${-s}Z`;
800
+ function Et(e, n, t) {
801
+ const o = n - (t ? 24 : 12) - xa;
802
+ if (o < Ot * 3) return "";
803
+ const a = Math.floor(o / Ot);
804
+ return e.length <= a ? e : `${e.slice(0, Math.max(1, a - 1)).trimEnd()}…`;
755
805
  }
756
- function sn(e, n, t) {
806
+ function P(e, n, t, o, a) {
807
+ const l = Math.min(a, t / 2, o / 2);
808
+ return l <= 0 || t <= 0 ? `M${e},${n}h${t}v${o}h${-t}Z` : `M${e + l},${n}h${t - 2 * l}q${l},0 ${l},${l}v${o - 2 * l}q0,${l} ${-l},${l}h${-(t - 2 * l)}q${-l},0 ${-l},${-l}v${-(o - 2 * l)}q0,${-l} ${l},${-l}Z`;
809
+ }
810
+ function xn(e, n, t) {
757
811
  return `M${e},${n - t}L${e + t},${n}L${e},${n + t}L${e - t},${n}Z`;
758
812
  }
759
- const p = k(null), _ = k(null);
760
- function un(e) {
813
+ const y = m(null), H = m(null);
814
+ function wn(e) {
761
815
  const n = e;
762
816
  return !n || typeof n.closest != "function" ? !1 : !!n.closest(".vlite-gantt-bar-group");
763
817
  }
764
- function cn(e) {
765
- if (!i.editableDependencies) return null;
766
- const n = Le.value;
818
+ function bn(e) {
819
+ if (!u.editableDependencies) return null;
820
+ const n = Ce.value;
767
821
  if (!n) return null;
768
822
  const t = n.getBoundingClientRect(), o = F(e), a = 14;
769
823
  return {
@@ -773,105 +827,127 @@ const Vn = {
773
827
  bottom: t.top + o.cy + a
774
828
  };
775
829
  }
776
- function dn(e, n, t) {
777
- if (!i.editableDependencies) return !1;
778
- if (I.value) return !0;
779
- const o = qe(e, n), a = F(t);
780
- return On(o.x, o.y, a.cx, a.cy);
830
+ function Dn(e, n, t) {
831
+ if (!u.editableDependencies) return !1;
832
+ if (M.value) return !0;
833
+ const o = Fe(e, n), a = F(t);
834
+ return ao(o.x, o.y, a.cx, a.cy);
781
835
  }
782
836
  function Ne(e, n) {
783
- if (!i.showTooltip || r.active || l.active || h.value) {
784
- p.value = null;
837
+ if (!u.showTooltip || i.active || r.active || h.value) {
838
+ y.value = null;
785
839
  return;
786
840
  }
787
- const t = b.value[n];
841
+ const t = w.value[n];
788
842
  if (!t) return;
789
- if (dn(e.clientX, e.clientY, t)) {
790
- p.value = null;
843
+ if (Dn(e.clientX, e.clientY, t)) {
844
+ y.value = null;
791
845
  return;
792
846
  }
793
- const o = t.task, a = qn({
847
+ const o = t.task, a = oo({
794
848
  pointerX: e.clientX,
795
849
  pointerY: e.clientY,
796
850
  viewportWidth: window.innerWidth,
797
851
  viewportHeight: window.innerHeight,
798
- avoid: cn(t)
852
+ avoid: bn(t)
799
853
  });
800
- p.value = {
854
+ y.value = {
801
855
  left: a.left,
802
856
  top: a.top,
803
857
  task: o,
804
- startStr: o._start.toLocaleDateString(i.locale, { month: "short", day: "numeric", year: "numeric" }),
805
- endStr: o._end.toLocaleDateString(i.locale, { month: "short", day: "numeric", year: "numeric" })
858
+ startStr: o._start.toLocaleDateString(u.locale, { month: "short", day: "numeric", year: "numeric" }),
859
+ endStr: o._end.toLocaleDateString(u.locale, { month: "short", day: "numeric", year: "numeric" })
806
860
  };
807
861
  }
808
- function vn(e = !0) {
809
- p.value = null, _.value = null, I.value = !1, Me.value == null && (G.value = null), fe.value = "default", e && X("task-hover", null);
862
+ function In(e = !0) {
863
+ y.value = null, H.value = null, M.value = !1, Le.value == null && (q.value = null), ve.value = "default", e && J("task-hover", null);
810
864
  }
811
- function fn(e, n) {
812
- if (r.active || l.active || h.value) return;
813
- G.value = n, _.value = n;
814
- const t = b.value[n];
865
+ function $n(e, n) {
866
+ if (i.active || r.active || h.value) return;
867
+ q.value = n, H.value = n;
868
+ const t = w.value[n];
815
869
  if (!t) return;
816
- X("task-hover", t.task), Xe(e, t);
870
+ J("task-hover", t.task), qe(e, t);
817
871
  const o = !!e.target?.closest?.(".vlite-gantt-dep-connector");
818
- I.value = o, o ? p.value = null : Ne(e, n);
819
- }
820
- function gn() {
821
- r.active || l.active || h.value || vn(!0);
822
- }
823
- function Dt(e, n) {
824
- if (r.active || l.active || h.value) return;
825
- I.value = !1, G.value = n, _.value = n;
826
- const t = b.value[n];
827
- t && (Xe(e, t), Ne(e, n));
828
- }
829
- function $t(e, n) {
830
- if (r.active || l.active || h.value) return;
831
- I.value = !1;
832
- const t = b.value[n];
833
- t && Xe(e, t), Ne(e, n);
834
- }
835
- function yn(e) {
836
- r.active || l.active || h.value || (I.value = !0, G.value = e, _.value = e, p.value = null);
837
- }
838
- function pn(e) {
839
- if (!(r.active || l.active || h.value)) {
840
- if (un(e.relatedTarget) && !e.relatedTarget?.closest?.(".vlite-gantt-dep-connector")) {
841
- I.value = !1;
872
+ M.value = o, o ? y.value = null : Ne(e, n);
873
+ }
874
+ function Mn() {
875
+ i.active || r.active || h.value || In(!0);
876
+ }
877
+ function Rt(e, n) {
878
+ if (i.active || r.active || h.value) return;
879
+ M.value = !1, q.value = n, H.value = n;
880
+ const t = w.value[n];
881
+ t && (qe(e, t), Ne(e, n));
882
+ }
883
+ function Bt(e, n) {
884
+ if (i.active || r.active || h.value) return;
885
+ M.value = !1;
886
+ const t = w.value[n];
887
+ t && qe(e, t), Ne(e, n);
888
+ }
889
+ function Sn(e) {
890
+ i.active || r.active || h.value || (M.value = !0, q.value = e, H.value = e, y.value = null);
891
+ }
892
+ function Ln(e) {
893
+ if (!(i.active || r.active || h.value)) {
894
+ if (wn(e.relatedTarget) && !e.relatedTarget?.closest?.(".vlite-gantt-dep-connector")) {
895
+ M.value = !1;
842
896
  return;
843
897
  }
844
- I.value = !1, p.value = null;
898
+ M.value = !1, y.value = null;
845
899
  }
846
900
  }
847
- function je(e) {
848
- !r.active && !l.active && X("task-click", e);
901
+ function Ze(e) {
902
+ !i.active && !r.active && J("task-click", e);
849
903
  }
850
- const K = k();
851
- function hn(e) {
852
- K.value && (K.value.scrollTop = e.target.scrollTop);
904
+ const U = m();
905
+ function Cn(e) {
906
+ U.value && (U.value.scrollTop = e.target.scrollTop);
853
907
  }
854
- const ee = Math.random().toString(36).slice(2, 7);
855
- function kn(e, n) {
908
+ const Y = Math.random().toString(36).slice(2, 7);
909
+ function Tn(e, n) {
856
910
  const t = Math.ceil(nt(e, n));
857
911
  if (t <= 1) return "1 day";
858
912
  if (t < 7) return `${t} days`;
859
913
  const o = Math.floor(t / 7), a = t % 7;
860
914
  return a === 0 ? `${o} week${o > 1 ? "s" : ""}` : `${o}w ${a}d`;
861
915
  }
862
- return (e, n) => (v(), g("div", {
916
+ return (e, n) => (d(), v("div", {
863
917
  ref_key: "containerRef",
864
- ref: xe,
918
+ ref: be,
865
919
  class: "vlite-gantt-chart w-full select-none"
866
920
  }, [
867
- d.showTodayLine && Ie.value || d.zoom ? (v(), g("div", Vn, [
868
- d.zoom ? (v(), g("div", Kn, [
869
- u("button", {
921
+ c.showTodayLine && Se.value || c.zoom || ot.value ? (d(), v("div", lo, [
922
+ ot.value ? (d(), v("span", ro, [...n[1] || (n[1] = [
923
+ s("svg", {
924
+ width: "12",
925
+ height: "12",
926
+ viewBox: "0 0 24 24",
927
+ fill: "none",
928
+ stroke: "currentColor",
929
+ "stroke-width": "2",
930
+ "stroke-linecap": "round",
931
+ "stroke-linejoin": "round"
932
+ }, [
933
+ s("rect", {
934
+ x: "5",
935
+ y: "11",
936
+ width: "14",
937
+ height: "9",
938
+ rx: "2"
939
+ }),
940
+ s("path", { d: "M8 11V8a4 4 0 0 1 8 0v3" })
941
+ ], -1),
942
+ s("span", null, "Blocked", -1)
943
+ ])])) : p("", !0),
944
+ c.zoom ? (d(), v("div", so, [
945
+ s("button", {
870
946
  class: "vlite-gantt-btn",
871
- onClick: zt,
872
- disabled: D.value <= 0.4
873
- }, [...n[1] || (n[1] = [
874
- u("svg", {
947
+ onClick: Qt,
948
+ disabled: $.value <= 0.4
949
+ }, [...n[2] || (n[2] = [
950
+ s("svg", {
875
951
  width: "12",
876
952
  height: "12",
877
953
  viewBox: "0 0 24 24",
@@ -881,40 +957,40 @@ const Vn = {
881
957
  "stroke-linecap": "round",
882
958
  "stroke-linejoin": "round"
883
959
  }, [
884
- u("circle", {
960
+ s("circle", {
885
961
  cx: "11",
886
962
  cy: "11",
887
963
  r: "8"
888
964
  }),
889
- u("line", {
965
+ s("line", {
890
966
  x1: "21",
891
967
  y1: "21",
892
968
  x2: "16.65",
893
969
  y2: "16.65"
894
970
  }),
895
- u("line", {
971
+ s("line", {
896
972
  x1: "8",
897
973
  y1: "11",
898
974
  x2: "14",
899
975
  y2: "11"
900
976
  })
901
977
  ], -1),
902
- u("span", null, "Zoom Out", -1)
903
- ])], 8, Zn),
904
- u("button", {
978
+ s("span", null, "Zoom Out", -1)
979
+ ])], 8, io),
980
+ s("button", {
905
981
  class: "vlite-gantt-btn",
906
- onClick: Ht,
907
- disabled: D.value >= 3
908
- }, [...n[2] || (n[2] = [
909
- bn('<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" data-v-d83427d6><circle cx="11" cy="11" r="8" data-v-d83427d6></circle><line x1="21" y1="21" x2="16.65" y2="16.65" data-v-d83427d6></line><line x1="11" y1="8" x2="11" y2="14" data-v-d83427d6></line><line x1="8" y1="11" x2="14" y2="11" data-v-d83427d6></line></svg><span data-v-d83427d6>Zoom In</span>', 2)
910
- ])], 8, Nn)
911
- ])) : m("", !0),
912
- d.showTodayLine && Ie.value ? (v(), g("button", {
913
- key: 1,
982
+ onClick: Jt,
983
+ disabled: $.value >= 3
984
+ }, [...n[3] || (n[3] = [
985
+ Rn('<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" data-v-94a48eeb><circle cx="11" cy="11" r="8" data-v-94a48eeb></circle><line x1="21" y1="21" x2="16.65" y2="16.65" data-v-94a48eeb></line><line x1="11" y1="8" x2="11" y2="14" data-v-94a48eeb></line><line x1="8" y1="11" x2="14" y2="11" data-v-94a48eeb></line></svg><span data-v-94a48eeb>Zoom In</span>', 2)
986
+ ])], 8, uo)
987
+ ])) : p("", !0),
988
+ c.showTodayLine && Se.value ? (d(), v("button", {
989
+ key: 2,
914
990
  class: "vlite-gantt-btn",
915
- onClick: jt
916
- }, [...n[3] || (n[3] = [
917
- u("svg", {
991
+ onClick: sn
992
+ }, [...n[4] || (n[4] = [
993
+ s("svg", {
918
994
  width: "12",
919
995
  height: "12",
920
996
  viewBox: "0 0 24 24",
@@ -924,57 +1000,57 @@ const Vn = {
924
1000
  "stroke-linecap": "round",
925
1001
  "stroke-linejoin": "round"
926
1002
  }, [
927
- u("circle", {
1003
+ s("circle", {
928
1004
  cx: "12",
929
1005
  cy: "12",
930
1006
  r: "10"
931
1007
  }),
932
- u("line", {
1008
+ s("line", {
933
1009
  x1: "12",
934
1010
  y1: "8",
935
1011
  x2: "12",
936
1012
  y2: "12"
937
1013
  }),
938
- u("line", {
1014
+ s("line", {
939
1015
  x1: "12",
940
1016
  y1: "16",
941
1017
  x2: "12.01",
942
1018
  y2: "16"
943
1019
  })
944
1020
  ], -1),
945
- u("span", null, "Today", -1)
946
- ])])) : m("", !0)
947
- ])) : m("", !0),
948
- u("div", jn, [
949
- u("div", {
1021
+ s("span", null, "Today", -1)
1022
+ ])])) : p("", !0)
1023
+ ])) : p("", !0),
1024
+ s("div", co, [
1025
+ s("div", {
950
1026
  class: "vlite-gantt-sidebar",
951
- style: R({ width: `${d.sidebarWidth}px`, minWidth: `${d.sidebarWidth}px` })
1027
+ style: E({ width: `${c.sidebarWidth}px`, minWidth: `${c.sidebarWidth}px` })
952
1028
  }, [
953
- d.showHeader ? (v(), g("div", {
1029
+ c.showHeader ? (d(), v("div", {
954
1030
  key: 0,
955
1031
  class: "vlite-gantt-sidebar-header",
956
- style: R({ height: `${U.value}px` })
957
- }, [...n[4] || (n[4] = [
958
- u("span", { class: "text-xs font-semibold text-muted-foreground uppercase tracking-wider" }, "Tasks", -1)
959
- ])], 4)) : m("", !0),
960
- u("div", {
1032
+ style: E({ height: `${te.value}px` })
1033
+ }, [...n[5] || (n[5] = [
1034
+ s("span", { class: "text-xs font-semibold text-muted-foreground uppercase tracking-wider" }, "Tasks", -1)
1035
+ ])], 4)) : p("", !0),
1036
+ s("div", {
961
1037
  ref_key: "sidebarRef",
962
- ref: K,
1038
+ ref: U,
963
1039
  class: "vlite-gantt-sidebar-body",
964
- style: R({ height: `${ue.value}px` })
1040
+ style: E({ height: `${ne.value}px` })
965
1041
  }, [
966
- (v(!0), g(C, null, z(re.value, (t, o) => (v(), g("div", {
1042
+ (d(!0), v(C, null, z(se.value, (t, o) => (d(), v("div", {
967
1043
  key: `s-${o}`,
968
1044
  class: "vlite-gantt-sidebar-row",
969
- style: R({ height: `${d.rowHeight}px` })
1045
+ style: E({ height: `${c.rowHeight}px` })
970
1046
  }, [
971
- t.type === "group-header" ? (v(), g("button", {
1047
+ t.type === "group-header" ? (d(), v("button", {
972
1048
  key: 0,
973
1049
  class: "vlite-gantt-group-toggle",
974
- onClick: (a) => _t(t.group)
1050
+ onClick: (a) => jt(t.group)
975
1051
  }, [
976
- (v(), g("svg", {
977
- class: ke(["vlite-gantt-chevron", { "vlite-gantt-chevron-collapsed": we.value.has(t.group) }]),
1052
+ (d(), v("svg", {
1053
+ class: xe(["vlite-gantt-chevron", { "vlite-gantt-chevron-collapsed": De.value.has(t.group) }]),
978
1054
  width: "14",
979
1055
  height: "14",
980
1056
  viewBox: "0 0 24 24",
@@ -983,335 +1059,402 @@ const Vn = {
983
1059
  "stroke-width": "2.5",
984
1060
  "stroke-linecap": "round",
985
1061
  "stroke-linejoin": "round"
986
- }, [...n[5] || (n[5] = [
987
- u("polyline", { points: "6 9 12 15 18 9" }, null, -1)
1062
+ }, [...n[6] || (n[6] = [
1063
+ s("polyline", { points: "6 9 12 15 18 9" }, null, -1)
988
1064
  ])], 2)),
989
- u("span", Yn, M(t.group), 1),
990
- u("span", Qn, M(_e.value.grouped.get(t.group)?.length ?? 0), 1)
991
- ], 8, Un)) : (v(), g("div", {
1065
+ s("span", fo, I(t.group), 1),
1066
+ s("span", go, I(He.value.grouped.get(t.group)?.length ?? 0), 1)
1067
+ ], 8, vo)) : (d(), v("div", {
992
1068
  key: 1,
993
- class: ke(["vlite-gantt-task-name", {
1069
+ class: xe(["vlite-gantt-task-name", {
994
1070
  "vlite-gantt-task-name-grouped": !!t.group,
995
- "vlite-gantt-task-name-dragging": P.value && q.value === t.task?.id
1071
+ "vlite-gantt-task-name-dragging": B.value && N.value === t.task?.id
996
1072
  }]),
997
- onClick: (a) => t.task && je(t.task)
1073
+ onClick: (a) => t.task && Ze(t.task)
998
1074
  }, [
999
- u("span", {
1075
+ s("span", {
1000
1076
  class: "vlite-gantt-task-dot",
1001
- style: R({ backgroundColor: t.task?._color })
1077
+ style: E({ backgroundColor: t.task?._color })
1002
1078
  }, null, 4),
1003
- u("span", eo, M(t.task?.name), 1),
1004
- d.showProgress && t.task?.progress != null ? (v(), g("span", to, M(t.task.progress) + "%", 1)) : m("", !0)
1005
- ], 10, Jn))
1079
+ s("span", po, I(t.task?.name), 1),
1080
+ c.showProgress && t.task?.progress != null ? (d(), v("span", ho, I(t.task.progress) + "%", 1)) : p("", !0)
1081
+ ], 10, yo))
1006
1082
  ], 4))), 128))
1007
1083
  ], 4)
1008
1084
  ], 4),
1009
- u("div", {
1085
+ s("div", {
1010
1086
  ref_key: "timelineRef",
1011
- ref: A,
1087
+ ref: R,
1012
1088
  class: "vlite-gantt-timeline",
1013
- onScroll: hn,
1014
- onWheel: Bt
1089
+ onScroll: Cn,
1090
+ onWheel: Ut
1015
1091
  }, [
1016
- d.showHeader ? (v(), g("div", {
1092
+ c.showHeader ? (d(), v("div", {
1017
1093
  key: 0,
1018
1094
  class: "vlite-gantt-timeline-header",
1019
- style: R({ height: `${U.value}px`, width: `${ie.value}px` })
1095
+ style: E({ height: `${te.value}px`, width: `${ee.value}px` })
1020
1096
  }, [
1021
- (v(), g("svg", {
1022
- width: ie.value,
1023
- height: U.value,
1097
+ (d(), v("svg", {
1098
+ width: ee.value,
1099
+ height: te.value,
1024
1100
  class: "overflow-visible"
1025
1101
  }, [
1026
- (v(!0), g(C, null, z(ot.value, (t, o) => (v(), g("g", { key: o }, [
1027
- u("line", {
1102
+ (d(!0), v(C, null, z(at.value, (t, o) => (d(), v("g", { key: o }, [
1103
+ s("line", {
1028
1104
  x1: t.x,
1029
1105
  y1: 0,
1030
1106
  x2: t.x,
1031
- y2: U.value,
1107
+ y2: te.value,
1032
1108
  stroke: "currentColor",
1033
1109
  "stroke-opacity": "0.06"
1034
- }, null, 8, oo),
1035
- u("text", {
1110
+ }, null, 8, mo),
1111
+ s("text", {
1036
1112
  x: t.x + t.width / 2,
1037
- y: U.value / 2 - 5,
1113
+ y: te.value / 2 - 5,
1038
1114
  "text-anchor": "middle",
1039
1115
  "dominant-baseline": "middle",
1040
1116
  "font-size": "11",
1041
1117
  "font-weight": "600",
1042
1118
  class: "fill-foreground"
1043
- }, M(t.label), 9, ao),
1044
- t.sublabel ? (v(), g("text", {
1119
+ }, I(t.label), 9, xo),
1120
+ t.sublabel ? (d(), v("text", {
1045
1121
  key: 0,
1046
1122
  x: t.x + t.width / 2,
1047
- y: U.value / 2 + 11,
1123
+ y: te.value / 2 + 11,
1048
1124
  "text-anchor": "middle",
1049
1125
  "dominant-baseline": "middle",
1050
1126
  "font-size": "10",
1051
1127
  class: "fill-muted-foreground"
1052
- }, M(t.sublabel), 9, lo)) : m("", !0)
1128
+ }, I(t.sublabel), 9, wo)) : p("", !0)
1053
1129
  ]))), 128))
1054
- ], 8, no))
1055
- ], 4)) : m("", !0),
1056
- u("div", {
1130
+ ], 8, ko))
1131
+ ], 4)) : p("", !0),
1132
+ s("div", {
1057
1133
  class: "vlite-gantt-timeline-body",
1058
- style: R({ height: `${ue.value}px` })
1134
+ style: E({ height: `${ne.value}px` })
1059
1135
  }, [
1060
- (v(), g("svg", {
1136
+ (d(), v("svg", {
1061
1137
  ref_key: "timelineSvgRef",
1062
- ref: Le,
1063
- width: ie.value,
1064
- height: ue.value,
1138
+ ref: Ce,
1139
+ width: ee.value,
1140
+ height: ne.value,
1065
1141
  role: "img",
1066
1142
  "aria-label": "Gantt chart",
1067
- class: ke(["overflow-visible", { "vlite-gantt-linking": h.value }]),
1068
- onPointerdown: Kt
1143
+ class: xe(["overflow-visible", { "vlite-gantt-linking": h.value }]),
1144
+ onPointerdown: rn
1069
1145
  }, [
1070
- u("defs", null, [
1071
- (v(!0), g(C, null, z(b.value, (t, o) => (v(), g("linearGradient", {
1146
+ s("defs", null, [
1147
+ (d(!0), v(C, null, z(w.value, (t, o) => (d(), v("linearGradient", {
1072
1148
  key: `g${o}`,
1073
- id: `gg-${N(ee)}-${o}`,
1149
+ id: `gg-${X(Y)}-${o}`,
1074
1150
  x1: "0",
1075
1151
  y1: "0",
1076
1152
  x2: "1",
1077
1153
  y2: "0"
1078
1154
  }, [
1079
- u("stop", {
1155
+ s("stop", {
1080
1156
  offset: "0%",
1081
1157
  "stop-color": t.task._color,
1082
1158
  "stop-opacity": "1"
1083
- }, null, 8, io),
1084
- u("stop", {
1159
+ }, null, 8, Io),
1160
+ s("stop", {
1085
1161
  offset: "100%",
1086
1162
  "stop-color": t.task._color,
1087
1163
  "stop-opacity": "0.75"
1088
- }, null, 8, uo)
1089
- ], 8, so))), 128)),
1090
- (v(!0), g(C, null, z(b.value, (t, o) => (v(), g("linearGradient", {
1164
+ }, null, 8, $o)
1165
+ ], 8, Do))), 128)),
1166
+ (d(!0), v(C, null, z(w.value, (t, o) => (d(), v("linearGradient", {
1091
1167
  key: `p${o}`,
1092
- id: `gp-${N(ee)}-${o}`,
1168
+ id: `gp-${X(Y)}-${o}`,
1093
1169
  x1: "0",
1094
1170
  y1: "0",
1095
1171
  x2: "1",
1096
1172
  y2: "0"
1097
1173
  }, [
1098
- u("stop", {
1174
+ s("stop", {
1099
1175
  offset: "0%",
1100
1176
  "stop-color": t.task._color,
1101
1177
  "stop-opacity": "0.35"
1102
- }, null, 8, vo),
1103
- u("stop", {
1178
+ }, null, 8, So),
1179
+ s("stop", {
1104
1180
  offset: "100%",
1105
1181
  "stop-color": t.task._color,
1106
1182
  "stop-opacity": "0.15"
1107
- }, null, 8, fo)
1108
- ], 8, co))), 128))
1183
+ }, null, 8, Lo)
1184
+ ], 8, Mo))), 128)),
1185
+ s("pattern", {
1186
+ id: `gb-${X(Y)}`,
1187
+ width: "6",
1188
+ height: "6",
1189
+ patternUnits: "userSpaceOnUse",
1190
+ patternTransform: "rotate(45)"
1191
+ }, [...n[7] || (n[7] = [
1192
+ s("line", {
1193
+ x1: "0",
1194
+ y1: "0",
1195
+ x2: "0",
1196
+ y2: "6",
1197
+ stroke: "currentColor",
1198
+ "stroke-width": "2",
1199
+ "stroke-opacity": "0.3"
1200
+ }, null, -1)
1201
+ ])], 8, Co)
1109
1202
  ]),
1110
- d.showGrid ? (v(!0), g(C, { key: 0 }, z(ot.value, (t, o) => (v(), g("line", {
1203
+ c.showGrid ? (d(!0), v(C, { key: 0 }, z(at.value, (t, o) => (d(), v("line", {
1111
1204
  key: o,
1112
1205
  x1: t.x,
1113
1206
  y1: 0,
1114
1207
  x2: t.x,
1115
- y2: ue.value,
1208
+ y2: ne.value,
1116
1209
  stroke: "currentColor",
1117
1210
  "stroke-opacity": "0.06",
1118
1211
  "stroke-dasharray": "4 4"
1119
- }, null, 8, go))), 128)) : m("", !0),
1120
- (v(!0), g(C, null, z(re.value, (t, o) => (v(), g("line", {
1212
+ }, null, 8, To))), 128)) : p("", !0),
1213
+ (d(!0), v(C, null, z(se.value, (t, o) => (d(), v("line", {
1121
1214
  key: o,
1122
1215
  x1: 0,
1123
- y1: (o + 1) * d.rowHeight,
1124
- x2: ie.value,
1125
- y2: (o + 1) * d.rowHeight,
1216
+ y1: (o + 1) * c.rowHeight,
1217
+ x2: ee.value,
1218
+ y2: (o + 1) * c.rowHeight,
1126
1219
  stroke: "currentColor",
1127
1220
  "stroke-opacity": "0.04"
1128
- }, null, 8, yo))), 128)),
1129
- (v(!0), g(C, null, z(re.value, (t, o) => Dn((v(), g("rect", {
1221
+ }, null, 8, Wo))), 128)),
1222
+ (d(!0), v(C, null, z(se.value, (t, o) => Bn((d(), v("rect", {
1130
1223
  key: `bg${o}`,
1131
1224
  x: 0,
1132
- y: o * d.rowHeight,
1133
- width: ie.value,
1134
- height: d.rowHeight,
1225
+ y: o * c.rowHeight,
1226
+ width: ee.value,
1227
+ height: c.rowHeight,
1135
1228
  fill: "currentColor",
1136
1229
  "fill-opacity": "0.02"
1137
- }, null, 8, po)), [
1138
- [$n, t.type === "group-header"]
1230
+ }, null, 8, Ao)), [
1231
+ [Pn, t.type === "group-header"]
1139
1232
  ])), 128)),
1140
- (v(!0), g(C, null, z(He.value, (t) => (v(), g("g", {
1233
+ (d(!0), v(C, null, z(V.value, (t) => (d(), v("g", {
1141
1234
  key: t.key,
1142
- class: ke(["vlite-gantt-dep-group", {
1143
- "vlite-gantt-dep-selectable": d.editableDependencies,
1144
- "vlite-gantt-dep-active": Y(t.key)
1145
- }])
1235
+ ref_for: !0,
1236
+ ref: (o) => on(o, t.key),
1237
+ class: xe(["vlite-gantt-dep-group", {
1238
+ "vlite-gantt-dep-selectable": c.editableDependencies,
1239
+ "vlite-gantt-dep-active": K(t.key),
1240
+ "vlite-gantt-dep-hovered": G.value === t.key && !K(t.key)
1241
+ }]),
1242
+ role: "img",
1243
+ "aria-label": vt(t)
1146
1244
  }, [
1147
- d.editableDependencies ? (v(), g("path", {
1148
- key: 0,
1245
+ s("title", null, I(vt(t)), 1),
1246
+ s("path", {
1149
1247
  d: t.d,
1248
+ "data-dep-part": "hit",
1150
1249
  stroke: "transparent",
1151
- "stroke-width": "14",
1250
+ "stroke-width": "16",
1152
1251
  fill: "none",
1153
1252
  "stroke-linejoin": "round",
1154
1253
  "stroke-linecap": "round",
1155
1254
  class: "vlite-gantt-dep-hit",
1156
- onClick: (o) => Ot(o, t)
1157
- }, null, 8, ho)) : m("", !0),
1158
- u("path", {
1255
+ tabindex: c.editableDependencies ? 0 : void 0,
1256
+ onClick: (o) => ft(o, t),
1257
+ onKeydown: je((o) => ft(o, t), ["enter"]),
1258
+ onMouseenter: (o) => rt(t.key),
1259
+ onMouseleave: st,
1260
+ onFocus: (o) => rt(t.key),
1261
+ onBlur: st
1262
+ }, null, 40, Ro),
1263
+ s("path", {
1159
1264
  d: t.d,
1160
- stroke: Y(t.key) ? et : "var(--color-muted-foreground)",
1161
- "stroke-width": Y(t.key) ? 2.5 : 1.5,
1162
- "stroke-opacity": Y(t.key) ? 1 : 0.35,
1265
+ "data-dep-part": "line",
1266
+ stroke: K(t.key) ? et : "var(--color-muted-foreground)",
1267
+ "stroke-width": K(t.key) ? 2.5 : 1.5,
1268
+ "stroke-opacity": K(t.key) ? 1 : 0.45,
1163
1269
  fill: "none",
1164
1270
  "stroke-linejoin": "round",
1165
- class: "pointer-events-none"
1166
- }, null, 8, ko),
1167
- u("path", {
1271
+ class: "vlite-gantt-dep-line pointer-events-none"
1272
+ }, null, 8, Bo),
1273
+ s("path", {
1168
1274
  d: t.ad,
1169
- fill: Y(t.key) ? et : "var(--color-muted-foreground)",
1170
- "fill-opacity": Y(t.key) ? 1 : 0.5,
1171
- class: "pointer-events-none"
1172
- }, null, 8, mo)
1173
- ], 2))), 128)),
1174
- d.editableDependencies && ce.value ? (v(), g("g", {
1275
+ "data-dep-part": "arrow",
1276
+ fill: K(t.key) ? et : "var(--color-muted-foreground)",
1277
+ "fill-opacity": K(t.key) ? 1 : 0.6,
1278
+ class: "vlite-gantt-dep-arrowhead pointer-events-none"
1279
+ }, null, 8, Po)
1280
+ ], 10, Eo))), 128)),
1281
+ c.editableDependencies && ue.value ? (d(), v("g", {
1175
1282
  key: 1,
1176
1283
  class: "vlite-gantt-dep-delete",
1177
- transform: `translate(${ce.value.midX}, ${ce.value.midY})`,
1284
+ transform: `translate(${ue.value.midX}, ${ue.value.midY})`,
1178
1285
  role: "button",
1179
1286
  tabindex: "0",
1180
1287
  focusable: "true",
1181
- "aria-label": qt.value,
1182
- onClick: Vt,
1288
+ "aria-label": an.value,
1289
+ onClick: ln,
1183
1290
  onKeydown: [
1184
- It(Mt($e, ["prevent"]), ["enter"]),
1185
- It(Mt($e, ["prevent"]), ["space"])
1291
+ je(zt(Me, ["prevent"]), ["enter"]),
1292
+ je(zt(Me, ["prevent"]), ["space"])
1186
1293
  ]
1187
1294
  }, [
1188
- n[6] || (n[6] = u("circle", {
1295
+ n[8] || (n[8] = s("circle", {
1189
1296
  r: "11",
1190
1297
  fill: "transparent"
1191
1298
  }, null, -1)),
1192
- u("circle", {
1299
+ s("circle", {
1193
1300
  r: "8",
1194
1301
  fill: et,
1195
1302
  stroke: "var(--color-background)",
1196
1303
  "stroke-width": "1.5"
1197
1304
  }),
1198
- n[7] || (n[7] = u("path", {
1305
+ n[9] || (n[9] = s("path", {
1199
1306
  d: "M -3 -3 L 3 3 M 3 -3 L -3 3",
1200
1307
  stroke: "var(--color-background)",
1201
1308
  "stroke-width": "1.75",
1202
1309
  "stroke-linecap": "round",
1203
1310
  class: "pointer-events-none"
1204
1311
  }, null, -1))
1205
- ], 40, xo)) : m("", !0),
1206
- (v(!0), g(C, null, z(b.value, (t, o) => (v(), g("g", {
1312
+ ], 40, Ho)) : p("", !0),
1313
+ (d(!0), v(C, null, z(w.value, (t, o) => (d(), v("g", {
1207
1314
  key: t.task.id,
1208
1315
  ref_for: !0,
1209
- ref: (a) => Ut(a, o),
1210
- class: ke(["vlite-gantt-bar-group", [
1211
- { "vlite-gantt-bar-dragging": P.value && (q.value === t.task.id || N(r).affectedIds.has(t.task.id)) },
1212
- rn(t.task.id),
1213
- { "vlite-gantt-link-source": h.value && Q.value === t.task.id }
1316
+ ref: (a) => un(a, o),
1317
+ class: xe(["vlite-gantt-bar-group", [
1318
+ { "vlite-gantt-bar-dragging": B.value && (N.value === t.task.id || X(i).affectedIds.has(t.task.id)) },
1319
+ mn(t.task.id),
1320
+ { "vlite-gantt-link-source": h.value && oe.value === t.task.id }
1214
1321
  ]]),
1215
- onMouseenter: (a) => fn(a, o),
1216
- onMouseleave: gn
1322
+ onMouseenter: (a) => $n(a, o),
1323
+ onMouseleave: Mn
1217
1324
  }, [
1218
- t.task.milestone ? (v(), g("path", {
1325
+ t.task.milestone ? (d(), v("path", {
1219
1326
  key: 0,
1220
- d: sn(t.x + t.fullW / 2, t.y + d.barHeight / 2, d.barHeight * 0.4),
1221
- fill: `url(#gg-${N(ee)}-${o})`,
1327
+ d: xn(t.x + t.fullW / 2, t.y + c.barHeight / 2, c.barHeight * 0.4),
1328
+ fill: `url(#gg-${X(Y)}-${o})`,
1222
1329
  stroke: t.task._color,
1223
1330
  "stroke-width": "1.5",
1224
1331
  "stroke-opacity": "0.6",
1225
1332
  class: "cursor-pointer",
1226
- opacity: _.value === o ? 0.9 : 1,
1227
- onMouseenter: (a) => Dt(a, o),
1228
- onMousemove: (a) => $t(a, o),
1229
- onClick: (a) => je(t.task)
1230
- }, null, 40, bo)) : (v(), g(C, { key: 1 }, [
1231
- u("path", {
1333
+ opacity: H.value === o ? 0.9 : 1,
1334
+ onMouseenter: (a) => Rt(a, o),
1335
+ onMousemove: (a) => Bt(a, o),
1336
+ onClick: (a) => Ze(t.task)
1337
+ }, null, 40, zo)) : (d(), v(C, { key: 1 }, [
1338
+ s("path", {
1232
1339
  "data-gantt-part": "bg",
1233
- d: J(t.x, t.y, t.fullW, d.barHeight, d.barRadius),
1234
- fill: `url(#gp-${N(ee)}-${o})`,
1340
+ d: P(t.x, t.y, t.fullW, c.barHeight, c.barRadius),
1341
+ fill: `url(#gp-${X(Y)}-${o})`,
1235
1342
  class: "pointer-events-none"
1236
- }, null, 8, Do),
1237
- d.showProgress && t.progressW > 0 ? (v(), g("path", {
1343
+ }, null, 8, Xo),
1344
+ c.showProgress && t.progressW > 0 ? (d(), v("path", {
1238
1345
  key: 0,
1239
1346
  "data-gantt-part": "progress",
1240
- d: J(t.x, t.y, Math.min(t.progressW, t.fullW), d.barHeight, d.barRadius),
1241
- fill: `url(#gg-${N(ee)}-${o})`,
1347
+ d: P(t.x, t.y, Math.min(t.progressW, t.fullW), c.barHeight, c.barRadius),
1348
+ fill: `url(#gg-${X(Y)}-${o})`,
1242
1349
  class: "pointer-events-none"
1243
- }, null, 8, $o)) : m("", !0),
1244
- d.showProgress ? m("", !0) : (v(), g("path", {
1350
+ }, null, 8, Go)) : p("", !0),
1351
+ c.showProgress ? p("", !0) : (d(), v("path", {
1245
1352
  key: 1,
1246
1353
  "data-gantt-part": "fill",
1247
- d: J(t.x, t.y, t.w, d.barHeight, d.barRadius),
1248
- fill: `url(#gg-${N(ee)}-${o})`,
1354
+ d: P(t.x, t.y, t.w, c.barHeight, c.barRadius),
1355
+ fill: `url(#gg-${X(Y)}-${o})`,
1249
1356
  class: "pointer-events-none"
1250
- }, null, 8, Io)),
1251
- u("rect", {
1357
+ }, null, 8, qo)),
1358
+ t.task.blocked ? (d(), v(C, { key: 2 }, [
1359
+ s("path", {
1360
+ "data-gantt-part": "blocked-hatch",
1361
+ d: P(t.x, t.y, t.fullW, c.barHeight, c.barRadius),
1362
+ fill: `url(#gb-${X(Y)})`,
1363
+ class: "pointer-events-none"
1364
+ }, null, 8, Fo),
1365
+ s("path", {
1366
+ "data-gantt-part": "blocked-outline",
1367
+ d: P(t.x, t.y, t.fullW, c.barHeight, c.barRadius),
1368
+ fill: "none",
1369
+ stroke: "var(--color-danger)",
1370
+ "stroke-width": "1.5",
1371
+ "stroke-opacity": "0.9",
1372
+ "stroke-dasharray": "4 3",
1373
+ class: "pointer-events-none"
1374
+ }, null, 8, Yo),
1375
+ s("g", {
1376
+ "data-gantt-part": "blocked-lock",
1377
+ transform: `translate(${t.x + 10}, ${t.y + c.barHeight / 2})`,
1378
+ class: "pointer-events-none"
1379
+ }, [...n[10] || (n[10] = [
1380
+ s("circle", {
1381
+ r: "7",
1382
+ fill: "var(--color-danger)"
1383
+ }, null, -1),
1384
+ s("path", {
1385
+ d: "M -2 -0.5 v -1.3 a 2 2 0 0 1 4 0 v 1.3 M -3 -0.5 h 6 v 3.8 h -6 Z",
1386
+ fill: "none",
1387
+ stroke: "var(--color-background)",
1388
+ "stroke-width": "1.2",
1389
+ "stroke-linejoin": "round"
1390
+ }, null, -1)
1391
+ ])], 8, Oo)
1392
+ ], 64)) : p("", !0),
1393
+ s("rect", {
1252
1394
  "data-gantt-part": "hitbox",
1253
1395
  x: t.x,
1254
1396
  y: t.y,
1255
1397
  width: t.fullW,
1256
- height: d.barHeight,
1398
+ height: c.barHeight,
1257
1399
  fill: "transparent",
1258
- style: R({ cursor: fe.value }),
1259
- onMouseenter: (a) => Dt(a, o),
1260
- onMousemove: (a) => $t(a, o),
1261
- onMousedown: (a) => Qt(a, o),
1262
- onClick: (a) => je(t.task)
1263
- }, null, 44, Mo),
1264
- _.value === o || P.value && q.value === t.task.id ? (v(), g("rect", {
1265
- key: 2,
1400
+ style: E({ cursor: ve.value }),
1401
+ onMouseenter: (a) => Rt(a, o),
1402
+ onMousemove: (a) => Bt(a, o),
1403
+ onMousedown: (a) => dn(a, o),
1404
+ onClick: (a) => Ze(t.task)
1405
+ }, null, 44, Vo),
1406
+ H.value === o || B.value && N.value === t.task.id ? (d(), v("rect", {
1407
+ key: 3,
1266
1408
  "data-gantt-part": "highlight",
1267
1409
  x: t.x,
1268
1410
  y: t.y,
1269
1411
  width: t.fullW,
1270
- height: d.barHeight,
1271
- rx: d.barRadius,
1272
- ry: d.barRadius,
1412
+ height: c.barHeight,
1413
+ rx: c.barRadius,
1414
+ ry: c.barRadius,
1273
1415
  fill: "currentColor",
1274
1416
  "fill-opacity": "0.06",
1275
1417
  class: "pointer-events-none"
1276
- }, null, 8, Lo)) : m("", !0),
1277
- d.draggable && !t.task.milestone && (G.value === o || P.value && q.value === t.task.id) ? (v(), g(C, { key: 3 }, [
1278
- u("rect", {
1418
+ }, null, 8, Ko)) : p("", !0),
1419
+ c.draggable && !t.task.milestone && (q.value === o || B.value && N.value === t.task.id) ? (d(), v(C, { key: 4 }, [
1420
+ s("rect", {
1279
1421
  "data-gantt-part": "handle-left",
1280
1422
  x: t.x,
1281
1423
  y: t.y + 4,
1282
1424
  width: "4",
1283
- height: d.barHeight - 8,
1425
+ height: c.barHeight - 8,
1284
1426
  rx: "2",
1285
1427
  fill: "currentColor",
1286
1428
  "fill-opacity": "0.4",
1287
1429
  class: "pointer-events-none"
1288
- }, null, 8, So),
1289
- u("rect", {
1430
+ }, null, 8, No),
1431
+ s("rect", {
1290
1432
  "data-gantt-part": "handle-right",
1291
1433
  x: t.x + t.fullW - 4,
1292
1434
  y: t.y + 4,
1293
1435
  width: "4",
1294
- height: d.barHeight - 8,
1436
+ height: c.barHeight - 8,
1295
1437
  rx: "2",
1296
1438
  fill: "currentColor",
1297
1439
  "fill-opacity": "0.4",
1298
1440
  class: "pointer-events-none"
1299
- }, null, 8, Co)
1300
- ], 64)) : m("", !0),
1301
- d.showLabels && t.fullW > 60 ? (v(), g("text", {
1302
- key: 4,
1441
+ }, null, 8, Zo)
1442
+ ], 64)) : p("", !0),
1443
+ c.showLabels && t.fullW > 60 ? (d(), v("text", {
1444
+ key: 5,
1303
1445
  "data-gantt-part": "label",
1304
- x: t.x + 12,
1305
- y: t.y + d.barHeight / 2,
1446
+ "data-name": t.task.name,
1447
+ x: t.x + (t.task.blocked ? 24 : 12),
1448
+ y: t.y + c.barHeight / 2,
1306
1449
  "dominant-baseline": "middle",
1307
1450
  "font-size": "11",
1308
1451
  "font-weight": "600",
1309
- fill: d.showProgress ? "currentColor" : "white",
1310
- opacity: We.value > 0.3 ? 0.85 : 0,
1452
+ fill: c.showProgress ? "currentColor" : "white",
1453
+ opacity: Re.value > 0.3 ? 0.85 : 0,
1311
1454
  class: "pointer-events-none"
1312
- }, M(t.task.name), 9, To)) : m("", !0)
1455
+ }, I(Et(t.task.name, t.fullW, t.task.blocked)), 9, jo)) : p("", !0)
1313
1456
  ], 64)),
1314
- d.editableDependencies && en(o) ? (v(), g("g", {
1457
+ c.editableDependencies && fn(o) ? (d(), v("g", {
1315
1458
  key: 2,
1316
1459
  class: "vlite-gantt-dep-connector",
1317
1460
  transform: `translate(${F(t).cx}, ${F(t).cy})`,
@@ -1319,83 +1462,83 @@ const Vn = {
1319
1462
  tabindex: "0",
1320
1463
  focusable: "true",
1321
1464
  "aria-label": `Create dependency from ${t.task.name}`,
1322
- onPointerdown: (a) => nn(a, o),
1323
- onKeydown: (a) => on(a, o),
1324
- onFocus: (a) => an(o),
1325
- onBlur: ln,
1326
- onMouseenter: (a) => yn(o),
1327
- onMouseleave: n[0] || (n[0] = (a) => pn(a))
1465
+ onPointerdown: (a) => yn(a, o),
1466
+ onKeydown: (a) => pn(a, o),
1467
+ onFocus: (a) => hn(o),
1468
+ onBlur: kn,
1469
+ onMouseenter: (a) => Sn(o),
1470
+ onMouseleave: n[0] || (n[0] = (a) => Ln(a))
1328
1471
  }, [
1329
- n[8] || (n[8] = u("circle", {
1472
+ n[11] || (n[11] = s("circle", {
1330
1473
  r: "11",
1331
1474
  fill: "transparent",
1332
1475
  class: "vlite-gantt-dep-connector-hit"
1333
1476
  }, null, -1)),
1334
- u("circle", {
1335
- r: ea,
1477
+ s("circle", {
1478
+ r: ma,
1336
1479
  class: "vlite-gantt-dep-connector-disc",
1337
1480
  fill: "var(--color-background)",
1338
1481
  stroke: "var(--color-foreground)",
1339
1482
  "stroke-width": "1.5"
1340
1483
  }),
1341
- n[9] || (n[9] = u("path", {
1484
+ n[12] || (n[12] = s("path", {
1342
1485
  d: "M -3.5 0 H 3.5 M 0 -3.5 V 3.5",
1343
1486
  stroke: "var(--color-foreground)",
1344
1487
  "stroke-width": "1.5",
1345
1488
  "stroke-linecap": "round",
1346
1489
  class: "pointer-events-none"
1347
1490
  }, null, -1))
1348
- ], 40, Eo)) : m("", !0),
1349
- h.value && ge.value === t.task.id ? (v(), g("g", Wo, [
1350
- u("rect", {
1491
+ ], 40, Uo)) : p("", !0),
1492
+ h.value && fe.value === t.task.id ? (d(), v("g", Jo, [
1493
+ s("rect", {
1351
1494
  x: t.x - 3,
1352
1495
  y: t.y - 3,
1353
1496
  width: t.fullW + 6,
1354
- height: d.barHeight + 6,
1355
- rx: d.barRadius + 2,
1497
+ height: c.barHeight + 6,
1498
+ rx: c.barRadius + 2,
1356
1499
  fill: "none",
1357
- stroke: L.value === "valid" ? "var(--color-success)" : "var(--color-danger)",
1500
+ stroke: S.value === "valid" ? "var(--color-success)" : "var(--color-danger)",
1358
1501
  "stroke-width": "2",
1359
- "stroke-dasharray": L.value === "valid" ? "0" : "5 3"
1360
- }, null, 8, Ro),
1361
- u("text", {
1502
+ "stroke-dasharray": S.value === "valid" ? "0" : "5 3"
1503
+ }, null, 8, Qo),
1504
+ s("text", {
1362
1505
  x: t.x + t.fullW + 10,
1363
- y: t.y + d.barHeight / 2,
1506
+ y: t.y + c.barHeight / 2,
1364
1507
  "dominant-baseline": "middle",
1365
1508
  "font-size": "11",
1366
1509
  "font-weight": "700",
1367
- fill: L.value === "valid" ? "var(--color-success)" : "var(--color-danger)"
1368
- }, M(L.value === "valid" ? "✓" : "✕"), 9, Ao)
1369
- ])) : m("", !0)
1370
- ], 42, wo))), 128)),
1371
- h.value && T.value ? (v(), g("g", Po, [
1372
- u("line", {
1510
+ fill: S.value === "valid" ? "var(--color-success)" : "var(--color-danger)"
1511
+ }, I(S.value === "valid" ? "✓" : "✕"), 9, ea)
1512
+ ])) : p("", !0)
1513
+ ], 42, _o))), 128)),
1514
+ h.value && T.value ? (d(), v("g", ta, [
1515
+ s("line", {
1373
1516
  x1: T.value.x1,
1374
1517
  y1: T.value.y1,
1375
1518
  x2: T.value.x2,
1376
1519
  y2: T.value.y2,
1377
- stroke: L.value === "invalid" ? "var(--color-danger)" : "var(--color-primary)",
1520
+ stroke: S.value === "invalid" ? "var(--color-danger)" : "var(--color-primary)",
1378
1521
  "stroke-width": "2",
1379
- "stroke-dasharray": L.value === "invalid" ? "2 4" : "6 4",
1522
+ "stroke-dasharray": S.value === "invalid" ? "2 4" : "6 4",
1380
1523
  "stroke-linecap": "round",
1381
- "stroke-opacity": L.value === "none" ? 0.55 : 0.9
1382
- }, null, 8, _o),
1383
- u("circle", {
1524
+ "stroke-opacity": S.value === "none" ? 0.55 : 0.9
1525
+ }, null, 8, na),
1526
+ s("circle", {
1384
1527
  cx: T.value.x2,
1385
1528
  cy: T.value.y2,
1386
1529
  r: "4",
1387
- fill: L.value === "invalid" ? "var(--color-danger)" : "var(--color-primary)",
1388
- "fill-opacity": L.value === "none" ? 0.55 : 0.9
1389
- }, null, 8, Bo)
1390
- ])) : m("", !0),
1391
- u("g", {
1530
+ fill: S.value === "invalid" ? "var(--color-danger)" : "var(--color-primary)",
1531
+ "fill-opacity": S.value === "none" ? 0.55 : 0.9
1532
+ }, null, 8, oa)
1533
+ ])) : p("", !0),
1534
+ s("g", {
1392
1535
  ref_key: "dragLabelRef",
1393
- ref: H,
1536
+ ref: _,
1394
1537
  style: { display: "none" },
1395
1538
  "pointer-events": "none",
1396
1539
  "aria-hidden": "true"
1397
- }, [...n[10] || (n[10] = [
1398
- u("rect", {
1540
+ }, [...n[13] || (n[13] = [
1541
+ s("rect", {
1399
1542
  x: "0",
1400
1543
  y: "0",
1401
1544
  width: "148",
@@ -1404,7 +1547,7 @@ const Vn = {
1404
1547
  fill: "var(--color-foreground)",
1405
1548
  "fill-opacity": "0.85"
1406
1549
  }, null, -1),
1407
- u("text", {
1550
+ s("text", {
1408
1551
  x: "0",
1409
1552
  y: "0",
1410
1553
  "text-anchor": "middle",
@@ -1414,79 +1557,101 @@ const Vn = {
1414
1557
  fill: "var(--color-background)"
1415
1558
  }, null, -1)
1416
1559
  ])], 512),
1417
- d.showTodayLine && Ie.value ? (v(), g("g", Ho, [
1418
- u("line", {
1419
- x1: ve.value,
1560
+ c.showTodayLine && Se.value ? (d(), v("g", aa, [
1561
+ s("line", {
1562
+ x1: de.value,
1420
1563
  y1: 0,
1421
- x2: ve.value,
1422
- y2: ue.value,
1423
- stroke: d.todayColor,
1564
+ x2: de.value,
1565
+ y2: ne.value,
1566
+ stroke: c.todayColor,
1424
1567
  "stroke-width": "2",
1425
1568
  "stroke-opacity": "0.7",
1426
1569
  "stroke-dasharray": "6 3"
1427
- }, null, 8, zo),
1428
- u("circle", {
1429
- cx: ve.value,
1570
+ }, null, 8, la),
1571
+ s("circle", {
1572
+ cx: de.value,
1430
1573
  cy: 0,
1431
1574
  r: "4",
1432
- fill: d.todayColor,
1575
+ fill: c.todayColor,
1433
1576
  "fill-opacity": "0.9"
1434
- }, null, 8, Go),
1435
- u("text", {
1436
- x: ve.value,
1577
+ }, null, 8, ra),
1578
+ s("text", {
1579
+ x: de.value,
1437
1580
  y: -8,
1438
1581
  "text-anchor": "middle",
1439
1582
  "font-size": "9",
1440
1583
  "font-weight": "700",
1441
- fill: d.todayColor,
1584
+ fill: c.todayColor,
1442
1585
  "fill-opacity": "0.9"
1443
- }, "TODAY", 8, Fo)
1444
- ])) : m("", !0)
1445
- ], 42, ro))
1586
+ }, "TODAY", 8, sa)
1587
+ ])) : p("", !0)
1588
+ ], 42, bo))
1446
1589
  ], 4)
1447
1590
  ], 544)
1448
1591
  ]),
1449
- u("div", Xo, M(Fe.value), 1),
1450
- (v(), In(Mn, { to: "body" }, [
1451
- p.value && !P.value && !h.value && !I.value ? (v(), g("div", {
1592
+ s("div", ia, I(Ge.value), 1),
1593
+ (d(), Hn(_n, { to: "body" }, [
1594
+ y.value && !B.value && !h.value && !M.value ? (d(), v("div", {
1452
1595
  key: 0,
1453
1596
  class: "vlite-chart-tooltip",
1454
- style: R({ left: `${p.value.left}px`, top: `${p.value.top}px` })
1597
+ style: E({ left: `${y.value.left}px`, top: `${y.value.top}px` })
1455
1598
  }, [
1456
- u("div", qo, M(p.value.task.name), 1),
1457
- u("div", Oo, [
1458
- u("span", {
1599
+ s("div", ua, I(y.value.task.name), 1),
1600
+ s("div", ca, [
1601
+ s("span", {
1459
1602
  class: "w-2 h-2 rounded-sm shrink-0",
1460
- style: R({ backgroundColor: p.value.task._color ?? p.value.task.color })
1603
+ style: E({ backgroundColor: y.value.task._color ?? y.value.task.color })
1461
1604
  }, null, 4),
1462
- u("span", null, M(p.value.startStr) + " — " + M(p.value.endStr), 1)
1605
+ s("span", null, I(y.value.startStr) + " — " + I(y.value.endStr), 1)
1463
1606
  ]),
1464
- u("div", Vo, M(kn(p.value.task._start, p.value.task._end)), 1),
1465
- d.showProgress && p.value.task.progress != null ? (v(), g("div", Ko, [
1466
- u("div", Zo, [
1467
- u("div", {
1607
+ s("div", da, I(Tn(y.value.task._start, y.value.task._end)), 1),
1608
+ c.showProgress && y.value.task.progress != null ? (d(), v("div", va, [
1609
+ s("div", fa, [
1610
+ s("div", {
1468
1611
  class: "vlite-gantt-tooltip-progress-fill",
1469
- style: R({
1470
- width: `${p.value.task.progress}%`,
1471
- backgroundColor: p.value.task._color ?? p.value.task.color
1612
+ style: E({
1613
+ width: `${y.value.task.progress}%`,
1614
+ backgroundColor: y.value.task._color ?? y.value.task.color
1472
1615
  })
1473
1616
  }, null, 4)
1474
1617
  ]),
1475
- u("span", No, M(p.value.task.progress) + "%", 1)
1476
- ])) : m("", !0),
1477
- p.value.task.group ? (v(), g("div", jo, M(p.value.task.group), 1)) : m("", !0),
1478
- d.draggable && !p.value.task.milestone ? (v(), g("div", Uo, [
1479
- n[11] || (n[11] = Lt(" Drag to move · Edges to resize ", -1)),
1480
- d.cascadeDependencies ? (v(), g(C, { key: 0 }, [
1481
- Lt(" · Dependents follow")
1482
- ], 64)) : m("", !0)
1483
- ])) : m("", !0),
1484
- d.editableDependencies ? (v(), g("div", Yo, " Drag the + connector to link a dependency ")) : m("", !0)
1485
- ], 4)) : m("", !0)
1618
+ s("span", ga, I(y.value.task.progress) + "%", 1)
1619
+ ])) : p("", !0),
1620
+ y.value.task.blocked ? (d(), v("div", ya, [
1621
+ n[14] || (n[14] = s("svg", {
1622
+ width: "10",
1623
+ height: "10",
1624
+ viewBox: "0 0 24 24",
1625
+ fill: "none",
1626
+ stroke: "currentColor",
1627
+ "stroke-width": "2.5",
1628
+ "stroke-linecap": "round",
1629
+ "stroke-linejoin": "round"
1630
+ }, [
1631
+ s("rect", {
1632
+ x: "5",
1633
+ y: "11",
1634
+ width: "14",
1635
+ height: "9",
1636
+ rx: "2"
1637
+ }),
1638
+ s("path", { d: "M8 11V8a4 4 0 0 1 8 0v3" })
1639
+ ], -1)),
1640
+ s("span", null, I(y.value.task.blockedReason || "Blocked"), 1)
1641
+ ])) : p("", !0),
1642
+ y.value.task.group ? (d(), v("div", pa, I(y.value.task.group), 1)) : p("", !0),
1643
+ c.draggable && !y.value.task.milestone ? (d(), v("div", ha, [
1644
+ n[15] || (n[15] = Xt(" Drag to move · Edges to resize ", -1)),
1645
+ c.cascadeDependencies ? (d(), v(C, { key: 0 }, [
1646
+ Xt(" · Dependents follow")
1647
+ ], 64)) : p("", !0)
1648
+ ])) : p("", !0),
1649
+ c.editableDependencies ? (d(), v("div", ka, " Drag the + connector to link a dependency ")) : p("", !0)
1650
+ ], 4)) : p("", !0)
1486
1651
  ]))
1487
1652
  ], 512));
1488
1653
  }
1489
1654
  });
1490
1655
  export {
1491
- sa as default
1656
+ La as default
1492
1657
  };