@savvycal/calendar 0.9.1 → 0.10.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 +60 -41
- package/dist/components/day-grid-view/DayColumn.d.ts +5 -1
- package/dist/components/day-grid-view/DayColumn.d.ts.map +1 -1
- package/dist/components/day-grid-view/DayColumn.js +6 -48
- package/dist/components/day-grid-view/DayGridView.d.ts +1 -1
- package/dist/components/day-grid-view/DayGridView.d.ts.map +1 -1
- package/dist/components/day-grid-view/DayGridView.js +168 -155
- package/dist/components/day-grid-view/defaults.d.ts.map +1 -1
- package/dist/components/day-grid-view/defaults.js +7 -1
- package/dist/components/resource-grid-view/ResourceColumn.d.ts +5 -1
- package/dist/components/resource-grid-view/ResourceColumn.d.ts.map +1 -1
- package/dist/components/resource-grid-view/ResourceColumn.js +8 -49
- package/dist/components/resource-grid-view/ResourceGridView.d.ts +1 -1
- package/dist/components/resource-grid-view/ResourceGridView.d.ts.map +1 -1
- package/dist/components/resource-grid-view/ResourceGridView.js +182 -169
- package/dist/components/resource-grid-view/defaults.d.ts.map +1 -1
- package/dist/components/resource-grid-view/defaults.js +7 -1
- package/dist/components/shared/EventChip.d.ts.map +1 -1
- package/dist/components/shared/EventChip.js +42 -42
- package/dist/components/shared/OverflowChip.d.ts +13 -0
- package/dist/components/shared/OverflowChip.d.ts.map +1 -0
- package/dist/components/shared/OverflowChip.js +125 -0
- package/dist/components/shared/SlotInteractionLayer.d.ts.map +1 -1
- package/dist/components/shared/SlotInteractionLayer.js +138 -125
- package/dist/components/shared/TimedEventLayer.d.ts +26 -0
- package/dist/components/shared/TimedEventLayer.d.ts.map +1 -0
- package/dist/components/shared/TimedEventLayer.js +83 -0
- package/dist/components/shared/useColumnWidth.d.ts +5 -0
- package/dist/components/shared/useColumnWidth.d.ts.map +1 -0
- package/dist/components/shared/useColumnWidth.js +17 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/lib/autoScroll.d.ts +44 -0
- package/dist/lib/autoScroll.d.ts.map +1 -0
- package/dist/lib/autoScroll.js +78 -0
- package/dist/lib/overlap.d.ts +13 -0
- package/dist/lib/overlap.d.ts.map +1 -1
- package/dist/lib/overlap.js +216 -118
- package/dist/types/calendar.d.ts +56 -0
- package/dist/types/calendar.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { CalendarEvent, EventLayout, GridViewClassNames, OverflowClickInfo, OverflowPopoverRenderProps, PositionedEvent, TimedCalendarEvent } from '../../types/calendar';
|
|
3
|
+
interface TimedEventLayerProps {
|
|
4
|
+
positionedEvents: PositionedEvent[];
|
|
5
|
+
column: number;
|
|
6
|
+
timeZone: string;
|
|
7
|
+
cls: (key: keyof GridViewClassNames) => string;
|
|
8
|
+
fallbackColor?: string;
|
|
9
|
+
onEventClick?: (event: CalendarEvent) => void;
|
|
10
|
+
renderEvent?: (props: {
|
|
11
|
+
event: TimedCalendarEvent;
|
|
12
|
+
position: PositionedEvent;
|
|
13
|
+
}) => React.ReactNode;
|
|
14
|
+
eventGap?: number;
|
|
15
|
+
eventLayout?: EventLayout;
|
|
16
|
+
stackOffset?: number;
|
|
17
|
+
selectedEventId?: string | null;
|
|
18
|
+
selectedEventRef?: Ref<HTMLDivElement>;
|
|
19
|
+
eventMinWidth?: number;
|
|
20
|
+
eventMaxStack?: number;
|
|
21
|
+
onOverflowClick?: (info: OverflowClickInfo) => void;
|
|
22
|
+
renderOverflowPopover?: (props: OverflowPopoverRenderProps) => React.ReactNode;
|
|
23
|
+
}
|
|
24
|
+
export declare const TimedEventLayer: import('react').NamedExoticComponent<TimedEventLayerProps>;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=TimedEventLayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimedEventLayer.d.ts","sourceRoot":"","sources":["../../../src/components/shared/TimedE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L, useMemo as N } from "react";
|
|
3
|
+
import { applyEventOverflow as V, DEFAULT_EVENT_MIN_WIDTH as _, computeMaxVisibleColumns as j } from "../../lib/overlap.js";
|
|
4
|
+
import { EventChip as D } from "./EventChip.js";
|
|
5
|
+
import { OverflowChip as I } from "./OverflowChip.js";
|
|
6
|
+
import { useColumnWidth as O } from "./useColumnWidth.js";
|
|
7
|
+
const W = L(function({
|
|
8
|
+
positionedEvents: r,
|
|
9
|
+
column: p,
|
|
10
|
+
timeZone: m,
|
|
11
|
+
cls: o,
|
|
12
|
+
fallbackColor: v,
|
|
13
|
+
onEventClick: t,
|
|
14
|
+
renderEvent: d,
|
|
15
|
+
eventGap: u,
|
|
16
|
+
eventLayout: a,
|
|
17
|
+
stackOffset: c,
|
|
18
|
+
selectedEventId: E,
|
|
19
|
+
selectedEventRef: C,
|
|
20
|
+
eventMinWidth: i = _,
|
|
21
|
+
eventMaxStack: n,
|
|
22
|
+
onOverflowClick: w,
|
|
23
|
+
renderOverflowPopover: T
|
|
24
|
+
}) {
|
|
25
|
+
const { ref: h, width: s } = O(), { visible: x, overflows: y } = N(() => {
|
|
26
|
+
const e = j(
|
|
27
|
+
s,
|
|
28
|
+
i,
|
|
29
|
+
n
|
|
30
|
+
);
|
|
31
|
+
return V(r, e);
|
|
32
|
+
}, [r, s, i, n]);
|
|
33
|
+
return /* @__PURE__ */ b(
|
|
34
|
+
"div",
|
|
35
|
+
{
|
|
36
|
+
ref: h,
|
|
37
|
+
className: o("eventColumn"),
|
|
38
|
+
style: {
|
|
39
|
+
gridRow: "3 / -1",
|
|
40
|
+
gridColumn: p,
|
|
41
|
+
pointerEvents: "none",
|
|
42
|
+
isolation: "isolate"
|
|
43
|
+
},
|
|
44
|
+
children: [
|
|
45
|
+
x.map((e) => {
|
|
46
|
+
const l = e.event.id === E;
|
|
47
|
+
return /* @__PURE__ */ f(
|
|
48
|
+
D,
|
|
49
|
+
{
|
|
50
|
+
positioned: e,
|
|
51
|
+
fallbackColor: v,
|
|
52
|
+
timeZone: m,
|
|
53
|
+
cls: o,
|
|
54
|
+
onClick: t,
|
|
55
|
+
renderEvent: d,
|
|
56
|
+
eventGap: u,
|
|
57
|
+
eventLayout: a,
|
|
58
|
+
stackOffset: c,
|
|
59
|
+
isSelected: l,
|
|
60
|
+
selectedEventRef: l ? C : void 0
|
|
61
|
+
},
|
|
62
|
+
e.event.id
|
|
63
|
+
);
|
|
64
|
+
}),
|
|
65
|
+
y.map((e) => /* @__PURE__ */ f(
|
|
66
|
+
I,
|
|
67
|
+
{
|
|
68
|
+
group: e,
|
|
69
|
+
timeZone: m,
|
|
70
|
+
cls: o,
|
|
71
|
+
onEventClick: t,
|
|
72
|
+
onOverflowClick: w,
|
|
73
|
+
renderOverflowPopover: T
|
|
74
|
+
},
|
|
75
|
+
e.id
|
|
76
|
+
))
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
});
|
|
81
|
+
export {
|
|
82
|
+
W as TimedEventLayer
|
|
83
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useColumnWidth.d.ts","sourceRoot":"","sources":["../../../src/components/shared/useColumnWidth.ts"],"names":[],"mappings":"AAEA,wBAAgB,cAAc;;;EAoB7B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useRef as u, useState as c, useLayoutEffect as i } from "react";
|
|
2
|
+
function d() {
|
|
3
|
+
const t = u(null), [s, o] = c(0);
|
|
4
|
+
return i(() => {
|
|
5
|
+
const e = t.current;
|
|
6
|
+
if (!e) return;
|
|
7
|
+
function n() {
|
|
8
|
+
o(e.clientWidth);
|
|
9
|
+
}
|
|
10
|
+
n();
|
|
11
|
+
const r = new ResizeObserver(n);
|
|
12
|
+
return r.observe(e), () => r.disconnect();
|
|
13
|
+
}, []), { ref: t, width: s };
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
d as useColumnWidth
|
|
17
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { ResourceGridView } from './components/resource-grid-view';
|
|
|
3
3
|
export { DayGridView } from './components/day-grid-view';
|
|
4
4
|
export { resourceGridViewDefaults } from './components/resource-grid-view';
|
|
5
5
|
export { dayGridViewDefaults } from './components/day-grid-view';
|
|
6
|
-
export type { CalendarResource, CalendarEvent, TimedCalendarEvent, AllDayCalendarEvent, TimeSlot, AvailabilityRange, TimeAxisConfig, ResourceGridViewProps, ResourceGridViewClassNames, GridViewClassNames, DayGridViewProps, DayGridViewClassNames, DayGridSelectedRange, PositionedEvent, SelectedRange, SelectionAppearance, SelectionEventData, EventLayout, } from './types/calendar';
|
|
6
|
+
export type { CalendarResource, CalendarEvent, TimedCalendarEvent, AllDayCalendarEvent, TimeSlot, AvailabilityRange, TimeAxisConfig, ResourceGridViewProps, ResourceGridViewClassNames, GridViewClassNames, DayGridViewProps, DayGridViewClassNames, DayGridSelectedRange, PositionedEvent, OverflowClickInfo, OverflowPopoverRenderProps, SelectedRange, SelectionAppearance, SelectionEventData, EventLayout, } from './types/calendar';
|
|
7
7
|
export { cn } from './lib/utils';
|
|
8
8
|
export { timedEvent, allDayEvent } from './lib/events';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGjE,YAAY,EACV,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,QAAQ,EACR,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGjE,YAAY,EACV,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,QAAQ,EACR,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,0BAA0B,EAC1B,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** Distance from a scroll viewport edge that starts auto-scroll, in px. */
|
|
2
|
+
export declare const AUTO_SCROLL_EDGE_PX = 48;
|
|
3
|
+
/** Peak auto-scroll speed while the pointer is at or past an edge. */
|
|
4
|
+
export declare const AUTO_SCROLL_MAX_PX_PER_SECOND = 400;
|
|
5
|
+
/**
|
|
6
|
+
* Nearest ancestor that scrolls vertically (overflow-y auto/scroll/overlay).
|
|
7
|
+
* The calendar root is `overflow-auto`, so this is the grid's own scroller.
|
|
8
|
+
*/
|
|
9
|
+
export declare function findVerticalScrollParent(el: HTMLElement): HTMLElement | null;
|
|
10
|
+
/**
|
|
11
|
+
* Signed intensity in [-1, 1] for pointer-driven vertical auto-scroll.
|
|
12
|
+
* Negative scrolls up, positive scrolls down, 0 means the pointer is outside
|
|
13
|
+
* the edge zones. Intensity ramps from 0 at `edgePx` away from the edge to 1
|
|
14
|
+
* at the edge (and stays 1 past it). On a short viewport the zones are shrunk
|
|
15
|
+
* so they don't overlap; if they still meet, the closer edge wins.
|
|
16
|
+
*/
|
|
17
|
+
export declare function computeAutoScrollIntensity(pointerY: number, viewportTop: number, viewportBottom: number, edgePx?: number): number;
|
|
18
|
+
/**
|
|
19
|
+
* Scroll `scrollParent` by `intensity * maxPxPerSecond * deltaSeconds`.
|
|
20
|
+
* Returns the actual delta applied after clamping to the scroll range.
|
|
21
|
+
*/
|
|
22
|
+
export declare function applyVerticalAutoScroll(scrollParent: HTMLElement, intensity: number, deltaSeconds: number, maxPxPerSecond?: number): number;
|
|
23
|
+
export interface VerticalAutoScroller {
|
|
24
|
+
/** Start the rAF loop if it isn't already running. */
|
|
25
|
+
ensure: () => void;
|
|
26
|
+
/** Cancel the rAF loop. Safe to call more than once. */
|
|
27
|
+
stop: () => void;
|
|
28
|
+
}
|
|
29
|
+
interface CreateVerticalAutoScrollerOptions {
|
|
30
|
+
getPointerY: () => number;
|
|
31
|
+
getScrollParent: () => HTMLElement | null;
|
|
32
|
+
/** Called after the scroller actually moves, so the caller can remap the pointer. */
|
|
33
|
+
onScroll: () => void;
|
|
34
|
+
raf?: typeof requestAnimationFrame;
|
|
35
|
+
cancelRaf?: typeof cancelAnimationFrame;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* rAF loop that auto-scrolls while the pointer sits in an edge zone. The
|
|
39
|
+
* loop stops on its own when intensity hits 0 or the scroller can't move
|
|
40
|
+
* further; call `ensure()` again to resume.
|
|
41
|
+
*/
|
|
42
|
+
export declare function createVerticalAutoScroller({ getPointerY, getScrollParent, onScroll, raf, cancelRaf, }: CreateVerticalAutoScrollerOptions): VerticalAutoScroller;
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=autoScroll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autoScroll.d.ts","sourceRoot":"","sources":["../../src/lib/autoScroll.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC,sEAAsE;AACtE,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAMjD;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,WAAW,GAAG,WAAW,GAAG,IAAI,CAS5E;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,MAAM,GAAE,MAA4B,GACnC,MAAM,CAiBR;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,WAAW,EACzB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,cAAc,GAAE,MAAsC,GACrD,MAAM,CAYR;AAED,MAAM,WAAW,oBAAoB;IACnC,sDAAsD;IACtD,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,wDAAwD;IACxD,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAED,UAAU,iCAAiC;IACzC,WAAW,EAAE,MAAM,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;IAC1C,qFAAqF;IACrF,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,GAAG,CAAC,EAAE,OAAO,qBAAqB,CAAC;IACnC,SAAS,CAAC,EAAE,OAAO,oBAAoB,CAAC;CACzC;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,EACzC,WAAW,EACX,eAAe,EACf,QAAQ,EACR,GAA2B,EAC3B,SAAgC,GACjC,EAAE,iCAAiC,GAAG,oBAAoB,CAqD1D"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
const O = 48, d = 400;
|
|
2
|
+
function h(n) {
|
|
3
|
+
return n === "auto" || n === "scroll" || n === "overlay";
|
|
4
|
+
}
|
|
5
|
+
function E(n) {
|
|
6
|
+
let e = n.parentElement;
|
|
7
|
+
for (; e; ) {
|
|
8
|
+
if (h(getComputedStyle(e).overflowY))
|
|
9
|
+
return e;
|
|
10
|
+
e = e.parentElement;
|
|
11
|
+
}
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
function S(n, e, o, c = 48) {
|
|
15
|
+
const u = o - e;
|
|
16
|
+
if (u <= 0) return 0;
|
|
17
|
+
const t = Math.min(c, u / 2);
|
|
18
|
+
if (t <= 0) return 0;
|
|
19
|
+
const l = o - n, r = n - e;
|
|
20
|
+
return l < t && l <= r ? Math.min(1, (t - l) / t) : r < t ? -Math.min(1, (t - r) / t) : 0;
|
|
21
|
+
}
|
|
22
|
+
function p(n, e, o, c = 400) {
|
|
23
|
+
if (e === 0 || o <= 0) return 0;
|
|
24
|
+
const u = e * c * o, t = Math.max(
|
|
25
|
+
0,
|
|
26
|
+
n.scrollHeight - n.clientHeight
|
|
27
|
+
), l = n.scrollTop, r = Math.min(t, Math.max(0, l + u));
|
|
28
|
+
return n.scrollTop = r, r - l;
|
|
29
|
+
}
|
|
30
|
+
function M({
|
|
31
|
+
getPointerY: n,
|
|
32
|
+
getScrollParent: e,
|
|
33
|
+
onScroll: o,
|
|
34
|
+
raf: c = requestAnimationFrame,
|
|
35
|
+
cancelRaf: u = cancelAnimationFrame
|
|
36
|
+
}) {
|
|
37
|
+
let t = null, l = null, r = !1;
|
|
38
|
+
const s = (a) => {
|
|
39
|
+
if (r) return;
|
|
40
|
+
t = null;
|
|
41
|
+
const i = e();
|
|
42
|
+
if (!i) {
|
|
43
|
+
l = null;
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const f = i.getBoundingClientRect(), m = S(
|
|
47
|
+
n(),
|
|
48
|
+
f.top,
|
|
49
|
+
f.bottom
|
|
50
|
+
);
|
|
51
|
+
if (m === 0) {
|
|
52
|
+
l = null;
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const _ = l == null ? 1 / 60 : Math.min(0.05, (a - l) / 1e3);
|
|
56
|
+
if (l = a, p(i, m, _) === 0) {
|
|
57
|
+
l = null;
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
o(), t = c(s);
|
|
61
|
+
};
|
|
62
|
+
return {
|
|
63
|
+
ensure: () => {
|
|
64
|
+
r || t != null || (t = c(s));
|
|
65
|
+
},
|
|
66
|
+
stop: () => {
|
|
67
|
+
r = !0, t != null && (u(t), t = null), l = null;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
O as AUTO_SCROLL_EDGE_PX,
|
|
73
|
+
d as AUTO_SCROLL_MAX_PX_PER_SECOND,
|
|
74
|
+
p as applyVerticalAutoScroll,
|
|
75
|
+
S as computeAutoScrollIntensity,
|
|
76
|
+
M as createVerticalAutoScroller,
|
|
77
|
+
E as findVerticalScrollParent
|
|
78
|
+
};
|
package/dist/lib/overlap.d.ts
CHANGED
|
@@ -6,7 +6,15 @@ interface LayoutEntry {
|
|
|
6
6
|
endMin: number;
|
|
7
7
|
subColumn: number;
|
|
8
8
|
totalSubColumns: number;
|
|
9
|
+
colSpan: number;
|
|
9
10
|
}
|
|
11
|
+
export interface OverflowGroup {
|
|
12
|
+
id: string;
|
|
13
|
+
events: TimedCalendarEvent[];
|
|
14
|
+
top: number;
|
|
15
|
+
height: number;
|
|
16
|
+
}
|
|
17
|
+
export declare const DEFAULT_EVENT_MIN_WIDTH = 80;
|
|
10
18
|
export declare function groupByResource<T extends {
|
|
11
19
|
resourceId: string;
|
|
12
20
|
}>(items: T[]): Map<string, T[]>;
|
|
@@ -24,5 +32,10 @@ export interface PositionedAllDayEvent {
|
|
|
24
32
|
}
|
|
25
33
|
export declare function layoutAllDayEvents(events: AllDayCalendarEvent[], dates: Temporal.PlainDate[]): PositionedAllDayEvent[];
|
|
26
34
|
export declare function computePositionedEventsByDate(events: TimedCalendarEvent[], timeZone: string, dates: Temporal.PlainDate[], startHour: number, endHour: number, hourHeight: number): Map<string, PositionedEvent[]>;
|
|
35
|
+
export declare function computeMaxVisibleColumns(columnWidth: number, eventMinWidth: number, eventMaxStack?: number): number;
|
|
36
|
+
export declare function applyEventOverflow(positioned: PositionedEvent[], maxVisible: number): {
|
|
37
|
+
visible: PositionedEvent[];
|
|
38
|
+
overflows: OverflowGroup[];
|
|
39
|
+
};
|
|
27
40
|
export {};
|
|
28
41
|
//# sourceMappingURL=overlap.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlap.d.ts","sourceRoot":"","sources":["../../src/lib/overlap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAG1B,UAAU,WAAW;IACnB,KAAK,EAAE,kBAAkB,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"overlap.d.ts","sourceRoot":"","sources":["../../src/lib/overlap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,EACV,mBAAm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