@lichta/event-calendar 2.0.0 → 2.1.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.
Files changed (2) hide show
  1. package/README.md +19 -8
  2. package/package.json +10 -2
package/README.md CHANGED
@@ -1,15 +1,20 @@
1
1
  # @lichta/event-calendar
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@lichta/event-calendar.svg)](https://www.npmjs.com/package/@lichta/event-calendar)
4
+ [![npm version](https://img.shields.io/npm/v/@lichta/core.svg)](https://www.npmjs.com/package/@lichta/core)
5
+
6
+ 🚀 **[Demo trực tiếp](https://lichta.zeneo.app/)**
4
7
 
5
8
  Plugin/Adapter tích hợp lịch âm Việt Nam (LichTa) vào thư viện [EventCalendar](https://github.com/vkurko/calendar).
6
9
 
7
10
  ## Cài đặt
8
11
 
9
12
  ```bash
10
- pnpm add @lichta/event-calendar @event-calendar/core
13
+ pnpm add @lichta/event-calendar @event-calendar/core @event-calendar/day-grid
11
14
  ```
12
15
 
16
+ 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.
17
+
13
18
  ## Cách sử dụng cơ bản
14
19
 
15
20
  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 +23,22 @@ Bạn chỉ cần bọc cấu hình gốc của EventCalendar bằng hàm `injec
18
23
  import Calendar from '@event-calendar/core';
19
24
  import DayGrid from '@event-calendar/day-grid';
20
25
  import { injectLunarDates } from '@lichta/event-calendar';
26
+ import '@event-calendar/core/index.css';
21
27
 
22
- const calendarOptions = injectLunarDates({
28
+ // injectLunarDates nhận vào object `options` gốc của EventCalendar (không phải
29
+ // object khởi tạo `{ target, props }`) và trả về options đã gắn thêm ngày âm lịch.
30
+ const options = injectLunarDates({
31
+ view: 'dayGridMonth'
32
+ // ... các options gốc khác của EventCalendar
33
+ });
34
+
35
+ const calendar = new Calendar({
23
36
  target: document.getElementById('calendar'),
24
- plugins: [DayGrid],
25
- options: {
26
- view: 'dayGridMonth'
27
- // ... các options gốc của EventCalendar
37
+ props: {
38
+ plugins: [DayGrid],
39
+ options
28
40
  }
29
41
  });
30
-
31
- let calendar = new Calendar(calendarOptions);
32
42
  ```
33
43
 
34
44
  ## Tùy chọn giao diện (Options)
@@ -71,6 +81,7 @@ const calendarOptions = injectLunarDates(baseOptions, {
71
81
  ## Phụ thuộc (Dependencies)
72
82
  - **@lichta/core**: workspace dependency (tự động cài kèm)
73
83
  - **@event-calendar/core**: ^3.0.0 (peer dependency)
84
+ - Í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
85
 
75
86
  ## License
76
87
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lichta/event-calendar",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
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.0"
23
+ "@lichta/core": "2.1.0"
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
  }