@algorisys/zen-ui-vanilla 13.11.2 → 13.12.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.
@@ -44,6 +44,12 @@ export interface CalendarEventChange {
44
44
  end: Date;
45
45
  allDay: boolean;
46
46
  kind: "move" | "resize";
47
+ /**
48
+ * How it was proposed: a drag (or a long press on touch), or Alt+arrow keys.
49
+ * A keyboard move fires once per key press, so an app that confirms each
50
+ * change may want to skip the dialog for "keyboard". Same as PlanningCalendar.
51
+ */
52
+ source: "pointer" | "keyboard";
47
53
  }
48
54
  export type CalendarEventVariant = "block" | "bar" | "chip" | "row";
49
55
  export interface CalendarEventRenderContext {
@@ -1 +1 @@
1
- {"version":3,"file":"event-calendar-model.d.ts","sourceRoot":"","sources":["../../../src/components/event-calendar/event-calendar-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACpB,UAAU,EACV,iBAAiB,EACjB,OAAO,EACR,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAE9D,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEtF,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,IAAI,CAAC;IACZ,yGAAyG;IACzG,GAAG,EAAE,IAAI,CAAC;IACV,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mDAAmD;IACnD,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,sFAAsF;IACtF,KAAK,CAAC,EAAE,MAAM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EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAKlH;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,IAAI,CAAA;CAAE,CAAC,EAAE,KAAK,EAAE;IAAE,KAAK,EAAE,IAAI,CAAC;IAAC,GAAG,EAAE,IAAI,CAAA;CAAE,GAAG,IAAI,GAAG,IAAI,CAKpI;AAED,0EAA0E;AAC1E,wBAAgB,UAAU,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAI1E"}
1
+ {"version":3,"file":"event-calendar-model.d.ts","sourceRoot":"","sources":["../../../src/components/event-calendar/event-calendar-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACpB,UAAU,EACV,iBAAiB,EACjB,OAAO,EACR,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAE9D,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEtF,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,IAAI,CAAC;IACZ,yGAAyG;IACzG,GAAG,EAAE,IAAI,CAAC;IACV,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mDAAmD;IACnD,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,sFAAsF;IACtF,KAAK,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;AAEF;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAKlH;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,IAAI,CAAA;CAAE,CAAC,EAAE,KAAK,EAAE;IAAE,KAAK,EAAE,IAAI,CAAC;IAAC,GAAG,EAAE,IAAI,CAAA;CAAE,GAAG,IAAI,GAAG,IAAI,CAKpI;AAED,0EAA0E;AAC1E,wBAAgB,UAAU,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAI1E"}
@@ -1 +1 @@
1
- {"version":3,"file":"event-calendar.d.ts","sourceRoot":"","sources":["../../../src/components/event-calendar/event-calendar.ts"],"names":[],"mappings":"AAaA,OAAO,EAAuD,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAK7G,OAAO,EAQL,KAAK,kBAAkB,EAGxB,MAAM,wBAAwB,CAAC;AAShC,YAAY,EACV,aAAa,EACb,mBAAmB,EACnB,0BAA0B,EAC1B,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,EACZ,kBAAkB,GACnB,MAAM,wBAAwB,CAAC;AAmChC,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,YAAY,CAAC,kBAAkB,CAAC,CA2WzF"}
1
+ {"version":3,"file":"event-calendar.d.ts","sourceRoot":"","sources":["../../../src/components/event-calendar/event-calendar.ts"],"names":[],"mappings":"AAaA,OAAO,EAAuD,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAK7G,OAAO,EAQL,KAAK,kBAAkB,EAGxB,MAAM,wBAAwB,CAAC;AAShC,YAAY,EACV,aAAa,EACb,mBAAmB,EACnB,0BAA0B,EAC1B,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,EACZ,kBAAkB,GACnB,MAAM,wBAAwB,CAAC;AAmChC,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,YAAY,CAAC,kBAAkB,CAAC,CAkXzF"}
package/dist/index113.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { calendarFollow as ie } from "./index232.js";
2
- import { wallMinutes as le, shiftEventCalendarAnchor as J, eventCalendarTitle as se, formatEventTimeRange as ce, eventCalendarRange as de } from "./index117.js";
2
+ import { wallMinutes as se, shiftEventCalendarAnchor as J, eventCalendarTitle as le, formatEventTimeRange as ce, eventCalendarRange as de } from "./index117.js";
3
3
  import { eventRowPx as ue, eventHourPx as ve } from "./index233.js";
4
4
  import { Disposer as pe, applyProps as me, toNodes as we } from "./index195.js";
5
5
  import { Button as x } from "./index4.js";
6
- import { Icon as K } from "./index6.js";
6
+ import { Icon as Q } from "./index6.js";
7
7
  import { useLocale as fe } from "./index31.js";
8
8
  import { agenda as he } from "./index234.js";
9
- import { el as l, sameDay as ge } from "./index235.js";
9
+ import { el as s, sameDay as ge } from "./index235.js";
10
10
  import { month as ye } from "./index236.js";
11
11
  import { timeGrid as Ce } from "./index237.js";
12
12
  import { registerMessages as De } from "./index212.js";
@@ -27,13 +27,13 @@ function vt(A) {
27
27
  let V = A.defaultView ?? (m().includes("week") ? "week" : m()[0]), T = A.defaultDate ?? /* @__PURE__ */ new Date(), _ = null;
28
28
  const w = {};
29
29
  let b = null;
30
- const a = l("div");
30
+ const a = s("div");
31
31
  a.setAttribute("role", "region"), a.setAttribute("data-cal-owner", d);
32
- const $ = l("div"), N = l("div"), R = l("span", "zen-sr-only", r.t("eventCalendar.editHint"));
32
+ const $ = s("div"), N = s("div"), R = s("span", "zen-sr-only", r.t("eventCalendar.editHint"));
33
33
  R.id = d;
34
- const W = l("span", "zen-sr-only", r.t("eventCalendar.slotHint"));
34
+ const W = s("span", "zen-sr-only", r.t("eventCalendar.slotHint"));
35
35
  W.id = `${d}-slot`;
36
- const f = l("div", "zen-sr-only");
36
+ const f = s("div", "zen-sr-only");
37
37
  f.setAttribute("aria-live", "polite"), f.setAttribute("aria-atomic", "true"), a.append($, N, R, W, f);
38
38
  let H = [], z = [], h = null, M;
39
39
  const u = {
@@ -51,7 +51,7 @@ function vt(A) {
51
51
  H = [];
52
52
  for (const e of z) e();
53
53
  z = [];
54
- }, I = () => t.view ?? V, q = () => t.date ?? T, Q = () => t.now ?? g, G = () => ({
54
+ }, I = () => t.view ?? V, q = () => t.date ?? T, X = () => t.now ?? g, G = () => ({
55
55
  weekStartsOn: t.weekStartsOn,
56
56
  nonWorkingDays: t.nonWorkingDays,
57
57
  agendaDays: t.agendaDays,
@@ -75,7 +75,7 @@ function vt(A) {
75
75
  a.ownerDocument.querySelector(i)?.focus({ preventScroll: e.part === "checkbox" });
76
76
  };
77
77
  let g = /* @__PURE__ */ new Date();
78
- const X = setInterval(() => {
78
+ const Z = setInterval(() => {
79
79
  if (t.now !== void 0) return;
80
80
  const e = g;
81
81
  if (g = /* @__PURE__ */ new Date(), !ge(e, g)) {
@@ -83,10 +83,10 @@ function vt(A) {
83
83
  return;
84
84
  }
85
85
  for (const n of a.querySelectorAll("[data-cal-now]"))
86
- n.style.top = `${le(g) / 1440 * 100}%`;
86
+ n.style.top = `${se(g) / 1440 * 100}%`;
87
87
  }, 6e4);
88
- k.add(() => clearInterval(X));
89
- const Z = () => {
88
+ k.add(() => clearInterval(Z));
89
+ const K = () => {
90
90
  const e = I(), n = q(), i = G();
91
91
  return {
92
92
  memory: w,
@@ -95,7 +95,7 @@ function vt(A) {
95
95
  scope: u,
96
96
  view: e,
97
97
  anchor: n,
98
- now: Q(),
98
+ now: X(),
99
99
  options: i,
100
100
  hourPx: Math.max(24, ve(t.density, t.hourHeight)),
101
101
  rowPx: ue(t.density),
@@ -120,8 +120,15 @@ function vt(A) {
120
120
  selectSlot: (o) => {
121
121
  t.onSlotSelect?.(o), L(r.t("eventCalendar.newEvent", { time: P(o) }));
122
122
  },
123
- propose: (o, s, C, c) => {
124
- c && (b = { id: o.id, part: "main", until: Date.now() + 1e3 }), v = c ? { id: o.id, from: o.start.getTime() } : null, t.onEventChange?.({ event: o, start: s.start, end: s.end, allDay: s.allDay, kind: C }), L(r.t("eventCalendar.proposed", { title: o.title, time: P(s) })), c && Y();
123
+ propose: (o, c, C, l) => {
124
+ l && (b = { id: o.id, part: "main", until: Date.now() + 1e3 }), v = l ? { id: o.id, from: o.start.getTime() } : null, t.onEventChange?.({
125
+ event: o,
126
+ start: c.start,
127
+ end: c.end,
128
+ allDay: c.allDay,
129
+ kind: C,
130
+ source: l ? "keyboard" : "pointer"
131
+ }), L(r.t("eventCalendar.proposed", { title: o.title, time: P(c) })), l && Y();
125
132
  },
126
133
  timeLabel: P,
127
134
  announce: L
@@ -135,29 +142,29 @@ function vt(A) {
135
142
  n && n !== a.ownerDocument.body && a.contains(n) || a.ownerDocument.querySelector(`[data-cal-owner="${d}"] [data-cal-focus="${CSS.escape(e)}"]`)?.focus({ preventScroll: !0 });
136
143
  }, E = (e, n) => (e.el.setAttribute("data-cal-focus", n), e);
137
144
  function ne(e) {
138
- const n = l("div", "zen-flex zen-flex-wrap zen-items-center zen-gap-2"), i = u.keep(
145
+ const n = s("div", "zen-flex zen-flex-wrap zen-items-center zen-gap-2"), i = u.keep(
139
146
  x({
140
147
  variant: "outline",
141
148
  size: "sm",
142
149
  "aria-label": r.t("eventCalendar.previous"),
143
- children: u.keep(K({ name: "chevron-left", size: 14, class: "rtl:zen-rotate-180" })),
150
+ children: u.keep(Q({ name: "chevron-left", size: 14, class: "rtl:zen-rotate-180" })),
144
151
  onClick: () => S(J(e.view, e.anchor, -1, e.options))
145
152
  })
146
153
  ), o = u.keep(
147
154
  x({ variant: "outline", size: "sm", children: r.t("eventCalendar.today"), onClick: () => S(e.now) })
148
- ), s = u.keep(
155
+ ), c = u.keep(
149
156
  x({
150
157
  variant: "outline",
151
158
  size: "sm",
152
159
  "aria-label": r.t("eventCalendar.next"),
153
- children: u.keep(K({ name: "chevron-right", size: 14, class: "rtl:zen-rotate-180" })),
160
+ children: u.keep(Q({ name: "chevron-right", size: 14, class: "rtl:zen-rotate-180" })),
154
161
  onClick: () => S(J(e.view, e.anchor, 1, e.options))
155
162
  })
156
- ), C = l("span", "zen-mx-1 zen-text-base zen-font-semibold zen-text-zen-foreground", se(e.view, e.anchor, e.options));
163
+ ), C = s("span", "zen-mx-1 zen-text-base zen-font-semibold zen-text-zen-foreground", le(e.view, e.anchor, e.options));
157
164
  C.setAttribute("aria-live", "polite");
158
- const c = l("div", "zen-ms-auto zen-flex zen-flex-wrap zen-items-center zen-gap-2");
159
- if (c.append(...we(t.toolbarActions)), m().length > 1) {
160
- const D = l("div", "zen-flex zen-gap-1");
165
+ const l = s("div", "zen-ms-auto zen-flex zen-flex-wrap zen-items-center zen-gap-2");
166
+ if (l.append(...we(t.toolbarActions)), m().length > 1) {
167
+ const D = s("div", "zen-flex zen-gap-1");
161
168
  D.setAttribute("role", "group"), D.setAttribute("aria-label", r.t("eventCalendar.view"));
162
169
  for (const p of m()) {
163
170
  const j = u.keep(
@@ -171,19 +178,19 @@ function vt(A) {
171
178
  );
172
179
  D.append(E(j, `view:${p}`).el);
173
180
  }
174
- c.append(D);
181
+ l.append(D);
175
182
  }
176
- return E(i, "tool:prev"), E(o, "tool:today"), E(s, "tool:next"), n.append(i.el, o.el, s.el, C, c), n;
183
+ return E(i, "tool:prev"), E(o, "tool:today"), E(c, "tool:next"), n.append(i.el, o.el, c.el, C, l), n;
177
184
  }
178
185
  function y() {
179
186
  const e = ee();
180
187
  F();
181
- const n = Z(), {
188
+ const n = K(), {
182
189
  events: i,
183
190
  defaultView: o,
184
- view: s,
191
+ view: c,
185
192
  onViewChange: C,
186
- views: c,
193
+ views: l,
187
194
  defaultDate: D,
188
195
  date: p,
189
196
  onDateChange: j,
@@ -210,9 +217,9 @@ function vt(A) {
210
217
  headerClassName: Ye,
211
218
  toolbarActions: je,
212
219
  hideToolbar: Je,
213
- emptyMessage: Ke,
220
+ emptyMessage: Qe,
214
221
  class: oe,
215
- children: Qe,
222
+ children: Xe,
216
223
  ...ae
217
224
  } = t;
218
225
  if (a.className = _e("zen-flex zen-w-full zen-flex-col zen-gap-3", oe), a.setAttribute("aria-label", r.t("eventCalendar.calendar")), $.replaceChildren(...t.hideToolbar ? [] : [ne(n)]), $.style.display = t.hideToolbar ? "none" : "", h = n.view === "month" ? ye(n) : n.view === "agenda" ? he(n) : Ce(n), N.replaceChildren(h.el), h.mounted?.(), _ && h.applyPreview(_), n.view === "month" && w.focusDayAfterRender && w.focusedDay) {
@@ -1 +1 @@
1
- {"version":3,"file":"index113.js","sources":["../src/components/event-calendar/event-calendar.ts"],"sourcesContent":["import { calendarFollow, type PendingFollow } from \"@algorisys/zen-ui-core/calendar-follow\";\nimport {\n eventCalendarRange,\n eventCalendarTitle,\n formatEventTimeRange,\n shiftEventCalendarAnchor,\n wallMinutes,\n type CalendarProposedSpan,\n type EventCalendarOptions,\n type EventCalendarView,\n} from \"@algorisys/zen-ui-core/event-calendar\";\nimport { eventHourPx, eventRowPx } from \"@algorisys/zen-ui-core/density\";\nimport { cn } from \"../../lib/cn\";\nimport { applyProps, Disposer, toNodes, type AnyZenComponent, type ZenComponent } from \"../../lib/component\";\nimport { Button } from \"../button/button\";\nimport { Icon } from \"../icon/icon\";\nimport { useLocale, type MessageKey } from \"../locale/locale\";\nimport { agenda } from \"./event-calendar-agenda\";\nimport {\n type CalendarContext,\n type CalendarEvent,\n type CalendarMemory,\n type CalendarPreview,\n type CalendarSlot,\n type CalendarViewHandle,\n el,\n type EventCalendarProps,\n type RenderScope,\n sameDay,\n} from \"./event-calendar-model\";\nimport { month } from \"./event-calendar-month\";\nimport { timeGrid } from \"./event-calendar-time-grid\";\nimport { registerMessages } from \"@algorisys/zen-ui-core/message-registry\";\nimport { CALENDAR_MESSAGES } from \"@algorisys/zen-ui-core/messages-calendar\";\n\n// This component's words live outside the base catalogue (see message-registry).\nregisterMessages(CALENDAR_MESSAGES);\n\nexport type {\n CalendarEvent,\n CalendarEventChange,\n CalendarEventRenderContext,\n CalendarEventState,\n CalendarEventVariant,\n CalendarSlot,\n EventCalendarProps,\n} from \"./event-calendar-model\";\n\n/**\n * EventCalendar — one person's or one team's calendar: a month page, week and\n * day time grids, and an agenda.\n *\n * const cal = EventCalendar({ events, onEventChange: (c) => { save(c); cal.update({ events: next }); } });\n * document.body.append(cal.el);\n *\n * Vanilla port of the React reference; same API, same output. It renders and\n * it proposes; it never edits: a drag (or Alt+arrow) calls `onEventChange`\n * with where the event would go, and nothing moves until you call\n * `update({ events })`. The maths and the drag gesture come from\n * @algorisys/zen-ui-core and are shared with every binding.\n *\n * The factory rebuilds its DOM when the data or the view changes, and nothing\n * else: a drag in progress, the slot cursor and the month's focused day update\n * the elements in place, so they keep focus and do not cost a rebuild per\n * frame. What must survive a rebuild (scroll position, cursor, focused day, an\n * open \"+N more\" panel, focus on the control the user was using) is carried\n * across it.\n */\n\nconst VIEW_LABEL: Record<EventCalendarView, MessageKey> = {\n month: \"eventCalendar.views.month\",\n week: \"eventCalendar.views.week\",\n workWeek: \"eventCalendar.views.workWeek\",\n day: \"eventCalendar.views.day\",\n agenda: \"eventCalendar.views.agenda\",\n};\n\nconst DEFAULT_VIEWS: EventCalendarView[] = [\"month\", \"week\", \"day\", \"agenda\"];\n\nlet uid = 0;\n\nexport function EventCalendar(props: EventCalendarProps): ZenComponent<EventCalendarProps> {\n let current: EventCalendarProps = { ...props };\n const loc = useLocale();\n const disposer = new Disposer();\n const hintId = `zen-event-calendar-${++uid}`;\n const views = () => (current.views?.length ? current.views : DEFAULT_VIEWS);\n\n /* Week unless the caller left week out of `views`, in which case the first\n view they did offer: opening on a view the switcher cannot show leaves no\n button pressed and no way back to it. */\n let innerView: EventCalendarView = props.defaultView ?? (views().includes(\"week\") ? \"week\" : views()[0]);\n let innerDate: Date = props.defaultDate ?? new Date();\n let preview: CalendarPreview | null = null;\n const memory: CalendarMemory = {};\n /** Focus to restore after the next rebuild: the control the user was on. */\n let pendingFocus: { id: string; part: \"main\" | \"checkbox\"; until: number } | null = null;\n\n const root = el(\"div\");\n root.setAttribute(\"role\", \"region\");\n root.setAttribute(\"data-cal-owner\", hintId);\n const toolbarHost = el(\"div\");\n const bodyHost = el(\"div\");\n const hint = el(\"span\", \"zen-sr-only\", loc.t(\"eventCalendar.editHint\"));\n hint.id = hintId;\n const slotHint = el(\"span\", \"zen-sr-only\", loc.t(\"eventCalendar.slotHint\"));\n slotHint.id = `${hintId}-slot`;\n // Kept across rebuilds, so an announcement is not dropped with the DOM it described.\n const live = el(\"div\", \"zen-sr-only\");\n live.setAttribute(\"aria-live\", \"polite\");\n live.setAttribute(\"aria-atomic\", \"true\");\n root.append(toolbarHost, bodyHost, hint, slotHint, live);\n\n let owned: AnyZenComponent[] = [];\n let cleanups: Array<() => void> = [];\n let viewHandle: CalendarViewHandle | null = null;\n let removeProps: (() => void) | undefined;\n\n const scope: RenderScope = {\n keep(component) {\n owned.push(component);\n return component;\n },\n on(node, type, listener) {\n node.addEventListener(type, listener as EventListener);\n cleanups.push(() => node.removeEventListener(type, listener as EventListener));\n },\n onRelease(cleanup) {\n cleanups.push(cleanup);\n },\n };\n const release = () => {\n for (const comp of owned) comp.destroy();\n owned = [];\n for (const off of cleanups) off();\n cleanups = [];\n };\n\n const viewOf = () => current.view ?? innerView;\n const dateOf = () => current.date ?? innerDate;\n const nowOf = () => current.now ?? clock;\n const optionsOf = (): EventCalendarOptions => ({\n weekStartsOn: current.weekStartsOn,\n nonWorkingDays: current.nonWorkingDays,\n agendaDays: current.agendaDays,\n locale: loc.locale,\n });\n\n /* A keyboard move proposed and not yet seen applied (see `propose`; core's\n calendarFollow decides in update()). Any navigation by the user cancels\n it, so an old move never pulls the view away later; the follow itself uses\n moveTo, which leaves it alone. */\n let pending: PendingFollow | null = null;\n const setView = (next: EventCalendarView) => {\n pending = null;\n if (current.view === undefined) innerView = next;\n current.onViewChange?.(next);\n render();\n };\n const moveTo = (next: Date) => {\n if (current.date === undefined) innerDate = next;\n current.onDateChange?.(next);\n };\n const setDate = (next: Date) => {\n pending = null;\n moveTo(next);\n render();\n };\n\n const timeLabel = (span: { start: Date; end: Date; allDay?: boolean }) =>\n span.allDay ? loc.t(\"eventCalendar.allDay\") : formatEventTimeRange(span.start, span.end, loc.locale);\n\n const announce = (text: string) => {\n // Cleared first so the same words twice in a row are still announced.\n live.textContent = \"\";\n requestAnimationFrame(() => {\n live.textContent = text;\n });\n };\n\n /* Looks in the calendar AND in the \"+N more\" panels it owns, which are\n portaled to <body>. */\n const restoreFocus = () => {\n const want = pendingFocus;\n if (!want) return;\n pendingFocus = null;\n if (Date.now() > want.until) return;\n const part = want.part === \"main\" ? \"[data-cal-event-main]\" : '[role=\"checkbox\"]';\n const selector = `[data-cal-owner=\"${hintId}\"] [data-cal-event=\"${CSS.escape(want.id)}\"] ${part}`;\n root.ownerDocument.querySelector<HTMLElement>(selector)?.focus({ preventScroll: want.part === \"checkbox\" });\n };\n\n /* The real clock, once a minute: the now line moves in place, and only a new\n day rebuilds (today's column changed). Not when the caller pins `now`. */\n let clock = new Date();\n const timer = setInterval(() => {\n if (current.now !== undefined) return;\n const before = clock;\n clock = new Date();\n if (!sameDay(before, clock)) {\n render();\n return;\n }\n for (const line of root.querySelectorAll<HTMLElement>(\"[data-cal-now]\")) {\n line.style.top = `${(wallMinutes(clock) / 1440) * 100}%`;\n }\n }, 60_000);\n disposer.add(() => clearInterval(timer));\n\n const context = (): CalendarContext => {\n const view = viewOf();\n const anchor = dateOf();\n const options = optionsOf();\n return {\n memory,\n props: current,\n loc,\n scope,\n view,\n anchor,\n now: nowOf(),\n options,\n hourPx: Math.max(24, eventHourPx(current.density, current.hourHeight)),\n rowPx: eventRowPx(current.density),\n snap: Math.max(1, current.snapMinutes ?? 15),\n root,\n hintId,\n preview,\n setPreview: (next) => {\n preview = next;\n viewHandle?.applyPreview(next);\n },\n editable: (event: CalendarEvent) =>\n current.onEventChange !== undefined && !event.readOnly && (current.canEditEvent?.(event) ?? true),\n selectable: current.onSlotSelect !== undefined,\n canGoToDay: views().includes(\"day\"),\n goToDay: (date: Date) => {\n if (current.date === undefined) innerDate = date;\n current.onDateChange?.(date);\n setView(\"day\");\n },\n setDate,\n openEvent: (event: CalendarEvent) => current.onEventClick?.(event),\n toggleTask: (event: CalendarEvent) => {\n // Set before the callback: a caller that calls update() at once rebuilds inside it.\n pendingFocus = { id: event.id, part: \"checkbox\", until: Date.now() + 1000 };\n current.onTaskToggle?.(event, !event.done);\n },\n selectSlot: (slot: CalendarSlot) => {\n current.onSlotSelect?.(slot);\n announce(loc.t(\"eventCalendar.newEvent\", { time: timeLabel(slot) }));\n },\n propose: (event: CalendarEvent, span: CalendarProposedSpan, kind: \"move\" | \"resize\", fromKeyboard: boolean) => {\n if (fromKeyboard) pendingFocus = { id: event.id, part: \"main\", until: Date.now() + 1000 };\n /* A keyboard move past the edge of the view should take the view with\n it, or the event vanishes and focus with it. But only once the\n caller has APPLIED it: following the proposal at once left a refused\n move (a cancelled confirm) showing a week the event never went to.\n Decided by core's calendarFollow when update({ events }) arrives.\n Recorded BEFORE the callback: a caller that applies synchronously\n calls update() inside it. Same as Solid and React. */\n pending = fromKeyboard ? { id: event.id, from: event.start.getTime() } : null;\n current.onEventChange?.({ event, start: span.start, end: span.end, allDay: span.allDay, kind });\n announce(loc.t(\"eventCalendar.proposed\", { title: event.title, time: timeLabel(span) }));\n if (fromKeyboard) restoreFocus();\n },\n timeLabel,\n announce,\n };\n };\n\n /**\n * Which control has focus, as a key that names the same control after a\n * rebuild (`data-cal-focus`). The factory rebuilds its DOM whenever the\n * caller passes new events, and without this every Enter on the slot cursor\n * or press of Next would drop a keyboard user's focus on <body>.\n */\n const focusedKey = (): string | null => {\n const active = root.ownerDocument.activeElement as HTMLElement | null;\n if (!active || !active.closest(`[data-cal-owner=\"${hintId}\"]`)) return null;\n return active.closest<HTMLElement>(\"[data-cal-focus]\")?.getAttribute(\"data-cal-focus\") ?? null;\n };\n const refocusKey = (key: string | null) => {\n if (!key) return;\n const active = root.ownerDocument.activeElement;\n if (active && active !== root.ownerDocument.body && root.contains(active)) return;\n root.ownerDocument\n .querySelector<HTMLElement>(`[data-cal-owner=\"${hintId}\"] [data-cal-focus=\"${CSS.escape(key)}\"]`)\n ?.focus({ preventScroll: true });\n };\n const tag = <T extends AnyZenComponent>(component: T, key: string): T => {\n (component.el as HTMLElement).setAttribute(\"data-cal-focus\", key);\n return component;\n };\n\n function toolbar(cal: CalendarContext): HTMLElement {\n const bar = el(\"div\", \"zen-flex zen-flex-wrap zen-items-center zen-gap-2\");\n const prev = scope.keep(\n Button({\n variant: \"outline\",\n size: \"sm\",\n \"aria-label\": loc.t(\"eventCalendar.previous\"),\n children: scope.keep(Icon({ name: \"chevron-left\", size: 14, class: \"rtl:zen-rotate-180\" })),\n onClick: () => setDate(shiftEventCalendarAnchor(cal.view, cal.anchor, -1, cal.options)),\n }),\n );\n const today = scope.keep(\n Button({ variant: \"outline\", size: \"sm\", children: loc.t(\"eventCalendar.today\"), onClick: () => setDate(cal.now) }),\n );\n const next = scope.keep(\n Button({\n variant: \"outline\",\n size: \"sm\",\n \"aria-label\": loc.t(\"eventCalendar.next\"),\n children: scope.keep(Icon({ name: \"chevron-right\", size: 14, class: \"rtl:zen-rotate-180\" })),\n onClick: () => setDate(shiftEventCalendarAnchor(cal.view, cal.anchor, 1, cal.options)),\n }),\n );\n // Announced, so a screen reader hears where Previous / Next landed. Not a\n // heading: the page decides its own heading levels.\n const title = el(\"span\", \"zen-mx-1 zen-text-base zen-font-semibold zen-text-zen-foreground\", eventCalendarTitle(cal.view, cal.anchor, cal.options));\n title.setAttribute(\"aria-live\", \"polite\");\n\n const end = el(\"div\", \"zen-ms-auto zen-flex zen-flex-wrap zen-items-center zen-gap-2\");\n end.append(...toNodes(current.toolbarActions));\n if (views().length > 1) {\n const switcher = el(\"div\", \"zen-flex zen-gap-1\");\n switcher.setAttribute(\"role\", \"group\");\n switcher.setAttribute(\"aria-label\", loc.t(\"eventCalendar.view\"));\n for (const v of views()) {\n const button = scope.keep(\n Button({\n variant: cal.view === v ? \"solid\" : \"outline\",\n size: \"sm\",\n \"aria-pressed\": String(cal.view === v),\n children: loc.t(VIEW_LABEL[v]),\n onClick: () => setView(v),\n }),\n );\n switcher.append(tag(button, `view:${v}`).el);\n }\n end.append(switcher);\n }\n tag(prev, \"tool:prev\");\n tag(today, \"tool:today\");\n tag(next, \"tool:next\");\n bar.append(prev.el, today.el, next.el, title, end);\n return bar;\n }\n\n function render(): void {\n const keep = focusedKey();\n release();\n const cal = context();\n\n const {\n events: _e,\n defaultView: _dv,\n view: _v,\n onViewChange: _ovc,\n views: _vs,\n defaultDate: _dd,\n date: _d,\n onDateChange: _odc,\n now: _n,\n weekStartsOn: _ws,\n nonWorkingDays: _nwd,\n workingHours: _wh,\n agendaDays: _ad,\n scrollToHour: _sth,\n hourHeight: _hh,\n density: _den,\n height: _h,\n snapMinutes: _sm,\n newEventMinutes: _nem,\n maxEventsPerDay: _med,\n onEventClick: _oec,\n onSlotSelect: _oss,\n onEventChange: _oech,\n canEditEvent: _cee,\n onTaskToggle: _ott,\n renderEvent: _re,\n eventClassName: _ecn,\n dayClassName: _dcn,\n headerClassName: _hcn,\n toolbarActions: _ta,\n hideToolbar: _ht,\n emptyMessage: _em,\n class: className,\n children: _children,\n ...rest\n } = current;\n root.className = cn(\"zen-flex zen-w-full zen-flex-col zen-gap-3\", className);\n root.setAttribute(\"aria-label\", loc.t(\"eventCalendar.calendar\"));\n\n toolbarHost.replaceChildren(...(current.hideToolbar ? [] : [toolbar(cal)]));\n toolbarHost.style.display = current.hideToolbar ? \"none\" : \"\";\n viewHandle = cal.view === \"month\" ? month(cal) : cal.view === \"agenda\" ? agenda(cal) : timeGrid(cal);\n bodyHost.replaceChildren(viewHandle.el);\n viewHandle.mounted?.();\n if (preview) viewHandle.applyPreview(preview);\n\n // Keyboard paging in the month moved to a day on another page: focus it there.\n if (cal.view === \"month\" && memory.focusDayAfterRender && memory.focusedDay) {\n memory.focusDayAfterRender = false;\n const d = memory.focusedDay;\n const key = `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, \"0\")}-${String(d.getDate()).padStart(2, \"0\")}`;\n root.querySelector<HTMLElement>(`[data-cal-cell=\"${key}\"] [data-cal-daynum]`)?.focus();\n }\n refocusKey(keep);\n restoreFocus();\n\n removeProps?.();\n removeProps = applyProps(root, rest as Record<string, unknown>);\n }\n\n render();\n disposer.add(() => removeProps?.());\n disposer.add(release);\n\n return {\n el: root,\n update(next) {\n current = { ...current, ...next };\n if (pending && next.events) {\n const view = viewOf();\n // The agenda is a list from a date, not a range to leave: it never follows.\n const decision =\n view === \"agenda\"\n ? { done: true, date: null }\n : calendarFollow(pending, next.events, eventCalendarRange(view, dateOf(), optionsOf()));\n if (decision.done) {\n pending = null;\n if (decision.date) moveTo(decision.date);\n }\n }\n // render() puts focus back on the moved event (pendingFocus), in view or not.\n render();\n },\n destroy() {\n disposer.dispose();\n root.remove();\n },\n };\n}\n"],"names":["registerMessages","CALENDAR_MESSAGES","VIEW_LABEL","DEFAULT_VIEWS","uid","EventCalendar","props","current","loc","useLocale","disposer","Disposer","hintId","views","innerView","innerDate","preview","memory","pendingFocus","root","el","toolbarHost","bodyHost","hint","slotHint","live","owned","cleanups","viewHandle","removeProps","scope","component","node","type","listener","cleanup","release","comp","off","viewOf","dateOf","nowOf","clock","optionsOf","pending","setView","next","render","moveTo","setDate","timeLabel","span","formatEventTimeRange","announce","text","restoreFocus","want","part","selector","timer","before","sameDay","line","wallMinutes","context","view","anchor","options","eventHourPx","eventRowPx","event","date","slot","kind","fromKeyboard","focusedKey","active","refocusKey","key","tag","toolbar","cal","bar","prev","Button","Icon","shiftEventCalendarAnchor","today","title","eventCalendarTitle","end","toNodes","switcher","v","button","keep","_e","_dv","_v","_ovc","_vs","_dd","_d","_odc","_n","_ws","_nwd","_wh","_ad","_sth","_hh","_den","_h","_sm","_nem","_med","_oec","_oss","_oech","_cee","_ott","_re","_ecn","_dcn","_hcn","_ta","_ht","_em","className","_children","rest","cn","month","agenda","timeGrid","d","applyProps","decision","calendarFollow","eventCalendarRange"],"mappings":";;;;;;;;;;;;;;AAoCAA,GAAiBC,EAAiB;AAiClC,MAAMC,KAAoD;AAAA,EACxD,OAAO;AAAA,EACP,MAAM;AAAA,EACN,UAAU;AAAA,EACV,KAAK;AAAA,EACL,QAAQ;AACV,GAEMC,KAAqC,CAAC,SAAS,QAAQ,OAAO,QAAQ;AAE5E,IAAIC,KAAM;AAEH,SAASC,GAAcC,GAA6D;AACzF,MAAIC,IAA8B,EAAE,GAAGD,EAAA;AACvC,QAAME,IAAMC,GAAA,GACNC,IAAW,IAAIC,GAAA,GACfC,IAAS,sBAAsB,EAAER,EAAG,IACpCS,IAAQ,MAAON,EAAQ,OAAO,SAASA,EAAQ,QAAQJ;AAK7D,MAAIW,IAA+BR,EAAM,gBAAgBO,EAAA,EAAQ,SAAS,MAAM,IAAI,SAASA,EAAA,EAAQ,CAAC,IAClGE,IAAkBT,EAAM,eAAe,oBAAI,KAAA,GAC3CU,IAAkC;AACtC,QAAMC,IAAyB,CAAA;AAE/B,MAAIC,IAAgF;AAEpF,QAAMC,IAAOC,EAAG,KAAK;AACrB,EAAAD,EAAK,aAAa,QAAQ,QAAQ,GAClCA,EAAK,aAAa,kBAAkBP,CAAM;AAC1C,QAAMS,IAAcD,EAAG,KAAK,GACtBE,IAAWF,EAAG,KAAK,GACnBG,IAAOH,EAAG,QAAQ,eAAeZ,EAAI,EAAE,wBAAwB,CAAC;AACtE,EAAAe,EAAK,KAAKX;AACV,QAAMY,IAAWJ,EAAG,QAAQ,eAAeZ,EAAI,EAAE,wBAAwB,CAAC;AAC1E,EAAAgB,EAAS,KAAK,GAAGZ,CAAM;AAEvB,QAAMa,IAAOL,EAAG,OAAO,aAAa;AACpC,EAAAK,EAAK,aAAa,aAAa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mB,IAAO1B,EAAA,GAEPkG,IACJxE,MAAS,WACL,EAAE,MAAM,IAAM,MAAM,KAAA,IACpByE,GAAe9F,GAASE,EAAK,QAAQ6F,GAAmB1E,GAAMzB,KAAUG,EAAA,CAAW,CAAC;AAC1F,QAAI8F,EAAS,SACX7F,IAAU,MACN6F,EAAS,QAAMzF,EAAOyF,EAAS,IAAI;AAAA,MAE3C;AAEA,MAAA1F,EAAA;AAAA,IACF;AAAA,IACA,UAAU;AACR,MAAArC,EAAS,QAAA,GACTS,EAAK,OAAA;AAAA,IACP;AAAA,EAAA;AAEJ;"}
1
+ {"version":3,"file":"index113.js","sources":["../src/components/event-calendar/event-calendar.ts"],"sourcesContent":["import { calendarFollow, type PendingFollow } from \"@algorisys/zen-ui-core/calendar-follow\";\nimport {\n eventCalendarRange,\n eventCalendarTitle,\n formatEventTimeRange,\n shiftEventCalendarAnchor,\n wallMinutes,\n type CalendarProposedSpan,\n type EventCalendarOptions,\n type EventCalendarView,\n} from \"@algorisys/zen-ui-core/event-calendar\";\nimport { eventHourPx, eventRowPx } from \"@algorisys/zen-ui-core/density\";\nimport { cn } from \"../../lib/cn\";\nimport { applyProps, Disposer, toNodes, type AnyZenComponent, type ZenComponent } from \"../../lib/component\";\nimport { Button } from \"../button/button\";\nimport { Icon } from \"../icon/icon\";\nimport { useLocale, type MessageKey } from \"../locale/locale\";\nimport { agenda } from \"./event-calendar-agenda\";\nimport {\n type CalendarContext,\n type CalendarEvent,\n type CalendarMemory,\n type CalendarPreview,\n type CalendarSlot,\n type CalendarViewHandle,\n el,\n type EventCalendarProps,\n type RenderScope,\n sameDay,\n} from \"./event-calendar-model\";\nimport { month } from \"./event-calendar-month\";\nimport { timeGrid } from \"./event-calendar-time-grid\";\nimport { registerMessages } from \"@algorisys/zen-ui-core/message-registry\";\nimport { CALENDAR_MESSAGES } from \"@algorisys/zen-ui-core/messages-calendar\";\n\n// This component's words live outside the base catalogue (see message-registry).\nregisterMessages(CALENDAR_MESSAGES);\n\nexport type {\n CalendarEvent,\n CalendarEventChange,\n CalendarEventRenderContext,\n CalendarEventState,\n CalendarEventVariant,\n CalendarSlot,\n EventCalendarProps,\n} from \"./event-calendar-model\";\n\n/**\n * EventCalendar — one person's or one team's calendar: a month page, week and\n * day time grids, and an agenda.\n *\n * const cal = EventCalendar({ events, onEventChange: (c) => { save(c); cal.update({ events: next }); } });\n * document.body.append(cal.el);\n *\n * Vanilla port of the React reference; same API, same output. It renders and\n * it proposes; it never edits: a drag (or Alt+arrow) calls `onEventChange`\n * with where the event would go, and nothing moves until you call\n * `update({ events })`. The maths and the drag gesture come from\n * @algorisys/zen-ui-core and are shared with every binding.\n *\n * The factory rebuilds its DOM when the data or the view changes, and nothing\n * else: a drag in progress, the slot cursor and the month's focused day update\n * the elements in place, so they keep focus and do not cost a rebuild per\n * frame. What must survive a rebuild (scroll position, cursor, focused day, an\n * open \"+N more\" panel, focus on the control the user was using) is carried\n * across it.\n */\n\nconst VIEW_LABEL: Record<EventCalendarView, MessageKey> = {\n month: \"eventCalendar.views.month\",\n week: \"eventCalendar.views.week\",\n workWeek: \"eventCalendar.views.workWeek\",\n day: \"eventCalendar.views.day\",\n agenda: \"eventCalendar.views.agenda\",\n};\n\nconst DEFAULT_VIEWS: EventCalendarView[] = [\"month\", \"week\", \"day\", \"agenda\"];\n\nlet uid = 0;\n\nexport function EventCalendar(props: EventCalendarProps): ZenComponent<EventCalendarProps> {\n let current: EventCalendarProps = { ...props };\n const loc = useLocale();\n const disposer = new Disposer();\n const hintId = `zen-event-calendar-${++uid}`;\n const views = () => (current.views?.length ? current.views : DEFAULT_VIEWS);\n\n /* Week unless the caller left week out of `views`, in which case the first\n view they did offer: opening on a view the switcher cannot show leaves no\n button pressed and no way back to it. */\n let innerView: EventCalendarView = props.defaultView ?? (views().includes(\"week\") ? \"week\" : views()[0]);\n let innerDate: Date = props.defaultDate ?? new Date();\n let preview: CalendarPreview | null = null;\n const memory: CalendarMemory = {};\n /** Focus to restore after the next rebuild: the control the user was on. */\n let pendingFocus: { id: string; part: \"main\" | \"checkbox\"; until: number } | null = null;\n\n const root = el(\"div\");\n root.setAttribute(\"role\", \"region\");\n root.setAttribute(\"data-cal-owner\", hintId);\n const toolbarHost = el(\"div\");\n const bodyHost = el(\"div\");\n const hint = el(\"span\", \"zen-sr-only\", loc.t(\"eventCalendar.editHint\"));\n hint.id = hintId;\n const slotHint = el(\"span\", \"zen-sr-only\", loc.t(\"eventCalendar.slotHint\"));\n slotHint.id = `${hintId}-slot`;\n // Kept across rebuilds, so an announcement is not dropped with the DOM it described.\n const live = el(\"div\", \"zen-sr-only\");\n live.setAttribute(\"aria-live\", \"polite\");\n live.setAttribute(\"aria-atomic\", \"true\");\n root.append(toolbarHost, bodyHost, hint, slotHint, live);\n\n let owned: AnyZenComponent[] = [];\n let cleanups: Array<() => void> = [];\n let viewHandle: CalendarViewHandle | null = null;\n let removeProps: (() => void) | undefined;\n\n const scope: RenderScope = {\n keep(component) {\n owned.push(component);\n return component;\n },\n on(node, type, listener) {\n node.addEventListener(type, listener as EventListener);\n cleanups.push(() => node.removeEventListener(type, listener as EventListener));\n },\n onRelease(cleanup) {\n cleanups.push(cleanup);\n },\n };\n const release = () => {\n for (const comp of owned) comp.destroy();\n owned = [];\n for (const off of cleanups) off();\n cleanups = [];\n };\n\n const viewOf = () => current.view ?? innerView;\n const dateOf = () => current.date ?? innerDate;\n const nowOf = () => current.now ?? clock;\n const optionsOf = (): EventCalendarOptions => ({\n weekStartsOn: current.weekStartsOn,\n nonWorkingDays: current.nonWorkingDays,\n agendaDays: current.agendaDays,\n locale: loc.locale,\n });\n\n /* A keyboard move proposed and not yet seen applied (see `propose`; core's\n calendarFollow decides in update()). Any navigation by the user cancels\n it, so an old move never pulls the view away later; the follow itself uses\n moveTo, which leaves it alone. */\n let pending: PendingFollow | null = null;\n const setView = (next: EventCalendarView) => {\n pending = null;\n if (current.view === undefined) innerView = next;\n current.onViewChange?.(next);\n render();\n };\n const moveTo = (next: Date) => {\n if (current.date === undefined) innerDate = next;\n current.onDateChange?.(next);\n };\n const setDate = (next: Date) => {\n pending = null;\n moveTo(next);\n render();\n };\n\n const timeLabel = (span: { start: Date; end: Date; allDay?: boolean }) =>\n span.allDay ? loc.t(\"eventCalendar.allDay\") : formatEventTimeRange(span.start, span.end, loc.locale);\n\n const announce = (text: string) => {\n // Cleared first so the same words twice in a row are still announced.\n live.textContent = \"\";\n requestAnimationFrame(() => {\n live.textContent = text;\n });\n };\n\n /* Looks in the calendar AND in the \"+N more\" panels it owns, which are\n portaled to <body>. */\n const restoreFocus = () => {\n const want = pendingFocus;\n if (!want) return;\n pendingFocus = null;\n if (Date.now() > want.until) return;\n const part = want.part === \"main\" ? \"[data-cal-event-main]\" : '[role=\"checkbox\"]';\n const selector = `[data-cal-owner=\"${hintId}\"] [data-cal-event=\"${CSS.escape(want.id)}\"] ${part}`;\n root.ownerDocument.querySelector<HTMLElement>(selector)?.focus({ preventScroll: want.part === \"checkbox\" });\n };\n\n /* The real clock, once a minute: the now line moves in place, and only a new\n day rebuilds (today's column changed). Not when the caller pins `now`. */\n let clock = new Date();\n const timer = setInterval(() => {\n if (current.now !== undefined) return;\n const before = clock;\n clock = new Date();\n if (!sameDay(before, clock)) {\n render();\n return;\n }\n for (const line of root.querySelectorAll<HTMLElement>(\"[data-cal-now]\")) {\n line.style.top = `${(wallMinutes(clock) / 1440) * 100}%`;\n }\n }, 60_000);\n disposer.add(() => clearInterval(timer));\n\n const context = (): CalendarContext => {\n const view = viewOf();\n const anchor = dateOf();\n const options = optionsOf();\n return {\n memory,\n props: current,\n loc,\n scope,\n view,\n anchor,\n now: nowOf(),\n options,\n hourPx: Math.max(24, eventHourPx(current.density, current.hourHeight)),\n rowPx: eventRowPx(current.density),\n snap: Math.max(1, current.snapMinutes ?? 15),\n root,\n hintId,\n preview,\n setPreview: (next) => {\n preview = next;\n viewHandle?.applyPreview(next);\n },\n editable: (event: CalendarEvent) =>\n current.onEventChange !== undefined && !event.readOnly && (current.canEditEvent?.(event) ?? true),\n selectable: current.onSlotSelect !== undefined,\n canGoToDay: views().includes(\"day\"),\n goToDay: (date: Date) => {\n if (current.date === undefined) innerDate = date;\n current.onDateChange?.(date);\n setView(\"day\");\n },\n setDate,\n openEvent: (event: CalendarEvent) => current.onEventClick?.(event),\n toggleTask: (event: CalendarEvent) => {\n // Set before the callback: a caller that calls update() at once rebuilds inside it.\n pendingFocus = { id: event.id, part: \"checkbox\", until: Date.now() + 1000 };\n current.onTaskToggle?.(event, !event.done);\n },\n selectSlot: (slot: CalendarSlot) => {\n current.onSlotSelect?.(slot);\n announce(loc.t(\"eventCalendar.newEvent\", { time: timeLabel(slot) }));\n },\n propose: (event: CalendarEvent, span: CalendarProposedSpan, kind: \"move\" | \"resize\", fromKeyboard: boolean) => {\n if (fromKeyboard) pendingFocus = { id: event.id, part: \"main\", until: Date.now() + 1000 };\n /* A keyboard move past the edge of the view should take the view with\n it, or the event vanishes and focus with it. But only once the\n caller has APPLIED it: following the proposal at once left a refused\n move (a cancelled confirm) showing a week the event never went to.\n Decided by core's calendarFollow when update({ events }) arrives.\n Recorded BEFORE the callback: a caller that applies synchronously\n calls update() inside it. Same as Solid and React. */\n pending = fromKeyboard ? { id: event.id, from: event.start.getTime() } : null;\n current.onEventChange?.({\n event,\n start: span.start,\n end: span.end,\n allDay: span.allDay,\n kind,\n source: fromKeyboard ? \"keyboard\" : \"pointer\",\n });\n announce(loc.t(\"eventCalendar.proposed\", { title: event.title, time: timeLabel(span) }));\n if (fromKeyboard) restoreFocus();\n },\n timeLabel,\n announce,\n };\n };\n\n /**\n * Which control has focus, as a key that names the same control after a\n * rebuild (`data-cal-focus`). The factory rebuilds its DOM whenever the\n * caller passes new events, and without this every Enter on the slot cursor\n * or press of Next would drop a keyboard user's focus on <body>.\n */\n const focusedKey = (): string | null => {\n const active = root.ownerDocument.activeElement as HTMLElement | null;\n if (!active || !active.closest(`[data-cal-owner=\"${hintId}\"]`)) return null;\n return active.closest<HTMLElement>(\"[data-cal-focus]\")?.getAttribute(\"data-cal-focus\") ?? null;\n };\n const refocusKey = (key: string | null) => {\n if (!key) return;\n const active = root.ownerDocument.activeElement;\n if (active && active !== root.ownerDocument.body && root.contains(active)) return;\n root.ownerDocument\n .querySelector<HTMLElement>(`[data-cal-owner=\"${hintId}\"] [data-cal-focus=\"${CSS.escape(key)}\"]`)\n ?.focus({ preventScroll: true });\n };\n const tag = <T extends AnyZenComponent>(component: T, key: string): T => {\n (component.el as HTMLElement).setAttribute(\"data-cal-focus\", key);\n return component;\n };\n\n function toolbar(cal: CalendarContext): HTMLElement {\n const bar = el(\"div\", \"zen-flex zen-flex-wrap zen-items-center zen-gap-2\");\n const prev = scope.keep(\n Button({\n variant: \"outline\",\n size: \"sm\",\n \"aria-label\": loc.t(\"eventCalendar.previous\"),\n children: scope.keep(Icon({ name: \"chevron-left\", size: 14, class: \"rtl:zen-rotate-180\" })),\n onClick: () => setDate(shiftEventCalendarAnchor(cal.view, cal.anchor, -1, cal.options)),\n }),\n );\n const today = scope.keep(\n Button({ variant: \"outline\", size: \"sm\", children: loc.t(\"eventCalendar.today\"), onClick: () => setDate(cal.now) }),\n );\n const next = scope.keep(\n Button({\n variant: \"outline\",\n size: \"sm\",\n \"aria-label\": loc.t(\"eventCalendar.next\"),\n children: scope.keep(Icon({ name: \"chevron-right\", size: 14, class: \"rtl:zen-rotate-180\" })),\n onClick: () => setDate(shiftEventCalendarAnchor(cal.view, cal.anchor, 1, cal.options)),\n }),\n );\n // Announced, so a screen reader hears where Previous / Next landed. Not a\n // heading: the page decides its own heading levels.\n const title = el(\"span\", \"zen-mx-1 zen-text-base zen-font-semibold zen-text-zen-foreground\", eventCalendarTitle(cal.view, cal.anchor, cal.options));\n title.setAttribute(\"aria-live\", \"polite\");\n\n const end = el(\"div\", \"zen-ms-auto zen-flex zen-flex-wrap zen-items-center zen-gap-2\");\n end.append(...toNodes(current.toolbarActions));\n if (views().length > 1) {\n const switcher = el(\"div\", \"zen-flex zen-gap-1\");\n switcher.setAttribute(\"role\", \"group\");\n switcher.setAttribute(\"aria-label\", loc.t(\"eventCalendar.view\"));\n for (const v of views()) {\n const button = scope.keep(\n Button({\n variant: cal.view === v ? \"solid\" : \"outline\",\n size: \"sm\",\n \"aria-pressed\": String(cal.view === v),\n children: loc.t(VIEW_LABEL[v]),\n onClick: () => setView(v),\n }),\n );\n switcher.append(tag(button, `view:${v}`).el);\n }\n end.append(switcher);\n }\n tag(prev, \"tool:prev\");\n tag(today, \"tool:today\");\n tag(next, \"tool:next\");\n bar.append(prev.el, today.el, next.el, title, end);\n return bar;\n }\n\n function render(): void {\n const keep = focusedKey();\n release();\n const cal = context();\n\n const {\n events: _e,\n defaultView: _dv,\n view: _v,\n onViewChange: _ovc,\n views: _vs,\n defaultDate: _dd,\n date: _d,\n onDateChange: _odc,\n now: _n,\n weekStartsOn: _ws,\n nonWorkingDays: _nwd,\n workingHours: _wh,\n agendaDays: _ad,\n scrollToHour: _sth,\n hourHeight: _hh,\n density: _den,\n height: _h,\n snapMinutes: _sm,\n newEventMinutes: _nem,\n maxEventsPerDay: _med,\n onEventClick: _oec,\n onSlotSelect: _oss,\n onEventChange: _oech,\n canEditEvent: _cee,\n onTaskToggle: _ott,\n renderEvent: _re,\n eventClassName: _ecn,\n dayClassName: _dcn,\n headerClassName: _hcn,\n toolbarActions: _ta,\n hideToolbar: _ht,\n emptyMessage: _em,\n class: className,\n children: _children,\n ...rest\n } = current;\n root.className = cn(\"zen-flex zen-w-full zen-flex-col zen-gap-3\", className);\n root.setAttribute(\"aria-label\", loc.t(\"eventCalendar.calendar\"));\n\n toolbarHost.replaceChildren(...(current.hideToolbar ? [] : [toolbar(cal)]));\n toolbarHost.style.display = current.hideToolbar ? \"none\" : \"\";\n viewHandle = cal.view === \"month\" ? month(cal) : cal.view === \"agenda\" ? agenda(cal) : timeGrid(cal);\n bodyHost.replaceChildren(viewHandle.el);\n viewHandle.mounted?.();\n if (preview) viewHandle.applyPreview(preview);\n\n // Keyboard paging in the month moved to a day on another page: focus it there.\n if (cal.view === \"month\" && memory.focusDayAfterRender && memory.focusedDay) {\n memory.focusDayAfterRender = false;\n const d = memory.focusedDay;\n const key = `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, \"0\")}-${String(d.getDate()).padStart(2, \"0\")}`;\n root.querySelector<HTMLElement>(`[data-cal-cell=\"${key}\"] [data-cal-daynum]`)?.focus();\n }\n refocusKey(keep);\n restoreFocus();\n\n removeProps?.();\n removeProps = applyProps(root, rest as Record<string, unknown>);\n }\n\n render();\n disposer.add(() => removeProps?.());\n disposer.add(release);\n\n return {\n el: root,\n update(next) {\n current = { ...current, ...next };\n if (pending && next.events) {\n const view = viewOf();\n // The agenda is a list from a date, not a range to leave: it never follows.\n const decision =\n view === \"agenda\"\n ? { done: true, date: null }\n : calendarFollow(pending, next.events, eventCalendarRange(view, dateOf(), optionsOf()));\n if (decision.done) {\n pending = null;\n if (decision.date) moveTo(decision.date);\n }\n }\n // render() puts focus back on the moved event (pendingFocus), in view or not.\n render();\n },\n destroy() {\n disposer.dispose();\n root.remove();\n },\n };\n}\n"],"names":["registerMessages","CALENDAR_MESSAGES","VIEW_LABEL","DEFAULT_VIEWS","uid","EventCalendar","props","current","loc","useLocale","disposer","Disposer","hintId","views","innerView","innerDate","preview","memory","pendingFocus","root","el","toolbarHost","bodyHost","hint","slotHint","live","owned","cleanups","viewHandle","removeProps","scope","component","node","type","listener","cleanup","release","comp","off","viewOf","dateOf","nowOf","clock","optionsOf","pending","setView","next","render","moveTo","setDate","timeLabel","span","formatEventTimeRange","announce","text","restoreFocus","want","part","selector","timer","before","sameDay","line","wallMinutes","context","view","anchor","options","eventHourPx","eventRowPx","event","date","slot","kind","fromKeyboard","focusedKey","active","refocusKey","key","tag","toolbar","cal","bar","prev","Button","Icon","shiftEventCalendarAnchor","today","title","eventCalendarTitle","end","toNodes","switcher","v","button","keep","_e","_dv","_v","_ovc","_vs","_dd","_d","_odc","_n","_ws","_nwd","_wh","_ad","_sth","_hh","_den","_h","_sm","_nem","_med","_oec","_oss","_oech","_cee","_ott","_re","_ecn","_dcn","_hcn","_ta","_ht","_em","className","_children","rest","cn","month","agenda","timeGrid","d","applyProps","decision","calendarFollow","eventCalendarRange"],"mappings":";;;;;;;;;;;;;;AAoCAA,GAAiBC,EAAiB;AAiClC,MAAMC,KAAoD;AAAA,EACxD,OAAO;AAAA,EACP,MAAM;AAAA,EACN,UAAU;AAAA,EACV,KAAK;AAAA,EACL,QAAQ;AACV,GAEMC,KAAqC,CAAC,SAAS,QAAQ,OAAO,QAAQ;AAE5E,IAAIC,KAAM;AAEH,SAASC,GAAcC,GAA6D;AACzF,MAAIC,IAA8B,EAAE,GAAGD,EAAA;AACvC,QAAME,IAAMC,GAAA,GACNC,IAAW,IAAIC,GAAA,GACfC,IAAS,sBAAsB,EAAER,EAAG,IACpCS,IAAQ,MAAON,EAAQ,OAAO,SAASA,EAAQ,QAAQJ;AAK7D,MAAIW,IAA+BR,EAAM,gBAAgBO,EAAA,EAAQ,SAAS,MAAM,IAAI,SAASA,EAAA,EAAQ,CAAC,IAClGE,IAAkBT,EAAM,eAAe,oBAAI,KAAA,GAC3CU,IAAkC;AACtC,QAAMC,IAAyB,CAAA;AAE/B,MAAIC,IAAgF;AAEpF,QAAMC,IAAOC,EAAG,KAAK;AACrB,EAAAD,EAAK,aAAa,QAAQ,QAAQ,GAClCA,EAAK,aAAa,kBAAkBP,CAAM;AAC1C,QAAMS,IAAcD,EAAG,KAAK,GACtBE,IAAWF,EAAG,KAAK,GACnBG,IAAOH,EAAG,QAAQ,eAAeZ,EAAI,EAAE,wBAAwB,CAAC;AACtE,EAAAe,EAAK,KAAKX;AACV,QAAMY,IAAWJ,EAAG,QAAQ,eAAeZ,EAAI,EAAE,wBAAwB,CAAC;AAC1E,EAAAgB,EAAS,KAAK,GAAGZ,CAAM;AAEvB,QAAMa,IAAOL,EAAG,OAAO,aAAa;AACpC,EAAAK,EAAK,aAAa,aAAa,QAAQ,GAC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GAAGuC,EAAA,GACvBF,KAAWE,EAAK,QAAQ;AAC1B,cAAMmB,IAAO1B,EAAA,GAEPkG,IACJxE,MAAS,WACL,EAAE,MAAM,IAAM,MAAM,KAAA,IACpByE,GAAe9F,GAASE,EAAK,QAAQ6F,GAAmB1E,GAAMzB,KAAUG,EAAA,CAAW,CAAC;AAC1F,QAAI8F,EAAS,SACX7F,IAAU,MACN6F,EAAS,QAAMzF,EAAOyF,EAAS,IAAI;AAAA,MAE3C;AAEA,MAAA1F,EAAA;AAAA,IACF;AAAA,IACA,UAAU;AACR,MAAArC,EAAS,QAAA,GACTS,EAAK,OAAA;AAAA,IACP;AAAA,EAAA;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index235.js","sources":["../src/components/event-calendar/event-calendar-model.ts"],"sourcesContent":["import type {\n CalendarProposedSpan,\n EventCalendarOptions,\n SlotCursor,\n EventCalendarView,\n Weekday,\n} from \"@algorisys/zen-ui-core/event-calendar\";\nimport type { Density } from \"@algorisys/zen-ui-core/density\";\nimport { cn } from \"../../lib/cn\";\nimport type { AnyZenComponent, BaseProps, Child } from \"../../lib/component\";\nimport type { useLocale } from \"../locale/locale\";\n\nexport type CalendarEventState = \"default\" | \"info\" | \"success\" | \"warning\" | \"error\";\n\nexport interface CalendarEvent {\n id: string;\n title: string;\n start: Date;\n /** Exclusive. For an all-day event, the first day NOT included (or the same day for a one-day event). */\n end: Date;\n allDay?: boolean;\n /** Token colour. \"default\" is the primary tint. */\n state?: CalendarEventState;\n /** Any CSS colour; wins over `state`. For a per-calendar colour from your own map. */\n color?: string;\n location?: string;\n /** Minutes before the start. Shown as a mark; zen-ui does not fire reminders. */\n reminders?: number[];\n /** Shown as a mark. Expand the occurrences before passing them (see `expandRecurrence`). */\n recurring?: boolean;\n /** \"task\" draws a checkbox; `done` strikes it through. */\n kind?: \"event\" | \"task\";\n done?: boolean;\n /** Never offered for moving or resizing, whatever `canEditEvent` says. */\n readOnly?: boolean;\n /**\n * Render the event as a link to this URL, so middle-click and \"open in new\n * tab\" work. `onEventClick` still fires on a plain click; the browser then\n * follows the link.\n */\n href?: string;\n}\n\nexport interface CalendarSlot {\n start: Date;\n /** Exclusive. */\n end: Date;\n allDay: boolean;\n}\n\nexport interface CalendarEventChange {\n /** The event as you passed it. */\n event: CalendarEvent;\n start: Date;\n end: Date;\n allDay: boolean;\n kind: \"move\" | \"resize\";\n}\n\nexport type CalendarEventVariant = \"block\" | \"bar\" | \"chip\" | \"row\";\n\nexport interface CalendarEventRenderContext {\n view: EventCalendarView;\n /** \"block\" in a time grid, \"bar\" for multi-day and all-day, \"chip\" for a timed event in a month cell, \"row\" in lists. */\n variant: CalendarEventVariant;\n /** \"09:00 – 10:30\" or the localised \"All day\". */\n timeLabel: string;\n /** Too short for a second line. */\n compact: boolean;\n}\n\nexport interface EventCalendarProps extends BaseProps {\n events: CalendarEvent[];\n /** Starting view. The factory owns it after that; pass `view` (or call update) to control it. Default \"week\". */\n defaultView?: EventCalendarView;\n view?: EventCalendarView;\n onViewChange?: (view: EventCalendarView) => void;\n /** Which views the switcher offers, in order. Default month, week, day, agenda. */\n views?: EventCalendarView[];\n /** Any date inside the range to open on. Default today. */\n defaultDate?: Date;\n date?: Date;\n onDateChange?: (date: Date) => void;\n /** Reference \"now\" for today and the now line. Injectable for tests and demos. */\n now?: Date;\n /** First column of a week. Default 1 (Monday). */\n weekStartsOn?: Weekday;\n /** Shaded, and left out of the work-week view. Default [0, 6]. */\n nonWorkingDays?: number[];\n /** [from, to) hours drawn unshaded in the time grid. Default [9, 18]. */\n workingHours?: [number, number];\n /** Days shown by the agenda. Default 14. */\n agendaDays?: number;\n /** Hour scrolled to the top of the time grid when it opens. Default 8. */\n scrollToHour?: number;\n /** Pixels per hour in the time grid. Wins over `density`. */\n hourHeight?: number;\n /** \"compact\", \"comfortable\" (default) or \"touch\" (44px rows, 64px hours). */\n density?: Density;\n /** Height of the time grid's scrolling area in px. Default 576. */\n height?: number;\n /** Minutes a drag snaps to, and a keyboard step. Default 15. */\n snapMinutes?: number;\n /** Length of the slot a single click selects. Default 60. */\n newEventMinutes?: number;\n /** Rows of events in a month cell before \"+N more\". Default 3. */\n maxEventsPerDay?: number;\n onEventClick?: (event: CalendarEvent) => void;\n /** Empty time was clicked or dragged across. Without it, empty time is not interactive. */\n onSlotSelect?: (slot: CalendarSlot) => void;\n /** A move or resize, proposed. Nothing changes until you pass back new `events`. Without it the calendar is read-only. */\n onEventChange?: (change: CalendarEventChange) => void;\n /** Per-event gate for editing. A blocked event is not draggable at all, rather than refused on drop. */\n canEditEvent?: (event: CalendarEvent) => boolean;\n /** A task's checkbox was toggled. Without it the checkbox is shown but disabled. */\n onTaskToggle?: (event: CalendarEvent, done: boolean) => void;\n /** Replace an event's content (title, time, marks). The calendar keeps the box, the colour and the controls. */\n renderEvent?: (event: CalendarEvent, context: CalendarEventRenderContext) => Child;\n /** Extra classes on an event's box. */\n eventClassName?: (event: CalendarEvent) => string | undefined;\n /** Extra classes on a day: a month cell, a time-grid column and its header. Holidays, closures. */\n dayClassName?: (date: Date) => string | undefined;\n /** Extra classes on the row of day headers. */\n headerClassName?: string;\n /** Your own controls, at the end of the toolbar. */\n toolbarActions?: Child;\n /** Hide the toolbar when your page already has one (drive `view` and `date` yourself). */\n hideToolbar?: boolean;\n /** What the agenda says when nothing is on. */\n emptyMessage?: Child;\n}\n\nexport interface CalendarPreview {\n kind: \"move\" | \"resize\" | \"select\";\n /** Where the drag is happening, which decides how the preview is drawn. */\n surface: \"time\" | \"day\";\n /** The event being moved or resized. */\n eventId?: string;\n span: CalendarProposedSpan;\n}\n\n/**\n * What one render owns: the components it built and the listeners it added to\n * nodes it created. Both are released before the next render and on destroy,\n * because a full re-render with nothing released leaks a listener per event\n * per render.\n */\nexport interface RenderScope {\n keep<T extends AnyZenComponent>(component: T): T;\n on<K extends keyof HTMLElementEventMap>(\n node: HTMLElement,\n type: K,\n listener: (event: HTMLElementEventMap[K]) => void,\n ): void;\n /** Run when this render is released (an observer to disconnect, say). */\n onRelease(cleanup: () => void): void;\n}\n\n/**\n * View state that must outlive a render. The factory rebuilds its DOM when the\n * data changes; without this the slot cursor, the focused day and the grid's\n * scroll position would all reset every time the caller passed new events.\n */\nexport interface CalendarMemory {\n cursor?: SlotCursor;\n focusedDay?: Date;\n /** Set by keyboard paging only: focus `focusedDay` once the new page is built. */\n focusDayAfterRender?: boolean;\n scrollTop?: number;\n /** The view the scroll position belongs to; a new view scrolls to scrollToHour instead. */\n scrollView?: string;\n /** The day whose \"+N more\" panel is open, kept open across a re-render. */\n openMore?: string;\n}\n\n/** What the root hands every view for one render. */\nexport interface CalendarContext {\n memory: CalendarMemory;\n props: EventCalendarProps;\n loc: ReturnType<typeof useLocale>;\n scope: RenderScope;\n view: EventCalendarView;\n anchor: Date;\n now: Date;\n options: EventCalendarOptions;\n hourPx: number;\n rowPx: number;\n snap: number;\n root: HTMLElement;\n hintId: string;\n /** The preview in progress when this render started (a re-render during a drag). */\n preview: CalendarPreview | null;\n setPreview: (preview: CalendarPreview | null) => void;\n editable: (event: CalendarEvent) => boolean;\n selectable: boolean;\n canGoToDay: boolean;\n goToDay: (date: Date) => void;\n setDate: (date: Date) => void;\n openEvent: (event: CalendarEvent) => void;\n toggleTask: (event: CalendarEvent) => void;\n selectSlot: (slot: CalendarSlot) => void;\n propose: (event: CalendarEvent, span: CalendarProposedSpan, kind: \"move\" | \"resize\", fromKeyboard: boolean) => void;\n timeLabel: (span: { start: Date; end: Date; allDay?: boolean }) => string;\n announce: (text: string) => void;\n}\n\n/** A built view: its element, and how it shows a drag in progress without being rebuilt. */\nexport interface CalendarViewHandle {\n el: HTMLElement;\n /** Draw (or clear) the preview in place. A drag updates it every frame; rebuilding the view each frame would drop focus and thrash layout. */\n applyPreview(preview: CalendarPreview | null): void;\n /** Called once the view is in the document (scroll position, focus). */\n mounted?(): void;\n}\n\nexport const STATE_CLASS: Record<CalendarEventState, string> = {\n default: \"zen-bg-zen-primary-soft zen-text-zen-primary-soft-fg zen-border-zen-primary\",\n info: \"zen-bg-zen-info-soft zen-text-zen-info-soft-fg zen-border-zen-info\",\n success: \"zen-bg-zen-success-soft zen-text-zen-success-soft-fg zen-border-zen-success\",\n warning: \"zen-bg-zen-warning-soft zen-text-zen-warning-soft-fg zen-border-zen-warning\",\n error: \"zen-bg-zen-error-soft zen-text-zen-error-soft-fg zen-border-zen-error\",\n};\n\nexport const DOT_CLASS: Record<CalendarEventState, string> = {\n default: \"zen-bg-zen-primary\",\n info: \"zen-bg-zen-info\",\n success: \"zen-bg-zen-success\",\n warning: \"zen-bg-zen-warning\",\n error: \"zen-bg-zen-error\",\n};\n\n/** The class a drag adds to the event it is moving. */\nexport const MOVING_CLASS = \"zen-opacity-40\";\n/** The class a preview adds to a day it covers. */\nexport const LIT_CLASS = \"zen-bg-zen-primary-soft\";\n\nexport const isRtl = (node: Element | null | undefined): boolean => !!node && getComputedStyle(node).direction === \"rtl\";\n\nexport const sameDay = (a: Date, b: Date) =>\n a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();\n\nexport const el = <K extends keyof HTMLElementTagNameMap>(\n tag: K,\n className?: string,\n text?: string,\n): HTMLElementTagNameMap[K] => {\n const node = document.createElement(tag);\n if (className) node.className = className;\n if (text !== undefined) node.textContent = text;\n return node;\n};\n\n/**\n * A caller's colour as a tint with a solid edge, mixed against the theme's\n * background so it reads in dark mode; the text stays the theme's foreground.\n */\nexport function applyCustomColor(node: HTMLElement, color: string | undefined, variant: CalendarEventVariant): void {\n if (!color || variant === \"chip\" || variant === \"row\") return;\n node.style.backgroundColor = `color-mix(in srgb, ${color} 18%, var(--zen-color-background))`;\n node.style.borderColor = color;\n node.style.color = \"var(--zen-color-foreground)\";\n}\n\n/**\n * The cells a day-surface preview lights, by recomputing their class from the\n * base they were built with: adding the tint beside a weekend shade would leave\n * the two fighting on stylesheet order.\n */\nexport function relight(cells: Array<{ node: HTMLElement; base: string; day: Date }>, range: { start: Date; end: Date } | null): void {\n for (const cell of cells) {\n const lit = range !== null && cell.day >= range.start && cell.day < range.end;\n cell.node.className = cn(cell.base, lit && LIT_CLASS);\n }\n}\n\n/** Dim the event being dragged (every piece of it) and undim the rest. */\nexport function markMoving(root: HTMLElement, id: string | undefined): void {\n for (const node of root.querySelectorAll<HTMLElement>(\"[data-cal-event]\")) {\n node.classList.toggle(MOVING_CLASS, id !== undefined && node.getAttribute(\"data-cal-event\") === id);\n }\n}\n"],"names":["STATE_CLASS","DOT_CLASS","MOVING_CLASS","LIT_CLASS","isRtl","node","sameDay","a","b","el","tag","className","text","applyCustomColor","color","variant","relight","cells","range","cell","lit","cn","markMoving","root","id"],"mappings":";AAuNO,MAAMA,IAAkD;AAAA,EAC7D,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACT,GAEaC,IAAgD;AAAA,EAC3D,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACT,GAGaC,IAAe,kBAEfC,IAAY,2BAEZC,IAAQ,CAACC,MAA8C,CAAC,CAACA,KAAQ,iBAAiBA,CAAI,EAAE,cAAc,OAEtGC,IAAU,CAACC,GAASC,MAC/BD,EAAE,YAAA,MAAkBC,EAAE,YAAA,KAAiBD,EAAE,SAAA,MAAeC,EAAE,SAAA,KAAcD,EAAE,QAAA,MAAcC,EAAE,QAAA,GAE/EC,IAAK,CAChBC,GACAC,GACAC,MAC6B;AAC7B,QAAMP,IAAO,SAAS,cAAcK,CAAG;AACvC,SAAIC,QAAgB,YAAYA,IAC5BC,MAAS,WAAWP,EAAK,cAAcO,IACpCP;AACT;AAMO,SAASQ,EAAiBR,GAAmBS,GAA2BC,GAAqC;AAClH,EAAI,CAACD,KAASC,MAAY,UAAUA,MAAY,UAChDV,EAAK,MAAM,kBAAkB,sBAAsBS,CAAK,sCACxDT,EAAK,MAAM,cAAcS,GACzBT,EAAK,MAAM,QAAQ;AACrB;AAOO,SAASW,EAAQC,GAA8DC,GAAgD;AACpI,aAAWC,KAAQF,GAAO;AACxB,UAAMG,IAAMF,MAAU,QAAQC,EAAK,OAAOD,EAAM,SAASC,EAAK,MAAMD,EAAM;AAC1E,IAAAC,EAAK,KAAK,YAAYE,EAAGF,EAAK,MAAMC,KAAOjB,CAAS;AAAA,EACtD;AACF;AAGO,SAASmB,EAAWC,GAAmBC,GAA8B;AAC1E,aAAWnB,KAAQkB,EAAK,iBAA8B,kBAAkB;AACtE,IAAAlB,EAAK,UAAU,OAAOH,GAAcsB,MAAO,UAAanB,EAAK,aAAa,gBAAgB,MAAMmB,CAAE;AAEtG;"}
1
+ {"version":3,"file":"index235.js","sources":["../src/components/event-calendar/event-calendar-model.ts"],"sourcesContent":["import type {\n CalendarProposedSpan,\n EventCalendarOptions,\n SlotCursor,\n EventCalendarView,\n Weekday,\n} from \"@algorisys/zen-ui-core/event-calendar\";\nimport type { Density } from \"@algorisys/zen-ui-core/density\";\nimport { cn } from \"../../lib/cn\";\nimport type { AnyZenComponent, BaseProps, Child } from \"../../lib/component\";\nimport type { useLocale } from \"../locale/locale\";\n\nexport type CalendarEventState = \"default\" | \"info\" | \"success\" | \"warning\" | \"error\";\n\nexport interface CalendarEvent {\n id: string;\n title: string;\n start: Date;\n /** Exclusive. For an all-day event, the first day NOT included (or the same day for a one-day event). */\n end: Date;\n allDay?: boolean;\n /** Token colour. \"default\" is the primary tint. */\n state?: CalendarEventState;\n /** Any CSS colour; wins over `state`. For a per-calendar colour from your own map. */\n color?: string;\n location?: string;\n /** Minutes before the start. Shown as a mark; zen-ui does not fire reminders. */\n reminders?: number[];\n /** Shown as a mark. Expand the occurrences before passing them (see `expandRecurrence`). */\n recurring?: boolean;\n /** \"task\" draws a checkbox; `done` strikes it through. */\n kind?: \"event\" | \"task\";\n done?: boolean;\n /** Never offered for moving or resizing, whatever `canEditEvent` says. */\n readOnly?: boolean;\n /**\n * Render the event as a link to this URL, so middle-click and \"open in new\n * tab\" work. `onEventClick` still fires on a plain click; the browser then\n * follows the link.\n */\n href?: string;\n}\n\nexport interface CalendarSlot {\n start: Date;\n /** Exclusive. */\n end: Date;\n allDay: boolean;\n}\n\nexport interface CalendarEventChange {\n /** The event as you passed it. */\n event: CalendarEvent;\n start: Date;\n end: Date;\n allDay: boolean;\n kind: \"move\" | \"resize\";\n /**\n * How it was proposed: a drag (or a long press on touch), or Alt+arrow keys.\n * A keyboard move fires once per key press, so an app that confirms each\n * change may want to skip the dialog for \"keyboard\". Same as PlanningCalendar.\n */\n source: \"pointer\" | \"keyboard\";\n}\n\nexport type CalendarEventVariant = \"block\" | \"bar\" | \"chip\" | \"row\";\n\nexport interface CalendarEventRenderContext {\n view: EventCalendarView;\n /** \"block\" in a time grid, \"bar\" for multi-day and all-day, \"chip\" for a timed event in a month cell, \"row\" in lists. */\n variant: CalendarEventVariant;\n /** \"09:00 – 10:30\" or the localised \"All day\". */\n timeLabel: string;\n /** Too short for a second line. */\n compact: boolean;\n}\n\nexport interface EventCalendarProps extends BaseProps {\n events: CalendarEvent[];\n /** Starting view. The factory owns it after that; pass `view` (or call update) to control it. Default \"week\". */\n defaultView?: EventCalendarView;\n view?: EventCalendarView;\n onViewChange?: (view: EventCalendarView) => void;\n /** Which views the switcher offers, in order. Default month, week, day, agenda. */\n views?: EventCalendarView[];\n /** Any date inside the range to open on. Default today. */\n defaultDate?: Date;\n date?: Date;\n onDateChange?: (date: Date) => void;\n /** Reference \"now\" for today and the now line. Injectable for tests and demos. */\n now?: Date;\n /** First column of a week. Default 1 (Monday). */\n weekStartsOn?: Weekday;\n /** Shaded, and left out of the work-week view. Default [0, 6]. */\n nonWorkingDays?: number[];\n /** [from, to) hours drawn unshaded in the time grid. Default [9, 18]. */\n workingHours?: [number, number];\n /** Days shown by the agenda. Default 14. */\n agendaDays?: number;\n /** Hour scrolled to the top of the time grid when it opens. Default 8. */\n scrollToHour?: number;\n /** Pixels per hour in the time grid. Wins over `density`. */\n hourHeight?: number;\n /** \"compact\", \"comfortable\" (default) or \"touch\" (44px rows, 64px hours). */\n density?: Density;\n /** Height of the time grid's scrolling area in px. Default 576. */\n height?: number;\n /** Minutes a drag snaps to, and a keyboard step. Default 15. */\n snapMinutes?: number;\n /** Length of the slot a single click selects. Default 60. */\n newEventMinutes?: number;\n /** Rows of events in a month cell before \"+N more\". Default 3. */\n maxEventsPerDay?: number;\n onEventClick?: (event: CalendarEvent) => void;\n /** Empty time was clicked or dragged across. Without it, empty time is not interactive. */\n onSlotSelect?: (slot: CalendarSlot) => void;\n /** A move or resize, proposed. Nothing changes until you pass back new `events`. Without it the calendar is read-only. */\n onEventChange?: (change: CalendarEventChange) => void;\n /** Per-event gate for editing. A blocked event is not draggable at all, rather than refused on drop. */\n canEditEvent?: (event: CalendarEvent) => boolean;\n /** A task's checkbox was toggled. Without it the checkbox is shown but disabled. */\n onTaskToggle?: (event: CalendarEvent, done: boolean) => void;\n /** Replace an event's content (title, time, marks). The calendar keeps the box, the colour and the controls. */\n renderEvent?: (event: CalendarEvent, context: CalendarEventRenderContext) => Child;\n /** Extra classes on an event's box. */\n eventClassName?: (event: CalendarEvent) => string | undefined;\n /** Extra classes on a day: a month cell, a time-grid column and its header. Holidays, closures. */\n dayClassName?: (date: Date) => string | undefined;\n /** Extra classes on the row of day headers. */\n headerClassName?: string;\n /** Your own controls, at the end of the toolbar. */\n toolbarActions?: Child;\n /** Hide the toolbar when your page already has one (drive `view` and `date` yourself). */\n hideToolbar?: boolean;\n /** What the agenda says when nothing is on. */\n emptyMessage?: Child;\n}\n\nexport interface CalendarPreview {\n kind: \"move\" | \"resize\" | \"select\";\n /** Where the drag is happening, which decides how the preview is drawn. */\n surface: \"time\" | \"day\";\n /** The event being moved or resized. */\n eventId?: string;\n span: CalendarProposedSpan;\n}\n\n/**\n * What one render owns: the components it built and the listeners it added to\n * nodes it created. Both are released before the next render and on destroy,\n * because a full re-render with nothing released leaks a listener per event\n * per render.\n */\nexport interface RenderScope {\n keep<T extends AnyZenComponent>(component: T): T;\n on<K extends keyof HTMLElementEventMap>(\n node: HTMLElement,\n type: K,\n listener: (event: HTMLElementEventMap[K]) => void,\n ): void;\n /** Run when this render is released (an observer to disconnect, say). */\n onRelease(cleanup: () => void): void;\n}\n\n/**\n * View state that must outlive a render. The factory rebuilds its DOM when the\n * data changes; without this the slot cursor, the focused day and the grid's\n * scroll position would all reset every time the caller passed new events.\n */\nexport interface CalendarMemory {\n cursor?: SlotCursor;\n focusedDay?: Date;\n /** Set by keyboard paging only: focus `focusedDay` once the new page is built. */\n focusDayAfterRender?: boolean;\n scrollTop?: number;\n /** The view the scroll position belongs to; a new view scrolls to scrollToHour instead. */\n scrollView?: string;\n /** The day whose \"+N more\" panel is open, kept open across a re-render. */\n openMore?: string;\n}\n\n/** What the root hands every view for one render. */\nexport interface CalendarContext {\n memory: CalendarMemory;\n props: EventCalendarProps;\n loc: ReturnType<typeof useLocale>;\n scope: RenderScope;\n view: EventCalendarView;\n anchor: Date;\n now: Date;\n options: EventCalendarOptions;\n hourPx: number;\n rowPx: number;\n snap: number;\n root: HTMLElement;\n hintId: string;\n /** The preview in progress when this render started (a re-render during a drag). */\n preview: CalendarPreview | null;\n setPreview: (preview: CalendarPreview | null) => void;\n editable: (event: CalendarEvent) => boolean;\n selectable: boolean;\n canGoToDay: boolean;\n goToDay: (date: Date) => void;\n setDate: (date: Date) => void;\n openEvent: (event: CalendarEvent) => void;\n toggleTask: (event: CalendarEvent) => void;\n selectSlot: (slot: CalendarSlot) => void;\n propose: (event: CalendarEvent, span: CalendarProposedSpan, kind: \"move\" | \"resize\", fromKeyboard: boolean) => void;\n timeLabel: (span: { start: Date; end: Date; allDay?: boolean }) => string;\n announce: (text: string) => void;\n}\n\n/** A built view: its element, and how it shows a drag in progress without being rebuilt. */\nexport interface CalendarViewHandle {\n el: HTMLElement;\n /** Draw (or clear) the preview in place. A drag updates it every frame; rebuilding the view each frame would drop focus and thrash layout. */\n applyPreview(preview: CalendarPreview | null): void;\n /** Called once the view is in the document (scroll position, focus). */\n mounted?(): void;\n}\n\nexport const STATE_CLASS: Record<CalendarEventState, string> = {\n default: \"zen-bg-zen-primary-soft zen-text-zen-primary-soft-fg zen-border-zen-primary\",\n info: \"zen-bg-zen-info-soft zen-text-zen-info-soft-fg zen-border-zen-info\",\n success: \"zen-bg-zen-success-soft zen-text-zen-success-soft-fg zen-border-zen-success\",\n warning: \"zen-bg-zen-warning-soft zen-text-zen-warning-soft-fg zen-border-zen-warning\",\n error: \"zen-bg-zen-error-soft zen-text-zen-error-soft-fg zen-border-zen-error\",\n};\n\nexport const DOT_CLASS: Record<CalendarEventState, string> = {\n default: \"zen-bg-zen-primary\",\n info: \"zen-bg-zen-info\",\n success: \"zen-bg-zen-success\",\n warning: \"zen-bg-zen-warning\",\n error: \"zen-bg-zen-error\",\n};\n\n/** The class a drag adds to the event it is moving. */\nexport const MOVING_CLASS = \"zen-opacity-40\";\n/** The class a preview adds to a day it covers. */\nexport const LIT_CLASS = \"zen-bg-zen-primary-soft\";\n\nexport const isRtl = (node: Element | null | undefined): boolean => !!node && getComputedStyle(node).direction === \"rtl\";\n\nexport const sameDay = (a: Date, b: Date) =>\n a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();\n\nexport const el = <K extends keyof HTMLElementTagNameMap>(\n tag: K,\n className?: string,\n text?: string,\n): HTMLElementTagNameMap[K] => {\n const node = document.createElement(tag);\n if (className) node.className = className;\n if (text !== undefined) node.textContent = text;\n return node;\n};\n\n/**\n * A caller's colour as a tint with a solid edge, mixed against the theme's\n * background so it reads in dark mode; the text stays the theme's foreground.\n */\nexport function applyCustomColor(node: HTMLElement, color: string | undefined, variant: CalendarEventVariant): void {\n if (!color || variant === \"chip\" || variant === \"row\") return;\n node.style.backgroundColor = `color-mix(in srgb, ${color} 18%, var(--zen-color-background))`;\n node.style.borderColor = color;\n node.style.color = \"var(--zen-color-foreground)\";\n}\n\n/**\n * The cells a day-surface preview lights, by recomputing their class from the\n * base they were built with: adding the tint beside a weekend shade would leave\n * the two fighting on stylesheet order.\n */\nexport function relight(cells: Array<{ node: HTMLElement; base: string; day: Date }>, range: { start: Date; end: Date } | null): void {\n for (const cell of cells) {\n const lit = range !== null && cell.day >= range.start && cell.day < range.end;\n cell.node.className = cn(cell.base, lit && LIT_CLASS);\n }\n}\n\n/** Dim the event being dragged (every piece of it) and undim the rest. */\nexport function markMoving(root: HTMLElement, id: string | undefined): void {\n for (const node of root.querySelectorAll<HTMLElement>(\"[data-cal-event]\")) {\n node.classList.toggle(MOVING_CLASS, id !== undefined && node.getAttribute(\"data-cal-event\") === id);\n }\n}\n"],"names":["STATE_CLASS","DOT_CLASS","MOVING_CLASS","LIT_CLASS","isRtl","node","sameDay","a","b","el","tag","className","text","applyCustomColor","color","variant","relight","cells","range","cell","lit","cn","markMoving","root","id"],"mappings":";AA6NO,MAAMA,IAAkD;AAAA,EAC7D,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACT,GAEaC,IAAgD;AAAA,EAC3D,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACT,GAGaC,IAAe,kBAEfC,IAAY,2BAEZC,IAAQ,CAACC,MAA8C,CAAC,CAACA,KAAQ,iBAAiBA,CAAI,EAAE,cAAc,OAEtGC,IAAU,CAACC,GAASC,MAC/BD,EAAE,YAAA,MAAkBC,EAAE,YAAA,KAAiBD,EAAE,SAAA,MAAeC,EAAE,SAAA,KAAcD,EAAE,QAAA,MAAcC,EAAE,QAAA,GAE/EC,IAAK,CAChBC,GACAC,GACAC,MAC6B;AAC7B,QAAMP,IAAO,SAAS,cAAcK,CAAG;AACvC,SAAIC,QAAgB,YAAYA,IAC5BC,MAAS,WAAWP,EAAK,cAAcO,IACpCP;AACT;AAMO,SAASQ,EAAiBR,GAAmBS,GAA2BC,GAAqC;AAClH,EAAI,CAACD,KAASC,MAAY,UAAUA,MAAY,UAChDV,EAAK,MAAM,kBAAkB,sBAAsBS,CAAK,sCACxDT,EAAK,MAAM,cAAcS,GACzBT,EAAK,MAAM,QAAQ;AACrB;AAOO,SAASW,EAAQC,GAA8DC,GAAgD;AACpI,aAAWC,KAAQF,GAAO;AACxB,UAAMG,IAAMF,MAAU,QAAQC,EAAK,OAAOD,EAAM,SAASC,EAAK,MAAMD,EAAM;AAC1E,IAAAC,EAAK,KAAK,YAAYE,EAAGF,EAAK,MAAMC,KAAOjB,CAAS;AAAA,EACtD;AACF;AAGO,SAASmB,EAAWC,GAAmBC,GAA8B;AAC1E,aAAWnB,KAAQkB,EAAK,iBAA8B,kBAAkB;AACtE,IAAAlB,EAAK,UAAU,OAAOH,GAAcsB,MAAO,UAAanB,EAAK,aAAa,gBAAgB,MAAMmB,CAAE;AAEtG;"}
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@algorisys/zen-ui-vanilla",
3
- "version": "13.11.2",
3
+ "version": "13.12.0",
4
4
  "license": "PolyForm-Noncommercial-1.0.0",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -72,6 +72,7 @@ SKILL.md.
72
72
  - `end: Date`
73
73
  - `allDay: boolean`
74
74
  - `kind: "move" | "resize"`
75
+ - `source: "pointer" | "keyboard"` — How it was proposed: a drag (or a long press on touch), or Alt+arrow keys. A keyboard move fires once per key press, so an app that confirms each change may want to skip the dialog for "keyboard". Same as PlanningCalendar.
75
76
 
76
77
  ### CalendarEventRenderContext (type)
77
78