@savvycal/calendar 0.9.0 → 0.10.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.
Files changed (39) hide show
  1. package/README.md +60 -41
  2. package/dist/components/day-grid-view/DayColumn.d.ts +5 -1
  3. package/dist/components/day-grid-view/DayColumn.d.ts.map +1 -1
  4. package/dist/components/day-grid-view/DayColumn.js +6 -48
  5. package/dist/components/day-grid-view/DayGridView.d.ts +1 -1
  6. package/dist/components/day-grid-view/DayGridView.d.ts.map +1 -1
  7. package/dist/components/day-grid-view/DayGridView.js +168 -155
  8. package/dist/components/day-grid-view/defaults.d.ts.map +1 -1
  9. package/dist/components/day-grid-view/defaults.js +7 -1
  10. package/dist/components/resource-grid-view/ResourceColumn.d.ts +5 -1
  11. package/dist/components/resource-grid-view/ResourceColumn.d.ts.map +1 -1
  12. package/dist/components/resource-grid-view/ResourceColumn.js +8 -49
  13. package/dist/components/resource-grid-view/ResourceGridView.d.ts +1 -1
  14. package/dist/components/resource-grid-view/ResourceGridView.d.ts.map +1 -1
  15. package/dist/components/resource-grid-view/ResourceGridView.js +182 -169
  16. package/dist/components/resource-grid-view/defaults.d.ts.map +1 -1
  17. package/dist/components/resource-grid-view/defaults.js +7 -1
  18. package/dist/components/shared/EventChip.d.ts.map +1 -1
  19. package/dist/components/shared/EventChip.js +42 -42
  20. package/dist/components/shared/OverflowChip.d.ts +13 -0
  21. package/dist/components/shared/OverflowChip.d.ts.map +1 -0
  22. package/dist/components/shared/OverflowChip.js +125 -0
  23. package/dist/components/shared/TimedEventLayer.d.ts +26 -0
  24. package/dist/components/shared/TimedEventLayer.d.ts.map +1 -0
  25. package/dist/components/shared/TimedEventLayer.js +83 -0
  26. package/dist/components/shared/UnavailabilityOverlay.d.ts.map +1 -1
  27. package/dist/components/shared/UnavailabilityOverlay.js +14 -13
  28. package/dist/components/shared/useColumnWidth.d.ts +5 -0
  29. package/dist/components/shared/useColumnWidth.d.ts.map +1 -0
  30. package/dist/components/shared/useColumnWidth.js +17 -0
  31. package/dist/components.css +5 -2
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/lib/overlap.d.ts +13 -0
  35. package/dist/lib/overlap.d.ts.map +1 -1
  36. package/dist/lib/overlap.js +216 -118
  37. package/dist/types/calendar.d.ts +56 -0
  38. package/dist/types/calendar.d.ts.map +1 -1
  39. package/package.json +2 -2
@@ -1,126 +1,130 @@
1
- import { jsxs as R, jsx as l } from "react/jsx-runtime";
2
- import { useMemo as u, useCallback as g, useRef as U, useState as $t, useEffect as q } from "react";
1
+ import { jsxs as U, jsx as l } from "react/jsx-runtime";
2
+ import { useMemo as u, useCallback as y, useRef as q, useState as kt, useEffect as J } from "react";
3
3
  import { Temporal as E } from "temporal-polyfill";
4
4
  import { cn as k } from "../../lib/utils.js";
5
- import { generateDateRange as vt, generateTimeSlots as Ct, formatDayOfWeek as J, formatTimeRange as Q } from "../../lib/time.js";
6
- import { layoutAllDayEvents as xt, computePositionedEventsByDate as Et } from "../../lib/overlap.js";
7
- import { computeUnavailableBlocks as kt } from "../../lib/availability.js";
8
- import { UnavailabilityOverlay as It } from "../shared/UnavailabilityOverlay.js";
9
- import { dayGridViewDefaults as Nt } from "./defaults.js";
10
- import { DayHeader as Lt } from "./DayHeader.js";
11
- import { DayColumn as jt } from "./DayColumn.js";
12
- import { TimeGutter as Mt } from "../shared/TimeGutter.js";
13
- import { SlotInteractionLayer as At } from "../shared/SlotInteractionLayer.js";
14
- import { SelectionOverlay as Bt } from "../shared/SelectionOverlay.js";
15
- import { NowIndicator as Gt } from "../shared/NowIndicator.js";
16
- import { AllDaySection as Ot } from "./AllDaySection.js";
17
- import { useEffectiveHourHeight as Pt } from "../shared/useEffectiveHourHeight.js";
18
- import { useInitialScroll as Wt } from "../shared/useInitialScroll.js";
19
- import { useAnnouncer as Kt } from "../shared/useAnnouncer.js";
20
- import { getEventLabel as X, getClientNameLabel as Y } from "../../lib/accessibility.js";
21
- function sr({
22
- activeRange: s,
5
+ import { generateDateRange as It, generateTimeSlots as Nt, formatDayOfWeek as Q, formatTimeRange as X } from "../../lib/time.js";
6
+ import { layoutAllDayEvents as Lt, computePositionedEventsByDate as jt } from "../../lib/overlap.js";
7
+ import { computeUnavailableBlocks as Mt } from "../../lib/availability.js";
8
+ import { UnavailabilityOverlay as Ot } from "../shared/UnavailabilityOverlay.js";
9
+ import { dayGridViewDefaults as At } from "./defaults.js";
10
+ import { DayHeader as Bt } from "./DayHeader.js";
11
+ import { DayColumn as Gt } from "./DayColumn.js";
12
+ import { TimeGutter as Pt } from "../shared/TimeGutter.js";
13
+ import { SlotInteractionLayer as Wt } from "../shared/SlotInteractionLayer.js";
14
+ import { SelectionOverlay as Kt } from "../shared/SelectionOverlay.js";
15
+ import { NowIndicator as Vt } from "../shared/NowIndicator.js";
16
+ import { AllDaySection as zt } from "./AllDaySection.js";
17
+ import { useEffectiveHourHeight as Ft } from "../shared/useEffectiveHourHeight.js";
18
+ import { useInitialScroll as Rt } from "../shared/useInitialScroll.js";
19
+ import { useAnnouncer as Ut } from "../shared/useAnnouncer.js";
20
+ import { getEventLabel as Y, getClientNameLabel as _ } from "../../lib/accessibility.js";
21
+ function fr({
22
+ activeRange: c,
23
23
  timeZone: n,
24
24
  events: I,
25
25
  availability: S,
26
26
  unavailability: T,
27
27
  defaultUnavailable: N,
28
28
  timeAxis: w,
29
- initialScrollHour: _,
29
+ initialScrollHour: Z,
30
30
  onEventClick: L,
31
31
  snapDuration: j,
32
- placeholderDuration: Z,
32
+ placeholderDuration: tt,
33
33
  selectedRange: f,
34
- onSelect: m,
34
+ onSelect: a,
35
35
  onSlotClick: H,
36
- className: tt,
36
+ className: rt,
37
37
  classNames: M,
38
- hourHeight: rt = 60,
39
- columnMinWidth: et = 120,
40
- renderHeader: ot,
38
+ hourHeight: et = 60,
39
+ columnMinWidth: ot = 120,
40
+ renderHeader: nt,
41
41
  renderEvent: b,
42
- selectionAppearance: nt,
43
- dragPreviewAppearance: it,
44
- selectionRef: lt,
45
- selectionLingerMs: $ = 0,
46
- selectedEventId: A,
47
- selectedEventRef: B,
48
- renderCorner: at,
49
- eventGap: st,
50
- eventLayout: ct = "columns",
51
- stackOffset: mt = 8
42
+ selectionAppearance: it,
43
+ dragPreviewAppearance: lt,
44
+ selectionRef: at,
45
+ selectionLingerMs: v = 0,
46
+ selectedEventId: O,
47
+ selectedEventRef: A,
48
+ renderCorner: st,
49
+ eventGap: ct,
50
+ eventLayout: mt = "columns",
51
+ stackOffset: dt = 8,
52
+ eventMinWidth: ut,
53
+ eventMaxStack: ft,
54
+ onOverflowClick: B,
55
+ renderOverflowPopover: pt
52
56
  }) {
53
- const a = w?.startHour ?? 0, c = w?.endHour ?? 24, v = w?.intervalMinutes ?? 60, o = u(
54
- () => vt(s.startDate, s.endDate),
55
- [s.startDate, s.endDate]
57
+ const s = w?.startHour ?? 0, m = w?.endHour ?? 24, $ = w?.intervalMinutes ?? 60, o = u(
58
+ () => It(c.startDate, c.endDate),
59
+ [c.startDate, c.endDate]
56
60
  ), G = u(() => E.Now.plainDateISO(n).toString(), [n]), {
57
61
  effectiveHourHeight: d,
58
- rootRef: O,
59
- headerRef: dt,
60
- allDayRef: ut,
61
- gridRef: ft,
62
- headerHeight: P,
63
- containerHeight: pt
64
- } = Pt(rt, c - a);
65
- Wt({
66
- rootRef: O,
67
- initialScrollHour: _,
68
- startHour: a,
69
- endHour: c,
62
+ rootRef: P,
63
+ headerRef: ht,
64
+ allDayRef: yt,
65
+ gridRef: Dt,
66
+ headerHeight: W,
67
+ containerHeight: gt
68
+ } = Ft(et, m - s);
69
+ Rt({
70
+ rootRef: P,
71
+ initialScrollHour: Z,
72
+ startHour: s,
73
+ endHour: m,
70
74
  effectiveHourHeight: d,
71
- containerHeight: pt,
72
- scrollKey: `${s.startDate.toString()}/${s.endDate.toString()}`
75
+ containerHeight: gt,
76
+ scrollKey: `${c.startDate.toString()}/${c.endDate.toString()}`
73
77
  });
74
- const i = g(
75
- (t) => k(Nt[t], M?.[t]),
78
+ const i = y(
79
+ (t) => k(At[t], M?.[t]),
76
80
  [M]
77
- ), y = U(null), p = U(null), [ht, W] = $t(null);
78
- q(() => {
81
+ ), D = q(null), p = q(null), [St, K] = kt(null);
82
+ J(() => {
79
83
  if (f)
80
- p.current !== null && (clearTimeout(p.current), p.current = null), y.current = f;
81
- else if (y.current && $ > 0) {
82
- const t = y.current;
83
- y.current = null, W(t), p.current = setTimeout(() => {
84
- p.current = null, W(null);
85
- }, $);
84
+ p.current !== null && (clearTimeout(p.current), p.current = null), D.current = f;
85
+ else if (D.current && v > 0) {
86
+ const t = D.current;
87
+ D.current = null, K(t), p.current = setTimeout(() => {
88
+ p.current = null, K(null);
89
+ }, v);
86
90
  }
87
- }, [f, $]);
88
- const D = f ?? ht, C = u(
89
- () => Ct({ startHour: a, endHour: c, intervalMinutes: v }),
90
- [a, c, v]
91
- ), { allDayEvents: K, timedEvents: V } = u(() => {
91
+ }, [f, v]);
92
+ const g = f ?? St, C = u(
93
+ () => Nt({ startHour: s, endHour: m, intervalMinutes: $ }),
94
+ [s, m, $]
95
+ ), { allDayEvents: V, timedEvents: z } = u(() => {
92
96
  const t = [], r = [];
93
97
  for (const e of I)
94
98
  e.allDay ? t.push(e) : r.push(e);
95
99
  return { allDayEvents: t, timedEvents: r };
96
- }, [I]), yt = u(
97
- () => xt(K, o),
98
- [K, o]
99
- ), Dt = u(
100
- () => Et(
101
- V,
100
+ }, [I]), Tt = u(
101
+ () => Lt(V, o),
102
+ [V, o]
103
+ ), wt = u(
104
+ () => jt(
105
+ z,
102
106
  n,
103
107
  o,
104
- a,
105
- c,
108
+ s,
109
+ m,
106
110
  d
107
111
  ),
108
- [V, n, o, a, c, d]
112
+ [z, n, o, s, m, d]
109
113
  ), x = u(
110
114
  () => N ? S ?? [] : S,
111
115
  [N, S]
112
- ), gt = u(() => {
116
+ ), Ht = u(() => {
113
117
  if (x === void 0 && !T)
114
118
  return /* @__PURE__ */ new Map();
115
119
  const t = /* @__PURE__ */ new Map();
116
120
  for (const r of o) {
117
- const e = kt(
121
+ const e = Mt(
118
122
  x,
119
123
  T,
120
124
  n,
121
125
  r,
122
- a,
123
- c,
126
+ s,
127
+ m,
124
128
  d
125
129
  );
126
130
  e.length > 0 && t.set(r.toString(), e);
@@ -131,42 +135,47 @@ function sr({
131
135
  T,
132
136
  n,
133
137
  o,
134
- a,
135
- c,
138
+ s,
139
+ m,
136
140
  d
137
- ]), { message: St, announce: h } = Kt(), Tt = u(() => {
138
- const t = J(s.startDate), r = J(s.endDate);
141
+ ]), { message: bt, announce: h } = Ut(), vt = u(() => {
142
+ const t = Q(c.startDate), r = Q(c.endDate);
139
143
  return `Schedule for ${t} to ${r}`;
140
- }, [s.startDate, s.endDate]), z = g(
144
+ }, [c.startDate, c.endDate]), F = y(
141
145
  (t) => {
142
- if (m?.(null), L?.(t), t.allDay) {
143
- const r = [X(t), "all day"], e = Y(t);
146
+ if (a?.(null), L?.(t), t.allDay) {
147
+ const r = [Y(t), "all day"], e = _(t);
144
148
  e && r.push(e), h(`Selected: ${r.join(", ")}`);
145
149
  } else {
146
150
  const r = [
147
- X(t),
148
- Q(t.startTime, t.endTime, n)
149
- ], e = Y(t);
151
+ Y(t),
152
+ X(t.startTime, t.endTime, n)
153
+ ], e = _(t);
150
154
  e && r.push(e), h(`Selected: ${r.join(", ")}`);
151
155
  }
152
156
  },
153
- [m, L, n, h]
154
- ), wt = g(
157
+ [a, L, n, h]
158
+ ), $t = y(
159
+ (t) => {
160
+ a?.(null), B?.(t);
161
+ },
162
+ [a, B]
163
+ ), Ct = y(
155
164
  (t) => {
156
165
  if (!t) {
157
- m?.(null);
166
+ a?.(null);
158
167
  return;
159
168
  }
160
169
  const r = {
161
170
  startTime: t.startTime,
162
171
  endTime: t.endTime
163
172
  };
164
- m?.(r);
165
- const e = [Q(t.startTime, t.endTime, n)];
173
+ a?.(r);
174
+ const e = [X(t.startTime, t.endTime, n)];
166
175
  h(`Selected time: ${e.join(", ")}`);
167
176
  },
168
- [m, n, h]
169
- ), Ht = g(
177
+ [a, n, h]
178
+ ), xt = y(
170
179
  (t) => {
171
180
  const r = E.PlainDate.from(t.columnId);
172
181
  H?.({
@@ -177,75 +186,75 @@ function sr({
177
186
  },
178
187
  [H]
179
188
  );
180
- q(() => {
181
- if (!f || !m) return;
189
+ J(() => {
190
+ if (!f || !a) return;
182
191
  const t = (r) => {
183
- r.key === "Escape" && m(null);
192
+ r.key === "Escape" && a(null);
184
193
  };
185
194
  return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
186
- }, [f, m]);
187
- const bt = d * v / 60, F = o.find((t) => t.toString() === G);
188
- return /* @__PURE__ */ R("div", { ref: O, className: k(i("root"), tt), children: [
189
- /* @__PURE__ */ R(
195
+ }, [f, a]);
196
+ const Et = d * $ / 60, R = o.find((t) => t.toString() === G);
197
+ return /* @__PURE__ */ U("div", { ref: P, className: k(i("root"), rt), children: [
198
+ /* @__PURE__ */ U(
190
199
  "div",
191
200
  {
192
- ref: ft,
201
+ ref: Dt,
193
202
  className: i("grid"),
194
203
  role: "region",
195
204
  "aria-roledescription": "calendar",
196
- "aria-label": Tt,
205
+ "aria-label": vt,
197
206
  style: {
198
207
  display: "grid",
199
- gridTemplateColumns: `max-content repeat(${o.length}, minmax(${et}px, 1fr))`,
200
- gridTemplateRows: `auto auto repeat(${C.length}, ${bt}px)`
208
+ gridTemplateColumns: `max-content repeat(${o.length}, minmax(${ot}px, 1fr))`,
209
+ gridTemplateRows: `auto auto repeat(${C.length}, ${Et}px)`
201
210
  },
202
211
  children: [
203
212
  /* @__PURE__ */ l(
204
213
  "div",
205
214
  {
206
- ref: dt,
215
+ ref: ht,
207
216
  className: i("cornerCell"),
208
217
  style: { gridRow: 1, gridColumn: 1 },
209
- children: at?.({ timeZone: n })
218
+ children: st?.({ timeZone: n })
210
219
  }
211
220
  ),
212
221
  o.map((t, r) => /* @__PURE__ */ l(
213
- Lt,
222
+ Bt,
214
223
  {
215
224
  date: t,
216
225
  isToday: t.toString() === G,
217
226
  column: r + 2,
218
227
  cls: i,
219
- renderHeader: ot
228
+ renderHeader: nt
220
229
  },
221
230
  t.toString()
222
231
  )),
223
232
  /* @__PURE__ */ l(
224
233
  "div",
225
234
  {
226
- ref: ut,
235
+ ref: yt,
227
236
  className: k(i("allDayCell"), "left-0 z-30"),
228
237
  style: {
229
238
  gridRow: 2,
230
239
  gridColumn: 1,
231
- top: P
240
+ top: W
232
241
  }
233
242
  }
234
243
  ),
235
244
  /* @__PURE__ */ l(
236
- Ot,
245
+ zt,
237
246
  {
238
- positioned: yt,
247
+ positioned: Tt,
239
248
  dates: o,
240
- headerHeight: P,
249
+ headerHeight: W,
241
250
  cls: i,
242
- onEventClick: z,
243
- selectedEventId: A,
244
- selectedEventRef: B
251
+ onEventClick: F,
252
+ selectedEventId: O,
253
+ selectedEventRef: A
245
254
  }
246
255
  ),
247
256
  C.map((t) => /* @__PURE__ */ l(
248
- Mt,
257
+ Pt,
249
258
  {
250
259
  label: t.label,
251
260
  row: t.index + 3,
@@ -272,9 +281,9 @@ function sr({
272
281
  ))
273
282
  ),
274
283
  o.map((t, r) => {
275
- const e = gt.get(t.toString());
284
+ const e = Ht.get(t.toString());
276
285
  return e ? /* @__PURE__ */ l(
277
- It,
286
+ Ot,
278
287
  {
279
288
  blocks: e,
280
289
  column: r + 2,
@@ -284,70 +293,74 @@ function sr({
284
293
  ) : null;
285
294
  }),
286
295
  j != null && o.map((t, r) => /* @__PURE__ */ l(
287
- At,
296
+ Wt,
288
297
  {
289
298
  columnId: t.toString(),
290
299
  column: r + 2,
291
300
  date: t,
292
301
  timeZone: n,
293
- startHour: a,
294
- endHour: c,
302
+ startHour: s,
303
+ endHour: m,
295
304
  hourHeight: d,
296
305
  snapDuration: j,
297
- placeholderDuration: Z ?? 15,
306
+ placeholderDuration: tt ?? 15,
298
307
  cls: i,
299
- onSlotClick: H ? Ht : void 0,
300
- onSelect: m ? wt : void 0,
301
- dragPreviewAppearance: it,
308
+ onSlotClick: H ? xt : void 0,
309
+ onSelect: a ? Ct : void 0,
310
+ dragPreviewAppearance: lt,
302
311
  renderEvent: b
303
312
  },
304
313
  `slot-${t.toString()}`
305
314
  )),
306
315
  o.map((t, r) => /* @__PURE__ */ l(
307
- jt,
316
+ Gt,
308
317
  {
309
- positionedEvents: Dt.get(t.toString()) ?? [],
318
+ positionedEvents: wt.get(t.toString()) ?? [],
310
319
  column: r + 2,
311
320
  timeZone: n,
312
321
  cls: i,
313
- onEventClick: z,
322
+ onEventClick: F,
314
323
  renderEvent: b,
315
- eventGap: st,
316
- eventLayout: ct,
317
- stackOffset: mt,
318
- selectedEventId: A,
319
- selectedEventRef: B
324
+ eventGap: ct,
325
+ eventLayout: mt,
326
+ stackOffset: dt,
327
+ selectedEventId: O,
328
+ selectedEventRef: A,
329
+ eventMinWidth: ut,
330
+ eventMaxStack: ft,
331
+ onOverflowClick: $t,
332
+ renderOverflowPopover: pt
320
333
  },
321
334
  t.toString()
322
335
  )),
323
- D != null && (() => {
324
- const t = D.startTime.withTimeZone(n).toPlainDate(), r = o.findIndex(
336
+ g != null && (() => {
337
+ const t = g.startTime.withTimeZone(n).toPlainDate(), r = o.findIndex(
325
338
  (e) => E.PlainDate.compare(e, t) === 0
326
339
  );
327
340
  return r === -1 ? null : /* @__PURE__ */ l(
328
- Bt,
341
+ Kt,
329
342
  {
330
- startTime: D.startTime,
331
- endTime: D.endTime,
343
+ startTime: g.startTime,
344
+ endTime: g.endTime,
332
345
  column: r + 2,
333
346
  viewDate: o[r],
334
347
  timeZone: n,
335
- startHour: a,
348
+ startHour: s,
336
349
  hourHeight: d,
337
350
  cls: i,
338
- appearance: nt,
339
- selectionRef: lt,
351
+ appearance: it,
352
+ selectionRef: at,
340
353
  renderEvent: b
341
354
  }
342
355
  );
343
356
  })(),
344
- F && /* @__PURE__ */ l(
345
- Gt,
357
+ R && /* @__PURE__ */ l(
358
+ Vt,
346
359
  {
347
- date: F,
360
+ date: R,
348
361
  timeZone: n,
349
- startHour: a,
350
- endHour: c,
362
+ startHour: s,
363
+ endHour: m,
351
364
  hourHeight: d,
352
365
  cls: i
353
366
  }
@@ -372,11 +385,11 @@ function sr({
372
385
  whiteSpace: "nowrap",
373
386
  borderWidth: 0
374
387
  },
375
- children: St
388
+ children: bt
376
389
  }
377
390
  )
378
391
  ] });
379
392
  }
380
393
  export {
381
- sr as DayGridView
394
+ fr as DayGridView
382
395
  };
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../src/components/day-grid-view/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAE9D,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,qBAAqB,CA2C/D,CAAC"}
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../src/components/day-grid-view/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAE9D,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,qBAAqB,CAqD/D,CAAC"}
@@ -28,7 +28,13 @@ const e = {
28
28
  allDayEvent: "rounded-md pl-2.5 pr-1.5 py-0.5 overflow-hidden cursor-pointer select-none text-left bg-cal-event-bg ring-1 ring-inset ring-cal-event-ring min-w-0",
29
29
  allDayEventSelected: "shadow-lg shadow-cal-event-shadow ring-cal-event-ring-selected",
30
30
  allDayEventColorBar: "absolute left-0 top-0 bottom-0 w-1",
31
- allDayEventTitle: "text-cal-text-body text-xs/4 font-medium truncate"
31
+ allDayEventTitle: "text-cal-text-body text-xs/4 font-medium truncate",
32
+ overflowChip: "absolute right-0.5 min-w-9 h-[22px] p-0 border-0 cursor-pointer select-none text-center rounded-md bg-cal-surface ring-1 ring-cal-event-ring shadow-lg shadow-cal-event-shadow hover:ring-cal-event-ring-selected",
33
+ overflowChipLabel: "block px-1 py-0.5 text-cal-text-body text-xs/4 font-medium",
34
+ overflowPopover: "w-64 rounded-lg bg-cal-surface p-1 shadow-lg shadow-cal-event-shadow ring-1 ring-cal-event-ring max-h-80 overflow-auto",
35
+ overflowPopoverEvent: "block w-full rounded-md px-2 py-1.5 text-left cursor-pointer hover:bg-cal-event-bg",
36
+ overflowPopoverTitle: "text-cal-text-body text-xs/4 font-medium truncate",
37
+ overflowPopoverTime: "text-cal-text-muted text-xs/4"
32
38
  };
33
39
  export {
34
40
  e as dayGridViewDefaults
@@ -1,5 +1,5 @@
1
1
  import { Ref } from 'react';
2
- import { CalendarEvent, CalendarResource, EventLayout, GridViewClassNames, PositionedEvent, TimedCalendarEvent } from '../../types/calendar';
2
+ import { CalendarEvent, CalendarResource, EventLayout, GridViewClassNames, OverflowClickInfo, OverflowPopoverRenderProps, PositionedEvent, TimedCalendarEvent } from '../../types/calendar';
3
3
  interface ResourceColumnProps {
4
4
  resource: CalendarResource;
5
5
  positionedEvents: PositionedEvent[];
@@ -16,6 +16,10 @@ interface ResourceColumnProps {
16
16
  stackOffset?: number;
17
17
  selectedEventId?: string | null;
18
18
  selectedEventRef?: Ref<HTMLDivElement>;
19
+ eventMinWidth?: number;
20
+ eventMaxStack?: number;
21
+ onOverflowClick?: (info: OverflowClickInfo) => void;
22
+ renderOverflowPopover?: (props: OverflowPopoverRenderProps) => React.ReactNode;
19
23
  }
20
24
  export declare const ResourceColumn: import('react').NamedExoticComponent<ResourceColumnProps>;
21
25
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"ResourceColumn.d.ts","sourceRoot":"","sources":["../../../src/components/resource-grid-view/ResourceColumn.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EACnB,MAAM,kBAAkB,CAAC;AAG1B,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,kBAAkB,KAAK,MAAM,CAAC;IAC/C,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC9C,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE;QACpB,KAAK,EAAE,kBAAkB,CAAC;QAC1B,QAAQ,EAAE,eAAe,CAAC;KAC3B,KAAK,KAAK,CAAC,SAAS,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,gBAAgB,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CACxC;AAED,eAAO,MAAM,cAAc,2DA6CzB,CAAC"}
1
+ {"version":3,"file":"ResourceColumn.d.ts","sourceRoot":"","sources":["../../../src/components/resource-grid-view/ResourceColumn.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,0BAA0B,EAC1B,eAAe,EACf,kBAAkB,EACnB,MAAM,kBAAkB,CAAC;AAG1B,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,kBAAkB,KAAK,MAAM,CAAC;IAC/C,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC9C,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE;QACpB,KAAK,EAAE,kBAAkB,CAAC;QAC1B,QAAQ,EAAE,eAAe,CAAC;KAC3B,KAAK,KAAK,CAAC,SAAS,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,gBAAgB,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACpD,qBAAqB,CAAC,EAAE,CACtB,KAAK,EAAE,0BAA0B,KAC9B,KAAK,CAAC,SAAS,CAAC;CACtB;AAED,eAAO,MAAM,cAAc,2DAKzB,CAAC"}
@@ -1,53 +1,12 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { memo as f } from "react";
3
- import { EventChip as p } from "../shared/EventChip.js";
4
- const k = f(function({
5
- resource: t,
6
- positionedEvents: l,
7
- column: i,
8
- timeZone: m,
9
- cls: o,
10
- onEventClick: c,
11
- renderEvent: s,
12
- eventGap: u,
13
- eventLayout: v,
14
- stackOffset: a,
15
- selectedEventId: d,
16
- selectedEventRef: C
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { memo as e } from "react";
3
+ import { TimedEventLayer as t } from "../shared/TimedEventLayer.js";
4
+ const f = e(function({
5
+ resource: o,
6
+ ...r
17
7
  }) {
18
- return /* @__PURE__ */ r(
19
- "div",
20
- {
21
- className: o("eventColumn"),
22
- style: {
23
- gridRow: "3 / -1",
24
- gridColumn: i,
25
- pointerEvents: "none",
26
- isolation: "isolate"
27
- },
28
- children: l.map((e) => {
29
- const n = e.event.id === d;
30
- return /* @__PURE__ */ r(
31
- p,
32
- {
33
- positioned: e,
34
- fallbackColor: t.color,
35
- timeZone: m,
36
- cls: o,
37
- onClick: c,
38
- renderEvent: s,
39
- eventGap: u,
40
- eventLayout: v,
41
- stackOffset: a,
42
- isSelected: n,
43
- selectedEventRef: n ? C : void 0
44
- },
45
- e.event.id
46
- );
47
- })
48
- }
49
- );
8
+ return /* @__PURE__ */ m(t, { ...r, fallbackColor: o.color });
50
9
  });
51
10
  export {
52
- k as ResourceColumn
11
+ f as ResourceColumn
53
12
  };
@@ -1,3 +1,3 @@
1
1
  import { ResourceGridViewProps } from '../../types/calendar';
2
- export declare function ResourceGridView({ date, timeZone, resources, events, availability, unavailability, defaultUnavailable, timeAxis, initialScrollHour, onEventClick, snapDuration, placeholderDuration, selectedRange, onSelect, onSlotClick, className, classNames, hourHeight, columnMinWidth, renderHeader, renderEvent, selectionAppearance, dragPreviewAppearance, selectionRef, selectionLingerMs, selectedEventId, selectedEventRef, renderCorner, eventGap, eventLayout, stackOffset, }: ResourceGridViewProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function ResourceGridView({ date, timeZone, resources, events, availability, unavailability, defaultUnavailable, timeAxis, initialScrollHour, onEventClick, snapDuration, placeholderDuration, selectedRange, onSelect, onSlotClick, className, classNames, hourHeight, columnMinWidth, renderHeader, renderEvent, selectionAppearance, dragPreviewAppearance, selectionRef, selectionLingerMs, selectedEventId, selectedEventRef, renderCorner, eventGap, eventLayout, stackOffset, eventMinWidth, eventMaxStack, onOverflowClick, renderOverflowPopover, }: ResourceGridViewProps): import("react/jsx-runtime").JSX.Element;
3
3
  //# sourceMappingURL=ResourceGridView.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ResourceGridView.d.ts","sourceRoot":"","sources":["../../../src/components/resource-grid-view/ResourceGridView.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAIV,qBAAqB,EAGtB,MAAM,kBAAkB,CAAC;AAe1B,wBAAgB,gBAAgB,CAAC,EAC/B,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,MAAM,EACN,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,QAAQ,EACR,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,QAAQ,EACR,WAAW,EACX,SAAS,EACT,UAAU,EACV,UAAe,EACf,cAAoB,EACpB,YAAY,EACZ,WAAW,EACX,mBAAmB,EACnB,qBAAqB,EACrB,YAAY,EACZ,iBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACR,WAAuB,EACvB,WAAe,GAChB,EAAE,qBAAqB,2CA0bvB"}
1
+ {"version":3,"file":"ResourceGridView.d.ts","sourceRoot":"","sources":["../../../src/components/resource-grid-view/ResourceGridView.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAIV,qBAAqB,EAGtB,MAAM,kBAAkB,CAAC;AAe1B,wBAAgB,gBAAgB,CAAC,EAC/B,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,MAAM,EACN,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,QAAQ,EACR,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,QAAQ,EACR,WAAW,EACX,SAAS,EACT,UAAU,EACV,UAAe,EACf,cAAoB,EACpB,YAAY,EACZ,WAAW,EACX,mBAAmB,EACnB,qBAAqB,EACrB,YAAY,EACZ,iBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACR,WAAuB,EACvB,WAAe,EACf,aAAa,EACb,aAAa,EACb,eAAe,EACf,qBAAqB,GACtB,EAAE,qBAAqB,2CAwcvB"}