react-native-roster 0.1.0 → 0.2.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/README.md +102 -2
- package/dist/src/components/primitives/portal.d.ts +12 -0
- package/dist/src/components/primitives/portal.d.ts.map +1 -0
- package/dist/src/components/primitives/portal.js +41 -0
- package/dist/src/components/primitives/portal.js.map +1 -0
- package/dist/src/components/roster/body-layout.d.ts +1 -1
- package/dist/src/components/roster/body-layout.d.ts.map +1 -1
- package/dist/src/components/roster/body-layout.js +7 -1
- package/dist/src/components/roster/body-layout.js.map +1 -1
- package/dist/src/components/roster/index.d.ts +2 -1
- package/dist/src/components/roster/index.d.ts.map +1 -1
- package/dist/src/components/roster/index.js +26 -3
- package/dist/src/components/roster/index.js.map +1 -1
- package/dist/src/components/roster/lanes/lane.d.ts.map +1 -1
- package/dist/src/components/roster/lanes/lane.js +2 -1
- package/dist/src/components/roster/lanes/lane.js.map +1 -1
- package/dist/src/components/roster/parts/lane-list.d.ts.map +1 -1
- package/dist/src/components/roster/parts/lane-list.js +2 -1
- package/dist/src/components/roster/parts/lane-list.js.map +1 -1
- package/dist/src/components/roster/roster.types.d.ts +29 -1
- package/dist/src/components/roster/roster.types.d.ts.map +1 -1
- package/dist/src/components/roster/selection/selection-layout.d.ts +4 -0
- package/dist/src/components/roster/selection/selection-layout.d.ts.map +1 -0
- package/dist/src/components/roster/selection/selection-layout.js +82 -0
- package/dist/src/components/roster/selection/selection-layout.js.map +1 -0
- package/dist/src/components/roster/selection/selection-layout.types.d.ts +25 -0
- package/dist/src/components/roster/selection/selection-layout.types.d.ts.map +1 -0
- package/dist/src/components/roster/selection/selection-layout.types.js +3 -0
- package/dist/src/components/roster/selection/selection-layout.types.js.map +1 -0
- package/dist/src/components/roster/selection/selection-layout.web.d.ts +4 -0
- package/dist/src/components/roster/selection/selection-layout.web.d.ts.map +1 -0
- package/dist/src/components/roster/selection/selection-layout.web.js +52 -0
- package/dist/src/components/roster/selection/selection-layout.web.js.map +1 -0
- package/dist/src/components/roster/use-roster-press.d.ts +6 -0
- package/dist/src/components/roster/use-roster-press.d.ts.map +1 -0
- package/dist/src/components/roster/use-roster-press.js +61 -0
- package/dist/src/components/roster/use-roster-press.js.map +1 -0
- package/dist/src/components/roster/use-roster.d.ts.map +1 -1
- package/dist/src/components/roster/use-roster.js +40 -30
- package/dist/src/components/roster/use-roster.js.map +1 -1
- package/dist/src/components/schedule/days/parts/column.d.ts.map +1 -1
- package/dist/src/components/schedule/days/parts/column.js +2 -1
- package/dist/src/components/schedule/days/parts/column.js.map +1 -1
- package/dist/src/core/index.d.ts +1 -0
- package/dist/src/core/index.d.ts.map +1 -1
- package/dist/src/core/index.js +3 -1
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/core/source.d.ts +4 -0
- package/dist/src/core/source.d.ts.map +1 -0
- package/dist/src/core/source.js +9 -0
- package/dist/src/core/source.js.map +1 -0
- package/dist/src/index.d.ts +4 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +6 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/nativewind/index.d.ts +4 -1
- package/dist/src/nativewind/index.d.ts.map +1 -1
- package/llms.txt +67 -2
- package/package.json +10 -4
- package/src/components/primitives/README.md +13 -2
- package/src/components/primitives/portal.tsx +48 -0
- package/src/components/roster/README.md +48 -2
- package/src/components/roster/body-layout.tsx +7 -1
- package/src/components/roster/index.tsx +62 -17
- package/src/components/roster/lanes/lane.tsx +2 -4
- package/src/components/roster/parts/lane-list.tsx +3 -1
- package/src/components/roster/roster.types.ts +30 -1
- package/src/components/roster/selection/selection-layout.tsx +90 -0
- package/src/components/roster/selection/selection-layout.types.ts +20 -0
- package/src/components/roster/selection/selection-layout.web.tsx +88 -0
- package/src/components/roster/use-roster-press.ts +74 -0
- package/src/components/roster/use-roster.ts +57 -44
- package/src/components/schedule/days/parts/column.tsx +2 -4
- package/src/core/README.md +4 -0
- package/src/core/index.ts +1 -0
- package/src/core/source.ts +9 -0
- package/src/index.ts +4 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection-layout.types.js","sourceRoot":"","sources":["../../../../../src/components/roster/selection/selection-layout.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SelectionLayoutProps } from './selection-layout.types';
|
|
2
|
+
/** Web selection presentation; Radix owns outside press, Escape, and collisions. */
|
|
3
|
+
export declare function RosterSelectionPopover({ anchorZone, contentZone, targetBounds, open, onDismiss, scroll, }: SelectionLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
//# sourceMappingURL=selection-layout.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection-layout.web.d.ts","sourceRoot":"","sources":["../../../../../src/components/roster/selection/selection-layout.web.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAErE,oFAAoF;AACpF,wBAAgB,sBAAsB,CAAC,EACrC,UAAU,EACV,WAAW,EACX,YAAY,EACZ,IAAI,EACJ,SAAS,EACT,MAAM,GACP,EAAE,oBAAoB,2CA0EtB"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.RosterSelectionPopover = RosterSelectionPopover;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_popover_1 = require("@radix-ui/react-popover");
|
|
9
|
+
const react_1 = require("react");
|
|
10
|
+
const react_native_reanimated_1 = __importDefault(require("react-native-reanimated"));
|
|
11
|
+
/** Web selection presentation; Radix owns outside press, Escape, and collisions. */
|
|
12
|
+
function RosterSelectionPopover({ anchorZone, contentZone, targetBounds, open, onDismiss, scroll, }) {
|
|
13
|
+
const bodyRef = (0, react_1.useRef)(null);
|
|
14
|
+
const returnFocusRef = (0, react_1.useRef)(null);
|
|
15
|
+
const keyboardDismissRef = (0, react_1.useRef)(false);
|
|
16
|
+
(0, react_1.useEffect)(() => {
|
|
17
|
+
if (open && targetBounds && bodyRef.current?.contains(document.activeElement)) {
|
|
18
|
+
returnFocusRef.current = document.activeElement;
|
|
19
|
+
}
|
|
20
|
+
}, [open, targetBounds]);
|
|
21
|
+
return ((0, jsx_runtime_1.jsxs)(react_popover_1.Root, { open: open, onOpenChange: (next) => {
|
|
22
|
+
if (!next)
|
|
23
|
+
onDismiss();
|
|
24
|
+
}, children: [(0, jsx_runtime_1.jsxs)("div", { ref: bodyRef, style: {
|
|
25
|
+
position: 'relative',
|
|
26
|
+
display: 'flex',
|
|
27
|
+
flexDirection: 'column',
|
|
28
|
+
flex: 1,
|
|
29
|
+
minHeight: 0,
|
|
30
|
+
}, children: [anchorZone, (0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, { style: [{ position: 'absolute', top: 0, left: 0 }, scroll.headerStyle], children: (0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, { style: scroll.labelStyle, children: (0, jsx_runtime_1.jsx)(react_popover_1.Anchor, { asChild: true, children: (0, jsx_runtime_1.jsx)("div", { "data-testid": "roster-selection-target", style: {
|
|
31
|
+
position: 'absolute',
|
|
32
|
+
left: targetBounds?.x ?? 0,
|
|
33
|
+
top: targetBounds ? targetBounds.y + targetBounds.height : 0,
|
|
34
|
+
width: 0,
|
|
35
|
+
height: 0,
|
|
36
|
+
pointerEvents: 'none',
|
|
37
|
+
} }) }) }) })] }), (0, jsx_runtime_1.jsx)(react_popover_1.Portal, { children: (0, jsx_runtime_1.jsx)(react_popover_1.Content, { onOpenAutoFocus: () => {
|
|
38
|
+
returnFocusRef.current = document.activeElement;
|
|
39
|
+
keyboardDismissRef.current = false;
|
|
40
|
+
}, onEscapeKeyDown: () => {
|
|
41
|
+
keyboardDismissRef.current = true;
|
|
42
|
+
}, onCloseAutoFocus: (event) => {
|
|
43
|
+
event.preventDefault();
|
|
44
|
+
if (keyboardDismissRef.current && returnFocusRef.current instanceof HTMLElement) {
|
|
45
|
+
returnFocusRef.current.focus({ preventScroll: true });
|
|
46
|
+
}
|
|
47
|
+
}, onInteractOutside: (event) => {
|
|
48
|
+
if (bodyRef.current?.contains(event.target))
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
}, sideOffset: 4, align: "start", updatePositionStrategy: "always", "aria-label": "Interval details", style: { zIndex: 1000 }, children: contentZone }) })] }));
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=selection-layout.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection-layout.web.js","sourceRoot":"","sources":["../../../../../src/components/roster/selection/selection-layout.web.tsx"],"names":[],"mappings":";;;;;;;AAAA,2DAAwE;AACxE,iCAA0C;AAC1C,sFAA+C;AAG/C,oFAAoF;AACpF,gCAAuC,EACrC,UAAU,EACV,WAAW,EACX,YAAY,EACZ,IAAI,EACJ,SAAS,EACT,MAAM,GACe;IACrB,MAAM,OAAO,GAAG,IAAA,cAAM,EAAiB,IAAI,CAAC,CAAC;IAC7C,MAAM,cAAc,GAAG,IAAA,cAAM,EAAiB,IAAI,CAAC,CAAC;IACpD,MAAM,kBAAkB,GAAG,IAAA,cAAM,EAAC,KAAK,CAAC,CAAC;IACzC,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,IAAI,IAAI,YAAY,IAAI,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;YAC9E,cAAc,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC;QAClD,CAAC;IACH,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;IACzB,OAAO,CACL,wBAAC,oBAAI,IACH,IAAI,EAAE,IAAI,EACV,Y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CAAC;wBACvB,IAAI,kBAAkB,CAAC,OAAO,IAAI,cAAc,CAAC,OAAO,YAAY,WAAW,EAAE,CAAC;4BAChF,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;wBACxD,CAAC;oBACH,CAAC,EACD,iBAAiB,EAAE,CAAC,KAAK,EAAE,EAAE;wBAC3B,IAAI,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAc,CAAC;4BAAE,KAAK,CAAC,cAAc,EAAE,CAAC;oBAC9E,CAAC,EACD,UAAU,EAAE,CAAC,EACb,KAAK,EAAC,OAAO,EACb,sBAAsB,EAAC,QAAQ,gBACpB,kBAAkB,EAC7B,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,YAEtB,WAAW,GACJ,GACH,IACJ,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import type { Lane, Window } from '../../core';
|
|
3
|
+
import type { RosterInput, RosterModel, RosterProjection } from './roster.types';
|
|
4
|
+
export type SelectedInterval = NonNullable<RosterModel['selection']>;
|
|
5
|
+
export declare function useRosterPress(input: RosterInput, window: Window, projection: RosterProjection, width: number, selection: RosterModel['selection'], setSelected: Dispatch<SetStateAction<SelectedInterval | null>>): (lane: Lane, pointX: number, pointY: number) => void;
|
|
6
|
+
//# sourceMappingURL=use-roster-press.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-roster-press.d.ts","sourceRoot":"","sources":["../../../../src/components/roster/use-roster-press.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEjF,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC;AAGrE,wBAAgB,cAAc,CAC5B,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,gBAAgB,EAC5B,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,WAAW,CAAC,WAAW,CAAC,EACnC,WAAW,EAAE,QAAQ,CAAC,cAAc,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC,UAMhC,IAAI,UAAU,MAAM,UAAU,MAAM,KAAG,IAAI,CAmD1E"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useRosterPress = useRosterPress;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const core_1 = require("../../core");
|
|
6
|
+
const hit_test_1 = require("../../core/hit-test");
|
|
7
|
+
// Isolate the stable press ref so it does not prevent compilation of derived roster values.
|
|
8
|
+
function useRosterPress(input, window, projection, width, selection, setSelected) {
|
|
9
|
+
const currentPress = { input, window, projection, width, selection };
|
|
10
|
+
const pressInput = (0, react_1.useRef)(currentPress);
|
|
11
|
+
pressInput.current = currentPress;
|
|
12
|
+
const [press] = (0, react_1.useState)(() => {
|
|
13
|
+
return function press(lane, pointX, pointY) {
|
|
14
|
+
const { input, window, projection, width, selection } = pressInput.current;
|
|
15
|
+
const { minuteStep = 60, onIntervalPress, onGapPress, onCellPress } = input;
|
|
16
|
+
const { rowHeight, viewTimezone } = projection;
|
|
17
|
+
if (!Number.isFinite(pointX) ||
|
|
18
|
+
!Number.isFinite(pointY) ||
|
|
19
|
+
pointX < 0 ||
|
|
20
|
+
pointX >= width ||
|
|
21
|
+
pointY < 0 ||
|
|
22
|
+
pointY >= rowHeight)
|
|
23
|
+
return;
|
|
24
|
+
const hit = (0, hit_test_1.hitTest)(lane, (0, core_1.layoutLane)(lane, window, projection), pointX, pointY);
|
|
25
|
+
if (hit?.kind === 'interval') {
|
|
26
|
+
if (input.selectable) {
|
|
27
|
+
const layer = lane.layers.find((layer) => layer.id === hit.rect.layerId);
|
|
28
|
+
// layoutLane supplied the hit rect's layerId, so this should succeed; guard future refactors.
|
|
29
|
+
if (layer === undefined)
|
|
30
|
+
return;
|
|
31
|
+
// Compare reconciled geometry so resizing and cache eviction preserve toggle identity.
|
|
32
|
+
setSelected(selection?.lane.id === lane.id &&
|
|
33
|
+
selection.rect.layerId === hit.rect.layerId &&
|
|
34
|
+
selection.rect.x === hit.rect.x &&
|
|
35
|
+
selection.rect.width === hit.rect.width
|
|
36
|
+
? null
|
|
37
|
+
: {
|
|
38
|
+
rect: hit.rect,
|
|
39
|
+
layer,
|
|
40
|
+
lane,
|
|
41
|
+
start: (0, core_1.timeAtX)(projection, window, hit.rect.x),
|
|
42
|
+
end: (0, core_1.timeAtX)(projection, window, hit.rect.x + hit.rect.width),
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
onIntervalPress?.(hit.rect, lane);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (selection)
|
|
49
|
+
setSelected(null);
|
|
50
|
+
if (hit?.kind === 'gap') {
|
|
51
|
+
onGapPress?.(hit.rect, lane);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const time = Math.max(window.start, (0, core_1.snapToStep)((0, core_1.timeAtX)(projection, window, pointX), minuteStep, viewTimezone));
|
|
55
|
+
if (time < window.end)
|
|
56
|
+
onCellPress?.(lane, time);
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
return press;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=use-roster-press.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-roster-press.js","sourceRoot":"","sources":["../../../../src/components/roster/use-roster-press.ts"],"names":[],"mappings":";;;AACA,iCAAyC;AAE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C,IAAA,cAAO,EAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,UAAU,EAAE,YAAY,CAAC,CAC1E,CAAC;YACF,IAAI,IAAI,GAAG,MAAM,CAAC,GAAG;gBAAE,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACnD,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-roster.d.ts","sourceRoot":"","sources":["../../../../src/components/roster/use-roster.ts"],"names":[],"mappings":"
|
|
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,CAkGzD"}
|
|
@@ -4,10 +4,14 @@ exports.useRoster = useRoster;
|
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const react_native_reanimated_1 = require("react-native-reanimated");
|
|
6
6
|
const core_1 = require("../../core");
|
|
7
|
-
const
|
|
7
|
+
const use_roster_press_1 = require("./use-roster-press");
|
|
8
8
|
const ticks_1 = require("./utils/ticks");
|
|
9
9
|
function useRoster(input) {
|
|
10
10
|
const { lanes, windowSpec, minuteStep = 60, sortLanes = core_1.byLabel, rowHeight = 48, pxPerMinute = 0.5, onNavigate, } = input;
|
|
11
|
+
const [selected, setSelected] = (0, react_1.useState)(null);
|
|
12
|
+
function dismissSelection() {
|
|
13
|
+
setSelected(null);
|
|
14
|
+
}
|
|
11
15
|
const [viewport, setViewport] = (0, react_1.useState)({ width: 0, height: 0 });
|
|
12
16
|
// The pinned compiler lint cannot resolve useSharedValue's built-in type.
|
|
13
17
|
// These shared values only track offsets, so no animation needs cancellation.
|
|
@@ -39,36 +43,14 @@ function useRoster(input) {
|
|
|
39
43
|
function geometryFor(lane) {
|
|
40
44
|
return (0, core_1.layoutLane)(lane, window, projection);
|
|
41
45
|
}
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const { input, window, projection, width } = pressInput.current;
|
|
48
|
-
const { minuteStep = 60, onIntervalPress, onGapPress, onCellPress } = input;
|
|
49
|
-
const { rowHeight, viewTimezone } = projection;
|
|
50
|
-
if (!Number.isFinite(pointX) ||
|
|
51
|
-
!Number.isFinite(pointY) ||
|
|
52
|
-
pointX < 0 ||
|
|
53
|
-
pointX >= width ||
|
|
54
|
-
pointY < 0 ||
|
|
55
|
-
pointY >= rowHeight)
|
|
56
|
-
return;
|
|
57
|
-
const hit = (0, hit_test_1.hitTest)(lane, (0, core_1.layoutLane)(lane, window, projection), pointX, pointY);
|
|
58
|
-
if (hit?.kind === 'interval') {
|
|
59
|
-
onIntervalPress?.(hit.rect, lane);
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
if (hit?.kind === 'gap') {
|
|
63
|
-
onGapPress?.(hit.rect, lane);
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
const time = Math.max(window.start, (0, core_1.snapToStep)((0, core_1.timeAtX)(projection, window, pointX), minuteStep, viewTimezone));
|
|
67
|
-
if (time < window.end)
|
|
68
|
-
onCellPress?.(lane, time);
|
|
69
|
-
};
|
|
70
|
-
});
|
|
46
|
+
const selection = reconcileSelection(selected, lanes, window, projection, input.selectable ?? false);
|
|
47
|
+
// Discard invalid selection during reconciliation, before rendering any stale detail.
|
|
48
|
+
if (selected && !selection)
|
|
49
|
+
setSelected(null);
|
|
50
|
+
const press = (0, use_roster_press_1.useRosterPress)(input, window, projection, contentWidth, selection, setSelected);
|
|
71
51
|
return {
|
|
52
|
+
selection,
|
|
53
|
+
dismissSelection,
|
|
72
54
|
window,
|
|
73
55
|
projection,
|
|
74
56
|
orderedLanes,
|
|
@@ -103,4 +85,32 @@ function useRoster(input) {
|
|
|
103
85
|
},
|
|
104
86
|
};
|
|
105
87
|
}
|
|
88
|
+
// Match provenance and nearest bounds while preserving the stored display values.
|
|
89
|
+
function reconcileSelection(selected, lanes, window, projection, enabled) {
|
|
90
|
+
if (selected && enabled) {
|
|
91
|
+
const lane = lanes.find((lane) => lane.id === selected.lane.id);
|
|
92
|
+
const layer = lane?.layers.find((layer) => layer.id === selected.layer.id);
|
|
93
|
+
if (lane && layer) {
|
|
94
|
+
const sources = new Set(selected.rect.sources.map((source) => JSON.stringify([source.kind, source.id])));
|
|
95
|
+
let rect;
|
|
96
|
+
let nearest = 1;
|
|
97
|
+
for (const candidate of (0, core_1.layoutLane)(lane, window, projection).rects) {
|
|
98
|
+
if (candidate.layerId !== layer.id)
|
|
99
|
+
continue;
|
|
100
|
+
const identities = new Set(candidate.sources.map((source) => JSON.stringify([source.kind, source.id])));
|
|
101
|
+
if (identities.size !== sources.size || ![...identities].every((id) => sources.has(id)))
|
|
102
|
+
continue;
|
|
103
|
+
const difference = Math.abs((0, core_1.timeAtX)(projection, window, candidate.x) - selected.start) +
|
|
104
|
+
Math.abs((0, core_1.timeAtX)(projection, window, candidate.x + candidate.width) - selected.end);
|
|
105
|
+
if (difference <= nearest && (!rect || difference < nearest)) {
|
|
106
|
+
nearest = difference;
|
|
107
|
+
rect = candidate;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (rect)
|
|
111
|
+
return { rect, layer, lane, start: selected.start, end: selected.end };
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
106
116
|
//# sourceMappingURL=use-roster.js.map
|
|
@@ -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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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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column.d.ts","sourceRoot":"","sources":["../../../../../../src/components/schedule/days/parts/column.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"column.d.ts","sourceRoot":"","sources":["../../../../../../src/components/schedule/days/parts/column.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,KAAK,EACL,iBAAiB,EAAE,iBAAiB,EACpC,YAAY,EAAE,YAAY,EAC1B,eAAe,GAChB,EAAE,mBAAmB,6CA0CrB"}
|
|
@@ -4,13 +4,14 @@ exports.ScheduleColumn = ScheduleColumn;
|
|
|
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
|
+
const core_1 = require("../../../../core");
|
|
7
8
|
const press_point_1 = require("../../../primitives/press-point");
|
|
8
9
|
function ScheduleColumn({ lane, rects, gapRects, press, intervalComponent: IntervalComponent, gapComponent: GapComponent, highlightSource, }) {
|
|
9
10
|
return [...lane.layers]
|
|
10
11
|
.sort((a, b) => a.z - b.z)
|
|
11
12
|
.map((layer) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [rects
|
|
12
13
|
.filter((rect) => rect.layerId === layer.id)
|
|
13
|
-
.map((rect) => ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: (0, jsx_runtime_1.jsx)(IntervalComponent, { rect: rect, layer: layer, lane: lane, highlighted:
|
|
14
|
+
.map((rect) => ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: (0, jsx_runtime_1.jsx)(IntervalComponent, { rect: rect, layer: layer, lane: lane, highlighted: (0, core_1.hasSource)(rect.sources, highlightSource) }) }, `interval-${rect.y}:${rect.height}`))), gapRects
|
|
14
15
|
.filter((rect) => rect.layerId === layer.id)
|
|
15
16
|
.map((rect) => ((0, jsx_runtime_1.jsx)(react_native_1.Pressable, { accessibilityLabel: `${lane.label}: removed time`, onPress: (input) => {
|
|
16
17
|
input.stopPropagation();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column.js","sourceRoot":"","sources":["../../../../../../src/components/schedule/days/parts/column.tsx"],"names":[],"mappings":";;;;AAAA,iCAAiC;AACjC,+CAAyC;AACzC,iEAA6D;AAG7D,wBAA+B,EAC7B,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,KAAK,EACL,iBAAiB,EAAE,iBAAiB,EACpC,YAAY,EAAE,YAAY,EAC1B,eAAe,GACK;IACpB,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;SACpB,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SACzB,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACd,wBAAC,gBAAQ,eACN,KAAK;iBACH,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,EAAE,CAAC;iBAC3C,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACb,uBAAC,gBAAQ,cACP,uBAAC,iBAAiB,IAChB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"column.js","sourceRoot":"","sources":["../../../../../../src/components/schedule/days/parts/column.tsx"],"names":[],"mappings":";;;;AAAA,iCAAiC;AACjC,+CAAyC;AACzC,2CAA6C;AAC7C,iEAA6D;AAG7D,wBAA+B,EAC7B,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,KAAK,EACL,iBAAiB,EAAE,iBAAiB,EACpC,YAAY,EAAE,YAAY,EAC1B,eAAe,GACK;IACpB,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;SACpB,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SACzB,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACd,wBAAC,gBAAQ,eACN,KAAK;iBACH,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,EAAE,CAAC;iBAC3C,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACb,uBAAC,gBAAQ,cACP,uBAAC,iBAAiB,IAChB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,IAAA,gBAAS,EAAC,IAAI,CAAC,OAAO,EAAE,eAAe,CAAC,GACrD,IANW,YAAY,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAOvC,CACZ,CAAC,EACH,QAAQ;iBACN,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,EAAE,CAAC;iBAC3C,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACb,uBAAC,wBAAS,IAER,kBAAkB,EAAE,GAAG,IAAI,CAAC,KAAK,gBAAgB,EACjD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;oBACjB,KAAK,CAAC,eAAe,EAAE,CAAC;oBACxB,MAAM,KAAK,GAAG,IAAA,wBAAU,EAAC,KAAK,CAAC,CAAC;oBAChC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;gBAC5C,CAAC,EACD,KAAK,EAAE;oBACL,QAAQ,EAAE,UAAU;oBACpB,IAAI,EAAE,IAAI,CAAC,CAAC;oBACZ,GAAG,EAAE,IAAI,CAAC,CAAC;oBACX,KAAK,EAAE,IAAI,CAAC,KAAK;oBACjB,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,MAAM,EAAE,IAAI,CAAC,CAAC;iBACf,YAED,uBAAC,YAAY,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,GAAI,IAhBjD,OAAO,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAiBzB,CACb,CAAC,KAnCS,KAAK,CAAC,EAAE,CAoCZ,CACZ,CAAC,CAAC;AACP,CAAC"}
|
package/dist/src/core/index.d.ts
CHANGED
|
@@ -8,5 +8,6 @@ export { layoutLane } from './layout';
|
|
|
8
8
|
export type { LaneComparator } from './order';
|
|
9
9
|
export { byCoverage, byLabel } from './order';
|
|
10
10
|
export { snapToStep, timeAtX, timeAtY } from './snap';
|
|
11
|
+
export { hasSource } from './source';
|
|
11
12
|
export type { Coverage, DayColumn, Gap, Interval, Lane, LaneFlag, LaneGeometry, Layer, LayerRole, LayerStyle, Projection, Rect, Source, Transition, Weekday, Window, } from './types';
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,EA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,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;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,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.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.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;
|
|
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,4 +27,6 @@ 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
|
+
var source_1 = require("./source");
|
|
31
|
+
Object.defineProperty(exports, "hasSource", { enumerable: true, get: function () { return source_1.hasSource; } });
|
|
30
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -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,+BAAsD;AAA7C,kGAAA,UAAU,OAAA;AAAE,+FAAA,OAAO,OAAA;AAAE,+FAAA,OAAO,OAAA"}
|
|
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,+BAAsD;AAA7C,kGAAA,UAAU,OAAA;AAAE,+FAAA,OAAO,OAAA;AAAE,+FAAA,OAAO,OAAA;AACrC,mCAAqC;AAA5B,mGAAA,SAAS,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../src/core/source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,uEAAuE;AACvE,wBAAgB,SAAS,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAKzF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hasSource = hasSource;
|
|
4
|
+
/** Match source identity by kind and id, ignoring display metadata. */
|
|
5
|
+
function hasSource(sources, source) {
|
|
6
|
+
return (source !== undefined &&
|
|
7
|
+
sources.some((item) => item.kind === source.kind && item.id === source.id));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../../src/core/source.ts"],"names":[],"mappings":";;;AAEA,uEAAuE;AACvE,mBAA0B,OAA0B,EAAE,MAA0B;IAC9E,OAAO,CACL,MAAM,KAAK,SAAS;QACpB,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,CAAC,CAC3E,CAAC;AACJ,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type { GapInput, IntervalInput } from './components/layers/layers.types';
|
|
2
2
|
export { RosterGap } from './components/layers/parts/gap';
|
|
3
3
|
export { RosterInterval } from './components/layers/parts/interval';
|
|
4
|
+
export { Portal, PortalHost } from './components/primitives/portal';
|
|
4
5
|
export { Roster } from './components/roster';
|
|
5
6
|
export { RosterBodyLayout } from './components/roster/body-layout';
|
|
6
7
|
export { RosterLaneLabel } from './components/roster/lanes/parts/lane-label';
|
|
@@ -12,7 +13,9 @@ export { RosterHeader } from './components/roster/parts/header';
|
|
|
12
13
|
export { RosterHeaderCell } from './components/roster/parts/header-cell';
|
|
13
14
|
export { RosterLaneLabelColumn } from './components/roster/parts/lane-label-column';
|
|
14
15
|
export { RosterLaneList } from './components/roster/parts/lane-list';
|
|
15
|
-
export type { BodyInput, GridInput, HeaderCellInput, HeaderInput, LabelColumnInput, LaneLabelInput, RosterInput, RosterModel, RosterProjection, RosterProps, RosterScroll, RosterStyleProps, RosterTick, } from './components/roster/roster.types';
|
|
16
|
+
export type { BodyInput, GridInput, HeaderCellInput, HeaderInput, IntervalDetailInput, LabelColumnInput, LaneLabelInput, RosterInput, RosterModel, RosterProjection, RosterProps, RosterScroll, RosterStyleProps, RosterTick, } from './components/roster/roster.types';
|
|
17
|
+
export { RosterSelectionPopover } from './components/roster/selection/selection-layout';
|
|
18
|
+
export type { SelectionLayoutProps } from './components/roster/selection/selection-layout.types';
|
|
16
19
|
export { useRoster } from './components/roster/use-roster';
|
|
17
20
|
export { Schedule } from './components/schedule';
|
|
18
21
|
export { ScheduleColumn } from './components/schedule/days/parts/column';
|
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,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,YAAY,EACV,SAAS,EACT,SAAS,EACT,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,UAAU,GACX,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,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B,GACnB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,cAAc,QAAQ,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -14,11 +14,14 @@ 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.RosterLaneList = exports.RosterLaneLabelColumn = exports.RosterHeaderCell = exports.RosterHeader = exports.RosterGrid = exports.RosterEmpty = exports.RosterCorner = exports.RosterBody = exports.RosterLaneLabel = exports.RosterBodyLayout = exports.Roster = 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.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");
|
|
21
21
|
Object.defineProperty(exports, "RosterInterval", { enumerable: true, get: function () { return interval_1.RosterInterval; } });
|
|
22
|
+
var portal_1 = require("./components/primitives/portal");
|
|
23
|
+
Object.defineProperty(exports, "Portal", { enumerable: true, get: function () { return portal_1.Portal; } });
|
|
24
|
+
Object.defineProperty(exports, "PortalHost", { enumerable: true, get: function () { return portal_1.PortalHost; } });
|
|
22
25
|
var roster_1 = require("./components/roster");
|
|
23
26
|
Object.defineProperty(exports, "Roster", { enumerable: true, get: function () { return roster_1.Roster; } });
|
|
24
27
|
var body_layout_1 = require("./components/roster/body-layout");
|
|
@@ -41,6 +44,8 @@ var lane_label_column_1 = require("./components/roster/parts/lane-label-column")
|
|
|
41
44
|
Object.defineProperty(exports, "RosterLaneLabelColumn", { enumerable: true, get: function () { return lane_label_column_1.RosterLaneLabelColumn; } });
|
|
42
45
|
var lane_list_1 = require("./components/roster/parts/lane-list");
|
|
43
46
|
Object.defineProperty(exports, "RosterLaneList", { enumerable: true, get: function () { return lane_list_1.RosterLaneList; } });
|
|
47
|
+
var selection_layout_1 = require("./components/roster/selection/selection-layout");
|
|
48
|
+
Object.defineProperty(exports, "RosterSelectionPopover", { enumerable: true, get: function () { return selection_layout_1.RosterSelectionPopover; } });
|
|
44
49
|
var use_roster_1 = require("./components/roster/use-roster");
|
|
45
50
|
Object.defineProperty(exports, "useRoster", { enumerable: true, get: function () { return use_roster_1.useRoster; } });
|
|
46
51
|
var schedule_1 = require("./components/schedule");
|
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,8CAA6C;AAApC,gGAAA,MAAM,OAAA;AACf,+DAAmE;AAA1D,+GAAA,gBAAgB,OAAA;AACzB,yEAA6E;AAApE,6GAAA,eAAe,OAAA;AACxB,uDAA4D;AAA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qE;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"}
|
|
@@ -8,7 +8,10 @@ type Mapping<T> = {
|
|
|
8
8
|
/** Each class prop resolves into the style prop of the same chrome region. */
|
|
9
9
|
export declare const rosterClassNames: Mapping<RosterStyleProps>;
|
|
10
10
|
export declare const scheduleClassNames: Mapping<ScheduleStyleProps>;
|
|
11
|
-
export declare const Roster: import("react").ComponentType<import("../components/roster/roster.types").RosterInput & RosterStyleProps & {
|
|
11
|
+
export declare const Roster: import("react").ComponentType<Omit<import("../components/roster/roster.types").RosterInput, "selectable"> & RosterStyleProps & {
|
|
12
|
+
intervalDetailComponent?: import("react").ComponentType<import("../components/roster/roster.types").IntervalDetailInput>;
|
|
13
|
+
selectionLayout?: import("react").ComponentType<import("..").SelectionLayoutProps>;
|
|
14
|
+
portalHost?: string;
|
|
12
15
|
incompleteLabel?: string;
|
|
13
16
|
neverSetLabel?: string;
|
|
14
17
|
laneLabelComponent?: import("react").ComponentType<import("../components/roster/roster.types").LaneLabelInput>;
|
|
@@ -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,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,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA+C,CAAC"}
|
package/llms.txt
CHANGED
|
@@ -144,7 +144,7 @@ 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,
|
|
147
|
+
| react-native-roster | Roster, Schedule, hooks, default slot components, RosterSelectionPopover, PortalHost, Portal, and core re-exports. |
|
|
148
148
|
| react-native-roster/core | layoutLane, coverageFor, flagFor, windowFor, prev, next, today, dayColumnsFor, 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. |
|
|
@@ -186,7 +186,7 @@ outside React state.
|
|
|
186
186
|
|
|
187
187
|
useRoster returns window, projection, orderedLanes, coverage, laneState,
|
|
188
188
|
geometryFor(lane), scroll, press(lane,x,y), ticks, contentWidth, viewport,
|
|
189
|
-
onLayout, navigate, and status ('empty' or 'ready'). There is no visibleRange
|
|
189
|
+
onLayout, navigate, selection, dismissSelection, and status ('empty' or 'ready'). There is no visibleRange
|
|
190
190
|
field in the shipped public model. Custom layouts must wire onLayout. Custom
|
|
191
191
|
bodies compute geometry only for mounted lanes, preserving virtualization.
|
|
192
192
|
A zero-duration window has contentWidth=0 and renders no Roster body. Positive
|
|
@@ -233,6 +233,71 @@ Keep its viewport gate and measured estimatedListSize in custom compositions.
|
|
|
233
233
|
| `laneLabelColumnComponent` | `labels: LaneLabelInput[]`, `projection`, `scroll`, `laneLabelComponent` | `RosterLaneLabelColumn`: frozen labels following vertical offset. |
|
|
234
234
|
| `bodyComponent` | Ordered `lanes`, `window`, `geometryFor`, `projection`, `scroll`, `press`, `ticks`, `viewport`, `contentWidth`, highlight/hover, incomplete label, and rect components | `RosterBody`: virtualized lanes. |
|
|
235
235
|
|
|
236
|
+
## Selection
|
|
237
|
+
|
|
238
|
+
Roster only; Schedule does not yet support selection and will gain it in a later change.
|
|
239
|
+
intervalDetailComponent?: ComponentType<IntervalDetailInput> enables selection on interval
|
|
240
|
+
press while preserving onIntervalPress. Absent content retains no selection.
|
|
241
|
+
Pressing the selected interval again dismisses it; pressing another interval
|
|
242
|
+
switches selection. Cell and gap presses dismiss selection while still firing
|
|
243
|
+
`onCellPress` and `onGapPress`. These rules live in the hook and apply on native
|
|
244
|
+
and web; web outside press and Escape still dismiss.
|
|
245
|
+
IntervalDetailInput is IntervalInput plus absolute start and end and viewTimezone.
|
|
246
|
+
useRoster owns selection: {rect,layer,lane,start,end}|null and dismissSelection(). It resolves
|
|
247
|
+
current lane/layer/rect references and clears removed lane or absolute rect bounds.
|
|
248
|
+
Resizing and sorting retain valid selection with current geometry; reconciliation
|
|
249
|
+
uses the private reconcileSelection helper to match source identity sets and choose
|
|
250
|
+
nearest bounds with a total difference of at most 1 ms for projection roundoff.
|
|
251
|
+
selectable?: boolean belongs only to the hook input, RosterInput, and defaults to false.
|
|
252
|
+
It is excluded from RosterProps; hook consumers pass
|
|
253
|
+
selectable: true to retain selection. intervalDetailComponent, selectionLayout, and
|
|
254
|
+
portalHost belong to RosterProps because the chassis mounts content and the layout.
|
|
255
|
+
The chassis passes selectable: Boolean(intervalDetailComponent) to useRoster.
|
|
256
|
+
Custom chassis mount their content and layout using the returned model.
|
|
257
|
+
|
|
258
|
+
selectionLayout?: ComponentType<SelectionLayoutProps> defaults to the root-exported
|
|
259
|
+
RosterSelectionPopover. It is the explicit naming exception to the Component suffix.
|
|
260
|
+
The chassis mounts the strategy once around the body node, then passes that node
|
|
261
|
+
to RosterLayout.bodyZone. SelectionLayoutProps is exported: anchorZone and contentZone
|
|
262
|
+
are ReactNode; targetBounds is {x,y,width,height}|null in body-content coordinates, including
|
|
263
|
+
the lane offset and interval inset; open is
|
|
264
|
+
boolean; onDismiss is () => void; portalHost is string; scroll is Pick<RosterScroll, 'x' | 'y' | 'headerStyle' | 'labelStyle'>.
|
|
265
|
+
Layouts receive no lane, layer, or rect. Render anchorZone once and arrange contentZone
|
|
266
|
+
above or beside it. The interval-detail fixture demonstrates a runtime inspector toggle.
|
|
267
|
+
|
|
268
|
+
Native selection-layout.tsx uses the root-exported PortalHost and Portal from
|
|
269
|
+
components/primitives/portal.tsx, a module-level Map store with useSyncExternalStore.
|
|
270
|
+
The default layout owns a host named from the roster's useId; portalHost overrides
|
|
271
|
+
that name. Use distinct names for independent rosters and never mount the same host
|
|
272
|
+
twice. Custom layouts may target an ancestor host they own. Caller context does not
|
|
273
|
+
cross a store portal; provide context above the host or inside the portaled node.
|
|
274
|
+
Native hardware back dismisses details. The detail card flips above
|
|
275
|
+
when that fits, or uses the top edge when neither vertical placement fits. It clamps
|
|
276
|
+
left using measured viewport and content widths. Shared x/y values position the
|
|
277
|
+
overlay in viewport coordinates, never React scroll state. Selection identity
|
|
278
|
+
must not enter the body content key or cause mounted rows to render. The stable press
|
|
279
|
+
ref lives in use-roster-press.ts so React Compiler can retain derived body inputs in useRoster.
|
|
280
|
+
|
|
281
|
+
Native has no intercepting dismissal overlay; body presses reach the hook, and the detail
|
|
282
|
+
card captures its own presses. Web excludes the body wrapper from Radix outside
|
|
283
|
+
dismissal, leaving body presses to the hook while preserving true outside presses and Escape.
|
|
284
|
+
The hook toggles the selected interval closed, switches to another interval, and dismisses
|
|
285
|
+
on cell or gap presses while preserving their callbacks. The body restores horizontal
|
|
286
|
+
and vertical offsets from shared values on remount when selectionLayout changes.
|
|
287
|
+
A mount effect calls the horizontal ScrollView ref's scrollTo without animation;
|
|
288
|
+
native also retains contentOffset. LegendList restores initialScrollOffset through
|
|
289
|
+
its own web mount effect and native initial offset.
|
|
290
|
+
|
|
291
|
+
selection-layout.web.tsx uses @radix-ui/react-popover, required by the web root entry
|
|
292
|
+
but an optional peer for native/core-only consumers. Source web bundlers (Vite,
|
|
293
|
+
Storybook, or Metro web) require it even with selection disabled because the web
|
|
294
|
+
layout is in the module graph. Install with Bun. The emitted
|
|
295
|
+
browser remap must travel with the shared selection-layout.types.ts contract, just
|
|
296
|
+
like press-point and interval-hover. Its zero-size, pointer-transparent anchor follows
|
|
297
|
+
the shared translation; Radix's portal follows anchor movement and owns outside press,
|
|
298
|
+
Escape, and collisions. The layout returns focus to the previously focused element
|
|
299
|
+
only after Escape.
|
|
300
|
+
|
|
236
301
|
## Schedule zones
|
|
237
302
|
|
|
238
303
|
| Slot | Component inputs or node | Default and behavior |
|