@lichta/event-calendar 2.0.0 → 2.0.1
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 +16 -8
- package/package.json +10 -2
package/README.md
CHANGED
|
@@ -7,9 +7,11 @@ Plugin/Adapter tích hợp lịch âm Việt Nam (LichTa) vào thư viện [Even
|
|
|
7
7
|
## Cài đặt
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
pnpm add @lichta/event-calendar @event-calendar/core
|
|
10
|
+
pnpm add @lichta/event-calendar @event-calendar/core @event-calendar/day-grid
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
+
Cài thêm plugin view khác (`@event-calendar/time-grid`, `@event-calendar/list`, ...) tùy theo view bạn muốn dùng — `@event-calendar/day-grid` chỉ là plugin phổ biến nhất cho view tháng.
|
|
14
|
+
|
|
13
15
|
## Cách sử dụng cơ bản
|
|
14
16
|
|
|
15
17
|
Bạn chỉ cần bọc cấu hình gốc của EventCalendar bằng hàm `injectLunarDates`. Adapter sẽ tự động tính toán và tiêm (inject) ngày âm lịch vào các ô ngày trên giao diện lịch.
|
|
@@ -18,17 +20,22 @@ Bạn chỉ cần bọc cấu hình gốc của EventCalendar bằng hàm `injec
|
|
|
18
20
|
import Calendar from '@event-calendar/core';
|
|
19
21
|
import DayGrid from '@event-calendar/day-grid';
|
|
20
22
|
import { injectLunarDates } from '@lichta/event-calendar';
|
|
23
|
+
import '@event-calendar/core/index.css';
|
|
24
|
+
|
|
25
|
+
// injectLunarDates nhận vào object `options` gốc của EventCalendar (không phải
|
|
26
|
+
// object khởi tạo `{ target, props }`) và trả về options đã gắn thêm ngày âm lịch.
|
|
27
|
+
const options = injectLunarDates({
|
|
28
|
+
view: 'dayGridMonth'
|
|
29
|
+
// ... các options gốc khác của EventCalendar
|
|
30
|
+
});
|
|
21
31
|
|
|
22
|
-
const
|
|
32
|
+
const calendar = new Calendar({
|
|
23
33
|
target: document.getElementById('calendar'),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
// ... các options gốc của EventCalendar
|
|
34
|
+
props: {
|
|
35
|
+
plugins: [DayGrid],
|
|
36
|
+
options
|
|
28
37
|
}
|
|
29
38
|
});
|
|
30
|
-
|
|
31
|
-
let calendar = new Calendar(calendarOptions);
|
|
32
39
|
```
|
|
33
40
|
|
|
34
41
|
## Tùy chọn giao diện (Options)
|
|
@@ -71,6 +78,7 @@ const calendarOptions = injectLunarDates(baseOptions, {
|
|
|
71
78
|
## Phụ thuộc (Dependencies)
|
|
72
79
|
- **@lichta/core**: workspace dependency (tự động cài kèm)
|
|
73
80
|
- **@event-calendar/core**: ^3.0.0 (peer dependency)
|
|
81
|
+
- Ít nhất 1 plugin view của EventCalendar (ví dụ **@event-calendar/day-grid**) — cài riêng, không phải dependency của package này
|
|
74
82
|
|
|
75
83
|
## License
|
|
76
84
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lichta/event-calendar",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "EventCalendar adapter for LichTa",
|
|
5
5
|
"author": "Zeforc Labs | Stridev",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"LICENSE"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@lichta/core": "2.0.
|
|
23
|
+
"@lichta/core": "2.0.1"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"@event-calendar/core": "^3.0.0"
|
|
@@ -29,6 +29,14 @@
|
|
|
29
29
|
"@event-calendar/core": "^3.0.0",
|
|
30
30
|
"typescript": "^6.0.0"
|
|
31
31
|
},
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+https://github.com/zeforc/lichta.git"
|
|
35
|
+
},
|
|
36
|
+
"bugs": {
|
|
37
|
+
"url": "https://github.com/zeforc/lichta/issues"
|
|
38
|
+
},
|
|
39
|
+
"homepage": "https://github.com/zeforc/lichta#readme",
|
|
32
40
|
"scripts": {
|
|
33
41
|
"build": "tsup"
|
|
34
42
|
}
|