@baishuyun/ui-base 6.4.1 → 6.4.2
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.
|
@@ -99,8 +99,11 @@ var De = (e) => e && I(e.then) ? e : Promise.resolve(e);
|
|
|
99
99
|
//#endregion
|
|
100
100
|
//#region src/components/Gantt/GanttChart/hooks/useEdgeScroll.tsx
|
|
101
101
|
function Oe(e, t) {
|
|
102
|
+
return e < 0 ? t * 10 : e >= 60 ? 0 : t * (2 + 8 * (1 - e / 60));
|
|
103
|
+
}
|
|
104
|
+
function ke(e, t) {
|
|
102
105
|
let n = J(null), r = J(0), i = G(() => {
|
|
103
|
-
n.current !== null &&
|
|
106
|
+
n.current !== null && cancelAnimationFrame(n.current), n.current = null, r.current = 0;
|
|
104
107
|
}, []);
|
|
105
108
|
K(() => () => {
|
|
106
109
|
n.current !== null && cancelAnimationFrame(n.current);
|
|
@@ -119,24 +122,28 @@ function Oe(e, t) {
|
|
|
119
122
|
n.current = requestAnimationFrame(i);
|
|
120
123
|
}, [e, t]);
|
|
121
124
|
return {
|
|
122
|
-
startEdgeDetection: G((t) => {
|
|
123
|
-
let
|
|
124
|
-
if (!
|
|
125
|
-
let
|
|
126
|
-
|
|
127
|
-
}, [
|
|
125
|
+
startEdgeDetection: G((t, n) => {
|
|
126
|
+
let o = e.current;
|
|
127
|
+
if (!o) return;
|
|
128
|
+
let s = n ?? o.getBoundingClientRect(), c = t - s.left, l = s.right - t, u = c < 60 ? Oe(c, -1) : l < 60 ? Oe(l, 1) : 0;
|
|
129
|
+
r.current = u, u === 0 ? i() : a();
|
|
130
|
+
}, [
|
|
131
|
+
e,
|
|
132
|
+
a,
|
|
133
|
+
i
|
|
134
|
+
]),
|
|
128
135
|
stopEdgeScroll: i
|
|
129
136
|
};
|
|
130
137
|
}
|
|
131
138
|
//#endregion
|
|
132
139
|
//#region src/components/Gantt/GanttChart/hooks/useGanttDrag.tsx
|
|
133
|
-
function
|
|
140
|
+
function Ae({ pixelsPerDay: e, viewMode: t, timelineCoords: n, onTaskTimeChange: i, containerRef: c, onDragInteractionChange: u }) {
|
|
134
141
|
let d = h(t), f = m(t), p = f / s * e, g = J(n);
|
|
135
142
|
g.current = n;
|
|
136
143
|
let [_, v] = Y({}), [y, b] = Y(null), x = J(null), S = J({
|
|
137
144
|
shouldSuppressClick: !1,
|
|
138
145
|
at: 0
|
|
139
|
-
}), C = J(0), w = J(null), { startEdgeDetection: T, stopEdgeScroll: ee } =
|
|
146
|
+
}), C = J(0), w = J(null), { startEdgeDetection: T, stopEdgeScroll: ee } = ke(c ?? { current: null }, w), E = J({});
|
|
140
147
|
K(() => {
|
|
141
148
|
x.current = y;
|
|
142
149
|
}, [y]), K(() => () => {
|
|
@@ -190,56 +197,54 @@ function ke({ pixelsPerDay: e, viewMode: t, timelineCoords: n, onTaskTimeChange:
|
|
|
190
197
|
}, [k]);
|
|
191
198
|
return K(() => {
|
|
192
199
|
if (!y?.taskId) return;
|
|
193
|
-
let e = (e) => {
|
|
194
|
-
let
|
|
195
|
-
if (!
|
|
196
|
-
let
|
|
197
|
-
if (t.dragMode === "resize-end") m = t.originLeftPx;
|
|
198
|
-
else if (!u && a > 0) {
|
|
199
|
-
let e = i, n = i + Math.max(0, a - l);
|
|
200
|
-
t.dragMode === "move" && (m = Math.min(n, Math.max(e, s)));
|
|
201
|
-
}
|
|
202
|
-
let h = (t.dragMode === "resize-end" ? s : m) - t.originAnchorPx;
|
|
200
|
+
let e = (e, t) => {
|
|
201
|
+
let n = x.current;
|
|
202
|
+
if (!n) return;
|
|
203
|
+
let r = c?.current, i = t ?? r?.getBoundingClientRect(), a = r?.scrollLeft ?? 0, o = g.current, s = a + (i ? e - i.left : 0) - n.grabOffsetInBar, l = n.dragMode === "resize-end" ? n.originLeftPx : s, u = s - n.originAnchorPx;
|
|
203
204
|
if (!d) {
|
|
204
205
|
let e = {
|
|
205
|
-
...Te(
|
|
206
|
-
previewLeftPx:
|
|
206
|
+
...Te(n, u, o, f),
|
|
207
|
+
previewLeftPx: l
|
|
207
208
|
};
|
|
208
|
-
if (e.deltaUnits ===
|
|
209
|
-
let
|
|
210
|
-
...
|
|
209
|
+
if (e.deltaUnits === n.deltaUnits && e.previewLeftPx === n.previewLeftPx && e.previewStartMs === n.previewStartMs && e.previewEndMs === n.previewEndMs) return;
|
|
210
|
+
let t = {
|
|
211
|
+
...n,
|
|
211
212
|
...e
|
|
212
213
|
};
|
|
213
|
-
x.current =
|
|
214
|
+
x.current = t, b(t);
|
|
214
215
|
return;
|
|
215
216
|
}
|
|
216
|
-
let
|
|
217
|
-
...
|
|
218
|
-
deltaUnits:
|
|
219
|
-
previewLeftPx:
|
|
217
|
+
let m = xe(u, p), h = {
|
|
218
|
+
...n,
|
|
219
|
+
deltaUnits: m,
|
|
220
|
+
previewLeftPx: l
|
|
220
221
|
};
|
|
221
|
-
if (
|
|
222
|
-
let e = Ce(
|
|
223
|
-
|
|
222
|
+
if (n.dragMode === "move") {
|
|
223
|
+
let e = Ce(n.originStartMs, n.originEndMs, m * f);
|
|
224
|
+
h.previewStartMs = e.startMs, h.previewEndMs = e.endMs;
|
|
224
225
|
} else {
|
|
225
226
|
let e = we({
|
|
226
|
-
startMs:
|
|
227
|
-
endMs:
|
|
228
|
-
deltaMs:
|
|
229
|
-
edge:
|
|
227
|
+
startMs: n.originStartMs,
|
|
228
|
+
endMs: n.originEndMs,
|
|
229
|
+
deltaMs: m * f,
|
|
230
|
+
edge: n.dragMode === "resize-start" ? "start" : "end",
|
|
230
231
|
minDurationMs: f
|
|
231
232
|
});
|
|
232
|
-
|
|
233
|
+
h.previewStartMs = e.startMs, h.previewEndMs = e.endMs;
|
|
233
234
|
}
|
|
234
|
-
let
|
|
235
|
-
...
|
|
236
|
-
deltaUnits:
|
|
235
|
+
let _ = Math.round((h.previewStartMs - n.originStartMs) / f), v = {
|
|
236
|
+
...h,
|
|
237
|
+
deltaUnits: n.dragMode === "resize-end" ? Math.round((h.previewEndMs - n.originEndMs) / f) : _
|
|
237
238
|
};
|
|
238
|
-
|
|
239
|
+
v.deltaUnits === n.deltaUnits && v.previewLeftPx === n.previewLeftPx && v.previewStartMs === n.previewStartMs && v.previewEndMs === n.previewEndMs || (x.current = v, b(v));
|
|
240
|
+
};
|
|
241
|
+
w.current = () => {
|
|
242
|
+
e(C.current);
|
|
239
243
|
};
|
|
240
|
-
w.current = () => e(C.current);
|
|
241
244
|
let n = (t) => {
|
|
242
|
-
C.current = t.clientX
|
|
245
|
+
C.current = t.clientX;
|
|
246
|
+
let n = c?.current?.getBoundingClientRect() ?? null;
|
|
247
|
+
e(t.clientX, n), T(t.clientX, n ?? void 0);
|
|
243
248
|
}, r = () => {
|
|
244
249
|
ee(), w.current = null, e(C.current);
|
|
245
250
|
let n = x.current;
|
|
@@ -346,25 +351,25 @@ function ke({ pixelsPerDay: e, viewMode: t, timelineCoords: n, onTaskTimeChange:
|
|
|
346
351
|
}
|
|
347
352
|
//#endregion
|
|
348
353
|
//#region src/components/Gantt/GanttChart/utils/timelineFocus.ts
|
|
349
|
-
function
|
|
354
|
+
function je(e, t, n) {
|
|
350
355
|
let r = Number(t) > 0 ? Number(t) : 0, i = Number(n) > 0 ? Number(n) : 0, a = Math.max(0, i - r);
|
|
351
356
|
return Number.isFinite(e) ? Math.min(Math.max(0, e), a) : 0;
|
|
352
357
|
}
|
|
353
|
-
function
|
|
358
|
+
function Me({ anchorMs: e, toX: t, viewportWidth: n, timelineWidth: r }) {
|
|
354
359
|
let i = Number(n) > 0 ? Number(n) : 0;
|
|
355
360
|
if (!Number.isFinite(e) || typeof t != "function" || i <= 0) return 0;
|
|
356
361
|
let a = t(e);
|
|
357
|
-
return Number.isFinite(a) ?
|
|
362
|
+
return Number.isFinite(a) ? je(a - i / 2, i, r) : 0;
|
|
358
363
|
}
|
|
359
364
|
//#endregion
|
|
360
365
|
//#region src/components/Gantt/GanttChart/hooks/useGanttColumnVirtual.ts
|
|
361
|
-
function
|
|
366
|
+
function Ne(e) {
|
|
362
367
|
let t = Number(e);
|
|
363
368
|
return Math.max((Number.isFinite(t) && t > 0 ? t : 0) * 4, 240);
|
|
364
369
|
}
|
|
365
|
-
function
|
|
370
|
+
function Pe(e, t) {
|
|
366
371
|
if (!Array.isArray(e) || e.length === 0) return [];
|
|
367
|
-
let { scrollLeft: n = 0, viewportWidth: r = 0, pixelsPerDay: i } = t || {}, a =
|
|
372
|
+
let { scrollLeft: n = 0, viewportWidth: r = 0, pixelsPerDay: i } = t || {}, a = Ne(Number(e[0]?.width) > 0 ? Number(e[0].width) : i), o = e[e.length - 1], s = je(n, r, Number(o?.left) + Number(o?.width) > 0 ? Number(o.left) + Number(o.width) : 0), c = Math.max(0, s - a), l = s + r + a, u = e.length, d = 0, f = u - 1, p = u;
|
|
368
373
|
for (; d <= f;) {
|
|
369
374
|
let t = d + f >> 1, n = e[t];
|
|
370
375
|
n.left + n.width > c ? (p = t, f = t - 1) : d = t + 1;
|
|
@@ -380,9 +385,9 @@ function Ne(e, t) {
|
|
|
380
385
|
for (let e = p; e <= m; e += 1) h.push({ index: e });
|
|
381
386
|
return h;
|
|
382
387
|
}
|
|
383
|
-
function
|
|
388
|
+
function Fe({ lowerSegments: e, pixelsPerDay: t, scrollLeft: n, viewportWidth: r, showWeekendHighlight: i, timelineStartMs: a, timelineWidth: o, viewMode: c }) {
|
|
384
389
|
return {
|
|
385
|
-
virtualColumns: q(() =>
|
|
390
|
+
virtualColumns: q(() => Pe(e, {
|
|
386
391
|
scrollLeft: n,
|
|
387
392
|
viewportWidth: r,
|
|
388
393
|
pixelsPerDay: t
|
|
@@ -416,7 +421,7 @@ function Pe({ lowerSegments: e, pixelsPerDay: t, scrollLeft: n, viewportWidth: r
|
|
|
416
421
|
};
|
|
417
422
|
}
|
|
418
423
|
Q.extend(fe), Q.extend(me);
|
|
419
|
-
var
|
|
424
|
+
var Ie = {
|
|
420
425
|
day: {
|
|
421
426
|
amount: 1,
|
|
422
427
|
unit: "day"
|
|
@@ -469,7 +474,7 @@ var Fe = {
|
|
|
469
474
|
amount: 1,
|
|
470
475
|
unit: "minute"
|
|
471
476
|
}
|
|
472
|
-
},
|
|
477
|
+
}, Le = (e, t, n) => {
|
|
473
478
|
switch (t) {
|
|
474
479
|
case "halfDay": return e.hour() < 12 ? n("header.lower.halfDayAm") : n("header.lower.halfDayPm");
|
|
475
480
|
case "sixHour": {
|
|
@@ -485,7 +490,7 @@ var Fe = {
|
|
|
485
490
|
case "oneMinute": return e.format("mm");
|
|
486
491
|
default: return e.format("DD");
|
|
487
492
|
}
|
|
488
|
-
},
|
|
493
|
+
}, Re = (e, t, n) => {
|
|
489
494
|
let r = C(e.valueOf());
|
|
490
495
|
switch (t) {
|
|
491
496
|
case "day": return r.format("DD");
|
|
@@ -494,12 +499,12 @@ var Fe = {
|
|
|
494
499
|
case "quarterMonth": return D(e.valueOf(), n);
|
|
495
500
|
case "quarter": return n("header.lower.quarter", { quarter: r.quarter() });
|
|
496
501
|
case "year": return r.month() < 6 ? n("firstHalf") : n("secondHalf");
|
|
497
|
-
default: return
|
|
502
|
+
default: return Le(r, t, n);
|
|
498
503
|
}
|
|
499
|
-
},
|
|
504
|
+
}, ze = (e, t) => {
|
|
500
505
|
let n = C(e.valueOf()), r = y(t).headerLayout;
|
|
501
506
|
return r === "dayNested" ? `day-${n.format("YYYY-MM-DD")}` : r === "hourNested" ? `hour-${n.format("YYYY-MM-DD-HH")}` : r === "quarterNested" ? `quarter-${n.format("YYYY")}-Q${n.quarter()}` : t === "day" || t === "week" ? `month-${n.format("YYYY-MM")}` : `year-${n.format("YYYY")}`;
|
|
502
|
-
},
|
|
507
|
+
}, Be = (e, t, n) => {
|
|
503
508
|
let r = C(e.valueOf()), i = y(t).headerLayout;
|
|
504
509
|
return i === "dayNested" ? n("header.top.monthDay", {
|
|
505
510
|
month: r.month() + 1,
|
|
@@ -512,7 +517,7 @@ var Fe = {
|
|
|
512
517
|
year: r.year(),
|
|
513
518
|
month: r.month() + 1
|
|
514
519
|
}) : n("header.top.year", { year: r.year() });
|
|
515
|
-
},
|
|
520
|
+
}, Ve = (e, t, n, r, i, a, o) => {
|
|
516
521
|
let s = _(r), c = A ?? 100;
|
|
517
522
|
e.push({
|
|
518
523
|
id: `${r}-${t}`,
|
|
@@ -520,23 +525,23 @@ var Fe = {
|
|
|
520
525
|
endMs: n,
|
|
521
526
|
left: s ? e.length * c : M(t, i, a, r),
|
|
522
527
|
width: s ? c : Math.max(1, ee(t, n, a, r)),
|
|
523
|
-
label:
|
|
528
|
+
label: Re(Q(t), r, o)
|
|
524
529
|
});
|
|
525
|
-
},
|
|
526
|
-
let a = [], o =
|
|
530
|
+
}, He = ({ viewMode: e, timelineStartMs: t, timelineEndMs: n, pixelsPerDay: r, formatMessage: i }) => {
|
|
531
|
+
let a = [], o = Ie[e] || Ie.day, s = Q(ae(t));
|
|
527
532
|
_(e) && (s = s.startOf("month"));
|
|
528
533
|
let c = Q(ae(n));
|
|
529
534
|
for (; s.isBefore(c);) {
|
|
530
535
|
o.align && (s = o.align(s));
|
|
531
536
|
let n = s.add(o.amount, o.unit);
|
|
532
|
-
|
|
537
|
+
Ve(a, ie(s.valueOf()), ie(n.valueOf()), e, t, r, i), s = n;
|
|
533
538
|
}
|
|
534
539
|
return a;
|
|
535
|
-
},
|
|
540
|
+
}, Ue = ({ lowerSegments: e, viewMode: t, formatMessage: n }) => {
|
|
536
541
|
if (!Array.isArray(e) || e.length === 0) return [];
|
|
537
542
|
let r = [], i = null;
|
|
538
543
|
for (let a of e) {
|
|
539
|
-
let e = Q(a.startMs), o =
|
|
544
|
+
let e = Q(a.startMs), o = ze(e, t);
|
|
540
545
|
if (!i || i.key !== o) {
|
|
541
546
|
i && r.push({
|
|
542
547
|
id: i.key,
|
|
@@ -547,7 +552,7 @@ var Fe = {
|
|
|
547
552
|
key: o,
|
|
548
553
|
left: a.left,
|
|
549
554
|
width: a.width,
|
|
550
|
-
label:
|
|
555
|
+
label: Be(e, t, n)
|
|
551
556
|
};
|
|
552
557
|
continue;
|
|
553
558
|
}
|
|
@@ -559,25 +564,25 @@ var Fe = {
|
|
|
559
564
|
width: i.width,
|
|
560
565
|
label: i.label
|
|
561
566
|
}), r;
|
|
562
|
-
},
|
|
563
|
-
if (!
|
|
564
|
-
},
|
|
565
|
-
if (
|
|
567
|
+
}, We = (e) => Number.isFinite(e.startMs) && Number.isFinite(e.endMs) && e.startMs < e.endMs, Ge = (e) => {
|
|
568
|
+
if (!We(e)) throw RangeError("Timeline range must be finite and satisfy startMs < endMs");
|
|
569
|
+
}, Ke = (e, t) => {
|
|
570
|
+
if (Ge(e), !Number.isFinite(t)) throw RangeError("Timeline time must be finite");
|
|
566
571
|
return e.startMs <= t && t < e.endMs;
|
|
567
|
-
},
|
|
568
|
-
|
|
572
|
+
}, qe = (e, t) => (Ge(e), Ge(t), e.startMs < t.endMs && t.startMs < e.endMs), Je = (e, t) => {
|
|
573
|
+
Ge(e), Ge(t);
|
|
569
574
|
let n = Math.max(e.startMs, t.startMs), r = Math.min(e.endMs, t.endMs);
|
|
570
575
|
return n < r ? {
|
|
571
576
|
startMs: n,
|
|
572
577
|
endMs: r
|
|
573
578
|
} : null;
|
|
574
|
-
}, Je = (e, t) => {
|
|
575
|
-
if (!Number.isFinite(e) || e <= 0) throw RangeError(`${t} must be finite and greater than zero`);
|
|
576
579
|
}, Ye = (e, t) => {
|
|
580
|
+
if (!Number.isFinite(e) || e <= 0) throw RangeError(`${t} must be finite and greater than zero`);
|
|
581
|
+
}, Xe = (e, t) => {
|
|
577
582
|
if (Number.isFinite(e)) return e;
|
|
578
583
|
if (Number.isFinite(t)) return t;
|
|
579
584
|
throw RangeError("focusMs or fallbackFocusMs must be finite");
|
|
580
|
-
},
|
|
585
|
+
}, Ze = ({ startMs: e, endMs: t, viewMode: n, viewportWidth: r, pixelsPerDay: i }) => {
|
|
581
586
|
let a = (t - e) / s;
|
|
582
587
|
if (a * i >= r) return {
|
|
583
588
|
startMs: e,
|
|
@@ -585,24 +590,24 @@ var Fe = {
|
|
|
585
590
|
};
|
|
586
591
|
let o = Math.ceil(r / i), c = Math.ceil((o - a) / 2) * s;
|
|
587
592
|
return S(e - c, t + c, n);
|
|
588
|
-
},
|
|
593
|
+
}, Qe = ({ range: e, focusMs: t, viewMode: n, viewportWidth: r, pixelsPerDay: i }) => {
|
|
589
594
|
let a = (r / 2 + 281) / i * s;
|
|
590
|
-
return
|
|
595
|
+
return Ze({
|
|
591
596
|
...S(Math.min(e.startMs, t - a), Math.max(e.endMs, t + a), n),
|
|
592
597
|
viewMode: n,
|
|
593
598
|
viewportWidth: r,
|
|
594
599
|
pixelsPerDay: i
|
|
595
600
|
});
|
|
596
|
-
},
|
|
597
|
-
if (!
|
|
601
|
+
}, $e = ({ renderWindow: e, timelineCoords: t, scrollLeft: n, viewportWidth: r }) => {
|
|
602
|
+
if (!We(e)) throw RangeError("renderWindow must be a valid timeline range");
|
|
598
603
|
if (!Number.isFinite(n) || n < 0) throw RangeError("scrollLeft must be finite and non-negative");
|
|
599
|
-
|
|
604
|
+
Ye(r, "viewportWidth");
|
|
600
605
|
let i = {
|
|
601
606
|
startMs: t.timeAtX(n),
|
|
602
607
|
endMs: t.timeAtX(n + r)
|
|
603
608
|
};
|
|
604
|
-
if (!
|
|
605
|
-
let a =
|
|
609
|
+
if (!We(i)) throw RangeError("TimelineCoords must produce an increasing finite visible range");
|
|
610
|
+
let a = Je(i, e);
|
|
606
611
|
if (!a) throw RangeError("Visible range must intersect renderWindow");
|
|
607
612
|
let o = t.timeAtX(n + r / 2);
|
|
608
613
|
if (!Number.isFinite(o)) throw RangeError("TimelineCoords must produce a finite focus");
|
|
@@ -611,65 +616,65 @@ var Fe = {
|
|
|
611
616
|
visibleRange: a,
|
|
612
617
|
focusMs: o
|
|
613
618
|
};
|
|
614
|
-
},
|
|
619
|
+
}, et = ({ scrollLeft: e, viewportWidth: t, timelineWidth: n, guardBandPx: r }) => {
|
|
615
620
|
if (!Number.isFinite(e) || e < 0) throw RangeError("scrollLeft must be finite and non-negative");
|
|
616
|
-
if (
|
|
621
|
+
if (Ye(t, "viewportWidth"), Ye(n, "timelineWidth"), !Number.isFinite(r) || r < 0) throw RangeError("guardBandPx must be finite and non-negative");
|
|
617
622
|
let i = Math.max(0, n - t);
|
|
618
623
|
if (i === 0) return null;
|
|
619
624
|
let a = Math.min(e, i), o = a <= r;
|
|
620
625
|
return o === i - a <= r ? null : o ? "left" : "right";
|
|
621
|
-
},
|
|
622
|
-
|
|
623
|
-
let o =
|
|
626
|
+
}, tt = ({ focusMs: e, fallbackFocusMs: t, viewMode: n, timeRangeConfig: r, viewportWidth: i, pixelsPerDay: a }) => {
|
|
627
|
+
Ye(i, "viewportWidth"), Ye(a, "pixelsPerDay");
|
|
628
|
+
let o = Xe(e, t), s = Qe({
|
|
624
629
|
range: j(r, o),
|
|
625
630
|
focusMs: o,
|
|
626
631
|
viewMode: n,
|
|
627
632
|
viewportWidth: i,
|
|
628
633
|
pixelsPerDay: a
|
|
629
634
|
});
|
|
630
|
-
if (!
|
|
635
|
+
if (!We(s)) throw RangeError("Viewport engine produced an invalid render window");
|
|
631
636
|
return s;
|
|
632
|
-
},
|
|
633
|
-
let a =
|
|
634
|
-
return
|
|
637
|
+
}, nt = ({ focusMs: e, fallbackFocusMs: t, timelineCoords: n, viewportWidth: r, timelineWidth: i }) => {
|
|
638
|
+
let a = Xe(e, t);
|
|
639
|
+
return Ye(r, "viewportWidth"), Ye(i, "timelineWidth"), {
|
|
635
640
|
focusMs: a,
|
|
636
|
-
scrollLeft:
|
|
641
|
+
scrollLeft: Me({
|
|
637
642
|
anchorMs: a,
|
|
638
643
|
toX: n.toX,
|
|
639
644
|
viewportWidth: r,
|
|
640
645
|
timelineWidth: i
|
|
641
646
|
})
|
|
642
647
|
};
|
|
643
|
-
},
|
|
648
|
+
}, rt = (e) => {
|
|
644
649
|
if (v(e)) {
|
|
645
650
|
let t = g(e);
|
|
646
651
|
return Se(Date.now(), t, "floor") + t / 2;
|
|
647
652
|
}
|
|
648
653
|
return T(Date.now()) + s / 2;
|
|
649
|
-
},
|
|
654
|
+
}, it = (e, t) => {
|
|
650
655
|
if (v(t)) {
|
|
651
656
|
let n = g(t);
|
|
652
657
|
return Se(e, n, "floor") + n + 1;
|
|
653
658
|
}
|
|
654
659
|
return T(e) + s + 1;
|
|
655
|
-
},
|
|
656
|
-
let [t, n] = Y(() =>
|
|
660
|
+
}, at = (e) => {
|
|
661
|
+
let [t, n] = Y(() => rt(e)), r = J(null), i = G(() => {
|
|
657
662
|
r.current &&= (clearTimeout(r.current), null);
|
|
658
663
|
}, []), a = G(() => {
|
|
659
664
|
i();
|
|
660
|
-
let t = Date.now(), o =
|
|
665
|
+
let t = Date.now(), o = it(t, e);
|
|
661
666
|
r.current = setTimeout(() => {
|
|
662
|
-
n(
|
|
667
|
+
n(rt(e)), a();
|
|
663
668
|
}, Math.max(1, o - t));
|
|
664
669
|
}, [i, e]);
|
|
665
|
-
K(() => (n(
|
|
670
|
+
K(() => (n(rt(e)), a(), i), [
|
|
666
671
|
e,
|
|
667
672
|
a,
|
|
668
673
|
i
|
|
669
674
|
]);
|
|
670
675
|
let o = le();
|
|
671
676
|
return K(() => {
|
|
672
|
-
o === "visible" && (n(
|
|
677
|
+
o === "visible" && (n(rt(e)), a());
|
|
673
678
|
}, [
|
|
674
679
|
o,
|
|
675
680
|
a,
|
|
@@ -678,7 +683,7 @@ var Fe = {
|
|
|
678
683
|
};
|
|
679
684
|
//#endregion
|
|
680
685
|
//#region src/components/Gantt/GanttChart/hooks/useTimelineViewportController.ts
|
|
681
|
-
function
|
|
686
|
+
function ot({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef: r, contentSize: i, headerTrackRef: a, formatMessage: o, isHorizontalScrollbarInteracting: s, isTaskBarInteracting: c = !1 }) {
|
|
682
687
|
let l = k(n, t), u = q(() => re(n, e), [n, e]), d = i?.width !== null && i?.width !== void 0 && Number(i.width) > 0 ? Number(i.width) : 0, f = J(!1), [p, m] = Y(!1), [h, g] = Y(d), _ = J(null), v = J(!1), y = J(!1), b = J(null), x = J(null), S = J(null), [C, w] = Y(0), T = G((e) => {
|
|
683
688
|
let t = S.current;
|
|
684
689
|
if (!t || !e) return !1;
|
|
@@ -707,12 +712,12 @@ function at({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef
|
|
|
707
712
|
}, [E]);
|
|
708
713
|
let [ie, ae] = Y(null), P = J(n), oe = P.current === n, F = oe ? ie : null, I = G(() => {
|
|
709
714
|
let e = _.current;
|
|
710
|
-
return e !== null && Number.isFinite(e) ? e :
|
|
715
|
+
return e !== null && Number.isFinite(e) ? e : rt(n);
|
|
711
716
|
}, [n]), L = G((e) => {
|
|
712
717
|
Number.isFinite(e) && (_.current = e);
|
|
713
718
|
}, []), R = G((e) => {
|
|
714
719
|
S.current = null;
|
|
715
|
-
let t =
|
|
720
|
+
let t = tt({
|
|
716
721
|
focusMs: e,
|
|
717
722
|
fallbackFocusMs: I(),
|
|
718
723
|
viewMode: n,
|
|
@@ -738,7 +743,7 @@ function at({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef
|
|
|
738
743
|
i?.width,
|
|
739
744
|
h
|
|
740
745
|
]);
|
|
741
|
-
let z = q(() => F ||
|
|
746
|
+
let z = q(() => F || tt({
|
|
742
747
|
focusMs: I(),
|
|
743
748
|
viewMode: n,
|
|
744
749
|
timeRangeConfig: u,
|
|
@@ -754,7 +759,7 @@ function at({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef
|
|
|
754
759
|
]), { timelineStartMs: B, timelineEndMs: V } = q(() => ({
|
|
755
760
|
timelineStartMs: z.startMs,
|
|
756
761
|
timelineEndMs: z.endMs
|
|
757
|
-
}), [z]), H = q(() =>
|
|
762
|
+
}), [z]), H = q(() => He({
|
|
758
763
|
viewMode: n,
|
|
759
764
|
timelineStartMs: B,
|
|
760
765
|
timelineEndMs: V,
|
|
@@ -790,7 +795,7 @@ function at({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef
|
|
|
790
795
|
I,
|
|
791
796
|
R
|
|
792
797
|
]);
|
|
793
|
-
let X =
|
|
798
|
+
let X = at(n), le = q(() => W <= 0 ? null : U.toX(X), [
|
|
794
799
|
X,
|
|
795
800
|
U,
|
|
796
801
|
W
|
|
@@ -802,7 +807,7 @@ function at({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef
|
|
|
802
807
|
}, [ue, D]), Z = G(() => {
|
|
803
808
|
let e = r.current, t = h;
|
|
804
809
|
if (!e || t <= 0 || W <= 0) return !1;
|
|
805
|
-
let { scrollLeft: n } =
|
|
810
|
+
let { scrollLeft: n } = nt({
|
|
806
811
|
focusMs: _.current ?? NaN,
|
|
807
812
|
fallbackFocusMs: I(),
|
|
808
813
|
timelineCoords: U,
|
|
@@ -822,8 +827,8 @@ function at({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef
|
|
|
822
827
|
r && E(), !i && f.current && (y.current = !0), ue(t);
|
|
823
828
|
let a = t !== j.current;
|
|
824
829
|
if (j.current = t, a && ne(t), n > 0 && !i) {
|
|
825
|
-
let e =
|
|
826
|
-
L(
|
|
830
|
+
let e = je(t, n, W);
|
|
831
|
+
L($e({
|
|
827
832
|
renderWindow: {
|
|
828
833
|
startMs: B,
|
|
829
834
|
endMs: V
|
|
@@ -846,7 +851,7 @@ function at({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef
|
|
|
846
851
|
B,
|
|
847
852
|
W
|
|
848
853
|
]), fe = G(() => {
|
|
849
|
-
let e =
|
|
854
|
+
let e = rt(n);
|
|
850
855
|
L(e), R(e);
|
|
851
856
|
}, [
|
|
852
857
|
R,
|
|
@@ -860,7 +865,7 @@ function at({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef
|
|
|
860
865
|
S.current = null, L(n), R(n);
|
|
861
866
|
return;
|
|
862
867
|
}
|
|
863
|
-
let a =
|
|
868
|
+
let a = Me({
|
|
864
869
|
anchorMs: n,
|
|
865
870
|
toX: U.toX,
|
|
866
871
|
viewportWidth: i,
|
|
@@ -889,7 +894,7 @@ function at({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef
|
|
|
889
894
|
]);
|
|
890
895
|
K(() => {
|
|
891
896
|
if (!f.current || !h || !W || v.current || !y.current) return;
|
|
892
|
-
let e = r.current, t = e?.scrollLeft ?? O, n =
|
|
897
|
+
let e = r.current, t = e?.scrollLeft ?? O, n = et({
|
|
893
898
|
scrollLeft: Math.max(0, t),
|
|
894
899
|
viewportWidth: h,
|
|
895
900
|
timelineWidth: W,
|
|
@@ -922,7 +927,7 @@ function at({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef
|
|
|
922
927
|
ie
|
|
923
928
|
]), ce(() => {
|
|
924
929
|
if (!f.current && h > 0 && W > 0) {
|
|
925
|
-
if (Number.isFinite(_.current ?? NaN) || L(
|
|
930
|
+
if (Number.isFinite(_.current ?? NaN) || L(rt(n)), !ie) {
|
|
926
931
|
R(I());
|
|
927
932
|
return;
|
|
928
933
|
}
|
|
@@ -969,7 +974,7 @@ function at({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef
|
|
|
969
974
|
]), ge = G(() => {
|
|
970
975
|
let e = r.current;
|
|
971
976
|
if (!e) return;
|
|
972
|
-
let t = h, n = e.scrollLeft || 0, i = Math.max(0, W - t), a =
|
|
977
|
+
let t = h, n = e.scrollLeft || 0, i = Math.max(0, W - t), a = je(n + t, t, W);
|
|
973
978
|
if (Math.abs(a - n) <= 1) {
|
|
974
979
|
if (S.current = null, a >= i - 1) {
|
|
975
980
|
let e = U.timeAtX(n + t * 1.5);
|
|
@@ -998,7 +1003,7 @@ function at({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef
|
|
|
998
1003
|
};
|
|
999
1004
|
return e.addEventListener("scrollend", t), () => e.removeEventListener("scrollend", t);
|
|
1000
1005
|
}, [r]);
|
|
1001
|
-
let _e = (!oe || v.current) && W > 0 && h > 0 ?
|
|
1006
|
+
let _e = (!oe || v.current) && W > 0 && h > 0 ? nt({
|
|
1002
1007
|
focusMs: _.current ?? NaN,
|
|
1003
1008
|
fallbackFocusMs: I(),
|
|
1004
1009
|
timelineCoords: U,
|
|
@@ -1009,7 +1014,7 @@ function at({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef
|
|
|
1009
1014
|
visibleStartMs: B,
|
|
1010
1015
|
visibleEndMs: B
|
|
1011
1016
|
};
|
|
1012
|
-
let e =
|
|
1017
|
+
let e = je(_e, h, W), { visibleRange: t } = $e({
|
|
1013
1018
|
renderWindow: {
|
|
1014
1019
|
startMs: B,
|
|
1015
1020
|
endMs: V
|
|
@@ -1053,7 +1058,7 @@ function at({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef
|
|
|
1053
1058
|
}
|
|
1054
1059
|
//#endregion
|
|
1055
1060
|
//#region src/components/Gantt/GanttChart/hooks/useNormalizedItems.ts
|
|
1056
|
-
function
|
|
1061
|
+
function st({ visibleItems: e, committedRangeById: t = {}, viewMode: n = "day" }) {
|
|
1057
1062
|
return { normalizedItems: q(() => {
|
|
1058
1063
|
let r = Array.isArray(e) ? e : [], i = [], a = b(n) ? n : "day";
|
|
1059
1064
|
for (let e = 0; e < r.length; e++) {
|
|
@@ -1093,7 +1098,7 @@ function ot({ visibleItems: e, committedRangeById: t = {}, viewMode: n = "day" }
|
|
|
1093
1098
|
}
|
|
1094
1099
|
//#endregion
|
|
1095
1100
|
//#region src/components/Gantt/GanttChart/hooks/useGanttScrollbars.tsx
|
|
1096
|
-
function
|
|
1101
|
+
function ct(e, t) {
|
|
1097
1102
|
let [n, r] = Y(!1);
|
|
1098
1103
|
return ce(() => {
|
|
1099
1104
|
let n = e.current, i = t.current;
|
|
@@ -1120,11 +1125,11 @@ function st(e, t) {
|
|
|
1120
1125
|
}
|
|
1121
1126
|
//#endregion
|
|
1122
1127
|
//#region src/components/Gantt/GanttChart/utils/timelineMarkers.ts
|
|
1123
|
-
function
|
|
1124
|
-
return !!e && Number.isFinite(r) &&
|
|
1128
|
+
function lt(e, t, n, r, i) {
|
|
1129
|
+
return !!e && Number.isFinite(r) && Ke(i, r) && t !== null && Number.isFinite(t) && t >= 0 && t <= n;
|
|
1125
1130
|
}
|
|
1126
|
-
var
|
|
1127
|
-
let g = q(() =>
|
|
1131
|
+
var ut = H.memo(({ timelineWidth: e, viewportWidth: t = 0, scrollLeft: n, trackRef: r, virtualColumns: i, lowerSegments: a, todayLineLeft: o, todayCenterMs: s, showTodayLine: c, viewMode: l, availableModes: u, formatMessage: d, onViewModeChange: f, onTodayClick: p, onScrollPrev: m, onScrollNext: h }) => {
|
|
1132
|
+
let g = q(() => Ue({
|
|
1128
1133
|
lowerSegments: a,
|
|
1129
1134
|
viewMode: l,
|
|
1130
1135
|
formatMessage: d
|
|
@@ -1133,14 +1138,14 @@ var lt = H.memo(({ timelineWidth: e, viewportWidth: t = 0, scrollLeft: n, trackR
|
|
|
1133
1138
|
l,
|
|
1134
1139
|
d
|
|
1135
1140
|
]), _ = q(() => {
|
|
1136
|
-
let r =
|
|
1141
|
+
let r = je(n, t, e), i = r - 240, a = r + t + 240;
|
|
1137
1142
|
return g.filter((e) => e.left < a && e.left + e.width > i);
|
|
1138
1143
|
}, [
|
|
1139
1144
|
g,
|
|
1140
1145
|
n,
|
|
1141
1146
|
t,
|
|
1142
1147
|
e
|
|
1143
|
-
]), v = q(() => a.length && a.find((e) => s != null && s >= e.startMs && s < e.endMs)?.id || null, [a, s]), y = a[0]?.startMs ?? 0, b = a[a.length - 1]?.endMs ?? 0, x =
|
|
1148
|
+
]), v = q(() => a.length && a.find((e) => s != null && s >= e.startMs && s < e.endMs)?.id || null, [a, s]), y = a[0]?.startMs ?? 0, b = a[a.length - 1]?.endMs ?? 0, x = lt(c, o, e, s ?? NaN, {
|
|
1144
1149
|
startMs: y,
|
|
1145
1150
|
endMs: b
|
|
1146
1151
|
});
|
|
@@ -1215,7 +1220,7 @@ var lt = H.memo(({ timelineWidth: e, viewportWidth: t = 0, scrollLeft: n, trackR
|
|
|
1215
1220
|
});
|
|
1216
1221
|
//#endregion
|
|
1217
1222
|
//#region src/components/Gantt/GanttChart/hooks/useGanttRowVirtualScroll.ts
|
|
1218
|
-
function
|
|
1223
|
+
function dt({ items: e, contentRef: t, safeRowHeight: n, viewportHeight: r, overscan: i = 4 }) {
|
|
1219
1224
|
let [a, o] = Y(!1), s = pe({
|
|
1220
1225
|
count: e.length,
|
|
1221
1226
|
getScrollElement: () => t.current,
|
|
@@ -1234,7 +1239,7 @@ function ut({ items: e, contentRef: t, safeRowHeight: n, viewportHeight: r, over
|
|
|
1234
1239
|
}
|
|
1235
1240
|
//#endregion
|
|
1236
1241
|
//#region src/components/Gantt/GanttChart/hooks/useOffscreenIndicators.ts
|
|
1237
|
-
function
|
|
1242
|
+
function ft({ virtualRows: e, normalizedItems: t, visibleStartMs: n, visibleEndMs: r, enabled: i = !0, excludeTaskId: a = null }) {
|
|
1238
1243
|
return q(() => {
|
|
1239
1244
|
if (!i || !Array.isArray(e) || !Array.isArray(t) || !Number.isFinite(n) || !Number.isFinite(r) || n >= r) return [];
|
|
1240
1245
|
let o = [];
|
|
@@ -1263,7 +1268,7 @@ function dt({ virtualRows: e, normalizedItems: t, visibleStartMs: n, visibleEndM
|
|
|
1263
1268
|
}
|
|
1264
1269
|
//#endregion
|
|
1265
1270
|
//#region src/components/Gantt/GanttChart/hooks/useRowHoverHighlight.ts
|
|
1266
|
-
function
|
|
1271
|
+
function pt({ normalizedItems: e, safeRowHeight: t }) {
|
|
1267
1272
|
let n = Z(d, (e) => e.setHighlightTarget), r = Z(d, (e) => e.subscribeHighlight), i = Z(d, (e) => e.getIsScrollActive), a = J(null), o = J(null), s = J(null), c = J(!1), l = q(() => {
|
|
1268
1273
|
let t = /* @__PURE__ */ new Map(), n = 0;
|
|
1269
1274
|
for (; n < e.length;) {
|
|
@@ -1350,14 +1355,14 @@ function ft({ normalizedItems: e, safeRowHeight: t }) {
|
|
|
1350
1355
|
}
|
|
1351
1356
|
//#endregion
|
|
1352
1357
|
//#region src/components/Gantt/GanttChart/GanttInteractionContext.ts
|
|
1353
|
-
var
|
|
1358
|
+
var mt = de({
|
|
1354
1359
|
tooltip: null,
|
|
1355
1360
|
isScrolling: !1,
|
|
1356
1361
|
collapsedKeys: void 0,
|
|
1357
1362
|
onBarClick: () => {},
|
|
1358
1363
|
onTaskMouseDown: () => {},
|
|
1359
1364
|
onResizeMouseDown: () => {}
|
|
1360
|
-
}),
|
|
1365
|
+
}), ht = (e) => Z(mt, e), gt = de({
|
|
1361
1366
|
viewMode: "day",
|
|
1362
1367
|
pixelsPerDay: 1,
|
|
1363
1368
|
timelineStartMs: 0,
|
|
@@ -1373,14 +1378,14 @@ var pt = de({
|
|
|
1373
1378
|
viewportWidth: 0,
|
|
1374
1379
|
timelineWidth: 0,
|
|
1375
1380
|
isInitialLayoutReady: !1
|
|
1376
|
-
}), $ = (e) => Z(
|
|
1381
|
+
}), $ = (e) => Z(gt, e), _t = (e, t) => {
|
|
1377
1382
|
let n = e.replace("#", ""), r = n.length === 3 ? n.split("").map((e) => e + e).join("") : n;
|
|
1378
1383
|
return `rgba(${parseInt(r.slice(0, 2), 16)}, ${parseInt(r.slice(2, 4), 16)}, ${parseInt(r.slice(4, 6), 16)}, ${t})`;
|
|
1379
|
-
},
|
|
1384
|
+
}, vt = (e, t) => {
|
|
1380
1385
|
if (!R(e)) return null;
|
|
1381
1386
|
let n = e.trim();
|
|
1382
|
-
return i.test(n) ?
|
|
1383
|
-
},
|
|
1387
|
+
return i.test(n) ? _t(n, t) : null;
|
|
1388
|
+
}, yt = (e, t = 2.5) => {
|
|
1384
1389
|
if (!e || !R(e)) return "#121211";
|
|
1385
1390
|
let n, r, i;
|
|
1386
1391
|
if (e.startsWith("#")) {
|
|
@@ -1399,22 +1404,22 @@ var pt = de({
|
|
|
1399
1404
|
return t <= .04045 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
1400
1405
|
};
|
|
1401
1406
|
return 1.05 / (.2126 * a(n) + .7152 * a(r) + .0722 * a(i) + .05) >= t ? "#ffffff" : "#121211";
|
|
1402
|
-
},
|
|
1403
|
-
if (
|
|
1407
|
+
}, bt, xt = () => {
|
|
1408
|
+
if (bt !== void 0) return bt;
|
|
1404
1409
|
try {
|
|
1405
|
-
|
|
1410
|
+
bt = document.createElement("canvas").getContext("2d");
|
|
1406
1411
|
} catch {
|
|
1407
|
-
|
|
1412
|
+
bt = null;
|
|
1408
1413
|
}
|
|
1409
|
-
return
|
|
1410
|
-
},
|
|
1414
|
+
return bt;
|
|
1415
|
+
}, St = (e, t = "12px -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, PingFang SC, Noto Sans, Noto Sans CJK SC, Microsoft YaHei, \"微软雅黑\", sans-serif") => {
|
|
1411
1416
|
if (!e) return 0;
|
|
1412
|
-
let n = String(e), r =
|
|
1417
|
+
let n = String(e), r = xt();
|
|
1413
1418
|
return r ? (r.font = t, r.measureText(n).width + 20) : n.length * 12 + 20;
|
|
1414
1419
|
};
|
|
1415
1420
|
//#endregion
|
|
1416
1421
|
//#region src/components/Gantt/GanttChart/hooks/useBarTooltipHover.ts
|
|
1417
|
-
function
|
|
1422
|
+
function Ct() {
|
|
1418
1423
|
let [e, t] = Y(null), n = J("idle"), r = G((e) => {
|
|
1419
1424
|
n.current === "frozen" && (n.current = "open");
|
|
1420
1425
|
let r = e.currentTarget.getBoundingClientRect();
|
|
@@ -1451,13 +1456,13 @@ function St() {
|
|
|
1451
1456
|
}
|
|
1452
1457
|
//#endregion
|
|
1453
1458
|
//#region src/components/Gantt/GanttChart/GanttBarTooltip/GanttBarTooltip.tsx
|
|
1454
|
-
var
|
|
1459
|
+
var wt = {
|
|
1455
1460
|
borderRadius: "10px",
|
|
1456
1461
|
padding: 0,
|
|
1457
1462
|
backgroundColor: "#fff",
|
|
1458
1463
|
boxShadow: "0 0 12px 0 rgba(0, 0, 0, 0.08)"
|
|
1459
|
-
},
|
|
1460
|
-
let { virtualReference: a, handleMouseMove: o, handleMouseLeave: s, handleTooltipVisibleChange: c } =
|
|
1464
|
+
}, Tt = ({ item: e, tooltip: t, disabled: r = !1, children: i }) => {
|
|
1465
|
+
let { virtualReference: a, handleMouseMove: o, handleMouseLeave: s, handleTooltipVisibleChange: c } = Ct(), l = q(() => r || !t ? null : t(e), [
|
|
1461
1466
|
r,
|
|
1462
1467
|
t,
|
|
1463
1468
|
e
|
|
@@ -1474,7 +1479,7 @@ var Ct = {
|
|
|
1474
1479
|
zIndex: 8001,
|
|
1475
1480
|
virtualReference: a,
|
|
1476
1481
|
onVisibleChange: c,
|
|
1477
|
-
style:
|
|
1482
|
+
style: wt,
|
|
1478
1483
|
children: i({
|
|
1479
1484
|
onMouseMove: o,
|
|
1480
1485
|
onMouseLeave: s
|
|
@@ -1483,14 +1488,14 @@ var Ct = {
|
|
|
1483
1488
|
onMouseMove: () => {},
|
|
1484
1489
|
onMouseLeave: () => {}
|
|
1485
1490
|
}) });
|
|
1486
|
-
},
|
|
1491
|
+
}, Et = (e, t, n) => ({
|
|
1487
1492
|
...e,
|
|
1488
1493
|
clientX: t,
|
|
1489
1494
|
clientY: n,
|
|
1490
1495
|
preventDefault: () => e.preventDefault(),
|
|
1491
1496
|
stopPropagation: () => e.stopPropagation()
|
|
1492
1497
|
});
|
|
1493
|
-
function
|
|
1498
|
+
function Dt({ enabled: e, onTaskMouseDown: t, onBarClick: n }) {
|
|
1494
1499
|
let r = J(null), i = J(null), a = J(t), o = J(n);
|
|
1495
1500
|
K(() => {
|
|
1496
1501
|
a.current = t, o.current = n;
|
|
@@ -1515,7 +1520,7 @@ function Et({ enabled: e, onTaskMouseDown: t, onBarClick: n }) {
|
|
|
1515
1520
|
let d = (e) => {
|
|
1516
1521
|
if (r.current !== u || u.dragStarted) return;
|
|
1517
1522
|
let t = e.clientX - u.startClientX, i = e.clientY - u.startClientY;
|
|
1518
|
-
Math.hypot(t, i) < 5 || (u.dragStarted = !0, s(), a.current?.(
|
|
1523
|
+
Math.hypot(t, i) < 5 || (u.dragStarted = !0, s(), a.current?.(Et(e, u.startClientX, u.startClientY), n, c, u.width));
|
|
1519
1524
|
}, f = (e) => {
|
|
1520
1525
|
r.current === u && (s(), u.dragStarted || o.current?.(e, n));
|
|
1521
1526
|
};
|
|
@@ -1525,18 +1530,18 @@ function Et({ enabled: e, onTaskMouseDown: t, onBarClick: n }) {
|
|
|
1525
1530
|
}, document.addEventListener("mousemove", d), document.addEventListener("mouseup", f);
|
|
1526
1531
|
}, [e, s]) };
|
|
1527
1532
|
}
|
|
1528
|
-
var
|
|
1529
|
-
let { t: o } = t(), s = $((e) => e.viewMode), c = $((e) => e.timelineCoords), l = $((e) => e.timelineStartMs), u = $((e) => e.timelineEndMs), d = $((e) => e.timelineWidth), f =
|
|
1533
|
+
var Ot = H.memo(({ item: e, barTop: n, dragTaskId: r, dragPreview: i, dragPermission: a }) => {
|
|
1534
|
+
let { t: o } = t(), s = $((e) => e.viewMode), c = $((e) => e.timelineCoords), l = $((e) => e.timelineStartMs), u = $((e) => e.timelineEndMs), d = $((e) => e.timelineWidth), f = ht((e) => e.tooltip), p = ht((e) => e.isScrolling), m = ht((e) => e.onBarClick), h = ht((e) => e.onTaskMouseDown), g = ht((e) => e.onResizeMouseDown), _ = p ? null : f, v = r === e.id, y = v && i ? i.previewStartMs : e.startMs, b = v && i ? i.previewEndMs : e.endMs, S = q(() => {
|
|
1530
1535
|
let t = e.color;
|
|
1531
1536
|
return {
|
|
1532
1537
|
baseColor: t,
|
|
1533
|
-
containerBgColor:
|
|
1534
|
-
hoverBorderColor:
|
|
1535
|
-
insideLabelColor:
|
|
1538
|
+
containerBgColor: vt(t, .2) || t,
|
|
1539
|
+
hoverBorderColor: vt(t, .5) || "transparent",
|
|
1540
|
+
insideLabelColor: yt(t)
|
|
1536
1541
|
};
|
|
1537
1542
|
}, [e.color]), C = q(() => {
|
|
1538
1543
|
if (y == null || b == null || y >= b || l >= u) return null;
|
|
1539
|
-
let e =
|
|
1544
|
+
let e = Je({
|
|
1540
1545
|
startMs: y,
|
|
1541
1546
|
endMs: b
|
|
1542
1547
|
}, {
|
|
@@ -1562,7 +1567,7 @@ var Dt = H.memo(({ item: e, barTop: n, dragTaskId: r, dragPreview: i, dragPermis
|
|
|
1562
1567
|
c,
|
|
1563
1568
|
v,
|
|
1564
1569
|
i
|
|
1565
|
-
]), { baseColor: w, containerBgColor: T, hoverBorderColor: ee, insideLabelColor: E } = S, D = C?.calculatedBarWidth ?? 0, O = e.progress === null, k = !C || y === null || b === null ? 0 : Math.max(0, Math.min(1, (C.rawBarLeft + c.toWidth(C.clippedRange.startMs, Math.min(C.clippedRange.endMs, Math.max(C.clippedRange.startMs, y + (b - y) * Math.max(0, e.progress ?? 0)))) - C.calculatedBarLeft) / C.calculatedBarWidth)), A = O || k >= 1, j = A ? "100%" : `${k * 100}%`, M = a || _e, N = M.canMove, te = e.label ?? "", ne = typeof te == "string" ? te : "", re = D < 40, ie = Math.max(0, D - 10), ae = q(() => ne ?
|
|
1570
|
+
]), { baseColor: w, containerBgColor: T, hoverBorderColor: ee, insideLabelColor: E } = S, D = C?.calculatedBarWidth ?? 0, O = e.progress === null, k = !C || y === null || b === null ? 0 : Math.max(0, Math.min(1, (C.rawBarLeft + c.toWidth(C.clippedRange.startMs, Math.min(C.clippedRange.endMs, Math.max(C.clippedRange.startMs, y + (b - y) * Math.max(0, e.progress ?? 0)))) - C.calculatedBarLeft) / C.calculatedBarWidth)), A = O || k >= 1, j = A ? "100%" : `${k * 100}%`, M = a || _e, N = M.canMove, te = e.label ?? "", ne = typeof te == "string" ? te : "", re = D < 40, ie = Math.max(0, D - 10), ae = q(() => ne ? St(ne) : 0, [ne]), P = !!ne && ae > ie && !!C && C.calculatedBarLeft + C.calculatedBarWidth + 4 + ae <= d, { handlePointerMouseDown: oe } = Dt({
|
|
1566
1571
|
enabled: N,
|
|
1567
1572
|
onTaskMouseDown: h,
|
|
1568
1573
|
onBarClick: m
|
|
@@ -1580,7 +1585,7 @@ var Dt = H.memo(({ item: e, barTop: n, dragTaskId: r, dragPreview: i, dragPermis
|
|
|
1580
1585
|
"--bsy-gantt-bar-calc-width": `${D}px`,
|
|
1581
1586
|
"--bsy-gantt-bar-label-color": E
|
|
1582
1587
|
};
|
|
1583
|
-
return /* @__PURE__ */ B(
|
|
1588
|
+
return /* @__PURE__ */ B(Tt, {
|
|
1584
1589
|
item: e,
|
|
1585
1590
|
tooltip: _,
|
|
1586
1591
|
disabled: v,
|
|
@@ -1632,21 +1637,21 @@ var Dt = H.memo(({ item: e, barTop: n, dragTaskId: r, dragPreview: i, dragPermis
|
|
|
1632
1637
|
if (e.barTop !== t.barTop || e.dragTaskId !== t.dragTaskId || e.dragPermission?.canMove !== t.dragPermission?.canMove || e.dragPermission?.canResizeStart !== t.dragPermission?.canResizeStart || e.dragPermission?.canResizeEnd !== t.dragPermission?.canResizeEnd || e.item !== t.item) return !1;
|
|
1633
1638
|
let n = e.dragPreview, r = t.dragPreview;
|
|
1634
1639
|
return !(n !== r && (!n || !r || n.previewStartMs !== r.previewStartMs || n.previewEndMs !== r.previewEndMs || n.previewLeftPx !== r.previewLeftPx));
|
|
1635
|
-
}),
|
|
1636
|
-
function
|
|
1640
|
+
}), kt = (e) => String(e).padStart(2, "0");
|
|
1641
|
+
function At(e, t) {
|
|
1637
1642
|
if (e == null) return t("summary.empty");
|
|
1638
1643
|
let n = C(e);
|
|
1639
1644
|
return t("summary.datetime", {
|
|
1640
1645
|
year: n.year(),
|
|
1641
|
-
month:
|
|
1642
|
-
day:
|
|
1643
|
-
hour:
|
|
1644
|
-
minute:
|
|
1645
|
-
second:
|
|
1646
|
+
month: kt(n.month() + 1),
|
|
1647
|
+
day: kt(n.date()),
|
|
1648
|
+
hour: kt(n.hour()),
|
|
1649
|
+
minute: kt(n.minute()),
|
|
1650
|
+
second: kt(n.second())
|
|
1646
1651
|
});
|
|
1647
1652
|
}
|
|
1648
|
-
function
|
|
1649
|
-
let n = L(e?.progress), r = n ? Math.max(0, Math.min(1, e.progress ?? 0)) : 0, i =
|
|
1653
|
+
function jt(e, t) {
|
|
1654
|
+
let n = L(e?.progress), r = n ? Math.max(0, Math.min(1, e.progress ?? 0)) : 0, i = At(e?.rawStartMs, t), a = At(e?.rawEndMs, t);
|
|
1650
1655
|
return /* @__PURE__ */ V("div", {
|
|
1651
1656
|
className: "bsy-gantt-summary-tooltip",
|
|
1652
1657
|
children: [
|
|
@@ -1667,17 +1672,17 @@ function At(e, t) {
|
|
|
1667
1672
|
}
|
|
1668
1673
|
//#endregion
|
|
1669
1674
|
//#region src/components/Gantt/GanttChart/GanttSummaryBar/GanttSummaryBar.tsx
|
|
1670
|
-
var
|
|
1675
|
+
var Mt = 24, Nt = {
|
|
1671
1676
|
borderRadius: "6px",
|
|
1672
1677
|
padding: 0,
|
|
1673
1678
|
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
1674
1679
|
boxShadow: "none"
|
|
1675
1680
|
};
|
|
1676
|
-
function
|
|
1681
|
+
function Pt(e, t) {
|
|
1677
1682
|
return e == null || e === "__empty__" ? t : e;
|
|
1678
1683
|
}
|
|
1679
|
-
var
|
|
1680
|
-
let { t: a } = t(), o = G((e, t) => a(oe(e), t), [a]), s = $((e) => e.timelineCoords), c = $((e) => e.timelineStartMs), l = $((e) => e.timelineEndMs), u = $((e) => e.timelineWidth), d =
|
|
1684
|
+
var Ft = ({ item: r, barTop: i }) => {
|
|
1685
|
+
let { t: a } = t(), o = G((e, t) => a(oe(e), t), [a]), s = $((e) => e.timelineCoords), c = $((e) => e.timelineStartMs), l = $((e) => e.timelineEndMs), u = $((e) => e.timelineWidth), d = ht((e) => e.collapsedKeys), f = ht((e) => e.onBarClick), { virtualReference: p, handleMouseMove: m, handleMouseLeave: h, handleTooltipVisibleChange: g } = Ct(), _ = L(r.progress) ? Math.max(0, Math.min(1, r.progress ?? 0)) : 0, v = q(() => jt({
|
|
1681
1686
|
rawStartMs: r.rawStartMs,
|
|
1682
1687
|
rawEndMs: r.rawEndMs,
|
|
1683
1688
|
progress: r.progress
|
|
@@ -1688,7 +1693,7 @@ var Pt = ({ item: r, barTop: i }) => {
|
|
|
1688
1693
|
o
|
|
1689
1694
|
]), y = q(() => {
|
|
1690
1695
|
if (r.startMs === null || r.endMs === null || r.startMs >= r.endMs || c >= l) return null;
|
|
1691
|
-
let e =
|
|
1696
|
+
let e = Je({
|
|
1692
1697
|
startMs: r.startMs,
|
|
1693
1698
|
endMs: r.endMs
|
|
1694
1699
|
}, {
|
|
@@ -1698,7 +1703,7 @@ var Pt = ({ item: r, barTop: i }) => {
|
|
|
1698
1703
|
return e ? {
|
|
1699
1704
|
barLeft: s.toX(e.startMs),
|
|
1700
1705
|
barWidth: s.toWidth(e.startMs, e.endMs),
|
|
1701
|
-
wrapperTop: i + (26 -
|
|
1706
|
+
wrapperTop: i + (26 - Mt) / 2,
|
|
1702
1707
|
clippedEnd: e.endMs !== r.endMs,
|
|
1703
1708
|
clippedRange: e,
|
|
1704
1709
|
itemStartMs: r.startMs,
|
|
@@ -1713,7 +1718,7 @@ var Pt = ({ item: r, barTop: i }) => {
|
|
|
1713
1718
|
i
|
|
1714
1719
|
]);
|
|
1715
1720
|
if (!y) return null;
|
|
1716
|
-
let { barLeft: b, barWidth: x, wrapperTop: S, clippedEnd: C, clippedRange: w, itemStartMs: T, itemEndMs: ee } = y, E = T + (ee - T) * _, D = Math.min(w.endMs, Math.max(w.startMs, E)), O = s.toWidth(w.startMs, D), k = `${Math.max(0, Math.min(1, O / x)) * 100}%`, A = Math.max(0, u - b), j =
|
|
1721
|
+
let { barLeft: b, barWidth: x, wrapperTop: S, clippedEnd: C, clippedRange: w, itemStartMs: T, itemEndMs: ee } = y, E = T + (ee - T) * _, D = Math.min(w.endMs, Math.max(w.startMs, E)), O = s.toWidth(w.startMs, D), k = `${Math.max(0, Math.min(1, O / x)) * 100}%`, A = Math.max(0, u - b), j = Pt(r.label, a("gantt.emptyGroup")), M = ne(d, r.groupKey);
|
|
1717
1722
|
return /* @__PURE__ */ B(n, {
|
|
1718
1723
|
content: v,
|
|
1719
1724
|
placement: "bottom-start",
|
|
@@ -1725,7 +1730,7 @@ var Pt = ({ item: r, barTop: i }) => {
|
|
|
1725
1730
|
zIndex: 8001,
|
|
1726
1731
|
virtualReference: p,
|
|
1727
1732
|
onVisibleChange: g,
|
|
1728
|
-
style:
|
|
1733
|
+
style: Nt,
|
|
1729
1734
|
children: /* @__PURE__ */ V("div", {
|
|
1730
1735
|
className: "bsy-gantt-summary-bar",
|
|
1731
1736
|
style: {
|
|
@@ -1761,10 +1766,10 @@ var Pt = ({ item: r, barTop: i }) => {
|
|
|
1761
1766
|
})
|
|
1762
1767
|
});
|
|
1763
1768
|
};
|
|
1764
|
-
function
|
|
1769
|
+
function It(e, t) {
|
|
1765
1770
|
return e.barTop === t.barTop && e.item === t.item;
|
|
1766
1771
|
}
|
|
1767
|
-
var
|
|
1772
|
+
var Lt = H.memo(Ft, It), Rt = H.memo(({ indicators: n = [], onJump: r }) => {
|
|
1768
1773
|
let { t: i } = t();
|
|
1769
1774
|
if (!Array.isArray(n) || n.length === 0) return null;
|
|
1770
1775
|
let a = (e, t) => {
|
|
@@ -1802,14 +1807,14 @@ var It = H.memo(Pt, Ft), Lt = H.memo(({ indicators: n = [], onJump: r }) => {
|
|
|
1802
1807
|
}) : null]
|
|
1803
1808
|
})
|
|
1804
1809
|
}, t.rowKey)) });
|
|
1805
|
-
}),
|
|
1810
|
+
}), zt = ({ left: e, height: t, className: n = "" }) => /* @__PURE__ */ B("div", {
|
|
1806
1811
|
className: X("bsy-gantt-chart__today-indicator", n),
|
|
1807
1812
|
style: {
|
|
1808
1813
|
left: e,
|
|
1809
1814
|
height: t
|
|
1810
1815
|
},
|
|
1811
1816
|
children: /* @__PURE__ */ B("span", { className: "bsy-gantt-chart__today-indicator-line" })
|
|
1812
|
-
}),
|
|
1817
|
+
}), Bt = W(function({ canvasHeight: e, weekendSegments: t, virtualColumns: n, lowerSegments: r, shouldShowTodayMarker: i, todayLineLeft: a }) {
|
|
1813
1818
|
return /* @__PURE__ */ V(z, { children: [
|
|
1814
1819
|
t.map((t) => /* @__PURE__ */ B("div", {
|
|
1815
1820
|
className: "bsy-gantt-chart__weekend-bg",
|
|
@@ -1829,19 +1834,19 @@ var It = H.memo(Pt, Ft), Lt = H.memo(({ indicators: n = [], onJump: r }) => {
|
|
|
1829
1834
|
}
|
|
1830
1835
|
}, `line-${n.id}`) : null;
|
|
1831
1836
|
}),
|
|
1832
|
-
i ? /* @__PURE__ */ B(
|
|
1837
|
+
i ? /* @__PURE__ */ B(zt, {
|
|
1833
1838
|
left: a ?? 0,
|
|
1834
1839
|
height: e,
|
|
1835
1840
|
className: "bsy-gantt-chart__today-indicator--content-line"
|
|
1836
1841
|
}) : null
|
|
1837
1842
|
] });
|
|
1838
|
-
}),
|
|
1843
|
+
}), Vt = ({ virtualRows: e, normalizedItems: t, dragState: n, dragPermissionById: r, timelineStartMs: i, timelineEndMs: a }) => {
|
|
1839
1844
|
let o = n?.taskId ?? null;
|
|
1840
1845
|
return e.map((e) => {
|
|
1841
1846
|
let s = t[e.index];
|
|
1842
1847
|
if (!s || s.invalid) return null;
|
|
1843
1848
|
let c = o === s.id;
|
|
1844
|
-
if (!c && (s.startMs === null || s.endMs === null || s.startMs >= s.endMs || !
|
|
1849
|
+
if (!c && (s.startMs === null || s.endMs === null || s.startMs >= s.endMs || !qe({
|
|
1845
1850
|
startMs: s.startMs,
|
|
1846
1851
|
endMs: s.endMs
|
|
1847
1852
|
}, {
|
|
@@ -1849,10 +1854,10 @@ var It = H.memo(Pt, Ft), Lt = H.memo(({ indicators: n = [], onJump: r }) => {
|
|
|
1849
1854
|
endMs: a
|
|
1850
1855
|
}))) return null;
|
|
1851
1856
|
let l = e.start + (e.size - 26) / 2;
|
|
1852
|
-
return s.type === "summary" ? /* @__PURE__ */ B(
|
|
1857
|
+
return s.type === "summary" ? /* @__PURE__ */ B(Lt, {
|
|
1853
1858
|
item: s,
|
|
1854
1859
|
barTop: l
|
|
1855
|
-
}, `summary-${s.id}`) : /* @__PURE__ */ B(
|
|
1860
|
+
}, `summary-${s.id}`) : /* @__PURE__ */ B(Ot, {
|
|
1856
1861
|
item: s,
|
|
1857
1862
|
barTop: l,
|
|
1858
1863
|
dragTaskId: o,
|
|
@@ -1860,8 +1865,8 @@ var It = H.memo(Pt, Ft), Lt = H.memo(({ indicators: n = [], onJump: r }) => {
|
|
|
1860
1865
|
dragPermission: r[s.id]
|
|
1861
1866
|
}, `bar-${s.id}`);
|
|
1862
1867
|
});
|
|
1863
|
-
},
|
|
1864
|
-
let o = $((e) => e.timelineStartMs), s = $((e) => e.timelineEndMs), c = $((e) => e.visibleStartMs), l = $((e) => e.visibleEndMs), u = $((e) => e.isInitialLayoutReady), d =
|
|
1868
|
+
}, Ht = W(function({ virtualRows: e, normalizedItems: t, dragState: n, dragPermissionById: r, handleOffscreenJump: i, hoverBgRef: a }) {
|
|
1869
|
+
let o = $((e) => e.timelineStartMs), s = $((e) => e.timelineEndMs), c = $((e) => e.visibleStartMs), l = $((e) => e.visibleEndMs), u = $((e) => e.isInitialLayoutReady), d = ft({
|
|
1865
1870
|
virtualRows: e,
|
|
1866
1871
|
normalizedItems: t,
|
|
1867
1872
|
visibleStartMs: c,
|
|
@@ -1882,7 +1887,7 @@ var It = H.memo(Pt, Ft), Lt = H.memo(({ indicators: n = [], onJump: r }) => {
|
|
|
1882
1887
|
className: "bsy-gantt-chart__row-hover-bg",
|
|
1883
1888
|
style: { display: "none" }
|
|
1884
1889
|
}),
|
|
1885
|
-
u &&
|
|
1890
|
+
u && Vt({
|
|
1886
1891
|
virtualRows: e,
|
|
1887
1892
|
normalizedItems: t,
|
|
1888
1893
|
dragState: n,
|
|
@@ -1890,18 +1895,18 @@ var It = H.memo(Pt, Ft), Lt = H.memo(({ indicators: n = [], onJump: r }) => {
|
|
|
1890
1895
|
timelineStartMs: o,
|
|
1891
1896
|
timelineEndMs: s
|
|
1892
1897
|
}),
|
|
1893
|
-
u ? /* @__PURE__ */ B(
|
|
1898
|
+
u ? /* @__PURE__ */ B(Rt, {
|
|
1894
1899
|
indicators: d,
|
|
1895
1900
|
onJump: i
|
|
1896
1901
|
}) : null
|
|
1897
1902
|
] });
|
|
1898
|
-
}),
|
|
1899
|
-
let _ = $((e) => e.timelineWidth), { virtualRows: v, canvasHeight: y, isScrolling: b } =
|
|
1903
|
+
}), Ut = W(function({ contentRef: e, normalizedItems: t, safeRowHeight: n, viewportHeight: r, lowerSegments: i, virtualColumns: a, weekendSegments: o, dragState: s, dragPermissionById: c, tooltip: l, handleTaskMouseDown: u, handleResizeMouseDown: d, handleBarClick: f, collapsedKeys: p, handleOffscreenJump: m, todayLineLeft: h, shouldShowTodayMarker: g }) {
|
|
1904
|
+
let _ = $((e) => e.timelineWidth), { virtualRows: v, canvasHeight: y, isScrolling: b } = dt({
|
|
1900
1905
|
items: t,
|
|
1901
1906
|
contentRef: e,
|
|
1902
1907
|
safeRowHeight: n,
|
|
1903
1908
|
viewportHeight: r
|
|
1904
|
-
}), { hoverBgRef: x, handleContentMouseMove: S, handleContentMouseLeave: C } =
|
|
1909
|
+
}), { hoverBgRef: x, handleContentMouseMove: S, handleContentMouseLeave: C } = pt({
|
|
1905
1910
|
normalizedItems: t,
|
|
1906
1911
|
safeRowHeight: n
|
|
1907
1912
|
}), w = q(() => ({
|
|
@@ -1927,16 +1932,16 @@ var It = H.memo(Pt, Ft), Lt = H.memo(({ indicators: n = [], onJump: r }) => {
|
|
|
1927
1932
|
style: w,
|
|
1928
1933
|
onMouseMove: S,
|
|
1929
1934
|
onMouseLeave: C,
|
|
1930
|
-
children: [/* @__PURE__ */ B(
|
|
1935
|
+
children: [/* @__PURE__ */ B(Bt, {
|
|
1931
1936
|
canvasHeight: y,
|
|
1932
1937
|
weekendSegments: o,
|
|
1933
1938
|
virtualColumns: a,
|
|
1934
1939
|
lowerSegments: i,
|
|
1935
1940
|
shouldShowTodayMarker: g,
|
|
1936
1941
|
todayLineLeft: h
|
|
1937
|
-
}), /* @__PURE__ */ B(
|
|
1942
|
+
}), /* @__PURE__ */ B(mt.Provider, {
|
|
1938
1943
|
value: T,
|
|
1939
|
-
children: /* @__PURE__ */ B(
|
|
1944
|
+
children: /* @__PURE__ */ B(Ht, {
|
|
1940
1945
|
virtualRows: v,
|
|
1941
1946
|
normalizedItems: t,
|
|
1942
1947
|
dragState: s,
|
|
@@ -1949,8 +1954,8 @@ var It = H.memo(Pt, Ft), Lt = H.memo(({ indicators: n = [], onJump: r }) => {
|
|
|
1949
1954
|
});
|
|
1950
1955
|
//#endregion
|
|
1951
1956
|
//#region src/components/Gantt/GanttChart/GanttChart.tsx
|
|
1952
|
-
function
|
|
1953
|
-
let { t: v } = t(), y = G((e, t) => v(oe(e), t), [v]), b = J(null), x = J(null), S = J(null), C = ue(x), w = J(null), T =
|
|
1957
|
+
function Wt({ items: e = [], viewMode: n = "day", availableModes: r, onViewModeChange: i, timeRangeConfig: a = u, pixelsPerDayConfig: o = c, onTaskTimeChange: s, onRowClick: l, tooltip: d, verticalScrollController: f, showWeekendHighlight: p = !0, showTodayLine: m = !0, collapsedKeys: h, onToggleCollapse: g }, _) {
|
|
1958
|
+
let { t: v } = t(), y = G((e, t) => v(oe(e), t), [v]), b = J(null), x = J(null), S = J(null), C = ue(x), w = J(null), T = ct(b, x), [ee, E] = Y(!1), { pixelsPerDay: D, viewportWidth: O, scrollLeft: k, timelineStartMs: A, timelineEndMs: j, visibleStartMs: M, visibleEndMs: N, lowerSegments: te, timelineCoords: ne, timelineWidth: re, todayCenterMs: ie, todayLineLeft: ae, isInitialLayoutReady: P, handleContentScroll: F, handleTodayClick: I, handleOffscreenJump: L, handleScrollPrev: R, handleScrollNext: z } = ot({
|
|
1954
1959
|
timeRangeConfig: a,
|
|
1955
1960
|
pixelsPerDayConfig: o,
|
|
1956
1961
|
viewMode: n,
|
|
@@ -1970,7 +1975,7 @@ function Ut({ items: e = [], viewMode: n = "day", availableModes: r, onViewModeC
|
|
|
1970
1975
|
R,
|
|
1971
1976
|
z
|
|
1972
1977
|
]);
|
|
1973
|
-
let { dragState: H, committedRangeById: U, resetCommittedRanges: W, forceResetAllCommittedRanges: ce, handleTaskMouseDown: X, handleResizeMouseDown: le, consumeRecentDragResult: de } =
|
|
1978
|
+
let { dragState: H, committedRangeById: U, resetCommittedRanges: W, forceResetAllCommittedRanges: ce, handleTaskMouseDown: X, handleResizeMouseDown: le, consumeRecentDragResult: de } = Ae({
|
|
1974
1979
|
pixelsPerDay: D,
|
|
1975
1980
|
viewMode: n,
|
|
1976
1981
|
timelineCoords: ne,
|
|
@@ -1997,7 +2002,7 @@ function Ut({ items: e = [], viewMode: n = "day", availableModes: r, onViewModeC
|
|
|
1997
2002
|
W,
|
|
1998
2003
|
ce
|
|
1999
2004
|
]);
|
|
2000
|
-
let { normalizedItems: Z } =
|
|
2005
|
+
let { normalizedItems: Z } = st({
|
|
2001
2006
|
visibleItems: e,
|
|
2002
2007
|
committedRangeById: U,
|
|
2003
2008
|
viewMode: n
|
|
@@ -2026,7 +2031,7 @@ function Ut({ items: e = [], viewMode: n = "day", availableModes: r, onViewModeC
|
|
|
2026
2031
|
e.scrollTop = t;
|
|
2027
2032
|
} });
|
|
2028
2033
|
}, [f]);
|
|
2029
|
-
let me = C?.height || 0, { virtualColumns: he, weekendSegments: ge } =
|
|
2034
|
+
let me = C?.height || 0, { virtualColumns: he, weekendSegments: ge } = Fe({
|
|
2030
2035
|
lowerSegments: te,
|
|
2031
2036
|
pixelsPerDay: D,
|
|
2032
2037
|
scrollLeft: k,
|
|
@@ -2035,7 +2040,7 @@ function Ut({ items: e = [], viewMode: n = "day", availableModes: r, onViewModeC
|
|
|
2035
2040
|
timelineStartMs: A,
|
|
2036
2041
|
timelineWidth: re,
|
|
2037
2042
|
viewMode: n
|
|
2038
|
-
}), _e =
|
|
2043
|
+
}), _e = lt(m, ae, re, ie, {
|
|
2039
2044
|
startMs: A,
|
|
2040
2045
|
endMs: j
|
|
2041
2046
|
}), ye = G((e, t) => {
|
|
@@ -2077,12 +2082,12 @@ function Ut({ items: e = [], viewMode: n = "day", availableModes: r, onViewModeC
|
|
|
2077
2082
|
re,
|
|
2078
2083
|
P
|
|
2079
2084
|
]);
|
|
2080
|
-
return /* @__PURE__ */ B(
|
|
2085
|
+
return /* @__PURE__ */ B(gt.Provider, {
|
|
2081
2086
|
value: be,
|
|
2082
2087
|
children: /* @__PURE__ */ V("div", {
|
|
2083
2088
|
className: "bsy-gantt-chart",
|
|
2084
2089
|
style: { visibility: P ? "visible" : "hidden" },
|
|
2085
|
-
children: [/* @__PURE__ */ B(
|
|
2090
|
+
children: [/* @__PURE__ */ B(ut, {
|
|
2086
2091
|
timelineWidth: re,
|
|
2087
2092
|
viewportWidth: O,
|
|
2088
2093
|
scrollLeft: k,
|
|
@@ -2110,7 +2115,7 @@ function Ut({ items: e = [], viewMode: n = "day", availableModes: r, onViewModeC
|
|
|
2110
2115
|
onScroll: (e) => {
|
|
2111
2116
|
F(e), f && f.sync("timeline", e.currentTarget.scrollTop);
|
|
2112
2117
|
},
|
|
2113
|
-
children: /* @__PURE__ */ B(
|
|
2118
|
+
children: /* @__PURE__ */ B(Ut, {
|
|
2114
2119
|
contentRef: x,
|
|
2115
2120
|
normalizedItems: Z,
|
|
2116
2121
|
safeRowHeight: 34,
|
|
@@ -2134,6 +2139,6 @@ function Ut({ items: e = [], viewMode: n = "day", availableModes: r, onViewModeC
|
|
|
2134
2139
|
})
|
|
2135
2140
|
});
|
|
2136
2141
|
}
|
|
2137
|
-
var
|
|
2142
|
+
var Gt = U(Wt);
|
|
2138
2143
|
//#endregion
|
|
2139
|
-
export {
|
|
2144
|
+
export { Gt as t };
|