@umriss-ui/schedule 0.3.16 → 0.5.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/CHANGELOG.md +121 -0
- package/README.md +23 -10
- package/dist/index.d.ts +120 -54
- package/dist/schedule.js +1536 -1466
- package/docs/llms-full.md +3081 -741
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -15,6 +15,127 @@ moves from here under the rule above.
|
|
|
15
15
|
|
|
16
16
|
---
|
|
17
17
|
|
|
18
|
+
## 0.5.0 – Declared through useSchedule, with a view of its own (Oct. 2026)
|
|
19
|
+
|
|
20
|
+
Released together with `@umriss-ui/charts` and `@umriss-ui/table`, which
|
|
21
|
+
break in the same release. A schedule is declared through `useSchedule`, as a
|
|
22
|
+
table is through `useTable` and a chart through `useChart` (ADR-0048), and it
|
|
23
|
+
holds its own **view** - the span in view and the folded lane groups -, taken
|
|
24
|
+
as a start and reported whole (ADR-0047). The free components and the
|
|
25
|
+
controlled pairs are removed, not deprecated.
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
**Moving over.** Every export and prop that went, and what stands in its
|
|
30
|
+
place:
|
|
31
|
+
|
|
32
|
+
| Was | Is |
|
|
33
|
+
|---|---|
|
|
34
|
+
| `import { Schedule, Lane, LaneGroup, Subtasks, Dependencies, BlockedTimes }` | `const { Schedule, Lane, … } = useSchedule()` - one `Schedule` per call; a ref on it still gives the `ScheduleHandle` |
|
|
35
|
+
| `Schedule initialDomain` (required) | `useSchedule({ initialView: { domain } })`; without a span the schedule shows the extent of its subtasks |
|
|
36
|
+
| `Schedule collapsedGroups` (controlled) | `view.folded`, and `toggleGroup`, `foldAll`, `unfoldAll` from `useSchedule`; or a new `initialView: { folded }` |
|
|
37
|
+
| `Schedule defaultCollapsedGroups` | `useSchedule({ initialView: { folded } })` |
|
|
38
|
+
| `Schedule onCollapsedGroupsChange` | `useSchedule({ onViewChange })`, `view.folded` |
|
|
39
|
+
| `Schedule onDomainChange` | `useSchedule({ onViewChange })`, `view.domain` |
|
|
40
|
+
|
|
41
|
+
- **`Schedule` and its parts are no exports of their own.** `useSchedule()`
|
|
42
|
+
hands them out; they keep their identity over every render. Their props
|
|
43
|
+
stay public types.
|
|
44
|
+
- **A span is optional.** `initialDomain` was required; without a `domain`
|
|
45
|
+
in the view the schedule shows the extent of its subtasks, lead-in and
|
|
46
|
+
lead-out included, widened or narrowed around its middle into
|
|
47
|
+
`zoomLimits` - fitted once, not after every change of the data, so a
|
|
48
|
+
dragged bar does not make the plan jump; without subtasks the local day of
|
|
49
|
+
today.
|
|
50
|
+
- **A view handed in applies by its content.** `initialDomain` went back to
|
|
51
|
+
a new pair of values; `initialView` applies whenever it differs in content
|
|
52
|
+
from the last one handed in - the folded groups compared as a set -, the
|
|
53
|
+
same view again changes nothing, and what it leaves out is reset. A group
|
|
54
|
+
id no group carries falls out. **A known limit:** a view handed in that
|
|
55
|
+
equals one the schedule reported less than a second ago, and that has not
|
|
56
|
+
come back yet, is taken for the schedule's own report coming back late and
|
|
57
|
+
is not applied - so that linked schedules do not jump back mid-pan. An
|
|
58
|
+
application that restores a just-reported view within that second sees no
|
|
59
|
+
change.
|
|
60
|
+
- **One report for both.** `onViewChange(view)` replaces
|
|
61
|
+
`onDomainChange` and `onCollapsedGroupsChange`: every change once, always
|
|
62
|
+
the whole view, a pan or zoom at most once per frame, not the view the
|
|
63
|
+
schedule starts with. `selectedTask` and `onSelectedTaskChange` are a
|
|
64
|
+
selection, not the view, and stay as they are; so does `zoomLimits`.
|
|
65
|
+
|
|
66
|
+
### Added
|
|
67
|
+
|
|
68
|
+
- **`useSchedule({ initialView, onViewChange })`** with `view`,
|
|
69
|
+
`setDomain(span | null)` (`null` = the subtasks' extent), `toggleGroup(id)`,
|
|
70
|
+
`foldAll()` and `unfoldAll()` on what it hands back.
|
|
71
|
+
- **Types**: `ScheduleParts`, `ScheduleOptions`, `ScheduleView`.
|
|
72
|
+
- **The demo** has a page 'View' (keep a view across a reload and restore
|
|
73
|
+
it); 'Linked schedules' keep in step through a shared view, and Lane
|
|
74
|
+
groups' "Fold groups from outside" folds through the setters, at the
|
|
75
|
+
anchor `#fold-from-outside` - the old `#controlled` lands there.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## 0.4.0 – Every export explained, and lane counts in every language (Oct. 2026)
|
|
80
|
+
|
|
81
|
+
The package explains itself where it is used: every export carries a comment,
|
|
82
|
+
every default a `@default` tag, and the demo lists all of it in an API index
|
|
83
|
+
(ADR-0044). A group's lane count is fitted anew when the language changes.
|
|
84
|
+
Needs `@umriss-ui/core` 0.25 and `@umriss-ui/charts` 0.10; the peer ranges move
|
|
85
|
+
to `^0.25.0` and `^0.10.0`.
|
|
86
|
+
|
|
87
|
+
### Added
|
|
88
|
+
|
|
89
|
+
- **The First schedule page says what a screen reader meets**: a section
|
|
90
|
+
Accessibility after Keyboard names the plot's role, name and summary, the
|
|
91
|
+
readout after a key, the label to pass and what forced colours and reduced
|
|
92
|
+
motion change. Every other page with a schedule in its examples has a
|
|
93
|
+
Keyboard section linking First schedule's keys; Dependencies and Pan and
|
|
94
|
+
zoom also list the keys of their own feature there. In the demo, the
|
|
95
|
+
Markdown twins and `docs/llms-full.md`; the schedule is unchanged.
|
|
96
|
+
- **Every export carries a comment**: what a component, a function or a type is
|
|
97
|
+
for, and for a function `@param` and `@returns` where its type alone does not
|
|
98
|
+
say it. The editor shows it on hover, from the package's `.d.ts`. Nothing
|
|
99
|
+
else changes.
|
|
100
|
+
- **A prop's default stands in a `@default` tag** where its comment used to say
|
|
101
|
+
it in words: the editor shows it on hover, and the props table in its Default
|
|
102
|
+
column. Nothing else changes.
|
|
103
|
+
- **`docs/llms-full.md` defines every type a props table names**: a type
|
|
104
|
+
without a table of its own (`Intent`, the charts' `WorkingCalendar`) stands
|
|
105
|
+
under "Types on this page" of each page that names it, with its comment and
|
|
106
|
+
its members or its declaration.
|
|
107
|
+
- **The demo has an API index**: `/schedule/api/`, the last entry of the
|
|
108
|
+
sidebar, lists every export of `@umriss-ui/schedule`, grouped as components,
|
|
109
|
+
functions, constants and types, alphabetical - each value with its comment
|
|
110
|
+
and its declaration, each type with a link to its table or its definition,
|
|
111
|
+
and the pages that use it. A hook or a function a page names, in its text or
|
|
112
|
+
its import line, leads to its entry. `docs/llms-full.md` ends with the same
|
|
113
|
+
index, in place of the appendix "The rest of the API". The library is
|
|
114
|
+
unchanged.
|
|
115
|
+
- **Every prop of a props table is shown, or named as an exception**: new
|
|
116
|
+
examples for groups that start folded (`defaultCollapsedGroups`), one
|
|
117
|
+
handover drawn its own way (a dependency's `attach` and `ends`) and a
|
|
118
|
+
tooltip that says what a bar covers and a line joins (`subtask`, `blocked`,
|
|
119
|
+
`dependency`, `from`, `to`); the list of findings now writes `departure`
|
|
120
|
+
and `arrival`, and "Report the pointer" names the lane, as its lead
|
|
121
|
+
promised. The two props left without an example, `className` and `style`,
|
|
122
|
+
are pass-throughs; the demo's list says so. The schedule is unchanged.
|
|
123
|
+
|
|
124
|
+
### Fixed
|
|
125
|
+
|
|
126
|
+
- **A group's lane count is measured anew when the language changes**: a
|
|
127
|
+
wording switched under a mounted schedule (English to German, say) left the
|
|
128
|
+
counts as the old wording had fitted them, so "2 Bahnen" stood beside a cut
|
|
129
|
+
name. Now the name wins over the count in every language, as it already did
|
|
130
|
+
after a reload - measured anew whenever the header column changes size or
|
|
131
|
+
anything it shows changes, a custom label's content included.
|
|
132
|
+
- **`docs/llms-full.md` names the peers in its install line**:
|
|
133
|
+
`npm install @umriss-ui/schedule @umriss-ui/core @umriss-ui/charts`, read
|
|
134
|
+
from the manifest. It had named the schedule alone, and an install after it
|
|
135
|
+
lacked core and charts.
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
18
139
|
## 0.3.16 – Core 0.24.0 (Oct. 2026)
|
|
19
140
|
|
|
20
141
|
Needs `@umriss-ui/core` 0.24; the peer range moves to `^0.24.0`. Nothing else changes for a caller.
|
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ the working calendar, the canvas colour resolution — from charts. React 18 or
|
|
|
24
24
|
## The smallest schedule that runs
|
|
25
25
|
|
|
26
26
|
```tsx
|
|
27
|
-
import {
|
|
27
|
+
import { useSchedule } from "@umriss-ui/schedule";
|
|
28
28
|
import type { Subtask, Task, Dependency } from "@umriss-ui/schedule";
|
|
29
29
|
|
|
30
30
|
const at = (h: number, m = 0) => new Date(2026, 2, 17, h, m).getTime();
|
|
@@ -37,8 +37,9 @@ const subtasks: Subtask[] = [
|
|
|
37
37
|
const dependencies: Dependency[] = [{ id: "move", from: "cut", to: "mill", lag: 15 * 60_000 }];
|
|
38
38
|
|
|
39
39
|
export function Plan() {
|
|
40
|
+
const { Schedule, Lane, Subtasks, Dependencies } = useSchedule({ initialView: { domain: [at(5), at(12)] } });
|
|
40
41
|
return (
|
|
41
|
-
<Schedule ariaLabel="Plan of Tuesday"
|
|
42
|
+
<Schedule ariaLabel="Plan of Tuesday">
|
|
42
43
|
<Lane id="saw" label="Saw" />
|
|
43
44
|
<Lane id="mill" label="Mill" />
|
|
44
45
|
<Dependencies data={dependencies} />
|
|
@@ -115,9 +116,8 @@ reported for it, and no intent names it (ADR-0025).
|
|
|
115
116
|
Folded, a group becomes one row showing a **miniature** — every lane in it as a
|
|
116
117
|
thin strip, the real work smaller. Dependencies still arrive at the right strip,
|
|
117
118
|
findings are still marked, and a strip can still be hovered and selected:
|
|
118
|
-
folding costs a planner detail and never access.
|
|
119
|
-
|
|
120
|
-
application's hands; it is a view state, never an intent.
|
|
119
|
+
folding costs a planner detail and never access. Which groups are folded is
|
|
120
|
+
part of the schedule's view, never an intent.
|
|
121
121
|
|
|
122
122
|
## Reading and moving
|
|
123
123
|
|
|
@@ -127,9 +127,18 @@ off. `now` draws the present across the lanes. The wheel over the schedule,
|
|
|
127
127
|
lane headers included, scrolls the lanes and releases the page at their end,
|
|
128
128
|
Ctrl or ⌘ and a pinch zoom, Shift pans; on a touch screen one finger pans and a
|
|
129
129
|
tap selects. The lane headers take at most 40 % of the width, so that on a
|
|
130
|
-
phone the plot keeps the larger part;
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
phone the plot keeps the larger part; a ref handle turns a client point into a
|
|
131
|
+
time and a lane and back.
|
|
132
|
+
|
|
133
|
+
## The view
|
|
134
|
+
|
|
135
|
+
The schedule holds its own view (ADR-0047): the span in view and the folded
|
|
136
|
+
groups. `useSchedule({ initialView, onViewChange })` takes a start and reports
|
|
137
|
+
every change, always the whole view; a view handed in that differs from the
|
|
138
|
+
last one applies at once, so two schedules keep in step by handing each other
|
|
139
|
+
what they report. Without a span the schedule shows the extent of its subtasks.
|
|
140
|
+
`view`, `setDomain`, `toggleGroup`, `foldAll` and `unfoldAll` stand on what the
|
|
141
|
+
hook hands back.
|
|
133
142
|
|
|
134
143
|
## Blocked time
|
|
135
144
|
|
|
@@ -155,12 +164,16 @@ Done from this list: **blocked time** per lane.
|
|
|
155
164
|
|
|
156
165
|
* The demo: <https://romanhaendler.github.io/umriss-ui/schedule/>, or locally
|
|
157
166
|
`pnpm dev:schedule` (port 4176). It is the documentation — every page shows
|
|
158
|
-
running examples with their source and the props table generated from `src
|
|
167
|
+
running examples with their source and the props table generated from `src/`,
|
|
168
|
+
each prop linked to the examples that show it. An API index lists every
|
|
169
|
+
export, one search finds across all five packages, and the header switches
|
|
170
|
+
the examples to German.
|
|
159
171
|
* [`CHANGELOG.md`](CHANGELOG.md) — what changes for a caller.
|
|
160
172
|
* **For a coding agent**: `docs/llms-full.md` inside the installed package —
|
|
161
173
|
the demo as one Markdown file, pinned to the installed version: every page
|
|
162
174
|
with its examples' source, its props tables and why it is built as it is,
|
|
163
|
-
and
|
|
175
|
+
and an index of every export with its comment and its declaration. Each
|
|
176
|
+
page also has a Markdown twin online; for the latest version:
|
|
164
177
|
<https://romanhaendler.github.io/umriss-ui/schedule/llms.txt>.
|
|
165
178
|
* The vocabulary — **Task**, **Subtask**, **Lead-in**, **Lead-out**,
|
|
166
179
|
**Dependency**, **Violated dependency**, **Blocked time**, **Lane header**, **Lane group**,
|
package/dist/index.d.ts
CHANGED
|
@@ -35,8 +35,9 @@ export declare interface BlockedTime {
|
|
|
35
35
|
|
|
36
36
|
/** A layer of blocked time. Wherever it is declared, it is drawn behind every
|
|
37
37
|
subtask and dependency: it is a property of the lane, not something on it. */
|
|
38
|
-
|
|
38
|
+
declare function BlockedTimes({ data }: BlockedTimesProps): null;
|
|
39
39
|
|
|
40
|
+
/** The props of `BlockedTimes`. */
|
|
40
41
|
export declare interface BlockedTimesProps {
|
|
41
42
|
/** The blocked time of the lanes - leave, maintenance, unavailability -, as
|
|
42
43
|
the caller holds it: one list, each interval naming its lane. */
|
|
@@ -48,8 +49,9 @@ export declare function departure(dependency: Dependency, from: Subtask): number
|
|
|
48
49
|
|
|
49
50
|
/** A layer of dependencies. Declared before `Subtasks`, the lines run beneath the
|
|
50
51
|
bars; after them, above. */
|
|
51
|
-
|
|
52
|
+
declare function Dependencies({ data }: DependenciesProps): null;
|
|
52
53
|
|
|
54
|
+
/** The props of `Dependencies`. */
|
|
53
55
|
export declare interface DependenciesProps {
|
|
54
56
|
/** The dependencies, as the caller holds them. */
|
|
55
57
|
data: readonly Dependency[];
|
|
@@ -68,11 +70,12 @@ export declare interface Dependency {
|
|
|
68
70
|
begin as soon as the predecessor ends. */
|
|
69
71
|
readonly lag: number;
|
|
70
72
|
/** Where it leaves: at the end of the main time, or after the lead-out.
|
|
71
|
-
|
|
73
|
+
The predecessor counts as ended once its lead-out is.
|
|
74
|
+
@default "leadOut" */
|
|
72
75
|
readonly leaves?: "main" | "leadOut";
|
|
73
76
|
/** Where it arrives: at the start of the main time, or before the lead-in.
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
The lag must have run out before the successor's lead-in begins.
|
|
78
|
+
@default "leadIn" */
|
|
76
79
|
readonly arrives?: "main" | "leadIn";
|
|
77
80
|
/** How this one is drawn, where it is not drawn like the rest. It changes
|
|
78
81
|
the picture and never the finding: whether a dependency is violated follows
|
|
@@ -145,24 +148,26 @@ export declare type IntentKind = Intent["kind"];
|
|
|
145
148
|
|
|
146
149
|
/** One lane: a person, a vehicle, a room. The lanes run top to bottom in the order
|
|
147
150
|
they are declared - whichever group they are declared in. */
|
|
148
|
-
|
|
151
|
+
declare function Lane({ id, label }: LaneProps): null;
|
|
149
152
|
|
|
150
153
|
/** A group of lanes: structure over them, and never a lane itself.
|
|
151
154
|
|
|
152
155
|
It gives its id to its children through context, so a lane never names its
|
|
153
156
|
group and a group reads in JSX as it reads in the organisation. Folded, it becomes
|
|
154
157
|
one row showing a **Miniature** of everything in it; open, it shows a slim
|
|
155
|
-
head above its lanes. Which groups are folded is
|
|
156
|
-
`
|
|
157
|
-
|
|
158
|
+
head above its lanes. Which groups are folded is part of the schedule's
|
|
159
|
+
view (`useSchedule`) - never an **Intent**. */
|
|
160
|
+
declare function LaneGroup({ id, label, children }: LaneGroupProps): ReactNode;
|
|
158
161
|
|
|
162
|
+
/** The props of `LaneGroup`. */
|
|
159
163
|
export declare interface LaneGroupProps {
|
|
160
|
-
/** The group's identity - what `
|
|
164
|
+
/** The group's identity - what the view's `folded` names. It is never a lane:
|
|
161
165
|
no subtask sits on it, no finding is reported for it, and no intent names
|
|
162
166
|
it (ADR-0025). */
|
|
163
167
|
id: string;
|
|
164
168
|
/** What the group's header says - the team, the depot, the region.
|
|
165
|
-
Real text, read by a screen reader
|
|
169
|
+
Real text, read by a screen reader.
|
|
170
|
+
@default id */
|
|
166
171
|
label?: ReactNode;
|
|
167
172
|
/** `Lane`s and further `LaneGroup`s, to any depth. */
|
|
168
173
|
children?: ReactNode;
|
|
@@ -177,11 +182,13 @@ export declare interface LaneIntent {
|
|
|
177
182
|
readonly lane: string;
|
|
178
183
|
}
|
|
179
184
|
|
|
185
|
+
/** The props of `Lane`. */
|
|
180
186
|
export declare interface LaneProps {
|
|
181
187
|
/** The identity subtasks name in their `lane`. */
|
|
182
188
|
id: string;
|
|
183
189
|
/** What the lane header says - the person, vehicle or room. Real text, read by a
|
|
184
|
-
screen reader
|
|
190
|
+
screen reader.
|
|
191
|
+
@default id */
|
|
185
192
|
label?: ReactNode;
|
|
186
193
|
}
|
|
187
194
|
|
|
@@ -278,6 +285,10 @@ export declare interface PlacingItem {
|
|
|
278
285
|
readonly leadOut?: number;
|
|
279
286
|
}
|
|
280
287
|
|
|
288
|
+
/** Settles a subtask's appearances into what is drawn. `provisional` and
|
|
289
|
+
`fixed` contradict each other; the later one in the list wins.
|
|
290
|
+
@param appearance The subtask's `appearance`, in the order it was given.
|
|
291
|
+
@returns Which of the four channels are on. */
|
|
281
292
|
export declare function resolveAppearance(appearance: readonly SubtaskAppearance[] | undefined): ResolvedAppearance;
|
|
282
293
|
|
|
283
294
|
/** What the drawing needs to know, with the contradiction already settled.
|
|
@@ -285,8 +296,7 @@ export declare function resolveAppearance(appearance: readonly SubtaskAppearance
|
|
|
285
296
|
The four names are the ones this module was born with, and they are kept so
|
|
286
297
|
that a caller's code does not change because a picture did. Two of them are
|
|
287
298
|
now named after a drawing they no longer use, and the channel each one
|
|
288
|
-
really owns stands beside it
|
|
289
|
-
STATEMENT"). */
|
|
299
|
+
really owns stands beside it. */
|
|
290
300
|
export declare interface ResolvedAppearance {
|
|
291
301
|
/** `provisional`: the FILL - none at all, so the surface shows through, with
|
|
292
302
|
a dashed outline in the task colour. Planned, not released. */
|
|
@@ -309,8 +319,6 @@ export declare interface ResolvedAppearance {
|
|
|
309
319
|
bounded number of pushes instead of running on. */
|
|
310
320
|
export declare function ripple(subtasks: readonly Subtask[], dependencies: readonly Dependency[], intent: Intent): MoveIntent[];
|
|
311
321
|
|
|
312
|
-
export declare const Schedule: ForwardRefExoticComponent<ScheduleProps & RefAttributes<ScheduleHandle>>;
|
|
313
|
-
|
|
314
322
|
/** What a schedule offers a caller imperatively: the arithmetic between a
|
|
315
323
|
point on the screen and a time on a lane. Everything else is props. */
|
|
316
324
|
export declare interface ScheduleHandle {
|
|
@@ -361,35 +369,79 @@ export declare interface ScheduleInteraction {
|
|
|
361
369
|
readonly lane: string | null;
|
|
362
370
|
}
|
|
363
371
|
|
|
372
|
+
/** What `useSchedule` takes: the view to start from and the handler that
|
|
373
|
+
hears every change of it. */
|
|
374
|
+
export declare interface ScheduleOptions {
|
|
375
|
+
/** The view to start from, and to go to whenever one differing in content
|
|
376
|
+
from the last is handed in - the same view again changes nothing, and
|
|
377
|
+
what it leaves out is reset; one the schedule reported itself, handed
|
|
378
|
+
back late, is its own state coming back and not gone to. The schedule
|
|
379
|
+
remembers none: where a view is kept is the application's decision. */
|
|
380
|
+
initialView?: ScheduleView;
|
|
381
|
+
/** Every change of the view, once, always the whole view - the one to keep,
|
|
382
|
+
or to hand another schedule as its `initialView`. A pan or zoom is
|
|
383
|
+
reported at most once per frame. Not called for the view the schedule
|
|
384
|
+
starts with. */
|
|
385
|
+
onViewChange?: (view: ScheduleView) => void;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/** What `useSchedule` hands back: the schedule and what is declared inside
|
|
389
|
+
it, its view and the setters that change it. */
|
|
390
|
+
export declare interface ScheduleParts {
|
|
391
|
+
/** The schedule. One per `useSchedule`: a second schedule is a second call. */
|
|
392
|
+
Schedule: ForwardRefExoticComponent<ScheduleProps & RefAttributes<ScheduleHandle>>;
|
|
393
|
+
Lane: typeof Lane;
|
|
394
|
+
LaneGroup: typeof LaneGroup;
|
|
395
|
+
Subtasks: typeof Subtasks;
|
|
396
|
+
Dependencies: typeof Dependencies;
|
|
397
|
+
BlockedTimes: typeof BlockedTimes;
|
|
398
|
+
/** How the planner is looking at the plan: the span and the folded groups. */
|
|
399
|
+
view: ScheduleView;
|
|
400
|
+
/** Puts a span of two wall-clock instants in view; `null` shows the
|
|
401
|
+
subtasks' extent. */
|
|
402
|
+
setDomain: (span: readonly [number, number] | null) => void;
|
|
403
|
+
/** Folds or unfolds one **Lane group**. */
|
|
404
|
+
toggleGroup: (id: string) => void;
|
|
405
|
+
/** Folds every group. */
|
|
406
|
+
foldAll: () => void;
|
|
407
|
+
/** Unfolds every group. */
|
|
408
|
+
unfoldAll: () => void;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/** The props of `Schedule`. */
|
|
364
412
|
export declare interface ScheduleProps {
|
|
365
413
|
/** What the schedule shows, for a screen reader: "Plan of week 38". */
|
|
366
414
|
ariaLabel: string;
|
|
367
|
-
/**
|
|
368
|
-
|
|
369
|
-
initialDomain: readonly [number, number];
|
|
370
|
-
/** Height in CSS pixels, both bands included. The width is the host's. */
|
|
415
|
+
/** Height in CSS pixels, both bands included. The width is the host's.
|
|
416
|
+
@default 400 */
|
|
371
417
|
height?: number;
|
|
372
|
-
/** Height of one lane in pixels.
|
|
418
|
+
/** Height of one lane in pixels.
|
|
419
|
+
@default 44 */
|
|
373
420
|
laneHeight?: number;
|
|
374
421
|
/** Width of the lane headers in pixels - at most 40 % of the schedule, so
|
|
375
|
-
that on a phone the plot keeps the larger part.
|
|
422
|
+
that on a phone the plot keeps the larger part.
|
|
423
|
+
@default 160 */
|
|
376
424
|
headerWidth?: number;
|
|
377
425
|
/** A working calendar: the intervals in which time counts. Nights and
|
|
378
|
-
weekends outside them are cut out of the axis.
|
|
426
|
+
weekends outside them are cut out of the axis. Without intervals every
|
|
427
|
+
hour counts, as on the wall clock.
|
|
428
|
+
@default [] */
|
|
379
429
|
calendar?: CalendarInput;
|
|
380
430
|
/** The narrowest and widest time span zoom may reach, in milliseconds.
|
|
381
|
-
|
|
431
|
+
@default one hour to 28 days */
|
|
382
432
|
zoomLimits?: ZoomLimits;
|
|
383
433
|
/** The raster a drag lands on: `"ticks"` - the fine band's current step -, a
|
|
384
434
|
step in milliseconds from local midnight, a step with an offset (shifts at
|
|
385
435
|
06:00, 14:00 and 22:00 are eight hours offset by six), or `false` for none.
|
|
386
|
-
It shapes the ghost and the intent, never the data.
|
|
436
|
+
It shapes the ghost and the intent, never the data.
|
|
437
|
+
@default "ticks" */
|
|
387
438
|
snap?: "ticks" | number | SnapRaster | false;
|
|
388
439
|
/** The intents the caller handles. Each one enables its interaction; none
|
|
389
|
-
leaves a read-only schedule (ADR-0023).
|
|
440
|
+
leaves a read-only schedule (ADR-0023).
|
|
441
|
+
@default [] */
|
|
390
442
|
intents?: readonly IntentKind[];
|
|
391
|
-
/** Whether a subtask may go to a lane.
|
|
392
|
-
|
|
443
|
+
/** Whether a subtask may go to a lane. It narrows `"lane"`, it does not
|
|
444
|
+
enable it.
|
|
393
445
|
|
|
394
446
|
Asked once per lane when a drag takes hold, and asked again at the drop.
|
|
395
447
|
The lanes it turns down are marked from the first frame of the drag - a
|
|
@@ -399,7 +451,8 @@ export declare interface ScheduleProps {
|
|
|
399
451
|
nothing else: a drop after it still reports the move in time.
|
|
400
452
|
|
|
401
453
|
It is asked for work dragged in from outside as well, with the key and
|
|
402
|
-
task the application declared in `placing`.
|
|
454
|
+
task the application declared in `placing`.
|
|
455
|
+
@default every lane is open */
|
|
403
456
|
canMoveTo?: (subtask: Subtask, lane: string) => boolean;
|
|
404
457
|
/** Called once per intent when a drag ends. The data changes only if the
|
|
405
458
|
caller changes it. */
|
|
@@ -415,24 +468,6 @@ export declare interface ScheduleProps {
|
|
|
415
468
|
nothing. It is called again when another subtask of the same task is
|
|
416
469
|
clicked. */
|
|
417
470
|
onSelectedTaskChange?: (task: string | null, subtask: string | null) => void;
|
|
418
|
-
/** The **Lane group**s that are folded, controlled. Leave it out and the
|
|
419
|
-
schedule keeps them itself, starting from `defaultCollapsedGroups`.
|
|
420
|
-
|
|
421
|
-
Folding changes the view and not the plan, which is why it is no intent:
|
|
422
|
-
a caller that applies every intent it receives must never find a fold
|
|
423
|
-
among them (ADR-0025). A folded outer group hides the inner ones without
|
|
424
|
-
their entries leaving the list, so unfolding it gives back the view that
|
|
425
|
-
was there. */
|
|
426
|
-
collapsedGroups?: readonly string[];
|
|
427
|
-
/** Which groups are folded when the schedule mounts, where the schedule
|
|
428
|
-
keeps the state itself. Ignored while `collapsedGroups` is given. */
|
|
429
|
-
defaultCollapsedGroups?: readonly string[];
|
|
430
|
-
/** Called with the whole list when the planner folds or unfolds a group. */
|
|
431
|
-
onCollapsedGroupsChange?: (groups: readonly string[]) => void;
|
|
432
|
-
/** The visible time span after the planner panned or zoomed, as two
|
|
433
|
-
wall-clock instants - for keeping a second schedule or a chart in step. A
|
|
434
|
-
span handed in through `initialDomain` is not reported back. */
|
|
435
|
-
onDomainChange?: (domain: readonly [number, number]) => void;
|
|
436
471
|
/** What the application is dragging in from outside while it drags it - its
|
|
437
472
|
key, task, the length of its main time, its lead-in and lead-out. The
|
|
438
473
|
browser hands the dragged data over only on the drop, so the ghost before
|
|
@@ -441,19 +476,22 @@ export declare interface ScheduleProps {
|
|
|
441
476
|
placing?: PlacingItem | null;
|
|
442
477
|
/** How the dependencies are drawn: a `"curve"` that leaves and arrives
|
|
443
478
|
forwards, a `"straight"` line, or `"orthogonal"` segments. A dependency may
|
|
444
|
-
say otherwise for itself.
|
|
479
|
+
say otherwise for itself.
|
|
480
|
+
@default "curve" */
|
|
445
481
|
route?: DependencyRoute;
|
|
446
482
|
/** Where a dependency's ends sit on their bars: the `"centre"` of both, or the
|
|
447
483
|
`"nearest"` edge - which is the shortest line between two stops. Within
|
|
448
484
|
one lane both mean the middle. A dependency may say otherwise for itself.
|
|
449
485
|
|
|
450
486
|
It changes the picture and never a finding: whether a dependency is violated
|
|
451
|
-
follows from its `leaves` and `arrives` alone.
|
|
487
|
+
follows from its `leaves` and `arrives` alone.
|
|
488
|
+
@default "centre" */
|
|
452
489
|
attach?: DependencyAttachment;
|
|
453
|
-
/** Whether a dependency's two ends carry a dot (`"dot"
|
|
454
|
-
|
|
490
|
+
/** Whether a dependency's two ends carry a dot (`"dot"`) or the line
|
|
491
|
+
stands alone (`"none"`). The dot says where the line is anchored - a
|
|
455
492
|
help while a plan is being read, and noise in a plan full of short moves.
|
|
456
|
-
A dependency may say otherwise for itself.
|
|
493
|
+
A dependency may say otherwise for itself.
|
|
494
|
+
@default "dot" */
|
|
457
495
|
ends?: DependencyEnds;
|
|
458
496
|
/** What stands written in a bar: a function from a subtask to a line of
|
|
459
497
|
text, or nothing for bars without text. The text is cut off with an
|
|
@@ -466,7 +504,8 @@ export declare interface ScheduleProps {
|
|
|
466
504
|
what the pointer rests on and returns content of the application's own. */
|
|
467
505
|
tooltip?: false | ((target: ScheduleTooltipTarget) => ReactNode);
|
|
468
506
|
/** A line marking the present across the lanes: `true` follows the clock by
|
|
469
|
-
the minute, an instant fixes it there.
|
|
507
|
+
the minute, an instant fixes it there.
|
|
508
|
+
@default false */
|
|
470
509
|
now?: boolean | number;
|
|
471
510
|
/** Goes to the root element. */
|
|
472
511
|
className?: string;
|
|
@@ -507,6 +546,26 @@ export declare type ScheduleTooltipTarget = {
|
|
|
507
546
|
readonly violated: ViolatedDependency | undefined;
|
|
508
547
|
};
|
|
509
548
|
|
|
549
|
+
/** How a planner is looking at the plan. Whatever is at its default is absent. */
|
|
550
|
+
export declare interface ScheduleView {
|
|
551
|
+
/** The span in view, as two wall-clock instants. Absent, the schedule shows
|
|
552
|
+
the extent of its subtasks, within `zoomLimits`. */
|
|
553
|
+
domain?: readonly [number, number];
|
|
554
|
+
/** The **Lane group**s that are folded, by id. An id no group carries falls
|
|
555
|
+
out. A folded outer group hides the inner ones without their ids leaving
|
|
556
|
+
the list, so unfolding it gives back the view that was there. */
|
|
557
|
+
folded?: readonly string[];
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
/** The moves that carry a whole task in time - every subtask of it by the same
|
|
561
|
+
amount, so that its lengths and the distances between its stops stay as
|
|
562
|
+
they were. The schedule never runs it: apply the moves like any other
|
|
563
|
+
intent, or run `ripple` over them first.
|
|
564
|
+
@param subtasks All subtasks; only those of `task` are moved.
|
|
565
|
+
@param task The id of the task, as its subtasks name it in `task`.
|
|
566
|
+
@param by How far, in milliseconds; negative is earlier.
|
|
567
|
+
@returns One move intent per subtask of the task - none where `by` is zero
|
|
568
|
+
or not finite. */
|
|
510
569
|
export declare function shiftTask(subtasks: readonly Subtask[], task: string, by: number): MoveIntent[];
|
|
511
570
|
|
|
512
571
|
/** A raster: a step, and where it starts after local midnight. */
|
|
@@ -570,8 +629,9 @@ export declare type SubtaskAppearance = "provisional" | "fixed" | "muted" | "ope
|
|
|
570
629
|
export declare function subtaskFromPlace(intent: PlaceIntent, id: string): Subtask;
|
|
571
630
|
|
|
572
631
|
/** A layer of subtasks. Several layers draw in the order they are declared. */
|
|
573
|
-
|
|
632
|
+
declare function Subtasks({ data, tasks }: SubtasksProps): null;
|
|
574
633
|
|
|
634
|
+
/** The props of `Subtasks`. */
|
|
575
635
|
export declare interface SubtasksProps {
|
|
576
636
|
/** The subtasks, as the caller holds them. The schedule never changes one. */
|
|
577
637
|
data: readonly Subtask[];
|
|
@@ -592,6 +652,12 @@ export declare interface Task {
|
|
|
592
652
|
readonly name?: string;
|
|
593
653
|
}
|
|
594
654
|
|
|
655
|
+
/** Declares a schedule: hands back `Schedule` and the parts declared inside it
|
|
656
|
+
- `Lane`, `LaneGroup`, `Subtasks`, `Dependencies`, `BlockedTimes` -, its
|
|
657
|
+
`view` and the setters `setDomain`, `toggleGroup`, `foldAll` and
|
|
658
|
+
`unfoldAll`. A ref on `Schedule` still gives the `ScheduleHandle`. */
|
|
659
|
+
export declare function useSchedule(options?: ScheduleOptions): ScheduleParts;
|
|
660
|
+
|
|
595
661
|
/** Every dependency whose successor is to be reached before the predecessor's
|
|
596
662
|
departure plus the dependency's lag. A dependency naming a subtask that
|
|
597
663
|
is not in the data is passed over: there is nothing to judge. */
|