@primeui/scheduler-core 0.0.1-alpha.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 (63) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +1 -0
  3. package/dist/calendar/index.d.mts +57 -0
  4. package/dist/calendar/index.mjs +1 -0
  5. package/dist/chunk-2B3YLWHA.mjs +196 -0
  6. package/dist/chunk-2THQAZ26.mjs +1669 -0
  7. package/dist/chunk-5KORIWDT.mjs +41 -0
  8. package/dist/chunk-5N4ZOBJV.mjs +866 -0
  9. package/dist/chunk-6OZAPQZ5.mjs +229 -0
  10. package/dist/chunk-6PK5WSKT.mjs +369 -0
  11. package/dist/chunk-6VYWVIGM.mjs +1170 -0
  12. package/dist/chunk-AAVM7UCG.mjs +100 -0
  13. package/dist/chunk-C7ADJGNV.mjs +157 -0
  14. package/dist/chunk-DYW6WUHE.mjs +277 -0
  15. package/dist/chunk-F5W5HD7S.mjs +285 -0
  16. package/dist/chunk-FIBAZFC4.mjs +871 -0
  17. package/dist/chunk-HPC5B3AR.mjs +558 -0
  18. package/dist/chunk-KQGRXTP5.mjs +650 -0
  19. package/dist/chunk-NMX4BW42.mjs +672 -0
  20. package/dist/chunk-NX46LPLF.mjs +440 -0
  21. package/dist/chunk-NZGJN7HG.mjs +314 -0
  22. package/dist/chunk-QDMZBJDV.mjs +251 -0
  23. package/dist/chunk-QR2SVYAD.mjs +1144 -0
  24. package/dist/chunk-SYJ5O4KH.mjs +136 -0
  25. package/dist/chunk-TNKJPFGI.mjs +569 -0
  26. package/dist/chunk-UMAMDBU4.mjs +1 -0
  27. package/dist/chunk-W2SJW3QQ.mjs +3925 -0
  28. package/dist/chunk-WFUJWDST.mjs +352 -0
  29. package/dist/chunk-XUBQ2IQS.mjs +1 -0
  30. package/dist/chunk-ZUKUKGNK.mjs +613 -0
  31. package/dist/controllers/index.d.mts +384 -0
  32. package/dist/controllers/index.mjs +13 -0
  33. package/dist/date-D_CjQPmM.d.mts +74 -0
  34. package/dist/display-format-CLVvRt4I.d.mts +57 -0
  35. package/dist/event/index.d.mts +267 -0
  36. package/dist/event/index.mjs +8 -0
  37. package/dist/event-surface-_R_LHD95.d.mts +21 -0
  38. package/dist/event.positioning-BdzAVPk7.d.mts +51 -0
  39. package/dist/event.utils-QSNdd-3W.d.mts +35 -0
  40. package/dist/index.d.mts +1128 -0
  41. package/dist/index.mjs +1022 -0
  42. package/dist/interaction/index.d.mts +442 -0
  43. package/dist/interaction/index.mjs +9 -0
  44. package/dist/month/index.d.mts +104 -0
  45. package/dist/month/index.mjs +6 -0
  46. package/dist/overlay-BYM9B6nC.d.mts +64 -0
  47. package/dist/resource/index.d.mts +172 -0
  48. package/dist/resource/index.mjs +1 -0
  49. package/dist/selection-CO_98HdS.d.mts +56 -0
  50. package/dist/time-grid/index.d.mts +92 -0
  51. package/dist/time-grid/index.mjs +13 -0
  52. package/dist/timeline/index.d.mts +165 -0
  53. package/dist/timeline/index.mjs +6 -0
  54. package/dist/touch-BhsMWsjf.d.mts +69 -0
  55. package/dist/utils/index.d.mts +494 -0
  56. package/dist/utils/index.mjs +17 -0
  57. package/dist/views/index.d.mts +51 -0
  58. package/dist/views/index.mjs +8 -0
  59. package/dist/views/timeline/index.d.mts +37 -0
  60. package/dist/views/timeline/index.mjs +4 -0
  61. package/dist/year/index.d.mts +70 -0
  62. package/dist/year/index.mjs +6 -0
  63. package/package.json +58 -0
@@ -0,0 +1,41 @@
1
+ // src/utils/event-surface.ts
2
+ function findSchedulerEventSurfaceResource(list, id) {
3
+ if (!list) return null;
4
+ for (const resource of list) {
5
+ if (resource.id === id) return resource;
6
+ const hit = findSchedulerEventSurfaceResource(resource.children, id);
7
+ if (hit) return hit;
8
+ }
9
+ return null;
10
+ }
11
+ function resolveSchedulerEventSurfaceColor(event, context) {
12
+ const resourceId = event.resourceId;
13
+ const resource = resourceId != null ? findSchedulerEventSurfaceResource(context.resources, resourceId) : null;
14
+ const categoryField = context.categoryField ?? "categoryId";
15
+ const categoryId = event[categoryField];
16
+ const categoryColor = categoryId != null ? context.categories?.find((category) => category.id === categoryId)?.color : void 0;
17
+ return resource?.eventColor ?? event.color ?? categoryColor ?? context.fallbackColor ?? "var(--p-primary-color)";
18
+ }
19
+ function getSchedulerEventSurfaceStyle(event, context, options = {}) {
20
+ const style = {};
21
+ const color = resolveSchedulerEventSurfaceColor(event, context) ?? context.fallbackColor ?? "var(--p-primary-color)";
22
+ const borderColor = event.borderColor ?? color;
23
+ const includeSurface = options.includeSurface ?? true;
24
+ const includeHoverSurface = options.includeHoverSurface ?? includeSurface;
25
+ const titleColor = event.textColor ?? "var(--p-text-color)";
26
+ const timeColor = event.textColor ?? "var(--p-text-muted-color)";
27
+ if (includeSurface) {
28
+ style["--p-scheduler-event-background"] = `light-dark(color-mix(in srgb, ${color} 10%, var(--p-content-background)), color-mix(in srgb, ${color} 24%, var(--p-content-background)))`;
29
+ }
30
+ if (includeHoverSurface) {
31
+ style["--p-scheduler-event-hover-background"] = `light-dark(color-mix(in srgb, ${color} 14%, var(--p-content-background)), color-mix(in srgb, ${color} 30%, var(--p-content-background)))`;
32
+ }
33
+ style["--p-scheduler-event-border-accent"] = borderColor;
34
+ style["--p-scheduler-event-border-color"] = `light-dark(color-mix(in srgb, ${borderColor} 28%, var(--p-content-border-color)), color-mix(in srgb, ${borderColor} 42%, var(--p-content-border-color)))`;
35
+ style["--p-scheduler-event-color"] = titleColor;
36
+ style["--p-scheduler-event-title-color"] = titleColor;
37
+ style["--p-scheduler-event-time-color"] = timeColor;
38
+ return style;
39
+ }
40
+
41
+ export { getSchedulerEventSurfaceStyle, resolveSchedulerEventSurfaceColor };