gantt-lib 0.132.3 → 0.132.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -616,6 +616,8 @@ interface TaskChartSharedProps<TTask extends Task = Task> {
|
|
|
616
616
|
skeletonRowCount?: number;
|
|
617
617
|
/** Shift skeleton chart bars by this many days relative to today (negative values start earlier). */
|
|
618
618
|
skeletonStartOffsetDays?: number;
|
|
619
|
+
/** Add a stable per-row backward jitter to skeleton chart bars, in days. */
|
|
620
|
+
skeletonStartJitterDays?: number;
|
|
619
621
|
/** Optional vertical timeline markers such as deadlines and checkpoints. */
|
|
620
622
|
timelineMarkers?: TimelineMarker[];
|
|
621
623
|
/** Additional custom columns to render in the TaskList after built-in columns */
|
|
@@ -842,6 +844,7 @@ interface GenerationSkeletonRowsProps {
|
|
|
842
844
|
taskListLayout?: GenerationSkeletonTaskListLayout;
|
|
843
845
|
chartDayWidth?: number;
|
|
844
846
|
chartStartDayOffset?: number;
|
|
847
|
+
chartStartJitterDays?: number;
|
|
845
848
|
}
|
|
846
849
|
declare const GenerationSkeletonRows: React$1.FC<GenerationSkeletonRowsProps>;
|
|
847
850
|
|
package/dist/index.d.ts
CHANGED
|
@@ -616,6 +616,8 @@ interface TaskChartSharedProps<TTask extends Task = Task> {
|
|
|
616
616
|
skeletonRowCount?: number;
|
|
617
617
|
/** Shift skeleton chart bars by this many days relative to today (negative values start earlier). */
|
|
618
618
|
skeletonStartOffsetDays?: number;
|
|
619
|
+
/** Add a stable per-row backward jitter to skeleton chart bars, in days. */
|
|
620
|
+
skeletonStartJitterDays?: number;
|
|
619
621
|
/** Optional vertical timeline markers such as deadlines and checkpoints. */
|
|
620
622
|
timelineMarkers?: TimelineMarker[];
|
|
621
623
|
/** Additional custom columns to render in the TaskList after built-in columns */
|
|
@@ -842,6 +844,7 @@ interface GenerationSkeletonRowsProps {
|
|
|
842
844
|
taskListLayout?: GenerationSkeletonTaskListLayout;
|
|
843
845
|
chartDayWidth?: number;
|
|
844
846
|
chartStartDayOffset?: number;
|
|
847
|
+
chartStartJitterDays?: number;
|
|
845
848
|
}
|
|
846
849
|
declare const GenerationSkeletonRows: React$1.FC<GenerationSkeletonRowsProps>;
|
|
847
850
|
|
package/dist/index.js
CHANGED
|
@@ -8648,6 +8648,11 @@ var import_react13 = require("react");
|
|
|
8648
8648
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
8649
8649
|
var MAX_SKELETON_ROWS = 200;
|
|
8650
8650
|
var SHIMMER_DURATION_MS = 1450;
|
|
8651
|
+
function stableRowJitter(rowIndex, maxDays) {
|
|
8652
|
+
if (maxDays <= 0) return 0;
|
|
8653
|
+
const hash = Math.imul(rowIndex + 1, 2654435761) >>> 0;
|
|
8654
|
+
return hash % (maxDays + 1);
|
|
8655
|
+
}
|
|
8651
8656
|
function clampCount(count) {
|
|
8652
8657
|
if (!Number.isFinite(count)) return 0;
|
|
8653
8658
|
return Math.min(MAX_SKELETON_ROWS, Math.max(0, Math.floor(count)));
|
|
@@ -8659,7 +8664,8 @@ var GenerationSkeletonRows = ({
|
|
|
8659
8664
|
startIndex = 0,
|
|
8660
8665
|
taskListLayout,
|
|
8661
8666
|
chartDayWidth = 40,
|
|
8662
|
-
chartStartDayOffset = 0
|
|
8667
|
+
chartStartDayOffset = 0,
|
|
8668
|
+
chartStartJitterDays = 0
|
|
8663
8669
|
}) => {
|
|
8664
8670
|
const safeCount = clampCount(count);
|
|
8665
8671
|
const previousCountRef = (0, import_react13.useRef)(null);
|
|
@@ -8687,9 +8693,10 @@ var GenerationSkeletonRows = ({
|
|
|
8687
8693
|
const shortShape = rowIndex % 3 === 1;
|
|
8688
8694
|
const mediumShape = rowIndex % 3 === 2;
|
|
8689
8695
|
const chartBarDays = 5 + rowIndex % 6;
|
|
8696
|
+
const chartStartJitter = variant === "chart" ? stableRowJitter(rowIndex, Math.max(0, Math.floor(chartStartJitterDays))) : 0;
|
|
8690
8697
|
const chartBarStyle = variant === "chart" ? {
|
|
8691
8698
|
width: `${chartBarDays * Math.max(1, chartDayWidth)}px`,
|
|
8692
|
-
marginLeft: `${Math.max(0, chartStartDayOffset) * Math.max(1, chartDayWidth)}px`
|
|
8699
|
+
marginLeft: `${Math.max(0, chartStartDayOffset - chartStartJitter) * Math.max(1, chartDayWidth)}px`
|
|
8693
8700
|
} : void 0;
|
|
8694
8701
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
8695
8702
|
"div",
|
|
@@ -14038,6 +14045,7 @@ function TaskGanttChartInner(props, ref) {
|
|
|
14038
14045
|
showChart = true,
|
|
14039
14046
|
skeletonRowCount = 0,
|
|
14040
14047
|
skeletonStartOffsetDays = 0,
|
|
14048
|
+
skeletonStartJitterDays = 0,
|
|
14041
14049
|
timelineMarkers,
|
|
14042
14050
|
additionalColumns,
|
|
14043
14051
|
hiddenTaskListColumns,
|
|
@@ -15490,7 +15498,8 @@ function TaskGanttChartInner(props, ref) {
|
|
|
15490
15498
|
variant: "chart",
|
|
15491
15499
|
startIndex: visibleTasks.length,
|
|
15492
15500
|
chartDayWidth: dayWidth,
|
|
15493
|
-
chartStartDayOffset: todayInRange ? Math.max(0, todayIndex + Math.floor(Number.isFinite(skeletonStartOffsetDays) ? skeletonStartOffsetDays : 0)) : 0
|
|
15501
|
+
chartStartDayOffset: todayInRange ? Math.max(0, todayIndex + Math.floor(Number.isFinite(skeletonStartOffsetDays) ? skeletonStartOffsetDays : 0)) : 0,
|
|
15502
|
+
chartStartJitterDays: skeletonStartJitterDays
|
|
15494
15503
|
}
|
|
15495
15504
|
)
|
|
15496
15505
|
]
|