@savvycal/calendar 0.8.1 → 0.9.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 CHANGED
@@ -74,9 +74,10 @@ function App() {
74
74
 
75
75
  ### Time axis
76
76
 
77
- | Prop | Type | Default | Description |
78
- | ---------- | ---------------- | ---------------------------------------------------- | ---------------------------------------------------- |
79
- | `timeAxis` | `TimeAxisConfig` | `{ startHour: 0, endHour: 24, intervalMinutes: 60 }` | Controls the visible hour range and gutter interval. |
77
+ | Prop | Type | Default | Description |
78
+ | ------------------- | ---------------- | ---------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
79
+ | `timeAxis` | `TimeAxisConfig` | `{ startHour: 0, endHour: 24, intervalMinutes: 60 }` | Controls the visible hour range and gutter interval. |
80
+ | `initialScrollHour` | `number` | — | Hour of day (in the grid's time zone) to scroll into view on initial mount and whenever the active date/range changes. Fractional hours are allowed (e.g. `6.5` = 6:30 AM) and the value is clamped to the `timeAxis` range. Omit to keep the default (scrolled to top). Does not fight the user's manual scrolling or re-scroll on unrelated re-renders. |
80
81
 
81
82
  ### Layout
82
83
 
@@ -167,37 +168,37 @@ function App() {
167
168
 
168
169
  #### Required
169
170
 
170
- | Prop | Type | Description |
171
- | ------------- | ------------------------------------------------- | ------------------------------------------------------ |
172
- | `activeRange` | `{ startDate: PlainDate; endDate: PlainDate }` | The date range to display (inclusive). |
173
- | `timeZone` | `string` | IANA time zone identifier (e.g. `"America/Chicago"`). |
174
- | `events` | `CalendarEvent[]` | Array of timed and/or all-day events. |
171
+ | Prop | Type | Description |
172
+ | ------------- | ---------------------------------------------- | ----------------------------------------------------- |
173
+ | `activeRange` | `{ startDate: PlainDate; endDate: PlainDate }` | The date range to display (inclusive). |
174
+ | `timeZone` | `string` | IANA time zone identifier (e.g. `"America/Chicago"`). |
175
+ | `events` | `CalendarEvent[]` | Array of timed and/or all-day events. |
175
176
 
176
177
  #### Availability
177
178
 
178
- | Prop | Type | Default | Description |
179
- | --------------------- | --------------------- | ------- | ------------------------------------------------------------------------------------------------ |
180
- | `availability` | `AvailabilityRange[]` | — | Time ranges that are available. Times outside these ranges are shown as unavailable. |
181
- | `unavailability` | `AvailabilityRange[]` | — | Time ranges explicitly marked unavailable. Applied on top of availability. |
182
- | `defaultUnavailable` | `boolean` | — | When `true` and no `availability` ranges are provided, the entire grid is shown as unavailable. |
179
+ | Prop | Type | Default | Description |
180
+ | -------------------- | --------------------- | ------- | ----------------------------------------------------------------------------------------------- |
181
+ | `availability` | `AvailabilityRange[]` | — | Time ranges that are available. Times outside these ranges are shown as unavailable. |
182
+ | `unavailability` | `AvailabilityRange[]` | — | Time ranges explicitly marked unavailable. Applied on top of availability. |
183
+ | `defaultUnavailable` | `boolean` | — | When `true` and no `availability` ranges are provided, the entire grid is shown as unavailable. |
183
184
 
184
185
  #### Layout, events & interaction
185
186
 
186
- The following props work identically to `ResourceGridView`: `timeAxis`, `hourHeight`, `columnMinWidth`, `eventLayout`, `eventGap`, `stackOffset`, `className`, `classNames` (uses `DayGridViewClassNames`), `onEventClick`, `snapDuration`, `placeholderDuration`, `selectionAppearance`, `dragPreviewAppearance`, `selectedEventId`, `selectedEventRef`.
187
+ The following props work identically to `ResourceGridView`: `timeAxis`, `initialScrollHour`, `hourHeight`, `columnMinWidth`, `eventLayout`, `eventGap`, `stackOffset`, `className`, `classNames` (uses `DayGridViewClassNames`), `onEventClick`, `snapDuration`, `placeholderDuration`, `selectionAppearance`, `dragPreviewAppearance`, `selectedEventId`, `selectedEventRef`.
187
188
 
188
189
  #### Selection
189
190
 
190
- | Prop | Type | Description |
191
- | --------------- | ------------------------------------------------- | ----------------------------------------------- |
192
- | `selectedRange` | `DayGridSelectedRange \| null` | The currently selected time range (controlled). |
193
- | `onSelect` | `(range: DayGridSelectedRange \| null) => void` | Called when the user selects or clears a range. |
194
- | `selectionRef` | `Ref<HTMLDivElement>` | Ref attached to the selection overlay element. |
191
+ | Prop | Type | Description |
192
+ | --------------- | ----------------------------------------------- | ----------------------------------------------- |
193
+ | `selectedRange` | `DayGridSelectedRange \| null` | The currently selected time range (controlled). |
194
+ | `onSelect` | `(range: DayGridSelectedRange \| null) => void` | Called when the user selects or clears a range. |
195
+ | `selectionRef` | `Ref<HTMLDivElement>` | Ref attached to the selection overlay element. |
195
196
 
196
197
  #### Slot click
197
198
 
198
- | Prop | Type | Description |
199
- | ------------- | ---------------------------------------------------------- | --------------------------------------- |
200
- | `onSlotClick` | `(info: { date, startTime, endTime }) => void` | Called when an empty time slot is clicked. Receives the `date` (PlainDate) and time range. |
199
+ | Prop | Type | Description |
200
+ | ------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------------ |
201
+ | `onSlotClick` | `(info: { date, startTime, endTime }) => void` | Called when an empty time slot is clicked. Receives the `date` (PlainDate) and time range. |
201
202
 
202
203
  #### Render props
203
204
 
@@ -220,11 +221,11 @@ interface DayGridSelectedRange {
220
221
 
221
222
  Extends `GridViewClassNames` with day-specific keys:
222
223
 
223
- | Key | Description |
224
- | ------------------ | ------------------------------------------- |
225
- | `headerWeekday` | Weekday abbreviation text (e.g. "Mon"). |
226
- | `headerDayNumber` | Day number text. |
227
- | `headerToday` | Additional classes for today's day number. |
224
+ | Key | Description |
225
+ | ----------------- | ------------------------------------------ |
226
+ | `headerWeekday` | Weekday abbreviation text (e.g. "Mon"). |
227
+ | `headerDayNumber` | Day number text. |
228
+ | `headerToday` | Additional classes for today's day number. |
228
229
 
229
230
  All shared keys from `GridViewClassNames` (root, grid, event, etc.) also apply.
230
231
 
@@ -1,3 +1,3 @@
1
1
  import { DayGridViewProps } from '../../types/calendar';
2
- export declare function DayGridView({ activeRange, timeZone, events, availability, unavailability, defaultUnavailable, timeAxis, onEventClick, snapDuration, placeholderDuration, selectedRange, onSelect, onSlotClick, className, classNames, hourHeight, columnMinWidth, renderHeader, renderEvent, selectionAppearance, dragPreviewAppearance, selectionRef, selectionLingerMs, selectedEventId, selectedEventRef, renderCorner, eventGap, eventLayout, stackOffset, }: DayGridViewProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function DayGridView({ activeRange, timeZone, 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, }: DayGridViewProps): import("react/jsx-runtime").JSX.Element;
3
3
  //# sourceMappingURL=DayGridView.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DayGridView.d.ts","sourceRoot":"","sources":["../../../src/components/day-grid-view/DayGridView.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAKV,gBAAgB,EAEjB,MAAM,kBAAkB,CAAC;AAc1B,wBAAgB,WAAW,CAAC,EAC1B,WAAW,EACX,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,QAAQ,EACR,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,gBAAgB,2CAgalB"}
1
+ {"version":3,"file":"DayGridView.d.ts","sourceRoot":"","sources":["../../../src/components/day-grid-view/DayGridView.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAKV,gBAAgB,EAEjB,MAAM,kBAAkB,CAAC;AAe1B,wBAAgB,WAAW,CAAC,EAC1B,WAAW,EACX,QAAQ,EACR,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,gBAAgB,2CA2alB"}
@@ -1,114 +1,127 @@
1
- import { jsxs as F, jsx as a } from "react/jsx-runtime";
2
- import { useMemo as m, useCallback as D, useRef as K, useState as Ht, useEffect as U } from "react";
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";
3
3
  import { Temporal as E } from "temporal-polyfill";
4
4
  import { cn as k } from "../../lib/utils.js";
5
- import { generateDateRange as bt, generateTimeSlots as vt, formatDayOfWeek as q, formatTimeRange as J } from "../../lib/time.js";
6
- import { layoutAllDayEvents as Ct, computePositionedEventsByDate as $t } from "../../lib/overlap.js";
7
- import { computeUnavailableBlocks as xt } from "../../lib/availability.js";
8
- import { UnavailabilityOverlay as Et } from "../shared/UnavailabilityOverlay.js";
9
- import { dayGridViewDefaults as kt } from "./defaults.js";
10
- import { DayHeader as Nt } from "./DayHeader.js";
11
- import { DayColumn as It } from "./DayColumn.js";
12
- import { TimeGutter as Lt } from "../shared/TimeGutter.js";
13
- import { SlotInteractionLayer as jt } from "../shared/SlotInteractionLayer.js";
14
- import { SelectionOverlay as Mt } from "../shared/SelectionOverlay.js";
15
- import { NowIndicator as At } from "../shared/NowIndicator.js";
16
- import { AllDaySection as Bt } from "./AllDaySection.js";
17
- import { useEffectiveHourHeight as Gt } from "../shared/useEffectiveHourHeight.js";
18
- import { useAnnouncer as Ot } from "../shared/useAnnouncer.js";
19
- import { getEventLabel as Q, getClientNameLabel as X } from "../../lib/accessibility.js";
20
- function nr({
21
- activeRange: d,
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,
22
23
  timeZone: n,
23
- events: N,
24
+ events: I,
24
25
  availability: S,
25
26
  unavailability: T,
26
- defaultUnavailable: I,
27
+ defaultUnavailable: N,
27
28
  timeAxis: w,
29
+ initialScrollHour: _,
28
30
  onEventClick: L,
29
31
  snapDuration: j,
30
- placeholderDuration: Y,
32
+ placeholderDuration: Z,
31
33
  selectedRange: f,
32
- onSelect: s,
34
+ onSelect: m,
33
35
  onSlotClick: H,
34
- className: _,
36
+ className: tt,
35
37
  classNames: M,
36
- hourHeight: Z = 60,
37
- columnMinWidth: tt = 120,
38
- renderHeader: rt,
38
+ hourHeight: rt = 60,
39
+ columnMinWidth: et = 120,
40
+ renderHeader: ot,
39
41
  renderEvent: b,
40
- selectionAppearance: et,
41
- dragPreviewAppearance: ot,
42
- selectionRef: nt,
43
- selectionLingerMs: v = 0,
42
+ selectionAppearance: nt,
43
+ dragPreviewAppearance: it,
44
+ selectionRef: lt,
45
+ selectionLingerMs: $ = 0,
44
46
  selectedEventId: A,
45
47
  selectedEventRef: B,
46
- renderCorner: it,
47
- eventGap: at,
48
- eventLayout: lt = "columns",
49
- stackOffset: st = 8
48
+ renderCorner: at,
49
+ eventGap: st,
50
+ eventLayout: ct = "columns",
51
+ stackOffset: mt = 8
50
52
  }) {
51
- const l = w?.startHour ?? 0, c = w?.endHour ?? 24, C = w?.intervalMinutes ?? 60, o = m(
52
- () => bt(d.startDate, d.endDate),
53
- [d.startDate, d.endDate]
54
- ), G = m(() => E.Now.plainDateISO(n).toString(), [n]), {
55
- effectiveHourHeight: u,
56
- rootRef: ct,
57
- headerRef: mt,
58
- allDayRef: dt,
59
- gridRef: ut,
60
- headerHeight: O
61
- } = Gt(Z, c - l), i = D(
62
- (t) => k(kt[t], M?.[t]),
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]
56
+ ), G = u(() => E.Now.plainDateISO(n).toString(), [n]), {
57
+ 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,
70
+ effectiveHourHeight: d,
71
+ containerHeight: pt,
72
+ scrollKey: `${s.startDate.toString()}/${s.endDate.toString()}`
73
+ });
74
+ const i = g(
75
+ (t) => k(Nt[t], M?.[t]),
63
76
  [M]
64
- ), y = K(null), p = K(null), [ft, P] = Ht(null);
65
- U(() => {
77
+ ), y = U(null), p = U(null), [ht, W] = $t(null);
78
+ q(() => {
66
79
  if (f)
67
80
  p.current !== null && (clearTimeout(p.current), p.current = null), y.current = f;
68
- else if (y.current && v > 0) {
81
+ else if (y.current && $ > 0) {
69
82
  const t = y.current;
70
- y.current = null, P(t), p.current = setTimeout(() => {
71
- p.current = null, P(null);
72
- }, v);
83
+ y.current = null, W(t), p.current = setTimeout(() => {
84
+ p.current = null, W(null);
85
+ }, $);
73
86
  }
74
- }, [f, v]);
75
- const g = f ?? ft, $ = m(
76
- () => vt({ startHour: l, endHour: c, intervalMinutes: C }),
77
- [l, c, C]
78
- ), { allDayEvents: W, timedEvents: R } = m(() => {
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(() => {
79
92
  const t = [], r = [];
80
- for (const e of N)
93
+ for (const e of I)
81
94
  e.allDay ? t.push(e) : r.push(e);
82
95
  return { allDayEvents: t, timedEvents: r };
83
- }, [N]), pt = m(
84
- () => Ct(W, o),
85
- [W, o]
86
- ), ht = m(
87
- () => $t(
88
- R,
96
+ }, [I]), yt = u(
97
+ () => xt(K, o),
98
+ [K, o]
99
+ ), Dt = u(
100
+ () => Et(
101
+ V,
89
102
  n,
90
103
  o,
91
- l,
104
+ a,
92
105
  c,
93
- u
106
+ d
94
107
  ),
95
- [R, n, o, l, c, u]
96
- ), x = m(
97
- () => I ? S ?? [] : S,
98
- [I, S]
99
- ), yt = m(() => {
108
+ [V, n, o, a, c, d]
109
+ ), x = u(
110
+ () => N ? S ?? [] : S,
111
+ [N, S]
112
+ ), gt = u(() => {
100
113
  if (x === void 0 && !T)
101
114
  return /* @__PURE__ */ new Map();
102
115
  const t = /* @__PURE__ */ new Map();
103
116
  for (const r of o) {
104
- const e = xt(
117
+ const e = kt(
105
118
  x,
106
119
  T,
107
120
  n,
108
121
  r,
109
- l,
122
+ a,
110
123
  c,
111
- u
124
+ d
112
125
  );
113
126
  e.length > 0 && t.set(r.toString(), e);
114
127
  }
@@ -118,42 +131,42 @@ function nr({
118
131
  T,
119
132
  n,
120
133
  o,
121
- l,
134
+ a,
122
135
  c,
123
- u
124
- ]), { message: gt, announce: h } = Ot(), Dt = m(() => {
125
- const t = q(d.startDate), r = q(d.endDate);
136
+ d
137
+ ]), { message: St, announce: h } = Kt(), Tt = u(() => {
138
+ const t = J(s.startDate), r = J(s.endDate);
126
139
  return `Schedule for ${t} to ${r}`;
127
- }, [d.startDate, d.endDate]), V = D(
140
+ }, [s.startDate, s.endDate]), z = g(
128
141
  (t) => {
129
- if (s?.(null), L?.(t), t.allDay) {
130
- const r = [Q(t), "all day"], e = X(t);
142
+ if (m?.(null), L?.(t), t.allDay) {
143
+ const r = [X(t), "all day"], e = Y(t);
131
144
  e && r.push(e), h(`Selected: ${r.join(", ")}`);
132
145
  } else {
133
146
  const r = [
134
- Q(t),
135
- J(t.startTime, t.endTime, n)
136
- ], e = X(t);
147
+ X(t),
148
+ Q(t.startTime, t.endTime, n)
149
+ ], e = Y(t);
137
150
  e && r.push(e), h(`Selected: ${r.join(", ")}`);
138
151
  }
139
152
  },
140
- [s, L, n, h]
141
- ), St = D(
153
+ [m, L, n, h]
154
+ ), wt = g(
142
155
  (t) => {
143
156
  if (!t) {
144
- s?.(null);
157
+ m?.(null);
145
158
  return;
146
159
  }
147
160
  const r = {
148
161
  startTime: t.startTime,
149
162
  endTime: t.endTime
150
163
  };
151
- s?.(r);
152
- const e = [J(t.startTime, t.endTime, n)];
164
+ m?.(r);
165
+ const e = [Q(t.startTime, t.endTime, n)];
153
166
  h(`Selected time: ${e.join(", ")}`);
154
167
  },
155
- [s, n, h]
156
- ), Tt = D(
168
+ [m, n, h]
169
+ ), Ht = g(
157
170
  (t) => {
158
171
  const r = E.PlainDate.from(t.columnId);
159
172
  H?.({
@@ -164,75 +177,75 @@ function nr({
164
177
  },
165
178
  [H]
166
179
  );
167
- U(() => {
168
- if (!f || !s) return;
180
+ q(() => {
181
+ if (!f || !m) return;
169
182
  const t = (r) => {
170
- r.key === "Escape" && s(null);
183
+ r.key === "Escape" && m(null);
171
184
  };
172
185
  return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
173
- }, [f, s]);
174
- const wt = u * C / 60, z = o.find((t) => t.toString() === G);
175
- return /* @__PURE__ */ F("div", { ref: ct, className: k(i("root"), _), children: [
176
- /* @__PURE__ */ F(
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(
177
190
  "div",
178
191
  {
179
- ref: ut,
192
+ ref: ft,
180
193
  className: i("grid"),
181
194
  role: "region",
182
195
  "aria-roledescription": "calendar",
183
- "aria-label": Dt,
196
+ "aria-label": Tt,
184
197
  style: {
185
198
  display: "grid",
186
- gridTemplateColumns: `max-content repeat(${o.length}, minmax(${tt}px, 1fr))`,
187
- gridTemplateRows: `auto auto repeat(${$.length}, ${wt}px)`
199
+ gridTemplateColumns: `max-content repeat(${o.length}, minmax(${et}px, 1fr))`,
200
+ gridTemplateRows: `auto auto repeat(${C.length}, ${bt}px)`
188
201
  },
189
202
  children: [
190
- /* @__PURE__ */ a(
203
+ /* @__PURE__ */ l(
191
204
  "div",
192
205
  {
193
- ref: mt,
206
+ ref: dt,
194
207
  className: i("cornerCell"),
195
208
  style: { gridRow: 1, gridColumn: 1 },
196
- children: it?.({ timeZone: n })
209
+ children: at?.({ timeZone: n })
197
210
  }
198
211
  ),
199
- o.map((t, r) => /* @__PURE__ */ a(
200
- Nt,
212
+ o.map((t, r) => /* @__PURE__ */ l(
213
+ Lt,
201
214
  {
202
215
  date: t,
203
216
  isToday: t.toString() === G,
204
217
  column: r + 2,
205
218
  cls: i,
206
- renderHeader: rt
219
+ renderHeader: ot
207
220
  },
208
221
  t.toString()
209
222
  )),
210
- /* @__PURE__ */ a(
223
+ /* @__PURE__ */ l(
211
224
  "div",
212
225
  {
213
- ref: dt,
226
+ ref: ut,
214
227
  className: k(i("allDayCell"), "left-0 z-30"),
215
228
  style: {
216
229
  gridRow: 2,
217
230
  gridColumn: 1,
218
- top: O
231
+ top: P
219
232
  }
220
233
  }
221
234
  ),
222
- /* @__PURE__ */ a(
223
- Bt,
235
+ /* @__PURE__ */ l(
236
+ Ot,
224
237
  {
225
- positioned: pt,
238
+ positioned: yt,
226
239
  dates: o,
227
- headerHeight: O,
240
+ headerHeight: P,
228
241
  cls: i,
229
- onEventClick: V,
242
+ onEventClick: z,
230
243
  selectedEventId: A,
231
244
  selectedEventRef: B
232
245
  }
233
246
  ),
234
- $.map((t) => /* @__PURE__ */ a(
235
- Lt,
247
+ C.map((t) => /* @__PURE__ */ l(
248
+ Mt,
236
249
  {
237
250
  label: t.label,
238
251
  row: t.index + 3,
@@ -242,8 +255,8 @@ function nr({
242
255
  },
243
256
  t.index
244
257
  )),
245
- $.map(
246
- (t) => o.map((r, e) => /* @__PURE__ */ a(
258
+ C.map(
259
+ (t) => o.map((r, e) => /* @__PURE__ */ l(
247
260
  "div",
248
261
  {
249
262
  className: i(t.isHourStart ? "bodyCell" : "bodyCellMinor"),
@@ -259,9 +272,9 @@ function nr({
259
272
  ))
260
273
  ),
261
274
  o.map((t, r) => {
262
- const e = yt.get(t.toString());
263
- return e ? /* @__PURE__ */ a(
264
- Et,
275
+ const e = gt.get(t.toString());
276
+ return e ? /* @__PURE__ */ l(
277
+ It,
265
278
  {
266
279
  blocks: e,
267
280
  column: r + 2,
@@ -270,79 +283,79 @@ function nr({
270
283
  `unavail-${t.toString()}`
271
284
  ) : null;
272
285
  }),
273
- j != null && o.map((t, r) => /* @__PURE__ */ a(
274
- jt,
286
+ j != null && o.map((t, r) => /* @__PURE__ */ l(
287
+ At,
275
288
  {
276
289
  columnId: t.toString(),
277
290
  column: r + 2,
278
291
  date: t,
279
292
  timeZone: n,
280
- startHour: l,
293
+ startHour: a,
281
294
  endHour: c,
282
- hourHeight: u,
295
+ hourHeight: d,
283
296
  snapDuration: j,
284
- placeholderDuration: Y ?? 15,
297
+ placeholderDuration: Z ?? 15,
285
298
  cls: i,
286
- onSlotClick: H ? Tt : void 0,
287
- onSelect: s ? St : void 0,
288
- dragPreviewAppearance: ot,
299
+ onSlotClick: H ? Ht : void 0,
300
+ onSelect: m ? wt : void 0,
301
+ dragPreviewAppearance: it,
289
302
  renderEvent: b
290
303
  },
291
304
  `slot-${t.toString()}`
292
305
  )),
293
- o.map((t, r) => /* @__PURE__ */ a(
294
- It,
306
+ o.map((t, r) => /* @__PURE__ */ l(
307
+ jt,
295
308
  {
296
- positionedEvents: ht.get(t.toString()) ?? [],
309
+ positionedEvents: Dt.get(t.toString()) ?? [],
297
310
  column: r + 2,
298
311
  timeZone: n,
299
312
  cls: i,
300
- onEventClick: V,
313
+ onEventClick: z,
301
314
  renderEvent: b,
302
- eventGap: at,
303
- eventLayout: lt,
304
- stackOffset: st,
315
+ eventGap: st,
316
+ eventLayout: ct,
317
+ stackOffset: mt,
305
318
  selectedEventId: A,
306
319
  selectedEventRef: B
307
320
  },
308
321
  t.toString()
309
322
  )),
310
- g != null && (() => {
311
- const t = g.startTime.withTimeZone(n).toPlainDate(), r = o.findIndex(
323
+ D != null && (() => {
324
+ const t = D.startTime.withTimeZone(n).toPlainDate(), r = o.findIndex(
312
325
  (e) => E.PlainDate.compare(e, t) === 0
313
326
  );
314
- return r === -1 ? null : /* @__PURE__ */ a(
315
- Mt,
327
+ return r === -1 ? null : /* @__PURE__ */ l(
328
+ Bt,
316
329
  {
317
- startTime: g.startTime,
318
- endTime: g.endTime,
330
+ startTime: D.startTime,
331
+ endTime: D.endTime,
319
332
  column: r + 2,
320
333
  viewDate: o[r],
321
334
  timeZone: n,
322
- startHour: l,
323
- hourHeight: u,
335
+ startHour: a,
336
+ hourHeight: d,
324
337
  cls: i,
325
- appearance: et,
326
- selectionRef: nt,
338
+ appearance: nt,
339
+ selectionRef: lt,
327
340
  renderEvent: b
328
341
  }
329
342
  );
330
343
  })(),
331
- z && /* @__PURE__ */ a(
332
- At,
344
+ F && /* @__PURE__ */ l(
345
+ Gt,
333
346
  {
334
- date: z,
347
+ date: F,
335
348
  timeZone: n,
336
- startHour: l,
349
+ startHour: a,
337
350
  endHour: c,
338
- hourHeight: u,
351
+ hourHeight: d,
339
352
  cls: i
340
353
  }
341
354
  )
342
355
  ]
343
356
  }
344
357
  ),
345
- /* @__PURE__ */ a(
358
+ /* @__PURE__ */ l(
346
359
  "div",
347
360
  {
348
361
  "aria-live": "polite",
@@ -359,11 +372,11 @@ function nr({
359
372
  whiteSpace: "nowrap",
360
373
  borderWidth: 0
361
374
  },
362
- children: gt
375
+ children: St
363
376
  }
364
377
  )
365
378
  ] });
366
379
  }
367
380
  export {
368
- nr as DayGridView
381
+ sr as DayGridView
369
382
  };
@@ -1,3 +1,3 @@
1
1
  import { ResourceGridViewProps } from '../../types/calendar';
2
- export declare function ResourceGridView({ date, timeZone, resources, events, availability, unavailability, defaultUnavailable, timeAxis, 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, }: 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;AAc1B,wBAAgB,gBAAgB,CAAC,EAC/B,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,MAAM,EACN,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,QAAQ,EACR,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,2CA+avB"}
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"}