@tlmgo/tui-calendar 2.2.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 +183 -0
- package/dist/toastui-calendar.css +1123 -0
- package/dist/toastui-calendar.ie11.js +27300 -0
- package/dist/toastui-calendar.ie11.min.js +9 -0
- package/dist/toastui-calendar.js +19597 -0
- package/dist/toastui-calendar.min.css +6 -0
- package/dist/toastui-calendar.min.js +9 -0
- package/dist/toastui-calendar.mjs +10600 -0
- package/package.json +108 -0
- package/types/factory/calendar.d.ts +14 -0
- package/types/factory/calendarCore.d.ts +504 -0
- package/types/factory/day.d.ts +7 -0
- package/types/factory/month.d.ts +11 -0
- package/types/factory/week.d.ts +7 -0
- package/types/index.d.ts +11 -0
- package/types/time/date.d.ts +206 -0
- package/types/types/eventBus.d.ts +40 -0
- package/types/types/events.d.ts +141 -0
- package/types/types/options.d.ts +82 -0
- package/types/types/template.d.ts +97 -0
- package/types/types/theme.d.ts +140 -0
package/README.md
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# 
|
|
2
|
+
|
|
3
|
+
> A JavaScript calendar that is full featured. Now your service just got the customizable calendar.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@toast-ui/calendar)
|
|
6
|
+
[](https://github.com/nhn/tui.calendar/blob/master/LICENSE)
|
|
7
|
+
[](https://github.com/nhn/tui.calendar/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)
|
|
8
|
+
[](https://github.com/nhn)
|
|
9
|
+
|
|
10
|
+
## 🚩 Table of Contents
|
|
11
|
+
|
|
12
|
+
- [📙 Documents](#-documents)
|
|
13
|
+
- [Collect statistics on the use of open source](#collect-statistics-on-the-use-of-open-source)
|
|
14
|
+
- [💾 Install](#-install)
|
|
15
|
+
- [Using npm](#using-npm)
|
|
16
|
+
- [Via Contents Delivery Network (CDN)](#via-contents-delivery-network-cdn)
|
|
17
|
+
- [Download Source Files](#download-source-files)
|
|
18
|
+
- [📅 Usage](#-usage)
|
|
19
|
+
- [Load](#load)
|
|
20
|
+
- [Implement](#implement)
|
|
21
|
+
- [🔧 Pull Request Steps](#-pull-request-steps)
|
|
22
|
+
- [Setup](#setup)
|
|
23
|
+
- [Develop](#develop)
|
|
24
|
+
- [Pull Request](#pull-request)
|
|
25
|
+
- [💬 Contributing](#-contributing)
|
|
26
|
+
- [📜 License](#-license)
|
|
27
|
+
|
|
28
|
+
## 📙 Documents
|
|
29
|
+
|
|
30
|
+
- [English](/docs/README.md)
|
|
31
|
+
- [Korean](/docs/ko/README.md)
|
|
32
|
+
|
|
33
|
+
## Collect statistics on the use of open source
|
|
34
|
+
|
|
35
|
+
TOAST UI Calendar applies Google Analytics (GA) to collect statistics on the use of open source, in order to identify how widely TOAST UI Calendar is used throughout the world. It also serves as important index to determine the future course of projects. location.hostname (e.g. > “ui.toast.com") is to be collected and the sole purpose is nothing but to measure statistics on the usage.
|
|
36
|
+
|
|
37
|
+
To disable GA, set the [`usageStatistics` option](/docs/en/apis/options.md#usagestatistics) to `false`:
|
|
38
|
+
|
|
39
|
+
```js
|
|
40
|
+
const calendar = new Calendar('#calendar', {
|
|
41
|
+
usageStatistics: false
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## 💾 Install
|
|
46
|
+
|
|
47
|
+
### Using npm
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
npm install --save @toast-ui/calendar
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Via Contents Delivery Network (CDN)
|
|
54
|
+
|
|
55
|
+
TOAST UI products are available over the CDN powered by [NHN Cloud](https://www.toast.com).
|
|
56
|
+
|
|
57
|
+
```html
|
|
58
|
+
<link rel="stylesheet" href="https://uicdn.toast.com/calendar/latest/toastui-calendar.min.css" />
|
|
59
|
+
<script src="https://uicdn.toast.com/calendar/latest/toastui-calendar.min.js"></script>
|
|
60
|
+
|
|
61
|
+
<!-- To get bundle file for legacy browser -->
|
|
62
|
+
<!-- <script src="https://uicdn.toast.com/calendar /latest/toastui-calendar.ie11.min.js"></script> -->
|
|
63
|
+
|
|
64
|
+
<!-- Import as es module -->
|
|
65
|
+
<!-- <script type="module" src="https:// uicdn.toast.com/calendar/latest/toastui-calendar.mjs"></script> -->
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
If you want to use a specific version, use the tag name instead of `latest` in the url's path.
|
|
69
|
+
|
|
70
|
+
The CDN directory has the following structure.
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
- uicdn.toast.com/
|
|
74
|
+
├─ calendar/
|
|
75
|
+
│ ├─ latest
|
|
76
|
+
│ │ ├─ toastui-calendar.css
|
|
77
|
+
│ │ ├─ toastui-calendar.js
|
|
78
|
+
│ │ ├─ toastui-calendar.min.css
|
|
79
|
+
│ │ ├─ toastui-calendar.min.js
|
|
80
|
+
│ │ ├─ toastui-calendar.ie11.js
|
|
81
|
+
│ │ ├─ toastui-calendar.ie11.min.js
|
|
82
|
+
│ │ │ toastui-calendar.mjs
|
|
83
|
+
│ ├─ v2.0.0/
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Download Source Files
|
|
87
|
+
|
|
88
|
+
- [Download all sources for each version](https://github.com/nhn/tui.calendar/releases)
|
|
89
|
+
|
|
90
|
+
## 📅 Usage
|
|
91
|
+
|
|
92
|
+
### Load
|
|
93
|
+
|
|
94
|
+
TOAST UI Calendar can be instantiated through the constructor function. There are three ways to access the constructor function depending on the environment.
|
|
95
|
+
|
|
96
|
+
```js
|
|
97
|
+
/* ES6 module in Node.js environment */
|
|
98
|
+
import Calendar from '@toast-ui/calendar';
|
|
99
|
+
import '@toast-ui/calendar/dist/toastui-calendar.min.css';
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
```js
|
|
103
|
+
/* CommonJS in Node.js environment */
|
|
104
|
+
const Calendar = require('@toast-ui/calendar');
|
|
105
|
+
require('@toast-ui/calendar/dist/toastui-calendar.min.css');
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
```js
|
|
109
|
+
/* in the browser environment namespace */
|
|
110
|
+
const Calendar = tui.Calendar;
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Implement
|
|
114
|
+
|
|
115
|
+
```html
|
|
116
|
+
<div id="calendar" style="height: 800px"></div>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
```javascript
|
|
120
|
+
const calendar = new Calendar('#calendar', {
|
|
121
|
+
defaultView: 'week',
|
|
122
|
+
template: {
|
|
123
|
+
time(event) {
|
|
124
|
+
const { start, end, title } = event;
|
|
125
|
+
|
|
126
|
+
return `<span style="color: white;">${formatTime(start)}~${formatTime(end)} ${title}</span>`;
|
|
127
|
+
},
|
|
128
|
+
allday(event) {
|
|
129
|
+
return `<span style="color: gray;">${event.title}</span>`;
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
calendars: [
|
|
133
|
+
{
|
|
134
|
+
id: 'cal1',
|
|
135
|
+
name: 'Personal',
|
|
136
|
+
backgroundColor: '#03bd9e',
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
id: 'cal2',
|
|
140
|
+
name: 'Work',
|
|
141
|
+
backgroundColor: '#00a9ff',
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
});
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## 🔧 Pull Request Steps
|
|
148
|
+
|
|
149
|
+
TOAST UI products are open source, so you can create a pull request(PR) after you fix issues.
|
|
150
|
+
Run npm scripts and develop yourself with the following process.
|
|
151
|
+
|
|
152
|
+
### Setup
|
|
153
|
+
|
|
154
|
+
Fork `main` branch into your personal repository.
|
|
155
|
+
Clone it to local computer. Install node modules.
|
|
156
|
+
Before starting development, you should check to have any errors.
|
|
157
|
+
|
|
158
|
+
``` sh
|
|
159
|
+
git clone https://github.com/{your-personal-repo}/[[repo name]].git
|
|
160
|
+
cd [[repo name]]
|
|
161
|
+
npm install
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Develop
|
|
165
|
+
|
|
166
|
+
Let's start development!
|
|
167
|
+
|
|
168
|
+
### Pull Request
|
|
169
|
+
|
|
170
|
+
Before PR, check to test lastly and then check any errors.
|
|
171
|
+
If it has no error, commit and then push it!
|
|
172
|
+
|
|
173
|
+
For more information on PR's step, please see links of Contributing section.
|
|
174
|
+
|
|
175
|
+
## 💬 Contributing
|
|
176
|
+
|
|
177
|
+
- [Code of Conduct](/CODE_OF_CONDUCT.md)
|
|
178
|
+
- [Contributing Guidelines](/CONTRIBUTING.md)
|
|
179
|
+
- [Commit Message Convention](/docs/COMMIT_MESSAGE_CONVENTION.md)
|
|
180
|
+
|
|
181
|
+
## 📜 License
|
|
182
|
+
|
|
183
|
+
This software is licensed under the [MIT](/LICENSE) © [NHN Cloud](https://github.com/nhn).
|