add-to-calendar-button 1.6.4 → 1.7.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/Gruntfile.js +2 -1
- package/README.md +86 -38
- package/assets/css/atcb.css +32 -13
- package/assets/css/atcb.min.css +1 -1
- package/assets/css/atcb.min.css.map +1 -1
- package/index.d.ts +25 -0
- package/npm_dist/cjs/index.js +184 -118
- package/npm_dist/mjs/index.js +184 -118
- package/package.json +1 -1
package/Gruntfile.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
const npmDelimiter = /\/\/ START INIT[\s\S]*?\/\/ END INIT/gm
|
|
2
2
|
|
|
3
3
|
function process(content, exportPhrase) {
|
|
4
|
-
|
|
4
|
+
content = content.replace('atcb_addToCalendar', 'addToCalendar');
|
|
5
|
+
return content.replace(npmDelimiter, `${exportPhrase} { addToCalendar, atcb_init };`);
|
|
5
6
|
}
|
|
6
7
|
module.exports = function(grunt) {
|
|
7
8
|
|
package/README.md
CHANGED
|
@@ -1,36 +1,44 @@
|
|
|
1
|
-
# Your next Add-to-Calendar Button
|
|
1
|
+
# 📅 Your next Add-to-Calendar Button!
|
|
2
2
|

|
|
3
3
|
|
|
4
|
-
_A convenient JavaScript snippet, which lets you create beautiful buttons, where people can add events to their calendars._
|
|
4
|
+
_A convenient JavaScript snippet, which lets you create beautiful buttons, where people can add events to their calendars._
|
|
5
5
|
|
|
6
|
+

|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
<br /><br />
|
|
9
|
+
|
|
10
|
+
## 😎 Use case // Who this is for
|
|
8
11
|
|
|
9
12
|
This is for everybody, who wants to include a button at his/her website or app, which enables users to easily add a specific event to their calendars.
|
|
10
13
|
It's main goal is to keep this process as easy as possible. Simply define your button configuration via JSON and everything else is automatically generated by the script.
|
|
11
14
|
It is for this simple use case. No strings attached.
|
|
12
15
|
|
|
16
|
+
<br />
|
|
13
17
|
|
|
14
|
-
## Background // Why this repo exists
|
|
18
|
+
## 🔎 Background // Why this repo exists
|
|
15
19
|
|
|
16
20
|
While building a personal wedding page, I was confronted with the task to include a button, where invited people could save the event to their calendars.
|
|
17
21
|
I did not want to build this from scratch (first) and therefore started the usual web research.
|
|
18
22
|
Unfortunately, all I found where some extremely outdated code snippets, which did not really fit all the modern systems and calendar tools.
|
|
19
|
-
Beside that, there was only the solution by AddEvent.com - all over the place. I was looking at CodePen and all I found where thousands of pens, which basically only included the AddEvent tool.
|
|
23
|
+
Beside that, there was only the solution by AddEvent.com - all over the place. I was looking at CodePen and all I found where thousands of pens, which basically only included the AddEvent tool.
|
|
24
|
+
|
|
20
25
|
The problems with AddEvent.com:
|
|
21
26
|
* it holds tons of features, which I did not need. I do not want to track my button. I just want it to work.
|
|
22
27
|
* it limits the free tier to 50 event adds per month (consider the wedding case - this is way too less).
|
|
23
|
-
* it brings some data privacy issues, since you basically send your users to their service.
|
|
24
|
-
* the UX/UI is not ideal (imho).
|
|
25
|
-
|
|
28
|
+
* it brings some data privacy issues, since you basically send your users to their service. GDPR alert!
|
|
29
|
+
* the UX/UI is not ideal (imho).
|
|
30
|
+
|
|
31
|
+
**Bottom line:** Paying for features, which I did not need - at additional privacy concerns - that made me create this solution (for you).
|
|
26
32
|
|
|
33
|
+
<br />
|
|
27
34
|
|
|
28
|
-
##
|
|
35
|
+
## ▶️ Demo
|
|
29
36
|
|
|
30
37
|
See [jekuer.github.io/add-to-calendar-button](https://jekuer.github.io/add-to-calendar-button/) for a live demo.
|
|
31
38
|
|
|
39
|
+
<br />
|
|
32
40
|
|
|
33
|
-
## Features
|
|
41
|
+
## ✨ Features
|
|
34
42
|
|
|
35
43
|
* Simple and convenient integration of multiple buttons - configure them directly within the HTML code.
|
|
36
44
|
* Optimized UX (for desktop and mobile) - adjustable.
|
|
@@ -41,13 +49,14 @@ See [jekuer.github.io/add-to-calendar-button](https://jekuer.github.io/add-to-ca
|
|
|
41
49
|
* Microsoft 365, Outlook, and Teams.
|
|
42
50
|
* Automatically generated iCal/ics files (for all other calendars, like Apple).
|
|
43
51
|
* Timed and all-day events.
|
|
44
|
-
* Translatable labels and dynamic.
|
|
45
|
-
* Well documented code, to easily understand the processes.
|
|
52
|
+
* Translatable labels and dynamic dates.
|
|
53
|
+
* Well documented code, to easily understand the processes and build on top of it.
|
|
46
54
|
|
|
47
55
|

|
|
48
56
|
|
|
57
|
+
<br />
|
|
49
58
|
|
|
50
|
-
## Setup
|
|
59
|
+
## 🌱 Setup
|
|
51
60
|
|
|
52
61
|
### Option 1: simple
|
|
53
62
|
|
|
@@ -59,18 +68,19 @@ See [jekuer.github.io/add-to-calendar-button](https://jekuer.github.io/add-to-ca
|
|
|
59
68
|
|
|
60
69
|
### Option 2: npm
|
|
61
70
|
|
|
62
|
-
1. Requires Node
|
|
71
|
+
1. Requires Node, npm, and a project, which builds on it (e.g. React or Angular).
|
|
63
72
|
2. Run **`npm install add-to-calendar-button`**.
|
|
64
|
-
3. Import the module into your project/component. For example with Angular/React: `import { atcb_init } from 'add-to-calendar-button';`.
|
|
65
|
-
4.
|
|
73
|
+
3. Import the module into your project/component. For example with Angular/React: `import { addToCalendar, atcb_init } from 'add-to-calendar-button';`.
|
|
74
|
+
4. Either use `addToCalendar` with your own buttons/forms/etc, or run `atcb_init` after the DOM has been loaded. To determine the right moment and execute, ...
|
|
66
75
|
1. with Angular, you would use `ngAfterViewInit()` with `atcb_init();` (mind that, depending on your app, other hooks might be better);
|
|
67
76
|
2. with React, you might want to include an event listener like `document.addEventListener('DOMContentLoaded', atcb_init, false);` or using hooks in a functional component like `useEffect(() => atcb_init());`
|
|
68
77
|
5. Include the css. For example with Angular or React, add the following to the global style.css: `@import 'add-to-calendar-button/assets/css/atcb.min'`;
|
|
69
78
|
6. Create your button as can be seen in the "Configuration" section below.
|
|
70
79
|
7. That is it. The script takes care of all the rest. :)
|
|
71
80
|
|
|
81
|
+
<br />
|
|
72
82
|
|
|
73
|
-
## Configuration
|
|
83
|
+
## 🎛️ Configuration
|
|
74
84
|
|
|
75
85
|
A button can be easily created by placing a respective placeholder, wherever you want the button to appear.
|
|
76
86
|
(The `style="display:none;"` theoretically is not necessary, but should be used for better compatibility.)
|
|
@@ -163,25 +173,57 @@ You can use startTime and endTime in the event block, but it is recommended to r
|
|
|
163
173
|
</div>
|
|
164
174
|
```
|
|
165
175
|
|
|
166
|
-
###
|
|
176
|
+
### `addToCalendar` example with React
|
|
167
177
|
|
|
168
|
-
|
|
169
|
-
|
|
178
|
+
If you can't or don't want to use `atcb_init`, you can use the `addToCalendar` import with your own buttons or other elements/components. If you omit the second argument, the dropdown list will display as a modal in the middle of the viewport - in this case, add the "atcb_customTrigger" class to the submitting element for better keyboard support.
|
|
179
|
+
|
|
180
|
+
This may work better with React and other frontend frameworks.
|
|
170
181
|
|
|
171
182
|
```js
|
|
183
|
+
import React from 'react'
|
|
184
|
+
import { addToCalendar } from 'add-to-calendar-button'
|
|
185
|
+
|
|
172
186
|
const AddToCalendar = () => {
|
|
187
|
+
const [name, setName] = React.useState('Some event')
|
|
188
|
+
return (
|
|
189
|
+
<form onSubmit={e => {
|
|
190
|
+
e.preventDefault()
|
|
191
|
+
addToCalendar({
|
|
192
|
+
name,
|
|
193
|
+
startDate: "2022-01-14",
|
|
194
|
+
endDate: "2022-01-18",
|
|
195
|
+
options: ['Apple', 'Google', 'iCal', 'Microsoft365', 'Outlook.com', 'MicrosoftTeams', 'Yahoo'],
|
|
196
|
+
trigger: "click",
|
|
197
|
+
iCalFileName: "Reminder-Event",
|
|
198
|
+
})
|
|
199
|
+
}}>
|
|
200
|
+
<input value={name} onChange={setName} />
|
|
201
|
+
<input class="atcb_customTrigger" type="submit" value="save">
|
|
202
|
+
</form>
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
```
|
|
173
206
|
|
|
174
|
-
|
|
207
|
+
Alternatively, you could use `atcb_init` with a `useEffect` hook:
|
|
175
208
|
|
|
176
|
-
|
|
209
|
+
```js
|
|
210
|
+
import React from 'react'
|
|
211
|
+
import { atcb_init } from 'add-to-calendar-button'
|
|
177
212
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
213
|
+
const AddToCalendar = () => {
|
|
214
|
+
React.useEffect(atcb_init, [])
|
|
215
|
+
return (
|
|
216
|
+
<div className='atcb' style={{display: 'none'}}>
|
|
217
|
+
{JSON.stringify({
|
|
218
|
+
name: "Some event",
|
|
219
|
+
startDate: "2022-01-14",
|
|
220
|
+
endDate: "2022-01-18",
|
|
221
|
+
options: ['Apple', 'Google', 'iCal', 'Microsoft365', 'Outlook.com', 'MicrosoftTeams', 'Yahoo'],
|
|
222
|
+
trigger: "click",
|
|
223
|
+
iCalFileName: "Reminder-Event",
|
|
224
|
+
})}
|
|
225
|
+
</div>
|
|
226
|
+
);
|
|
185
227
|
}
|
|
186
228
|
```
|
|
187
229
|
|
|
@@ -189,8 +231,8 @@ const AddToCalendar = () => {
|
|
|
189
231
|
|
|
190
232
|
* The "label" is optional, but enables you to customize the button text. Default: "Add to Calendar".
|
|
191
233
|
* Dates need to be formatted as YYYY-MM-DD ([ISO-8601](https://en.wikipedia.org/wiki/ISO_8601)).
|
|
192
|
-
* You can also use the word "today" as date. It will then dynamically use the current day at click.
|
|
193
|
-
* Add "+5" at the end of the date to dynamically add 5 days (or any other number). "2022-01-30+12" would generate the 11th of February 2022. This can be interesting, when combined with "today".
|
|
234
|
+
* You can also use the word "today" as date. It will then dynamically use the current day at click (not supported with schema.org style).
|
|
235
|
+
* Add "+5" at the end of the date to dynamically add 5 days (or any other number). "2022-01-30+12" would generate the 11th of February 2022. This can be interesting, when combined with "today".
|
|
194
236
|
* Times need to be formatted as HH:MM.
|
|
195
237
|
* Times are optional. If not set, the button generates all-day events.
|
|
196
238
|
* 1 option is required. You can add as many as you want. The supported formats are listed above.
|
|
@@ -207,8 +249,9 @@ const AddToCalendar = () => {
|
|
|
207
249
|
* Formatting a URL in the description like `[url]https://....[/url]` makes it clickable.
|
|
208
250
|
* If you require line breaks within the description, use `\n` or `<br>`.
|
|
209
251
|
|
|
252
|
+
<br />
|
|
210
253
|
|
|
211
|
-
## Contributing
|
|
254
|
+
## 🙌 Contributing
|
|
212
255
|
|
|
213
256
|
Anyone is welcome to contribute, but mind the [guidelines](.github/CONTRIBUTING.md):
|
|
214
257
|
|
|
@@ -216,16 +259,19 @@ Anyone is welcome to contribute, but mind the [guidelines](.github/CONTRIBUTING.
|
|
|
216
259
|
* [Feature requests](.github/CONTRIBUTING.md#features)
|
|
217
260
|
* [Pull requests](.github/CONTRIBUTING.md#pull-requests)
|
|
218
261
|
|
|
219
|
-
IMPORTANT NOTE
|
|
262
|
+
**IMPORTANT NOTE:** Run `npm install` and `npm run build` to create the minified js and css file, its sourcemap files as well as the npm_dist/ folder and content!
|
|
220
263
|
|
|
264
|
+
<br />
|
|
221
265
|
|
|
222
|
-
## License
|
|
266
|
+
## 📃 License
|
|
223
267
|
|
|
224
268
|
The code is available under the [MIT license (with “Commons Clause” License Condition v1.0)](LICENSE.txt).
|
|
225
269
|
|
|
270
|
+
<br />
|
|
226
271
|
|
|
227
|
-
## Changelog (without
|
|
272
|
+
## ⚡ Changelog (without minor changes and fixes)
|
|
228
273
|
|
|
274
|
+
* v1.7 : new code structure and options + tons of optimizations
|
|
229
275
|
* v1.6 : supporting Microsoft Teams
|
|
230
276
|
* v1.5 : update to date format and better accesibility
|
|
231
277
|
* v1.4 : schema.org support (also changed some keys in the JSON!)
|
|
@@ -234,8 +280,10 @@ The code is available under the [MIT license (with “Commons Clause” License
|
|
|
234
280
|
* v1.1 : npm functionality
|
|
235
281
|
* v1.0 : initial release
|
|
236
282
|
|
|
283
|
+
<br />
|
|
237
284
|
|
|
238
|
-
## Kudos go to
|
|
239
|
-
* [github.com/dudewheresmycode](https://github.com/dudewheresmycodee)
|
|
285
|
+
## 💜 Kudos go to
|
|
240
286
|
* [uxwing.com](https://uxwing.com)
|
|
241
|
-
*
|
|
287
|
+
* [Brian R (dudewheresmycode)](https://github.com/dudewheresmycode)
|
|
288
|
+
* [Chad Ostrowski (chadoh)](https://github.com/chadoh)
|
|
289
|
+
* ... and all other contributors!
|
package/assets/css/atcb.css
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Add-to-Calendar Button
|
|
4
4
|
* ++++++++++++++++++++++
|
|
5
5
|
*
|
|
6
|
-
* Version: 1.
|
|
6
|
+
* Version: 1.7.0
|
|
7
7
|
* Creator: Jens Kuerschner (https://jenskuerschner.de)
|
|
8
8
|
* Project: https://github.com/jekuer/add-to-calendar-button
|
|
9
9
|
* License: MIT with “Commons Clause” License Condition v1.0
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.atcb_button {
|
|
23
|
+
align-items: center;
|
|
23
24
|
background: rgb(245, 245, 245);
|
|
24
25
|
border: 1px solid rgb(210, 210, 210);
|
|
25
26
|
border-radius: 6px;
|
|
@@ -27,11 +28,10 @@
|
|
|
27
28
|
box-shadow: 1px 2px 10px 0px rgba(0,0,0,.4);
|
|
28
29
|
color: rgb(51, 51, 51);
|
|
29
30
|
cursor: pointer;
|
|
30
|
-
display:
|
|
31
|
+
display: flex;
|
|
31
32
|
font-size: 16px;
|
|
32
33
|
font-weight: 600;
|
|
33
34
|
line-height: 24px;
|
|
34
|
-
margin: 10px auto;
|
|
35
35
|
max-width: 300px;
|
|
36
36
|
min-width: 150px;
|
|
37
37
|
padding: 10px 16px 11px 16px;
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
-webkit-tap-highlight-color: transparent;
|
|
46
46
|
width: auto;
|
|
47
47
|
}
|
|
48
|
+
.atcb_button:focus,
|
|
48
49
|
.atcb_button:hover {
|
|
49
50
|
background: rgb(255, 255, 255);
|
|
50
51
|
}
|
|
@@ -54,22 +55,21 @@
|
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
57
|
|
|
57
|
-
.atcb_button.
|
|
58
|
+
.atcb_button.atcb_active {
|
|
58
59
|
background: rgb(255, 255, 255);
|
|
59
60
|
border-radius: 6px 6px 3px 3px;
|
|
60
|
-
-webkit-box-shadow: 1px 5px 15px 0px rgba(0,0,0,.5);
|
|
61
|
+
-webkit-box-shadow: 1px 5px 15px 0px rgba(0,0,0,.5);
|
|
61
62
|
box-shadow: 1px 5px 15px 0px rgba(0,0,0,.5);
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
padding: 12px 20px 13px 20px;
|
|
64
|
+
margin-bottom: -4px;
|
|
64
65
|
z-index: 90;
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
.atcb_icon {
|
|
68
69
|
height: 16px;
|
|
69
|
-
display: inline-
|
|
70
|
+
display: inline-block;
|
|
70
71
|
margin-bottom: 4px;
|
|
71
72
|
margin-right: 10px;
|
|
72
|
-
vertical-align: middle;
|
|
73
73
|
}
|
|
74
74
|
.atcb_icon svg {
|
|
75
75
|
height: 100%;
|
|
@@ -80,8 +80,7 @@
|
|
|
80
80
|
.atcb_list {
|
|
81
81
|
box-sizing: border-box;
|
|
82
82
|
color: rgb(51, 51, 51);
|
|
83
|
-
display: block;
|
|
84
|
-
margin: -10px auto 0 auto;
|
|
83
|
+
display: block;
|
|
85
84
|
max-width: 100%;
|
|
86
85
|
position: absolute;
|
|
87
86
|
padding: 0 3px;
|
|
@@ -90,10 +89,20 @@
|
|
|
90
89
|
-ms-user-select: none;
|
|
91
90
|
user-select: none;
|
|
92
91
|
width: 100%;
|
|
92
|
+
min-width: 10em;
|
|
93
93
|
z-index: 80;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
.atcb_list.atcb_modal {
|
|
97
|
+
position: fixed;
|
|
98
|
+
width: 16em;
|
|
99
|
+
left: 50%;
|
|
100
|
+
top: 50%;
|
|
101
|
+
transform: translateY(-50%) translateX(-50%);
|
|
102
|
+
}
|
|
103
|
+
|
|
96
104
|
.atcb_list_item {
|
|
105
|
+
align-items: center;
|
|
97
106
|
background: rgb(250, 250, 250);
|
|
98
107
|
border: 1px solid rgb(210, 210, 210);
|
|
99
108
|
border-top: 0;
|
|
@@ -101,6 +110,7 @@
|
|
|
101
110
|
box-shadow: 1px 2px 8px 0px rgba(0,0,0,.3);
|
|
102
111
|
box-sizing: border-box;
|
|
103
112
|
cursor: pointer;
|
|
113
|
+
display: flex;
|
|
104
114
|
font-size: 16px;
|
|
105
115
|
left: 50%;
|
|
106
116
|
position: relative;
|
|
@@ -110,6 +120,7 @@
|
|
|
110
120
|
touch-action: manipulation;
|
|
111
121
|
-webkit-tap-highlight-color: transparent;
|
|
112
122
|
}
|
|
123
|
+
.atcb_list_item:focus,
|
|
113
124
|
.atcb_list_item:hover {
|
|
114
125
|
background: rgb(255, 255, 255);
|
|
115
126
|
-webkit-box-shadow: 1px 2px 10px 0px rgba(0,0,0,.4);
|
|
@@ -122,8 +133,12 @@
|
|
|
122
133
|
}
|
|
123
134
|
}
|
|
124
135
|
|
|
125
|
-
.atcb_list_item:first-child {
|
|
126
|
-
padding-top:
|
|
136
|
+
.atcb_list.atcb_generated_button .atcb_list_item:first-child {
|
|
137
|
+
padding-top: 20px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.atcb_list:not(.atcb_generated_button) .atcb_list_item:first-child {
|
|
141
|
+
border-radius: 6px 6px 0 0;
|
|
127
142
|
}
|
|
128
143
|
|
|
129
144
|
.atcb_list_item:last-child {
|
|
@@ -133,6 +148,7 @@
|
|
|
133
148
|
|
|
134
149
|
.atcb_list_item .atcb_icon {
|
|
135
150
|
margin-right: 8px;
|
|
151
|
+
width: 18px;
|
|
136
152
|
}
|
|
137
153
|
|
|
138
154
|
.atcb_bgoverlay {
|
|
@@ -145,3 +161,6 @@
|
|
|
145
161
|
width: 100%;
|
|
146
162
|
z-index: 70;
|
|
147
163
|
}
|
|
164
|
+
.atcb_bgoverlay.atcb_click:hover {
|
|
165
|
+
cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath fill-rule='evenodd' d='M11.991.69a2.35 2.35 0 0 1 3.318-.009c.918.911.922 2.392.009 3.307l-4.009 4.014 4.013 4.018c.906.909.893 2.38-.027 3.287a2.35 2.35 0 0 1-3.307-.004l-3.985-3.99-3.993 3.997a2.35 2.35 0 0 1-3.318.009c-.918-.911-.922-2.392-.009-3.307l4.009-4.014L.678 3.98C-.228 3.072-.215 1.6.706.693a2.35 2.35 0 0 1 3.307.004l3.985 3.99z'/%3E%3C/svg%3E") 32 32, pointer;
|
|
166
|
+
}
|
package/assets/css/atcb.min.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.atcb{display:none}.atcb_button_wrapper{display:inline-block;position:relative}.atcb_button{background:#f5f5f5;border:1px solid #d2d2d2;border-radius:6px;-webkit-box-shadow:1px 2px 10px 0 rgba(0,0,0,.4);box-shadow:1px 2px 10px 0 rgba(0,0,0,.4);color:#333;cursor:pointer;display:
|
|
1
|
+
.atcb{display:none}.atcb_button_wrapper{display:inline-block;position:relative}.atcb_button{align-items:center;background:#f5f5f5;border:1px solid #d2d2d2;border-radius:6px;-webkit-box-shadow:1px 2px 10px 0 rgba(0,0,0,.4);box-shadow:1px 2px 10px 0 rgba(0,0,0,.4);color:#333;cursor:pointer;display:flex;font-size:16px;font-weight:600;line-height:24px;max-width:300px;min-width:150px;padding:10px 16px 11px 16px;position:relative;text-align:center;touch-action:manipulation;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;width:auto}.atcb_button:focus,.atcb_button:hover{background:#fff}@media only screen and (max-width:575px){.atcb_button{font-size:14px}}.atcb_button.atcb_active{background:#fff;border-radius:6px 6px 3px 3px;-webkit-box-shadow:1px 5px 15px 0 rgba(0,0,0,.5);box-shadow:1px 5px 15px 0 rgba(0,0,0,.5);padding:12px 20px 13px 20px;margin-bottom:-4px;z-index:90}.atcb_icon{height:16px;display:inline-block;margin-bottom:4px;margin-right:10px}.atcb_icon svg{height:100%;color:#333;width:auto}.atcb_list{box-sizing:border-box;color:#333;display:block;max-width:100%;position:absolute;padding:0 3px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%;min-width:10em;z-index:80}.atcb_list.atcb_modal{position:fixed;width:16em;left:50%;top:50%;transform:translateY(-50%) translateX(-50%)}.atcb_list_item{align-items:center;background:#fafafa;border:1px solid #d2d2d2;border-top:0;-webkit-box-shadow:1px 2px 8px 0 rgba(0,0,0,.3);box-shadow:1px 2px 8px 0 rgba(0,0,0,.3);box-sizing:border-box;cursor:pointer;display:flex;font-size:16px;left:50%;position:relative;padding:12px 18px;text-align:left;transform:translate(-50%);touch-action:manipulation;-webkit-tap-highlight-color:transparent}.atcb_list_item:focus,.atcb_list_item:hover{background:#fff;-webkit-box-shadow:1px 2px 10px 0 rgba(0,0,0,.4);box-shadow:1px 2px 10px 0 rgba(0,0,0,.4);color:#000}@media only screen and (max-width:575px){.atcb_list_item{font-size:14px}}.atcb_list.atcb_generated_button .atcb_list_item:first-child{padding-top:20px}.atcb_list:not(.atcb_generated_button) .atcb_list_item:first-child{border-radius:6px 6px 0 0}.atcb_list_item:last-child{border-radius:0 0 6px 6px}.atcb_list_item .atcb_icon{margin-right:8px;width:18px}.atcb_bgoverlay{background:rgba(20,20,20,.2);backdrop-filter:blur(2px);height:100%;left:0;position:fixed;top:0;width:100%;z-index:70}.atcb_bgoverlay.atcb_click:hover{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath fill-rule='evenodd' d='M11.991.69a2.35 2.35 0 0 1 3.318-.009c.918.911.922 2.392.009 3.307l-4.009 4.014 4.013 4.018c.906.909.893 2.38-.027 3.287a2.35 2.35 0 0 1-3.307-.004l-3.985-3.99-3.993 3.997a2.35 2.35 0 0 1-3.318.009c-.918-.911-.922-2.392-.009-3.307l4.009-4.014L.678 3.98C-.228 3.072-.215 1.6.706.693a2.35 2.35 0 0 1 3.307.004l3.985 3.99z'/%3E%3C/svg%3E") 32 32,pointer}
|
|
2
2
|
/*# sourceMappingURL=atcb.min.css.map */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["assets\\css\\atcb.css"],"names":[],"mappings":"AAYA,MACE,QAAS,KAGX,qBACE,QAAS,aACT,SAAU,SAGZ,aACE,WAAY,QACZ,OAAQ,IAAI,MAAM,QAClB,cAAe,IACf,mBAAoB,IAAI,IAAI,KAAK,EAAI,eACrC,WAAY,IAAI,IAAI,KAAK,EAAI,eAC7B,MAAO,KACP,OAAQ,QACR,QAAS,
|
|
1
|
+
{"version":3,"sources":["assets\\css\\atcb.css"],"names":[],"mappings":"AAYA,MACE,QAAS,KAGX,qBACE,QAAS,aACT,SAAU,SAGZ,aACE,YAAa,OACb,WAAY,QACZ,OAAQ,IAAI,MAAM,QAClB,cAAe,IACf,mBAAoB,IAAI,IAAI,KAAK,EAAI,eACrC,WAAY,IAAI,IAAI,KAAK,EAAI,eAC7B,MAAO,KACP,OAAQ,QACR,QAAS,KACT,UAAW,KACX,YAAa,IACb,YAAa,KACb,UAAW,MACX,UAAW,MACX,QAAS,KAAK,KAAK,KAAK,KACxB,SAAU,SACV,WAAY,OACZ,aAAc,aACd,oBAAqB,KACrB,iBAAkB,KAClB,gBAAiB,KACjB,YAAa,KACb,4BAA6B,YAC7B,MAAO,KAET,mBACA,mBACE,WAAY,KAEd,yCACE,aACE,UAAW,MAIf,yBACE,WAAY,KACZ,cAAe,IAAI,IAAI,IAAI,IAC3B,mBAAoB,IAAI,IAAI,KAAK,EAAI,eACrC,WAAY,IAAI,IAAI,KAAK,EAAI,eAC7B,QAAS,KAAK,KAAK,KAAK,KACxB,cAAe,KACf,QAAS,GAGX,WACE,OAAQ,KACR,QAAS,aACT,cAAe,IACf,aAAc,KAEhB,eACE,OAAQ,KACR,MAAO,KACP,MAAO,KAGT,WACE,WAAY,WACZ,MAAO,KACP,QAAS,MACT,UAAW,KACX,SAAU,SACV,QAAS,EAAE,IACX,oBAAqB,KACrB,iBAAkB,KAClB,gBAAiB,KACjB,YAAa,KACb,MAAO,KACP,UAAW,KACX,QAAS,GAGX,sBACE,SAAU,MACV,MAAO,KACP,KAAM,IACN,IAAK,IACL,UAAW,iBAAiB,iBAG9B,gBACE,YAAa,OACb,WAAY,QACZ,OAAQ,IAAI,MAAM,QAClB,WAAY,EACZ,mBAAoB,IAAI,IAAI,IAAI,EAAI,eACpC,WAAY,IAAI,IAAI,IAAI,EAAI,eAC5B,WAAY,WACZ,OAAQ,QACR,QAAS,KACT,UAAW,KACX,KAAM,IACN,SAAU,SACV,QAAS,KAAK,KACd,WAAY,KACZ,UAAW,gBACX,aAAc,aACd,4BAA6B,YAE/B,sBACA,sBACE,WAAY,KACZ,mBAAoB,IAAI,IAAI,KAAK,EAAI,eACrC,WAAY,IAAI,IAAI,KAAK,EAAI,eAC7B,MAAO,KAET,yCACE,gBACE,UAAW,MAIf,6DACE,YAAa,KAGf,mEACE,cAAe,IAAI,IAAI,EAAE,EAG3B,2BACE,cAAe,EAAE,EAAE,IAAI,IAIzB,2BACE,aAAc,IACd,MAAO,KAGT,gBACE,WAAY,kBACZ,gBAAiB,UACjB,OAAQ,KACR,KAAM,EACN,SAAU,MACV,IAAK,EACL,MAAO,KACP,QAAS,GAEX,iCACE,OAAQ,2cAA2c,GAAG,EAAE,CAAE"}
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
1
|
declare module 'add-to-calendar-button' {
|
|
2
|
+
export type ISO8601Date = string;
|
|
3
|
+
export type ISO8601Time = string;
|
|
2
4
|
export function atcb_init(): any;
|
|
5
|
+
export function addToCalendar (
|
|
6
|
+
config: {
|
|
7
|
+
name?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
startDate: ISO8601Date | "today";
|
|
10
|
+
endDate: ISO8601Date;
|
|
11
|
+
startTime?: ISO8601Time;
|
|
12
|
+
endTime?: ISO8601Time;
|
|
13
|
+
location?: string;
|
|
14
|
+
options: ("Apple" | "Google" | "iCal" | "Microsoft365" | "MicrosoftTeams" | "Outlook.com" | "Yahoo")[],
|
|
15
|
+
timeZone?: string;
|
|
16
|
+
timeZoneOffset?: string;
|
|
17
|
+
iCalFileName?: string;
|
|
18
|
+
/**
|
|
19
|
+
* By default, the dropdown list will be opened on hover and closed as
|
|
20
|
+
* soon as you mouse over the background overlay. If you want it to
|
|
21
|
+
* instead close only when thebackground overlay is clicked, set this
|
|
22
|
+
* to `"click"`.
|
|
23
|
+
*/
|
|
24
|
+
trigger?: "click";
|
|
25
|
+
},
|
|
26
|
+
placeBelow?: HTMLElement
|
|
27
|
+
): void;
|
|
3
28
|
}
|