@axium/calendar 0.3.2 → 0.3.4
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axium/calendar",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"author": "James Prevett <axium@jamespre.dev>",
|
|
5
5
|
"description": "Calendar for Axium",
|
|
6
6
|
"funding": {
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"rrule": "^2.8.1",
|
|
46
|
+
"svelte-gestures": "^5.2.2",
|
|
46
47
|
"zod": "^4.0.5"
|
|
47
48
|
},
|
|
48
49
|
"axium": {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
import { fetchAPI } from '@axium/client/requests';
|
|
19
19
|
import { colorHashHex, encodeColor } from '@axium/core/color';
|
|
20
20
|
import { rrulestr } from 'rrule';
|
|
21
|
+
import { useSwipe } from 'svelte-gestures';
|
|
21
22
|
import { SvelteDate } from 'svelte/reactivity';
|
|
22
23
|
import { _throw } from 'utilium';
|
|
23
24
|
import * as z from 'zod';
|
|
@@ -117,7 +118,9 @@
|
|
|
117
118
|
<span class="label">{weekDays[0].toLocaleString('default', { month: 'long', year: 'numeric' })}</span>
|
|
118
119
|
|
|
119
120
|
<!-- mobile -->
|
|
120
|
-
<button class="reset mobile-only
|
|
121
|
+
<button class="reset mobile-only" onclick={() => start.setTime(today.getTime())}>
|
|
122
|
+
<span class="day-number today">{today.getDate()}</span>
|
|
123
|
+
</button>
|
|
121
124
|
<button class="reset mobile-only icon-text" command="show-modal" commandfor="event-init"><Icon i="plus" /></button>
|
|
122
125
|
</div>
|
|
123
126
|
<div id="cal-sidebar" bind:this={calSidebar}>
|
|
@@ -186,7 +189,27 @@
|
|
|
186
189
|
{/each}
|
|
187
190
|
{/if}
|
|
188
191
|
</div>
|
|
189
|
-
<div
|
|
192
|
+
<div
|
|
193
|
+
id="cal"
|
|
194
|
+
{...useSwipe(
|
|
195
|
+
e => {
|
|
196
|
+
if (e.detail.pointerType != 'touch') return;
|
|
197
|
+
switch (e.detail.direction) {
|
|
198
|
+
case 'left':
|
|
199
|
+
start.setDate(start.getDate() + spanDays);
|
|
200
|
+
end.setDate(end.getDate() + spanDays);
|
|
201
|
+
break;
|
|
202
|
+
case 'right':
|
|
203
|
+
start.setDate(start.getDate() - spanDays);
|
|
204
|
+
end.setDate(end.getDate() - spanDays);
|
|
205
|
+
break;
|
|
206
|
+
case 'top':
|
|
207
|
+
case 'bottom':
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
() => ({ touchAction: 'pan-y' })
|
|
211
|
+
)}
|
|
212
|
+
>
|
|
190
213
|
<div id="hours" class="subtle">
|
|
191
214
|
{#each { length: 24 }, i}
|
|
192
215
|
{#if !i}
|
package/routes/calendar/cal.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
body:has(#cal-app) {
|
|
2
|
-
top:
|
|
2
|
+
top: 4em;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
#cal-app {
|
|
@@ -66,7 +66,7 @@ div.attendees {
|
|
|
66
66
|
input,
|
|
67
67
|
select,
|
|
68
68
|
textarea {
|
|
69
|
-
|
|
69
|
+
width: 100%;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
textarea {
|
|
@@ -224,7 +224,7 @@ div.attendees {
|
|
|
224
224
|
inset: 3em 0 0;
|
|
225
225
|
z-index: 10;
|
|
226
226
|
background-color: var(--bg-menu);
|
|
227
|
-
font-size: clamp(0.95rem, 0.
|
|
227
|
+
font-size: clamp(0.95rem, 0.75rem + 2.5cqw, 1.35rem);
|
|
228
228
|
translate: -100% 0;
|
|
229
229
|
opacity: 0;
|
|
230
230
|
visibility: hidden;
|