react-native-roster 0.3.0 → 0.4.1
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/README.md +27 -2
- package/dist/src/components/roster/body-layout.d.ts +3 -1
- package/dist/src/components/roster/body-layout.d.ts.map +1 -1
- package/dist/src/components/roster/body-layout.js +6 -2
- package/dist/src/components/roster/body-layout.js.map +1 -1
- package/dist/src/components/roster/index.d.ts.map +1 -1
- package/dist/src/components/roster/index.js +4 -3
- package/dist/src/components/roster/index.js.map +1 -1
- package/dist/src/components/roster/parts/body.d.ts.map +1 -1
- package/dist/src/components/roster/parts/body.js +2 -2
- package/dist/src/components/roster/parts/body.js.map +1 -1
- package/dist/src/components/roster/parts/lane-list.d.ts +2 -2
- package/dist/src/components/roster/parts/lane-list.d.ts.map +1 -1
- package/dist/src/components/roster/parts/now-line.d.ts +3 -0
- package/dist/src/components/roster/parts/now-line.d.ts.map +1 -0
- package/dist/src/components/roster/parts/now-line.js +16 -0
- package/dist/src/components/roster/parts/now-line.js.map +1 -0
- package/dist/src/components/roster/roster.types.d.ts +17 -1
- package/dist/src/components/roster/roster.types.d.ts.map +1 -1
- package/dist/src/components/roster/use-roster.d.ts.map +1 -1
- package/dist/src/components/roster/use-roster.js +6 -1
- package/dist/src/components/roster/use-roster.js.map +1 -1
- package/dist/src/core/index.d.ts +1 -1
- package/dist/src/core/index.d.ts.map +1 -1
- package/dist/src/core/index.js +2 -1
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/core/layout.d.ts.map +1 -1
- package/dist/src/core/layout.js +2 -1
- package/dist/src/core/layout.js.map +1 -1
- package/dist/src/core/snap.d.ts +4 -0
- package/dist/src/core/snap.d.ts.map +1 -1
- package/dist/src/core/snap.js +5 -0
- package/dist/src/core/snap.js.map +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +5 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/nativewind/index.d.ts +1 -0
- package/dist/src/nativewind/index.d.ts.map +1 -1
- package/llms.txt +34 -7
- package/package.json +8 -8
- package/src/components/roster/README.md +16 -5
- package/src/components/roster/body-layout.tsx +15 -0
- package/src/components/roster/index.tsx +5 -0
- package/src/components/roster/parts/body.tsx +39 -2
- package/src/components/roster/parts/lane-list.tsx +2 -2
- package/src/components/roster/parts/now-line.tsx +19 -0
- package/src/components/roster/roster.types.ts +15 -9
- package/src/components/roster/use-roster.ts +8 -1
- package/src/core/README.md +1 -1
- package/src/core/index.ts +1 -1
- package/src/core/layout.ts +2 -1
- package/src/core/snap.ts +9 -0
- package/src/index.ts +3 -0
package/README.md
CHANGED
|
@@ -247,6 +247,19 @@ Roster's web-only pointer callback. `highlightSource={{ kind, id }}` applies
|
|
|
247
247
|
`highlightColor` to every matching rect without new geometry. Sorting defaults
|
|
248
248
|
to `byLabel`; `byCoverage({ measure })` sorts by coverage descending.
|
|
249
249
|
|
|
250
|
+
## Now line
|
|
251
|
+
|
|
252
|
+
The optional `now` prop accepts epoch milliseconds or `null` (the default, which
|
|
253
|
+
draws nothing). Pass `now={timestamp}` to draw a vertical 2 px red line across the
|
|
254
|
+
body at the projected instant. Only `window.start <= now < window.end` is visible.
|
|
255
|
+
The caller owns clock updates; Roster starts no timer. `useRoster` exposes `now` and `nowLine`.
|
|
256
|
+
`now` retains the raw instant. `nowLine` (`{ x, now }`) uses the fitted
|
|
257
|
+
`pxPerMinute` scale and is null when `now` is null or outside the window.
|
|
258
|
+
Replace `nowLineComponent` to customize the line using `RosterNowLineInput`
|
|
259
|
+
(`{ x, now }`). The line follows horizontal scrolling; changing `now` does not
|
|
260
|
+
invalidate mounted lanes. The every-zone gallery fixture can toggle a fixed
|
|
261
|
+
instant at the window midpoint.
|
|
262
|
+
|
|
250
263
|
## Roster zones
|
|
251
264
|
|
|
252
265
|
Props ending in `Component` accept `ComponentType<Input>` and are mounted by React.
|
|
@@ -265,12 +278,13 @@ or press behavior. Pass `null` to a node slot to suppress its default.
|
|
|
265
278
|
| `intervalDetailComponent` | `rect`, `layer`, `lane`, `highlighted`, absolute `start` and `end`, `viewTimezone` | Absent by default; enables selection and fills its details. |
|
|
266
279
|
| `selectionLayout` | `SelectionLayoutProps`: nodes, targetBounds, open, dismissal, host, and shared scroll | `RosterSelectionPopover`: native portal or Radix web popover; replace at runtime. |
|
|
267
280
|
| `gapComponent` | `rect`, `layer`, `lane` | `RosterGap`: no visible content; the row supplies pressable bounds. |
|
|
281
|
+
| `nowLineComponent` | `RosterNowLineInput` (`x`, `now`) | `RosterNowLine`: noninteractive vertical red line across the body. |
|
|
268
282
|
| `gridComponent` | `ticks`, `contentWidth` | `RosterGrid`: one hairline per tick behind every lane. |
|
|
269
283
|
| `headerComponent` | `ticks`, `projection`, `scroll`, `contentWidth`, `headerCellComponent` | `RosterHeader`: frozen header following horizontal offset. |
|
|
270
284
|
| `laneLabelColumnComponent` | `labels`, `projection`, `scroll`, `laneLabelComponent` | `RosterLaneLabelColumn`: frozen labels following vertical offset. |
|
|
271
|
-
| `bodyComponent` | Ordered `lanes`, `window`, `geometryFor`, `projection`, `scroll`, `press`, `ticks`, `viewport`, `contentWidth`, highlight and hover, incomplete label, and rect components | `RosterBody`: virtualized lanes. |
|
|
285
|
+
| `bodyComponent` | Ordered `lanes`, `window`, `geometryFor`, `projection`, `scroll`, `press`, `ticks`, `viewport`, `contentWidth`, `nowLine`, `nowLineComponent`, highlight and hover, incomplete label, and rect components | `RosterBody`: virtualized lanes. |
|
|
272
286
|
|
|
273
|
-
`RosterBody` composes `RosterBodyLayout`, which arranges `gridZone` and `
|
|
287
|
+
`RosterBody` composes `RosterBodyLayout`, which arranges `gridZone`, `listZone`, and optional `overlayZone`
|
|
274
288
|
nodes with scroll wiring, and `RosterLaneList`, which owns LegendList and its
|
|
275
289
|
per-lane callback. The body waits for viewport measurement before mounting the list.
|
|
276
290
|
|
|
@@ -545,6 +559,17 @@ network). The home page lists every fixture route:
|
|
|
545
559
|
NativeWind class props and slot components, with a sun and moon theme toggle.
|
|
546
560
|
Names, titles, and the organization come from `@faker-js/faker` with a fixed
|
|
547
561
|
seed; any resemblance to real people is coincidental.
|
|
562
|
+
Each event compares scheduled time with seeded attendee arrivals and departures.
|
|
563
|
+
A fixed seeded now separates past, live, and future events; attendees are expected,
|
|
564
|
+
pending, present, attended, or absent. Present spans extend through now without
|
|
565
|
+
exposing future departures, including after scheduled end until actual departure.
|
|
566
|
+
A bottom strip draws the union of attendances over the lighter scheduled block,
|
|
567
|
+
preserving gaps and overhang. The event detail popover shares a shaded scheduled
|
|
568
|
+
band across attendance rows. Its footer status line defaults to the attendance
|
|
569
|
+
legend and scheduled-band explanation; web hover or visible keyboard focus shows
|
|
570
|
+
row detail, and native taps toggle detail or switch rows. The inspector retains
|
|
571
|
+
member selection. This feature lives in
|
|
572
|
+
[demo/components/team-roster](./demo/components/team-roster/README.md).
|
|
548
573
|
|
|
549
574
|
| Platform | Support and evidence |
|
|
550
575
|
| --- | --- |
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import type { BodyInput } from './roster.types';
|
|
3
|
-
export declare function RosterBodyLayout({ scroll, contentWidth, viewport, gridZone, listZone, }: Pick<BodyInput, 'scroll' | 'contentWidth' | 'viewport'> & {
|
|
3
|
+
export declare function RosterBodyLayout({ scroll, contentWidth, viewport, gridZone, listZone, overlayZone, }: Pick<BodyInput, 'scroll' | 'contentWidth' | 'viewport'> & {
|
|
4
4
|
/** Noninteractive grid behind the lane list. */
|
|
5
5
|
gridZone: ReactNode;
|
|
6
6
|
/** Virtualized lane collection within the measured viewport. */
|
|
7
7
|
listZone: ReactNode;
|
|
8
|
+
/** Noninteractive content above the grid and lane list, following horizontal scroll. */
|
|
9
|
+
overlayZone?: ReactNode;
|
|
8
10
|
}): import("react/jsx-runtime").JSX.Element;
|
|
9
11
|
//# sourceMappingURL=body-layout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body-layout.d.ts","sourceRoot":"","sources":["../../../../src/components/roster/body-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAE5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,QAAQ,
|
|
1
|
+
{"version":3,"file":"body-layout.d.ts","sourceRoot":"","sources":["../../../../src/components/roster/body-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAE5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,WAAW,GACZ,EAAE,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,cAAc,GAAG,UAAU,CAAC,GAAG;IAC3D,gDAAgD;IAChD,QAAQ,EAAE,SAAS,CAAC;IACpB,gEAAgE;IAChE,QAAQ,EAAE,SAAS,CAAC;IACpB,wFAAwF;IACxF,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB,2CAkCA"}
|
|
@@ -4,12 +4,16 @@ exports.RosterBodyLayout = RosterBodyLayout;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const react_native_1 = require("react-native");
|
|
7
|
-
function RosterBodyLayout({ scroll, contentWidth, viewport, gridZone, listZone, }) {
|
|
7
|
+
function RosterBodyLayout({ scroll, contentWidth, viewport, gridZone, listZone, overlayZone, }) {
|
|
8
|
+
let overlay = null;
|
|
9
|
+
if (overlayZone != null) {
|
|
10
|
+
overlay = ((0, jsx_runtime_1.jsx)(react_native_1.View, { pointerEvents: "none", style: { position: 'absolute', top: 0, bottom: 0, left: 0, right: 0, zIndex: 1 }, children: overlayZone }));
|
|
11
|
+
}
|
|
8
12
|
const [contentOffset] = (0, react_1.useState)(() => ({ x: scroll.x.get(), y: 0 }));
|
|
9
13
|
const bodyRef = scroll.bodyRef;
|
|
10
14
|
(0, react_1.useEffect)(() => {
|
|
11
15
|
bodyRef.current?.scrollTo({ x: contentOffset.x, animated: false });
|
|
12
16
|
}, [bodyRef, contentOffset]);
|
|
13
|
-
return ((0, jsx_runtime_1.jsx)(react_native_1.ScrollView, { testID: "roster-horizontal-scroll", ref: scroll.bodyRef, contentOffset: contentOffset, horizontal: true, onScroll: scroll.onBodyScroll, scrollEventThrottle: 16, style: { flex: 1 }, children: (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: { width: contentWidth, height: viewport.height }, children: [gridZone, listZone] }) }));
|
|
17
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.ScrollView, { testID: "roster-horizontal-scroll", ref: scroll.bodyRef, contentOffset: contentOffset, horizontal: true, onScroll: scroll.onBodyScroll, scrollEventThrottle: 16, style: { flex: 1 }, children: (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: { width: contentWidth, height: viewport.height }, children: [gridZone, listZone, overlay] }) }));
|
|
14
18
|
}
|
|
15
19
|
//# sourceMappingURL=body-layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body-layout.js","sourceRoot":"","sources":["../../../../src/components/roster/body-layout.tsx"],"names":[],"mappings":";;;;AAAA,iCAA4D;AAC5D,+CAAgD;AAGhD,0BAAiC,EAC/B,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,QAAQ,
|
|
1
|
+
{"version":3,"file":"body-layout.js","sourceRoot":"","sources":["../../../../src/components/roster/body-layout.tsx"],"names":[],"mappings":";;;;AAAA,iCAA4D;AAC5D,+CAAgD;AAGhD,0BAAiC,EAC/B,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,WA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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/roster/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAS,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/roster/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAS,MAAM,OAAO,CAAC;AAc9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAQlD,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,+TAuIxC"}
|
|
@@ -15,13 +15,14 @@ const grid_1 = require("./parts/grid");
|
|
|
15
15
|
const header_1 = require("./parts/header");
|
|
16
16
|
const header_cell_1 = require("./parts/header-cell");
|
|
17
17
|
const lane_label_column_1 = require("./parts/lane-label-column");
|
|
18
|
+
const now_line_1 = require("./parts/now-line");
|
|
18
19
|
const selection_layout_1 = require("./selection/selection-layout");
|
|
19
20
|
const use_roster_1 = require("./use-roster");
|
|
20
21
|
const defaultEmptyZone = (0, jsx_runtime_1.jsx)(empty_1.RosterEmpty, {});
|
|
21
22
|
const defaultCornerZone = (0, jsx_runtime_1.jsx)(corner_1.RosterCorner, {});
|
|
22
23
|
function Roster(props) {
|
|
23
|
-
const { selection, dismissSelection, status, orderedLanes, laneState, window, geometryFor, projection, scroll, press, ticks, contentWidth, viewport, onLayout, } = (0, use_roster_1.useRoster)({ ...props, selectable: Boolean(props.intervalDetailComponent) });
|
|
24
|
-
const { intervalDetailComponent: IntervalDetailComponent, selectionLayout: SelectionLayout = selection_layout_1.RosterSelectionPopover, emptyZone = defaultEmptyZone, cornerZone = defaultCornerZone, headerComponent: HeaderComponent = header_1.RosterHeader, laneLabelColumnComponent: LaneLabelColumnComponent = lane_label_column_1.RosterLaneLabelColumn, bodyComponent: BodyComponent = body_1.RosterBody, headerCellComponent = header_cell_1.RosterHeaderCell, laneLabelComponent = lane_label_1.RosterLaneLabel, intervalComponent = interval_1.RosterInterval, gapComponent = gap_1.RosterGap, gridComponent = grid_1.RosterGrid, incompleteLabel = 'Availability may be incomplete', neverSetLabel = 'No availability set', } = props;
|
|
24
|
+
const { nowLine, selection, dismissSelection, status, orderedLanes, laneState, window, geometryFor, projection, scroll, press, ticks, contentWidth, viewport, onLayout, } = (0, use_roster_1.useRoster)({ ...props, selectable: Boolean(props.intervalDetailComponent) });
|
|
25
|
+
const { intervalDetailComponent: IntervalDetailComponent, selectionLayout: SelectionLayout = selection_layout_1.RosterSelectionPopover, emptyZone = defaultEmptyZone, cornerZone = defaultCornerZone, headerComponent: HeaderComponent = header_1.RosterHeader, laneLabelColumnComponent: LaneLabelColumnComponent = lane_label_column_1.RosterLaneLabelColumn, bodyComponent: BodyComponent = body_1.RosterBody, headerCellComponent = header_cell_1.RosterHeaderCell, laneLabelComponent = lane_label_1.RosterLaneLabel, intervalComponent = interval_1.RosterInterval, gapComponent = gap_1.RosterGap, gridComponent = grid_1.RosterGrid, nowLineComponent = now_line_1.RosterNowLine, incompleteLabel = 'Availability may be incomplete', neverSetLabel = 'No availability set', } = props;
|
|
25
26
|
const hostId = (0, react_1.useId)();
|
|
26
27
|
if (status === 'empty')
|
|
27
28
|
return emptyZone;
|
|
@@ -58,6 +59,6 @@ function Roster(props) {
|
|
|
58
59
|
y: scroll.y,
|
|
59
60
|
headerStyle: scroll.headerStyle,
|
|
60
61
|
labelStyle: scroll.labelStyle,
|
|
61
|
-
}, targetBounds: targetBounds, contentZone: contentZone, anchorZone: (0, jsx_runtime_1.jsx)(BodyComponent, { lanes: orderedLanes, window: window, geometryFor: geometryFor, projection: projection, scroll: scroll, press: press, ticks: ticks, contentWidth: contentWidth, viewport: viewport, intervalComponent: intervalComponent, gapComponent: gapComponent, gridComponent: gridComponent, highlightSource: props.highlightSource, onIntervalHover: props.onIntervalHover, incompleteLabel: incompleteLabel }) }) }));
|
|
62
|
+
}, targetBounds: targetBounds, contentZone: contentZone, anchorZone: (0, jsx_runtime_1.jsx)(BodyComponent, { nowLine: nowLine, nowLineComponent: nowLineComponent, lanes: orderedLanes, window: window, geometryFor: geometryFor, projection: projection, scroll: scroll, press: press, ticks: ticks, contentWidth: contentWidth, viewport: viewport, intervalComponent: intervalComponent, gapComponent: gapComponent, gridComponent: gridComponent, highlightSource: props.highlightSource, onIntervalHover: props.onIntervalHover, incompleteLabel: incompleteLabel }) }) }));
|
|
62
63
|
}
|
|
63
64
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/roster/index.tsx"],"names":[],"mappings":";;;;AAAA,iCAA8C;AAC9C,qCAAuC;AACvC,6CAAgD;AAChD,uDAA0D;AAC1D,yDAA2D;AAC3D,qCAAwC;AACxC,uCAA0C;AAC1C,2CAA8C;AAC9C,yCAA4C;AAC5C,uCAA0C;AAC1C,2CAA8C;AAC9C,qDAAuD;AACvD,iEAAkE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/roster/index.tsx"],"names":[],"mappings":";;;;AAAA,iCAA8C;AAC9C,qCAAuC;AACvC,6CAAgD;AAChD,uDAA0D;AAC1D,yDAA2D;AAC3D,qCAAwC;AACxC,uCAA0C;AAC1C,2CAA8C;AAC9C,yCAA4C;AAC5C,uCAA0C;AAC1C,2CAA8C;AAC9C,qDAAuD;AACvD,iEAAkE;AAClE,+CAAiD;AAEjD,mEAAsE;AAEtE,6CAAyC;AAEzC,MAAM,gBAAgB,GAAG,uBAAC,mBAAW,KAAG,CAAC;AACzC,MAAM,iBAAiB,GAAG,uBAAC,qBAAY,KAAG,CAAC;AAE3C,gBAAuB,KAAkB;IACvC,MAAM,EACJ,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,MAAM,EACN,YAAY,EACZ,SAAS,EACT,MAAM,EACN,WAAW,EACX,UAAU,EACV,MAAM,EACN,KAAK,EACL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;CACxC,
|
|
1
|
+
{"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../../../../src/components/roster/parts/body.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGjD,wBAAgB,UAAU,CACxB,KAAK,EAAE,SAAS,GAAG;IACjB,+FAA+F;IAC/F,WAAW,CAAC,EAAE,wBAAwB,CAAC;CACxC,kDAmDF"}
|
|
@@ -5,10 +5,10 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const body_layout_1 = require("../body-layout");
|
|
6
6
|
const lane_list_1 = require("./lane-list");
|
|
7
7
|
function RosterBody(props) {
|
|
8
|
-
const {
|
|
8
|
+
const { nowLine, nowLineComponent: NowLineComponent, ticks, gridComponent: GridComponent, lanes, geometryFor, projection, scroll, press, contentWidth, viewport, window, intervalComponent, gapComponent, highlightSource, onIntervalHover, incompleteLabel, onRowRender, } = props;
|
|
9
9
|
// LegendList requires a measured viewport and does not support static rendering.
|
|
10
10
|
if (viewport.width <= 0 || viewport.height <= 0)
|
|
11
11
|
return null;
|
|
12
|
-
return ((0, jsx_runtime_1.jsx)(body_layout_1.RosterBodyLayout, { scroll: scroll, contentWidth: contentWidth, viewport: viewport, gridZone: (0, jsx_runtime_1.jsx)(GridComponent, { ticks: ticks, contentWidth: contentWidth }), listZone: (0, jsx_runtime_1.jsx)(lane_list_1.RosterLaneList, { ...
|
|
12
|
+
return ((0, jsx_runtime_1.jsx)(body_layout_1.RosterBodyLayout, { scroll: scroll, contentWidth: contentWidth, viewport: viewport, gridZone: (0, jsx_runtime_1.jsx)(GridComponent, { ticks: ticks, contentWidth: contentWidth }), listZone: (0, jsx_runtime_1.jsx)(lane_list_1.RosterLaneList, { lanes: lanes, geometryFor: geometryFor, projection: projection, scroll: scroll, press: press, contentWidth: contentWidth, viewport: viewport, window: window, intervalComponent: intervalComponent, gapComponent: gapComponent, highlightSource: highlightSource, onIntervalHover: onIntervalHover, incompleteLabel: incompleteLabel, onRowRender: onRowRender }), overlayZone: nowLine ? (0, jsx_runtime_1.jsx)(NowLineComponent, { ...nowLine }) : null }));
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=body.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body.js","sourceRoot":"","sources":["../../../../../src/components/roster/parts/body.tsx"],"names":[],"mappings":";;;;AACA,gDAAkD;AAElD,2CAA6C;AAE7C,oBACE,KAGC;IAED,MAAM,
|
|
1
|
+
{"version":3,"file":"body.js","sourceRoot":"","sources":["../../../../../src/components/roster/parts/body.tsx"],"names":[],"mappings":";;;;AACA,gDAAkD;AAElD,2CAA6C;AAE7C,oBACE,KAGC;IAED,MAAM,EACJ,OAAO,EACP,gBAAgB,EAAE,gBAAgB,EAClC,KAAK,EACL,aAAa,EAAE,aAAa,EAC5B,KAAK,EACL,WAAW,EACX,UAAU,EACV,MAAM,EACN,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,eAAe,EACf,eAAe,EACf,WAAW,GACZ,GAAG,KAAK,CAAC;IACV,iFAAiF;IACjF,IAAI,QAAQ,CAAC,KAAK,IAAI,CAAC,IAAI,QAAQ,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7D,OAAO,CACL,uBAAC,8BAAgB,IACf,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,uBAAC,aAAa,IAAC,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,YAAY,GAAI,EACrE,QAAQ,EACN,uBAAC,0BAAc,IACb,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,iBAAiB,EAAE,iBAAiB,EACpC,YAAY,EAAE,YAAY,EAC1B,eAAe,EAAE,eAAe,EAChC,eAAe,EAAE,eAAe,EAChC,eAAe,EAAE,eAAe,EAChC,WAAW,EAAE,WAAW,GACxB,EAEJ,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,uBAAC,gBAAgB,OAAK,OAAO,GAAI,CAAC,CAAC,CAAC,IAAI,GAC/D,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ProfilerOnRenderCallback } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
export declare function RosterLaneList({ lanes, geometryFor, projection, scroll, press, contentWidth, viewport, window, intervalComponent, gapComponent, highlightSource, onIntervalHover, incompleteLabel, onRowRender, }:
|
|
2
|
+
import type { LaneListInput } from '../roster.types';
|
|
3
|
+
export declare function RosterLaneList({ lanes, geometryFor, projection, scroll, press, contentWidth, viewport, window, intervalComponent, gapComponent, highlightSource, onIntervalHover, incompleteLabel, onRowRender, }: LaneListInput & {
|
|
4
4
|
/** Development-only Profiler hook used by the gallery; not a supported customization point. */
|
|
5
5
|
onRowRender?: ProfilerOnRenderCallback;
|
|
6
6
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lane-list.d.ts","sourceRoot":"","sources":["../../../../../src/components/roster/parts/lane-list.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,KAAK,wBAAwB,EAAY,MAAM,OAAO,CAAC;AAE1E,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"lane-list.d.ts","sourceRoot":"","sources":["../../../../../src/components/roster/parts/lane-list.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,KAAK,wBAAwB,EAAY,MAAM,OAAO,CAAC;AAE1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGrD,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,WAAW,EACX,UAAU,EACV,MAAM,EACN,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,eAAe,EACf,eAAe,EACf,WAAW,GACZ,EAAE,aAAa,GAAG;IACjB,+FAA+F;IAC/F,WAAW,CAAC,EAAE,wBAAwB,CAAC;CACxC,2CAmDA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"now-line.d.ts","sourceRoot":"","sources":["../../../../../src/components/roster/parts/now-line.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,wBAAgB,aAAa,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,2CAetD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RosterNowLine = RosterNowLine;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_native_1 = require("react-native");
|
|
6
|
+
function RosterNowLine({ x }) {
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { testID: "roster-now-line", pointerEvents: "none", style: {
|
|
8
|
+
position: 'absolute',
|
|
9
|
+
left: x,
|
|
10
|
+
top: 0,
|
|
11
|
+
bottom: 0,
|
|
12
|
+
width: 2,
|
|
13
|
+
backgroundColor: '#dc2626',
|
|
14
|
+
} }));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=now-line.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"now-line.js","sourceRoot":"","sources":["../../../../../src/components/roster/parts/now-line.tsx"],"names":[],"mappings":";;;;AAAA,+CAAoC;AAGpC,uBAA8B,EAAE,CAAC,EAAsB;IACrD,OAAO,CACL,uBAAC,mBAAI,IACH,MAAM,EAAC,iBAAiB,EACxB,aAAa,EAAC,MAAM,EACpB,KAAK,EAAE;YACL,QAAQ,EAAE,UAAU;YACpB,IAAI,EAAE,CAAC;YACP,GAAG,EAAE,CAAC;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,CAAC;YACR,eAAe,EAAE,SAAS;SAC3B,GACD,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -35,6 +35,8 @@ export type RosterInput = {
|
|
|
35
35
|
lanes: Lane[];
|
|
36
36
|
windowSpec: WindowSpec;
|
|
37
37
|
minuteStep?: number;
|
|
38
|
+
/** Current instant in epoch milliseconds; default null draws no now line. */
|
|
39
|
+
now?: number | null;
|
|
38
40
|
sortLanes?: LaneComparator;
|
|
39
41
|
highlightSource?: Source;
|
|
40
42
|
onNavigate?: (next: WindowSpec) => void;
|
|
@@ -66,6 +68,8 @@ export type RosterModel = {
|
|
|
66
68
|
press: (lane: Lane, x: number, y: number) => void;
|
|
67
69
|
status: 'empty' | 'ready';
|
|
68
70
|
ticks: RosterTick[];
|
|
71
|
+
now: number | null;
|
|
72
|
+
nowLine: RosterNowLineInput | null;
|
|
69
73
|
contentWidth: number;
|
|
70
74
|
viewport: {
|
|
71
75
|
width: number;
|
|
@@ -82,6 +86,10 @@ export type LaneLabelInput = {
|
|
|
82
86
|
incompleteLabel: string;
|
|
83
87
|
neverSetLabel: string;
|
|
84
88
|
};
|
|
89
|
+
export type RosterNowLineInput = {
|
|
90
|
+
x: number;
|
|
91
|
+
now: number;
|
|
92
|
+
};
|
|
85
93
|
export type HeaderCellInput = {
|
|
86
94
|
tick: RosterTick;
|
|
87
95
|
};
|
|
@@ -98,7 +106,7 @@ export type LabelColumnInput = Pick<RosterModel, 'projection' | 'scroll'> & {
|
|
|
98
106
|
/** Lane label filler, positioned at the fixed row height. */
|
|
99
107
|
laneLabelComponent: ComponentType<LaneLabelInput>;
|
|
100
108
|
};
|
|
101
|
-
export type
|
|
109
|
+
export type LaneListInput = Pick<RosterModel, 'geometryFor' | 'projection' | 'scroll' | 'press' | 'contentWidth' | 'viewport' | 'window'> & {
|
|
102
110
|
lanes: Lane[];
|
|
103
111
|
highlightSource?: Source;
|
|
104
112
|
onIntervalHover?: (rect: Rect, lane: Lane) => void;
|
|
@@ -107,6 +115,12 @@ export type BodyInput = Pick<RosterModel, 'geometryFor' | 'projection' | 'scroll
|
|
|
107
115
|
intervalComponent: ComponentType<IntervalInput>;
|
|
108
116
|
/** Removed rect filler, placed inside a pressable by LaneRow. */
|
|
109
117
|
gapComponent: ComponentType<GapInput>;
|
|
118
|
+
};
|
|
119
|
+
export type BodyInput = LaneListInput & {
|
|
120
|
+
ticks: RosterTick[];
|
|
121
|
+
nowLine: RosterNowLineInput | null;
|
|
122
|
+
/** Noninteractive current-time line positioned in body content pixels. */
|
|
123
|
+
nowLineComponent: ComponentType<RosterNowLineInput>;
|
|
110
124
|
/** Noninteractive tick lines behind every lane, sized to the content width. */
|
|
111
125
|
gridComponent: ComponentType<GridInput>;
|
|
112
126
|
};
|
|
@@ -132,6 +146,8 @@ export type RosterStyleProps = {
|
|
|
132
146
|
laneLabelWidth?: number;
|
|
133
147
|
};
|
|
134
148
|
export type RosterProps = Omit<RosterInput, 'selectable'> & RosterStyleProps & {
|
|
149
|
+
/** Noninteractive current-time line; RosterNowLine spans the body height at x. */
|
|
150
|
+
nowLineComponent?: ComponentType<RosterNowLineInput>;
|
|
135
151
|
/**
|
|
136
152
|
* Selected interval content; absent means interval presses retain no selection.
|
|
137
153
|
* Lives on RosterProps because the chassis mounts content and enables useRoster selection.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roster.types.d.ts","sourceRoot":"","sources":["../../../../src/components/roster/roster.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACj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AG,QAAQ,GAAG,cAAc,CAAC,GAAG;IAChG,mDAAmD;IACnD,mBAAmB,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;CACrD,CAAC;AACF,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,WAAW,EAAE,YAAY,GAAG,QAAQ,CAAC,GAAG;IAC1E,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,6DAA6D;IAC7D,kBAAkB,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;CACnD,CAAC;AACF,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"roster.types.d.ts","sourceRoot":"","sources":["../../../../src/components/roster/roster.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,UAAU,EACV,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EACV,QAAQ,EACR,IAAI,EACJ,cAAc,EACd,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,IAAI,EACJ,MAAM,EACN,MAAM,EACN,UAAU,EACX,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE/E,qGAAqG;AACrG,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,UAAU,EAAE;IAAE,WAAW,EAAE,YAAY,CAAA;CAAE,CAAC,CAAC;AAClF,MA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;AAIjF,wBAAgB,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,
|
|
1
|
+
{"version":3,"file":"use-roster.d.ts","sourceRoot":"","sources":["../../../../src/components/roster/use-roster.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAoB,MAAM,gBAAgB,CAAC;AAIjF,wBAAgB,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,CAyGzD"}
|
|
@@ -7,7 +7,7 @@ const core_1 = require("../../core");
|
|
|
7
7
|
const use_roster_press_1 = require("./use-roster-press");
|
|
8
8
|
const ticks_1 = require("./utils/ticks");
|
|
9
9
|
function useRoster(input) {
|
|
10
|
-
const { lanes, windowSpec, minuteStep = 60, sortLanes = core_1.byLabel, rowHeight = 48, pxPerMinute = 0.5, onNavigate, } = input;
|
|
10
|
+
const { lanes, windowSpec, now = null, minuteStep = 60, sortLanes = core_1.byLabel, rowHeight = 48, pxPerMinute = 0.5, onNavigate, } = input;
|
|
11
11
|
const [selected, setSelected] = (0, react_1.useState)(null);
|
|
12
12
|
function dismissSelection() {
|
|
13
13
|
setSelected(null);
|
|
@@ -33,6 +33,9 @@ function useRoster(input) {
|
|
|
33
33
|
rowHeight,
|
|
34
34
|
pxPerMinute: Math.max(pxPerMinute, duration === 0 ? 0 : viewport.width / duration),
|
|
35
35
|
};
|
|
36
|
+
const nowLine = now !== null && now >= window.start && now < window.end
|
|
37
|
+
? { x: (0, core_1.xAtTime)(projection, window, now), now }
|
|
38
|
+
: null;
|
|
36
39
|
const contentWidth = duration * projection.pxPerMinute;
|
|
37
40
|
const coverage = new Map(lanes.map((lane) => [lane.id, (0, core_1.coverageFor)(lane, window)]));
|
|
38
41
|
const orderedLanes = [...lanes].sort((a, b) => sortLanes(a, b, coverage));
|
|
@@ -60,6 +63,8 @@ function useRoster(input) {
|
|
|
60
63
|
press,
|
|
61
64
|
status: lanes.length === 0 ? 'empty' : 'ready',
|
|
62
65
|
ticks: (0, ticks_1.ticksFor)(window, windowSpec, projection, minuteStep),
|
|
66
|
+
now,
|
|
67
|
+
nowLine,
|
|
63
68
|
contentWidth,
|
|
64
69
|
viewport,
|
|
65
70
|
navigate: (next) => onNavigate?.(next),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-roster.js","sourceRoot":"","sources":["../../../../src/components/roster/use-roster.ts"],"names":[],"mappings":";;;AAAA,iCAAyC;AAEzC,qEAAwE;AAExE,
|
|
1
|
+
{"version":3,"file":"use-roster.js","sourceRoot":"","sources":["../../../../src/components/roster/use-roster.ts"],"names":[],"mappings":";;;AAAA,iCAAyC;AAEzC,qEAAwE;AAExE,qCAAoG;AAEpG,yDAA2E;AAC3E,yCAAyC;AAEzC,mBAA0B,KAAkB;IAC1C,MAAM,EACJ,KAAK,EACL,UAAU,EACV,GAAG,GAAG,IAAI,EACV,UAAU,GAAG,EAAE,EACf,SAAS,GAAG,cAAO,EACnB,SAAS,GAAG,EAAE,EACd,WAAW,GAAG,GAAG,EACjB,UAAU,GACX,GAAG,KAAK,CAAC;IACV,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAA0B,IAAI,CAAC,CAAC;IACxE,SAAS,gBAAgB;QACvB,WAAW,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IACD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;IAClE,0EAA0E;IAC1E,8EAA8E;IAC9E,MAAM,CAAC,CAAC,CAAC,GAAG,IAAA,gBAAQ,EAAC,GAAG,EAAE,CAAC,IAAA,qCAAW,EAAC,CAAC,CAAC,CAAC,CAAC;IAC3C,MAAM,CAAC,CAAC,CAAC,GAAG,IAAA,gBAAQ,EAAC,GAAG,EAAE,CAAC,IAAA,qCAAW,EAAC,CAAC,CAAC,CAAC,CAAC;IAC3C,M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AM,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAC5E,CAAC;gBACF,IAAI,UAAU,CAAC,IAAI,KAAK,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;oBACrF,SAAS;gBACX,MAAM,UAAU,GACd,IAAI,CAAC,GAAG,CAAC,IAAA,cAAO,EAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;oBACnE,IAAI,CAAC,GAAG,CAAC,IAAA,cAAO,EAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;gBACtF,IAAI,UAAU,IAAI,OAAO,IAAI,CAAC,CAAC,IAAI,IAAI,UAAU,GAAG,OAAO,CAAC,EAAE,CAAC;oBAC7D,OAAO,GAAG,UAAU,CAAC;oBACrB,IAAI,GAAG,SAAS,CAAC;gBACnB,CAAC;YACH,CAAC;YACD,IAAI,IAAI;gBAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,GAAG,EAAE,CAAC;QACnF,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/src/core/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export { flagFor } from './flag';
|
|
|
7
7
|
export { layoutLane } from './layout';
|
|
8
8
|
export type { LaneComparator } from './order';
|
|
9
9
|
export { byCoverage, byLabel } from './order';
|
|
10
|
-
export { snapToStep, timeAtX, timeAtY } from './snap';
|
|
10
|
+
export { snapToStep, timeAtX, timeAtY, xAtTime } from './snap';
|
|
11
11
|
export { hasSource } from './source';
|
|
12
12
|
export { extentOf, intersectionOf, unionOf } from './spans';
|
|
13
13
|
export type { Coverage, DayColumn, Gap, Interval, Lane, LaneFlag, LaneGeometry, Layer, LayerRole, LayerStyle, Projection, Rect, Source, Transition, Weekday, Window, } from './types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,UAAU,GACX,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,UAAU,GACX,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC5D,YAAY,EACV,QAAQ,EACR,SAAS,EACT,GAAG,EACH,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,YAAY,EACZ,KAAK,EACL,SAAS,EACT,UAAU,EACV,UAAU,EACV,IAAI,EACJ,MAAM,EACN,UAAU,EACV,OAAO,EACP,MAAM,GACP,MAAM,SAAS,CAAC"}
|
package/dist/src/core/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.unionOf = exports.intersectionOf = exports.extentOf = exports.hasSource = exports.timeAtY = exports.timeAtX = exports.snapToStep = exports.byLabel = exports.byCoverage = exports.layoutLane = exports.flagFor = exports.coverageFor = exports.dayColumnsFor = exports.resetStats = exports.layoutStats = exports.coverageStats = exports.clearLayoutCache = exports.clearCoverageCache = exports.windowFor = exports.today = exports.prev = exports.next = void 0;
|
|
3
|
+
exports.unionOf = exports.intersectionOf = exports.extentOf = exports.hasSource = exports.xAtTime = exports.timeAtY = exports.timeAtX = exports.snapToStep = exports.byLabel = exports.byCoverage = exports.layoutLane = exports.flagFor = exports.coverageFor = exports.dayColumnsFor = exports.resetStats = exports.layoutStats = exports.coverageStats = exports.clearLayoutCache = exports.clearCoverageCache = exports.windowFor = exports.today = exports.prev = exports.next = void 0;
|
|
4
4
|
var axis_1 = require("./axis");
|
|
5
5
|
Object.defineProperty(exports, "next", { enumerable: true, get: function () { return axis_1.next; } });
|
|
6
6
|
Object.defineProperty(exports, "prev", { enumerable: true, get: function () { return axis_1.prev; } });
|
|
@@ -27,6 +27,7 @@ var snap_1 = require("./snap");
|
|
|
27
27
|
Object.defineProperty(exports, "snapToStep", { enumerable: true, get: function () { return snap_1.snapToStep; } });
|
|
28
28
|
Object.defineProperty(exports, "timeAtX", { enumerable: true, get: function () { return snap_1.timeAtX; } });
|
|
29
29
|
Object.defineProperty(exports, "timeAtY", { enumerable: true, get: function () { return snap_1.timeAtY; } });
|
|
30
|
+
Object.defineProperty(exports, "xAtTime", { enumerable: true, get: function () { return snap_1.xAtTime; } });
|
|
30
31
|
var source_1 = require("./source");
|
|
31
32
|
Object.defineProperty(exports, "hasSource", { enumerable: true, get: function () { return source_1.hasSource; } });
|
|
32
33
|
var spans_1 = require("./spans");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":";;;AACA,+BAAsD;AAA7C,4FAAA,IAAI,OAAA;AAAE,4FAAA,IAAI,OAAA;AAAE,6FAAA,KAAK,OAAA;AAAE,iGAAA,SAAS,OAAA;AACrC,iCAMiB;AALf,2GAAA,kBAAkB,OAAA;AAClB,yGAAA,gBAAgB,OAAA;AAChB,sGAAA,aAAa,OAAA;AACb,oGAAA,WAAW,OAAA;AACX,mGAAA,UAAU,OAAA;AAEZ,qCAA0C;AAAjC,wGAAA,aAAa,OAAA;AACtB,uCAAyC;AAAhC,uGAAA,WAAW,OAAA;AACpB,+BAAiC;AAAxB,+FAAA,OAAO,OAAA;AAChB,mCAAsC;AAA7B,oGAAA,UAAU,OAAA;AAEnB,iCAA8C;AAArC,mGAAA,UAAU,OAAA;AAAE,gGAAA,OAAO,OAAA;AAC5B,+
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":";;;AACA,+BAAsD;AAA7C,4FAAA,IAAI,OAAA;AAAE,4FAAA,IAAI,OAAA;AAAE,6FAAA,KAAK,OAAA;AAAE,iGAAA,SAAS,OAAA;AACrC,iCAMiB;AALf,2GAAA,kBAAkB,OAAA;AAClB,yGAAA,gBAAgB,OAAA;AAChB,sGAAA,aAAa,OAAA;AACb,oGAAA,WAAW,OAAA;AACX,mGAAA,UAAU,OAAA;AAEZ,qCAA0C;AAAjC,wGAAA,aAAa,OAAA;AACtB,uCAAyC;AAAhC,uGAAA,WAAW,OAAA;AACpB,+BAAiC;AAAxB,+FAAA,OAAO,OAAA;AAChB,mCAAsC;AAA7B,oGAAA,UAAU,OAAA;AAEnB,iCAA8C;AAArC,mGAAA,UAAU,OAAA;AAAE,gGAAA,OAAO,OAAA;AAC5B,+BAA+D;AAAtD,kGAAA,UAAU,OAAA;AAAE,+FAAA,OAAO,OAAA;AAAE,+FAAA,OAAO,OAAA;AAAE,+FAAA,OAAO,OAAA;AAC9C,mCAAqC;AAA5B,mGAAA,SAAS,OAAA;AAClB,iCAA4D;AAAnD,iGAAA,QAAQ,OAAA;AAAE,uGAAA,cAAc,OAAA;AAAE,gGAAA,OAAO,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../src/core/layout.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../src/core/layout.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAY,IAAI,EAAE,YAAY,EAAS,UAAU,EAAQ,MAAM,EAAE,MAAM,SAAS,CAAC;AAE7F,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,YAAY,CAwC3F"}
|
package/dist/src/core/layout.js
CHANGED
|
@@ -6,6 +6,7 @@ const coverage_1 = require("./coverage");
|
|
|
6
6
|
const flag_1 = require("./flag");
|
|
7
7
|
const hash_1 = require("./hash");
|
|
8
8
|
const scale_1 = require("./scale");
|
|
9
|
+
const snap_1 = require("./snap");
|
|
9
10
|
const spans_1 = require("./spans");
|
|
10
11
|
function layoutLane(lane, window, projection) {
|
|
11
12
|
const key = `${(0, hash_1.laneKey)(lane, window)}|${(0, hash_1.projectionKey)(projection)}`;
|
|
@@ -54,7 +55,7 @@ function project(spans, layer, window, projection, columns, rects) {
|
|
|
54
55
|
if (projection.orientation === 'horizontal') {
|
|
55
56
|
for (const span of spans) {
|
|
56
57
|
rects.push({
|
|
57
|
-
x: ((
|
|
58
|
+
x: (0, snap_1.xAtTime)(projection, window, span.start),
|
|
58
59
|
y: inset,
|
|
59
60
|
width: ((span.end - span.start) / 60_000) * projection.pxPerMinute,
|
|
60
61
|
height: Math.max(0, projection.rowHeight - 2 * inset),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../src/core/layout.ts"],"names":[],"mappings":";;;AAAA,mCAA8C;AAC9C,yCAAyC;AACzC,iCAAiC;AACjC,iCAAgD;AAChD,mCAAuD;AACvD,mCAAsC;AAGtC,oBAA2B,IAAU,EAAE,MAAc,EAAE,UAAsB;IAC3E,MAAM,GAAG,GAAG,GAAG,IAAA,cAAO,EAAC,IAAI,EAAE,MAAM,CAAC,IAAI,IAAA,oBAAa,EAAC,UAAU,CAAC,EAAE,CAAC;IACpE,IAAI,MAAM,GAAG,mBAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAClC,MAAM,QAAQ,GAAG,IAAA,sBAAW,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC3C,MAAM,IAAI,GAAG,IAA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AAG,KAAK,CAAC,GAAG,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC,SAAS,CAAC,GAAG,EAAE;oBAC5E,OAAO,EAAE,KAAK,CAAC,EAAE;oBACjB,CAAC,EAAE,KAAK,CAAC,CAAC;oBACV,OAAO,EAAE,IAAI,CAAC,OAAO;oBACrB,MAAM;iBACP,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/src/core/snap.d.ts
CHANGED
|
@@ -7,4 +7,8 @@ export declare function timeAtY(projection: Extract<Projection, {
|
|
|
7
7
|
export declare function timeAtX(projection: Extract<Projection, {
|
|
8
8
|
orientation: 'horizontal';
|
|
9
9
|
}>, window: Window, x: number): number;
|
|
10
|
+
/** Horizontal position at true elapsed length; the window supplies the projection's origin. */
|
|
11
|
+
export declare function xAtTime(projection: Extract<Projection, {
|
|
12
|
+
orientation: 'horizontal';
|
|
13
|
+
}>, window: Window, time: number): number;
|
|
10
14
|
//# sourceMappingURL=snap.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snap.d.ts","sourceRoot":"","sources":["../../../src/core/snap.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAGlD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAcrF;AAED,wBAAgB,OAAO,CACrB,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE;IAAE,WAAW,EAAE,SAAS,CAAA;CAAE,CAAC,EAC3D,WAAW,EAAE,MAAM,EACnB,CAAC,EAAE,MAAM,GACR,MAAM,GAAG,IAAI,CAiBf;AAED,yFAAyF;AACzF,wBAAgB,OAAO,CACrB,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE;IAAE,WAAW,EAAE,YAAY,CAAA;CAAE,CAAC,EAC9D,MAAM,EAAE,MAAM,EACd,CAAC,EAAE,MAAM,GACR,MAAM,CAER"}
|
|
1
|
+
{"version":3,"file":"snap.d.ts","sourceRoot":"","sources":["../../../src/core/snap.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAGlD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAcrF;AAED,wBAAgB,OAAO,CACrB,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE;IAAE,WAAW,EAAE,SAAS,CAAA;CAAE,CAAC,EAC3D,WAAW,EAAE,MAAM,EACnB,CAAC,EAAE,MAAM,GACR,MAAM,GAAG,IAAI,CAiBf;AAED,yFAAyF;AACzF,wBAAgB,OAAO,CACrB,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE;IAAE,WAAW,EAAE,YAAY,CAAA;CAAE,CAAC,EAC9D,MAAM,EAAE,MAAM,EACd,CAAC,EAAE,MAAM,GACR,MAAM,CAER;AAED,+FAA+F;AAC/F,wBAAgB,OAAO,CACrB,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE;IAAE,WAAW,EAAE,YAAY,CAAA;CAAE,CAAC,EAC9D,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GACX,MAAM,CAER"}
|
package/dist/src/core/snap.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.snapToStep = snapToStep;
|
|
4
4
|
exports.timeAtY = timeAtY;
|
|
5
5
|
exports.timeAtX = timeAtX;
|
|
6
|
+
exports.xAtTime = xAtTime;
|
|
6
7
|
const columns_1 = require("./columns");
|
|
7
8
|
const scale_1 = require("./scale");
|
|
8
9
|
const zone_1 = require("./zone");
|
|
@@ -40,4 +41,8 @@ function timeAtY(projection, columnIndex, y) {
|
|
|
40
41
|
function timeAtX(projection, window, x) {
|
|
41
42
|
return window.start + (x * 60_000) / projection.pxPerMinute;
|
|
42
43
|
}
|
|
44
|
+
/** Horizontal position at true elapsed length; the window supplies the projection's origin. */
|
|
45
|
+
function xAtTime(projection, window, time) {
|
|
46
|
+
return ((time - window.start) / 60_000) * projection.pxPerMinute;
|
|
47
|
+
}
|
|
43
48
|
//# sourceMappingURL=snap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snap.js","sourceRoot":"","sources":["../../../src/core/snap.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"snap.js","sourceRoot":"","sources":["../../../src/core/snap.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA0C;AAC1C,mCAAsC;AAEtC,iCAAkC;AAElC,oBAA2B,IAAY,EAAE,UAAkB,EAAE,QAAgB;IAC3E,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,CAAC,IAAI,EAAE,GAAG,UAAU,KAAK,CAAC,EAAE,CAAC;QAC9E,MAAM,IAAI,UAAU,CAAC,6CAA6C,CAAC,CAAC;IACtE,CAAC;IACD,MAAM,IAAI,GAAG,UAAU,GAAG,MAAM,CAAC;IACjC,MAAM,IAAI,GAAG,IAAA,eAAQ,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACtC,IAAI,MAAM,GAAG,IAAI,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IAC5D,MAAM,IAAI,GAAG,IAAA,uBAAa,EAAC,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,GAAG,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;IACrE,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,KAAK,MAAM,EAAE,EAAE,EAAE,IAAI,GAAG,CAAC,WAAW,EAAE,CAAC;YACrC,IAAI,EAA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MAAc,EACd,IAAY;IAEZ,OAAO,CAAC,CAAC,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,GAAG,UAAU,CAAC,WAAW,CAAC;AACnE,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -13,7 +13,8 @@ export { RosterHeader } from './components/roster/parts/header';
|
|
|
13
13
|
export { RosterHeaderCell } from './components/roster/parts/header-cell';
|
|
14
14
|
export { RosterLaneLabelColumn } from './components/roster/parts/lane-label-column';
|
|
15
15
|
export { RosterLaneList } from './components/roster/parts/lane-list';
|
|
16
|
-
export
|
|
16
|
+
export { RosterNowLine } from './components/roster/parts/now-line';
|
|
17
|
+
export type { BodyInput, GridInput, HeaderCellInput, HeaderInput, IntervalDetailInput, LabelColumnInput, LaneLabelInput, LaneListInput, RosterInput, RosterModel, RosterNowLineInput, RosterProjection, RosterProps, RosterScroll, RosterStyleProps, RosterTick, } from './components/roster/roster.types';
|
|
17
18
|
export { RosterSelectionPopover } from './components/roster/selection/selection-layout';
|
|
18
19
|
export type { SelectionLayoutProps } from './components/roster/selection/selection-layout.types';
|
|
19
20
|
export { useRoster } from './components/roster/use-roster';
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;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BAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,UAAU,GACX,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AACxF,YAAY,EAAE,oBAAoB,EAAE,MAAM,sDAAsD,CAAC;AACjG,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,cAAc,QAAQ,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.useSchedule = exports.ScheduleIncomplete = exports.ScheduleGutter = exports.ScheduleTransition = exports.ScheduleSkippedDate = exports.ScheduleNowLine = exports.ScheduleGrid = exports.ScheduleDayHeader = exports.ScheduleColumn = exports.Schedule = exports.useRoster = exports.RosterSelectionPopover = exports.RosterLaneList = exports.RosterLaneLabelColumn = exports.RosterHeaderCell = exports.RosterHeader = exports.RosterGrid = exports.RosterEmpty = exports.RosterCorner = exports.RosterBody = exports.RosterLaneLabel = exports.RosterBodyLayout = exports.Roster = exports.PortalHost = exports.Portal = exports.RosterInterval = exports.RosterGap = void 0;
|
|
17
|
+
exports.useSchedule = exports.ScheduleIncomplete = exports.ScheduleGutter = exports.ScheduleTransition = exports.ScheduleSkippedDate = exports.ScheduleNowLine = exports.ScheduleGrid = exports.ScheduleDayHeader = exports.ScheduleColumn = exports.Schedule = exports.useRoster = exports.RosterSelectionPopover = exports.RosterNowLine = exports.RosterLaneList = exports.RosterLaneLabelColumn = exports.RosterHeaderCell = exports.RosterHeader = exports.RosterGrid = exports.RosterEmpty = exports.RosterCorner = exports.RosterBody = exports.RosterLaneLabel = exports.RosterBodyLayout = exports.Roster = exports.PortalHost = exports.Portal = exports.RosterInterval = exports.RosterGap = void 0;
|
|
18
18
|
var gap_1 = require("./components/layers/parts/gap");
|
|
19
19
|
Object.defineProperty(exports, "RosterGap", { enumerable: true, get: function () { return gap_1.RosterGap; } });
|
|
20
20
|
var interval_1 = require("./components/layers/parts/interval");
|
|
@@ -44,6 +44,8 @@ var lane_label_column_1 = require("./components/roster/parts/lane-label-column")
|
|
|
44
44
|
Object.defineProperty(exports, "RosterLaneLabelColumn", { enumerable: true, get: function () { return lane_label_column_1.RosterLaneLabelColumn; } });
|
|
45
45
|
var lane_list_1 = require("./components/roster/parts/lane-list");
|
|
46
46
|
Object.defineProperty(exports, "RosterLaneList", { enumerable: true, get: function () { return lane_list_1.RosterLaneList; } });
|
|
47
|
+
var now_line_1 = require("./components/roster/parts/now-line");
|
|
48
|
+
Object.defineProperty(exports, "RosterNowLine", { enumerable: true, get: function () { return now_line_1.RosterNowLine; } });
|
|
47
49
|
var selection_layout_1 = require("./components/roster/selection/selection-layout");
|
|
48
50
|
Object.defineProperty(exports, "RosterSelectionPopover", { enumerable: true, get: function () { return selection_layout_1.RosterSelectionPopover; } });
|
|
49
51
|
var use_roster_1 = require("./components/roster/use-roster");
|
|
@@ -56,8 +58,8 @@ var day_header_1 = require("./components/schedule/days/parts/day-header");
|
|
|
56
58
|
Object.defineProperty(exports, "ScheduleDayHeader", { enumerable: true, get: function () { return day_header_1.ScheduleDayHeader; } });
|
|
57
59
|
var grid_2 = require("./components/schedule/days/parts/grid");
|
|
58
60
|
Object.defineProperty(exports, "ScheduleGrid", { enumerable: true, get: function () { return grid_2.ScheduleGrid; } });
|
|
59
|
-
var
|
|
60
|
-
Object.defineProperty(exports, "ScheduleNowLine", { enumerable: true, get: function () { return
|
|
61
|
+
var now_line_2 = require("./components/schedule/days/parts/now-line");
|
|
62
|
+
Object.defineProperty(exports, "ScheduleNowLine", { enumerable: true, get: function () { return now_line_2.ScheduleNowLine; } });
|
|
61
63
|
var skipped_date_1 = require("./components/schedule/days/parts/skipped-date");
|
|
62
64
|
Object.defineProperty(exports, "ScheduleSkippedDate", { enumerable: true, get: function () { return skipped_date_1.ScheduleSkippedDate; } });
|
|
63
65
|
var transition_1 = require("./components/schedule/days/parts/transition");
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,qDAA0D;AAAjD,gGAAA,SAAS,OAAA;AAClB,+DAAoE;AAA3D,0GAAA,cAAc,OAAA;AACvB,yDAAoE;AAA3D,gGAAA,MAAM,OAAA;AAAE,oGAAA,UAAU,OAAA;AAC3B,8CAA6C;AAApC,gGAAA,MAAM,OAAA;AACf,+DAAmE;AAA1D,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xC,oGAAA,QAAQ,OAAA;AACjB,kEAAyE;AAAhE,wGAAA,cAAc,OAAA;AACvB,0EAAgF;AAAvE,+GAAA,iBAAiB,OAAA;AAC1B,8DAAqE;AAA5D,oGAAA,YAAY,OAAA;AACrB,sEAA4E;AAAnE,2GAAA,eAAe,OAAA;AACxB,8EAAoF;AAA3E,mHAAA,mBAAmB,OAAA;AAC5B,0EAAiF;AAAxE,gHAAA,kBAAkB,OAAA;AAC3B,6DAAoE;AAA3D,wGAAA,cAAc,OAAA;AACvB,qEAA4E;AAAnE,gHAAA,kBAAkB,OAAA;AAY3B,mEAAiE;AAAxD,2GAAA,WAAW,OAAA;AACpB,yCAAuB"}
|
|
@@ -9,6 +9,7 @@ type Mapping<T> = {
|
|
|
9
9
|
export declare const rosterClassNames: Mapping<RosterStyleProps>;
|
|
10
10
|
export declare const scheduleClassNames: Mapping<ScheduleStyleProps>;
|
|
11
11
|
export declare const Roster: import("react").ComponentType<Omit<import("../components/roster/roster.types").RosterInput, "selectable"> & RosterStyleProps & {
|
|
12
|
+
nowLineComponent?: import("react").ComponentType<import("../components/roster/roster.types").RosterNowLineInput>;
|
|
12
13
|
intervalDetailComponent?: import("react").ComponentType<import("../components/roster/roster.types").IntervalDetailInput>;
|
|
13
14
|
selectionLayout?: import("react").ComponentType<import("..").SelectionLayoutProps>;
|
|
14
15
|
portalHost?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/nativewind/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAE1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAEhF,KAAK,aAAa,CAAC,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,GAAG,MAAM,WAAW,GAAG,GAAG,MAAM,WAAW,CAAC,CAAC;AACtF,KAAK,WAAW,CAAC,CAAC,SAAS,MA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;;;;;;;EAA+C,CAAC"}
|
package/llms.txt
CHANGED
|
@@ -144,8 +144,8 @@ show the incompleteLabel; do not describe incomplete empty time as definitive.
|
|
|
144
144
|
|
|
145
145
|
| Import | Runtime exports and purpose |
|
|
146
146
|
| --- | --- |
|
|
147
|
-
| react-native-roster | Roster, Schedule,
|
|
148
|
-
| react-native-roster/core | layoutLane, coverageFor, flagFor, extentOf, intersectionOf, unionOf, windowFor, prev, next, today, dayColumnsFor, timeAtX, timeAtY, snapToStep, byLabel, byCoverage, and core counters/caches. |
|
|
147
|
+
| react-native-roster | Roster, Schedule, useRoster, useSchedule, default slot components, RosterSelectionPopover, PortalHost, Portal, and core re-exports. |
|
|
148
|
+
| react-native-roster/core | layoutLane, coverageFor, flagFor, hasSource, extentOf, intersectionOf, unionOf, windowFor, prev, next, today, dayColumnsFor, xAtTime, timeAtX, timeAtY, snapToStep, byLabel, byCoverage, and core counters/caches. |
|
|
149
149
|
| react-native-roster/rrule | expandRuleSet, envelopeFor, expandStats, resetExpandStats, clearExpandCache; RuleSet, RosterRule, RosterDate, ExpandOptions, ExpandResult, and ExpandStats types. |
|
|
150
150
|
| react-native-roster/nativewind | Side-effect registration of Roster and Schedule with NativeWind's cssInterop, plus the registered Roster and Schedule and the rosterClassNames/scheduleClassNames mappings. Imports the optional nativewind peer. |
|
|
151
151
|
|
|
@@ -188,7 +188,8 @@ Component props are ComponentType<Input>.
|
|
|
188
188
|
## Renderer contracts
|
|
189
189
|
|
|
190
190
|
Roster required props: lanes: Lane[], windowSpec: WindowSpec.
|
|
191
|
-
Optional:
|
|
191
|
+
Optional: now (epoch ms or null, default null), minuteStep (60), rowHeight (48),
|
|
192
|
+
pxPerMinute (minimum 0.5, fits viewport),
|
|
192
193
|
sortLanes (byLabel), highlightSource, onNavigate, onIntervalPress, onGapPress,
|
|
193
194
|
onCellPress, onIntervalHover (web only), style, headerStyle, laneLabelColumnStyle,
|
|
194
195
|
bodyStyle, laneLabelWidth (180), neverSetLabel, incompleteLabel, and zones below.
|
|
@@ -203,9 +204,14 @@ outside React state.
|
|
|
203
204
|
|
|
204
205
|
useRoster returns window, projection, orderedLanes, coverage, laneState,
|
|
205
206
|
geometryFor(lane), scroll, press(lane,x,y), ticks, contentWidth, viewport,
|
|
206
|
-
onLayout, navigate, selection, dismissSelection, and status ('empty' or 'ready'). There is no visibleRange
|
|
207
|
+
now, nowLine, onLayout, navigate, selection, dismissSelection, and status ('empty' or 'ready'). There is no visibleRange
|
|
207
208
|
field in the shipped public model. Custom layouts must wire onLayout. Custom
|
|
208
209
|
bodies compute geometry only for mounted lanes, preserving virtualization.
|
|
210
|
+
now retains the raw instant. nowLine is { x, now }, using xAtTime with the fitted
|
|
211
|
+
projection.pxPerMinute scale; it is null when now is null or outside the
|
|
212
|
+
end-exclusive window. The caller owns clock updates.
|
|
213
|
+
The vertical now line follows horizontal scroll without invalidating mounted lanes.
|
|
214
|
+
The every-zone gallery offers a fixed window-midpoint now toggle.
|
|
209
215
|
A zero-duration window has contentWidth=0 and renders no Roster body. Positive
|
|
210
216
|
windows use their exact elapsed duration, including sub-minute spans. Cell times
|
|
211
217
|
are clamped up to window.start and rejected at or beyond window.end.
|
|
@@ -231,8 +237,11 @@ interaction. Input types, including HeaderCellInput, are exported from root.
|
|
|
231
237
|
Mount a React context provider above Roster for extra consumer data, and read it with useContext in a module-scope slot component.
|
|
232
238
|
Avoid inline closures or memoized factories returning a new component per render; new interval types remount every interval and defeat the body's content key.
|
|
233
239
|
|
|
234
|
-
RosterBody composes the exported RosterBodyLayout (gridZone/listZone
|
|
235
|
-
scroll wiring) and RosterLaneList (LegendList,
|
|
240
|
+
RosterBody composes the exported RosterBodyLayout (gridZone/listZone and optional
|
|
241
|
+
absolute overlayZone nodes with scroll wiring) and RosterLaneList (LegendList,
|
|
242
|
+
geometryFor, and LaneRow mounting). BodyInput extends LaneListInput with ticks,
|
|
243
|
+
gridComponent, nowLine, and nowLineComponent. The body picks lane-list props
|
|
244
|
+
explicitly; the overlay wrapper mounts only when overlayZone is provided.
|
|
236
245
|
Keep its viewport gate and measured estimatedListSize in custom compositions.
|
|
237
246
|
|
|
238
247
|
## Roster zones
|
|
@@ -244,11 +253,12 @@ Keep its viewport gate and measured estimatedListSize in custom compositions.
|
|
|
244
253
|
| `headerCellComponent` | `HeaderCellInput` (`tick`) | `RosterHeaderCell`: tick label. |
|
|
245
254
|
| `intervalComponent` | `rect`, `layer`, `lane`, `highlighted` | `RosterInterval`: positioned colored rect, with final inset bounds. |
|
|
246
255
|
| `gapComponent` | `rect`, `layer`, `lane` | `RosterGap`: no visible content; the row supplies pressable bounds. |
|
|
256
|
+
| `nowLineComponent` | `RosterNowLineInput` (`x`, `now`) | `RosterNowLine`: noninteractive 2 px red vertical line across the body. |
|
|
247
257
|
| `gridComponent` | `ticks`, `contentWidth` | `RosterGrid`: one hairline per tick behind every lane. |
|
|
248
258
|
| `cornerZone` | `ReactNode` | `RosterCorner`: nothing; the cell above the labels, laneLabelWidth wide. |
|
|
249
259
|
| `headerComponent` | `ticks`, `projection`, `scroll`, `contentWidth`, `headerCellComponent` | `RosterHeader`: frozen header following horizontal offset. |
|
|
250
260
|
| `laneLabelColumnComponent` | `labels: LaneLabelInput[]`, `projection`, `scroll`, `laneLabelComponent` | `RosterLaneLabelColumn`: frozen labels following vertical offset. |
|
|
251
|
-
| `bodyComponent` | Ordered `lanes`, `window`, `geometryFor`, `projection`, `scroll`, `press`, `ticks`, `viewport`, `contentWidth`, highlight/hover, incomplete label, and rect components | `RosterBody`: virtualized lanes. |
|
|
261
|
+
| `bodyComponent` | Ordered `lanes`, `window`, `geometryFor`, `projection`, `scroll`, `press`, `ticks`, `viewport`, `contentWidth`, `nowLine`, `nowLineComponent`, highlight/hover, incomplete label, and rect components | `RosterBody`: virtualized lanes. |
|
|
252
262
|
|
|
253
263
|
## Selection
|
|
254
264
|
|
|
@@ -366,6 +376,7 @@ ordinary wall time resumes. timeAtY inverts this region to the absolute occurren
|
|
|
366
376
|
The repeat divider uses dividerY, the projected transition instant, even when
|
|
367
377
|
the surviving repeat regions have unequal heights.
|
|
368
378
|
|
|
379
|
+
xAtTime(projection,window,time) returns horizontal pixels from the window origin.
|
|
369
380
|
timeAtX(projection,window,x) returns absolute time with origin from window.
|
|
370
381
|
timeAtY(projection,columnIndex,y) returns an absolute occurrence or null for
|
|
371
382
|
skipped time/outside bounds. Inverse times stay below each scale piece's exclusive
|
|
@@ -536,6 +547,22 @@ ruleSetEditorZone. useRuleSetDraft owns text, parse result, and the applied set;
|
|
|
536
547
|
Apply validates before updating the roster, keeping the last valid set on error.
|
|
537
548
|
These are demo hooks/zones, not library exports.
|
|
538
549
|
|
|
550
|
+
The home page also links to /showcase. Its feature lives in
|
|
551
|
+
demo/components/team-roster. Every generated event has a scheduled window, title,
|
|
552
|
+
description, expected attendees, and seeded attendance for elapsed time. The hook
|
|
553
|
+
owns a fixed seeded now separating past, live, and future events. Attendees have
|
|
554
|
+
expected, pending, present, attended, or absent presence states. Present spans draw
|
|
555
|
+
through now without exposing future departures; immutable seeded arrival and
|
|
556
|
+
departure facts keep late departures present after scheduled end.
|
|
557
|
+
TeamInterval draws disjoint strips over the union of attendances on the lighter
|
|
558
|
+
scheduled block, retaining gaps and overhang. EventDetail in team-roster/events
|
|
559
|
+
is the intervalDetailComponent; its popover shows named presence rows against a
|
|
560
|
+
shared shaded scheduled band and scale. The footer status line defaults to the
|
|
561
|
+
attendance legend and scheduled-band explanation. Web hover or visible keyboard
|
|
562
|
+
focus shows row detail; keyboard focus wins when both are active. Native taps
|
|
563
|
+
toggle detail or switch rows. Event detail belongs to the popover; the inspector
|
|
564
|
+
retains member selection. See [showcase](./demo/components/team-roster/README.md).
|
|
565
|
+
|
|
539
566
|
Every route exposes live counter functions on web window.__roster. Its identity
|
|
540
567
|
stays stable until unmount; on-screen snapshots sample every 500 ms. The 200-lane
|
|
541
568
|
route feeds real adapter output to workload W and includes cold-layout, rule-hour,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-roster",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Layered intervals with provenance across lanes and a shared time axis for React Native.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
"rrule-temporal": "1.6.0"
|
|
125
125
|
},
|
|
126
126
|
"devDependencies": {
|
|
127
|
-
"@biomejs/biome": "2.5.
|
|
127
|
+
"@biomejs/biome": "2.5.13",
|
|
128
128
|
"@legendapp/list": "2.0.19",
|
|
129
129
|
"@semantic-release/changelog": "^7.0.0",
|
|
130
130
|
"@semantic-release/commit-analyzer": "13.0.1",
|
|
@@ -133,18 +133,18 @@
|
|
|
133
133
|
"@semantic-release/github": "12.0.9",
|
|
134
134
|
"@semantic-release/npm": "13.1.5",
|
|
135
135
|
"@semantic-release/release-notes-generator": "14.1.1",
|
|
136
|
-
"@size-limit/preset-small-lib": "^13.
|
|
136
|
+
"@size-limit/preset-small-lib": "^13.1.1",
|
|
137
137
|
"@types/bun": "^1.3.12",
|
|
138
138
|
"@types/react": "~19.1.10",
|
|
139
|
-
"@types/react-test-renderer": "^19.
|
|
139
|
+
"@types/react-test-renderer": "^19.3.0",
|
|
140
140
|
"@types/semver": "^7.7.0",
|
|
141
141
|
"@typescript-eslint/parser": "^8.60.1",
|
|
142
142
|
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
143
|
-
"eslint": "^10.
|
|
143
|
+
"eslint": "^10.11.0",
|
|
144
144
|
"eslint-plugin-react-compiler": "^19.1.0-rc.2",
|
|
145
145
|
"expo": "~54.0.37",
|
|
146
|
-
"knip": "^6.
|
|
147
|
-
"lefthook": "^2.1.
|
|
146
|
+
"knip": "^6.37.0",
|
|
147
|
+
"lefthook": "^2.1.14",
|
|
148
148
|
"nativewind": "4.1.x",
|
|
149
149
|
"playwright": "^1.63.0",
|
|
150
150
|
"publint": "^0.3.18",
|
|
@@ -154,7 +154,7 @@
|
|
|
154
154
|
"react-test-renderer": "19.1.0",
|
|
155
155
|
"semantic-release": "^25.0.3",
|
|
156
156
|
"semver": "^7.7.0",
|
|
157
|
-
"size-limit": "^13.
|
|
157
|
+
"size-limit": "^13.1.1",
|
|
158
158
|
"temporal-spec": "1.0.1",
|
|
159
159
|
"@radix-ui/react-popover": "1.1.23"
|
|
160
160
|
},
|
|
@@ -6,13 +6,13 @@ This feature is about a roster; its children are lanes.
|
|
|
6
6
|
`XxxInput` slot input type from `roster.types.ts`
|
|
7
7
|
|
|
8
8
|
- `index.tsx`: the chassis; calls `useRoster`, branches on `status`, composes zones
|
|
9
|
-
- `use-roster.ts`: the hook; owns window, projection, scroll, geometry, and selection
|
|
9
|
+
- `use-roster.ts`: the hook; owns window, projection, nowLine, scroll, geometry, and selection
|
|
10
10
|
- `use-roster-press.ts`: isolates the stable press ref so React Compiler can retain derived body inputs
|
|
11
11
|
- `layout.tsx`: arranges corner, header, label column, and body regions only
|
|
12
12
|
- `roster.types.ts`: props, model, and every slot input type
|
|
13
|
-
- `body-layout.tsx`: arranges grid and
|
|
13
|
+
- `body-layout.tsx`: arranges grid, list, and optional absolute overlay nodes with horizontal scroll wiring
|
|
14
14
|
- `parts/lane-list.tsx`: `RosterLaneList` owns LegendList and its lane render callback
|
|
15
|
-
- `parts/`: collection-level parts (body, header, header cell, grid, corner, label column, empty)
|
|
15
|
+
- `parts/`: collection-level parts (body, header, header cell, grid, now line, corner, label column, empty)
|
|
16
16
|
- `lanes/`: `LaneRow`, the interval-hover platform pair, and lane-local parts
|
|
17
17
|
- `utils/`: ticks and the body content key
|
|
18
18
|
|
|
@@ -20,8 +20,10 @@ Interval and gap components live in `../layers`; press geometry and `regionStyle
|
|
|
20
20
|
in `../primitives`. Zone contracts are documented in the README's Roster zones
|
|
21
21
|
section and in `llms.txt`. Tests: `test/components/roster`.
|
|
22
22
|
|
|
23
|
-
`RosterBody` gates
|
|
24
|
-
measurement and composes the body layout and lane list.
|
|
23
|
+
This feature is about a roster body; its children are lanes. `RosterBody` gates
|
|
24
|
+
measurement and composes the body layout and lane list. `BodyInput` extends the
|
|
25
|
+
positive `LaneListInput` with ticks, grid, and now-line inputs; the body explicitly
|
|
26
|
+
picks the lane-list props. The `onRowRender` prop on
|
|
25
27
|
`RosterBody` and `RosterLaneList` is a development-only Profiler hook used by the
|
|
26
28
|
gallery, not a supported customization point. Production Profiler callbacks are disabled.
|
|
27
29
|
|
|
@@ -29,6 +31,15 @@ Input-bearing slots accept component types and mount in the data-owning parts.
|
|
|
29
31
|
The chassis binds defaults once; emptyZone and cornerZone accept nodes. The body
|
|
30
32
|
content key tracks interval and gap component identity, including class components.
|
|
31
33
|
|
|
34
|
+
`now` is a controlled epoch millisecond value, default null. `useRoster` derives
|
|
35
|
+
`nowLine` (`{ x, now }`) during render via `xAtTime` using the fitted horizontal
|
|
36
|
+
scale; it is null when `now` is null or outside the end-exclusive window. The model
|
|
37
|
+
retains the raw `now` instant. The exported `RosterNowLine` fills the body's `overlayZone`
|
|
38
|
+
with a noninteractive 2 px red line; `nowLineComponent` accepts the exported
|
|
39
|
+
`RosterNowLineInput` (`{ x, now }`). The overlay scrolls horizontally with the
|
|
40
|
+
content. Now values and component identity never enter the lane list or body
|
|
41
|
+
content key. The caller owns clock updates.
|
|
42
|
+
|
|
32
43
|
`selection/` holds the runtime-swappable presentation strategies (native popover, web popover) for one `SelectionLayoutProps` contract.
|
|
33
44
|
|
|
34
45
|
- `selection/selection-layout.types.ts`: exported `SelectionLayoutProps`, with body
|
|
@@ -8,12 +8,26 @@ export function RosterBodyLayout({
|
|
|
8
8
|
viewport,
|
|
9
9
|
gridZone,
|
|
10
10
|
listZone,
|
|
11
|
+
overlayZone,
|
|
11
12
|
}: Pick<BodyInput, 'scroll' | 'contentWidth' | 'viewport'> & {
|
|
12
13
|
/** Noninteractive grid behind the lane list. */
|
|
13
14
|
gridZone: ReactNode;
|
|
14
15
|
/** Virtualized lane collection within the measured viewport. */
|
|
15
16
|
listZone: ReactNode;
|
|
17
|
+
/** Noninteractive content above the grid and lane list, following horizontal scroll. */
|
|
18
|
+
overlayZone?: ReactNode;
|
|
16
19
|
}) {
|
|
20
|
+
let overlay: ReactNode = null;
|
|
21
|
+
if (overlayZone != null) {
|
|
22
|
+
overlay = (
|
|
23
|
+
<View
|
|
24
|
+
pointerEvents="none"
|
|
25
|
+
style={{ position: 'absolute', top: 0, bottom: 0, left: 0, right: 0, zIndex: 1 }}
|
|
26
|
+
>
|
|
27
|
+
{overlayZone}
|
|
28
|
+
</View>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
17
31
|
const [contentOffset] = useState(() => ({ x: scroll.x.get(), y: 0 }));
|
|
18
32
|
const bodyRef = scroll.bodyRef;
|
|
19
33
|
useEffect(() => {
|
|
@@ -32,6 +46,7 @@ export function RosterBodyLayout({
|
|
|
32
46
|
<View style={{ width: contentWidth, height: viewport.height }}>
|
|
33
47
|
{gridZone}
|
|
34
48
|
{listZone}
|
|
49
|
+
{overlay}
|
|
35
50
|
</View>
|
|
36
51
|
</ScrollView>
|
|
37
52
|
);
|
|
@@ -11,6 +11,7 @@ import { RosterGrid } from './parts/grid';
|
|
|
11
11
|
import { RosterHeader } from './parts/header';
|
|
12
12
|
import { RosterHeaderCell } from './parts/header-cell';
|
|
13
13
|
import { RosterLaneLabelColumn } from './parts/lane-label-column';
|
|
14
|
+
import { RosterNowLine } from './parts/now-line';
|
|
14
15
|
import type { RosterProps } from './roster.types';
|
|
15
16
|
import { RosterSelectionPopover } from './selection/selection-layout';
|
|
16
17
|
import type { SelectionLayoutProps } from './selection/selection-layout.types';
|
|
@@ -21,6 +22,7 @@ const defaultCornerZone = <RosterCorner />;
|
|
|
21
22
|
|
|
22
23
|
export function Roster(props: RosterProps) {
|
|
23
24
|
const {
|
|
25
|
+
nowLine,
|
|
24
26
|
selection,
|
|
25
27
|
dismissSelection,
|
|
26
28
|
status,
|
|
@@ -49,6 +51,7 @@ export function Roster(props: RosterProps) {
|
|
|
49
51
|
intervalComponent = RosterInterval,
|
|
50
52
|
gapComponent = RosterGap,
|
|
51
53
|
gridComponent = RosterGrid,
|
|
54
|
+
nowLineComponent = RosterNowLine,
|
|
52
55
|
incompleteLabel = 'Availability may be incomplete',
|
|
53
56
|
neverSetLabel = 'No availability set',
|
|
54
57
|
} = props;
|
|
@@ -129,6 +132,8 @@ export function Roster(props: RosterProps) {
|
|
|
129
132
|
contentZone={contentZone}
|
|
130
133
|
anchorZone={
|
|
131
134
|
<BodyComponent
|
|
135
|
+
nowLine={nowLine}
|
|
136
|
+
nowLineComponent={nowLineComponent}
|
|
132
137
|
lanes={orderedLanes}
|
|
133
138
|
window={window}
|
|
134
139
|
geometryFor={geometryFor}
|
|
@@ -9,7 +9,26 @@ export function RosterBody(
|
|
|
9
9
|
onRowRender?: ProfilerOnRenderCallback;
|
|
10
10
|
},
|
|
11
11
|
) {
|
|
12
|
-
const {
|
|
12
|
+
const {
|
|
13
|
+
nowLine,
|
|
14
|
+
nowLineComponent: NowLineComponent,
|
|
15
|
+
ticks,
|
|
16
|
+
gridComponent: GridComponent,
|
|
17
|
+
lanes,
|
|
18
|
+
geometryFor,
|
|
19
|
+
projection,
|
|
20
|
+
scroll,
|
|
21
|
+
press,
|
|
22
|
+
contentWidth,
|
|
23
|
+
viewport,
|
|
24
|
+
window,
|
|
25
|
+
intervalComponent,
|
|
26
|
+
gapComponent,
|
|
27
|
+
highlightSource,
|
|
28
|
+
onIntervalHover,
|
|
29
|
+
incompleteLabel,
|
|
30
|
+
onRowRender,
|
|
31
|
+
} = props;
|
|
13
32
|
// LegendList requires a measured viewport and does not support static rendering.
|
|
14
33
|
if (viewport.width <= 0 || viewport.height <= 0) return null;
|
|
15
34
|
return (
|
|
@@ -18,7 +37,25 @@ export function RosterBody(
|
|
|
18
37
|
contentWidth={contentWidth}
|
|
19
38
|
viewport={viewport}
|
|
20
39
|
gridZone={<GridComponent ticks={ticks} contentWidth={contentWidth} />}
|
|
21
|
-
listZone={
|
|
40
|
+
listZone={
|
|
41
|
+
<RosterLaneList
|
|
42
|
+
lanes={lanes}
|
|
43
|
+
geometryFor={geometryFor}
|
|
44
|
+
projection={projection}
|
|
45
|
+
scroll={scroll}
|
|
46
|
+
press={press}
|
|
47
|
+
contentWidth={contentWidth}
|
|
48
|
+
viewport={viewport}
|
|
49
|
+
window={window}
|
|
50
|
+
intervalComponent={intervalComponent}
|
|
51
|
+
gapComponent={gapComponent}
|
|
52
|
+
highlightSource={highlightSource}
|
|
53
|
+
onIntervalHover={onIntervalHover}
|
|
54
|
+
incompleteLabel={incompleteLabel}
|
|
55
|
+
onRowRender={onRowRender}
|
|
56
|
+
/>
|
|
57
|
+
}
|
|
58
|
+
overlayZone={nowLine ? <NowLineComponent {...nowLine} /> : null}
|
|
22
59
|
/>
|
|
23
60
|
);
|
|
24
61
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LegendList } from '@legendapp/list';
|
|
2
2
|
import { Profiler, type ProfilerOnRenderCallback, useState } from 'react';
|
|
3
3
|
import { LaneRow } from '../lanes/lane';
|
|
4
|
-
import type {
|
|
4
|
+
import type { LaneListInput } from '../roster.types';
|
|
5
5
|
import { bodyContentKey } from '../utils/body-content-key';
|
|
6
6
|
|
|
7
7
|
export function RosterLaneList({
|
|
@@ -19,7 +19,7 @@ export function RosterLaneList({
|
|
|
19
19
|
onIntervalHover,
|
|
20
20
|
incompleteLabel,
|
|
21
21
|
onRowRender,
|
|
22
|
-
}:
|
|
22
|
+
}: LaneListInput & {
|
|
23
23
|
/** Development-only Profiler hook used by the gallery; not a supported customization point. */
|
|
24
24
|
onRowRender?: ProfilerOnRenderCallback;
|
|
25
25
|
}) {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { View } from 'react-native';
|
|
2
|
+
import type { RosterNowLineInput } from '../roster.types';
|
|
3
|
+
|
|
4
|
+
export function RosterNowLine({ x }: RosterNowLineInput) {
|
|
5
|
+
return (
|
|
6
|
+
<View
|
|
7
|
+
testID="roster-now-line"
|
|
8
|
+
pointerEvents="none"
|
|
9
|
+
style={{
|
|
10
|
+
position: 'absolute',
|
|
11
|
+
left: x,
|
|
12
|
+
top: 0,
|
|
13
|
+
bottom: 0,
|
|
14
|
+
width: 2,
|
|
15
|
+
backgroundColor: '#dc2626',
|
|
16
|
+
}}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -48,6 +48,8 @@ export type RosterInput = {
|
|
|
48
48
|
lanes: Lane[];
|
|
49
49
|
windowSpec: WindowSpec;
|
|
50
50
|
minuteStep?: number;
|
|
51
|
+
/** Current instant in epoch milliseconds; default null draws no now line. */
|
|
52
|
+
now?: number | null;
|
|
51
53
|
sortLanes?: LaneComparator;
|
|
52
54
|
highlightSource?: Source;
|
|
53
55
|
onNavigate?: (next: WindowSpec) => void;
|
|
@@ -76,6 +78,8 @@ export type RosterModel = {
|
|
|
76
78
|
press: (lane: Lane, x: number, y: number) => void;
|
|
77
79
|
status: 'empty' | 'ready';
|
|
78
80
|
ticks: RosterTick[];
|
|
81
|
+
now: number | null;
|
|
82
|
+
nowLine: RosterNowLineInput | null;
|
|
79
83
|
contentWidth: number;
|
|
80
84
|
viewport: { width: number; height: number };
|
|
81
85
|
onLayout: (input: LayoutChangeEvent) => void;
|
|
@@ -89,6 +93,7 @@ export type LaneLabelInput = {
|
|
|
89
93
|
incompleteLabel: string;
|
|
90
94
|
neverSetLabel: string;
|
|
91
95
|
};
|
|
96
|
+
export type RosterNowLineInput = { x: number; now: number };
|
|
92
97
|
export type HeaderCellInput = { tick: RosterTick };
|
|
93
98
|
export type GridInput = { ticks: RosterTick[]; contentWidth: number };
|
|
94
99
|
export type HeaderInput = Pick<RosterModel, 'ticks' | 'projection' | 'scroll' | 'contentWidth'> & {
|
|
@@ -100,16 +105,9 @@ export type LabelColumnInput = Pick<RosterModel, 'projection' | 'scroll'> & {
|
|
|
100
105
|
/** Lane label filler, positioned at the fixed row height. */
|
|
101
106
|
laneLabelComponent: ComponentType<LaneLabelInput>;
|
|
102
107
|
};
|
|
103
|
-
export type
|
|
108
|
+
export type LaneListInput = Pick<
|
|
104
109
|
RosterModel,
|
|
105
|
-
| '
|
|
106
|
-
| 'projection'
|
|
107
|
-
| 'scroll'
|
|
108
|
-
| 'press'
|
|
109
|
-
| 'ticks'
|
|
110
|
-
| 'contentWidth'
|
|
111
|
-
| 'viewport'
|
|
112
|
-
| 'window'
|
|
110
|
+
'geometryFor' | 'projection' | 'scroll' | 'press' | 'contentWidth' | 'viewport' | 'window'
|
|
113
111
|
> & {
|
|
114
112
|
lanes: Lane[];
|
|
115
113
|
highlightSource?: Source;
|
|
@@ -119,6 +117,12 @@ export type BodyInput = Pick<
|
|
|
119
117
|
intervalComponent: ComponentType<IntervalInput>;
|
|
120
118
|
/** Removed rect filler, placed inside a pressable by LaneRow. */
|
|
121
119
|
gapComponent: ComponentType<GapInput>;
|
|
120
|
+
};
|
|
121
|
+
export type BodyInput = LaneListInput & {
|
|
122
|
+
ticks: RosterTick[];
|
|
123
|
+
nowLine: RosterNowLineInput | null;
|
|
124
|
+
/** Noninteractive current-time line positioned in body content pixels. */
|
|
125
|
+
nowLineComponent: ComponentType<RosterNowLineInput>;
|
|
122
126
|
/** Noninteractive tick lines behind every lane, sized to the content width. */
|
|
123
127
|
gridComponent: ComponentType<GridInput>;
|
|
124
128
|
};
|
|
@@ -145,6 +149,8 @@ export type RosterStyleProps = {
|
|
|
145
149
|
};
|
|
146
150
|
export type RosterProps = Omit<RosterInput, 'selectable'> &
|
|
147
151
|
RosterStyleProps & {
|
|
152
|
+
/** Noninteractive current-time line; RosterNowLine spans the body height at x. */
|
|
153
|
+
nowLineComponent?: ComponentType<RosterNowLineInput>;
|
|
148
154
|
/**
|
|
149
155
|
* Selected interval content; absent means interval presses retain no selection.
|
|
150
156
|
* Lives on RosterProps because the chassis mounts content and enables useRoster selection.
|
|
@@ -2,7 +2,7 @@ import { useRef, useState } from 'react';
|
|
|
2
2
|
import type { ScrollView } from 'react-native';
|
|
3
3
|
import { makeMutable, useAnimatedStyle } from 'react-native-reanimated';
|
|
4
4
|
import type { Lane, LaneGeometry, Rect, Window } from '../../core';
|
|
5
|
-
import { byLabel, coverageFor, flagFor, layoutLane, timeAtX, windowFor } from '../../core';
|
|
5
|
+
import { byLabel, coverageFor, flagFor, layoutLane, timeAtX, windowFor, xAtTime } from '../../core';
|
|
6
6
|
import type { RosterInput, RosterModel, RosterProjection } from './roster.types';
|
|
7
7
|
import { type SelectedInterval, useRosterPress } from './use-roster-press';
|
|
8
8
|
import { ticksFor } from './utils/ticks';
|
|
@@ -11,6 +11,7 @@ export function useRoster(input: RosterInput): RosterModel {
|
|
|
11
11
|
const {
|
|
12
12
|
lanes,
|
|
13
13
|
windowSpec,
|
|
14
|
+
now = null,
|
|
14
15
|
minuteStep = 60,
|
|
15
16
|
sortLanes = byLabel,
|
|
16
17
|
rowHeight = 48,
|
|
@@ -44,6 +45,10 @@ export function useRoster(input: RosterInput): RosterModel {
|
|
|
44
45
|
rowHeight,
|
|
45
46
|
pxPerMinute: Math.max(pxPerMinute, duration === 0 ? 0 : viewport.width / duration),
|
|
46
47
|
};
|
|
48
|
+
const nowLine =
|
|
49
|
+
now !== null && now >= window.start && now < window.end
|
|
50
|
+
? { x: xAtTime(projection, window, now), now }
|
|
51
|
+
: null;
|
|
47
52
|
const contentWidth = duration * projection.pxPerMinute;
|
|
48
53
|
const coverage = new Map(lanes.map((lane) => [lane.id, coverageFor(lane, window)]));
|
|
49
54
|
const orderedLanes = [...lanes].sort((a, b) => sortLanes(a, b, coverage));
|
|
@@ -78,6 +83,8 @@ export function useRoster(input: RosterInput): RosterModel {
|
|
|
78
83
|
press,
|
|
79
84
|
status: lanes.length === 0 ? 'empty' : 'ready',
|
|
80
85
|
ticks: ticksFor(window, windowSpec, projection, minuteStep),
|
|
86
|
+
now,
|
|
87
|
+
nowLine,
|
|
81
88
|
contentWidth,
|
|
82
89
|
viewport,
|
|
83
90
|
navigate: (next) => onNavigate?.(next),
|
package/src/core/README.md
CHANGED
|
@@ -20,7 +20,7 @@ no React Native, no dependencies.
|
|
|
20
20
|
| `spans.ts` | `extentOf`, `intersectionOf`, `unionOf`, and the provenance sweep with exact sources per merged span |
|
|
21
21
|
| `columns.ts` | day columns, transitions, and skipped dates for the columns projection |
|
|
22
22
|
| `zone.ts` | Intl-only timezone math (offsets, first instants, transitions) |
|
|
23
|
-
| `scale.ts`, `snap.ts` | pixel and time conversion, pointer snapping |
|
|
23
|
+
| `scale.ts`, `snap.ts` | pixel and time conversion (`xAtTime`, `timeAtX`, `timeAtY`), pointer snapping |
|
|
24
24
|
| `hit-test.ts` | the geometry walk both hooks use to resolve a press |
|
|
25
25
|
| `order.ts`, `flag.ts` | lane comparators and lane flags |
|
|
26
26
|
| `cache.ts`, `hash.ts` | layout and coverage caches keyed by lane content |
|
package/src/core/index.ts
CHANGED
|
@@ -13,7 +13,7 @@ export { flagFor } from './flag';
|
|
|
13
13
|
export { layoutLane } from './layout';
|
|
14
14
|
export type { LaneComparator } from './order';
|
|
15
15
|
export { byCoverage, byLabel } from './order';
|
|
16
|
-
export { snapToStep, timeAtX, timeAtY } from './snap';
|
|
16
|
+
export { snapToStep, timeAtX, timeAtY, xAtTime } from './snap';
|
|
17
17
|
export { hasSource } from './source';
|
|
18
18
|
export { extentOf, intersectionOf, unionOf } from './spans';
|
|
19
19
|
export type {
|
package/src/core/layout.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { coverageFor } from './coverage';
|
|
|
3
3
|
import { flagFor } from './flag';
|
|
4
4
|
import { laneKey, projectionKey } from './hash';
|
|
5
5
|
import { type ScalePiece, scalePieces } from './scale';
|
|
6
|
+
import { xAtTime } from './snap';
|
|
6
7
|
import { sourceSpans } from './spans';
|
|
7
8
|
import type { Interval, Lane, LaneGeometry, Layer, Projection, Rect, Window } from './types';
|
|
8
9
|
|
|
@@ -60,7 +61,7 @@ function project(
|
|
|
60
61
|
if (projection.orientation === 'horizontal') {
|
|
61
62
|
for (const span of spans) {
|
|
62
63
|
rects.push({
|
|
63
|
-
x: (
|
|
64
|
+
x: xAtTime(projection, window, span.start),
|
|
64
65
|
y: inset,
|
|
65
66
|
width: ((span.end - span.start) / 60_000) * projection.pxPerMinute,
|
|
66
67
|
height: Math.max(0, projection.rowHeight - 2 * inset),
|
package/src/core/snap.ts
CHANGED
|
@@ -50,3 +50,12 @@ export function timeAtX(
|
|
|
50
50
|
): number {
|
|
51
51
|
return window.start + (x * 60_000) / projection.pxPerMinute;
|
|
52
52
|
}
|
|
53
|
+
|
|
54
|
+
/** Horizontal position at true elapsed length; the window supplies the projection's origin. */
|
|
55
|
+
export function xAtTime(
|
|
56
|
+
projection: Extract<Projection, { orientation: 'horizontal' }>,
|
|
57
|
+
window: Window,
|
|
58
|
+
time: number,
|
|
59
|
+
): number {
|
|
60
|
+
return ((time - window.start) / 60_000) * projection.pxPerMinute;
|
|
61
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -13,6 +13,7 @@ export { RosterHeader } from './components/roster/parts/header';
|
|
|
13
13
|
export { RosterHeaderCell } from './components/roster/parts/header-cell';
|
|
14
14
|
export { RosterLaneLabelColumn } from './components/roster/parts/lane-label-column';
|
|
15
15
|
export { RosterLaneList } from './components/roster/parts/lane-list';
|
|
16
|
+
export { RosterNowLine } from './components/roster/parts/now-line';
|
|
16
17
|
export type {
|
|
17
18
|
BodyInput,
|
|
18
19
|
GridInput,
|
|
@@ -21,8 +22,10 @@ export type {
|
|
|
21
22
|
IntervalDetailInput,
|
|
22
23
|
LabelColumnInput,
|
|
23
24
|
LaneLabelInput,
|
|
25
|
+
LaneListInput,
|
|
24
26
|
RosterInput,
|
|
25
27
|
RosterModel,
|
|
28
|
+
RosterNowLineInput,
|
|
26
29
|
RosterProjection,
|
|
27
30
|
RosterProps,
|
|
28
31
|
RosterScroll,
|