@algorisys/zen-ui-vanilla 13.10.1 → 13.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/AGENTS.md +2 -2
  2. package/dist/_core/index.d.ts +1 -0
  3. package/dist/_core/messages-all.d.ts +5 -0
  4. package/dist/_core/messages.d.ts +5 -0
  5. package/dist/_core/planning-gesture.d.ts +31 -0
  6. package/dist/_core/planning.d.ts +71 -9
  7. package/dist/components/data-table/data-table.d.ts.map +1 -1
  8. package/dist/components/event-calendar/event-calendar-item.d.ts.map +1 -1
  9. package/dist/components/event-calendar/event-calendar-model.d.ts +6 -0
  10. package/dist/components/event-calendar/event-calendar-model.d.ts.map +1 -1
  11. package/dist/components/planning-calendar/planning-calendar.d.ts +65 -3
  12. package/dist/components/planning-calendar/planning-calendar.d.ts.map +1 -1
  13. package/dist/components/rich-text/rich-text.d.ts +5 -7
  14. package/dist/components/rich-text/rich-text.d.ts.map +1 -1
  15. package/dist/index.d.ts +1 -1
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index108.js +12 -4
  18. package/dist/index108.js.map +1 -1
  19. package/dist/index112.js +244 -144
  20. package/dist/index112.js.map +1 -1
  21. package/dist/index113.js +6 -6
  22. package/dist/index114.js +1 -1
  23. package/dist/index115.js +1 -1
  24. package/dist/index116.js +1 -1
  25. package/dist/index118.js +2 -2
  26. package/dist/index120.js +2 -2
  27. package/dist/index168.js +1 -1
  28. package/dist/index175.js +1 -1
  29. package/dist/index187.js +1 -1
  30. package/dist/index191.js +1 -1
  31. package/dist/index194.js +2 -2
  32. package/dist/index199.js +1 -1
  33. package/dist/index211.js +5 -0
  34. package/dist/index211.js.map +1 -1
  35. package/dist/index230.js +107 -75
  36. package/dist/index230.js.map +1 -1
  37. package/dist/index231.js +95 -7
  38. package/dist/index231.js.map +1 -1
  39. package/dist/index232.js +7 -48
  40. package/dist/index232.js.map +1 -1
  41. package/dist/index233.js +45 -37
  42. package/dist/index233.js.map +1 -1
  43. package/dist/index234.js +38 -149
  44. package/dist/index234.js.map +1 -1
  45. package/dist/index235.js +138 -177
  46. package/dist/index235.js.map +1 -1
  47. package/dist/index236.js +190 -90
  48. package/dist/index236.js.map +1 -1
  49. package/dist/index237.js +90 -444
  50. package/dist/index237.js.map +1 -1
  51. package/dist/index238.js +436 -98
  52. package/dist/index238.js.map +1 -1
  53. package/dist/index239.js +106 -2
  54. package/dist/index239.js.map +1 -1
  55. package/dist/index240.js +2 -18804
  56. package/dist/index240.js.map +1 -1
  57. package/dist/index241.js +18798 -117
  58. package/dist/index241.js.map +1 -1
  59. package/dist/index242.js +122 -13
  60. package/dist/index242.js.map +1 -1
  61. package/dist/index243.js +13 -3012
  62. package/dist/index243.js.map +1 -1
  63. package/dist/index244.js +3006 -123
  64. package/dist/index244.js.map +1 -1
  65. package/dist/index245.js +125 -140
  66. package/dist/index245.js.map +1 -1
  67. package/dist/index246.js +138 -93
  68. package/dist/index246.js.map +1 -1
  69. package/dist/index247.js +91 -104
  70. package/dist/index247.js.map +1 -1
  71. package/dist/index248.js +95 -111
  72. package/dist/index248.js.map +1 -1
  73. package/dist/index249.js +127 -4
  74. package/dist/index249.js.map +1 -1
  75. package/dist/index250.js +5 -34
  76. package/dist/index250.js.map +1 -1
  77. package/dist/index251.js +34 -9
  78. package/dist/index251.js.map +1 -1
  79. package/dist/index252.js +10 -7
  80. package/dist/index252.js.map +1 -1
  81. package/dist/index253.js +6 -15
  82. package/dist/index253.js.map +1 -1
  83. package/dist/index254.js +15 -11
  84. package/dist/index254.js.map +1 -1
  85. package/dist/index255.js +11 -3
  86. package/dist/index255.js.map +1 -1
  87. package/dist/index256.js +7 -0
  88. package/dist/index256.js.map +1 -0
  89. package/dist/index99.js.map +1 -1
  90. package/dist/previews/analytic-chart.jpg +0 -0
  91. package/dist/previews/chunk-uploader.jpg +0 -0
  92. package/dist/previews/code-editor.jpg +0 -0
  93. package/dist/previews/countdown.jpg +0 -0
  94. package/dist/previews/loading.jpg +0 -0
  95. package/dist/previews/map.jpg +0 -0
  96. package/dist/previews/tile.jpg +0 -0
  97. package/dist/style.css +1 -1
  98. package/package.json +1 -1
  99. package/skills/zen-ui/SKILL.md +1 -1
  100. package/skills/zen-ui/references/api/event-calendar-event-calendar.md +1 -0
  101. package/skills/zen-ui/references/api/index.md +1 -1
  102. package/skills/zen-ui/references/api/locale.md +5 -0
  103. package/skills/zen-ui/references/api/planning-calendar.md +30 -1
  104. package/skills/zen-ui/references/api/rich-text.md +1 -1
  105. package/skills/zen-ui/references/api/scan-input.md +1 -1
  106. package/skills/zen-ui/references/catalogue.md +2 -2
package/dist/index238.js CHANGED
@@ -1,109 +1,447 @@
1
- const W = 200, x = 50;
2
- function c(t, n) {
3
- return n <= 0 || t <= 0 ? 0 : Math.floor(t / n) * n;
1
+ import { cn as W } from "./index194.js";
2
+ import "./index210.js";
3
+ import "./index169.js";
4
+ import { nowPct as Ee } from "./index230.js";
5
+ import "./index116.js";
6
+ import { ganttFitUnit as Ie, ganttFitHourStep as Re, ganttContinuousRange as _e, ganttRange as Se, ganttRangeColumns as ge, ganttViewUnit as me, ganttColumns as Ge, ganttPaneColumns as Ne, ganttColumnWidths as Pe, shiftGanttAnchor as ze, ganttHeaderGroups as Fe, ganttSpanLabel as He, ganttRangeLabel as Xe, ganttRowWindow as Be, ganttColumnWindow as De } from "./index119.js";
7
+ import { Button as Z } from "./index4.js";
8
+ import { Icon as be } from "./index6.js";
9
+ import { useLocale as Oe } from "./index31.js";
10
+ const Ue = 36, qe = 44, le = 22, lt = 14, we = {
11
+ day: 56,
12
+ week: 128,
13
+ month: 44,
14
+ quarter: 72,
15
+ year: 80
16
+ }, Ve = {
17
+ hour: 40,
18
+ day: 20,
19
+ week: 26,
20
+ month: 30
21
+ }, ve = { min: 64, max: 180 }, Ke = {
22
+ day: 34,
23
+ week: 44,
24
+ month: 20,
25
+ quarter: 38,
26
+ year: 30
27
+ }, ye = 280, ee = 5, je = 512, Ae = "focus-visible:zen-outline-none focus-visible:zen-ring-2 focus-visible:zen-ring-inset focus-visible:zen-ring-zen-ring", Ye = {
28
+ fit: "scheduleGrid.views.fit",
29
+ day: "scheduleGrid.views.day",
30
+ week: "scheduleGrid.views.week",
31
+ month: "scheduleGrid.views.month",
32
+ quarter: "scheduleGrid.views.quarter",
33
+ year: "scheduleGrid.views.year"
34
+ }, Je = ["fit", "day", "week", "month", "quarter", "year"];
35
+ function dt(a) {
36
+ const e = a.view === "fit", x = e ? "month" : a.view, b = a.fitRange ? Ie(a.fitRange.end.getTime() - a.fitRange.start.getTime()) : null, _ = b === "hour" && a.hourStep === void 0 && a.fitRange ? Re(a.fitRange.end.getTime() - a.fitRange.start.getTime()) : a.hourStep, S = !!a.continuous && !e, k = S ? _e(x, a.plan ?? null, a.anchor) : null, o = a.fitRange ?? k?.range ?? Se(x, a.anchor), w = a.monthUnit === "week" && !e && !S && x === "month", E = {
37
+ now: a.now,
38
+ calendar: a.calendar,
39
+ hourStep: _,
40
+ grouped: a.grouped,
41
+ monthUnit: w ? "week" : void 0
42
+ }, m = k ? ge(k.range, me(x), E) : a.fitRange && b ? ge(a.fitRange, b, E) : Ge(x, a.anchor, E), I = S ? ye : a.columnWidth !== void 0 ? m.length * a.columnWidth : b ? m.length * Ve[b] : w ? m.length * ve.min : m.length * Ke[x], G = a.columnWidth !== void 0 ? m.length * a.columnWidth : b ? Number.POSITIVE_INFINITY : w ? m.length * ve.max : m.length * we[x], R = {};
43
+ for (const C of a.paneColumns) R[C.key] = C.width;
44
+ const B = Ne(
45
+ a.paneColumns.map((C) => C.key),
46
+ R,
47
+ a.available,
48
+ Math.max(ye, I)
49
+ ), f = B.reduce((C, O) => C + (R[O] ?? 0), 0), N = m.length * (a.columnWidth ?? we[x]), P = S ? a.available > 0 ? Math.max(N, a.available - f) : N : a.available > 0 ? Math.min(G, Math.max(I, a.available - f)) : Number.isFinite(G) ? G : I, D = Pe(m, o, P), J = P > 0 ? (o.end.getTime() - o.start.getTime()) / P : 0, te = b ?? (w ? "week" : me(x));
50
+ return {
51
+ range: o,
52
+ columns: m,
53
+ columnWidths: D,
54
+ axisWidth: P,
55
+ paneWidth: f,
56
+ paneKeys: B,
57
+ isFit: e,
58
+ anchoredView: x,
59
+ unit: te,
60
+ continuous: S,
61
+ clamped: k?.clamped ?? !1,
62
+ minGapMs: J
63
+ };
4
64
  }
5
- function d(t, n, e) {
6
- if (n < t)
7
- return [];
8
- const r = c(t, e), o = c(n, e), s = [];
9
- for (let a = r; a <= o; a += e)
10
- s.push(a);
11
- return s;
12
- }
13
- function h(t, n) {
14
- return t.find((e) => e.startIndex === n);
15
- }
16
- function g(t, n, e) {
17
- const r = t.startIndex + t.length - 1;
18
- return n >= t.startIndex && e <= r;
19
- }
20
- function E(t, n, e, r) {
21
- const o = d(n, e, r), s = [];
22
- for (const a of o) {
23
- const u = a + r - 1, i = Math.max(n, a), l = Math.min(e, u), f = h(t, a);
24
- f && f.length > 0 && g(f, i, l) || s.push(a);
65
+ const c = (a, e, x) => {
66
+ const b = document.createElement(a);
67
+ return e && (b.className = e), x !== void 0 && (b.textContent = x), b;
68
+ }, Qe = (a) => typeof a == "object" && a !== null && "el" in a;
69
+ function ct(a) {
70
+ let e = { ...a };
71
+ const x = Oe(), b = () => qe + (e.headerGroups ? le : 0), _ = c("div"), S = c("div"), k = c("div"), o = c(
72
+ "div",
73
+ "zen-relative zen-max-h-[32rem] zen-overflow-auto zen-rounded-zen-md zen-border zen-border-zen-border focus-visible:zen-outline-none"
74
+ );
75
+ o.tabIndex = -1;
76
+ const w = c("div", "zen-absolute zen-z-40 zen-flex zen-bg-zen-background");
77
+ w.setAttribute("aria-hidden", "true"), w.setAttribute("data-schedule-scrollbar", ""), w.style.display = "none";
78
+ const E = c("div", "zen-shrink-0 zen-border-e zen-border-zen-border");
79
+ E.style.boxSizing = "border-box";
80
+ const m = c("div", "zen-min-w-0 zen-flex-1 zen-overflow-x-scroll zen-overflow-y-hidden");
81
+ m.tabIndex = -1;
82
+ const I = c("div");
83
+ I.style.height = "1px", m.append(I), w.append(E, m);
84
+ const G = (t, s) => {
85
+ Math.abs(s.scrollLeft - t.scrollLeft) >= 1 && (s.scrollLeft = t.scrollLeft);
86
+ }, R = () => G(o, m);
87
+ o.addEventListener("scroll", R, { passive: !0 }), m.addEventListener("scroll", () => G(m, o));
88
+ const B = () => {
89
+ const t = o.clientTop, s = Math.max(0, o.offsetHeight - o.clientHeight - t * 2), i = Math.max(0, o.offsetWidth - o.clientWidth - t * 2), r = e.axis.paneWidth;
90
+ if (s === 0 || r <= 0 || o.clientWidth - r <= 0) {
91
+ w.style.display = "none";
92
+ return;
93
+ }
94
+ w.style.display = "", w.style.bottom = `${t}px`, w.style.insetInlineStart = `${t}px`, w.style.insetInlineEnd = `${t + i}px`, w.style.height = `${s}px`, E.style.width = `${r}px`, I.style.width = `${e.axis.axisWidth}px`, R();
95
+ };
96
+ _.append(S, k, o, w);
97
+ let f = { top: 0, height: je, width: 0, left: 0 };
98
+ const N = () => Math.max(0, f.width - e.axis.paneWidth), P = (t) => e.axis.minGapMs > 0 ? (t.getTime() - e.axis.range.start.getTime()) / e.axis.minGapMs : 0, D = () => new Date(e.axis.range.start.getTime() + (f.left + N() / 2) * e.axis.minGapMs), J = () => e.axis.continuous ? D() : e.anchor, te = () => e.axis.continuous ? De(e.axis.columnWidths, f.left, N(), Math.max(N(), 400)) : null, C = () => {
99
+ const t = te();
100
+ return t ? t.offsets.map((s, i) => ({ i: t.first + i, offset: s })) : e.axis.columns.map((s, i) => ({ i }));
101
+ };
102
+ let O = null;
103
+ const de = () => e.axis.isFit ? He(e.axis.range) : Xe(e.axis.anchoredView, e.axis.continuous ? D() : e.anchor);
104
+ let ce = "", F = [], M = [], U = [];
105
+ const H = (t) => (F.push(t), t), ne = (t, s, i) => {
106
+ t.addEventListener(s, i), U.push(() => t.removeEventListener(s, i));
107
+ }, L = () => e.rowHeight ?? Ue, oe = () => re().length + 1, re = () => e.axis.paneKeys.map((t) => e.columns.find((s) => s.key === t)).filter((t) => t !== void 0);
108
+ let q = { row: 0, col: 0 };
109
+ const $ = () => Math.min(Math.max(q.row, 0), Math.max(e.rows.length - 1, 0)), T = () => Math.min(Math.max(q.col, 0), oe() - 1);
110
+ let ie = !1;
111
+ const he = () => Be(e.rows.length, L(), f.top, f.height);
112
+ let y = null, X = null, V = null, K = null, j = null;
113
+ const se = (t, s, i) => {
114
+ for (const r of s)
115
+ Qe(r) ? (i.push(r), t.append(r.el)) : t.append(r);
116
+ };
117
+ function ke(t) {
118
+ const s = he(), i = Math.min(Math.max($(), s.startIndex), Math.max(s.endIndex - 1, 0)), r = t.index === i ? T() : -1, u = re(), h = e.rowClass?.(t), n = c(
119
+ "div",
120
+ W(
121
+ "zen-flex zen-border-b zen-border-zen-border last:zen-border-b-0",
122
+ /* The frozen pane is the row's CHILD, so it covers the row's content
123
+ box and stops one pixel short of its bottom border. Whatever is drawn
124
+ over the axis at that height then shows through the pane as it
125
+ scrolls under: a dependency line routed along a row boundary crossed
126
+ the whole pane, and the today marker left a dot on every rule. The
127
+ pane redraws the rule itself, one pixel below its own box and at its
128
+ own stacking level. Not on the last row, which has no rule to cover. */
129
+ "[&:not(:last-child)>div:first-child]:zen-shadow-[0_1px_0_0_var(--zen-color-border)]",
130
+ h
131
+ )
132
+ );
133
+ n.setAttribute("role", "row"), n.setAttribute("aria-rowindex", String(t.index + 2)), n.setAttribute("aria-level", String(t.depth + 1)), t.hasChildren && n.setAttribute("aria-expanded", String(t.expanded)), n.style.height = `${L()}px`, n.style.boxSizing = "border-box";
134
+ const d = c(
135
+ "div",
136
+ "zen-sticky zen-z-20 zen-flex zen-shrink-0 zen-items-center zen-border-e zen-border-zen-border zen-bg-zen-background"
137
+ );
138
+ d.style.width = `${e.axis.paneWidth}px`, d.style.insetInlineStart = "0", u.forEach((z, v) => {
139
+ const g = c("div", W("zen-flex zen-items-center", z.class ?? "zen-px-2", Ae));
140
+ g.setAttribute("role", "gridcell"), g.setAttribute("aria-colindex", String(z.colIndex)), g.setAttribute("data-gantt-cell", `${t.index}:${v}`), g.tabIndex = r === v ? 0 : -1;
141
+ const A = z.ariaLabel?.(t);
142
+ A && g.setAttribute("aria-label", A), g.style.width = `${z.width}px`;
143
+ for (const [Le, Te] of z.style?.(t) ?? []) g.style.setProperty(Le, Te);
144
+ ne(g, "focusin", () => {
145
+ q = { row: t.index, col: v };
146
+ }), se(g, z.render(t), M), d.append(g);
147
+ });
148
+ const l = c("div", W("zen-relative zen-shrink-0", Ae));
149
+ l.setAttribute("role", "gridcell"), l.setAttribute("aria-colindex", String(e.timelineColIndex)), l.setAttribute("data-gantt-cell", `${t.index}:${u.length}`), l.tabIndex = r === u.length ? 0 : -1, l.style.width = `${e.axis.axisWidth}px`, ne(l, "focusin", () => {
150
+ q = { row: t.index, col: u.length };
151
+ });
152
+ const p = c("div", "zen-absolute zen-inset-0 zen-flex");
153
+ p.setAttribute("aria-hidden", "true");
154
+ for (const { i: z, offset: v } of C()) {
155
+ const g = e.axis.columns[z], A = c(
156
+ "div",
157
+ W(
158
+ "zen-shrink-0 zen-border-e zen-border-zen-border last:zen-border-e-0",
159
+ v !== void 0 && "zen-absolute zen-inset-y-0",
160
+ g.nonWorking && (h ? "zen-bg-[color-mix(in_srgb,var(--zen-color-muted)_40%,transparent)]" : "zen-bg-zen-muted"),
161
+ g.today && (h ? "zen-bg-[color-mix(in_srgb,var(--zen-color-primary-soft)_40%,transparent)]" : "zen-bg-zen-primary-soft")
162
+ )
163
+ );
164
+ A.style.width = `${e.axis.columnWidths[z]}px`, v !== void 0 && (A.style.insetInlineStart = `${v}px`), p.append(A);
165
+ }
166
+ return l.append(p), se(l, e.renderTrack(t, e.axis.axisWidth), M), n.append(d, l), n;
25
167
  }
26
- return s;
27
- }
28
- function I(t, n, e, r) {
29
- if (r <= 0 || t.length === 0)
30
- return [...t];
31
- const o = Math.max(0, c(n, r) - r), s = c(e, r) + r * 2 - 1;
32
- return t.filter((a) => a.startIndex + Math.max(a.length, 1) - 1 >= o && a.startIndex <= s);
33
- }
34
- function R(t, n, e) {
35
- let r = t[0], o = Math.abs(r + e / 2 - n);
36
- for (let s = 1; s < t.length; s++) {
37
- const a = t[s], u = Math.abs(a + e / 2 - n);
38
- u < o && (r = a, o = u);
168
+ function Q() {
169
+ if (!j || !V || !K) return;
170
+ for (const s of M) s.destroy();
171
+ M = [], j.replaceChildren();
172
+ const t = he();
173
+ V.style.height = `${t.paddingTop}px`, K.style.height = `${t.paddingBottom}px`;
174
+ for (const s of e.rows.slice(t.startIndex, t.endIndex))
175
+ j.append(ke(s));
39
176
  }
40
- return r;
41
- }
42
- const v = 4;
43
- function M(t) {
44
- return t.map((n) => ({
45
- startIndex: n.startIndex,
46
- length: n.values.length
47
- }));
48
- }
49
- function _(t, n, e) {
50
- const r = t.startIndex + t.values.length - 1;
51
- return n < t.startIndex || e > r ? !1 : e - t.startIndex < t.values.length;
52
- }
53
- function p(t, n, e, r) {
54
- return E(M(t), n, e, r).filter(
55
- (o) => {
56
- const s = o + r - 1;
57
- return !L(n, s, t, e);
177
+ function Ce(t, s) {
178
+ q = { row: t, col: s };
179
+ const i = b() + t * L(), r = i - b(), u = i + L() - o.clientHeight, h = Math.max(0, Math.min(Math.max(o.scrollTop, u), r));
180
+ h !== o.scrollTop && (o.scrollTop = h, f = { ...f, top: h }), Q();
181
+ const n = o.querySelector(`[data-gantt-cell="${t}:${s}"]`);
182
+ if (!n) return;
183
+ ie = !0, n.focus({ preventScroll: !0 });
184
+ const d = n.querySelector("[data-gantt-bar]");
185
+ if (!d) return;
186
+ const l = d.getBoundingClientRect(), p = o.getBoundingClientRect(), z = getComputedStyle(o).direction === "rtl", v = e.axis.paneWidth, g = z ? p.left : p.left + v, A = z ? p.right - v : p.right;
187
+ l.left < g ? o.scrollLeft -= g - l.left : l.right > A && (o.scrollLeft += Math.min(l.right - A, l.left - g));
188
+ }
189
+ function $e(t) {
190
+ if (t.altKey || t.metaKey) return;
191
+ const s = getComputedStyle(o).direction === "rtl", i = s ? "ArrowLeft" : "ArrowRight", r = s ? "ArrowRight" : "ArrowLeft", u = Math.max(1, Math.floor((f.height - b()) / L())), h = e.rows.length - 1, n = e.rows[$()];
192
+ let d = $(), l = T();
193
+ switch (t.key) {
194
+ case "ArrowDown":
195
+ d = Math.min(h, $() + 1);
196
+ break;
197
+ case "ArrowUp":
198
+ d = Math.max(0, $() - 1);
199
+ break;
200
+ case i:
201
+ if (T() === 0 && n?.hasChildren && !n.expanded) {
202
+ t.preventDefault(), e.onToggle(n);
203
+ return;
204
+ }
205
+ l = Math.min(oe() - 1, T() + 1);
206
+ break;
207
+ case r:
208
+ if (T() === 0 && n?.hasChildren && n.expanded) {
209
+ t.preventDefault(), e.onToggle(n);
210
+ return;
211
+ }
212
+ l = Math.max(0, T() - 1);
213
+ break;
214
+ case "Home":
215
+ l = 0, t.ctrlKey && (d = 0);
216
+ break;
217
+ case "End":
218
+ l = oe() - 1, t.ctrlKey && (d = h);
219
+ break;
220
+ case "PageDown":
221
+ d = Math.min(h, $() + u);
222
+ break;
223
+ case "PageUp":
224
+ d = Math.max(0, $() - u);
225
+ break;
226
+ case "Enter":
227
+ case " ":
228
+ t.preventDefault(), n && e.onActivate?.(n);
229
+ return;
230
+ default:
231
+ return;
58
232
  }
59
- );
60
- }
61
- function L(t, n, e, r) {
62
- const o = Math.min(r, n);
63
- if (o < t)
64
- return !1;
65
- for (const s of e) {
66
- if (s.values.length === 0 || r < s.startIndex || s.startIndex - t > v)
67
- continue;
68
- const a = Math.min(
69
- r,
70
- s.startIndex + s.values.length - 1
233
+ t.preventDefault(), !(d === $() && l === T()) && Ce(d, l);
234
+ }
235
+ function We() {
236
+ const t = c("div", "zen-flex zen-flex-wrap zen-items-center zen-gap-2");
237
+ if (!e.axis.isFit) {
238
+ const r = H(
239
+ Z({
240
+ variant: "outline",
241
+ size: "sm",
242
+ "aria-label": x.t("scheduleGrid.previous"),
243
+ // Logical, not physical: under RTL the axis runs the other way.
244
+ children: H(be({ name: "chevron-left", size: 14, class: "rtl:zen-rotate-180" })),
245
+ /* Continuous: a period back from what is ON SCREEN, not from an anchor
246
+ the user may have scrolled a month away from. */
247
+ onClick: () => e.onDateChange(ze(e.axis.anchoredView, J(), -1))
248
+ })
249
+ ), u = H(
250
+ Z({
251
+ variant: "outline",
252
+ size: "sm",
253
+ children: x.t("scheduleGrid.today"),
254
+ onClick: () => e.onDateChange(e.now)
255
+ })
256
+ ), h = H(
257
+ Z({
258
+ variant: "outline",
259
+ size: "sm",
260
+ "aria-label": x.t("scheduleGrid.next"),
261
+ children: H(be({ name: "chevron-right", size: 14, class: "rtl:zen-rotate-180" })),
262
+ onClick: () => e.onDateChange(ze(e.axis.anchoredView, J(), 1))
263
+ })
264
+ );
265
+ t.append(r.el, u.el, h.el);
266
+ }
267
+ const s = c("span", "zen-mx-1 zen-text-sm zen-font-medium zen-text-zen-foreground", de());
268
+ O = s, s.setAttribute("dir", "auto"), t.append(s);
269
+ const i = c("div", "zen-ms-auto zen-flex zen-gap-1");
270
+ i.setAttribute("role", "group"), i.setAttribute("aria-label", x.t("scheduleGrid.view"));
271
+ for (const r of e.views ?? Je) {
272
+ const u = H(
273
+ Z({
274
+ variant: e.view === r ? "solid" : "outline",
275
+ size: "sm",
276
+ // A boolean would land as aria-pressed="" (the helper writes
277
+ // booleans as presence attributes), which reads as unset.
278
+ "aria-pressed": String(e.view === r),
279
+ children: x.t(Ye[r]),
280
+ onClick: () => {
281
+ e.axis.continuous && r !== "fit" && e.onDateChange(D()), e.onViewChange(r);
282
+ }
283
+ })
284
+ );
285
+ i.append(u.el);
286
+ }
287
+ return t.append(i), t;
288
+ }
289
+ function ue() {
290
+ const t = c(
291
+ "div",
292
+ W("zen-sticky zen-top-0 zen-z-30 zen-flex zen-border-b zen-border-zen-border zen-bg-zen-muted", e.headerClassName)
293
+ );
294
+ t.setAttribute("role", "row"), t.setAttribute("aria-rowindex", "1"), t.style.height = `${b()}px`, t.style.boxSizing = "border-box";
295
+ const s = c(
296
+ "div",
297
+ W(
298
+ "zen-sticky zen-z-40 zen-flex zen-shrink-0 zen-items-center zen-border-e zen-border-zen-border zen-bg-zen-muted zen-text-xs zen-font-semibold zen-text-zen-muted-fg",
299
+ e.headerClassName
300
+ )
71
301
  );
72
- if (o < s.startIndex && _(s, s.startIndex, a))
73
- return !0;
302
+ s.style.width = `${e.axis.paneWidth}px`, s.style.insetInlineStart = "0";
303
+ for (const n of re()) {
304
+ const d = c("div", W("zen-truncate", n.class ?? "zen-px-2"), n.label);
305
+ d.setAttribute("role", "columnheader"), d.setAttribute("aria-colindex", String(n.colIndex)), d.style.width = `${n.width}px`, s.append(d);
306
+ }
307
+ const i = c("div", e.headerGroups ? "zen-flex zen-flex-col" : "zen-flex");
308
+ i.setAttribute("role", "columnheader"), i.setAttribute("aria-colindex", String(e.timelineColIndex)), i.setAttribute("aria-label", x.t("scheduleGrid.timeline")), i.style.width = `${e.axis.axisWidth}px`;
309
+ const r = e.headerGroups ? c("div") : i, u = e.axis.continuous, h = u ? c("div", "zen-relative zen-h-full zen-w-full") : r;
310
+ u && (h.setAttribute("data-schedule-windowed", ""), r.append(h));
311
+ for (const { i: n, offset: d } of C()) {
312
+ const l = e.axis.columns[n], p = c(
313
+ "div",
314
+ W(
315
+ "zen-flex zen-shrink-0 zen-flex-col zen-items-center zen-justify-center zen-overflow-hidden zen-border-e zen-border-zen-border last:zen-border-e-0",
316
+ d !== void 0 && "zen-absolute zen-inset-y-0",
317
+ l.nonWorking && "zen-bg-zen-muted",
318
+ l.today && "zen-bg-zen-primary-soft"
319
+ )
320
+ );
321
+ p.style.width = `${e.axis.columnWidths[n]}px`, d !== void 0 && (p.style.insetInlineStart = `${d}px`), p.append(c("span", "zen-text-xs zen-font-medium zen-text-zen-foreground", l.label)), l.sublabel && p.append(c("span", "zen-[font-size:var(--zen-schedule-label-font-size)] zen-text-zen-muted-fg", l.sublabel)), h.append(p);
322
+ }
323
+ if (e.headerGroups) {
324
+ const n = e.axis.columnWidths, d = c("div", "zen-flex zen-shrink-0 zen-border-b zen-border-zen-border");
325
+ d.setAttribute("aria-hidden", "true"), d.setAttribute("data-schedule-groups", ""), d.style.height = `${le}px`, d.style.boxSizing = "border-box";
326
+ for (const l of Fe(e.axis.columns, e.axis.unit)) {
327
+ const p = n.slice(l.firstColumn, l.firstColumn + l.columnCount).reduce((g, A) => g + A, 0), z = c("div", "zen-shrink-0 zen-border-e zen-border-zen-border last:zen-border-e-0");
328
+ z.setAttribute("data-schedule-group", ""), z.style.width = `${p}px`;
329
+ const v = c(
330
+ "span",
331
+ "zen-sticky zen-inline-block zen-max-w-full zen-truncate zen-px-2 zen-align-top zen-text-xs zen-font-semibold zen-text-zen-foreground",
332
+ p >= l.label.length * 7 + 16 ? l.label : l.shortLabel
333
+ );
334
+ v.style.insetInlineStart = `${e.axis.paneWidth}px`, v.style.lineHeight = `${le - 1}px`, z.append(v), d.append(z);
335
+ }
336
+ r.setAttribute("data-schedule-axis-row", ""), r.className = "zen-flex zen-min-h-0 zen-flex-1", i.append(d, r);
337
+ }
338
+ return t.append(s, i), t;
74
339
  }
75
- return !1;
76
- }
77
- function A(t, n, e, r) {
78
- return I(
79
- t.map((o) => ({
80
- startIndex: o.startIndex,
81
- length: o.values.length,
82
- window: o
83
- })),
84
- n,
85
- e,
86
- r
87
- ).map((o) => o.window);
88
- }
89
- function C(t, n) {
90
- for (const e of t) {
91
- const r = n - e.startIndex;
92
- if (r >= 0 && r < e.values.length)
93
- return e.values[r];
340
+ function Me() {
341
+ const t = e.connectors;
342
+ if (!t || t.length === 0) return null;
343
+ const s = e.rows.length * L(), i = document.createElementNS("http://www.w3.org/2000/svg", "svg");
344
+ i.setAttribute("aria-hidden", "true"), i.setAttribute(
345
+ "class",
346
+ "zen-pointer-events-none zen-absolute zen-top-0 zen-z-10 rtl:-zen-scale-x-100"
347
+ ), i.setAttribute("width", String(e.axis.axisWidth)), i.setAttribute("height", String(s)), i.setAttribute("viewBox", `0 0 ${e.axis.axisWidth} ${s}`), i.style.insetInlineStart = `${e.axis.paneWidth}px`;
348
+ for (const r of t) {
349
+ const u = e.connectorAccent?.(r) ?? !1, h = e.connectorStyle?.(r), n = u ? "var(--zen-color-error)" : h?.color ?? "var(--zen-color-muted-fg)", d = document.createElementNS("http://www.w3.org/2000/svg", "g"), l = document.createElementNS("http://www.w3.org/2000/svg", "path");
350
+ l.setAttribute("d", r.d), l.setAttribute("fill", "none"), l.setAttribute("stroke", n), h?.dash && l.setAttribute("stroke-dasharray", h.dash), l.setAttribute("stroke-width", u ? "2.25" : "1.5");
351
+ const p = document.createElementNS("http://www.w3.org/2000/svg", "polygon");
352
+ p.setAttribute(
353
+ "points",
354
+ [
355
+ `${r.arrow.x},${r.arrow.y}`,
356
+ `${r.arrow.x - r.arrow.dir * ee * 1.6},${r.arrow.y - ee}`,
357
+ `${r.arrow.x - r.arrow.dir * ee * 1.6},${r.arrow.y + ee}`
358
+ ].join(" ")
359
+ ), p.setAttribute("fill", n), d.append(l, p), i.append(d);
360
+ }
361
+ return i;
362
+ }
363
+ function fe() {
364
+ for (const n of F) n.destroy();
365
+ for (const n of M) n.destroy();
366
+ for (const n of U) n();
367
+ F = [], M = [], U = [], _.className = W("zen-relative zen-flex zen-w-full zen-flex-col zen-gap-3", e.class);
368
+ const t = e.maxBodyHeight;
369
+ o.classList.toggle("zen-max-h-[32rem]", t === void 0), o.style.maxHeight = t === void 0 ? "" : typeof t == "number" ? `${t}px` : t, S.replaceChildren(), e.hideToolbar || S.append(We()), k.replaceChildren(), k.hidden = !e.legend, e.legend && k.append(e.legend);
370
+ const s = o.scrollTop, i = o.scrollLeft, r = o.contains(document.activeElement);
371
+ o.replaceChildren(), y = c("div"), y.style.width = `${e.axis.paneWidth + e.axis.axisWidth}px`, y.setAttribute("role", "treegrid"), y.setAttribute("aria-rowcount", String(e.rows.length + 1)), y.setAttribute("aria-colcount", String(e.colCount)), y.setAttribute("aria-label", e.ariaLabel), ne(y, "keydown", $e), y.append(ue()), X = c("div", "zen-relative"), X.style.height = `${e.rows.length * L()}px`, V = c("div"), V.setAttribute("aria-hidden", "true"), j = c("div"), K = c("div"), K.setAttribute("aria-hidden", "true"), X.append(V, j, K);
372
+ const u = Ee(e.axis.range, e.now);
373
+ if (u !== null) {
374
+ const n = c("div", "zen-pointer-events-none zen-absolute zen-top-0 zen-z-10 zen-w-px zen-bg-zen-error");
375
+ n.setAttribute("aria-hidden", "true"), n.style.height = `${e.rows.length * L()}px`, n.style.insetInlineStart = `${e.axis.paneWidth + u / 100 * e.axis.axisWidth}px`, X.append(n);
376
+ }
377
+ const h = Me();
378
+ if (h && X.append(h), y.append(X), o.append(y), e.renderFooter) {
379
+ const n = c(
380
+ "div",
381
+ "zen-sticky zen-bottom-0 zen-z-30 zen-flex zen-border-t zen-border-zen-border zen-bg-zen-muted"
382
+ );
383
+ n.style.width = `${e.axis.paneWidth + e.axis.axisWidth}px`, se(n, e.renderFooter(e.axis), F), o.append(n);
384
+ }
385
+ if (Q(), o.scrollTop = s, o.scrollLeft = i, e.axis.continuous && f.width > 0) {
386
+ const n = `${e.view}|${e.anchor.getTime()}|${e.axis.range.start.getTime()}|${e.axis.range.end.getTime()}`;
387
+ if (n !== ce) {
388
+ ce = n;
389
+ const d = Math.max(0, P(Se(e.axis.anchoredView, e.anchor).start));
390
+ o.scrollLeft = getComputedStyle(o).direction === "rtl" ? -d : d;
391
+ }
392
+ }
393
+ r && (o.querySelector(
394
+ `[data-gantt-cell="${$()}:${T()}"]`
395
+ ) ?? o).focus({ preventScroll: !0 }), B();
94
396
  }
397
+ const pe = () => {
398
+ B();
399
+ const t = {
400
+ top: o.scrollTop,
401
+ height: o.clientHeight,
402
+ width: o.clientWidth,
403
+ // Chrome reports an RTL scrollLeft as negative; the axis thinks in logical px.
404
+ left: Math.abs(o.scrollLeft)
405
+ }, s = t.top !== f.top || t.height !== f.height, i = t.width !== f.width || t.height !== f.height, r = t.left !== f.left;
406
+ if (!(!s && !i && !r)) {
407
+ if (f = t, r && !i && e.axis.continuous && y) {
408
+ y.firstElementChild?.replaceWith(ue()), O && (O.textContent = de()), Q();
409
+ return;
410
+ }
411
+ i ? e.onMetrics?.(f) : Q();
412
+ }
413
+ };
414
+ let Y = 0;
415
+ const ae = () => {
416
+ Y === 0 && (Y = requestAnimationFrame(() => {
417
+ Y = 0, pe(), ie && document.activeElement === document.body && o.focus({ preventScroll: !0 });
418
+ }));
419
+ };
420
+ o.addEventListener("scroll", ae, { passive: !0 });
421
+ const xe = new ResizeObserver(ae);
422
+ return xe.observe(o), o.addEventListener("focusin", () => {
423
+ ie = !0;
424
+ }), fe(), queueMicrotask(pe), {
425
+ el: _,
426
+ update(t) {
427
+ e = { ...e, ...t }, fe();
428
+ },
429
+ metrics: () => f,
430
+ destroy() {
431
+ for (const t of F) t.destroy();
432
+ for (const t of M) t.destroy();
433
+ for (const t of U) t();
434
+ F = [], M = [], U = [], Y !== 0 && cancelAnimationFrame(Y), o.removeEventListener("scroll", ae), o.removeEventListener("scroll", R), xe.disconnect(), _.remove();
435
+ }
436
+ };
95
437
  }
96
438
  export {
97
- v as PIVOT_FILTER_LEADING_OVERSCAN_SLACK,
98
- W as VIRTUAL_SCROLL_FETCH_DEBOUNCE_MS,
99
- x as VIRTUAL_SCROLL_WINDOW_PAGE_SIZE,
100
- c as alignWindowStart,
101
- E as missingWindowStarts,
102
- R as pickNearestWindowStart,
103
- p as pivotFilterMissingWindowStarts,
104
- C as pivotFilterWindowValueAt,
105
- A as prunePivotFilterWindows,
106
- I as pruneWindowsByRange,
107
- d as requiredWindowStarts
439
+ Je as ALL_VIEWS,
440
+ le as GROUP_PX,
441
+ qe as HEADER_PX,
442
+ lt as INDENT_PX,
443
+ Ue as ROW_PX,
444
+ ct as ScheduleGrid,
445
+ dt as resolveScheduleAxis
108
446
  };
109
447
  //# sourceMappingURL=index238.js.map