@cjlapao/ui-kit-vue 0.2.0 → 0.2.3
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.cjs +18 -25
- package/dist/index.css +37732 -13285
- package/dist/index.js +31192 -21036
- package/dist/types/common/chat/markdown.d.ts +8 -0
- package/dist/types/common/chat/storage.d.ts +48 -0
- package/dist/types/common/chat/stream.d.ts +43 -0
- package/dist/types/common/chat/types.d.ts +143 -0
- package/dist/types/common/connectionFlow/header.d.ts +56 -0
- package/dist/types/common/connectionFlow/icons.d.ts +15 -0
- package/dist/types/common/connectionFlow/index.d.ts +6 -0
- package/dist/types/common/connectionFlow/layout.d.ts +73 -0
- package/dist/types/common/connectionFlow/measure.d.ts +94 -0
- package/dist/types/common/connectionFlow/paint.d.ts +36 -0
- package/dist/types/common/connectionFlow/router.d.ts +131 -0
- package/dist/types/common/connectionFlow/tones.d.ts +79 -0
- package/dist/types/common/connectionFlow/types.d.ts +394 -0
- package/dist/types/common/gantt/drag.d.ts +221 -0
- package/dist/types/common/gantt/index.d.ts +11 -0
- package/dist/types/common/gantt/layout.d.ts +133 -0
- package/dist/types/common/gantt/sample.d.ts +15 -0
- package/dist/types/common/gantt/time.d.ts +77 -0
- package/dist/types/common/gantt/tokens.d.ts +73 -0
- package/dist/types/common/gantt/types.d.ts +216 -0
- package/dist/types/common/i18n/builtIn/de.d.ts +2 -0
- package/dist/types/common/i18n/builtIn/en.d.ts +2 -0
- package/dist/types/common/i18n/builtIn/es.d.ts +2 -0
- package/dist/types/common/i18n/builtIn/fr.d.ts +2 -0
- package/dist/types/common/i18n/builtIn/index.d.ts +15 -0
- package/dist/types/common/i18n/builtIn/pt.d.ts +2 -0
- package/dist/types/common/i18n/catalog.d.ts +32 -0
- package/dist/types/common/i18n/createI18n.d.ts +2 -0
- package/dist/types/common/i18n/dates.d.ts +12 -0
- package/dist/types/common/i18n/detect.d.ts +29 -0
- package/dist/types/common/i18n/icu.d.ts +36 -0
- package/dist/types/common/i18n/index.d.ts +10 -0
- package/dist/types/common/i18n/provider.d.ts +7 -0
- package/dist/types/common/i18n/storage.d.ts +8 -0
- package/dist/types/common/i18n/types.d.ts +64 -0
- package/dist/types/common/i18n/warn.d.ts +5 -0
- package/dist/types/common/theme/Theme.d.ts +941 -3
- package/dist/types/common/theme/glass.d.ts +90 -11
- package/dist/types/common/theme/randomThemeColor.d.ts +4 -4
- package/dist/types/common/tooltip/placement.d.ts +103 -0
- package/dist/types/common/tooltip/tokens.d.ts +40 -0
- package/dist/types/common/types/TableSettings.d.ts +15 -0
- package/dist/types/common/types/Variables.d.ts +71 -1
- package/dist/types/common/utils/dates.d.ts +113 -0
- package/dist/types/common/utils/gravatar.d.ts +0 -10
- package/dist/types/common/utils/safeStorage.d.ts +28 -0
- package/dist/types/common/utils/sanitizeSvg.d.ts +44 -0
- package/dist/types/common/utils/smartVariables.d.ts +74 -18
- package/dist/types/common/utils/tableStorage.d.ts +38 -0
- package/dist/types/vue/src/chat/index.d.ts +4 -0
- package/dist/types/vue/src/components/AccessMatrix.test.d.ts +1 -0
- package/dist/types/vue/src/components/AccessMatrix.vue.d.ts +23 -1
- package/dist/types/vue/src/components/Accordion.test.d.ts +1 -0
- package/dist/types/vue/src/components/Accordion.vue.d.ts +42 -28
- package/dist/types/vue/src/components/ActivityFeed.test.d.ts +1 -0
- package/dist/types/vue/src/components/ActivityFeed.vue.d.ts +141 -0
- package/dist/types/vue/src/components/Alert.test.d.ts +1 -0
- package/dist/types/vue/src/components/Alert.vue.d.ts +59 -2
- package/dist/types/vue/src/components/ApiErrorState.test.d.ts +1 -0
- package/dist/types/vue/src/components/ApiErrorState.vue.d.ts +28 -8
- package/dist/types/vue/src/components/AppDivider.vue.d.ts +53 -4
- package/dist/types/vue/src/components/Badge.vue.d.ts +45 -13
- package/dist/types/vue/src/components/BadgeIcon.vue.d.ts +1 -1
- package/dist/types/vue/src/components/BreakdownCard.test.d.ts +1 -0
- package/dist/types/vue/src/components/BreakdownCard.vue.d.ts +81 -0
- package/dist/types/vue/src/components/Button.vue.d.ts +22 -11
- package/dist/types/vue/src/components/Chat.test.d.ts +1 -0
- package/dist/types/vue/src/components/Chat.vue.d.ts +80 -0
- package/dist/types/vue/src/components/Checkbox.test.d.ts +1 -0
- package/dist/types/vue/src/components/Checkbox.vue.d.ts +44 -29
- package/dist/types/vue/src/components/CollapsiblePanel.vue.d.ts +5 -5
- package/dist/types/vue/src/components/ColorSwatches.test.d.ts +1 -0
- package/dist/types/vue/src/components/ColorSwatches.vue.d.ts +42 -0
- package/dist/types/vue/src/components/Combobox.test.d.ts +1 -0
- package/dist/types/vue/src/components/Combobox.vue.d.ts +61 -12
- package/dist/types/vue/src/components/ConnectionFlow/ConnectionFlow.vue.d.ts +153 -17
- package/dist/types/vue/src/components/ConnectionFlow/ConnectionFlowCanvas.vue.d.ts +28 -0
- package/dist/types/vue/src/components/ConnectionFlow/ConnectionFlowHeader.vue.d.ts +33 -0
- package/dist/types/vue/src/components/ConnectionFlow/ConnectionFlowNodeBody.vue.d.ts +32 -0
- package/dist/types/vue/src/components/ConnectionFlow/ConnectionFlowSkeleton.vue.d.ts +18 -0
- package/dist/types/vue/src/components/ConnectionFlow/ConnectionFlowSvg.vue.d.ts +52 -0
- package/dist/types/vue/src/components/ConnectionFlow/connectionFlow.test.d.ts +1 -0
- package/dist/types/vue/src/components/ConnectionFlow/index.d.ts +11 -4
- package/dist/types/vue/src/components/CustomIcon.vue.d.ts +35 -11
- package/dist/types/vue/src/components/DetailItemCard.vue.d.ts +37 -5
- package/dist/types/vue/src/components/DropdownButton.vue.d.ts +3 -3
- package/dist/types/vue/src/components/DropdownMenu.test.d.ts +1 -0
- package/dist/types/vue/src/components/DropdownMenu.vue.d.ts +1 -1
- package/dist/types/vue/src/components/DynamicFormField.test.d.ts +1 -0
- package/dist/types/vue/src/components/DynamicFormField.vue.d.ts +61 -5
- package/dist/types/vue/src/components/DynamicImg.vue.d.ts +28 -3
- package/dist/types/vue/src/components/EmptyState.test.d.ts +1 -0
- package/dist/types/vue/src/components/EmptyState.vue.d.ts +104 -24
- package/dist/types/vue/src/components/FormField.vue.d.ts +2 -1
- package/dist/types/vue/src/components/Gantt/Gantt.test.d.ts +1 -0
- package/dist/types/vue/src/components/Gantt/Gantt.vue.d.ts +160 -0
- package/dist/types/vue/src/components/Gantt/GanttBodyRow.vue.d.ts +78 -0
- package/dist/types/vue/src/components/Gantt/GanttCell.vue.d.ts +28 -0
- package/dist/types/vue/src/components/Gantt/GanttLinkLayer.vue.d.ts +22 -0
- package/dist/types/vue/src/components/Gantt/GanttScale.vue.d.ts +7 -0
- package/dist/types/vue/src/components/Gantt/GanttTaskBar.vue.d.ts +53 -0
- package/dist/types/vue/src/components/Gantt/GanttToolbar.vue.d.ts +22 -0
- package/dist/types/vue/src/components/Gantt/index.d.ts +18 -0
- package/dist/types/vue/src/components/Gantt/labels.d.ts +3 -0
- package/dist/types/vue/src/components/Gantt/types.d.ts +11 -0
- package/dist/types/vue/src/components/Gantt/useGanttDrag.d.ts +105 -0
- package/dist/types/vue/src/components/GlassBackground.vue.d.ts +4 -3
- package/dist/types/vue/src/components/GlassPanel.vue.d.ts +2 -2
- package/dist/types/vue/src/components/HeaderGroup.vue.d.ts +19 -1
- package/dist/types/vue/src/components/HelpButton.test.d.ts +1 -0
- package/dist/types/vue/src/components/HelpButton.vue.d.ts +15 -6
- package/dist/types/vue/src/components/Hero.test.d.ts +1 -0
- package/dist/types/vue/src/components/Hero.vue.d.ts +52 -31
- package/dist/types/vue/src/components/IconButton.vue.d.ts +12 -6
- package/dist/types/vue/src/components/InfiniteScrollPanel.vue.d.ts +61 -14
- package/dist/types/vue/src/components/InfoRow.test.d.ts +1 -0
- package/dist/types/vue/src/components/InfoRow.vue.d.ts +67 -37
- package/dist/types/vue/src/components/InlinePanel.vue.d.ts +12 -18
- package/dist/types/vue/src/components/Input.test.d.ts +1 -0
- package/dist/types/vue/src/components/Input.vue.d.ts +42 -13
- package/dist/types/vue/src/components/InputGroup.test.d.ts +1 -0
- package/dist/types/vue/src/components/InputGroup.vue.d.ts +20 -5
- package/dist/types/vue/src/components/Loader.test.d.ts +1 -0
- package/dist/types/vue/src/components/Loader.vue.d.ts +30 -11
- package/dist/types/vue/src/components/MarkdownEditor.vue.d.ts +1 -1
- package/dist/types/vue/src/components/MetricBar.test.d.ts +1 -0
- package/dist/types/vue/src/components/MetricBar.vue.d.ts +16 -5
- package/dist/types/vue/src/components/Modal.vue.d.ts +18 -19
- package/dist/types/vue/src/components/MultiProgressBar.vue.d.ts +15 -2
- package/dist/types/vue/src/components/MultiSelectPills.test.d.ts +1 -0
- package/dist/types/vue/src/components/MultiSelectPills.vue.d.ts +47 -43
- package/dist/types/vue/src/components/MultiToggle.test.d.ts +1 -0
- package/dist/types/vue/src/components/MultiToggle.vue.d.ts +33 -6
- package/dist/types/vue/src/components/NotificationModal.test.d.ts +1 -0
- package/dist/types/vue/src/components/NotificationModal.vue.d.ts +19 -2
- package/dist/types/vue/src/components/PageHeader.test.d.ts +1 -0
- package/dist/types/vue/src/components/PageHeader.vue.d.ts +18 -0
- package/dist/types/vue/src/components/PagedPanel.test.d.ts +1 -0
- package/dist/types/vue/src/components/PagedPanel.vue.d.ts +39 -11
- package/dist/types/vue/src/components/Panel.vue.d.ts +18 -9
- package/dist/types/vue/src/components/PasswordInput.test.d.ts +1 -0
- package/dist/types/vue/src/components/PasswordInput.vue.d.ts +20 -3
- package/dist/types/vue/src/components/Picker.test.d.ts +1 -0
- package/dist/types/vue/src/components/Picker.vue.d.ts +3 -3
- package/dist/types/vue/src/components/Pill.vue.d.ts +63 -5
- package/dist/types/vue/src/components/Progress.test.d.ts +1 -0
- package/dist/types/vue/src/components/Progress.vue.d.ts +60 -11
- package/dist/types/vue/src/components/ProgressSpinner.test.d.ts +1 -0
- package/dist/types/vue/src/components/ProgressSpinner.vue.d.ts +46 -0
- package/dist/types/vue/src/components/ScrollArea.test.d.ts +1 -0
- package/dist/types/vue/src/components/ScrollArea.vue.d.ts +52 -0
- package/dist/types/vue/src/components/SearchBar.vue.d.ts +2 -3
- package/dist/types/vue/src/components/Section.vue.d.ts +1 -1
- package/dist/types/vue/src/components/SectionCard.vue.d.ts +2 -2
- package/dist/types/vue/src/components/Select.test.d.ts +1 -0
- package/dist/types/vue/src/components/Select.vue.d.ts +41 -16
- package/dist/types/vue/src/components/SidePanel.vue.d.ts +1 -1
- package/dist/types/vue/src/components/SmartInput.vue.d.ts +49 -18
- package/dist/types/vue/src/components/SmartValue.vue.d.ts +20 -13
- package/dist/types/vue/src/components/SmartVariableBadge.vue.d.ts +17 -0
- package/dist/types/vue/src/components/Spinner.test.d.ts +1 -0
- package/dist/types/vue/src/components/Spinner.vue.d.ts +12 -5
- package/dist/types/vue/src/components/SplitView.vue.d.ts +6 -6
- package/dist/types/vue/src/components/StartupStageStepper.vue.d.ts +1 -1
- package/dist/types/vue/src/components/StatChartTile.vue.d.ts +5 -0
- package/dist/types/vue/src/components/StatCountTile.vue.d.ts +5 -1
- package/dist/types/vue/src/components/StatGraphTile.vue.d.ts +1 -1
- package/dist/types/vue/src/components/StatTile.test.d.ts +1 -0
- package/dist/types/vue/src/components/StatTile.vue.d.ts +5 -1
- package/dist/types/vue/src/components/StatusSpinner.test.d.ts +1 -0
- package/dist/types/vue/src/components/StatusSpinner.vue.d.ts +10 -5
- package/dist/types/vue/src/components/Stepper.test.d.ts +1 -0
- package/dist/types/vue/src/components/Stepper.vue.d.ts +62 -25
- package/dist/types/vue/src/components/Table.test.d.ts +1 -0
- package/dist/types/vue/src/components/Table.vue.d.ts +67 -14
- package/dist/types/vue/src/components/Tabs.vue.d.ts +20 -3
- package/dist/types/vue/src/components/TagPicker.vue.d.ts +3 -3
- package/dist/types/vue/src/components/Textarea.vue.d.ts +8 -5
- package/dist/types/vue/src/components/TimelinePanel/TimelinePanel.vue.d.ts +4 -4
- package/dist/types/vue/src/components/Toggle.vue.d.ts +4 -4
- package/dist/types/vue/src/components/Toolbar.test.d.ts +1 -0
- package/dist/types/vue/src/components/Toolbar.vue.d.ts +62 -0
- package/dist/types/vue/src/components/Tooltip.test.d.ts +1 -0
- package/dist/types/vue/src/components/Tooltip.vue.d.ts +20 -3
- package/dist/types/vue/src/components/TooltipWrapper.vue.d.ts +24 -3
- package/dist/types/vue/src/components/TreeView/TreeFlowSvg.vue.d.ts +5 -5
- package/dist/types/vue/src/components/TreeView/TreeItemRow.vue.d.ts +2 -2
- package/dist/types/vue/src/components/TreeView/TreeView.vue.d.ts +4 -4
- package/dist/types/vue/src/components/UserAvatar.test.d.ts +1 -0
- package/dist/types/vue/src/components/UserAvatar.vue.d.ts +56 -6
- package/dist/types/vue/src/components/VariablePicker.vue.d.ts +23 -6
- package/dist/types/vue/src/components/__dbg.test.d.ts +1 -0
- package/dist/types/vue/src/components/index.d.ts +50 -31
- package/dist/types/vue/src/components/internal/InfoRowContent.vue.d.ts +52 -0
- package/dist/types/vue/src/components/internal/PagedPanelContent.vue.d.ts +47 -0
- package/dist/types/vue/src/connectionFlow/index.d.ts +1 -0
- package/dist/types/vue/src/contexts/IconContext.d.ts +8 -3
- package/dist/types/vue/src/i18n/I18nContext.d.ts +14 -0
- package/dist/types/vue/src/i18n/I18nProvider.test.d.ts +2 -0
- package/dist/types/vue/src/i18n/I18nProvider.vue.d.ts +35 -0
- package/dist/types/vue/src/i18n/index.d.ts +8 -0
- package/dist/types/vue/src/i18n/kit-components-spot.test.d.ts +1 -0
- package/dist/types/vue/src/i18n/useI18n.d.ts +44 -0
- package/dist/types/vue/src/index.d.ts +2 -2
- package/dist/types/vue/src/test-setup.d.ts +5 -0
- package/dist/types/vue/src/types/Icon.d.ts +11 -2
- package/dist/types/vue/src/types/TableSettings.d.ts +1 -0
- package/dist/types/vue/src/types/index.d.ts +1 -0
- package/dist/types/vue/src/utils/index.d.ts +1 -0
- package/dist/types/vue/src/utils/sanitizeSvg.d.ts +1 -0
- package/dist/types/vue/src/utils/tableStorage.d.ts +1 -0
- package/dist/ui-kit-vue.css +1 -1
- package/package.json +8 -3
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gantt interaction math — pure. Converts pointer deltas into date/duration
|
|
3
|
+
* edits and computes dependency-arrow geometry.
|
|
4
|
+
*
|
|
5
|
+
* The framework layer (React/Vue) owns the pointer listeners; everything
|
|
6
|
+
* here is a function in, value out, which keeps the behaviour unit-testable
|
|
7
|
+
* without a DOM.
|
|
8
|
+
*/
|
|
9
|
+
import type { GanttBarGeometry, GanttLink, GanttLinkPath, GanttLinkPoint, GanttLinkType, GanttSnap, GanttTask, TrueColor } from "./types";
|
|
10
|
+
export declare const MIN_TASK_MS = 3600000;
|
|
11
|
+
export interface GanttDragState {
|
|
12
|
+
kind: "move" | "resize-start" | "resize-end" | "link" | "reorder" | "progress";
|
|
13
|
+
taskId: string;
|
|
14
|
+
/** Pointer x at drag start, in timeline space. */
|
|
15
|
+
startX: number;
|
|
16
|
+
/** Pointer y at drag start, in row-area space. */
|
|
17
|
+
startY: number;
|
|
18
|
+
/** The task's start/end at drag start, epoch ms. */
|
|
19
|
+
originStart: number;
|
|
20
|
+
originEnd: number;
|
|
21
|
+
/** Row keys the pointer is currently over (reorder preview). */
|
|
22
|
+
beforeKey?: string | null;
|
|
23
|
+
/** Live pointer position (timeline x / row-area y). */
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Produce the edited start/end for a live drag. `deltaX` is in px, the
|
|
29
|
+
* pointer delta from the drag origin. `snap` quantises the result.
|
|
30
|
+
*
|
|
31
|
+
* - `move` shifts both edges.
|
|
32
|
+
* - `resize-start` moves the start edge, clamped to `end - MIN_TASK_MS`.
|
|
33
|
+
* - `resize-end` moves the end edge, clamped to `start + MIN_TASK_MS`.
|
|
34
|
+
*/
|
|
35
|
+
export declare function applyDragDates(state: Pick<GanttDragState, "kind" | "originStart" | "originEnd">, deltaX: number, pxPerDay: number, snap: GanttSnap): {
|
|
36
|
+
start: number;
|
|
37
|
+
end: number;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Commit a drag onto a task: returns the edited task with ISO dates (or the
|
|
41
|
+
* same task when the edit is a no-op).
|
|
42
|
+
*/
|
|
43
|
+
export declare function commitDragEdit(task: GanttTask, startMs: number, endMs: number): GanttTask;
|
|
44
|
+
/** Live progress (0..1) while dragging a progress knob. */
|
|
45
|
+
export declare function progressFromPointer(pointerX: number, barLeft: number, barWidth: number): number;
|
|
46
|
+
/** Radius of the port (connection node) drawn at each bar edge. */
|
|
47
|
+
export declare const LINK_PORT_R = 3.5;
|
|
48
|
+
/**
|
|
49
|
+
* The one uniform margin (px) a connector keeps whenever it passes by a bar:
|
|
50
|
+
* every vertical run hugs the nearest bar edge it passes at exactly this
|
|
51
|
+
* distance (and stays at least this far from the source/target bars it
|
|
52
|
+
* departs or enters). A single constant for obstacle avoidance *and* the
|
|
53
|
+
* shared-column alignment pass, so "passing a bar" always reads as the same
|
|
54
|
+
* padding everywhere in the diagram.
|
|
55
|
+
*/
|
|
56
|
+
export declare const LINK_PASS_PADDING = 6;
|
|
57
|
+
/** How far left of the target's left edge the final corner must sit, so the
|
|
58
|
+
* rounded elbow *and* the arrowhead both sit on a straight approach:
|
|
59
|
+
* corner room + port clearance + arrowhead length + margin. */
|
|
60
|
+
export declare const LINK_ENTRY_CLEAR: number;
|
|
61
|
+
/** A 2D point in timeline pixel space (x, y). */
|
|
62
|
+
export type GanttPt = [number, number];
|
|
63
|
+
type Pt = GanttPt;
|
|
64
|
+
/**
|
|
65
|
+
* Compute the SVG path, arrowhead and port anchors for a dependency link.
|
|
66
|
+
*
|
|
67
|
+
* Port convention (agreed): the connector always leaves the **source's right
|
|
68
|
+
* edge** (its "children" side — the successors it leads to) and enters the
|
|
69
|
+
* **target's left edge** (its "parents" side — the predecessors it depends on).
|
|
70
|
+
* So every dependency reads "item 1's right → item 2's left", and the link
|
|
71
|
+
* type (`fs`/`ff`/`ss`/`sf`) is conveyed by the line style (dashed for
|
|
72
|
+
* `ff`/`sf`) and the tooltip rather than by which edge is used.
|
|
73
|
+
*
|
|
74
|
+
* Routing is a best-path orthogonal route that never crosses a bar:
|
|
75
|
+
* - **Same row** — a straight connector between the two ports.
|
|
76
|
+
* - **Target to the right** — a vertical channel in the horizontal gap
|
|
77
|
+
* between the bars, in a column no intermediate bar occupies.
|
|
78
|
+
* - **Overlapping / "going back"** — the connector steps out of the source
|
|
79
|
+
* row into the clear row-boundary band, drops in a clear column, and
|
|
80
|
+
* enters the target's left edge.
|
|
81
|
+
* - **No clear column** — the route swings out to the right of every bar in
|
|
82
|
+
* the corridor, drops to the target row's clear band, and enters the port.
|
|
83
|
+
*
|
|
84
|
+
* `obstacles` are the bars (other than the source and target) the connector
|
|
85
|
+
* must not cross. `fanSrcY` / `fanTgtY` offset the port vertically so several
|
|
86
|
+
* links sharing a bar fan out instead of stacking. `points` are the corner
|
|
87
|
+
* points of the route (pre-rounding), exposed for the global alignment pass.
|
|
88
|
+
*/
|
|
89
|
+
export declare function linkPath(from: GanttBarGeometry, to: GanttBarGeometry, type: GanttLinkType, fanSrcY?: number, fanTgtY?: number, obstacles?: GanttBarGeometry[]): {
|
|
90
|
+
d: string;
|
|
91
|
+
points: Pt[];
|
|
92
|
+
arrow?: string;
|
|
93
|
+
from: GanttLinkPoint;
|
|
94
|
+
to: GanttLinkPoint;
|
|
95
|
+
};
|
|
96
|
+
/** Max spacing (px) between adjacent ports of links sharing a bar edge. */
|
|
97
|
+
export declare const LINK_FAN_MAX_SPREAD = 16;
|
|
98
|
+
/** Min distance (px) from a port to the bar's top/bottom edge. */
|
|
99
|
+
export declare const LINK_FAN_INSET = 4;
|
|
100
|
+
/** How far past the bar's half height the hover handle may float (into the
|
|
101
|
+
* row's padding) so it can keep the fan's spacing from an occupied port. */
|
|
102
|
+
export declare const LINK_HANDLE_OVERHANG = 4;
|
|
103
|
+
/** Blank right gutter (px) past the timeline, so rightmost link routes and
|
|
104
|
+
* their arrowheads never sit at the scroll edge. */
|
|
105
|
+
export declare const LINK_RIGHT_GUTTER = 24;
|
|
106
|
+
/** Per-bar port slots: `out` = outgoing ports on the right edge, `inc` =
|
|
107
|
+
* incoming ports on the left edge, both as dense arrays of offsets from the
|
|
108
|
+
* bar's centre, in slot order (top → bottom). */
|
|
109
|
+
export interface GanttLinkFanOffsets {
|
|
110
|
+
out: number[];
|
|
111
|
+
inc: number[];
|
|
112
|
+
}
|
|
113
|
+
/** Result of {@link computeLinkFanOffsets}: dense per-bar slots for the hover
|
|
114
|
+
* handles, plus the per-link lookup the path router uses. */
|
|
115
|
+
export interface GanttLinkFanResult {
|
|
116
|
+
bars: Map<string, GanttLinkFanOffsets>;
|
|
117
|
+
/** One entry per input link (same order as `links`): the offset its source
|
|
118
|
+
* edge and target edge ports sit at. Links whose bars are missing get 0. */
|
|
119
|
+
perLink: {
|
|
120
|
+
src: number;
|
|
121
|
+
tgt: number;
|
|
122
|
+
}[];
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Compute the vertical port slots for every bar edge.
|
|
126
|
+
*
|
|
127
|
+
* Links sharing a side are **ordered by the other endpoint's centre Y** (top
|
|
128
|
+
* to bottom) and assigned evenly spaced slots: with n > 1 the spacing is
|
|
129
|
+
* `min(LINK_FAN_MAX_SPREAD, (barH - 2·LINK_FAN_INSET) / (n - 1))`, so ports
|
|
130
|
+
* fan across the bar edge without leaving it; a single link stays centred.
|
|
131
|
+
* Ordering by the other endpoint keeps the fan from crossing at the ports.
|
|
132
|
+
*/
|
|
133
|
+
export declare function computeLinkFanOffsets(links: GanttLink[], bars: Map<string, GanttBarGeometry>): GanttLinkFanResult;
|
|
134
|
+
/**
|
|
135
|
+
* Pick the slot a *new* connector's hover handle / rubber preview should use
|
|
136
|
+
* on a bar edge that already carries `taken` port offsets.
|
|
137
|
+
*
|
|
138
|
+
* The handle floats into the row's padding, so the slot range extends
|
|
139
|
+
* {@link LINK_HANDLE_OVERHANG} past the bar's half height. Placement by
|
|
140
|
+
* preference:
|
|
141
|
+
* 1. the bar centre, when no port sits within a visible gap;
|
|
142
|
+
* 2. otherwise `LINK_FAN_MAX_SPREAD` (the fan's own spacing) away from the
|
|
143
|
+
* nearest port, pushed toward the bar's edge (top first) — so the handle
|
|
144
|
+
* never sits on a port and reads with the same spacing the fan gives its
|
|
145
|
+
* ports;
|
|
146
|
+
* 3. otherwise the centre of the largest free gap (a crowded side).
|
|
147
|
+
* `0` when the side is free.
|
|
148
|
+
*/
|
|
149
|
+
export declare function fanHandleOffset(barHeight: number, taken: number[]): number;
|
|
150
|
+
/**
|
|
151
|
+
* Resolve all visible links into draw-ready paths. Links referencing missing
|
|
152
|
+
* bars are skipped (defensive — a removed task must not break the overlay).
|
|
153
|
+
*
|
|
154
|
+
* Links that share a source (fan-out) or a target (fan-in) take **ordered
|
|
155
|
+
* even slots** on the bar edge ({@link computeLinkFanOffsets}): sorted by the
|
|
156
|
+
* other endpoint's Y, evenly spaced and clamped to the bar, so ports never
|
|
157
|
+
* overlap and lines never cross at the ports. After every route is computed,
|
|
158
|
+
* a global pass aligns overlapping vertical channels into shared columns.
|
|
159
|
+
*/
|
|
160
|
+
export declare function computeLinkPaths(links: GanttLink[], bars: Map<string, GanttBarGeometry>, defaultColor: TrueColor): GanttLinkPath[];
|
|
161
|
+
/**
|
|
162
|
+
* Compute the rubber-band preview path for a link being dragged from `source`
|
|
163
|
+
* toward a pointer at (px, py).
|
|
164
|
+
*
|
|
165
|
+
* - When `target` is supplied (the bar currently under the pointer), the
|
|
166
|
+
* preview is the *exact* committed-connector path — the same best-path,
|
|
167
|
+
* collision-free right→left route the arrow will take once dropped, so the
|
|
168
|
+
* preview never crosses a bar.
|
|
169
|
+
* - When there is no target (dangling mid-drag), the preview runs from the
|
|
170
|
+
* source's right port to the pointer, routed to clear the source bar and
|
|
171
|
+
* every other bar: it descends/ascends in the clear column nearest the
|
|
172
|
+
* pointer (stepping into the clear band on the pointer's side when the
|
|
173
|
+
* pointer is to the left of the source's right edge).
|
|
174
|
+
*
|
|
175
|
+
* `obstacles` are the bars (other than the source and any snapped target) the
|
|
176
|
+
* preview must not cross — normally every other visible bar.
|
|
177
|
+
*
|
|
178
|
+
* Returns the same shape as {@link linkPath} so the layer can render the
|
|
179
|
+
* preview identically to a committed arrow (arrowhead + port nodes).
|
|
180
|
+
*/
|
|
181
|
+
export declare function rubberLinkPath(source: GanttBarGeometry, px: number, py: number, target?: GanttBarGeometry, obstacles?: GanttBarGeometry[],
|
|
182
|
+
/** Vertical slot the rubber band departs from on the source edge (the
|
|
183
|
+
* hover-handle's {@link fanHandleOffset}), so the preview never starts on an
|
|
184
|
+
* existing port. Defaults to the bar centre. */
|
|
185
|
+
fromOffset?: number): {
|
|
186
|
+
d: string;
|
|
187
|
+
arrow?: string;
|
|
188
|
+
from: GanttLinkPoint;
|
|
189
|
+
to: GanttLinkPoint;
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* Anchor a link-creation drag: given the pointer position relative to a bar,
|
|
193
|
+
* return which edge the new link departs from (`"out"` = right edge, the
|
|
194
|
+
* common FS source side). Used to aim the rubber-band preview.
|
|
195
|
+
*/
|
|
196
|
+
export declare function linkSourceAnchor(bar: GanttBarGeometry, pointerX: number): {
|
|
197
|
+
x: number;
|
|
198
|
+
y: number;
|
|
199
|
+
side: 1 | -1;
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* Pick radius (px) for selecting a dependency: the pointer selects the
|
|
203
|
+
* nearest link whose route passes within this many px of it. The visible
|
|
204
|
+
* stroke is ~1.5px wide, so without this, grabbing an arrow would demand
|
|
205
|
+
* pixel-perfect aiming.
|
|
206
|
+
*/
|
|
207
|
+
export declare const LINK_HIT_RADIUS = 6;
|
|
208
|
+
/** Perpendicular distance from (x, y) to a polyline (Infinity when empty). */
|
|
209
|
+
export declare function linkDistance(points: readonly GanttPt[], x: number, y: number): number;
|
|
210
|
+
/**
|
|
211
|
+
* The link the pointer at (x, y) is aiming at: the nearest route within
|
|
212
|
+
* {@link LINK_HIT_RADIUS}. When two connectors run close together the closer
|
|
213
|
+
* one wins (exact ties go to the earlier link), so a generous radius never
|
|
214
|
+
* makes neighbouring arrows ambiguous.
|
|
215
|
+
*/
|
|
216
|
+
export declare function pickLinkAt(paths: readonly GanttLinkPath[], x: number, y: number, radius?: number): GanttLinkPath | null;
|
|
217
|
+
/** Today marker x for a `today` date within the view. */
|
|
218
|
+
export declare function todayX(today: number, viewStart: number, pxPerDay: number): number;
|
|
219
|
+
/** Convenience: duration label from a drag state's live dates. */
|
|
220
|
+
export declare function dragDurationLabel(start: number, end: number): string;
|
|
221
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gantt — framework-agnostic core (types, time engine, layout, interaction
|
|
3
|
+
* math, tokens, sample data). The React and Vue kits wrap this engine with
|
|
4
|
+
* their own component layers; the engine itself has no framework imports.
|
|
5
|
+
*/
|
|
6
|
+
export * from "./types";
|
|
7
|
+
export * from "./time";
|
|
8
|
+
export * from "./layout";
|
|
9
|
+
export * from "./drag";
|
|
10
|
+
export * from "./tokens";
|
|
11
|
+
export * from "./sample";
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gantt row layout — pure. Flattens the task hierarchy into renderable rows,
|
|
3
|
+
* attaches lanes, computes row geometry and roll-up progress.
|
|
4
|
+
*
|
|
5
|
+
* Row order rules (top to bottom):
|
|
6
|
+
* 1. Tasks are grouped by `lane` (a task with no `lane` id goes to a
|
|
7
|
+
* synthetic "default" lane, rendered without a band when no explicit
|
|
8
|
+
* lanes were provided at all).
|
|
9
|
+
* 2. Within a lane, top-level tasks keep their input order (or the explicit
|
|
10
|
+
* `rowOrder` when supplied); children are depth-first under their parent.
|
|
11
|
+
* 3. A lane or task with `open: false` collapses to its header row only.
|
|
12
|
+
*/
|
|
13
|
+
import type { GanttLane, GanttRow, GanttTask } from "./types";
|
|
14
|
+
export declare const DEFAULT_ROW_HEIGHT = 44;
|
|
15
|
+
export declare const GROUP_ROW_HEIGHT = 40;
|
|
16
|
+
/** Roll-up of a task's descendants: duration-weighted, clamped to 0..1. */
|
|
17
|
+
export declare function rollupProgress(task: GanttTask, tasksById: Map<string, GanttTask>, childrenByParent: Map<string, GanttTask[]>): number;
|
|
18
|
+
/**
|
|
19
|
+
* Roll-up of the task identified by `taskId`: its own progress for a leaf,
|
|
20
|
+
* the duration-weighted roll-up of its descendants for a group (the value a
|
|
21
|
+
* group row displays — groups have no progress of their own). `override` is
|
|
22
|
+
* a preview edit of *any* task (usually the dragged child — live dates or
|
|
23
|
+
* live progress) substituted in place of that task's committed values before
|
|
24
|
+
* the roll-up is computed, which is what makes a group's percentage follow
|
|
25
|
+
* its child in real time while the child is being edited.
|
|
26
|
+
* Returns `null` when `taskId` is not in the list.
|
|
27
|
+
*/
|
|
28
|
+
export declare function taskRollupProgress(tasks: GanttTask[], taskId: string, override?: GanttTask): number | null;
|
|
29
|
+
/**
|
|
30
|
+
* Duration-weighted progress over the lane that owns `taskId`, with
|
|
31
|
+
* `override` (a preview edit of that task — the live dates of an in-flight
|
|
32
|
+
* bar drag, or the live progress of a knob drag) substituted in place of
|
|
33
|
+
* the task's committed values. This is what lets a lane header recompute
|
|
34
|
+
* its roll-up in real time while one of its children is being edited.
|
|
35
|
+
* Returns `null` when `taskId` is not in the list.
|
|
36
|
+
*/
|
|
37
|
+
export declare function laneRollupProgress(tasks: GanttTask[], taskId: string, override?: GanttTask): {
|
|
38
|
+
laneId: string;
|
|
39
|
+
progress: number;
|
|
40
|
+
} | null;
|
|
41
|
+
/**
|
|
42
|
+
* Build the row model.
|
|
43
|
+
*
|
|
44
|
+
* @param tasks The task list (parents may precede or follow children).
|
|
45
|
+
* @param lanes Optional lane (swimlane) definitions; explicit lanes render
|
|
46
|
+
* even when empty (an empty band).
|
|
47
|
+
* @param rowOrder Optional explicit top-level order (task ids, per lane, in
|
|
48
|
+
* lane order). Ids not listed keep their input order and
|
|
49
|
+
* sort after the listed ones within their lane.
|
|
50
|
+
* @param rowHeight Row height in px.
|
|
51
|
+
*/
|
|
52
|
+
export declare function buildRows(tasks: GanttTask[], lanes?: GanttLane[], rowOrder?: string[], rowHeight?: number): {
|
|
53
|
+
rows: GanttRow[];
|
|
54
|
+
tasksById: Map<string, GanttTask>;
|
|
55
|
+
laneById: Map<string, GanttLane>;
|
|
56
|
+
laneOrder: string[];
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Y (px, body-relative) of the reorder insertion indicator for the given
|
|
60
|
+
* displayed row order: the top edge of the row the dragged row is being
|
|
61
|
+
* inserted before, or — for an end drop — the bottom of the scope block
|
|
62
|
+
* (the parent's visible block for a child drag, the lane segment for a
|
|
63
|
+
* top-level drag). Pass the *previewed* row order while a live reorder is
|
|
64
|
+
* in flight so the indicator tracks the slot the dragged row currently
|
|
65
|
+
* occupies. Returns `null` when the dragged row can't be found.
|
|
66
|
+
*/
|
|
67
|
+
export declare function reorderPreviewTop(rows: GanttRow[], dragKey: string, beforeId: string | null): number | null;
|
|
68
|
+
/**
|
|
69
|
+
* Apply a reorder drop to the dataset.
|
|
70
|
+
*
|
|
71
|
+
* - Top-level drag (`dragId` has no parent): `order` is the new per-lane
|
|
72
|
+
* top-level id order for `buildRows`; `tasks` is the input array.
|
|
73
|
+
* - Child drag (`dragId` has a parent): the row moves among its *siblings*
|
|
74
|
+
* (same parent). The top-level `order` is unchanged; `tasks` is a new flat
|
|
75
|
+
* array with the dragged task repositioned relative to its siblings
|
|
76
|
+
* (sibling order is the tasks-array order).
|
|
77
|
+
*
|
|
78
|
+
* `beforeId` is the top-level / sibling task id to insert before, or `null`
|
|
79
|
+
* for the end of the lane / sibling list. Returns the input references
|
|
80
|
+
* unchanged when the drop is a no-op (onto itself, across parents or lanes,
|
|
81
|
+
* or landing where the row already is).
|
|
82
|
+
*/
|
|
83
|
+
export interface RowReorderResult {
|
|
84
|
+
/** Per-lane top-level id order for `buildRows` (unchanged for child drags). */
|
|
85
|
+
order: string[];
|
|
86
|
+
/** Flat tasks array with the child-level move applied (the input array for
|
|
87
|
+
* top-level drags and no-ops). */
|
|
88
|
+
tasks: GanttTask[];
|
|
89
|
+
}
|
|
90
|
+
export declare function applyRowReorder(tasks: GanttTask[], dragId: string, beforeId: string | null, currentOrder?: string[]): RowReorderResult;
|
|
91
|
+
/**
|
|
92
|
+
* Resolve the reorder drop target for a live pointer position (`pointerY`
|
|
93
|
+
* in the row area's pixel space) — the same before/after system
|
|
94
|
+
* SmartGridLayout uses, evaluated against *blocks*: a row and its visible
|
|
95
|
+
* descendants form one unit, because a top-level drag can only address
|
|
96
|
+
* top-level rows and a child drag can only address its siblings.
|
|
97
|
+
*
|
|
98
|
+
* - Top-level drag: the candidate blocks are the other top-level subtrees
|
|
99
|
+
* of the dragged lane.
|
|
100
|
+
* - Child drag: the candidate blocks are the sibling subtrees (same
|
|
101
|
+
* parent).
|
|
102
|
+
*
|
|
103
|
+
* The pointer decides at the *block's* midpoint:
|
|
104
|
+
* - Above the midpoint → insert before the block.
|
|
105
|
+
* - Below the midpoint → insert after the block (i.e. before the next
|
|
106
|
+
* block; `null` = end of the lane / sibling list).
|
|
107
|
+
* - Over the object being dragged (the dragged subtree's band) → the
|
|
108
|
+
* previous target is kept. This is also the press itself: nothing shifts
|
|
109
|
+
* until the pointer crosses into a neighbouring block, and the shift
|
|
110
|
+
* happens once it has passed that block's midpoint — never "almost over
|
|
111
|
+
* the second item".
|
|
112
|
+
* - Above the first block (the lane header band) → top of the lane; below
|
|
113
|
+
* the last block → end of the lane.
|
|
114
|
+
*
|
|
115
|
+
* `currentBeforeId` is `undefined` before the first decision (right after
|
|
116
|
+
* the press) — no preview until the pointer commits. Because resolution
|
|
117
|
+
* runs against the *live preview* rows, a committed move parks the pointer
|
|
118
|
+
* over the dragged object's new band, where the target is kept — a stable
|
|
119
|
+
* fixed point, no oscillation.
|
|
120
|
+
*/
|
|
121
|
+
export declare function resolveDropBeforeId(rows: GanttRow[], tasksById: Map<string, GanttTask>, dragKey: string, pointerY: number, currentBeforeId?: string | null): {
|
|
122
|
+
beforeId: string | null | undefined;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* The visible object being dragged for a reorder: the dragged row plus its
|
|
126
|
+
* visible descendant rows (contiguous in the live model — a single row for
|
|
127
|
+
* a leaf, the whole expanded block for an open group). `null` when the drag
|
|
128
|
+
* row can't be found. Used for the dashed ghost slot (its total height) and
|
|
129
|
+
* the floating clone (its stacked rows).
|
|
130
|
+
*/
|
|
131
|
+
export declare function reorderDragSubtree(rows: GanttRow[], dragKey: string): GanttRow[] | null;
|
|
132
|
+
/** The top-level ancestor task id of a row (the row's task when top level). */
|
|
133
|
+
export declare function topAncestorId(row: GanttRow, tasksById: Map<string, GanttTask>): string | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gantt sample project — a small product release with three swimlanes,
|
|
3
|
+
* hierarchy, milestones, dependencies and mixed colours. Dates are anchored
|
|
4
|
+
* to "today" so the demo always shows a live-looking plan around the
|
|
5
|
+
* today-marker.
|
|
6
|
+
*/
|
|
7
|
+
import type { GanttLane, GanttLink, GanttTask } from "./types";
|
|
8
|
+
export declare const sampleGanttLanes: GanttLane[];
|
|
9
|
+
export declare function sampleGanttTasks(now?: Date): GanttTask[];
|
|
10
|
+
export declare function sampleGanttLinks(): GanttLink[];
|
|
11
|
+
export declare const sampleGantt: {
|
|
12
|
+
lanes: GanttLane[];
|
|
13
|
+
tasks: typeof sampleGanttTasks;
|
|
14
|
+
links: typeof sampleGanttLinks;
|
|
15
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gantt time engine — pure date/scale math, no framework imports.
|
|
3
|
+
*
|
|
4
|
+
* The timeline is a linear time→px projection: `x = (t - viewStart) *
|
|
5
|
+
* pxPerDay / MS_PER_DAY`. Header levels are generated from the real calendar
|
|
6
|
+
* (month columns have real widths, weeks start on the configured weekday), so
|
|
7
|
+
* labels never drift from the grid.
|
|
8
|
+
*/
|
|
9
|
+
import type { GanttDate, GanttSnap, GanttTimeScaleLevel } from "./types";
|
|
10
|
+
export declare const MS_PER_DAY = 86400000;
|
|
11
|
+
export declare const MS_PER_HOUR = 3600000;
|
|
12
|
+
export declare const MS_PER_WEEK: number;
|
|
13
|
+
/** Week starts Monday (0) … Sunday (6). Default 1 = Monday. */
|
|
14
|
+
export declare const GANTT_WEEK_START = 1;
|
|
15
|
+
export declare function toMs(value: GanttDate): number;
|
|
16
|
+
export declare function msToIso(ms: number): string;
|
|
17
|
+
/** Whole days between two ms values (fractional). */
|
|
18
|
+
export declare function daysBetween(a: number, b: number): number;
|
|
19
|
+
export declare function startOfDay(ms: number): number;
|
|
20
|
+
export declare function addDays(ms: number, days: number): number;
|
|
21
|
+
/** `weekday` 1 = Monday … 7 = Sunday, matching the ISO week (0 unused). */
|
|
22
|
+
export declare function startOfWeek(ms: number, weekday?: number): number;
|
|
23
|
+
export declare function startOfMonth(ms: number): number;
|
|
24
|
+
export declare function startOfQuarter(ms: number): number;
|
|
25
|
+
export declare function startOfYear(ms: number): number;
|
|
26
|
+
export declare function endOfMonth(ms: number): number;
|
|
27
|
+
/** Start of the month `months` from `ms` (negative supported). */
|
|
28
|
+
export declare function addMonths(ms: number, months: number): number;
|
|
29
|
+
type LabelLocale = string | undefined;
|
|
30
|
+
export declare function formatDay(ms: number, locale?: LabelLocale): string;
|
|
31
|
+
export declare function formatDayNumber(ms: number, locale?: LabelLocale): string;
|
|
32
|
+
export declare function formatWeekday(ms: number, locale?: LabelLocale): string;
|
|
33
|
+
export declare function formatMonth(ms: number, locale?: LabelLocale): string;
|
|
34
|
+
export declare function formatMonthName(ms: number, locale?: LabelLocale): string;
|
|
35
|
+
export declare function formatYear(ms: number, locale?: LabelLocale): string;
|
|
36
|
+
export declare function formatQuarter(ms: number, _locale?: LabelLocale): string;
|
|
37
|
+
export declare function formatDateTime(ms: number, locale?: LabelLocale): string;
|
|
38
|
+
/** "3d" / "1d 4h" / "6h" — duration label for tooltips & cells. */
|
|
39
|
+
export declare function formatDuration(startMs: number, endMs: number): string;
|
|
40
|
+
/**
|
|
41
|
+
* Compute the timeline's visible range from the data: from the earliest
|
|
42
|
+
* start to the latest end, padded one week on each side so the outermost bar
|
|
43
|
+
* is not glued to the edge. Zoom-independent on purpose — the zoom handler
|
|
44
|
+
* anchors the date under the pointer, which is only exact when the range
|
|
45
|
+
* does not move between zoom steps.
|
|
46
|
+
*/
|
|
47
|
+
export declare function computeViewRange(starts: number[], ends: number[]): {
|
|
48
|
+
start: number;
|
|
49
|
+
end: number;
|
|
50
|
+
};
|
|
51
|
+
export declare function dateToX(ms: number, viewStart: number, pxPerDay: number): number;
|
|
52
|
+
export declare function xToDate(x: number, viewStart: number, pxPerDay: number): number;
|
|
53
|
+
/**
|
|
54
|
+
* Snap a timestamp to the configured unit. `week` snaps to the start of the
|
|
55
|
+
* week. `none` passes through (still clamped to the hour when the timeline is
|
|
56
|
+
* hour-fine, i.e. pxPerDay > 120).
|
|
57
|
+
*/
|
|
58
|
+
export declare function snapDate(ms: number, snap: GanttSnap): number;
|
|
59
|
+
/**
|
|
60
|
+
* Pick the base header unit for a zoom. Two levels are produced: a coarse
|
|
61
|
+
* level (month/year/quarter) and a fine level whose columns are the grid
|
|
62
|
+
* lines of the timeline.
|
|
63
|
+
*/
|
|
64
|
+
export declare function pickBaseUnit(pxPerDay: number): "day" | "week" | "month" | "quarter";
|
|
65
|
+
/**
|
|
66
|
+
* Build the two header levels for the visible range. Columns align to real
|
|
67
|
+
* calendar boundaries and carry their true widths (a February is narrower
|
|
68
|
+
* than a March).
|
|
69
|
+
*/
|
|
70
|
+
export declare function buildTimeScale(rangeStart: number, rangeEnd: number, pxPerDay: number, locale?: string): GanttTimeScaleLevel[];
|
|
71
|
+
/** ISO-8601 week number (used for the week header label). */
|
|
72
|
+
export declare function getIsoWeekNumber(ms: number): number;
|
|
73
|
+
/**
|
|
74
|
+
* Width of the visible timeline in px.
|
|
75
|
+
*/
|
|
76
|
+
export declare function rangeWidth(rangeStart: number, rangeEnd: number, pxPerDay: number): number;
|
|
77
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gantt colour tokens — TrueColor → Tailwind class maps.
|
|
3
|
+
*
|
|
4
|
+
* Every dynamic class produced here is emitted by
|
|
5
|
+
* `scripts/generate-safelist.mjs` (Gantt section), because the scanner only
|
|
6
|
+
* sees static strings. The dark: pairs keep the chart legible on both
|
|
7
|
+
* schemes without a single hand-edited hex.
|
|
8
|
+
*/
|
|
9
|
+
import type { TrueColor } from "../theme/Theme";
|
|
10
|
+
export interface GanttBarTokens {
|
|
11
|
+
/** Bar fill (light + dark identical — saturated reads on both). Used for
|
|
12
|
+
* the milestone diamond, owner initials and badges. */
|
|
13
|
+
fill: string;
|
|
14
|
+
/** Light base of a task bar — the un-done part of a bar reads as a soft
|
|
15
|
+
* tint, so the darker progress fill stands out (done vs. remaining). */
|
|
16
|
+
base: string;
|
|
17
|
+
/** Base hover step. */
|
|
18
|
+
baseHover: string;
|
|
19
|
+
/** Progress overlay inside the bar (the done part, a step darker than the
|
|
20
|
+
* base). */
|
|
21
|
+
progress: string;
|
|
22
|
+
/** Milestone diamond fill. */
|
|
23
|
+
milestone: string;
|
|
24
|
+
/** Bar border / 1px rim. */
|
|
25
|
+
rim: string;
|
|
26
|
+
/** Text on the bar. */
|
|
27
|
+
text: string;
|
|
28
|
+
/** Soft tint used for the row wash behind a task's bar. */
|
|
29
|
+
soft: string;
|
|
30
|
+
/** Soft tint, dark scheme. */
|
|
31
|
+
softDark: string;
|
|
32
|
+
}
|
|
33
|
+
export declare function getGanttBarTokens(color: TrueColor): GanttBarTokens;
|
|
34
|
+
export interface GanttLaneTokens {
|
|
35
|
+
/** Lane band background. */
|
|
36
|
+
band: string;
|
|
37
|
+
/** Lane header label colour. */
|
|
38
|
+
label: string;
|
|
39
|
+
/** Accent edge of the lane header. */
|
|
40
|
+
accent: string;
|
|
41
|
+
/** Progress chip fill. */
|
|
42
|
+
chip: string;
|
|
43
|
+
}
|
|
44
|
+
export declare function getGanttLaneTokens(color: TrueColor): GanttLaneTokens;
|
|
45
|
+
export interface GanttColumnTokens {
|
|
46
|
+
/** Header cell background. */
|
|
47
|
+
header: string;
|
|
48
|
+
/** Header text. */
|
|
49
|
+
text: string;
|
|
50
|
+
/** Cell divider. */
|
|
51
|
+
border: string;
|
|
52
|
+
}
|
|
53
|
+
export declare function getGanttColumnTokens(color: TrueColor): GanttColumnTokens;
|
|
54
|
+
export interface GanttLinkTokens {
|
|
55
|
+
/** SVG stroke class for the arrow. */
|
|
56
|
+
stroke: string;
|
|
57
|
+
/** Arrow head / port-node fill. */
|
|
58
|
+
fill: string;
|
|
59
|
+
/** Pale halo behind a port node. */
|
|
60
|
+
halo: string;
|
|
61
|
+
}
|
|
62
|
+
export declare function getGanttLinkTokens(color: TrueColor): GanttLinkTokens;
|
|
63
|
+
/** Today marker: the Gantt's accent colour. */
|
|
64
|
+
export declare function getGanttTodayTokens(color: TrueColor): {
|
|
65
|
+
line: string;
|
|
66
|
+
chip: string;
|
|
67
|
+
text: string;
|
|
68
|
+
};
|
|
69
|
+
/** Selection ring for a focused/selected bar. */
|
|
70
|
+
export declare function getGanttSelectionTokens(color: TrueColor): {
|
|
71
|
+
ring: string;
|
|
72
|
+
row: string;
|
|
73
|
+
};
|