@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.
- package/dist/_core/calendar-follow.d.ts +39 -0
- package/dist/_core/index.d.ts +1 -0
- package/dist/components/event-calendar/event-calendar.d.ts.map +1 -1
- package/dist/components/planning-calendar/planning-calendar.d.ts.map +1 -1
- package/dist/index112.js +174 -165
- package/dist/index112.js.map +1 -1
- package/dist/index113.js +149 -143
- package/dist/index113.js.map +1 -1
- 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/index231.js +1 -1
- package/dist/index232.js +7 -7
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +7 -48
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +45 -37
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +38 -149
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +138 -177
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +190 -90
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +90 -444
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +436 -98
- package/dist/index239.js.map +1 -1
- package/dist/index240.js +106 -2
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +2 -18804
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +18798 -117
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +122 -13
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +13 -3012
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +3006 -123
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +125 -140
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +138 -93
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +91 -104
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +95 -111
- package/dist/index249.js.map +1 -1
- package/dist/index250.js +127 -4
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +5 -34
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +34 -9
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +10 -7
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +6 -15
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +15 -11
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +11 -3
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +7 -0
- package/dist/index257.js.map +1 -0
- package/dist/previews/analytic-chart.jpg +0 -0
- package/dist/previews/chunk-uploader.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/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;
|
package/dist/_core/index.d.ts
CHANGED
|
@@ -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":"
|
|
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,
|
|
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,EAiBL,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,CAA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
import { cn as B } from "./index194.js";
|
|
2
2
|
import "./index210.js";
|
|
3
3
|
import "./index169.js";
|
|
4
|
-
import { planningColumns as
|
|
5
|
-
import { startPlanningGesture as
|
|
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
|
|
9
|
+
import { calendarLanePx as Ke } from "./index233.js";
|
|
9
10
|
import { Button as F } from "./index4.js";
|
|
10
|
-
import { Icon as
|
|
11
|
-
import { Disposer as
|
|
12
|
-
import { useLocale as
|
|
13
|
-
const
|
|
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
|
-
},
|
|
20
|
+
}, Ue = {
|
|
20
21
|
day: "planningCalendar.views.day",
|
|
21
22
|
week: "planningCalendar.views.week",
|
|
22
23
|
month: "planningCalendar.views.month"
|
|
23
|
-
},
|
|
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
|
|
28
|
-
function
|
|
29
|
-
let n = { ...
|
|
30
|
-
const w = () => Math.max(14,
|
|
31
|
-
let U,
|
|
32
|
-
const
|
|
33
|
-
q.id =
|
|
34
|
-
const
|
|
35
|
-
|
|
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
|
|
40
|
-
|
|
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
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
n.
|
|
47
|
-
},
|
|
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
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
if (
|
|
56
|
-
|
|
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
|
-
|
|
60
|
-
const s = j.get(
|
|
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",
|
|
67
|
-
},
|
|
68
|
-
const l = (n.rows ?? []).find((
|
|
69
|
-
z === "keyboard" && (
|
|
70
|
-
const
|
|
71
|
-
|
|
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
|
|
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(
|
|
82
|
-
onClick: () =>
|
|
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
|
-
),
|
|
85
|
-
F({ variant: "outline", size: "sm", children: p.t("planningCalendar.today"), onClick: () =>
|
|
86
|
-
),
|
|
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(
|
|
92
|
-
onClick: () =>
|
|
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
|
-
),
|
|
99
|
+
), be = t(
|
|
95
100
|
"span",
|
|
96
101
|
"zen-mx-1 zen-text-sm zen-font-medium zen-text-zen-foreground",
|
|
97
|
-
|
|
98
|
-
),
|
|
99
|
-
|
|
100
|
-
for (const b of n.views ??
|
|
101
|
-
|
|
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(
|
|
108
|
-
onClick: () =>
|
|
112
|
+
children: p.t(Ue[b]),
|
|
113
|
+
onClick: () => Ae(b)
|
|
109
114
|
})
|
|
110
115
|
).el
|
|
111
116
|
);
|
|
112
|
-
if (z.append(l.el,
|
|
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(...
|
|
119
|
+
b.append(...de(n.toolbarActions)), z.append(b);
|
|
115
120
|
}
|
|
116
121
|
return z;
|
|
117
122
|
}
|
|
118
|
-
function
|
|
119
|
-
const e =
|
|
120
|
-
|
|
121
|
-
for (const d of
|
|
122
|
-
|
|
123
|
-
for (const d of
|
|
124
|
-
|
|
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:
|
|
131
|
+
rows: r,
|
|
127
132
|
emptyMessage: s,
|
|
128
133
|
class: z,
|
|
129
134
|
children: l,
|
|
130
|
-
defaultView:
|
|
131
|
-
defaultDate:
|
|
132
|
-
view:
|
|
133
|
-
date:
|
|
135
|
+
defaultView: I,
|
|
136
|
+
defaultDate: O,
|
|
137
|
+
view: be,
|
|
138
|
+
date: M,
|
|
134
139
|
views: b,
|
|
135
|
-
now:
|
|
136
|
-
hideToolbar:
|
|
137
|
-
onViewChange:
|
|
138
|
-
onDateChange:
|
|
139
|
-
onAppointmentClick:
|
|
140
|
-
toolbarActions:
|
|
141
|
-
onAppointmentChange:
|
|
142
|
-
canEditAppointment:
|
|
143
|
-
allowRowChange:
|
|
144
|
-
snapMinutes:
|
|
145
|
-
renderAppointment:
|
|
146
|
-
appointmentClass:
|
|
147
|
-
weekStartsOn:
|
|
148
|
-
dayStartHour:
|
|
149
|
-
dayEndHour:
|
|
150
|
-
hourStep:
|
|
151
|
-
workingHours:
|
|
152
|
-
nonWorkingDays:
|
|
153
|
-
laneHeight:
|
|
154
|
-
density:
|
|
155
|
-
...
|
|
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 $ =
|
|
159
|
-
now:
|
|
160
|
-
weekStartsOn:
|
|
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
|
-
|
|
168
|
-
const
|
|
169
|
-
const
|
|
170
|
-
(
|
|
171
|
-
), { lanes:
|
|
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:
|
|
179
|
+
blocks: _.map((a, f) => ({ ...a, lane: T[f] })),
|
|
175
180
|
laneCount: Math.max(K, 1)
|
|
176
181
|
};
|
|
177
182
|
});
|
|
178
|
-
if (!n.hideToolbar && (
|
|
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(...
|
|
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
|
-
),
|
|
186
|
-
|
|
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
|
|
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
|
-
|
|
200
|
-
|
|
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",
|
|
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
|
-
|
|
206
|
-
for (const
|
|
207
|
-
const f = t("div", "zen-flex zen-border-b zen-border-zen-border last:zen-border-b-0"),
|
|
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
|
-
|
|
212
|
-
t("div", "zen-truncate zen-text-sm zen-font-medium zen-text-zen-foreground",
|
|
213
|
-
),
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
const
|
|
217
|
-
|
|
218
|
-
for (const c of
|
|
219
|
-
|
|
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 (
|
|
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", `${
|
|
236
|
+
c.setAttribute("aria-hidden", "true"), c.style.setProperty("inset-inline-start", `${we}%`), x.append(c);
|
|
232
237
|
}
|
|
233
|
-
for (const c of
|
|
234
|
-
const { appointment:
|
|
235
|
-
o.type = "button", o.setAttribute("data-plan-appointment",
|
|
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
|
-
|
|
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
|
-
|
|
245
|
-
|
|
246
|
-
n.appointmentClass?.(
|
|
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`,
|
|
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
|
-
)),
|
|
251
|
-
const
|
|
252
|
-
o.title = `${
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
|
|
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:
|
|
264
|
+
axis: C,
|
|
260
265
|
view: $,
|
|
261
|
-
snapMinutes:
|
|
262
|
-
appointment:
|
|
266
|
+
snapMinutes: ue(),
|
|
267
|
+
appointment: i,
|
|
263
268
|
rowId: m.id,
|
|
264
269
|
allowRowChange: !!n.allowRowChange,
|
|
265
270
|
scroller: d,
|
|
266
|
-
onPreview: (
|
|
267
|
-
onCommit: (
|
|
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
|
|
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((
|
|
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
|
-
|
|
281
|
+
v = { start: i.start, end: i.end, rowId: V.id };
|
|
277
282
|
} else {
|
|
278
|
-
const N = getComputedStyle(o).direction === "rtl", V =
|
|
283
|
+
const N = getComputedStyle(o).direction === "rtl", V = Ve(i, u.key, { view: $, rtl: N, snapMinutes: ue() });
|
|
279
284
|
if (!V) return;
|
|
280
|
-
|
|
285
|
+
v = { ...V, rowId: m.id };
|
|
281
286
|
}
|
|
282
|
-
u.preventDefault(), u.stopPropagation(),
|
|
283
|
-
})),
|
|
287
|
+
u.preventDefault(), u.stopPropagation(), me(i, m, v, "keyboard");
|
|
288
|
+
})), x.append(o);
|
|
284
289
|
}
|
|
285
|
-
f.append(
|
|
290
|
+
f.append(x), _.append(f);
|
|
286
291
|
}
|
|
287
|
-
d.append(
|
|
292
|
+
d.append(_), h.append(d);
|
|
288
293
|
}
|
|
289
|
-
U?.(), U =
|
|
290
|
-
const
|
|
291
|
-
if (
|
|
292
|
-
const d =
|
|
293
|
-
d && (d.focus(),
|
|
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
|
|
297
|
-
|
|
298
|
-
for (const e of
|
|
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 },
|
|
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
|
-
|
|
322
|
+
Ln as PlanningCalendar
|
|
314
323
|
};
|
|
315
324
|
//# sourceMappingURL=index112.js.map
|