@savvycal/calendar 0.4.0 → 0.6.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 +116 -7
- package/dist/components/day-grid-view/AllDayEventChip.d.ts +14 -0
- package/dist/components/day-grid-view/AllDayEventChip.d.ts.map +1 -0
- package/dist/components/day-grid-view/AllDayEventChip.js +86 -0
- package/dist/components/day-grid-view/AllDaySection.d.ts +16 -0
- package/dist/components/day-grid-view/AllDaySection.d.ts.map +1 -0
- package/dist/components/day-grid-view/AllDaySection.js +60 -0
- package/dist/components/day-grid-view/DayColumn.d.ts +21 -0
- package/dist/components/day-grid-view/DayColumn.d.ts.map +1 -0
- package/dist/components/day-grid-view/DayColumn.js +51 -0
- package/dist/components/day-grid-view/DayGridView.d.ts +3 -0
- package/dist/components/day-grid-view/DayGridView.d.ts.map +1 -0
- package/dist/components/day-grid-view/DayGridView.js +360 -0
- package/dist/components/day-grid-view/DayHeader.d.ts +16 -0
- package/dist/components/day-grid-view/DayHeader.d.ts.map +1 -0
- package/dist/components/day-grid-view/DayHeader.js +36 -0
- package/dist/components/day-grid-view/defaults.d.ts +3 -0
- package/dist/components/day-grid-view/defaults.d.ts.map +1 -0
- package/dist/components/day-grid-view/defaults.js +35 -0
- package/dist/components/day-grid-view/index.d.ts +3 -0
- package/dist/components/day-grid-view/index.d.ts.map +1 -0
- package/dist/components/resource-grid-view/ResourceColumn.d.ts +2 -2
- package/dist/components/resource-grid-view/ResourceColumn.d.ts.map +1 -1
- package/dist/components/resource-grid-view/ResourceColumn.js +24 -24
- 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 +219 -197
- package/dist/components/{resource-grid-view → shared}/AllDayRow.d.ts +2 -2
- package/dist/components/shared/AllDayRow.d.ts.map +1 -0
- package/dist/components/{resource-grid-view → shared}/EventChip.d.ts +3 -3
- package/dist/components/shared/EventChip.d.ts.map +1 -0
- package/dist/components/{resource-grid-view → shared}/EventChip.js +8 -8
- package/dist/components/{resource-grid-view → shared}/NowIndicator.d.ts +2 -2
- package/dist/components/shared/NowIndicator.d.ts.map +1 -0
- package/dist/components/{resource-grid-view → shared}/SelectionOverlay.d.ts +5 -4
- package/dist/components/shared/SelectionOverlay.d.ts.map +1 -0
- package/dist/components/shared/SelectionOverlay.js +83 -0
- package/dist/components/{resource-grid-view → shared}/SlotInteractionLayer.d.ts +10 -5
- package/dist/components/shared/SlotInteractionLayer.d.ts.map +1 -0
- package/dist/components/shared/SlotInteractionLayer.js +214 -0
- package/dist/components/{resource-grid-view → shared}/TimeGutter.d.ts +2 -2
- package/dist/components/shared/TimeGutter.d.ts.map +1 -0
- package/dist/components/{resource-grid-view → shared}/UnavailabilityOverlay.d.ts +2 -2
- package/dist/components/shared/UnavailabilityOverlay.d.ts.map +1 -0
- package/dist/components/shared/useAnnouncer.d.ts.map +1 -0
- package/dist/components/shared/useEffectiveHourHeight.d.ts.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -9
- package/dist/lib/availability.js +17 -17
- package/dist/lib/overlap.d.ts +13 -1
- package/dist/lib/overlap.d.ts.map +1 -1
- package/dist/lib/overlap.js +126 -45
- package/dist/lib/time.d.ts +2 -0
- package/dist/lib/time.d.ts.map +1 -1
- package/dist/lib/time.js +31 -18
- package/dist/types/calendar.d.ts +65 -2
- package/dist/types/calendar.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/components/resource-grid-view/AllDayRow.d.ts.map +0 -1
- package/dist/components/resource-grid-view/EventChip.d.ts.map +0 -1
- package/dist/components/resource-grid-view/NowIndicator.d.ts.map +0 -1
- package/dist/components/resource-grid-view/SelectionOverlay.d.ts.map +0 -1
- package/dist/components/resource-grid-view/SelectionOverlay.js +0 -87
- package/dist/components/resource-grid-view/SlotInteractionLayer.d.ts.map +0 -1
- package/dist/components/resource-grid-view/SlotInteractionLayer.js +0 -213
- package/dist/components/resource-grid-view/TimeGutter.d.ts.map +0 -1
- package/dist/components/resource-grid-view/UnavailabilityOverlay.d.ts.map +0 -1
- package/dist/components/resource-grid-view/useAnnouncer.d.ts.map +0 -1
- package/dist/components/resource-grid-view/useEffectiveHourHeight.d.ts.map +0 -1
- /package/dist/components/{resource-grid-view → shared}/AllDayRow.js +0 -0
- /package/dist/components/{resource-grid-view → shared}/NowIndicator.js +0 -0
- /package/dist/components/{resource-grid-view → shared}/TimeGutter.js +0 -0
- /package/dist/components/{resource-grid-view → shared}/UnavailabilityOverlay.js +0 -0
- /package/dist/components/{resource-grid-view → shared}/useAnnouncer.d.ts +0 -0
- /package/dist/components/{resource-grid-view → shared}/useAnnouncer.js +0 -0
- /package/dist/components/{resource-grid-view → shared}/useEffectiveHourHeight.d.ts +0 -0
- /package/dist/components/{resource-grid-view → shared}/useEffectiveHourHeight.js +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @savvycal/calendar
|
|
2
2
|
|
|
3
|
-
A fully-featured
|
|
3
|
+
A fully-featured calendar component library built with React, Tailwind CSS v4, and the Temporal API. Includes a resource grid view (resources as columns) and a day grid view (days as columns).
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -113,10 +113,11 @@ function App() {
|
|
|
113
113
|
|
|
114
114
|
### Availability
|
|
115
115
|
|
|
116
|
-
| Prop
|
|
117
|
-
|
|
|
118
|
-
| `availability`
|
|
119
|
-
| `unavailability`
|
|
116
|
+
| Prop | Type | Default | Description |
|
|
117
|
+
| -------------------- | ------------------------------------- | ------- | ------------------------------------------------------------------------------------------------- |
|
|
118
|
+
| `availability` | `Record<string, AvailabilityRange[]>` | — | Map of resource ID to available time ranges. Times outside these ranges are shown as unavailable. |
|
|
119
|
+
| `unavailability` | `Record<string, AvailabilityRange[]>` | — | Map of resource ID to explicitly unavailable time ranges. Applied on top of availability. |
|
|
120
|
+
| `defaultUnavailable` | `boolean` | — | When `true`, resources without an entry in `availability` are shown as entirely unavailable. |
|
|
120
121
|
|
|
121
122
|
### Render props
|
|
122
123
|
|
|
@@ -126,6 +127,107 @@ function App() {
|
|
|
126
127
|
| `renderEvent` | `(props: { event: TimedCalendarEvent, position: PositionedEvent }) => ReactNode` | Custom renderer for timed events. |
|
|
127
128
|
| `renderCorner` | `() => ReactNode` | Custom renderer for the top-left corner cell (e.g. time zone label). |
|
|
128
129
|
|
|
130
|
+
## DayGridView
|
|
131
|
+
|
|
132
|
+
A day-based grid view that shows days as columns (e.g. a week view).
|
|
133
|
+
|
|
134
|
+
### Quick start
|
|
135
|
+
|
|
136
|
+
```tsx
|
|
137
|
+
import { DayGridView, Temporal } from '@savvycal/calendar';
|
|
138
|
+
|
|
139
|
+
const today = Temporal.Now.plainDateISO();
|
|
140
|
+
const weekStart = today.subtract({ days: today.dayOfWeek - 1 });
|
|
141
|
+
const weekEnd = weekStart.add({ days: 6 });
|
|
142
|
+
|
|
143
|
+
function App() {
|
|
144
|
+
return (
|
|
145
|
+
<DayGridView
|
|
146
|
+
activeRange={{ startDate: weekStart, endDate: weekEnd }}
|
|
147
|
+
timeZone="America/Chicago"
|
|
148
|
+
events={[
|
|
149
|
+
{
|
|
150
|
+
id: 'evt-1',
|
|
151
|
+
title: 'Meeting',
|
|
152
|
+
resourceId: '',
|
|
153
|
+
startTime: today
|
|
154
|
+
.toPlainDateTime({ hour: 10 })
|
|
155
|
+
.toZonedDateTime('America/Chicago'),
|
|
156
|
+
endTime: today
|
|
157
|
+
.toPlainDateTime({ hour: 11 })
|
|
158
|
+
.toZonedDateTime('America/Chicago'),
|
|
159
|
+
},
|
|
160
|
+
]}
|
|
161
|
+
/>
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### DayGridView props
|
|
167
|
+
|
|
168
|
+
#### Required
|
|
169
|
+
|
|
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. |
|
|
175
|
+
|
|
176
|
+
#### Availability
|
|
177
|
+
|
|
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. |
|
|
183
|
+
|
|
184
|
+
#### Layout, events & interaction
|
|
185
|
+
|
|
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
|
+
|
|
188
|
+
#### Selection
|
|
189
|
+
|
|
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. |
|
|
195
|
+
|
|
196
|
+
#### Slot click
|
|
197
|
+
|
|
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. |
|
|
201
|
+
|
|
202
|
+
#### Render props
|
|
203
|
+
|
|
204
|
+
| Prop | Type | Description |
|
|
205
|
+
| -------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
|
|
206
|
+
| `renderHeader` | `(props: { date: PlainDate, isToday: boolean }) => ReactNode` | Custom renderer for day column headers. |
|
|
207
|
+
| `renderEvent` | `(props: { event: TimedCalendarEvent, position: PositionedEvent }) => ReactNode` | Custom renderer for timed events. |
|
|
208
|
+
| `renderCorner` | `(props: { timeZone: string }) => ReactNode` | Custom renderer for the top-left corner cell (e.g. time zone label). |
|
|
209
|
+
|
|
210
|
+
### DayGridSelectedRange
|
|
211
|
+
|
|
212
|
+
```ts
|
|
213
|
+
interface DayGridSelectedRange {
|
|
214
|
+
startTime: Temporal.ZonedDateTime;
|
|
215
|
+
endTime: Temporal.ZonedDateTime;
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### DayGridViewClassNames
|
|
220
|
+
|
|
221
|
+
Extends `GridViewClassNames` with day-specific keys:
|
|
222
|
+
|
|
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. |
|
|
228
|
+
|
|
229
|
+
All shared keys from `GridViewClassNames` (root, grid, event, etc.) also apply.
|
|
230
|
+
|
|
129
231
|
## Data types
|
|
130
232
|
|
|
131
233
|
### CalendarResource
|
|
@@ -422,9 +524,12 @@ const { refs, floatingStyles } = useFloating({
|
|
|
422
524
|
|
|
423
525
|
```ts
|
|
424
526
|
// Components
|
|
425
|
-
export { ResourceGridView } from '@savvycal/calendar';
|
|
527
|
+
export { ResourceGridView, DayGridView } from '@savvycal/calendar';
|
|
426
528
|
// Defaults
|
|
427
|
-
export {
|
|
529
|
+
export {
|
|
530
|
+
resourceGridViewDefaults,
|
|
531
|
+
dayGridViewDefaults,
|
|
532
|
+
} from '@savvycal/calendar';
|
|
428
533
|
|
|
429
534
|
// Temporal polyfill
|
|
430
535
|
export { Temporal } from '@savvycal/calendar';
|
|
@@ -443,6 +548,10 @@ export type {
|
|
|
443
548
|
TimeAxisConfig,
|
|
444
549
|
ResourceGridViewProps,
|
|
445
550
|
ResourceGridViewClassNames,
|
|
551
|
+
GridViewClassNames,
|
|
552
|
+
DayGridViewProps,
|
|
553
|
+
DayGridViewClassNames,
|
|
554
|
+
DayGridSelectedRange,
|
|
446
555
|
PositionedEvent,
|
|
447
556
|
SelectedRange,
|
|
448
557
|
SelectionAppearance,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { CalendarEvent, DayGridViewClassNames } from '../../types/calendar';
|
|
3
|
+
import { PositionedAllDayEvent } from '../../lib/overlap';
|
|
4
|
+
interface AllDayEventChipProps {
|
|
5
|
+
positioned: PositionedAllDayEvent;
|
|
6
|
+
laneOffset: number;
|
|
7
|
+
cls: (key: keyof DayGridViewClassNames) => string;
|
|
8
|
+
onEventClick?: (event: CalendarEvent) => void;
|
|
9
|
+
selectedEventId?: string | null;
|
|
10
|
+
selectedEventRef?: Ref<HTMLDivElement>;
|
|
11
|
+
}
|
|
12
|
+
export declare const AllDayEventChip: import('react').NamedExoticComponent<AllDayEventChipProps>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=AllDayEventChip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AllDayEventChip.d.ts","sourceRoot":"","sources":["../../../src/components/day-grid-view/AllDayEventChip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAE3D,UAAU,oBAAoB;IAC5B,UAAU,EAAE,qBAAqB,CAAC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,qBAAqB,KAAK,MAAM,CAAC;IAClD,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC9C,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,gBAAgB,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CACxC;AAED,eAAO,MAAM,eAAe,4DAkG1B,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { jsxs as R, Fragment as D, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { memo as x } from "react";
|
|
3
|
+
import { cn as f } from "../../lib/utils.js";
|
|
4
|
+
const B = x(function({
|
|
5
|
+
positioned: y,
|
|
6
|
+
laneOffset: g,
|
|
7
|
+
cls: t,
|
|
8
|
+
onEventClick: a,
|
|
9
|
+
selectedEventId: h,
|
|
10
|
+
selectedEventRef: b
|
|
11
|
+
}) {
|
|
12
|
+
const {
|
|
13
|
+
event: e,
|
|
14
|
+
gridColumnStart: o,
|
|
15
|
+
gridColumnSpan: r,
|
|
16
|
+
lane: v,
|
|
17
|
+
continuesBefore: l,
|
|
18
|
+
continuesAfter: s
|
|
19
|
+
} = y, C = e.id === h, d = v + 1 + g, i = [e.title, "all day"];
|
|
20
|
+
e.clientName && i.push(e.clientName);
|
|
21
|
+
const c = l ? 2 : 4, m = s ? 2 : 4, p = {
|
|
22
|
+
...l ? {
|
|
23
|
+
borderTopLeftRadius: 0,
|
|
24
|
+
borderBottomLeftRadius: 0,
|
|
25
|
+
paddingLeft: 4
|
|
26
|
+
} : {},
|
|
27
|
+
...s ? { borderTopRightRadius: 0, borderBottomRightRadius: 0 } : {}
|
|
28
|
+
}, u = /* @__PURE__ */ R(D, { children: [
|
|
29
|
+
e.color && !l && /* @__PURE__ */ n(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
className: t("allDayEventColorBar"),
|
|
33
|
+
style: { backgroundColor: e.color, borderRadius: "inherit" }
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
/* @__PURE__ */ n("span", { className: t("allDayEventTitle"), children: e.title })
|
|
37
|
+
] });
|
|
38
|
+
return C ? /* @__PURE__ */ n(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
ref: b,
|
|
42
|
+
style: {
|
|
43
|
+
gridColumn: `${o} / span ${r}`,
|
|
44
|
+
gridRow: d,
|
|
45
|
+
display: "flex",
|
|
46
|
+
minWidth: 0,
|
|
47
|
+
marginLeft: c,
|
|
48
|
+
marginRight: m
|
|
49
|
+
},
|
|
50
|
+
children: /* @__PURE__ */ n(
|
|
51
|
+
"button",
|
|
52
|
+
{
|
|
53
|
+
type: "button",
|
|
54
|
+
"aria-label": i.join(", "),
|
|
55
|
+
className: f(
|
|
56
|
+
t("allDayEvent"),
|
|
57
|
+
t("allDayEventSelected"),
|
|
58
|
+
"relative flex items-center gap-1 w-full"
|
|
59
|
+
),
|
|
60
|
+
style: p,
|
|
61
|
+
onClick: () => a?.(e),
|
|
62
|
+
children: u
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
) : /* @__PURE__ */ n(
|
|
67
|
+
"button",
|
|
68
|
+
{
|
|
69
|
+
type: "button",
|
|
70
|
+
"aria-label": i.join(", "),
|
|
71
|
+
className: f(t("allDayEvent"), "relative flex items-center gap-1"),
|
|
72
|
+
style: {
|
|
73
|
+
gridColumn: `${o} / span ${r}`,
|
|
74
|
+
gridRow: d,
|
|
75
|
+
marginLeft: c,
|
|
76
|
+
marginRight: m,
|
|
77
|
+
...p
|
|
78
|
+
},
|
|
79
|
+
onClick: () => a?.(e),
|
|
80
|
+
children: u
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
});
|
|
84
|
+
export {
|
|
85
|
+
B as AllDayEventChip
|
|
86
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { Temporal } from 'temporal-polyfill';
|
|
3
|
+
import { CalendarEvent, DayGridViewClassNames } from '../../types/calendar';
|
|
4
|
+
import { PositionedAllDayEvent } from '../../lib/overlap';
|
|
5
|
+
interface AllDaySectionProps {
|
|
6
|
+
positioned: PositionedAllDayEvent[];
|
|
7
|
+
dates: Temporal.PlainDate[];
|
|
8
|
+
headerHeight: number;
|
|
9
|
+
cls: (key: keyof DayGridViewClassNames) => string;
|
|
10
|
+
onEventClick?: (event: CalendarEvent) => void;
|
|
11
|
+
selectedEventId?: string | null;
|
|
12
|
+
selectedEventRef?: Ref<HTMLDivElement>;
|
|
13
|
+
}
|
|
14
|
+
export declare const AllDaySection: import('react').NamedExoticComponent<AllDaySectionProps>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=AllDaySection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AllDaySection.d.ts","sourceRoot":"","sources":["../../../src/components/day-grid-view/AllDaySection.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAG3D,UAAU,kBAAkB;IAC1B,UAAU,EAAE,qBAAqB,EAAE,CAAC;IACpC,KAAK,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,qBAAqB,KAAK,MAAM,CAAC;IAClD,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC9C,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,gBAAgB,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CACxC;AAED,eAAO,MAAM,aAAa,0DA+DxB,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsxs as u, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { memo as x } from "react";
|
|
3
|
+
import { AllDayEventChip as y } from "./AllDayEventChip.js";
|
|
4
|
+
const C = x(function({
|
|
5
|
+
positioned: o,
|
|
6
|
+
dates: n,
|
|
7
|
+
headerHeight: s,
|
|
8
|
+
cls: a,
|
|
9
|
+
onEventClick: m,
|
|
10
|
+
selectedEventId: d,
|
|
11
|
+
selectedEventRef: p
|
|
12
|
+
}) {
|
|
13
|
+
const g = o.length > 0 ? Math.max(...o.map((t) => t.lane)) + 1 : 0, e = o.length > 0, r = e ? "4px" : "0px", c = e ? `${r} repeat(${g}, auto) ${r}` : "auto";
|
|
14
|
+
return /* @__PURE__ */ u(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
className: a("allDayLane"),
|
|
18
|
+
style: {
|
|
19
|
+
gridRow: 2,
|
|
20
|
+
gridColumn: "2 / -1",
|
|
21
|
+
display: "grid",
|
|
22
|
+
gridTemplateColumns: "subgrid",
|
|
23
|
+
gridTemplateRows: c,
|
|
24
|
+
position: "sticky",
|
|
25
|
+
top: s,
|
|
26
|
+
zIndex: 20,
|
|
27
|
+
gap: "2px 0"
|
|
28
|
+
},
|
|
29
|
+
children: [
|
|
30
|
+
n.map((t, l) => /* @__PURE__ */ i(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
className: l < n.length - 1 ? "border-r border-cal-border" : void 0,
|
|
34
|
+
style: {
|
|
35
|
+
gridColumn: l + 1,
|
|
36
|
+
gridRow: "1 / -1",
|
|
37
|
+
pointerEvents: "none"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
t.toString()
|
|
41
|
+
)),
|
|
42
|
+
o.map((t) => /* @__PURE__ */ i(
|
|
43
|
+
y,
|
|
44
|
+
{
|
|
45
|
+
positioned: t,
|
|
46
|
+
laneOffset: e ? 1 : 0,
|
|
47
|
+
cls: a,
|
|
48
|
+
onEventClick: m,
|
|
49
|
+
selectedEventId: d,
|
|
50
|
+
selectedEventRef: p
|
|
51
|
+
},
|
|
52
|
+
t.event.id
|
|
53
|
+
))
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
});
|
|
58
|
+
export {
|
|
59
|
+
C as AllDaySection
|
|
60
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { CalendarEvent, EventLayout, GridViewClassNames, PositionedEvent, TimedCalendarEvent } from '../../types/calendar';
|
|
3
|
+
interface DayColumnProps {
|
|
4
|
+
positionedEvents: PositionedEvent[];
|
|
5
|
+
column: number;
|
|
6
|
+
timeZone: string;
|
|
7
|
+
cls: (key: keyof GridViewClassNames) => string;
|
|
8
|
+
onEventClick?: (event: CalendarEvent) => void;
|
|
9
|
+
renderEvent?: (props: {
|
|
10
|
+
event: TimedCalendarEvent;
|
|
11
|
+
position: PositionedEvent;
|
|
12
|
+
}) => React.ReactNode;
|
|
13
|
+
eventGap?: number;
|
|
14
|
+
eventLayout?: EventLayout;
|
|
15
|
+
stackOffset?: number;
|
|
16
|
+
selectedEventId?: string | null;
|
|
17
|
+
selectedEventRef?: Ref<HTMLDivElement>;
|
|
18
|
+
}
|
|
19
|
+
export declare const DayColumn: import('react').NamedExoticComponent<DayColumnProps>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=DayColumn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DayColumn.d.ts","sourceRoot":"","sources":["../../../src/components/day-grid-view/DayColumn.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EACnB,MAAM,kBAAkB,CAAC;AAG1B,UAAU,cAAc;IACtB,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,SAAS,sDA2CpB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { memo as C } from "react";
|
|
3
|
+
import { EventChip as f } from "../shared/EventChip.js";
|
|
4
|
+
const h = C(function({
|
|
5
|
+
positionedEvents: r,
|
|
6
|
+
column: i,
|
|
7
|
+
timeZone: m,
|
|
8
|
+
cls: n,
|
|
9
|
+
onEventClick: l,
|
|
10
|
+
renderEvent: s,
|
|
11
|
+
eventGap: v,
|
|
12
|
+
eventLayout: a,
|
|
13
|
+
stackOffset: c,
|
|
14
|
+
selectedEventId: d,
|
|
15
|
+
selectedEventRef: u
|
|
16
|
+
}) {
|
|
17
|
+
return /* @__PURE__ */ t(
|
|
18
|
+
"div",
|
|
19
|
+
{
|
|
20
|
+
className: n("eventColumn"),
|
|
21
|
+
style: {
|
|
22
|
+
gridRow: "3 / -1",
|
|
23
|
+
gridColumn: i,
|
|
24
|
+
pointerEvents: "none",
|
|
25
|
+
isolation: "isolate"
|
|
26
|
+
},
|
|
27
|
+
children: r.map((e) => {
|
|
28
|
+
const o = e.event.id === d;
|
|
29
|
+
return /* @__PURE__ */ t(
|
|
30
|
+
f,
|
|
31
|
+
{
|
|
32
|
+
positioned: e,
|
|
33
|
+
timeZone: m,
|
|
34
|
+
cls: n,
|
|
35
|
+
onClick: l,
|
|
36
|
+
renderEvent: s,
|
|
37
|
+
eventGap: v,
|
|
38
|
+
eventLayout: a,
|
|
39
|
+
stackOffset: c,
|
|
40
|
+
isSelected: o,
|
|
41
|
+
selectedEventRef: o ? u : void 0
|
|
42
|
+
},
|
|
43
|
+
e.event.id
|
|
44
|
+
);
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
});
|
|
49
|
+
export {
|
|
50
|
+
h as DayColumn
|
|
51
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
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;
|
|
3
|
+
//# sourceMappingURL=DayGridView.d.ts.map
|
|
@@ -0,0 +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;AAa1B,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,2CAuZlB"}
|