mgv-backoffice 1.47.0 → 1.49.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.
Files changed (43) hide show
  1. package/README.md +2099 -2072
  2. package/dist/components/BaseBooleanIcon.vue.d.ts +14 -0
  3. package/dist/components/BaseDetailList.vue.d.ts +13 -1
  4. package/dist/components/BasePageHeader.vue.d.ts +1 -1
  5. package/dist/components/BasePhotoViewer.vue.d.ts +24 -0
  6. package/dist/components/BaseRating.vue.d.ts +9 -0
  7. package/dist/components/BaseRowButton.vue.d.ts +18 -0
  8. package/dist/components/BaseSelect.vue.d.ts +15 -3
  9. package/dist/components/BaseSidebarUser.vue.d.ts +3 -0
  10. package/dist/components/BaseStatCard.vue.d.ts +6 -4
  11. package/dist/components/BaseTextarea.vue.d.ts +12 -0
  12. package/dist/composables/useRefreshOnReturn.d.ts +7 -0
  13. package/dist/index.d.ts +8 -1
  14. package/dist/types/photoViewer.d.ts +6 -0
  15. package/dist/ui-lib.css +1 -1
  16. package/dist/ui-lib.js +1050 -851
  17. package/dist/ui-lib.umd.cjs +1 -1
  18. package/dist/utils/format.d.ts +9 -0
  19. package/package.json +1 -1
  20. package/src/components/BaseBadge.vue +7 -7
  21. package/src/components/BaseBooleanIcon.vue +22 -0
  22. package/src/components/BaseDetailList.vue +50 -47
  23. package/src/components/BaseField.label.test.ts +30 -0
  24. package/src/components/BaseField.vue +19 -3
  25. package/src/components/BasePageHeader.test.ts +29 -0
  26. package/src/components/BasePageHeader.vue +137 -131
  27. package/src/components/BasePhotoViewer.test.ts +22 -0
  28. package/src/components/BasePhotoViewer.vue +93 -0
  29. package/src/components/BaseRating.test.ts +19 -0
  30. package/src/components/BaseRating.vue +21 -0
  31. package/src/components/BaseRowButton.vue +24 -0
  32. package/src/components/BaseSelect.vue +4 -2
  33. package/src/components/BaseSidebarUser.vue +85 -75
  34. package/src/components/BaseStatCard.vue +11 -3
  35. package/src/components/BaseTextarea.test.ts +17 -0
  36. package/src/components/BaseTextarea.vue +24 -0
  37. package/src/composables/useRefreshOnReturn.test.ts +47 -0
  38. package/src/composables/useRefreshOnReturn.ts +24 -0
  39. package/src/index.ts +10 -0
  40. package/src/style.css +132 -36
  41. package/src/types/photoViewer.ts +6 -0
  42. package/src/utils/format.test.ts +342 -322
  43. package/src/utils/format.ts +23 -0
@@ -281,3 +281,26 @@ export function fmtDuration(ms: number | null | undefined, maxUnits = 2): string
281
281
  parts.push(`${mins}m`)
282
282
  return parts.slice(0, maxUnits).join(' ')
283
283
  }
284
+
285
+ /**
286
+ * Normalize a backend time string for display: "11:00:00" → "11:00".
287
+ * Leaves already-short ("11:00") or unexpected values untouched.
288
+ */
289
+ export function fmtTime(time?: string | null): string {
290
+ if (!time) return '—'
291
+ const match = /^(\d{2}:\d{2})(?::\d{2}(?:\.\d+)?)?$/.exec(time)
292
+ return match ? match[1] : time
293
+ }
294
+
295
+ /** ISO instant → "YYYY-MM-DDTHH:mm" in the browser's time zone, for <input type="datetime-local">. */
296
+ export function toLocalInput(iso?: string | null): string {
297
+ if (!iso) return ''
298
+ const d = new Date(iso)
299
+ const pad = (n: number) => String(n).padStart(2, '0')
300
+ return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(d.getHours())}:${pad(d.getMinutes())}`
301
+ }
302
+
303
+ /** Value of an <input type="datetime-local"> → ISO instant (null when empty). */
304
+ export function fromLocalInput(value: string): string | null {
305
+ return value ? new Date(value).toISOString() : null
306
+ }