awesome-timeline-react 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_tsup-dts-rollup.d.mts +75 -12
- package/dist/_tsup-dts-rollup.d.ts +75 -12
- package/dist/index.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +166 -42
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +165 -42
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -65,6 +65,7 @@ declare type CanvasBoardProps = {
|
|
|
65
65
|
onEventHover?: (props: OnEventHoverProps) => void;
|
|
66
66
|
eventsResize: boolean;
|
|
67
67
|
stripeOverlap: boolean;
|
|
68
|
+
timeBar?: TimeBarConfig;
|
|
68
69
|
panZoom?: PanZoomConfig;
|
|
69
70
|
animations: {
|
|
70
71
|
layoutMs: number;
|
|
@@ -219,9 +220,24 @@ export declare const DEFAULT_GEOMETRY: Geometry;
|
|
|
219
220
|
|
|
220
221
|
export declare const DEFAULT_LAYOUT_DURATION_MS = 200;
|
|
221
222
|
|
|
223
|
+
export declare const DEFAULT_MIN_BLOCK_WIDTH = 40;
|
|
224
|
+
|
|
222
225
|
/** Defaults mirror the pre-0.2.0 stylesheet values. */
|
|
223
226
|
export declare const DEFAULT_THEME: ResolvedTheme;
|
|
224
227
|
|
|
228
|
+
declare const DEFAULT_TIME_BAR_LEVELS: TimeBarLevel[];
|
|
229
|
+
export { DEFAULT_TIME_BAR_LEVELS }
|
|
230
|
+
export { DEFAULT_TIME_BAR_LEVELS as DEFAULT_TIME_BAR_LEVELS_alias_1 }
|
|
231
|
+
|
|
232
|
+
/** Vertical grid lines on the time bar's block edges, so they line up with its
|
|
233
|
+
* separators at any unit. Same edge rule as `drawGridLines`. */
|
|
234
|
+
export declare const drawBlockGridLines: (ctx: CanvasRenderingContext2D, { width, height, blocks, color, }: {
|
|
235
|
+
width: number;
|
|
236
|
+
height: number;
|
|
237
|
+
blocks: TimeBlock[];
|
|
238
|
+
color?: string;
|
|
239
|
+
}) => void;
|
|
240
|
+
|
|
225
241
|
/**
|
|
226
242
|
* Custom canvas renderer for an event. Return false to fall through to the
|
|
227
243
|
* library's default drawing.
|
|
@@ -267,15 +283,18 @@ export declare const drawRowDividers: (ctx: CanvasRenderingContext2D, view: Rend
|
|
|
267
283
|
/**
|
|
268
284
|
* Two-row time bar (top row over bottom row) — canvas replacement for the
|
|
269
285
|
* day/hour block divs of time-bar.tsx. The two rows are unit-agnostic
|
|
270
|
-
* (day/hour by default, configurable via TimeBarConfig).
|
|
271
|
-
* transparent so the .time-bar container color shows through.
|
|
286
|
+
* (day/hour by default, configurable via TimeBarConfig). A row without its own
|
|
287
|
+
* background is left transparent, so the .time-bar container color shows through.
|
|
272
288
|
*/
|
|
273
|
-
export declare const drawTimeBar: (ctx: CanvasRenderingContext2D, { width, height, topBlocks, bottomBlocks, font, borderColor, textColor, }: {
|
|
289
|
+
export declare const drawTimeBar: (ctx: CanvasRenderingContext2D, { width, height, topBlocks, bottomBlocks, font, borderColor, textColor, topBackground, bottomBackground, bottomTextColor, }: {
|
|
274
290
|
width: number;
|
|
275
291
|
height: number;
|
|
276
292
|
font: string;
|
|
277
293
|
borderColor?: string;
|
|
278
294
|
textColor?: string;
|
|
295
|
+
topBackground?: string;
|
|
296
|
+
bottomBackground?: string;
|
|
297
|
+
bottomTextColor?: string;
|
|
279
298
|
topBlocks: TimeBlock[];
|
|
280
299
|
bottomBlocks: TimeBlock[];
|
|
281
300
|
}) => void;
|
|
@@ -423,8 +442,8 @@ export declare class FrameScheduler {
|
|
|
423
442
|
/**
|
|
424
443
|
* The default two-row time bar: a day row over an hour row. Thin wrapper over
|
|
425
444
|
* `generateUnitBlocks` kept for the golden tests and as the documented
|
|
426
|
-
* default; the canvas time bar resolves `TimeBarConfig`
|
|
427
|
-
* `generateUnitBlocks` per row
|
|
445
|
+
* default; the canvas time bar resolves `TimeBarConfig` through
|
|
446
|
+
* `resolveTimeBar` and calls `generateUnitBlocks` per row.
|
|
428
447
|
*/
|
|
429
448
|
export declare const generateTimeBlocks: ({ windowStart, tick, contentWidth, }: {
|
|
430
449
|
windowStart: number;
|
|
@@ -475,7 +494,7 @@ export declare type Geometry = {
|
|
|
475
494
|
/** Derive the full Geometry from the resolved theme's geometry tokens. */
|
|
476
495
|
export declare const geometryFromTheme: (theme: ResolvedTheme) => Geometry;
|
|
477
496
|
|
|
478
|
-
declare type HeaderToken = "headerBackground" | "headerTextColor" | "headerBorderColor" | "headerShadow" | "borderColor";
|
|
497
|
+
declare type HeaderToken = "headerBackground" | "headerTextColor" | "headerBorderColor" | "headerShadow" | "borderColor" | "timeBarTopBackground" | "timeBarBottomBackground" | "timeBarBottomTextColor";
|
|
479
498
|
|
|
480
499
|
export declare type HitTarget = {
|
|
481
500
|
kind: "event" | "static";
|
|
@@ -503,6 +522,9 @@ export declare type HitTestView = {
|
|
|
503
522
|
|
|
504
523
|
export declare const intersectsWindow: (event: EventType, windowStart: number, windowEnd: number) => boolean;
|
|
505
524
|
|
|
525
|
+
/** ISO-8601 week number (weeks start Monday; week 1 holds the year's first Thursday). */
|
|
526
|
+
export declare const isoWeek: (date: Date) => number;
|
|
527
|
+
|
|
506
528
|
/**
|
|
507
529
|
* Whether an event may be dropped onto a row, given its `droppableRowIds`.
|
|
508
530
|
* `undefined` = unrestricted (any row); otherwise the target must be listed.
|
|
@@ -669,6 +691,7 @@ export declare type RendererView = {
|
|
|
669
691
|
drawEvent?: DrawEventFn;
|
|
670
692
|
eventsResize: boolean;
|
|
671
693
|
stripeOverlap: boolean;
|
|
694
|
+
timeBar?: TimeBarConfig;
|
|
672
695
|
hoveredEventId: string | null;
|
|
673
696
|
draggedEventId: string | null;
|
|
674
697
|
resizePreview: ResizePreview | null;
|
|
@@ -687,6 +710,9 @@ export { ResolvedTheme as ResolvedTheme_alias_1 }
|
|
|
687
710
|
|
|
688
711
|
export declare const resolveTheme: (theme?: Theme) => ResolvedTheme;
|
|
689
712
|
|
|
713
|
+
/** The two rows `timeBar` draws at this zoom. */
|
|
714
|
+
export declare const resolveTimeBar: (timeBar: TimeBarConfig | undefined, windowStart: number, windowEnd: number, tick: number | null) => TimeBarLevel;
|
|
715
|
+
|
|
690
716
|
export declare const rowMinHeight: (highestLane: number, g?: Geometry) => number;
|
|
691
717
|
|
|
692
718
|
declare type RowType = {
|
|
@@ -841,6 +867,12 @@ declare type Theme = {
|
|
|
841
867
|
gridColor?: string;
|
|
842
868
|
timeBarBorder?: string;
|
|
843
869
|
timeBarTextColor?: string;
|
|
870
|
+
/** fills of the time bar's top and bottom rows, so the two read apart; unset, both show the
|
|
871
|
+
* header background */
|
|
872
|
+
timeBarTopBackground?: string;
|
|
873
|
+
timeBarBottomBackground?: string;
|
|
874
|
+
/** the bottom row's labels; unset, `timeBarTextColor` */
|
|
875
|
+
timeBarBottomTextColor?: string;
|
|
844
876
|
/** opacity applied to NON-selected events while a selection is active, so the
|
|
845
877
|
* selection stands out (default 0.35). 1 disables dimming. */
|
|
846
878
|
dimmedOpacity?: number;
|
|
@@ -895,24 +927,52 @@ export { Theme as Theme_alias_1 }
|
|
|
895
927
|
export declare const TIME_BAR_HEIGHT = 50;
|
|
896
928
|
|
|
897
929
|
/** Per-row configuration for the two-row time bar. */
|
|
898
|
-
|
|
930
|
+
declare type TimeBarConfig = {
|
|
899
931
|
topRow?: TimeBarRowConfig;
|
|
900
932
|
bottomRow?: TimeBarRowConfig;
|
|
933
|
+
/** pick the rows by zoom instead: the first of `levels` (finest first; default
|
|
934
|
+
* day/hour → day/6 h → week/day → month/week → year/month) whose bottom-row
|
|
935
|
+
* blocks are at least `minBlockWidth` px wide (default 40). `topRow`/`bottomRow`
|
|
936
|
+
* are ignored, and the grid lines follow the bottom row rather than the grid
|
|
937
|
+
* cell; drops still snap to the cell. */
|
|
938
|
+
auto?: boolean | {
|
|
939
|
+
levels?: TimeBarLevel[];
|
|
940
|
+
minBlockWidth?: number;
|
|
941
|
+
};
|
|
901
942
|
};
|
|
943
|
+
export { TimeBarConfig }
|
|
944
|
+
export { TimeBarConfig as TimeBarConfig_alias_1 }
|
|
902
945
|
|
|
903
|
-
|
|
946
|
+
/** One zoom level of an automatic time bar. */
|
|
947
|
+
declare type TimeBarLevel = {
|
|
948
|
+
topRow: TimeBarRowConfig;
|
|
949
|
+
bottomRow: TimeBarRowConfig;
|
|
950
|
+
};
|
|
951
|
+
export { TimeBarLevel }
|
|
952
|
+
export { TimeBarLevel as TimeBarLevel_alias_1 }
|
|
953
|
+
|
|
954
|
+
declare type TimeBarRowConfig = {
|
|
904
955
|
/** the unit each block spans (default: "day" for the top row, "hour" for
|
|
905
|
-
* the bottom row),
|
|
956
|
+
* the bottom row), a fixed step like `{ stepSeconds: 8 * 3600 }`, or
|
|
957
|
+
* `{ boundaries }` for uneven blocks such as real shifts: it returns the
|
|
958
|
+
* sorted block edges in unix seconds, one at or before `windowStart` and one
|
|
959
|
+
* at or after `windowEnd`, so the row tiles the window. */
|
|
906
960
|
unit?: TimeBarUnit | {
|
|
907
961
|
stepSeconds: number;
|
|
962
|
+
} | {
|
|
963
|
+
boundaries: (windowStart: number, windowEnd: number) => number[];
|
|
908
964
|
};
|
|
909
965
|
/** label for a block; receives the block's start and end. Defaults mirror
|
|
910
966
|
* the built-in day ("Mon 1 Jan") and hour ("HH:00") labels. */
|
|
911
967
|
format?: (blockStart: Date, blockEnd: Date) => string;
|
|
912
968
|
};
|
|
969
|
+
export { TimeBarRowConfig }
|
|
970
|
+
export { TimeBarRowConfig as TimeBarRowConfig_alias_1 }
|
|
913
971
|
|
|
914
972
|
/** Calendar unit for a time-bar row, or a fixed step in seconds. */
|
|
915
|
-
|
|
973
|
+
declare type TimeBarUnit = "hour" | "day" | "week" | "month" | "year";
|
|
974
|
+
export { TimeBarUnit }
|
|
975
|
+
export { TimeBarUnit as TimeBarUnit_alias_1 }
|
|
916
976
|
|
|
917
977
|
export declare type TimeBlock = {
|
|
918
978
|
label: string;
|
|
@@ -929,6 +989,8 @@ declare const Timeline: React_2.ForwardRefExoticComponent<TimelineProps & React_
|
|
|
929
989
|
export { Timeline }
|
|
930
990
|
export { Timeline as Timeline_alias_1 }
|
|
931
991
|
|
|
992
|
+
export declare const TimelineAutoTimeBar: () => React_2.JSX.Element;
|
|
993
|
+
|
|
932
994
|
export declare const TimelineCanvas: () => React_2.JSX.Element;
|
|
933
995
|
|
|
934
996
|
/**
|
|
@@ -1099,8 +1161,8 @@ declare type TimelineProps = {
|
|
|
1099
1161
|
/** draw the two-row time bar above the rows (default true). Off, the timeline is just its rows —
|
|
1100
1162
|
* e.g. a secondary strip kept in step with a main timeline through `onWindowChange`/`setWindow`. */
|
|
1101
1163
|
showTimeBar?: boolean;
|
|
1102
|
-
/** a dashed vertical line follows the pointer over the rows, its time shown in the time bar
|
|
1103
|
-
* (default false) */
|
|
1164
|
+
/** a dashed vertical line follows the pointer over the rows, its time shown in the time bar;
|
|
1165
|
+
* hidden while the pointer is on an event (default false) */
|
|
1104
1166
|
showPointerLine?: boolean;
|
|
1105
1167
|
/** the pointer line's label for a time in unix seconds (default: the browser's locale date and time) */
|
|
1106
1168
|
formatPointerTime?: (time: number) => string;
|
|
@@ -1142,6 +1204,7 @@ export declare class TimelineRenderer {
|
|
|
1142
1204
|
flush(): void;
|
|
1143
1205
|
dispose(): void;
|
|
1144
1206
|
private resizeCanvases;
|
|
1207
|
+
private drawGrid;
|
|
1145
1208
|
private drawFrame;
|
|
1146
1209
|
}
|
|
1147
1210
|
|
|
@@ -65,6 +65,7 @@ declare type CanvasBoardProps = {
|
|
|
65
65
|
onEventHover?: (props: OnEventHoverProps) => void;
|
|
66
66
|
eventsResize: boolean;
|
|
67
67
|
stripeOverlap: boolean;
|
|
68
|
+
timeBar?: TimeBarConfig;
|
|
68
69
|
panZoom?: PanZoomConfig;
|
|
69
70
|
animations: {
|
|
70
71
|
layoutMs: number;
|
|
@@ -219,9 +220,24 @@ export declare const DEFAULT_GEOMETRY: Geometry;
|
|
|
219
220
|
|
|
220
221
|
export declare const DEFAULT_LAYOUT_DURATION_MS = 200;
|
|
221
222
|
|
|
223
|
+
export declare const DEFAULT_MIN_BLOCK_WIDTH = 40;
|
|
224
|
+
|
|
222
225
|
/** Defaults mirror the pre-0.2.0 stylesheet values. */
|
|
223
226
|
export declare const DEFAULT_THEME: ResolvedTheme;
|
|
224
227
|
|
|
228
|
+
declare const DEFAULT_TIME_BAR_LEVELS: TimeBarLevel[];
|
|
229
|
+
export { DEFAULT_TIME_BAR_LEVELS }
|
|
230
|
+
export { DEFAULT_TIME_BAR_LEVELS as DEFAULT_TIME_BAR_LEVELS_alias_1 }
|
|
231
|
+
|
|
232
|
+
/** Vertical grid lines on the time bar's block edges, so they line up with its
|
|
233
|
+
* separators at any unit. Same edge rule as `drawGridLines`. */
|
|
234
|
+
export declare const drawBlockGridLines: (ctx: CanvasRenderingContext2D, { width, height, blocks, color, }: {
|
|
235
|
+
width: number;
|
|
236
|
+
height: number;
|
|
237
|
+
blocks: TimeBlock[];
|
|
238
|
+
color?: string;
|
|
239
|
+
}) => void;
|
|
240
|
+
|
|
225
241
|
/**
|
|
226
242
|
* Custom canvas renderer for an event. Return false to fall through to the
|
|
227
243
|
* library's default drawing.
|
|
@@ -267,15 +283,18 @@ export declare const drawRowDividers: (ctx: CanvasRenderingContext2D, view: Rend
|
|
|
267
283
|
/**
|
|
268
284
|
* Two-row time bar (top row over bottom row) — canvas replacement for the
|
|
269
285
|
* day/hour block divs of time-bar.tsx. The two rows are unit-agnostic
|
|
270
|
-
* (day/hour by default, configurable via TimeBarConfig).
|
|
271
|
-
* transparent so the .time-bar container color shows through.
|
|
286
|
+
* (day/hour by default, configurable via TimeBarConfig). A row without its own
|
|
287
|
+
* background is left transparent, so the .time-bar container color shows through.
|
|
272
288
|
*/
|
|
273
|
-
export declare const drawTimeBar: (ctx: CanvasRenderingContext2D, { width, height, topBlocks, bottomBlocks, font, borderColor, textColor, }: {
|
|
289
|
+
export declare const drawTimeBar: (ctx: CanvasRenderingContext2D, { width, height, topBlocks, bottomBlocks, font, borderColor, textColor, topBackground, bottomBackground, bottomTextColor, }: {
|
|
274
290
|
width: number;
|
|
275
291
|
height: number;
|
|
276
292
|
font: string;
|
|
277
293
|
borderColor?: string;
|
|
278
294
|
textColor?: string;
|
|
295
|
+
topBackground?: string;
|
|
296
|
+
bottomBackground?: string;
|
|
297
|
+
bottomTextColor?: string;
|
|
279
298
|
topBlocks: TimeBlock[];
|
|
280
299
|
bottomBlocks: TimeBlock[];
|
|
281
300
|
}) => void;
|
|
@@ -423,8 +442,8 @@ export declare class FrameScheduler {
|
|
|
423
442
|
/**
|
|
424
443
|
* The default two-row time bar: a day row over an hour row. Thin wrapper over
|
|
425
444
|
* `generateUnitBlocks` kept for the golden tests and as the documented
|
|
426
|
-
* default; the canvas time bar resolves `TimeBarConfig`
|
|
427
|
-
* `generateUnitBlocks` per row
|
|
445
|
+
* default; the canvas time bar resolves `TimeBarConfig` through
|
|
446
|
+
* `resolveTimeBar` and calls `generateUnitBlocks` per row.
|
|
428
447
|
*/
|
|
429
448
|
export declare const generateTimeBlocks: ({ windowStart, tick, contentWidth, }: {
|
|
430
449
|
windowStart: number;
|
|
@@ -475,7 +494,7 @@ export declare type Geometry = {
|
|
|
475
494
|
/** Derive the full Geometry from the resolved theme's geometry tokens. */
|
|
476
495
|
export declare const geometryFromTheme: (theme: ResolvedTheme) => Geometry;
|
|
477
496
|
|
|
478
|
-
declare type HeaderToken = "headerBackground" | "headerTextColor" | "headerBorderColor" | "headerShadow" | "borderColor";
|
|
497
|
+
declare type HeaderToken = "headerBackground" | "headerTextColor" | "headerBorderColor" | "headerShadow" | "borderColor" | "timeBarTopBackground" | "timeBarBottomBackground" | "timeBarBottomTextColor";
|
|
479
498
|
|
|
480
499
|
export declare type HitTarget = {
|
|
481
500
|
kind: "event" | "static";
|
|
@@ -503,6 +522,9 @@ export declare type HitTestView = {
|
|
|
503
522
|
|
|
504
523
|
export declare const intersectsWindow: (event: EventType, windowStart: number, windowEnd: number) => boolean;
|
|
505
524
|
|
|
525
|
+
/** ISO-8601 week number (weeks start Monday; week 1 holds the year's first Thursday). */
|
|
526
|
+
export declare const isoWeek: (date: Date) => number;
|
|
527
|
+
|
|
506
528
|
/**
|
|
507
529
|
* Whether an event may be dropped onto a row, given its `droppableRowIds`.
|
|
508
530
|
* `undefined` = unrestricted (any row); otherwise the target must be listed.
|
|
@@ -669,6 +691,7 @@ export declare type RendererView = {
|
|
|
669
691
|
drawEvent?: DrawEventFn;
|
|
670
692
|
eventsResize: boolean;
|
|
671
693
|
stripeOverlap: boolean;
|
|
694
|
+
timeBar?: TimeBarConfig;
|
|
672
695
|
hoveredEventId: string | null;
|
|
673
696
|
draggedEventId: string | null;
|
|
674
697
|
resizePreview: ResizePreview | null;
|
|
@@ -687,6 +710,9 @@ export { ResolvedTheme as ResolvedTheme_alias_1 }
|
|
|
687
710
|
|
|
688
711
|
export declare const resolveTheme: (theme?: Theme) => ResolvedTheme;
|
|
689
712
|
|
|
713
|
+
/** The two rows `timeBar` draws at this zoom. */
|
|
714
|
+
export declare const resolveTimeBar: (timeBar: TimeBarConfig | undefined, windowStart: number, windowEnd: number, tick: number | null) => TimeBarLevel;
|
|
715
|
+
|
|
690
716
|
export declare const rowMinHeight: (highestLane: number, g?: Geometry) => number;
|
|
691
717
|
|
|
692
718
|
declare type RowType = {
|
|
@@ -841,6 +867,12 @@ declare type Theme = {
|
|
|
841
867
|
gridColor?: string;
|
|
842
868
|
timeBarBorder?: string;
|
|
843
869
|
timeBarTextColor?: string;
|
|
870
|
+
/** fills of the time bar's top and bottom rows, so the two read apart; unset, both show the
|
|
871
|
+
* header background */
|
|
872
|
+
timeBarTopBackground?: string;
|
|
873
|
+
timeBarBottomBackground?: string;
|
|
874
|
+
/** the bottom row's labels; unset, `timeBarTextColor` */
|
|
875
|
+
timeBarBottomTextColor?: string;
|
|
844
876
|
/** opacity applied to NON-selected events while a selection is active, so the
|
|
845
877
|
* selection stands out (default 0.35). 1 disables dimming. */
|
|
846
878
|
dimmedOpacity?: number;
|
|
@@ -895,24 +927,52 @@ export { Theme as Theme_alias_1 }
|
|
|
895
927
|
export declare const TIME_BAR_HEIGHT = 50;
|
|
896
928
|
|
|
897
929
|
/** Per-row configuration for the two-row time bar. */
|
|
898
|
-
|
|
930
|
+
declare type TimeBarConfig = {
|
|
899
931
|
topRow?: TimeBarRowConfig;
|
|
900
932
|
bottomRow?: TimeBarRowConfig;
|
|
933
|
+
/** pick the rows by zoom instead: the first of `levels` (finest first; default
|
|
934
|
+
* day/hour → day/6 h → week/day → month/week → year/month) whose bottom-row
|
|
935
|
+
* blocks are at least `minBlockWidth` px wide (default 40). `topRow`/`bottomRow`
|
|
936
|
+
* are ignored, and the grid lines follow the bottom row rather than the grid
|
|
937
|
+
* cell; drops still snap to the cell. */
|
|
938
|
+
auto?: boolean | {
|
|
939
|
+
levels?: TimeBarLevel[];
|
|
940
|
+
minBlockWidth?: number;
|
|
941
|
+
};
|
|
901
942
|
};
|
|
943
|
+
export { TimeBarConfig }
|
|
944
|
+
export { TimeBarConfig as TimeBarConfig_alias_1 }
|
|
902
945
|
|
|
903
|
-
|
|
946
|
+
/** One zoom level of an automatic time bar. */
|
|
947
|
+
declare type TimeBarLevel = {
|
|
948
|
+
topRow: TimeBarRowConfig;
|
|
949
|
+
bottomRow: TimeBarRowConfig;
|
|
950
|
+
};
|
|
951
|
+
export { TimeBarLevel }
|
|
952
|
+
export { TimeBarLevel as TimeBarLevel_alias_1 }
|
|
953
|
+
|
|
954
|
+
declare type TimeBarRowConfig = {
|
|
904
955
|
/** the unit each block spans (default: "day" for the top row, "hour" for
|
|
905
|
-
* the bottom row),
|
|
956
|
+
* the bottom row), a fixed step like `{ stepSeconds: 8 * 3600 }`, or
|
|
957
|
+
* `{ boundaries }` for uneven blocks such as real shifts: it returns the
|
|
958
|
+
* sorted block edges in unix seconds, one at or before `windowStart` and one
|
|
959
|
+
* at or after `windowEnd`, so the row tiles the window. */
|
|
906
960
|
unit?: TimeBarUnit | {
|
|
907
961
|
stepSeconds: number;
|
|
962
|
+
} | {
|
|
963
|
+
boundaries: (windowStart: number, windowEnd: number) => number[];
|
|
908
964
|
};
|
|
909
965
|
/** label for a block; receives the block's start and end. Defaults mirror
|
|
910
966
|
* the built-in day ("Mon 1 Jan") and hour ("HH:00") labels. */
|
|
911
967
|
format?: (blockStart: Date, blockEnd: Date) => string;
|
|
912
968
|
};
|
|
969
|
+
export { TimeBarRowConfig }
|
|
970
|
+
export { TimeBarRowConfig as TimeBarRowConfig_alias_1 }
|
|
913
971
|
|
|
914
972
|
/** Calendar unit for a time-bar row, or a fixed step in seconds. */
|
|
915
|
-
|
|
973
|
+
declare type TimeBarUnit = "hour" | "day" | "week" | "month" | "year";
|
|
974
|
+
export { TimeBarUnit }
|
|
975
|
+
export { TimeBarUnit as TimeBarUnit_alias_1 }
|
|
916
976
|
|
|
917
977
|
export declare type TimeBlock = {
|
|
918
978
|
label: string;
|
|
@@ -929,6 +989,8 @@ declare const Timeline: React_2.ForwardRefExoticComponent<TimelineProps & React_
|
|
|
929
989
|
export { Timeline }
|
|
930
990
|
export { Timeline as Timeline_alias_1 }
|
|
931
991
|
|
|
992
|
+
export declare const TimelineAutoTimeBar: () => React_2.JSX.Element;
|
|
993
|
+
|
|
932
994
|
export declare const TimelineCanvas: () => React_2.JSX.Element;
|
|
933
995
|
|
|
934
996
|
/**
|
|
@@ -1099,8 +1161,8 @@ declare type TimelineProps = {
|
|
|
1099
1161
|
/** draw the two-row time bar above the rows (default true). Off, the timeline is just its rows —
|
|
1100
1162
|
* e.g. a secondary strip kept in step with a main timeline through `onWindowChange`/`setWindow`. */
|
|
1101
1163
|
showTimeBar?: boolean;
|
|
1102
|
-
/** a dashed vertical line follows the pointer over the rows, its time shown in the time bar
|
|
1103
|
-
* (default false) */
|
|
1164
|
+
/** a dashed vertical line follows the pointer over the rows, its time shown in the time bar;
|
|
1165
|
+
* hidden while the pointer is on an event (default false) */
|
|
1104
1166
|
showPointerLine?: boolean;
|
|
1105
1167
|
/** the pointer line's label for a time in unix seconds (default: the browser's locale date and time) */
|
|
1106
1168
|
formatPointerTime?: (time: number) => string;
|
|
@@ -1142,6 +1204,7 @@ export declare class TimelineRenderer {
|
|
|
1142
1204
|
flush(): void;
|
|
1143
1205
|
dispose(): void;
|
|
1144
1206
|
private resizeCanvases;
|
|
1207
|
+
private drawGrid;
|
|
1145
1208
|
private drawFrame;
|
|
1146
1209
|
}
|
|
1147
1210
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { DEFAULT_TIME_BAR_LEVELS } from './_tsup-dts-rollup.mjs';
|
|
1
2
|
export { RowType } from './_tsup-dts-rollup.mjs';
|
|
2
3
|
export { EventType } from './_tsup-dts-rollup.mjs';
|
|
3
4
|
export { EventPropsType } from './_tsup-dts-rollup.mjs';
|
|
@@ -13,6 +14,10 @@ export { OnEventClickProps } from './_tsup-dts-rollup.mjs';
|
|
|
13
14
|
export { OnEventHoverProps } from './_tsup-dts-rollup.mjs';
|
|
14
15
|
export { DroppableError } from './_tsup-dts-rollup.mjs';
|
|
15
16
|
export { PanZoomConfig } from './_tsup-dts-rollup.mjs';
|
|
17
|
+
export { TimeBarConfig } from './_tsup-dts-rollup.mjs';
|
|
18
|
+
export { TimeBarLevel } from './_tsup-dts-rollup.mjs';
|
|
19
|
+
export { TimeBarRowConfig } from './_tsup-dts-rollup.mjs';
|
|
20
|
+
export { TimeBarUnit } from './_tsup-dts-rollup.mjs';
|
|
16
21
|
export { EventPatch } from './_tsup-dts-rollup.mjs';
|
|
17
22
|
export { TimelineHandle } from './_tsup-dts-rollup.mjs';
|
|
18
23
|
export { TimelineProps } from './_tsup-dts-rollup.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { DEFAULT_TIME_BAR_LEVELS } from './_tsup-dts-rollup.js';
|
|
1
2
|
export { RowType } from './_tsup-dts-rollup.js';
|
|
2
3
|
export { EventType } from './_tsup-dts-rollup.js';
|
|
3
4
|
export { EventPropsType } from './_tsup-dts-rollup.js';
|
|
@@ -13,6 +14,10 @@ export { OnEventClickProps } from './_tsup-dts-rollup.js';
|
|
|
13
14
|
export { OnEventHoverProps } from './_tsup-dts-rollup.js';
|
|
14
15
|
export { DroppableError } from './_tsup-dts-rollup.js';
|
|
15
16
|
export { PanZoomConfig } from './_tsup-dts-rollup.js';
|
|
17
|
+
export { TimeBarConfig } from './_tsup-dts-rollup.js';
|
|
18
|
+
export { TimeBarLevel } from './_tsup-dts-rollup.js';
|
|
19
|
+
export { TimeBarRowConfig } from './_tsup-dts-rollup.js';
|
|
20
|
+
export { TimeBarUnit } from './_tsup-dts-rollup.js';
|
|
16
21
|
export { EventPatch } from './_tsup-dts-rollup.js';
|
|
17
22
|
export { TimelineHandle } from './_tsup-dts-rollup.js';
|
|
18
23
|
export { TimelineProps } from './_tsup-dts-rollup.js';
|