@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 +28 -27
- 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 +170 -157
- 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 +142 -129
- package/dist/components/shared/useEffectiveHourHeight.d.ts +1 -0
- package/dist/components/shared/useEffectiveHourHeight.d.ts.map +1 -1
- package/dist/components/shared/useEffectiveHourHeight.js +27 -25
- package/dist/components/shared/useInitialScroll.d.ts +43 -0
- package/dist/components/shared/useInitialScroll.d.ts.map +1 -0
- package/dist/components/shared/useInitialScroll.js +31 -0
- package/dist/types/calendar.d.ts +22 -0
- package/dist/types/calendar.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -74,9 +74,10 @@ function App() {
|
|
|
74
74
|
|
|
75
75
|
### Time axis
|
|
76
76
|
|
|
77
|
-
| Prop
|
|
78
|
-
|
|
|
79
|
-
| `timeAxis`
|
|
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
|
|
171
|
-
| ------------- |
|
|
172
|
-
| `activeRange` | `{ startDate: PlainDate; endDate: PlainDate }`
|
|
173
|
-
| `timeZone` | `string`
|
|
174
|
-
| `events` | `CalendarEvent[]`
|
|
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
|
|
179
|
-
|
|
|
180
|
-
| `availability`
|
|
181
|
-
| `unavailability`
|
|
182
|
-
| `defaultUnavailable`
|
|
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
|
|
191
|
-
| --------------- |
|
|
192
|
-
| `selectedRange` | `DayGridSelectedRange \| null`
|
|
193
|
-
| `onSelect` | `(range: DayGridSelectedRange \| null) => void`
|
|
194
|
-
| `selectionRef` | `Ref<HTMLDivElement>`
|
|
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
|
|
199
|
-
| ------------- |
|
|
200
|
-
| `onSlotClick` | `(info: { date, startTime, endTime }) => void`
|
|
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
|
|
224
|
-
|
|
|
225
|
-
| `headerWeekday`
|
|
226
|
-
| `headerDayNumber`
|
|
227
|
-
| `headerToday`
|
|
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;
|
|
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
|
|
2
|
-
import { useMemo as
|
|
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
|
|
6
|
-
import { layoutAllDayEvents as
|
|
7
|
-
import { computeUnavailableBlocks as
|
|
8
|
-
import { UnavailabilityOverlay as
|
|
9
|
-
import { dayGridViewDefaults as
|
|
10
|
-
import { DayHeader as
|
|
11
|
-
import { DayColumn as
|
|
12
|
-
import { TimeGutter as
|
|
13
|
-
import { SlotInteractionLayer as
|
|
14
|
-
import { SelectionOverlay as
|
|
15
|
-
import { NowIndicator as
|
|
16
|
-
import { AllDaySection as
|
|
17
|
-
import { useEffectiveHourHeight as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
|
|
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:
|
|
24
|
+
events: I,
|
|
24
25
|
availability: S,
|
|
25
26
|
unavailability: T,
|
|
26
|
-
defaultUnavailable:
|
|
27
|
+
defaultUnavailable: N,
|
|
27
28
|
timeAxis: w,
|
|
29
|
+
initialScrollHour: _,
|
|
28
30
|
onEventClick: L,
|
|
29
31
|
snapDuration: j,
|
|
30
|
-
placeholderDuration:
|
|
32
|
+
placeholderDuration: Z,
|
|
31
33
|
selectedRange: f,
|
|
32
|
-
onSelect:
|
|
34
|
+
onSelect: m,
|
|
33
35
|
onSlotClick: H,
|
|
34
|
-
className:
|
|
36
|
+
className: tt,
|
|
35
37
|
classNames: M,
|
|
36
|
-
hourHeight:
|
|
37
|
-
columnMinWidth:
|
|
38
|
-
renderHeader:
|
|
38
|
+
hourHeight: rt = 60,
|
|
39
|
+
columnMinWidth: et = 120,
|
|
40
|
+
renderHeader: ot,
|
|
39
41
|
renderEvent: b,
|
|
40
|
-
selectionAppearance:
|
|
41
|
-
dragPreviewAppearance:
|
|
42
|
-
selectionRef:
|
|
43
|
-
selectionLingerMs:
|
|
42
|
+
selectionAppearance: nt,
|
|
43
|
+
dragPreviewAppearance: it,
|
|
44
|
+
selectionRef: lt,
|
|
45
|
+
selectionLingerMs: $ = 0,
|
|
44
46
|
selectedEventId: A,
|
|
45
47
|
selectedEventRef: B,
|
|
46
|
-
renderCorner:
|
|
47
|
-
eventGap:
|
|
48
|
-
eventLayout:
|
|
49
|
-
stackOffset:
|
|
48
|
+
renderCorner: at,
|
|
49
|
+
eventGap: st,
|
|
50
|
+
eventLayout: ct = "columns",
|
|
51
|
+
stackOffset: mt = 8
|
|
50
52
|
}) {
|
|
51
|
-
const
|
|
52
|
-
() =>
|
|
53
|
-
[
|
|
54
|
-
), G =
|
|
55
|
-
effectiveHourHeight:
|
|
56
|
-
rootRef:
|
|
57
|
-
headerRef:
|
|
58
|
-
allDayRef:
|
|
59
|
-
gridRef:
|
|
60
|
-
headerHeight:
|
|
61
|
-
|
|
62
|
-
|
|
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 =
|
|
65
|
-
|
|
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 &&
|
|
81
|
+
else if (y.current && $ > 0) {
|
|
69
82
|
const t = y.current;
|
|
70
|
-
y.current = null,
|
|
71
|
-
p.current = null,
|
|
72
|
-
},
|
|
83
|
+
y.current = null, W(t), p.current = setTimeout(() => {
|
|
84
|
+
p.current = null, W(null);
|
|
85
|
+
}, $);
|
|
73
86
|
}
|
|
74
|
-
}, [f,
|
|
75
|
-
const
|
|
76
|
-
() =>
|
|
77
|
-
[
|
|
78
|
-
), { allDayEvents:
|
|
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
|
|
93
|
+
for (const e of I)
|
|
81
94
|
e.allDay ? t.push(e) : r.push(e);
|
|
82
95
|
return { allDayEvents: t, timedEvents: r };
|
|
83
|
-
}, [
|
|
84
|
-
() =>
|
|
85
|
-
[
|
|
86
|
-
),
|
|
87
|
-
() =>
|
|
88
|
-
|
|
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
|
-
|
|
104
|
+
a,
|
|
92
105
|
c,
|
|
93
|
-
|
|
106
|
+
d
|
|
94
107
|
),
|
|
95
|
-
[
|
|
96
|
-
), x =
|
|
97
|
-
() =>
|
|
98
|
-
[
|
|
99
|
-
),
|
|
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 =
|
|
117
|
+
const e = kt(
|
|
105
118
|
x,
|
|
106
119
|
T,
|
|
107
120
|
n,
|
|
108
121
|
r,
|
|
109
|
-
|
|
122
|
+
a,
|
|
110
123
|
c,
|
|
111
|
-
|
|
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
|
-
|
|
134
|
+
a,
|
|
122
135
|
c,
|
|
123
|
-
|
|
124
|
-
]), { message:
|
|
125
|
-
const t =
|
|
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
|
-
}, [
|
|
140
|
+
}, [s.startDate, s.endDate]), z = g(
|
|
128
141
|
(t) => {
|
|
129
|
-
if (
|
|
130
|
-
const r = [
|
|
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
|
-
|
|
135
|
-
|
|
136
|
-
], e =
|
|
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
|
-
[
|
|
141
|
-
),
|
|
153
|
+
[m, L, n, h]
|
|
154
|
+
), wt = g(
|
|
142
155
|
(t) => {
|
|
143
156
|
if (!t) {
|
|
144
|
-
|
|
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
|
-
|
|
152
|
-
const e = [
|
|
164
|
+
m?.(r);
|
|
165
|
+
const e = [Q(t.startTime, t.endTime, n)];
|
|
153
166
|
h(`Selected time: ${e.join(", ")}`);
|
|
154
167
|
},
|
|
155
|
-
[
|
|
156
|
-
),
|
|
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
|
-
|
|
168
|
-
if (!f || !
|
|
180
|
+
q(() => {
|
|
181
|
+
if (!f || !m) return;
|
|
169
182
|
const t = (r) => {
|
|
170
|
-
r.key === "Escape" &&
|
|
183
|
+
r.key === "Escape" && m(null);
|
|
171
184
|
};
|
|
172
185
|
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
173
|
-
}, [f,
|
|
174
|
-
const
|
|
175
|
-
return /* @__PURE__ */
|
|
176
|
-
/* @__PURE__ */
|
|
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:
|
|
192
|
+
ref: ft,
|
|
180
193
|
className: i("grid"),
|
|
181
194
|
role: "region",
|
|
182
195
|
"aria-roledescription": "calendar",
|
|
183
|
-
"aria-label":
|
|
196
|
+
"aria-label": Tt,
|
|
184
197
|
style: {
|
|
185
198
|
display: "grid",
|
|
186
|
-
gridTemplateColumns: `max-content repeat(${o.length}, minmax(${
|
|
187
|
-
gridTemplateRows: `auto auto repeat(${
|
|
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__ */
|
|
203
|
+
/* @__PURE__ */ l(
|
|
191
204
|
"div",
|
|
192
205
|
{
|
|
193
|
-
ref:
|
|
206
|
+
ref: dt,
|
|
194
207
|
className: i("cornerCell"),
|
|
195
208
|
style: { gridRow: 1, gridColumn: 1 },
|
|
196
|
-
children:
|
|
209
|
+
children: at?.({ timeZone: n })
|
|
197
210
|
}
|
|
198
211
|
),
|
|
199
|
-
o.map((t, r) => /* @__PURE__ */
|
|
200
|
-
|
|
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:
|
|
219
|
+
renderHeader: ot
|
|
207
220
|
},
|
|
208
221
|
t.toString()
|
|
209
222
|
)),
|
|
210
|
-
/* @__PURE__ */
|
|
223
|
+
/* @__PURE__ */ l(
|
|
211
224
|
"div",
|
|
212
225
|
{
|
|
213
|
-
ref:
|
|
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:
|
|
231
|
+
top: P
|
|
219
232
|
}
|
|
220
233
|
}
|
|
221
234
|
),
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
|
|
235
|
+
/* @__PURE__ */ l(
|
|
236
|
+
Ot,
|
|
224
237
|
{
|
|
225
|
-
positioned:
|
|
238
|
+
positioned: yt,
|
|
226
239
|
dates: o,
|
|
227
|
-
headerHeight:
|
|
240
|
+
headerHeight: P,
|
|
228
241
|
cls: i,
|
|
229
|
-
onEventClick:
|
|
242
|
+
onEventClick: z,
|
|
230
243
|
selectedEventId: A,
|
|
231
244
|
selectedEventRef: B
|
|
232
245
|
}
|
|
233
246
|
),
|
|
234
|
-
|
|
235
|
-
|
|
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
|
-
|
|
246
|
-
(t) => o.map((r, e) => /* @__PURE__ */
|
|
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 =
|
|
263
|
-
return e ? /* @__PURE__ */
|
|
264
|
-
|
|
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__ */
|
|
274
|
-
|
|
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:
|
|
293
|
+
startHour: a,
|
|
281
294
|
endHour: c,
|
|
282
|
-
hourHeight:
|
|
295
|
+
hourHeight: d,
|
|
283
296
|
snapDuration: j,
|
|
284
|
-
placeholderDuration:
|
|
297
|
+
placeholderDuration: Z ?? 15,
|
|
285
298
|
cls: i,
|
|
286
|
-
onSlotClick: H ?
|
|
287
|
-
onSelect:
|
|
288
|
-
dragPreviewAppearance:
|
|
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__ */
|
|
294
|
-
|
|
306
|
+
o.map((t, r) => /* @__PURE__ */ l(
|
|
307
|
+
jt,
|
|
295
308
|
{
|
|
296
|
-
positionedEvents:
|
|
309
|
+
positionedEvents: Dt.get(t.toString()) ?? [],
|
|
297
310
|
column: r + 2,
|
|
298
311
|
timeZone: n,
|
|
299
312
|
cls: i,
|
|
300
|
-
onEventClick:
|
|
313
|
+
onEventClick: z,
|
|
301
314
|
renderEvent: b,
|
|
302
|
-
eventGap:
|
|
303
|
-
eventLayout:
|
|
304
|
-
stackOffset:
|
|
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
|
-
|
|
311
|
-
const t =
|
|
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__ */
|
|
315
|
-
|
|
327
|
+
return r === -1 ? null : /* @__PURE__ */ l(
|
|
328
|
+
Bt,
|
|
316
329
|
{
|
|
317
|
-
startTime:
|
|
318
|
-
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:
|
|
323
|
-
hourHeight:
|
|
335
|
+
startHour: a,
|
|
336
|
+
hourHeight: d,
|
|
324
337
|
cls: i,
|
|
325
|
-
appearance:
|
|
326
|
-
selectionRef:
|
|
338
|
+
appearance: nt,
|
|
339
|
+
selectionRef: lt,
|
|
327
340
|
renderEvent: b
|
|
328
341
|
}
|
|
329
342
|
);
|
|
330
343
|
})(),
|
|
331
|
-
|
|
332
|
-
|
|
344
|
+
F && /* @__PURE__ */ l(
|
|
345
|
+
Gt,
|
|
333
346
|
{
|
|
334
|
-
date:
|
|
347
|
+
date: F,
|
|
335
348
|
timeZone: n,
|
|
336
|
-
startHour:
|
|
349
|
+
startHour: a,
|
|
337
350
|
endHour: c,
|
|
338
|
-
hourHeight:
|
|
351
|
+
hourHeight: d,
|
|
339
352
|
cls: i
|
|
340
353
|
}
|
|
341
354
|
)
|
|
342
355
|
]
|
|
343
356
|
}
|
|
344
357
|
),
|
|
345
|
-
/* @__PURE__ */
|
|
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:
|
|
375
|
+
children: St
|
|
363
376
|
}
|
|
364
377
|
)
|
|
365
378
|
] });
|
|
366
379
|
}
|
|
367
380
|
export {
|
|
368
|
-
|
|
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;
|
|
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"}
|