@algorisys/zen-ui-vanilla 13.10.1 → 13.11.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.
- package/AGENTS.md +2 -2
- package/dist/_core/index.d.ts +1 -0
- package/dist/_core/messages-all.d.ts +5 -0
- package/dist/_core/messages.d.ts +5 -0
- package/dist/_core/planning-gesture.d.ts +31 -0
- package/dist/_core/planning.d.ts +71 -9
- package/dist/components/data-table/data-table.d.ts.map +1 -1
- package/dist/components/event-calendar/event-calendar-item.d.ts.map +1 -1
- package/dist/components/event-calendar/event-calendar-model.d.ts +6 -0
- package/dist/components/event-calendar/event-calendar-model.d.ts.map +1 -1
- package/dist/components/planning-calendar/planning-calendar.d.ts +61 -3
- package/dist/components/planning-calendar/planning-calendar.d.ts.map +1 -1
- package/dist/components/rich-text/rich-text.d.ts +5 -7
- package/dist/components/rich-text/rich-text.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index108.js +12 -4
- package/dist/index108.js.map +1 -1
- package/dist/index112.js +244 -144
- package/dist/index112.js.map +1 -1
- package/dist/index113.js +6 -6
- package/dist/index114.js +1 -1
- package/dist/index115.js +1 -1
- package/dist/index116.js +1 -1
- package/dist/index118.js +2 -2
- package/dist/index120.js +2 -2
- package/dist/index168.js +1 -1
- package/dist/index175.js +1 -1
- package/dist/index187.js +1 -1
- package/dist/index191.js +1 -1
- package/dist/index194.js +2 -2
- package/dist/index199.js +1 -1
- package/dist/index211.js +5 -0
- package/dist/index211.js.map +1 -1
- package/dist/index230.js +107 -75
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +95 -7
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +7 -48
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +45 -37
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +38 -149
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +138 -177
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +190 -90
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +90 -444
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +436 -98
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +106 -2
- package/dist/index239.js.map +1 -1
- package/dist/index240.js +2 -18804
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +18798 -117
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +122 -13
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +13 -3012
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +3006 -123
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +125 -140
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +138 -93
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +91 -104
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +95 -111
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +127 -4
- package/dist/index249.js.map +1 -1
- package/dist/index250.js +5 -34
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +34 -9
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +10 -7
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +6 -15
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +15 -11
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +11 -3
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +7 -0
- package/dist/index256.js.map +1 -0
- package/dist/index99.js.map +1 -1
- package/dist/previews/analytic-chart.jpg +0 -0
- package/dist/previews/code-editor.jpg +0 -0
- package/dist/previews/countdown.jpg +0 -0
- package/dist/previews/loading.jpg +0 -0
- package/dist/previews/map.jpg +0 -0
- package/dist/previews/skeleton.jpg +0 -0
- package/dist/previews/tile.jpg +0 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/skills/zen-ui/SKILL.md +1 -1
- package/skills/zen-ui/references/api/event-calendar-event-calendar.md +1 -0
- package/skills/zen-ui/references/api/index.md +1 -1
- package/skills/zen-ui/references/api/locale.md +5 -0
- package/skills/zen-ui/references/api/planning-calendar.md +30 -1
- package/skills/zen-ui/references/api/rich-text.md +1 -1
- package/skills/zen-ui/references/api/scan-input.md +1 -1
- package/skills/zen-ui/references/catalogue.md +2 -2
package/dist/index112.js
CHANGED
|
@@ -1,215 +1,315 @@
|
|
|
1
|
-
import { cn as
|
|
1
|
+
import { cn as B } from "./index194.js";
|
|
2
2
|
import "./index210.js";
|
|
3
3
|
import "./index169.js";
|
|
4
|
-
import {
|
|
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";
|
|
5
6
|
import "./index116.js";
|
|
6
7
|
import "./index119.js";
|
|
7
|
-
import { calendarLanePx as
|
|
8
|
-
import { Button as
|
|
9
|
-
import { Icon as
|
|
10
|
-
import { Disposer as
|
|
11
|
-
import { useLocale as
|
|
12
|
-
const
|
|
8
|
+
import { calendarLanePx as We } from "./index232.js";
|
|
9
|
+
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 = {
|
|
13
14
|
default: "zen-bg-zen-muted zen-text-zen-foreground zen-border-zen-border",
|
|
14
15
|
info: "zen-bg-zen-info-soft zen-text-zen-info zen-border-zen-info",
|
|
15
16
|
success: "zen-bg-zen-success-soft zen-text-zen-success zen-border-zen-success",
|
|
16
17
|
warning: "zen-bg-zen-warning-soft zen-text-zen-warning zen-border-zen-warning",
|
|
17
18
|
error: "zen-bg-zen-error-soft zen-text-zen-error zen-border-zen-error"
|
|
18
|
-
},
|
|
19
|
+
}, Be = {
|
|
19
20
|
day: "planningCalendar.views.day",
|
|
20
21
|
week: "planningCalendar.views.week",
|
|
21
22
|
month: "planningCalendar.views.month"
|
|
22
|
-
},
|
|
23
|
-
const
|
|
24
|
-
return
|
|
23
|
+
}, Fe = ["day", "week", "month"], Ge = 3, t = (_, n, w) => {
|
|
24
|
+
const p = document.createElement(_);
|
|
25
|
+
return n && (p.className = n), w !== void 0 && (p.textContent = w), p;
|
|
25
26
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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);
|
|
38
|
+
let S = [];
|
|
39
|
+
const X = (e, i, s) => {
|
|
40
|
+
e.addEventListener(i, s), S.push(() => e.removeEventListener(i, s));
|
|
38
41
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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 = () => {
|
|
48
|
+
const e = g.ownerDocument.activeElement;
|
|
49
|
+
return e && h.contains(e) ? e.getAttribute("data-plan-appointment") : null;
|
|
50
|
+
};
|
|
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();
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
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);
|
|
61
|
+
if (!s || !z) return;
|
|
62
|
+
const l = t(
|
|
63
|
+
"div",
|
|
64
|
+
"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
|
+
);
|
|
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);
|
|
72
|
+
};
|
|
73
|
+
function De(e, i, s) {
|
|
74
|
+
const z = t("div", "zen-flex zen-flex-wrap zen-items-center zen-gap-2"), l = y(
|
|
75
|
+
F({
|
|
42
76
|
variant: "outline",
|
|
43
77
|
size: "sm",
|
|
44
|
-
"aria-label":
|
|
78
|
+
"aria-label": p.t("planningCalendar.previous"),
|
|
45
79
|
// Logical, not physical: under RTL the axis runs the other way, so a
|
|
46
80
|
// left-pointing chevron would send you forward.
|
|
47
|
-
children:
|
|
48
|
-
onClick: () =>
|
|
81
|
+
children: y(se({ name: "chevron-left", size: 14, class: "rtl:zen-rotate-180" })),
|
|
82
|
+
onClick: () => W(he(e, i, -1, H()))
|
|
49
83
|
})
|
|
50
|
-
), R =
|
|
51
|
-
|
|
52
|
-
),
|
|
53
|
-
|
|
84
|
+
), R = y(
|
|
85
|
+
F({ variant: "outline", size: "sm", children: p.t("planningCalendar.today"), onClick: () => W(s) })
|
|
86
|
+
), T = y(
|
|
87
|
+
F({
|
|
54
88
|
variant: "outline",
|
|
55
89
|
size: "sm",
|
|
56
|
-
"aria-label":
|
|
57
|
-
children:
|
|
58
|
-
onClick: () =>
|
|
90
|
+
"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()))
|
|
59
93
|
})
|
|
60
|
-
),
|
|
94
|
+
), fe = t(
|
|
61
95
|
"span",
|
|
62
96
|
"zen-mx-1 zen-text-sm zen-font-medium zen-text-zen-foreground",
|
|
63
|
-
|
|
64
|
-
),
|
|
65
|
-
|
|
66
|
-
for (const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
variant:
|
|
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
|
+
y(
|
|
103
|
+
F({
|
|
104
|
+
variant: e === b ? "solid" : "outline",
|
|
71
105
|
size: "sm",
|
|
72
|
-
"aria-pressed": String(
|
|
73
|
-
children:
|
|
74
|
-
onClick: () =>
|
|
106
|
+
"aria-pressed": String(e === b),
|
|
107
|
+
children: p.t(Be[b]),
|
|
108
|
+
onClick: () => ve(b)
|
|
75
109
|
})
|
|
76
110
|
).el
|
|
77
111
|
);
|
|
78
|
-
|
|
112
|
+
if (z.append(l.el, R.el, T.el, fe, I), n.toolbarActions != null) {
|
|
113
|
+
const b = t("div", "zen-flex zen-flex-wrap zen-items-center zen-gap-2");
|
|
114
|
+
b.append(...le(n.toolbarActions)), z.append(b);
|
|
115
|
+
}
|
|
116
|
+
return z;
|
|
79
117
|
}
|
|
80
|
-
function
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
for (const
|
|
84
|
-
|
|
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();
|
|
85
125
|
const {
|
|
86
|
-
rows:
|
|
87
|
-
emptyMessage:
|
|
88
|
-
class:
|
|
89
|
-
children:
|
|
90
|
-
defaultView:
|
|
91
|
-
defaultDate:
|
|
92
|
-
view:
|
|
93
|
-
date:
|
|
94
|
-
views:
|
|
95
|
-
now:
|
|
96
|
-
hideToolbar:
|
|
97
|
-
onViewChange:
|
|
98
|
-
onDateChange:
|
|
99
|
-
onAppointmentClick:
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
126
|
+
rows: i,
|
|
127
|
+
emptyMessage: s,
|
|
128
|
+
class: z,
|
|
129
|
+
children: l,
|
|
130
|
+
defaultView: R,
|
|
131
|
+
defaultDate: T,
|
|
132
|
+
view: fe,
|
|
133
|
+
date: I,
|
|
134
|
+
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
|
|
156
|
+
} = n;
|
|
157
|
+
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(),
|
|
161
|
+
dayStartHour: n.dayStartHour,
|
|
162
|
+
dayEndHour: n.dayEndHour,
|
|
163
|
+
hourStep: n.hourStep,
|
|
164
|
+
workingHours: n.workingHours,
|
|
165
|
+
nonWorkingDays: n.nonWorkingDays
|
|
166
|
+
});
|
|
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));
|
|
107
172
|
return {
|
|
108
|
-
row:
|
|
109
|
-
blocks:
|
|
110
|
-
laneCount: Math.max(
|
|
173
|
+
row: d,
|
|
174
|
+
blocks: k.map((r, f) => ({ ...r, lane: M[f] })),
|
|
175
|
+
laneCount: Math.max(K, 1)
|
|
111
176
|
};
|
|
112
177
|
});
|
|
113
|
-
if (!
|
|
114
|
-
const
|
|
115
|
-
|
|
178
|
+
if (!n.hideToolbar && ee.length > 0 && h.append(De($, Q, Y)), ee.length === 0) {
|
|
179
|
+
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);
|
|
116
181
|
} else {
|
|
117
|
-
const
|
|
182
|
+
const d = t(
|
|
118
183
|
"div",
|
|
119
184
|
"zen-overflow-x-auto zen-rounded-zen-md zen-border zen-border-zen-border"
|
|
120
|
-
),
|
|
121
|
-
|
|
122
|
-
|
|
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(
|
|
187
|
+
t(
|
|
123
188
|
"div",
|
|
124
189
|
"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",
|
|
125
|
-
|
|
190
|
+
p.t("planningCalendar.resource")
|
|
126
191
|
)
|
|
127
192
|
);
|
|
128
|
-
const
|
|
129
|
-
for (const
|
|
130
|
-
const
|
|
193
|
+
const K = t("div", "zen-flex zen-flex-1");
|
|
194
|
+
for (const r of Z) {
|
|
195
|
+
const f = t(
|
|
131
196
|
"div",
|
|
132
|
-
|
|
197
|
+
B(
|
|
133
198
|
"zen-flex-1 zen-border-e zen-border-zen-border zen-px-1 zen-py-2 zen-text-center last:zen-border-e-0",
|
|
134
|
-
|
|
135
|
-
|
|
199
|
+
r.nonWorking && "zen-bg-zen-muted",
|
|
200
|
+
r.today && "zen-bg-zen-primary-soft"
|
|
136
201
|
)
|
|
137
202
|
);
|
|
138
|
-
|
|
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);
|
|
139
204
|
}
|
|
140
|
-
|
|
141
|
-
for (const
|
|
142
|
-
const
|
|
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(
|
|
143
208
|
"div",
|
|
144
209
|
"zen-w-40 zen-shrink-0 zen-border-e zen-border-zen-border zen-px-3 zen-py-2"
|
|
145
210
|
);
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
),
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
for (const
|
|
154
|
-
|
|
155
|
-
|
|
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(
|
|
220
|
+
t(
|
|
156
221
|
"div",
|
|
157
|
-
|
|
222
|
+
B(
|
|
158
223
|
"zen-flex-1 zen-border-e zen-border-zen-border last:zen-border-e-0",
|
|
159
|
-
|
|
160
|
-
|
|
224
|
+
c.nonWorking && "zen-bg-zen-muted",
|
|
225
|
+
c.today && "zen-bg-zen-primary-soft"
|
|
161
226
|
)
|
|
162
227
|
)
|
|
163
228
|
);
|
|
164
|
-
if (
|
|
165
|
-
const
|
|
166
|
-
|
|
229
|
+
if (v.append(oe), me !== null) {
|
|
230
|
+
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);
|
|
167
232
|
}
|
|
168
|
-
for (const
|
|
169
|
-
const a = document.createElement("button");
|
|
170
|
-
|
|
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(
|
|
171
236
|
"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",
|
|
172
237
|
"focus-visible:zen-outline-none focus-visible:zen-ring-2 focus-visible:zen-ring-zen-ring",
|
|
173
|
-
|
|
238
|
+
Ne[a.state ?? "default"],
|
|
174
239
|
// Square off the cut edge so a block continuing past the view does
|
|
175
240
|
// not look like it ends there.
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
241
|
+
c.placement.clippedStart && "zen-rounded-s-none zen-border-s-0",
|
|
242
|
+
c.placement.clippedEnd && "zen-rounded-e-none zen-border-e-0",
|
|
243
|
+
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(
|
|
248
|
+
"aria-keyshortcuts",
|
|
249
|
+
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({
|
|
256
|
+
event: u,
|
|
257
|
+
target: o,
|
|
258
|
+
root: g,
|
|
259
|
+
axis: x,
|
|
260
|
+
view: $,
|
|
261
|
+
snapMinutes: ze(),
|
|
262
|
+
appointment: a,
|
|
263
|
+
rowId: m.id,
|
|
264
|
+
allowRowChange: !!n.allowRowChange,
|
|
265
|
+
scroller: d,
|
|
266
|
+
onPreview: (C) => _e(o, C),
|
|
267
|
+
onCommit: (C) => ue(a, m, C, "pointer")
|
|
268
|
+
});
|
|
269
|
+
}), X(o, "keydown", (u) => {
|
|
270
|
+
if (!u.altKey || u.ctrlKey || u.metaKey) return;
|
|
271
|
+
let C = null;
|
|
272
|
+
if (u.key === "ArrowUp" || u.key === "ArrowDown") {
|
|
273
|
+
if (!n.allowRowChange) return;
|
|
274
|
+
const N = n.rows ?? [], V = N[N.findIndex((Se) => Se.id === m.id) + (u.key === "ArrowDown" ? 1 : -1)];
|
|
275
|
+
if (!V) return;
|
|
276
|
+
C = { start: a.start, end: a.end, rowId: V.id };
|
|
277
|
+
} else {
|
|
278
|
+
const N = getComputedStyle(o).direction === "rtl", V = Me(a, u.key, { view: $, rtl: N, snapMinutes: ze() });
|
|
279
|
+
if (!V) return;
|
|
280
|
+
C = { ...V, rowId: m.id };
|
|
281
|
+
}
|
|
282
|
+
u.preventDefault(), u.stopPropagation(), ue(a, m, C, "keyboard");
|
|
283
|
+
})), v.append(o);
|
|
190
284
|
}
|
|
191
|
-
|
|
285
|
+
f.append(v), k.append(f);
|
|
192
286
|
}
|
|
193
|
-
|
|
287
|
+
d.append(k), h.append(d);
|
|
288
|
+
}
|
|
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));
|
|
194
294
|
}
|
|
195
|
-
P?.(), P = ce(d, ee);
|
|
196
295
|
}
|
|
197
|
-
return
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
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
|
+
S = [];
|
|
202
302
|
}), {
|
|
203
|
-
el:
|
|
204
|
-
update(
|
|
205
|
-
|
|
303
|
+
el: g,
|
|
304
|
+
update(e) {
|
|
305
|
+
n = { ...n, ...e }, O();
|
|
206
306
|
},
|
|
207
307
|
destroy() {
|
|
208
|
-
|
|
308
|
+
G.dispose(), g.remove();
|
|
209
309
|
}
|
|
210
310
|
};
|
|
211
311
|
}
|
|
212
312
|
export {
|
|
213
|
-
|
|
313
|
+
_n as PlanningCalendar
|
|
214
314
|
};
|
|
215
315
|
//# sourceMappingURL=index112.js.map
|