@calenderjs/calendar 0.0.1 → 0.3.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 ADDED
@@ -0,0 +1,56 @@
1
+ # @calenderjs/calendar
2
+
3
+ 基于 WSX 框架的事件日历 Web Component。
4
+
5
+ ## 安装
6
+
7
+ ```bash
8
+ pnpm add @calenderjs/calendar @wsxjs/wsx-core
9
+ ```
10
+
11
+ ## 使用
12
+
13
+ ```html
14
+ <script type="module">
15
+ import "@calenderjs/calendar";
16
+ </script>
17
+
18
+ <wsx-calendar view="month" date="2024-12-30"></wsx-calendar>
19
+ ```
20
+
21
+ ```typescript
22
+ import { Calendar } from "@calenderjs/calendar";
23
+ import type { Event } from "@calenderjs/event-model";
24
+
25
+ const el = document.querySelector("wsx-calendar") as Calendar;
26
+ el.events = [
27
+ {
28
+ id: "1",
29
+ type: "meeting",
30
+ title: "团队会议",
31
+ startTime: new Date("2024-12-30T10:00:00"),
32
+ endTime: new Date("2024-12-30T11:00:00"),
33
+ color: "#4285f4",
34
+ },
35
+ ];
36
+ ```
37
+
38
+ ## 属性
39
+
40
+ | 属性 | 类型 | 说明 |
41
+ | -------- | ---------------------------- | -------------------- |
42
+ | `view` | `'month' \| 'week' \| 'day'` | 当前视图 |
43
+ | `date` | `string` | 当前日期(ISO 格式) |
44
+ | `events` | `Event[]` | 事件列表 |
45
+ | `user` | `User` | 当前用户 |
46
+
47
+ 支持 property 和 attribute 两种设置方式(RFC-0008)。
48
+
49
+ ## React
50
+
51
+ 使用 `@calenderjs/react` 封装,见 [packages/react/README.md](../react/README.md)。
52
+
53
+ ## 相关 RFC
54
+
55
+ - [RFC-0005](../../docs/rfc/0005-calendar-component.md) — Calendar Component
56
+ - [RFC-0008](../../docs/rfc/0008-calendar-component-api-redesign.md) — API 设计