@algorisys/zen-ui-vanilla 13.11.1 → 13.11.2

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 (81) hide show
  1. package/dist/_core/calendar-follow.d.ts +39 -0
  2. package/dist/_core/index.d.ts +1 -0
  3. package/dist/components/event-calendar/event-calendar.d.ts.map +1 -1
  4. package/dist/components/planning-calendar/planning-calendar.d.ts.map +1 -1
  5. package/dist/index112.js +174 -165
  6. package/dist/index112.js.map +1 -1
  7. package/dist/index113.js +149 -143
  8. package/dist/index113.js.map +1 -1
  9. package/dist/index114.js +1 -1
  10. package/dist/index115.js +1 -1
  11. package/dist/index116.js +1 -1
  12. package/dist/index118.js +2 -2
  13. package/dist/index120.js +2 -2
  14. package/dist/index168.js +1 -1
  15. package/dist/index175.js +1 -1
  16. package/dist/index187.js +1 -1
  17. package/dist/index191.js +1 -1
  18. package/dist/index194.js +2 -2
  19. package/dist/index199.js +1 -1
  20. package/dist/index231.js +1 -1
  21. package/dist/index232.js +7 -7
  22. package/dist/index232.js.map +1 -1
  23. package/dist/index233.js +7 -48
  24. package/dist/index233.js.map +1 -1
  25. package/dist/index234.js +45 -37
  26. package/dist/index234.js.map +1 -1
  27. package/dist/index235.js +38 -149
  28. package/dist/index235.js.map +1 -1
  29. package/dist/index236.js +138 -177
  30. package/dist/index236.js.map +1 -1
  31. package/dist/index237.js +190 -90
  32. package/dist/index237.js.map +1 -1
  33. package/dist/index238.js +90 -444
  34. package/dist/index238.js.map +1 -1
  35. package/dist/index239.js +436 -98
  36. package/dist/index239.js.map +1 -1
  37. package/dist/index240.js +106 -2
  38. package/dist/index240.js.map +1 -1
  39. package/dist/index241.js +2 -18804
  40. package/dist/index241.js.map +1 -1
  41. package/dist/index242.js +18798 -117
  42. package/dist/index242.js.map +1 -1
  43. package/dist/index243.js +122 -13
  44. package/dist/index243.js.map +1 -1
  45. package/dist/index244.js +13 -3012
  46. package/dist/index244.js.map +1 -1
  47. package/dist/index245.js +3006 -123
  48. package/dist/index245.js.map +1 -1
  49. package/dist/index246.js +125 -140
  50. package/dist/index246.js.map +1 -1
  51. package/dist/index247.js +138 -93
  52. package/dist/index247.js.map +1 -1
  53. package/dist/index248.js +91 -104
  54. package/dist/index248.js.map +1 -1
  55. package/dist/index249.js +95 -111
  56. package/dist/index249.js.map +1 -1
  57. package/dist/index250.js +127 -4
  58. package/dist/index250.js.map +1 -1
  59. package/dist/index251.js +5 -34
  60. package/dist/index251.js.map +1 -1
  61. package/dist/index252.js +34 -9
  62. package/dist/index252.js.map +1 -1
  63. package/dist/index253.js +10 -7
  64. package/dist/index253.js.map +1 -1
  65. package/dist/index254.js +6 -15
  66. package/dist/index254.js.map +1 -1
  67. package/dist/index255.js +15 -11
  68. package/dist/index255.js.map +1 -1
  69. package/dist/index256.js +11 -3
  70. package/dist/index256.js.map +1 -1
  71. package/dist/index257.js +7 -0
  72. package/dist/index257.js.map +1 -0
  73. package/dist/previews/analytic-chart.jpg +0 -0
  74. package/dist/previews/chunk-uploader.jpg +0 -0
  75. package/dist/previews/code-editor.jpg +0 -0
  76. package/dist/previews/countdown.jpg +0 -0
  77. package/dist/previews/loading.jpg +0 -0
  78. package/dist/previews/map.jpg +0 -0
  79. package/dist/previews/skeleton.jpg +0 -0
  80. package/dist/previews/tile.jpg +0 -0
  81. package/package.json +1 -1
@@ -0,0 +1,39 @@
1
+ /**
2
+ * When a keyboard move should take the view with it — for PlanningCalendar and
3
+ * EventCalendar alike.
4
+ *
5
+ * Alt+arrow on an item at the edge of the view proposes a time outside it. The
6
+ * calendars used to move the view to the proposal AT ONCE. But they only
7
+ * propose: the caller may confirm, refuse, or ask first. A refused move left
8
+ * the user looking at a week the item never went to (measured in a CRM with a
9
+ * confirm dialog: Cancel, and the view was a week away from the project).
10
+ *
11
+ * So the view follows the item only once the caller has APPLIED the move,
12
+ * which is visible the only way the calendar can see it: the item's start in
13
+ * the next `rows` / `events` is no longer where it was when the move was
14
+ * proposed. It then follows to where the item ACTUALLY is, which may differ
15
+ * from the proposal if the caller adjusted it (a server snapping to a slot).
16
+ *
17
+ * Pure, so four renderers make the same call. Pinned by scripts/check-planning.ts.
18
+ */
19
+ /** A keyboard move proposed and not yet seen applied. */
20
+ export interface PendingFollow {
21
+ id: string;
22
+ /** The item's start, in ms, when the move was proposed. */
23
+ from: number;
24
+ }
25
+ export interface CalendarFollowRange {
26
+ start: Date;
27
+ /** Exclusive. */
28
+ end: Date;
29
+ }
30
+ export interface CalendarFollowDecision {
31
+ /** The move has been applied (or can no longer be): forget the pending follow. */
32
+ done: boolean;
33
+ /** Move the view here. Null: stay — not applied yet, or applied inside the view. */
34
+ date: Date | null;
35
+ }
36
+ export declare function calendarFollow(pending: PendingFollow, items: readonly {
37
+ id: string;
38
+ start: Date;
39
+ }[], range: CalendarFollowRange): CalendarFollowDecision;
@@ -13,6 +13,7 @@ export * from "./pivot";
13
13
  export * from "./virtual-window";
14
14
  export * from "./planning";
15
15
  export * from "./planning-gesture";
16
+ export * from "./calendar-follow";
16
17
  export * from "./event-calendar";
17
18
  export * from "./event-calendar-gesture";
18
19
  export * from "./recurrence-form";
@@ -1 +1 @@
1
- {"version":3,"file":"event-calendar.d.ts","sourceRoot":"","sources":["../../../src/components/event-calendar/event-calendar.ts"],"names":[],"mappings":"AAYA,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,CAmVzF"}
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 +1 @@
1
- {"version":3,"file":"planning-calendar.d.ts","sourceRoot":"","sources":["../../../src/components/planning-calendar/planning-calendar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAeL,KAAK,YAAY,EACjB,KAAK,OAAO,EACb,MAAM,wBAAwB,CAAC;AAIhC,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,KAAK,EACV,KAAK,YAAY,EAClB,MAAM,qBAAqB,CAAC;AAG7B;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,MAAM,wBAAwB,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAU5F,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,IAAI,CAAC;IACZ,GAAG,EAAE,IAAI,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,wBAAwB,CAAC;IACjC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,4EAA4E;AAC5E,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,mBAAmB,CAAC;IACjC,4BAA4B;IAC5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CAAC,EAAE,CAAC,WAAW,EAAE,mBAAmB,EAAE,GAAG,EAAE,WAAW,KAAK,MAAM,GAAG,SAAS,CAAC;IAC9F,mEAAmE;IACnE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,+DAA+D;IAC/D,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,uFAAuF;IACvF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AASD,6EAA6E;AAC7E,OAAO,EAAkB,KAAK,OAAO,EAAE,MAAM,gCAAgC,CAAC;AA0B9E,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,qBAAqB,GAC3B,YAAY,CAAC,qBAAqB,CAAC,CAgjBrC"}
package/dist/index112.js CHANGED
@@ -1,76 +1,81 @@
1
1
  import { cn as B } from "./index194.js";
2
2
  import "./index210.js";
3
3
  import "./index169.js";
4
- import { planningColumns as Le, planningAxis as Ee, planningRange as He, nowPct as Re, placeAppointment as ge, layoutLanes as Ie, formatTimeRange as ie, shiftPlanningAnchor as he, planningRangeLabel as $e, planningKeyboardMove as Me } from "./index230.js";
5
- import { startPlanningGesture as Ve } from "./index231.js";
4
+ import { planningColumns as He, planningAxis as Re, planningRange as Ie, nowPct as Me, placeAppointment as ye, layoutLanes as $e, formatTimeRange as se, shiftPlanningAnchor as xe, planningRangeLabel as Te, planningKeyboardMove as Ve } from "./index230.js";
5
+ import { startPlanningGesture as We } from "./index231.js";
6
+ import { calendarFollow as Oe } from "./index232.js";
6
7
  import "./index116.js";
7
8
  import "./index119.js";
8
- import { calendarLanePx as We } from "./index232.js";
9
+ import { calendarLanePx as Ke } from "./index233.js";
9
10
  import { Button as F } from "./index4.js";
10
- import { Icon as se } from "./index6.js";
11
- import { Disposer as Oe, toNodes as le, applyProps as Te } from "./index195.js";
12
- import { useLocale as Ke } from "./index31.js";
13
- const Ne = {
11
+ import { Icon as le } from "./index6.js";
12
+ import { Disposer as Ne, toNodes as de, applyProps as Be } from "./index195.js";
13
+ import { useLocale as Fe } from "./index31.js";
14
+ const Ge = {
14
15
  default: "zen-bg-zen-muted zen-text-zen-foreground zen-border-zen-border",
15
16
  info: "zen-bg-zen-info-soft zen-text-zen-info zen-border-zen-info",
16
17
  success: "zen-bg-zen-success-soft zen-text-zen-success zen-border-zen-success",
17
18
  warning: "zen-bg-zen-warning-soft zen-text-zen-warning zen-border-zen-warning",
18
19
  error: "zen-bg-zen-error-soft zen-text-zen-error zen-border-zen-error"
19
- }, Be = {
20
+ }, Ue = {
20
21
  day: "planningCalendar.views.day",
21
22
  week: "planningCalendar.views.week",
22
23
  month: "planningCalendar.views.month"
23
- }, Fe = ["day", "week", "month"], Ge = 3, t = (_, n, w) => {
24
- const p = document.createElement(_);
24
+ }, qe = ["day", "week", "month"], Xe = 3, t = (D, n, w) => {
25
+ const p = document.createElement(D);
25
26
  return n && (p.className = n), w !== void 0 && (p.textContent = w), p;
26
27
  };
27
- let Ue = 0;
28
- function _n(_) {
29
- let n = { ..._ };
30
- const w = () => Math.max(14, We(n.density, n.laneHeight)), p = Ke(), G = new Oe();
31
- let U, de = _.defaultView ?? "week", pe = _.defaultDate ?? /* @__PURE__ */ new Date();
32
- const ce = `zen-planning-calendar-${++Ue}`, g = t("div"), h = t("div", "zen-contents"), q = t("span", "zen-sr-only");
33
- q.id = ce;
34
- const D = t("div", "zen-sr-only");
35
- D.setAttribute("aria-live", "polite"), D.setAttribute("aria-atomic", "true"), g.append(h, q, D);
36
- let P = [];
37
- const y = (e) => (P.push(e), e);
28
+ let je = 0;
29
+ function Ln(D) {
30
+ let n = { ...D };
31
+ const w = () => Math.max(14, Ke(n.density, n.laneHeight)), p = Fe(), G = new Ne();
32
+ let U, pe = D.defaultView ?? "week", ce = D.defaultDate ?? /* @__PURE__ */ new Date();
33
+ const ze = `zen-planning-calendar-${++je}`, g = t("div"), h = t("div", "zen-contents"), q = t("span", "zen-sr-only");
34
+ q.id = ze;
35
+ const P = t("div", "zen-sr-only");
36
+ P.setAttribute("aria-live", "polite"), P.setAttribute("aria-atomic", "true"), g.append(h, q, P);
38
37
  let S = [];
39
- const X = (e, i, s) => {
40
- e.addEventListener(i, s), S.push(() => e.removeEventListener(i, s));
38
+ const y = (e) => (S.push(e), e);
39
+ let L = [];
40
+ const X = (e, r, s) => {
41
+ e.addEventListener(r, s), L.push(() => e.removeEventListener(r, s));
41
42
  };
42
- let x = { start: /* @__PURE__ */ new Date(), end: /* @__PURE__ */ new Date() }, j = /* @__PURE__ */ new Map(), L = null, E = null;
43
- const ye = () => n.view ?? de, xe = () => n.date ?? pe, H = () => n.weekStartsOn ?? 1, ze = () => Math.max(1, n.snapMinutes ?? 15), ve = (e) => {
44
- n.view === void 0 && (de = e), n.onViewChange?.(e), O();
45
- }, W = (e) => {
46
- n.date === void 0 && (pe = e), n.onDateChange?.(e), O();
47
- }, Ce = (e, i) => !!n.onAppointmentChange && !e.busy && (n.canEditAppointment?.(e, i) ?? !0), Ae = (e) => h.querySelector(`[data-plan-appointment="${CSS.escape(e)}"]`), ke = () => {
43
+ let C = { start: /* @__PURE__ */ new Date(), end: /* @__PURE__ */ new Date() }, j = /* @__PURE__ */ new Map(), E = null, H = null;
44
+ const ve = () => n.view ?? pe, Ce = () => n.date ?? ce, R = () => n.weekStartsOn ?? 1, ue = () => Math.max(1, n.snapMinutes ?? 15);
45
+ let A = null;
46
+ const Ae = (e) => {
47
+ A = null, n.view === void 0 && (pe = e), n.onViewChange?.(e), W();
48
+ }, fe = (e) => {
49
+ n.date === void 0 && (ce = e), n.onDateChange?.(e);
50
+ }, J = (e) => {
51
+ A = null, fe(e), W();
52
+ }, ke = (e, r) => !!n.onAppointmentChange && !e.busy && (n.canEditAppointment?.(e, r) ?? !0), _e = (e) => h.querySelector(`[data-plan-appointment="${CSS.escape(e)}"]`), De = () => {
48
53
  const e = g.ownerDocument.activeElement;
49
54
  return e && h.contains(e) ? e.getAttribute("data-plan-appointment") : null;
50
55
  };
51
- let A = null;
52
- const J = () => {
53
- L?.remove(), L = null, E?.classList.remove("zen-opacity-40"), E = null;
54
- }, _e = (e, i) => {
55
- if (L?.remove(), L = null, !i) {
56
- J();
56
+ let k = null;
57
+ const Q = () => {
58
+ E?.remove(), E = null, H?.classList.remove("zen-opacity-40"), H = null;
59
+ }, Pe = (e, r) => {
60
+ if (E?.remove(), E = null, !r) {
61
+ Q();
57
62
  return;
58
63
  }
59
- E !== e && (E?.classList.remove("zen-opacity-40"), E = e, e.classList.add("zen-opacity-40"));
60
- const s = j.get(i.rowId), z = ge(i, x);
64
+ H !== e && (H?.classList.remove("zen-opacity-40"), H = e, e.classList.add("zen-opacity-40"));
65
+ const s = j.get(r.rowId), z = ye(r, C);
61
66
  if (!s || !z) return;
62
67
  const l = t(
63
68
  "div",
64
69
  "zen-pointer-events-none zen-absolute zen-z-10 zen-flex zen-items-center zen-overflow-hidden zen-rounded-zen-sm zen-border-2 zen-border-dashed zen-border-zen-primary zen-bg-zen-primary-soft zen-px-1.5 zen-text-xs zen-font-medium zen-text-zen-foreground"
65
70
  );
66
- l.setAttribute("aria-hidden", "true"), l.setAttribute("data-plan-ghost", ""), l.style.setProperty("inset-inline-start", `${z.startPct}%`), l.style.width = `${z.widthPct}%`, l.style.top = "4px", l.style.height = `${w() - 6}px`, l.append(t("span", "zen-truncate", ie(i.start, i.end))), s.append(l), L = l;
67
- }, ue = (e, i, s, z) => {
68
- const l = (n.rows ?? []).find((T) => T.id === s.rowId) ?? i;
69
- z === "keyboard" && (A = { id: e.id, until: Date.now() + 2e3 }), n.onAppointmentChange?.({ appointment: e, row: i, toRow: l, start: s.start, end: s.end, source: z });
70
- const R = ie(s.start, s.end);
71
- D.textContent = "", D.textContent = l.id === i.id ? p.t("planningCalendar.proposed", { title: e.title, time: R }) : p.t("planningCalendar.proposedRow", { title: e.title, row: l.title, time: R }), z === "keyboard" && (s.start < x.start || s.start >= x.end) && W(s.start);
71
+ l.setAttribute("aria-hidden", "true"), l.setAttribute("data-plan-ghost", ""), l.style.setProperty("inset-inline-start", `${z.startPct}%`), l.style.width = `${z.widthPct}%`, l.style.top = "4px", l.style.height = `${w() - 6}px`, l.append(t("span", "zen-truncate", se(r.start, r.end))), s.append(l), E = l;
72
+ }, me = (e, r, s, z) => {
73
+ const l = (n.rows ?? []).find((O) => O.id === s.rowId) ?? r;
74
+ z === "keyboard" && (k = { id: e.id, until: Date.now() + 2e3 }), A = z === "keyboard" ? { id: e.id, from: e.start.getTime() } : null, n.onAppointmentChange?.({ appointment: e, row: r, toRow: l, start: s.start, end: s.end, source: z });
75
+ const I = se(s.start, s.end);
76
+ P.textContent = "", P.textContent = l.id === r.id ? p.t("planningCalendar.proposed", { title: e.title, time: I }) : p.t("planningCalendar.proposedRow", { title: e.title, row: l.title, time: I });
72
77
  };
73
- function De(e, i, s) {
78
+ function Se(e, r, s) {
74
79
  const z = t("div", "zen-flex zen-flex-wrap zen-items-center zen-gap-2"), l = y(
75
80
  F({
76
81
  variant: "outline",
@@ -78,112 +83,112 @@ function _n(_) {
78
83
  "aria-label": p.t("planningCalendar.previous"),
79
84
  // Logical, not physical: under RTL the axis runs the other way, so a
80
85
  // left-pointing chevron would send you forward.
81
- children: y(se({ name: "chevron-left", size: 14, class: "rtl:zen-rotate-180" })),
82
- onClick: () => W(he(e, i, -1, H()))
86
+ children: y(le({ name: "chevron-left", size: 14, class: "rtl:zen-rotate-180" })),
87
+ onClick: () => J(xe(e, r, -1, R()))
83
88
  })
84
- ), R = y(
85
- F({ variant: "outline", size: "sm", children: p.t("planningCalendar.today"), onClick: () => W(s) })
86
- ), T = y(
89
+ ), I = y(
90
+ F({ variant: "outline", size: "sm", children: p.t("planningCalendar.today"), onClick: () => J(s) })
91
+ ), O = y(
87
92
  F({
88
93
  variant: "outline",
89
94
  size: "sm",
90
95
  "aria-label": p.t("planningCalendar.next"),
91
- children: y(se({ name: "chevron-right", size: 14, class: "rtl:zen-rotate-180" })),
92
- onClick: () => W(he(e, i, 1, H()))
96
+ children: y(le({ name: "chevron-right", size: 14, class: "rtl:zen-rotate-180" })),
97
+ onClick: () => J(xe(e, r, 1, R()))
93
98
  })
94
- ), fe = t(
99
+ ), be = t(
95
100
  "span",
96
101
  "zen-mx-1 zen-text-sm zen-font-medium zen-text-zen-foreground",
97
- $e(e, i, H())
98
- ), I = t("div", "zen-ms-auto zen-flex zen-gap-1");
99
- I.setAttribute("role", "group"), I.setAttribute("aria-label", p.t("planningCalendar.view"));
100
- for (const b of n.views ?? Fe)
101
- I.append(
102
+ Te(e, r, R())
103
+ ), M = t("div", "zen-ms-auto zen-flex zen-gap-1");
104
+ M.setAttribute("role", "group"), M.setAttribute("aria-label", p.t("planningCalendar.view"));
105
+ for (const b of n.views ?? qe)
106
+ M.append(
102
107
  y(
103
108
  F({
104
109
  variant: e === b ? "solid" : "outline",
105
110
  size: "sm",
106
111
  "aria-pressed": String(e === b),
107
- children: p.t(Be[b]),
108
- onClick: () => ve(b)
112
+ children: p.t(Ue[b]),
113
+ onClick: () => Ae(b)
109
114
  })
110
115
  ).el
111
116
  );
112
- if (z.append(l.el, R.el, T.el, fe, I), n.toolbarActions != null) {
117
+ if (z.append(l.el, I.el, O.el, be, M), n.toolbarActions != null) {
113
118
  const b = t("div", "zen-flex zen-flex-wrap zen-items-center zen-gap-2");
114
- b.append(...le(n.toolbarActions)), z.append(b);
119
+ b.append(...de(n.toolbarActions)), z.append(b);
115
120
  }
116
121
  return z;
117
122
  }
118
- function O() {
119
- const e = ke();
120
- J();
121
- for (const d of P) d.destroy();
122
- P = [];
123
- for (const d of S) d();
124
- S = [], h.replaceChildren(), j = /* @__PURE__ */ new Map();
123
+ function W() {
124
+ const e = De();
125
+ Q();
126
+ for (const d of S) d.destroy();
127
+ S = [];
128
+ for (const d of L) d();
129
+ L = [], h.replaceChildren(), j = /* @__PURE__ */ new Map();
125
130
  const {
126
- rows: i,
131
+ rows: r,
127
132
  emptyMessage: s,
128
133
  class: z,
129
134
  children: l,
130
- defaultView: R,
131
- defaultDate: T,
132
- view: fe,
133
- date: I,
135
+ defaultView: I,
136
+ defaultDate: O,
137
+ view: be,
138
+ date: M,
134
139
  views: b,
135
- now: qe,
136
- hideToolbar: Xe,
137
- onViewChange: je,
138
- onDateChange: Je,
139
- onAppointmentClick: Qe,
140
- toolbarActions: Ye,
141
- onAppointmentChange: Ze,
142
- canEditAppointment: en,
143
- allowRowChange: nn,
144
- snapMinutes: tn,
145
- renderAppointment: on,
146
- appointmentClass: rn,
147
- weekStartsOn: an,
148
- dayStartHour: sn,
149
- dayEndHour: ln,
150
- hourStep: dn,
151
- workingHours: pn,
152
- nonWorkingDays: cn,
153
- laneHeight: zn,
154
- density: un,
155
- ...Pe
140
+ now: Je,
141
+ hideToolbar: Qe,
142
+ onViewChange: Ye,
143
+ onDateChange: Ze,
144
+ onAppointmentClick: en,
145
+ toolbarActions: nn,
146
+ onAppointmentChange: tn,
147
+ canEditAppointment: on,
148
+ allowRowChange: rn,
149
+ snapMinutes: an,
150
+ renderAppointment: sn,
151
+ appointmentClass: ln,
152
+ weekStartsOn: dn,
153
+ dayStartHour: pn,
154
+ dayEndHour: cn,
155
+ hourStep: zn,
156
+ workingHours: un,
157
+ nonWorkingDays: fn,
158
+ laneHeight: mn,
159
+ density: bn,
160
+ ...Le
156
161
  } = n;
157
162
  g.className = B("zen-flex zen-w-full zen-flex-col zen-gap-3", z), q.textContent = p.t(n.allowRowChange ? "planningCalendar.editHintRows" : "planningCalendar.editHint");
158
- const $ = ye(), Q = xe(), Y = n.now ?? /* @__PURE__ */ new Date(), Z = Le($, Q, {
159
- now: Y,
160
- weekStartsOn: H(),
163
+ const $ = ve(), Y = Ce(), Z = n.now ?? /* @__PURE__ */ new Date(), ee = He($, Y, {
164
+ now: Z,
165
+ weekStartsOn: R(),
161
166
  dayStartHour: n.dayStartHour,
162
167
  dayEndHour: n.dayEndHour,
163
168
  hourStep: n.hourStep,
164
169
  workingHours: n.workingHours,
165
170
  nonWorkingDays: n.nonWorkingDays
166
171
  });
167
- x = Ee(Z, He($, Q, H()));
168
- const me = Re(x, Y), ee = (i ?? []).map((d) => {
169
- const k = d.appointments.map((r) => ({ appointment: r, placement: ge(r, x) })).filter(
170
- (r) => r.placement !== null
171
- ), { lanes: M, laneCount: K } = Ie(k.map((r) => r.appointment));
172
+ C = Re(ee, Ie($, Y, R()));
173
+ const we = Me(C, Z), ne = (r ?? []).map((d) => {
174
+ const _ = d.appointments.map((a) => ({ appointment: a, placement: ye(a, C) })).filter(
175
+ (a) => a.placement !== null
176
+ ), { lanes: T, laneCount: K } = $e(_.map((a) => a.appointment));
172
177
  return {
173
178
  row: d,
174
- blocks: k.map((r, f) => ({ ...r, lane: M[f] })),
179
+ blocks: _.map((a, f) => ({ ...a, lane: T[f] })),
175
180
  laneCount: Math.max(K, 1)
176
181
  };
177
182
  });
178
- if (!n.hideToolbar && (ee.length > 0 || n.toolbarActions != null) && h.append(De($, Q, Y)), ee.length === 0) {
183
+ if (!n.hideToolbar && (ne.length > 0 || n.toolbarActions != null) && h.append(Se($, Y, Z)), ne.length === 0) {
179
184
  const d = t("p", "zen-m-0 zen-py-6 zen-text-center zen-text-sm zen-text-zen-muted-fg");
180
- d.append(...le(s ?? p.t("planningCalendar.noResources"))), h.append(d);
185
+ d.append(...de(s ?? p.t("planningCalendar.noResources"))), h.append(d);
181
186
  } else {
182
187
  const d = t(
183
188
  "div",
184
189
  "zen-overflow-x-auto zen-rounded-zen-md zen-border zen-border-zen-border"
185
- ), k = t("div", "zen-min-w-[45rem]"), M = t("div", "zen-flex zen-border-b zen-border-zen-border zen-bg-zen-muted");
186
- M.append(
190
+ ), _ = t("div", "zen-min-w-[45rem]"), T = t("div", "zen-flex zen-border-b zen-border-zen-border zen-bg-zen-muted");
191
+ T.append(
187
192
  t(
188
193
  "div",
189
194
  "zen-w-40 zen-shrink-0 zen-border-e zen-border-zen-border zen-px-3 zen-py-2 zen-text-xs zen-font-semibold zen-text-zen-muted-fg",
@@ -191,32 +196,32 @@ function _n(_) {
191
196
  )
192
197
  );
193
198
  const K = t("div", "zen-flex zen-flex-1");
194
- for (const r of Z) {
199
+ for (const a of ee) {
195
200
  const f = t(
196
201
  "div",
197
202
  B(
198
203
  "zen-flex-1 zen-border-e zen-border-zen-border zen-px-1 zen-py-2 zen-text-center last:zen-border-e-0",
199
- r.nonWorking && "zen-bg-zen-muted",
200
- r.today && "zen-bg-zen-primary-soft"
204
+ a.nonWorking && "zen-bg-zen-muted",
205
+ a.today && "zen-bg-zen-primary-soft"
201
206
  )
202
207
  );
203
- f.append(t("div", "zen-text-xs zen-font-medium zen-text-zen-foreground", r.label)), r.sublabel && f.append(t("div", "zen-[font-size:var(--zen-schedule-label-font-size)] zen-text-zen-muted-fg", r.sublabel)), K.append(f);
208
+ f.append(t("div", "zen-text-xs zen-font-medium zen-text-zen-foreground", a.label)), a.sublabel && f.append(t("div", "zen-[font-size:var(--zen-schedule-label-font-size)] zen-text-zen-muted-fg", a.sublabel)), K.append(f);
204
209
  }
205
- M.append(K), k.append(M);
206
- for (const r of ee) {
207
- const f = t("div", "zen-flex zen-border-b zen-border-zen-border last:zen-border-b-0"), te = t(
210
+ T.append(K), _.append(T);
211
+ for (const a of ne) {
212
+ const f = t("div", "zen-flex zen-border-b zen-border-zen-border last:zen-border-b-0"), oe = t(
208
213
  "div",
209
214
  "zen-w-40 zen-shrink-0 zen-border-e zen-border-zen-border zen-px-3 zen-py-2"
210
215
  );
211
- te.append(
212
- t("div", "zen-truncate zen-text-sm zen-font-medium zen-text-zen-foreground", r.row.title)
213
- ), r.row.subtitle && te.append(t("div", "zen-truncate zen-text-xs zen-text-zen-muted-fg", r.row.subtitle)), f.append(te);
214
- const v = t("div", "zen-relative zen-flex-1");
215
- v.setAttribute("data-plan-lane", r.row.id), v.style.minHeight = `${r.laneCount * w() + 8}px`, j.set(r.row.id, v);
216
- const oe = t("div", "zen-absolute zen-inset-0 zen-flex");
217
- oe.setAttribute("aria-hidden", "true");
218
- for (const c of Z)
219
- oe.append(
216
+ oe.append(
217
+ t("div", "zen-truncate zen-text-sm zen-font-medium zen-text-zen-foreground", a.row.title)
218
+ ), a.row.subtitle && oe.append(t("div", "zen-truncate zen-text-xs zen-text-zen-muted-fg", a.row.subtitle)), f.append(oe);
219
+ const x = t("div", "zen-relative zen-flex-1");
220
+ x.setAttribute("data-plan-lane", a.row.id), x.style.minHeight = `${a.laneCount * w() + 8}px`, j.set(a.row.id, x);
221
+ const re = t("div", "zen-absolute zen-inset-0 zen-flex");
222
+ re.setAttribute("aria-hidden", "true");
223
+ for (const c of ee)
224
+ re.append(
220
225
  t(
221
226
  "div",
222
227
  B(
@@ -226,83 +231,87 @@ function _n(_) {
226
231
  )
227
232
  )
228
233
  );
229
- if (v.append(oe), me !== null) {
234
+ if (x.append(re), we !== null) {
230
235
  const c = t("div", "zen-absolute zen-top-0 zen-bottom-0 zen-w-px zen-bg-zen-error");
231
- c.setAttribute("aria-hidden", "true"), c.style.setProperty("inset-inline-start", `${me}%`), v.append(c);
236
+ c.setAttribute("aria-hidden", "true"), c.style.setProperty("inset-inline-start", `${we}%`), x.append(c);
232
237
  }
233
- for (const c of r.blocks) {
234
- const { appointment: a } = c, m = r.row, re = Ce(a, m), be = c.placement.widthPct < Ge, o = document.createElement("button");
235
- o.type = "button", o.setAttribute("data-plan-appointment", a.id), o.className = B(
238
+ for (const c of a.blocks) {
239
+ const { appointment: i } = c, m = a.row, ae = ke(i, m), ge = c.placement.widthPct < Xe, o = document.createElement("button");
240
+ o.type = "button", o.setAttribute("data-plan-appointment", i.id), o.className = B(
236
241
  "zen-absolute zen-flex zen-items-center zen-gap-1 zen-overflow-hidden zen-rounded-zen-sm zen-border zen-px-1.5 zen-text-start zen-text-xs",
237
242
  "focus-visible:zen-outline-none focus-visible:zen-ring-2 focus-visible:zen-ring-zen-ring",
238
- Ne[a.state ?? "default"],
243
+ Ge[i.state ?? "default"],
239
244
  // Square off the cut edge so a block continuing past the view does
240
245
  // not look like it ends there.
241
246
  c.placement.clippedStart && "zen-rounded-s-none zen-border-s-0",
242
247
  c.placement.clippedEnd && "zen-rounded-e-none zen-border-e-0",
243
248
  n.onAppointmentClick && "hover:zen-brightness-95",
244
- re && "zen-cursor-grab",
245
- a.busy && "zen-cursor-wait zen-opacity-60",
246
- n.appointmentClass?.(a, m)
247
- ), o.style.setProperty("inset-inline-start", `${c.placement.startPct}%`), o.style.width = `${c.placement.widthPct}%`, o.style.top = `${c.lane * w() + 4}px`, o.style.height = `${w() - 6}px`, re && (o.style.userSelect = "none", o.style.setProperty("-webkit-touch-callout", "none"), o.setAttribute("aria-describedby", ce), o.setAttribute(
249
+ ae && "zen-cursor-grab",
250
+ i.busy && "zen-cursor-wait zen-opacity-60",
251
+ n.appointmentClass?.(i, m)
252
+ ), o.style.setProperty("inset-inline-start", `${c.placement.startPct}%`), o.style.width = `${c.placement.widthPct}%`, o.style.top = `${c.lane * w() + 4}px`, o.style.height = `${w() - 6}px`, ae && (o.style.userSelect = "none", o.style.setProperty("-webkit-touch-callout", "none"), o.setAttribute("aria-describedby", ze), o.setAttribute(
248
253
  "aria-keyshortcuts",
249
254
  n.allowRowChange ? "Alt+ArrowLeft Alt+ArrowRight Alt+ArrowUp Alt+ArrowDown" : "Alt+ArrowLeft Alt+ArrowRight"
250
- )), a.busy && o.setAttribute("aria-busy", "true");
251
- const ae = ie(a.start, a.end);
252
- o.title = `${a.title} · ${ae}`, o.append(t("span", "zen-sr-only", ae)), a.busy && o.append(t("span", "zen-sr-only", p.t("planningCalendar.busy"))), n.renderAppointment ? o.append(...le(n.renderAppointment(a, { row: m, compact: be, timeLabel: ae }))) : be || (a.icon && o.append(y(se({ name: a.icon, size: 12, class: "zen-shrink-0" })).el), o.append(t("span", "zen-truncate zen-font-medium", a.title)), a.subtitle && o.append(t("span", "zen-truncate zen-opacity-70", a.subtitle)));
253
- const we = n.onAppointmentClick;
254
- we && X(o, "click", () => we(a, m)), re && (X(o, "pointerdown", (u) => {
255
- Ve({
255
+ )), i.busy && o.setAttribute("aria-busy", "true");
256
+ const ie = se(i.start, i.end);
257
+ o.title = `${i.title} · ${ie}`, o.append(t("span", "zen-sr-only", ie)), i.busy && o.append(t("span", "zen-sr-only", p.t("planningCalendar.busy"))), n.renderAppointment ? o.append(...de(n.renderAppointment(i, { row: m, compact: ge, timeLabel: ie }))) : ge || (i.icon && o.append(y(le({ name: i.icon, size: 12, class: "zen-shrink-0" })).el), o.append(t("span", "zen-truncate zen-font-medium", i.title)), i.subtitle && o.append(t("span", "zen-truncate zen-opacity-70", i.subtitle)));
258
+ const he = n.onAppointmentClick;
259
+ he && X(o, "click", () => he(i, m)), ae && (X(o, "pointerdown", (u) => {
260
+ We({
256
261
  event: u,
257
262
  target: o,
258
263
  root: g,
259
- axis: x,
264
+ axis: C,
260
265
  view: $,
261
- snapMinutes: ze(),
262
- appointment: a,
266
+ snapMinutes: ue(),
267
+ appointment: i,
263
268
  rowId: m.id,
264
269
  allowRowChange: !!n.allowRowChange,
265
270
  scroller: d,
266
- onPreview: (C) => _e(o, C),
267
- onCommit: (C) => ue(a, m, C, "pointer")
271
+ onPreview: (v) => Pe(o, v),
272
+ onCommit: (v) => me(i, m, v, "pointer")
268
273
  });
269
274
  }), X(o, "keydown", (u) => {
270
275
  if (!u.altKey || u.ctrlKey || u.metaKey) return;
271
- let C = null;
276
+ let v = null;
272
277
  if (u.key === "ArrowUp" || u.key === "ArrowDown") {
273
278
  if (!n.allowRowChange) return;
274
- const N = n.rows ?? [], V = N[N.findIndex((Se) => Se.id === m.id) + (u.key === "ArrowDown" ? 1 : -1)];
279
+ const N = n.rows ?? [], V = N[N.findIndex((Ee) => Ee.id === m.id) + (u.key === "ArrowDown" ? 1 : -1)];
275
280
  if (!V) return;
276
- C = { start: a.start, end: a.end, rowId: V.id };
281
+ v = { start: i.start, end: i.end, rowId: V.id };
277
282
  } else {
278
- const N = getComputedStyle(o).direction === "rtl", V = Me(a, u.key, { view: $, rtl: N, snapMinutes: ze() });
283
+ const N = getComputedStyle(o).direction === "rtl", V = Ve(i, u.key, { view: $, rtl: N, snapMinutes: ue() });
279
284
  if (!V) return;
280
- C = { ...V, rowId: m.id };
285
+ v = { ...V, rowId: m.id };
281
286
  }
282
- u.preventDefault(), u.stopPropagation(), ue(a, m, C, "keyboard");
283
- })), v.append(o);
287
+ u.preventDefault(), u.stopPropagation(), me(i, m, v, "keyboard");
288
+ })), x.append(o);
284
289
  }
285
- f.append(v), k.append(f);
290
+ f.append(x), _.append(f);
286
291
  }
287
- d.append(k), h.append(d);
292
+ d.append(_), h.append(d);
288
293
  }
289
- U?.(), U = Te(g, Pe);
290
- const ne = A && A.until > Date.now() ? A.id : e;
291
- if (ne) {
292
- const d = Ae(ne);
293
- d && (d.focus(), A?.id === ne && (A = null));
294
+ U?.(), U = Be(g, Le);
295
+ const te = k && k.until > Date.now() ? k.id : e;
296
+ if (te) {
297
+ const d = _e(te);
298
+ d && (d.focus(), k?.id === te && (k = null));
294
299
  }
295
300
  }
296
- return O(), G.add(() => U?.()), G.add(() => {
297
- J();
298
- for (const e of P) e.destroy();
299
- P = [];
300
- for (const e of S) e();
301
+ return W(), G.add(() => U?.()), G.add(() => {
302
+ Q();
303
+ for (const e of S) e.destroy();
301
304
  S = [];
305
+ for (const e of L) e();
306
+ L = [];
302
307
  }), {
303
308
  el: g,
304
309
  update(e) {
305
- n = { ...n, ...e }, O();
310
+ if (n = { ...n, ...e }, A && e.rows) {
311
+ const r = Oe(A, e.rows.flatMap((s) => s.appointments), C);
312
+ r.done && (A = null, r.date && fe(r.date));
313
+ }
314
+ W();
306
315
  },
307
316
  destroy() {
308
317
  G.dispose(), g.remove();
@@ -310,6 +319,6 @@ function _n(_) {
310
319
  };
311
320
  }
312
321
  export {
313
- _n as PlanningCalendar
322
+ Ln as PlanningCalendar
314
323
  };
315
324
  //# sourceMappingURL=index112.js.map