@conduction/nextcloud-vue 2.185.1 → 2.186.1

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 (69) hide show
  1. package/dist/esm/components/CnCalendarWidget/CnCalendarWidget.vue.js +1 -1
  2. package/dist/esm/components/CnCalendarWidget/CnCalendarWidget2.vue.js +83 -2
  3. package/dist/esm/components/CnCalendarWidget/CnCalendarWidget2.vue.js.map +1 -1
  4. package/dist/esm/components/CnCalendarWidget/CnCalendarWidget3.vue.js +147 -104
  5. package/dist/esm/components/CnCalendarWidget/CnCalendarWidget3.vue.js.map +1 -1
  6. package/dist/esm/components/CnChartWidget/CnChartWidget.vue.js +1 -1
  7. package/dist/esm/components/CnChartWidget/CnChartWidget2.vue.js +58 -0
  8. package/dist/esm/components/CnChartWidget/CnChartWidget2.vue.js.map +1 -1
  9. package/dist/esm/components/CnChartWidget/CnChartWidget3.vue.js +2 -2
  10. package/dist/esm/components/CnChartWidget/CnChartWidget3.vue.js.map +1 -1
  11. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue.js +1 -1
  12. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid2.vue.js +41 -16
  13. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid2.vue.js.map +1 -1
  14. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid3.vue.js.map +1 -1
  15. package/dist/esm/components/CnDividerWidget/index.js +1 -0
  16. package/dist/esm/components/CnDividerWidget/index.js.map +1 -1
  17. package/dist/esm/components/CnFilesWidget/CnFilesWidget.vue.js +1 -1
  18. package/dist/esm/components/CnFilesWidget/CnFilesWidget2.vue.js +158 -5
  19. package/dist/esm/components/CnFilesWidget/CnFilesWidget2.vue.js.map +1 -1
  20. package/dist/esm/components/CnFilesWidget/CnFilesWidget3.vue.js +109 -45
  21. package/dist/esm/components/CnFilesWidget/CnFilesWidget3.vue.js.map +1 -1
  22. package/dist/esm/components/CnHeaderWidget/index.js +0 -1
  23. package/dist/esm/components/CnHeaderWidget/index.js.map +1 -1
  24. package/dist/esm/components/CnHeaderWidgetForm/CnHeaderWidgetForm.vue.js +1 -1
  25. package/dist/esm/components/CnHeaderWidgetForm/CnHeaderWidgetForm2.vue.js +17 -3
  26. package/dist/esm/components/CnHeaderWidgetForm/CnHeaderWidgetForm2.vue.js.map +1 -1
  27. package/dist/esm/components/CnHeaderWidgetForm/CnHeaderWidgetForm3.vue.js +3 -3
  28. package/dist/esm/components/CnHeaderWidgetForm/CnHeaderWidgetForm3.vue.js.map +1 -1
  29. package/dist/esm/components/CnVideoWidget/CnVideoWidget.vue.js +1 -1
  30. package/dist/esm/components/CnVideoWidget/CnVideoWidget2.vue.js +63 -1
  31. package/dist/esm/components/CnVideoWidget/CnVideoWidget2.vue.js.map +1 -1
  32. package/dist/esm/components/CnVideoWidget/CnVideoWidget3.vue.js +20 -10
  33. package/dist/esm/components/CnVideoWidget/CnVideoWidget3.vue.js.map +1 -1
  34. package/dist/esm/components/CnVideoWidgetForm/CnVideoWidgetForm.vue.js +1 -1
  35. package/dist/esm/components/CnVideoWidgetForm/CnVideoWidgetForm2.vue.js +15 -0
  36. package/dist/esm/components/CnVideoWidgetForm/CnVideoWidgetForm2.vue.js.map +1 -1
  37. package/dist/esm/components/CnVideoWidgetForm/CnVideoWidgetForm3.vue.js +17 -10
  38. package/dist/esm/components/CnVideoWidgetForm/CnVideoWidgetForm3.vue.js.map +1 -1
  39. package/dist/esm/components/CnWidgetGrid/dashboardWidgetRegistry.js +1 -0
  40. package/dist/esm/components/CnWidgetGrid/dashboardWidgetRegistry.js.map +1 -1
  41. package/dist/esm/dialogs/CnAddWidgetModal.vue.js +1 -1
  42. package/dist/esm/dialogs/CnAddWidgetModal2.vue.js +18 -4
  43. package/dist/esm/dialogs/CnAddWidgetModal2.vue.js.map +1 -1
  44. package/dist/esm/dialogs/CnAddWidgetModal3.vue.js +57 -39
  45. package/dist/esm/dialogs/CnAddWidgetModal3.vue.js.map +1 -1
  46. package/dist/esm/l10n/en.json.js +96 -1
  47. package/dist/esm/l10n/en.json.js.map +1 -1
  48. package/dist/esm/l10n/nl.json.js +96 -1
  49. package/dist/esm/l10n/nl.json.js.map +1 -1
  50. package/dist/esm/library-style.js +1 -1
  51. package/dist/esm/nextcloud-vue.css +309 -192
  52. package/dist/nextcloud-vue.cjs.js +2359 -1605
  53. package/dist/nextcloud-vue.cjs.js.map +2 -2
  54. package/dist/nextcloud-vue.css +309 -192
  55. package/l10n/en.json +96 -1
  56. package/l10n/nl.json +96 -1
  57. package/package.json +1 -1
  58. package/src/components/CnCalendarWidget/CnCalendarWidget.vue +217 -75
  59. package/src/components/CnChartWidget/CnChartWidget.vue +60 -2
  60. package/src/components/CnDashboardGrid/CnDashboardGrid.md +1 -1
  61. package/src/components/CnDashboardGrid/CnDashboardGrid.vue +41 -16
  62. package/src/components/CnDividerWidget/index.js +1 -0
  63. package/src/components/CnFilesWidget/CnFilesWidget.vue +278 -5
  64. package/src/components/CnHeaderWidget/index.js +0 -1
  65. package/src/components/CnHeaderWidgetForm/CnHeaderWidgetForm.vue +20 -6
  66. package/src/components/CnVideoWidget/CnVideoWidget.vue +84 -1
  67. package/src/components/CnVideoWidgetForm/CnVideoWidgetForm.vue +19 -1
  68. package/src/components/CnWidgetGrid/dashboardWidgetRegistry.js +1 -0
  69. package/src/dialogs/CnAddWidgetModal.vue +53 -14
package/l10n/en.json CHANGED
@@ -2808,7 +2808,94 @@
2808
2808
  "An EAN-13 code takes twelve or thirteen digits with a valid check digit.": "An EAN-13 code takes twelve or thirteen digits with a valid check digit.",
2809
2809
  "A Code 128 code takes letters, digits and plain punctuation only.": "A Code 128 code takes letters, digits and plain punctuation only.",
2810
2810
  "Started. It finishes in the background.": "Started. It finishes in the background.",
2811
- "At most {max} rows.": "At most {max} rows."
2811
+ "At most {max} rows.": "At most {max} rows.",
2812
+ "Loading calendars…": "Loading calendars…",
2813
+ "The calendars are taking too long to load.": "The calendars are taking too long to load.",
2814
+ "Failed to load events": "Failed to load events",
2815
+ "No calendar available": "No calendar available",
2816
+ "No calendar is selected yet. Choose one in this widget’s settings.": "No calendar is selected yet. Choose one in this widget’s settings.",
2817
+ "No events in the next {n} days": "No events in the next {n} days",
2818
+ "Sun": "Sun",
2819
+ "Mon": "Mon",
2820
+ "Tue": "Tue",
2821
+ "Wed": "Wed",
2822
+ "Thu": "Thu",
2823
+ "Fri": "Fri",
2824
+ "Sat": "Sat",
2825
+ "Month": "Month",
2826
+ "Week": "Week",
2827
+ "Agenda": "Agenda",
2828
+ "All day": "All day",
2829
+ "Calendars": "Calendars",
2830
+ "Select calendars…": "Select calendars…",
2831
+ "One calendar principal URI per line": "One calendar principal URI per line",
2832
+ "External ICS URLs (one per line)": "External ICS URLs (one per line)",
2833
+ "Days ahead": "Days ahead",
2834
+ "Color by calendar": "Color by calendar",
2835
+ "At least one calendar source is required": "At least one calendar source is required",
2836
+ "External ICS URLs must start with https://": "External ICS URLs must start with https://",
2837
+ "Folder breadcrumb": "Folder breadcrumb",
2838
+ "Root": "Root",
2839
+ "Search this folder": "Search this folder",
2840
+ "Search this folder…": "Search this folder…",
2841
+ "Upload File": "Upload File",
2842
+ "Drop files to upload": "Drop files to upload",
2843
+ "Loading folder…": "Loading folder…",
2844
+ "Files is not available": "Files is not available",
2845
+ "You don't have access to this folder.": "You don't have access to this folder.",
2846
+ "Folder no longer exists.": "Folder no longer exists.",
2847
+ "Failed to load folder contents.": "Failed to load folder contents.",
2848
+ "This folder is empty.": "This folder is empty.",
2849
+ "Uploading {loaded} / {total}": "Uploading {loaded} / {total}",
2850
+ "Upload complete": "Upload complete",
2851
+ "No files matching '{query}'": "No files matching '{query}'",
2852
+ "You no longer have permission to delete {name}.": "You no longer have permission to delete {name}.",
2853
+ "Could not delete {name}.": "Could not delete {name}.",
2854
+ "Not enough storage space": "Not enough storage space",
2855
+ "You may not upload to this folder": "You may not upload to this folder",
2856
+ "This file type is not allowed here": "This file type is not allowed here",
2857
+ "Upload failed": "Upload failed",
2858
+ "Sent": "Sent",
2859
+ "Uploaded": "Uploaded",
2860
+ "Uploading {percent}%": "Uploading {percent}%",
2861
+ "Delete file": "Delete file",
2862
+ "Are you sure you want to delete {name}?": "Are you sure you want to delete {name}?",
2863
+ "Current object": "Current object",
2864
+ "Browse…": "Browse…",
2865
+ "Sort descending": "Sort descending",
2866
+ "Show thumbnails": "Show thumbnails",
2867
+ "MIME type filter (comma separated)": "MIME type filter (comma separated)",
2868
+ "e.g. image/*, application/pdf": "e.g. image/*, application/pdf",
2869
+ "Allow upload": "Allow upload",
2870
+ "Allow delete": "Allow delete",
2871
+ "This widget shows files attached to the current object, so the folder cannot be set here.": "This widget shows files attached to the current object, so the folder cannot be set here.",
2872
+ "Grid": "Grid",
2873
+ "Tree": "Tree",
2874
+ "Choose a folder": "Choose a folder",
2875
+ "Choose": "Choose",
2876
+ "Could not open the folder picker": "Could not open the folder picker",
2877
+ "Folder path or folder id is required": "Folder path or folder id is required",
2878
+ "No video URL configured": "No video URL configured",
2879
+ "Edit the widget to add a video": "Edit the widget to add a video",
2880
+ "Configure now": "Configure now",
2881
+ "Video not accessible": "Video not accessible",
2882
+ "Video failed to load": "Video failed to load",
2883
+ "Invalid video URL or domain not allowed.": "Invalid video URL or domain not allowed.",
2884
+ "Video URL": "Video URL",
2885
+ "Nextcloud File ID": "Nextcloud File ID",
2886
+ "Aspect Ratio": "Aspect Ratio",
2887
+ "Autoplay": "Autoplay",
2888
+ "Autoplay requires muting": "Autoplay requires muting",
2889
+ "Muted": "Muted",
2890
+ "Loop": "Loop",
2891
+ "Show controls": "Show controls",
2892
+ "Poster Image URL (optional)": "Poster Image URL (optional)",
2893
+ "Detected: YouTube": "Detected: YouTube",
2894
+ "Detected: Vimeo": "Detected: Vimeo",
2895
+ "Detected: PeerTube": "Detected: PeerTube",
2896
+ "Detected: Nextcloud File": "Detected: Nextcloud File",
2897
+ "Video URL is required": "Video URL is required",
2898
+ "Nextcloud file ID is required": "Nextcloud file ID is required"
2812
2899
  },
2813
2900
  "plurals": {
2814
2901
  "{count} member": [
@@ -3049,6 +3136,14 @@
3049
3136
  "%n log line": [
3050
3137
  "%n log line",
3051
3138
  "%n log lines"
3139
+ ],
3140
+ "{count} calendar source unavailable": [
3141
+ "{count} calendar source unavailable",
3142
+ "{count} calendar sources unavailable"
3143
+ ],
3144
+ "{count} file could not be uploaded": [
3145
+ "{count} file could not be uploaded",
3146
+ "{count} files could not be uploaded"
3052
3147
  ]
3053
3148
  }
3054
3149
  }
package/l10n/nl.json CHANGED
@@ -3076,7 +3076,94 @@
3076
3076
  "Location field": "Locatieveld",
3077
3077
  "Objects are plotted from the location field: a point, line or area. Without one, from their location (@self.geo). Objects without a location are skipped.": "Objecten worden getekend vanuit het locatieveld: een punt, lijn of vlak. Zonder locatieveld vanuit hun locatie (@self.geo). Objecten zonder locatie worden overgeslagen.",
3078
3078
  "Custom base map": "Eigen achtergrondkaart",
3079
- "Base map": "Achtergrondkaart"
3079
+ "Base map": "Achtergrondkaart",
3080
+ "Loading calendars…": "Agenda's laden…",
3081
+ "The calendars are taking too long to load.": "Het laden van de agenda's duurt te lang.",
3082
+ "Failed to load events": "Afspraken laden mislukt",
3083
+ "No calendar available": "Geen agenda beschikbaar",
3084
+ "No calendar is selected yet. Choose one in this widget’s settings.": "Er is nog geen agenda gekozen. Kies er een in de instellingen van deze widget.",
3085
+ "No events in the next {n} days": "Geen afspraken in de komende {n} dagen",
3086
+ "Sun": "zo",
3087
+ "Mon": "ma",
3088
+ "Tue": "di",
3089
+ "Wed": "wo",
3090
+ "Thu": "do",
3091
+ "Fri": "vr",
3092
+ "Sat": "za",
3093
+ "Month": "Maand",
3094
+ "Week": "Week",
3095
+ "Agenda": "Agenda",
3096
+ "All day": "Hele dag",
3097
+ "Calendars": "Agenda's",
3098
+ "Select calendars…": "Kies agenda's…",
3099
+ "One calendar principal URI per line": "Eén agenda-principal-URI per regel",
3100
+ "External ICS URLs (one per line)": "Externe ICS-URL's (één per regel)",
3101
+ "Days ahead": "Dagen vooruit",
3102
+ "Color by calendar": "Kleur per agenda",
3103
+ "At least one calendar source is required": "Kies minstens één agendabron",
3104
+ "External ICS URLs must start with https://": "Externe ICS-URL's moeten beginnen met https://",
3105
+ "Folder breadcrumb": "Mappad",
3106
+ "Root": "Hoofdmap",
3107
+ "Search this folder": "Zoek in deze map",
3108
+ "Search this folder…": "Zoek in deze map…",
3109
+ "Upload File": "Bestand uploaden",
3110
+ "Drop files to upload": "Zet bestanden hier neer om te uploaden",
3111
+ "Loading folder…": "Map laden…",
3112
+ "Files is not available": "Bestanden is niet beschikbaar",
3113
+ "You don't have access to this folder.": "Je hebt geen toegang tot deze map.",
3114
+ "Folder no longer exists.": "Deze map bestaat niet meer.",
3115
+ "Failed to load folder contents.": "De inhoud van de map kon niet worden geladen.",
3116
+ "This folder is empty.": "Deze map is leeg.",
3117
+ "Uploading {loaded} / {total}": "Uploaden {loaded} / {total}",
3118
+ "Upload complete": "Upload voltooid",
3119
+ "No files matching '{query}'": "Geen bestanden gevonden voor '{query}'",
3120
+ "You no longer have permission to delete {name}.": "Je mag {name} niet meer verwijderen.",
3121
+ "Could not delete {name}.": "{name} kon niet worden verwijderd.",
3122
+ "Not enough storage space": "Niet genoeg opslagruimte",
3123
+ "You may not upload to this folder": "Je mag niet uploaden naar deze map",
3124
+ "This file type is not allowed here": "Dit bestandstype is hier niet toegestaan",
3125
+ "Upload failed": "Uploaden mislukt",
3126
+ "Sent": "Verzonden",
3127
+ "Uploaded": "Geüpload",
3128
+ "Uploading {percent}%": "Uploaden {percent}%",
3129
+ "Delete file": "Bestand verwijderen",
3130
+ "Are you sure you want to delete {name}?": "Weet je zeker dat je {name} wilt verwijderen?",
3131
+ "Current object": "Huidig object",
3132
+ "Browse…": "Bladeren…",
3133
+ "Sort descending": "Aflopend sorteren",
3134
+ "Show thumbnails": "Miniaturen tonen",
3135
+ "MIME type filter (comma separated)": "MIME-typefilter (gescheiden door komma's)",
3136
+ "e.g. image/*, application/pdf": "bijv. image/*, application/pdf",
3137
+ "Allow upload": "Uploaden toestaan",
3138
+ "Allow delete": "Verwijderen toestaan",
3139
+ "This widget shows files attached to the current object, so the folder cannot be set here.": "Deze widget toont de bestanden bij het huidige object, dus de map is hier niet in te stellen.",
3140
+ "Grid": "Raster",
3141
+ "Tree": "Boom",
3142
+ "Choose a folder": "Kies een map",
3143
+ "Choose": "Kiezen",
3144
+ "Could not open the folder picker": "De mapkiezer kon niet worden geopend",
3145
+ "Folder path or folder id is required": "Een mappad of map-id is verplicht",
3146
+ "No video URL configured": "Geen video-URL ingesteld",
3147
+ "Edit the widget to add a video": "Bewerk de widget om een video toe te voegen",
3148
+ "Configure now": "Nu instellen",
3149
+ "Video not accessible": "Video niet toegankelijk",
3150
+ "Video failed to load": "Video laden mislukt",
3151
+ "Invalid video URL or domain not allowed.": "Ongeldige video-URL of domein niet toegestaan.",
3152
+ "Video URL": "Video-URL",
3153
+ "Nextcloud File ID": "Nextcloud-bestands-id",
3154
+ "Aspect Ratio": "Beeldverhouding",
3155
+ "Autoplay": "Automatisch afspelen",
3156
+ "Autoplay requires muting": "Automatisch afspelen kan alleen zonder geluid",
3157
+ "Muted": "Geluid uit",
3158
+ "Loop": "Herhalen",
3159
+ "Show controls": "Bediening tonen",
3160
+ "Poster Image URL (optional)": "URL van voorbeeldafbeelding (optioneel)",
3161
+ "Detected: YouTube": "Herkend: YouTube",
3162
+ "Detected: Vimeo": "Herkend: Vimeo",
3163
+ "Detected: PeerTube": "Herkend: PeerTube",
3164
+ "Detected: Nextcloud File": "Herkend: Nextcloud-bestand",
3165
+ "Video URL is required": "Video-URL is verplicht",
3166
+ "Nextcloud file ID is required": "Nextcloud-bestands-id is verplicht"
3080
3167
  },
3081
3168
  "plurals": {
3082
3169
  "{count} member": [
@@ -3338,6 +3425,14 @@
3338
3425
  "%n log line": [
3339
3426
  "%n logregel",
3340
3427
  "%n logregels"
3428
+ ],
3429
+ "{count} calendar source unavailable": [
3430
+ "{count} agendabron niet beschikbaar",
3431
+ "{count} agendabronnen niet beschikbaar"
3432
+ ],
3433
+ "{count} file could not be uploaded": [
3434
+ "{count} bestand kon niet worden geüpload",
3435
+ "{count} bestanden konden niet worden geüpload"
3341
3436
  ]
3342
3437
  }
3343
3438
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conduction/nextcloud-vue",
3
- "version": "2.185.1",
3
+ "version": "2.186.1",
4
4
  "description": "Shared Vue component library for Conduction Nextcloud apps — complements @nextcloud/vue with higher-level components, OpenRegister integration, and NL Design System support",
5
5
  "homepage": "https://github.com/ConductionNL/nextcloud-vue#readme",
6
6
  "bugs": {
@@ -25,10 +25,17 @@
25
25
  </header>
26
26
 
27
27
  <div class="cn-calendar-widget__body">
28
- <div v-if="loading" class="cn-calendar-widget__state">
28
+ <div v-if="loading && !slow" class="cn-calendar-widget__state">
29
29
  {{ t('nextcloud-vue', 'Loading calendars…') }}
30
30
  </div>
31
31
 
32
+ <div v-else-if="loading" class="cn-calendar-widget__state" role="status">
33
+ <p>{{ t('nextcloud-vue', 'The calendars are taking too long to load.') }}</p>
34
+ <button type="button" class="cn-calendar-widget__retry" @click="fetchEvents">
35
+ {{ t('nextcloud-vue', 'Retry') }}
36
+ </button>
37
+ </div>
38
+
32
39
  <div v-else-if="error" class="cn-calendar-widget__state cn-calendar-widget__state--error">
33
40
  <p>{{ t('nextcloud-vue', 'Failed to load events') }}</p>
34
41
  <button type="button" class="cn-calendar-widget__retry" @click="fetchEvents">
@@ -41,99 +48,124 @@
41
48
  </div>
42
49
 
43
50
  <div v-else-if="hasNoCalendarChosen" class="cn-calendar-widget__state">
44
- {{ t('nextcloud-vue', 'No calendar is selected yet. Choose one in this widget\u2019s settings.') }}
51
+ {{ t('nextcloud-vue', 'No calendar is selected yet. Choose one in this widget’s settings.') }}
45
52
  </div>
46
53
 
47
- <div v-else-if="events.length === 0 && activeMode === 'agenda'" class="cn-calendar-widget__state">
48
- {{ emptyMessage }}
49
- </div>
50
-
51
- <!-- Month view: 7-column grid padded to whole weeks. -->
52
- <div v-else-if="activeMode === 'month'" class="cn-calendar-widget__month">
53
- <div
54
- v-for="(weekday, idx) in weekdayHeaders"
55
- :key="'wh-' + idx"
56
- class="cn-calendar-widget__month-header">
57
- {{ weekday }}
58
- </div>
54
+ <template v-else>
55
+ <!-- A source that failed is named, not hidden: small above the
56
+ events, prominent when nothing could be shown at all. -->
59
57
  <div
60
- v-for="day in monthGrid"
61
- :key="day.iso"
62
- class="cn-calendar-widget__month-cell"
63
- :class="{ 'is-today': day.isToday, 'is-other-month': day.isOtherMonth }">
64
- <span class="cn-calendar-widget__month-day">{{ day.dayNum }}</span>
65
- <ul v-if="day.events.length" class="cn-calendar-widget__month-events">
66
- <li
67
- v-for="event in day.events.slice(0, 3)"
68
- :key="event.uid + '-' + event.start"
69
- class="cn-calendar-widget__month-event"
70
- :title="event.title"
71
- :style="eventStyle(event)">
72
- {{ event.title }}
73
- </li>
74
- <li
75
- v-if="day.events.length > 3"
76
- class="cn-calendar-widget__month-overflow">
77
- +{{ day.events.length - 3 }}
58
+ v-if="failures.length > 0"
59
+ class="cn-calendar-widget__notice"
60
+ :class="{ 'cn-calendar-widget__notice--prominent': events.length === 0 }"
61
+ :role="events.length === 0 ? 'alert' : 'status'">
62
+ <button
63
+ type="button"
64
+ class="cn-calendar-widget__notice-toggle"
65
+ :aria-expanded="showFailures ? 'true' : 'false'"
66
+ @click="showFailures = !showFailures">
67
+ {{ failureSummary }}
68
+ </button>
69
+ <ul v-if="showFailures" class="cn-calendar-widget__notice-list">
70
+ <li v-for="(failure, index) in failures" :key="index">
71
+ {{ failureLabel(failure) }}
78
72
  </li>
79
73
  </ul>
80
74
  </div>
81
- </div>
82
75
 
83
- <!-- Week view: 7 day columns. -->
84
- <div v-else-if="activeMode === 'week'" class="cn-calendar-widget__week">
85
- <div
86
- v-for="day in weekDays"
87
- :key="day.iso"
88
- class="cn-calendar-widget__week-col"
89
- :class="{ 'is-today': day.isToday }">
90
- <header class="cn-calendar-widget__week-day">
91
- <span class="cn-calendar-widget__week-name">{{ day.weekday }}</span>
92
- <span class="cn-calendar-widget__week-num">{{ day.dayNum }}</span>
93
- </header>
94
- <ul v-if="day.events.length" class="cn-calendar-widget__week-events">
76
+ <div v-if="events.length === 0 && activeMode === 'agenda'" class="cn-calendar-widget__state">
77
+ {{ emptyMessage }}
78
+ </div>
79
+
80
+ <!-- Month view: 7-column grid padded to whole weeks. -->
81
+ <div v-else-if="activeMode === 'month'" class="cn-calendar-widget__month">
82
+ <div
83
+ v-for="(weekday, idx) in weekdayHeaders"
84
+ :key="'wh-' + idx"
85
+ class="cn-calendar-widget__month-header">
86
+ {{ weekday }}
87
+ </div>
88
+ <div
89
+ v-for="day in monthGrid"
90
+ :key="day.iso"
91
+ class="cn-calendar-widget__month-cell"
92
+ :class="{ 'is-today': day.isToday, 'is-other-month': day.isOtherMonth }">
93
+ <span class="cn-calendar-widget__month-day">{{ day.dayNum }}</span>
94
+ <ul v-if="day.events.length" class="cn-calendar-widget__month-events">
95
+ <li
96
+ v-for="event in day.events.slice(0, 3)"
97
+ :key="event.uid + '-' + event.start"
98
+ class="cn-calendar-widget__month-event"
99
+ :title="event.title"
100
+ :style="eventStyle(event)">
101
+ {{ event.title }}
102
+ </li>
103
+ <li
104
+ v-if="day.events.length > 3"
105
+ class="cn-calendar-widget__month-overflow">
106
+ +{{ day.events.length - 3 }}
107
+ </li>
108
+ </ul>
109
+ </div>
110
+ </div>
111
+
112
+ <!-- Week view: 7 day columns. -->
113
+ <div v-else-if="activeMode === 'week'" class="cn-calendar-widget__week">
114
+ <div
115
+ v-for="day in weekDays"
116
+ :key="day.iso"
117
+ class="cn-calendar-widget__week-col"
118
+ :class="{ 'is-today': day.isToday }">
119
+ <header class="cn-calendar-widget__week-day">
120
+ <span class="cn-calendar-widget__week-name">{{ day.weekday }}</span>
121
+ <span class="cn-calendar-widget__week-num">{{ day.dayNum }}</span>
122
+ </header>
123
+ <ul v-if="day.events.length" class="cn-calendar-widget__week-events">
124
+ <li
125
+ v-for="event in day.events"
126
+ :key="event.uid + '-' + event.start"
127
+ class="cn-calendar-widget__week-event"
128
+ :style="eventStyle(event)">
129
+ <span class="cn-calendar-widget__week-time">{{ formatTime(event) }}</span>
130
+ <span class="cn-calendar-widget__week-title">{{ event.title }}</span>
131
+ </li>
132
+ </ul>
133
+ <p v-else class="cn-calendar-widget__week-empty">
134
+ —
135
+ </p>
136
+ </div>
137
+ </div>
138
+
139
+ <!-- Agenda view: chronological list grouped by day. -->
140
+ <ul v-else class="cn-calendar-widget__agenda">
141
+ <template v-for="group in agendaGroups" :key="group.iso">
142
+ <li class="cn-calendar-widget__agenda-header">
143
+ {{ group.label }}
144
+ </li>
95
145
  <li
96
- v-for="event in day.events"
146
+ v-for="event in group.events"
97
147
  :key="event.uid + '-' + event.start"
98
- class="cn-calendar-widget__week-event"
148
+ class="cn-calendar-widget__agenda-row"
99
149
  :style="eventStyle(event)">
100
- <span class="cn-calendar-widget__week-time">{{ formatTime(event) }}</span>
101
- <span class="cn-calendar-widget__week-title">{{ event.title }}</span>
150
+ <span class="cn-calendar-widget__agenda-time">{{ formatTimeRange(event) }}</span>
151
+ <span class="cn-calendar-widget__agenda-title">{{ event.title }}</span>
152
+ <span v-if="event.calendarName" class="cn-calendar-widget__agenda-cal">{{ event.calendarName }}</span>
102
153
  </li>
103
- </ul>
104
- <p v-else class="cn-calendar-widget__week-empty">
105
- —
106
- </p>
107
- </div>
108
- </div>
109
-
110
- <!-- Agenda view: chronological list grouped by day. -->
111
- <ul v-else class="cn-calendar-widget__agenda">
112
- <template v-for="group in agendaGroups" :key="group.iso">
113
- <li class="cn-calendar-widget__agenda-header">
114
- {{ group.label }}
115
- </li>
116
- <li
117
- v-for="event in group.events"
118
- :key="event.uid + '-' + event.start"
119
- class="cn-calendar-widget__agenda-row"
120
- :style="eventStyle(event)">
121
- <span class="cn-calendar-widget__agenda-time">{{ formatTime(event) }}</span>
122
- <span class="cn-calendar-widget__agenda-title">{{ event.title }}</span>
123
- <span v-if="event.calendarName" class="cn-calendar-widget__agenda-cal">{{ event.calendarName }}</span>
124
- </li>
125
- </template>
126
- </ul>
154
+ </template>
155
+ </ul>
156
+ </template>
127
157
  </div>
128
158
  </div>
129
159
  </template>
130
160
 
131
161
  <script>
132
- import { translate as t } from '@nextcloud/l10n'
162
+ import { translatePlural as n, translate as t } from '@nextcloud/l10n'
133
163
  import { userLocale } from '../../utils/userLocale.js'
134
164
 
135
165
  const VIEW_MODES = ['month', 'week', 'agenda']
136
166
  const DEFAULT_DAYS_AHEAD = 14
167
+ // After this long a pending load says it is taking too long and offers Retry.
168
+ const SLOW_AFTER_MS = 30000
137
169
 
138
170
  /**
139
171
  * CnCalendarWidget — renders aggregated upcoming events as a chronological,
@@ -199,6 +231,8 @@ export default {
199
231
  events: [],
200
232
  failures: [],
201
233
  loading: false,
234
+ slow: false,
235
+ showFailures: false,
202
236
  error: null,
203
237
  today: new Date(),
204
238
  }
@@ -317,6 +351,16 @@ export default {
317
351
  return t('nextcloud-vue', 'No events in the next {n} days').replace('{n}', String(this.daysAhead))
318
352
  },
319
353
 
354
+ /**
355
+ * The failure notice's summary: how many sources could not be read.
356
+ *
357
+ * @return {string} the summary.
358
+ */
359
+ failureSummary() {
360
+ const count = this.failures.length
361
+ return n('nextcloud-vue', '{count} calendar source unavailable', '{count} calendar sources unavailable', count, { count })
362
+ },
363
+
320
364
  /**
321
365
  * Localised short weekday names (Sun-first).
322
366
  *
@@ -467,6 +511,10 @@ export default {
467
511
  this.fetchEvents()
468
512
  },
469
513
 
514
+ beforeUnmount() {
515
+ clearTimeout(this.slowTimer)
516
+ },
517
+
470
518
  methods: {
471
519
  t,
472
520
 
@@ -538,20 +586,42 @@ export default {
538
586
  return
539
587
  }
540
588
  const { from, to } = this.computeRange()
589
+ // Only the latest request may settle the widget: a Retry after a
590
+ // slow load must not be overwritten by the request it replaced.
591
+ const request = (this.requestId || 0) + 1
592
+ this.requestId = request
541
593
  this.loading = true
594
+ this.slow = false
542
595
  this.error = null
596
+ clearTimeout(this.slowTimer)
597
+ this.slowTimer = setTimeout(() => {
598
+ if (this.requestId === request && this.loading) {
599
+ this.slow = true
600
+ }
601
+ }, SLOW_AFTER_MS)
543
602
  try {
544
603
  const payload = await this.source.fetchEvents({
545
604
  from: from.toISOString(),
546
605
  to: to.toISOString(),
547
606
  }) || {}
607
+ if (this.requestId !== request) {
608
+ return
609
+ }
548
610
  this.events = Array.isArray(payload.events) ? payload.events : []
549
611
  this.failures = Array.isArray(payload.failures) ? payload.failures : []
550
612
  } catch (err) {
613
+ if (this.requestId !== request) {
614
+ return
615
+ }
551
616
  this.error = err
552
617
  this.events = []
618
+ this.failures = []
553
619
  } finally {
554
- this.loading = false
620
+ if (this.requestId === request) {
621
+ clearTimeout(this.slowTimer)
622
+ this.loading = false
623
+ this.slow = false
624
+ }
555
625
  }
556
626
  },
557
627
 
@@ -598,6 +668,47 @@ export default {
598
668
  return `${hh}:${mm}`
599
669
  },
600
670
 
671
+ /**
672
+ * Format an event's start and end time, `09:00 – 10:00` (or "All day").
673
+ * An event without a later end shows its start alone.
674
+ *
675
+ * @param {object} event the event.
676
+ * @return {string} the time range label.
677
+ */
678
+ formatTimeRange(event) {
679
+ const start = this.formatTime(event)
680
+ if (event.allDay || !event.end) {
681
+ return start
682
+ }
683
+ const begin = this.parseDate(event.start)
684
+ const end = new Date(event.end)
685
+ if (Number.isNaN(end.getTime()) || end <= begin) {
686
+ return start
687
+ }
688
+ const hh = String(end.getHours()).padStart(2, '0')
689
+ const mm = String(end.getMinutes()).padStart(2, '0')
690
+ return `${start} – ${hh}:${mm}`
691
+ },
692
+
693
+ /**
694
+ * The text for one failed source: the host's string, or the source and
695
+ * error an object names.
696
+ *
697
+ * @param {string|object} failure a failure from the source's payload.
698
+ * @return {string} the label.
699
+ */
700
+ failureLabel(failure) {
701
+ if (typeof failure === 'string') {
702
+ return failure
703
+ }
704
+ if (!failure || typeof failure !== 'object') {
705
+ return String(failure ?? '')
706
+ }
707
+ const source = failure.source || failure.url || failure.name || failure.calendar || ''
708
+ const reason = failure.error || failure.message || ''
709
+ return [source, reason].filter(Boolean).join(': ')
710
+ },
711
+
601
712
  /**
602
713
  * Format a per-day agenda group header.
603
714
  *
@@ -689,6 +800,37 @@ export default {
689
800
  color: var(--color-text-maxcontrast);
690
801
  }
691
802
 
803
+ .cn-calendar-widget__notice {
804
+ margin-bottom: 8px;
805
+ font-size: 12px;
806
+ color: var(--color-text-maxcontrast);
807
+ }
808
+
809
+ .cn-calendar-widget__notice--prominent {
810
+ padding: 8px 12px;
811
+ border: 1px solid var(--color-warning);
812
+ border-radius: var(--border-radius);
813
+ text-align: center;
814
+ color: var(--color-warning-text, var(--color-main-text));
815
+ }
816
+
817
+ .cn-calendar-widget__notice-toggle {
818
+ padding: 0;
819
+ border: none;
820
+ background: transparent;
821
+ color: inherit;
822
+ font: inherit;
823
+ text-decoration: underline;
824
+ cursor: pointer;
825
+ }
826
+
827
+ .cn-calendar-widget__notice-list {
828
+ margin: 4px 0 0;
829
+ padding-inline-start: 16px;
830
+ text-align: start;
831
+ word-break: break-all;
832
+ }
833
+
692
834
  .cn-calendar-widget__retry {
693
835
  padding: 4px 12px;
694
836
  border: 1px solid var(--color-border);