picocrank 1.18.3 → 1.20.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "picocrank",
3
- "version": "1.18.3",
3
+ "version": "1.20.0",
4
4
  "description": "A set of zero dependency Vue components built on the Femtocrank global CSS theme.",
5
5
  "main": "vite.config.js",
6
6
  "scripts": {
@@ -46,6 +46,8 @@ export interface CalendarProps {
46
46
  formatEventTime?: (event: CalendarEvent, date: Date) => string
47
47
  // Customization
48
48
  showNavigation?: boolean
49
+ /** When true, day titles show ordinal + full month name (e.g. "21st July") instead of the day number alone. */
50
+ shortMonthSuffix?: boolean
49
51
  currentMonth?: number
50
52
  currentYear?: number
51
53
  }
@@ -62,6 +64,7 @@ const props = withDefaults(defineProps<CalendarProps>(), {
62
64
  eventDragEnabled: true,
63
65
  eventMoveResponseTimeoutMs: 15000,
64
66
  showNavigation: true,
67
+ shortMonthSuffix: false,
65
68
  })
66
69
 
67
70
  const emit = defineEmits<{
@@ -646,8 +649,16 @@ watch([currentMonth, currentYear], () => {
646
649
  }"
647
650
  >
648
651
  <div class="day-content">
649
- <div class="day-number clickable">
650
- {{ day.date.getDate() }}<span class="day-month">{{ getOrdinalSuffix(day.date.getDate()) }} {{ monthNames[day.date.getMonth()].substring(0, 3) }}</span>
652
+ <div
653
+ class="day-number clickable"
654
+ :class="{ 'with-month-suffix': shortMonthSuffix }"
655
+ >
656
+ <template v-if="shortMonthSuffix">
657
+ {{ day.date.getDate() }}{{ getOrdinalSuffix(day.date.getDate()) }} {{ monthNames[day.date.getMonth()] }}
658
+ </template>
659
+ <template v-else>
660
+ {{ day.date.getDate() }}<span class="day-month">{{ getOrdinalSuffix(day.date.getDate()) }} {{ monthNames[day.date.getMonth()].substring(0, 3) }}</span>
661
+ </template>
651
662
  </div>
652
663
  <div class="day-events">
653
664
  <div
@@ -913,6 +924,13 @@ watch([currentMonth, currentYear], () => {
913
924
  font-size: small;
914
925
  }
915
926
 
927
+ .day-number.with-month-suffix {
928
+ min-width: auto;
929
+ text-align: center;
930
+ font-size: 0.8rem;
931
+ white-space: nowrap;
932
+ }
933
+
916
934
  .day-content:hover .day-number.clickable {
917
935
  color: #007bff;
918
936
  }
@@ -2,7 +2,7 @@
2
2
  <header>
3
3
  <div
4
4
  :id = "sidebarEnabled ? 'sidebar-button' : null"
5
- :class="['image-and-title', 'flex-row', { 'disabled-branding': !showBranding }]"
5
+ :class="['image-and-title', 'flex-row', { 'disabled-branding': !showBranding, 'logo-home-link': !sidebarEnabled && showBranding }]"
6
6
  @click = "onImageAndTitleClick"
7
7
  >
8
8
  <img v-if="showBranding" :src = "logoUrl" alt = "Logo" class = "logo" />
@@ -111,6 +111,15 @@ button:hover {
111
111
  width: auto;
112
112
  }
113
113
 
114
+ .logo-home-link {
115
+ cursor: pointer;
116
+ }
117
+
118
+ .logo-home-link:hover {
119
+ background-color: var(--header-hover-background-color);
120
+ color: var(--header-hover-text-color);
121
+ }
122
+
114
123
  .user-info span {
115
124
  padding-right: 0.5rem;
116
125
  }
package/vue/views/App.vue CHANGED
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <Header username = "Guest" @toggleSidebar="toggleSidebar" title = "PicoCrank" :logoUrl="logoUrl" :sidebarEnabled="sidebarEnabled" :navigation="navigation" :topBarEnabled="topBarEnabled" :showBranding="brandingEnabled" :breadcrumbs="breadcrumbsEnabled">
2
+ <Header username = "Guest" @toggleSidebar="toggleSidebar" @logoClick="goToIndex" title = "PicoCrank" :logoUrl="logoUrl" :sidebarEnabled="sidebarEnabled" :navigation="navigation" :topBarEnabled="topBarEnabled" :showBranding="brandingEnabled" :breadcrumbs="breadcrumbsEnabled">
3
3
  <template #toolbar>
4
4
  <QuickSearch
5
5
  v-if="quickSearchEnabled"
@@ -32,6 +32,7 @@
32
32
 
33
33
  <script setup>
34
34
  import { ref, onMounted, provide } from 'vue';
35
+ import { useRouter } from 'vue-router';
35
36
  import { Pin02Icon } from '@hugeicons/core-free-icons'
36
37
 
37
38
  import QuickSearch from './../components/QuickSearch.vue'
@@ -41,6 +42,7 @@
41
42
  import '../composables/useTheme.js'
42
43
  import logoUrl from '/logo.png';
43
44
 
45
+ const router = useRouter();
44
46
  const quickSearchRef = ref(null)
45
47
  const sidebar = ref(null);
46
48
  const navigation = ref(null);
@@ -56,6 +58,10 @@
56
58
  }
57
59
  }
58
60
 
61
+ function goToIndex() {
62
+ router.push({ name: 'Welcome' });
63
+ }
64
+
59
65
  function toggleSidebarEnabled() {
60
66
  sidebarEnabled.value = !sidebarEnabled.value;
61
67
  }
@@ -4,6 +4,10 @@
4
4
  padding
5
5
  >
6
6
  <template #toolbar>
7
+ <label class="short-month-suffix-toggle">
8
+ <input type="checkbox" v-model="shortMonthSuffix" />
9
+ Short month suffix
10
+ </label>
7
11
  <button @click="goToToday">Today</button>
8
12
  <button @click="previousMonth">‹</button>
9
13
  <div class="date-picker-container">
@@ -23,6 +27,7 @@
23
27
  :loading="loading"
24
28
  :error="error"
25
29
  :show-navigation="false"
30
+ :short-month-suffix="shortMonthSuffix"
26
31
  :current-month="currentMonthIndex"
27
32
  :current-year="currentYear"
28
33
  @event-click="handleEventClick"
@@ -51,6 +56,7 @@ import {
51
56
  const events = ref([])
52
57
  const loading = ref(false)
53
58
  const error = ref(null)
59
+ const shortMonthSuffix = ref(false)
54
60
  const currentMonth = ref('?')
55
61
  const currentMonthIndex = ref(new Date().getMonth())
56
62
  const currentYear = ref(new Date().getFullYear())
@@ -401,6 +407,15 @@ onMounted(() => {
401
407
  </script>
402
408
 
403
409
  <style scoped>
410
+ .short-month-suffix-toggle {
411
+ display: inline-flex;
412
+ align-items: center;
413
+ gap: 0.35rem;
414
+ font-size: 0.875rem;
415
+ cursor: pointer;
416
+ user-select: none;
417
+ }
418
+
404
419
  .date-picker-container {
405
420
  display: flex;
406
421
  align-items: center;