@super-calendar/solid 2.16.0 → 2.18.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 +88 -7
- package/dist/client/index.d.ts +96 -17
- package/dist/client/index.js +1093 -382
- package/dist/server/index.d.ts +96 -17
- package/dist/server/index.js +1788 -930
- package/package.json +2 -2
- package/src/Agenda.tsx +17 -1
- package/src/Calendar.tsx +175 -27
- package/src/MonthView.tsx +589 -98
- package/src/MultiWeekView.tsx +49 -0
- package/src/TimeGrid.tsx +350 -155
- package/src/YearView.tsx +17 -1
- package/src/index.ts +7 -0
- package/src/touch.ts +70 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { JSX } from "@solidjs/web";
|
|
2
|
+
import type { WeekStartsOn } from "@super-calendar/core/vanilla";
|
|
3
|
+
import { DateRows, type MonthViewProps } from "./MonthView";
|
|
4
|
+
|
|
5
|
+
/** Props for {@link MultiWeekView}. */
|
|
6
|
+
export interface MultiWeekViewProps<T = unknown> extends Omit<
|
|
7
|
+
MonthViewProps<T>,
|
|
8
|
+
"date" | "weekStartsOn" | "showAdjacentMonths"
|
|
9
|
+
> {
|
|
10
|
+
/**
|
|
11
|
+
* Any day in the first week to show. The rows start on the `weekStartsOn` day
|
|
12
|
+
* on or before it, in the device's local calendar.
|
|
13
|
+
*/
|
|
14
|
+
date: Date;
|
|
15
|
+
/**
|
|
16
|
+
* How many consecutive full weeks to show, as stacked rows. A positive whole
|
|
17
|
+
* number; default 2. Other values throw a `RangeError`.
|
|
18
|
+
*/
|
|
19
|
+
numberOfWeeks?: number;
|
|
20
|
+
/** First day of the week. Sunday = 0 (default) … Saturday = 6. */
|
|
21
|
+
weekStartsOn?: WeekStartsOn;
|
|
22
|
+
/** Event chip and overflow-button height in pixels (default 24). */
|
|
23
|
+
chipHeight?: number;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Consecutive full weeks as stacked seven-day rows, with event chips and no hour
|
|
28
|
+
* slots. It has the month grid's event bars, overflow, selection, and drag
|
|
29
|
+
* interactions, and the month slots, `renderEvent`, and theme style it. Every
|
|
30
|
+
* row is kept at full height; when the view is given less room, the rows scroll
|
|
31
|
+
* under the title and weekday header.
|
|
32
|
+
*
|
|
33
|
+
* Standalone, it shows `events` as given; expand recurring events first with
|
|
34
|
+
* `expandRecurringEvents`, or use `Calendar` with `mode="multiweek"`.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* <MultiWeekView date={new Date()} numberOfWeeks={3} events={events} />
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export function MultiWeekView<T = unknown>(props: MultiWeekViewProps<T>): JSX.Element {
|
|
42
|
+
return (
|
|
43
|
+
<DateRows<T>
|
|
44
|
+
{...props}
|
|
45
|
+
chipHeight={props.chipHeight ?? 24}
|
|
46
|
+
source={{ kind: "multiweek", date: props.date, numberOfWeeks: props.numberOfWeeks ?? 2 }}
|
|
47
|
+
/>
|
|
48
|
+
);
|
|
49
|
+
}
|