@object-ui/layout 17.6.0 → 18.0.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/CHANGELOG.md +2006 -0
- package/README.md +35 -6
- package/dist/AppSchemaRenderer.d.ts +5 -7
- package/dist/AppShell.d.ts +28 -1
- package/dist/NavigationRenderer.d.ts +205 -37
- package/dist/PageHeader.d.ts +7 -6
- package/dist/ResponsiveGrid.d.ts +53 -18
- package/dist/index.js +821 -723
- package/dist/index.umd.cjs +1 -1
- package/dist/navOrder.d.ts +18 -0
- package/package.json +10 -12
package/dist/index.js
CHANGED
|
@@ -1,179 +1,143 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { Badge as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
//#region src/PageHeader.tsx
|
|
14
|
-
var _e = (e) => {
|
|
15
|
-
let t = e?.name ?? e?.full_name ?? e?.display_name ?? e?.label ?? e?.title ?? e?.subject;
|
|
16
|
-
return t != null && String(t).trim() ? String(t) : [
|
|
17
|
-
e?.salutation,
|
|
18
|
-
e?.first_name,
|
|
19
|
-
e?.last_name
|
|
20
|
-
].filter((e) => typeof e == "string" && e.trim()).map((e) => e.trim()).join(" ") || (typeof e?.email == "string" && e.email.trim() ? e.email.trim() : null);
|
|
21
|
-
}, ve = (e, t) => !e || typeof e != "string" ? e ?? "" : e.includes("{") ? e.replace(/\{([a-zA-Z0-9_.]+)\}/g, (e, n) => {
|
|
22
|
-
let r = n.split(".").reduce((e, t) => e == null ? e : e[t], t);
|
|
23
|
-
return r == null ? "" : typeof r == "object" ? _e(r) ?? "" : String(r);
|
|
24
|
-
}).replace(/\s*[-–—|/·,:]\s*(?=\s*[-–—|/·,:]|$)/g, "").replace(/^\s*[-–—|/·,:]\s*/, "").replace(/\s+/g, " ").trim() : e;
|
|
25
|
-
function ye({ title: e, subtitle: n, icon: r, action: i, actions: a, showBack: s, schema: c, className: l, children: u, ...f }) {
|
|
26
|
-
let p = R(), m = typeof e == "string" && /\{[a-zA-Z0-9_.]+\}/.test(e), h = ve(e, p?.data) || (m ? "" : e), g = n, _ = typeof g == "string" && /\{[a-zA-Z0-9_.]+\}/.test(g), v = ve(g, p?.data) || (_ ? "" : g), y = !!p?.recordId, b = !!p?.embedded, x = s ?? (y && !b), S = t.useCallback(() => {
|
|
27
|
-
if (typeof window > "u") return;
|
|
28
|
-
let e = window.location.pathname, t = e.replace(/\/record\/[^/]+\/?$/, "");
|
|
29
|
-
t === e ? window.history.length > 1 && window.history.back() : (window.history.pushState({}, "", t + window.location.search), window.dispatchEvent(new PopStateEvent("popstate")));
|
|
30
|
-
}, []), C = Array.isArray(c?.children) ? c.children.filter(Boolean).map((e, t) => /* @__PURE__ */ z(L, { schema: e }, e?.id || `pgh-child-${t}`)) : null, w = Array.isArray(a) && a.length > 0 && a || Array.isArray(c?.actions) && c.actions.length > 0 && c.actions || Array.isArray(c?.properties?.actions) && c.properties.actions.length > 0 && c.properties.actions || null, T = i || u || (w ? /* @__PURE__ */ z(L, { schema: {
|
|
31
|
-
type: "record:quick_actions",
|
|
32
|
-
properties: {
|
|
33
|
-
actions: w,
|
|
34
|
-
location: "record_header",
|
|
35
|
-
align: "end",
|
|
36
|
-
inline: !0
|
|
37
|
-
}
|
|
38
|
-
} }) : null) || C;
|
|
39
|
-
return /* @__PURE__ */ z("div", {
|
|
40
|
-
className: A("flex flex-col gap-3 pb-4 border-b", l),
|
|
41
|
-
...f,
|
|
42
|
-
children: /* @__PURE__ */ B("div", {
|
|
43
|
-
className: "flex flex-wrap items-center gap-x-4 gap-y-2",
|
|
44
|
-
children: [
|
|
45
|
-
x && /* @__PURE__ */ z(o, {
|
|
46
|
-
type: "button",
|
|
47
|
-
variant: "ghost",
|
|
48
|
-
size: "icon",
|
|
49
|
-
onClick: S,
|
|
50
|
-
"aria-label": "Back to list",
|
|
51
|
-
className: "flex-shrink-0 -ml-2",
|
|
52
|
-
children: /* @__PURE__ */ z(N, { className: "size-4" })
|
|
53
|
-
}),
|
|
54
|
-
r && (h || v) && /* @__PURE__ */ z("div", {
|
|
55
|
-
className: "flex-shrink-0 grid place-items-center size-10 rounded-md bg-primary/10 text-primary",
|
|
56
|
-
children: typeof r == "string" ? /* @__PURE__ */ z(d, {
|
|
57
|
-
name: r,
|
|
58
|
-
className: "size-5"
|
|
59
|
-
}) : r
|
|
60
|
-
}),
|
|
61
|
-
/* @__PURE__ */ B("div", {
|
|
62
|
-
className: "flex flex-col min-w-0 flex-1",
|
|
63
|
-
children: [h ? /* @__PURE__ */ z("h1", {
|
|
64
|
-
className: "text-2xl font-bold tracking-tight md:text-3xl truncate",
|
|
65
|
-
children: h
|
|
66
|
-
}) : null, v && /* @__PURE__ */ z("p", {
|
|
67
|
-
className: "text-sm text-muted-foreground truncate",
|
|
68
|
-
children: v
|
|
69
|
-
})]
|
|
70
|
-
}),
|
|
71
|
-
T && /* @__PURE__ */ z("div", {
|
|
72
|
-
className: "flex items-center gap-2 ml-auto",
|
|
73
|
-
children: T
|
|
74
|
-
})
|
|
75
|
-
]
|
|
76
|
-
})
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
//#endregion
|
|
1
|
+
import e, { createElement as t, useEffect as n, useMemo as r, useState as i } from "react";
|
|
2
|
+
import { ComponentRegistry as a } from "@object-ui/core";
|
|
3
|
+
import { Badge as o, Button as s, Collapsible as c, CollapsibleContent as l, CollapsibleTrigger as u, Input as d, LazyIcon as f, Separator as p, Sidebar as m, SidebarContent as h, SidebarFooter as g, SidebarGroup as _, SidebarGroupContent as v, SidebarGroupLabel as y, SidebarHeader as b, SidebarInput as x, SidebarInset as S, SidebarMenu as C, SidebarMenuAction as w, SidebarMenuButton as T, SidebarMenuItem as E, SidebarMenuSub as D, SidebarMenuSubButton as O, SidebarMenuSubItem as k, SidebarProvider as A, cn as j, getLazyIcon as M, useIsMobile as N } from "@object-ui/components";
|
|
4
|
+
import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
5
|
+
import { Link as L, NavLink as R, useLocation as z } from "react-router-dom";
|
|
6
|
+
import { ArrowLeft as B, ChevronRight as ee, FileText as te, Layers as V, Pin as ne, PinOff as re, Search as ie, Star as H } from "lucide-react";
|
|
7
|
+
import { menuItemToNavigationItem as ae } from "@object-ui/types";
|
|
8
|
+
import { resolveI18nLabel as U } from "@objectstack/spec/ui";
|
|
9
|
+
import { DndContext as oe, KeyboardSensor as W, PointerSensor as G, closestCenter as se, useDndContext as K, useSensor as q, useSensors as ce } from "@dnd-kit/core";
|
|
10
|
+
import { SortableContext as le, arrayMove as ue, sortableKeyboardCoordinates as de, useSortable as fe } from "@dnd-kit/sortable";
|
|
11
|
+
import { CSS as pe } from "@dnd-kit/utilities";
|
|
12
|
+
import { SchemaRenderer as me, isElementApiDataSourceShape as he, useRecordContext as ge } from "@object-ui/react";
|
|
80
13
|
//#region src/PageCard.tsx
|
|
81
|
-
function
|
|
82
|
-
return /* @__PURE__ */
|
|
83
|
-
className:
|
|
14
|
+
function _e({ className: e, children: t, ...n }) {
|
|
15
|
+
return /* @__PURE__ */ F("div", {
|
|
16
|
+
className: j("rounded-xl border bg-card text-card-foreground shadow", e),
|
|
84
17
|
...n,
|
|
85
|
-
children: /* @__PURE__ */
|
|
18
|
+
children: /* @__PURE__ */ F("div", {
|
|
86
19
|
className: "p-6",
|
|
87
20
|
children: t
|
|
88
21
|
})
|
|
89
22
|
});
|
|
90
23
|
}
|
|
91
24
|
//#endregion
|
|
92
|
-
//#region src/
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
6: "sm:grid-cols-6",
|
|
108
|
-
12: "sm:grid-cols-12"
|
|
109
|
-
},
|
|
110
|
-
md: {
|
|
111
|
-
1: "md:grid-cols-1",
|
|
112
|
-
2: "md:grid-cols-2",
|
|
113
|
-
3: "md:grid-cols-3",
|
|
114
|
-
4: "md:grid-cols-4",
|
|
115
|
-
6: "md:grid-cols-6",
|
|
116
|
-
12: "md:grid-cols-12"
|
|
117
|
-
},
|
|
118
|
-
lg: {
|
|
119
|
-
1: "lg:grid-cols-1",
|
|
120
|
-
2: "lg:grid-cols-2",
|
|
121
|
-
3: "lg:grid-cols-3",
|
|
122
|
-
4: "lg:grid-cols-4",
|
|
123
|
-
6: "lg:grid-cols-6",
|
|
124
|
-
12: "lg:grid-cols-12"
|
|
125
|
-
},
|
|
126
|
-
xl: {
|
|
127
|
-
1: "xl:grid-cols-1",
|
|
128
|
-
2: "xl:grid-cols-2",
|
|
129
|
-
3: "xl:grid-cols-3",
|
|
130
|
-
4: "xl:grid-cols-4",
|
|
131
|
-
6: "xl:grid-cols-6",
|
|
132
|
-
12: "xl:grid-cols-12"
|
|
133
|
-
},
|
|
134
|
-
"2xl": {
|
|
135
|
-
1: "2xl:grid-cols-1",
|
|
136
|
-
2: "2xl:grid-cols-2",
|
|
137
|
-
3: "2xl:grid-cols-3",
|
|
138
|
-
4: "2xl:grid-cols-4",
|
|
139
|
-
6: "2xl:grid-cols-6",
|
|
140
|
-
12: "2xl:grid-cols-12"
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
function Se(e) {
|
|
144
|
-
if (!e) return "grid-cols-1";
|
|
145
|
-
let t = [];
|
|
146
|
-
for (let [n, r] of Object.entries(e)) {
|
|
147
|
-
let e = xe[n];
|
|
148
|
-
if (e && r) {
|
|
149
|
-
let n = Object.keys(e).map(Number).reduce((e, t) => Math.abs(t - r) < Math.abs(e - r) ? t : e);
|
|
150
|
-
t.push(e[n]);
|
|
25
|
+
//#region src/AppShell.tsx
|
|
26
|
+
function ve(e) {
|
|
27
|
+
let t = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
|
|
28
|
+
if (!t) return null;
|
|
29
|
+
let n = parseInt(t[1], 16) / 255, r = parseInt(t[2], 16) / 255, i = parseInt(t[3], 16) / 255, a = Math.max(n, r, i), o = Math.min(n, r, i), s = 0, c = 0, l = (a + o) / 2;
|
|
30
|
+
if (a !== o) {
|
|
31
|
+
let e = a - o;
|
|
32
|
+
switch (c = l > .5 ? e / (2 - a - o) : e / (a + o), a) {
|
|
33
|
+
case n:
|
|
34
|
+
s = ((r - i) / e + (r < i ? 6 : 0)) / 6;
|
|
35
|
+
break;
|
|
36
|
+
case r:
|
|
37
|
+
s = ((i - n) / e + 2) / 6;
|
|
38
|
+
break;
|
|
39
|
+
case i: s = ((n - r) / e + 4) / 6;
|
|
151
40
|
}
|
|
152
41
|
}
|
|
153
|
-
return
|
|
42
|
+
return {
|
|
43
|
+
h: s * 360,
|
|
44
|
+
s: c * 100,
|
|
45
|
+
l: l * 100
|
|
46
|
+
};
|
|
154
47
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
48
|
+
function ye(e) {
|
|
49
|
+
let t = ve(e);
|
|
50
|
+
return t ? `${Math.round(t.h)} ${Math.round(t.s)}% ${Math.round(t.l)}%` : null;
|
|
51
|
+
}
|
|
52
|
+
function be(e) {
|
|
53
|
+
let t = ve(e);
|
|
54
|
+
if (!t) return null;
|
|
55
|
+
let n = Math.max(t.l, 65), r = t.s > 80 ? Math.max(t.s - 10, 70) : t.s;
|
|
56
|
+
return `${Math.round(t.h)} ${Math.round(r)}% ${Math.round(n)}%`;
|
|
57
|
+
}
|
|
58
|
+
function xe(e) {
|
|
59
|
+
let t = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
|
|
60
|
+
if (!t) return "0 0% 100%";
|
|
61
|
+
let n = (e) => {
|
|
62
|
+
let t = e / 255;
|
|
63
|
+
return t <= .03928 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
64
|
+
}, r = n(parseInt(t[1], 16)), i = n(parseInt(t[2], 16)), a = n(parseInt(t[3], 16));
|
|
65
|
+
return .2126 * r + .7152 * i + .0722 * a > .6 ? "222 47% 11%" : "0 0% 100%";
|
|
66
|
+
}
|
|
67
|
+
function Se(e, t) {
|
|
68
|
+
n(() => {
|
|
69
|
+
let n = document.documentElement, r = () => n.classList.contains("dark"), i = () => {
|
|
70
|
+
if (e?.primaryColor) {
|
|
71
|
+
let t = ye(e.primaryColor), i = be(e.primaryColor), a = r() && i || t;
|
|
72
|
+
a && (n.style.setProperty("--brand-primary", e.primaryColor), n.style.setProperty("--brand-primary-hsl", t || a), n.style.setProperty("--primary", a), n.style.setProperty("--primary-foreground", r() ? "222 47% 11%" : xe(e.primaryColor)), n.style.setProperty("--ring", a), n.style.setProperty("--sidebar-primary", a), n.style.setProperty("--sidebar-ring", a));
|
|
73
|
+
} else n.style.removeProperty("--brand-primary"), n.style.removeProperty("--brand-primary-hsl"), n.style.removeProperty("--primary"), n.style.removeProperty("--primary-foreground"), n.style.removeProperty("--ring"), n.style.removeProperty("--sidebar-primary"), n.style.removeProperty("--sidebar-ring");
|
|
74
|
+
if (e?.accentColor) {
|
|
75
|
+
let t = ye(e.accentColor), i = be(e.accentColor), a = r() && i || t;
|
|
76
|
+
a && (n.style.setProperty("--brand-accent", e.accentColor), n.style.setProperty("--brand-accent-hsl", t || a), n.style.setProperty("--accent", a), n.style.setProperty("--accent-foreground", r() ? "222 47% 11%" : xe(e.accentColor)));
|
|
77
|
+
} else n.style.removeProperty("--brand-accent"), n.style.removeProperty("--brand-accent-hsl"), n.style.removeProperty("--accent"), n.style.removeProperty("--accent-foreground");
|
|
78
|
+
};
|
|
79
|
+
i();
|
|
80
|
+
let a = new MutationObserver((e) => {
|
|
81
|
+
for (let t of e) if (t.type === "attributes" && t.attributeName === "class") {
|
|
82
|
+
i();
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
a.observe(n, {
|
|
87
|
+
attributes: !0,
|
|
88
|
+
attributeFilter: ["class"]
|
|
89
|
+
});
|
|
90
|
+
let o = null, s = null;
|
|
91
|
+
if (e?.favicon) {
|
|
92
|
+
let t = document.querySelector("#favicon") || document.querySelector("link[rel=\"icon\"]");
|
|
93
|
+
t && (o = t, s = t.getAttribute("href"), t.href = e.favicon);
|
|
94
|
+
}
|
|
95
|
+
let c = null;
|
|
96
|
+
return t && (c = document.title, document.title = t), () => {
|
|
97
|
+
a.disconnect(), c !== null && (document.title = c), o && (s === null ? o.removeAttribute("href") : o.setAttribute("href", s)), n.style.removeProperty("--brand-primary"), n.style.removeProperty("--brand-primary-hsl"), n.style.removeProperty("--brand-accent"), n.style.removeProperty("--brand-accent-hsl"), n.style.removeProperty("--primary"), n.style.removeProperty("--primary-foreground"), n.style.removeProperty("--ring"), n.style.removeProperty("--sidebar-primary"), n.style.removeProperty("--sidebar-ring"), n.style.removeProperty("--accent"), n.style.removeProperty("--accent-foreground");
|
|
98
|
+
};
|
|
99
|
+
}, [
|
|
100
|
+
e?.primaryColor,
|
|
101
|
+
e?.accentColor,
|
|
102
|
+
e?.favicon,
|
|
103
|
+
t
|
|
104
|
+
]);
|
|
105
|
+
}
|
|
106
|
+
function Ce({ sidebar: e, navbar: t, children: n, className: r, defaultOpen: i = !0, branding: a, rightRail: o }) {
|
|
107
|
+
return Se(a, a?.title), /* @__PURE__ */ I(A, {
|
|
108
|
+
defaultOpen: i,
|
|
109
|
+
className: "!flex-col h-svh overflow-hidden",
|
|
110
|
+
children: [/* @__PURE__ */ F("header", {
|
|
111
|
+
className: "sticky top-0 z-30 flex h-12 w-full shrink-0 items-center gap-2 border-b bg-background px-2 sm:px-4",
|
|
112
|
+
children: t
|
|
113
|
+
}), /* @__PURE__ */ I("div", {
|
|
114
|
+
className: "flex flex-1 min-h-0 w-full",
|
|
115
|
+
children: [
|
|
116
|
+
e,
|
|
117
|
+
/* @__PURE__ */ F(S, {
|
|
118
|
+
className: "min-w-0",
|
|
119
|
+
children: /* @__PURE__ */ F("main", {
|
|
120
|
+
className: j("flex-1 min-w-0 overflow-auto p-3 sm:p-4 md:p-6 pb-20 sm:pb-4 md:pb-6", r),
|
|
121
|
+
children: n
|
|
122
|
+
})
|
|
123
|
+
}),
|
|
124
|
+
o
|
|
125
|
+
]
|
|
126
|
+
})]
|
|
169
127
|
});
|
|
170
|
-
}
|
|
128
|
+
}
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region src/navOrder.ts
|
|
131
|
+
function we(e, t) {
|
|
132
|
+
return (e.order ?? 0) - (t.order ?? 0);
|
|
133
|
+
}
|
|
171
134
|
//#endregion
|
|
172
135
|
//#region src/NavigationRenderer.tsx
|
|
173
|
-
|
|
174
|
-
|
|
136
|
+
var Te = "group-data-[state=collapsed]:group-data-[collapsible=icon]:pointer-events-none", Ee = "group-data-[state=collapsed]:group-data-[collapsible=icon]:invisible group-data-[state=collapsed]:group-data-[collapsible=icon]:transition-[margin,opacity,visibility]";
|
|
137
|
+
function J(e) {
|
|
138
|
+
return e ? M(e) : te;
|
|
175
139
|
}
|
|
176
|
-
function
|
|
140
|
+
function De(e, t) {
|
|
177
141
|
if (typeof e == "string") return e;
|
|
178
142
|
if (t) {
|
|
179
143
|
let n = t(e.key, {
|
|
@@ -184,53 +148,106 @@ function q(e, t) {
|
|
|
184
148
|
}
|
|
185
149
|
return e.defaultValue || e.key;
|
|
186
150
|
}
|
|
187
|
-
function
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
151
|
+
function Y(e, t, n, r) {
|
|
152
|
+
return e.type === "separator" ? "" : e.label === void 0 ? Ae(e, n) : Oe(e.label, t, r);
|
|
153
|
+
}
|
|
154
|
+
function Oe(e, t, n) {
|
|
155
|
+
return typeof e == "string" ? e : ke(e) ? De(e, t) : U(e, n) ?? "";
|
|
156
|
+
}
|
|
157
|
+
function ke(e) {
|
|
158
|
+
return typeof e == "object" && !!e && ("key" in e || "defaultValue" in e);
|
|
159
|
+
}
|
|
160
|
+
function Ae(e, t) {
|
|
161
|
+
let n = (e) => {
|
|
162
|
+
let n = t?.(e);
|
|
163
|
+
return typeof n == "string" && n.trim() !== "" ? n : void 0;
|
|
164
|
+
};
|
|
165
|
+
switch (e.type) {
|
|
166
|
+
case "object":
|
|
167
|
+
if (!e.objectName) break;
|
|
168
|
+
return e.viewName ? n({
|
|
169
|
+
kind: "view",
|
|
170
|
+
objectName: e.objectName,
|
|
171
|
+
viewName: e.viewName
|
|
172
|
+
}) ?? n({
|
|
173
|
+
kind: "object",
|
|
174
|
+
objectName: e.objectName
|
|
175
|
+
}) ?? e.viewName : n({
|
|
176
|
+
kind: "object",
|
|
177
|
+
objectName: e.objectName
|
|
178
|
+
}) ?? e.objectName;
|
|
179
|
+
case "dashboard":
|
|
180
|
+
if (!e.dashboardName) break;
|
|
181
|
+
return n({
|
|
182
|
+
kind: "dashboard",
|
|
183
|
+
dashboardName: e.dashboardName
|
|
184
|
+
}) ?? e.dashboardName;
|
|
185
|
+
case "page":
|
|
186
|
+
if (e.pageName) return e.pageName;
|
|
187
|
+
break;
|
|
188
|
+
case "report":
|
|
189
|
+
if (e.reportName) return e.reportName;
|
|
190
|
+
break;
|
|
191
|
+
case "url":
|
|
192
|
+
if (e.url) return e.url;
|
|
193
|
+
break;
|
|
194
|
+
case "component":
|
|
195
|
+
if (e.componentRef) return e.componentRef;
|
|
196
|
+
break;
|
|
197
|
+
case "action":
|
|
198
|
+
if (e.actionDef?.actionName) return e.actionDef.actionName;
|
|
199
|
+
break;
|
|
200
|
+
case "doc":
|
|
201
|
+
if (e.doc) return e.doc;
|
|
202
|
+
if (e.book) return e.book;
|
|
199
203
|
}
|
|
200
|
-
return
|
|
204
|
+
return e.id;
|
|
205
|
+
}
|
|
206
|
+
var je = (e, t) => !(t && he(t.dataSource) || e === !1 || e === "false"), Me = () => !0, Ne = () => !0;
|
|
207
|
+
function Pe(e, t) {
|
|
208
|
+
let { evaluateVisibility: n = je, checkPermission: r = Me, checkCapability: i = Ne, checkDocTarget: a } = t;
|
|
209
|
+
if (!n(e.visible, e) || e.requiredPermissions?.length && !r(e.requiredPermissions)) return !1;
|
|
210
|
+
let o = e.requiresObject, s = e.requiresService;
|
|
211
|
+
return !(o && !i("object", o) || s && !i("service", s) || e.type === "doc" && a && !a({
|
|
212
|
+
book: e.book,
|
|
213
|
+
doc: e.doc
|
|
214
|
+
}));
|
|
201
215
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
let
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
if (J(o.children ?? [], t)) return !0;
|
|
216
|
+
function X(e, t = {}) {
|
|
217
|
+
let { hasActionHandler: n = !1 } = t;
|
|
218
|
+
for (let r of e) if (Pe(r, t) && r.type !== "separator") {
|
|
219
|
+
if (r.type === "group") {
|
|
220
|
+
if (X(r.children ?? [], t)) return !0;
|
|
208
221
|
continue;
|
|
209
222
|
}
|
|
210
|
-
if (
|
|
223
|
+
if (r.type !== "action" || n) return !0;
|
|
211
224
|
}
|
|
212
225
|
return !1;
|
|
213
226
|
}
|
|
214
|
-
var
|
|
215
|
-
function
|
|
227
|
+
var Fe = /\{(current_user_id|current_org_id|[a-z][a-z0-9_]*)\}/g;
|
|
228
|
+
function Z(e, t) {
|
|
216
229
|
if (!e.includes("{")) return e;
|
|
217
|
-
let n = !1, r = e.replace(
|
|
230
|
+
let n = !1, r = e.replace(Fe, (e, r) => {
|
|
218
231
|
let i;
|
|
219
232
|
return i = r === "current_user_id" ? t?.currentUserId : r === "current_org_id" ? t?.currentOrgId : t?.contextValues?.[r], i || (n = !0, "");
|
|
220
233
|
});
|
|
221
234
|
return n ? null : r;
|
|
222
235
|
}
|
|
223
|
-
var
|
|
224
|
-
function
|
|
236
|
+
var Ie = "runAction";
|
|
237
|
+
function Le(e, t) {
|
|
225
238
|
let n = t.runAction;
|
|
226
|
-
return typeof n != "string" || n === "" ? e : `${e}${e.includes("?") ? "&" : "?"}${
|
|
239
|
+
return typeof n != "string" || n === "" ? e : `${e}${e.includes("?") ? "&" : "?"}${Ie}=${encodeURIComponent(n)}`;
|
|
227
240
|
}
|
|
228
|
-
function
|
|
241
|
+
function Re(e, t, n) {
|
|
242
|
+
let r = (e) => encodeURIComponent(e);
|
|
243
|
+
return e && t ? `${n}/docs/${r(e)}/${r(t)}` : t ? `${n}/docs/${r(t)}` : e ? `${n}/docs/${r(e)}` : "#";
|
|
244
|
+
}
|
|
245
|
+
function Q(e, t, n) {
|
|
229
246
|
switch (e.type) {
|
|
230
247
|
case "object": {
|
|
231
248
|
let r = `${t}/${e.objectName ?? ""}`, i = e.recordId;
|
|
232
249
|
if (i) {
|
|
233
|
-
let t =
|
|
250
|
+
let t = Z(i, n);
|
|
234
251
|
if (t) {
|
|
235
252
|
let n = `${r}/record/${encodeURIComponent(t)}`;
|
|
236
253
|
return {
|
|
@@ -244,17 +261,17 @@ function X(e, t, n) {
|
|
|
244
261
|
let t = new URLSearchParams();
|
|
245
262
|
for (let [e, r] of Object.entries(a)) {
|
|
246
263
|
if (r == null || e === "") continue;
|
|
247
|
-
let i =
|
|
264
|
+
let i = Z(String(r), n);
|
|
248
265
|
i !== null && t.set(`filter[${e}]`, i);
|
|
249
266
|
}
|
|
250
267
|
let i = t.toString();
|
|
251
268
|
return {
|
|
252
|
-
href:
|
|
269
|
+
href: Le(i ? `${r}/data?${i}` : `${r}/data`, e),
|
|
253
270
|
external: !1
|
|
254
271
|
};
|
|
255
272
|
}
|
|
256
273
|
return {
|
|
257
|
-
href:
|
|
274
|
+
href: Le(e.viewName ? `${r}/view/${e.viewName}` : r, e),
|
|
258
275
|
external: !1
|
|
259
276
|
};
|
|
260
277
|
}
|
|
@@ -272,7 +289,7 @@ function X(e, t, n) {
|
|
|
272
289
|
let e = new URLSearchParams();
|
|
273
290
|
for (let [t, i] of Object.entries(r)) if (i != null) {
|
|
274
291
|
if (typeof i == "string") {
|
|
275
|
-
let r =
|
|
292
|
+
let r = Z(i, n);
|
|
276
293
|
r !== null && e.set(t, r);
|
|
277
294
|
} else e.set(t, JSON.stringify(i));
|
|
278
295
|
}
|
|
@@ -310,7 +327,7 @@ function X(e, t, n) {
|
|
|
310
327
|
let e = new URLSearchParams();
|
|
311
328
|
for (let [t, r] of Object.entries(a)) if (t !== "type" && t !== "name" && r != null) {
|
|
312
329
|
if (typeof r == "string") {
|
|
313
|
-
let i =
|
|
330
|
+
let i = Z(r, n);
|
|
314
331
|
i && e.set(t, i);
|
|
315
332
|
} else e.set(t, JSON.stringify(r));
|
|
316
333
|
}
|
|
@@ -340,33 +357,37 @@ function X(e, t, n) {
|
|
|
340
357
|
external: !1
|
|
341
358
|
};
|
|
342
359
|
}
|
|
360
|
+
case "doc": return {
|
|
361
|
+
href: Re(e.book, e.doc, t),
|
|
362
|
+
external: !1
|
|
363
|
+
};
|
|
343
364
|
default: return {
|
|
344
365
|
href: "#",
|
|
345
366
|
external: !1
|
|
346
367
|
};
|
|
347
368
|
}
|
|
348
369
|
}
|
|
349
|
-
var
|
|
350
|
-
function
|
|
370
|
+
var ze = 50, Be = 40, Ve = 30, He = 25, Ue = 10, We = 5;
|
|
371
|
+
function Ge(e) {
|
|
351
372
|
let t = /* @__PURE__ */ new Map();
|
|
352
373
|
return new URLSearchParams(e).forEach((e, n) => {
|
|
353
374
|
let r = /^filter\[(.+)\]$/.exec(n);
|
|
354
375
|
r && r[1] && e !== "" && t.set(r[1], e);
|
|
355
376
|
}), t;
|
|
356
377
|
}
|
|
357
|
-
function
|
|
378
|
+
function Ke(e, t) {
|
|
358
379
|
return t.startsWith(`${e}.`) ? t.slice(e.length + 1) : t;
|
|
359
380
|
}
|
|
360
|
-
function
|
|
361
|
-
let { href: a, external: o } =
|
|
381
|
+
function qe(e, t, n, r, i) {
|
|
382
|
+
let { href: a, external: o } = Q(e, r, i);
|
|
362
383
|
if (o || a === "#") return 0;
|
|
363
384
|
if (e.type === "object" && e.objectName) {
|
|
364
385
|
let a = `${r}/${e.objectName}`;
|
|
365
386
|
if (t !== a && !t.startsWith(`${a}/`)) return 0;
|
|
366
387
|
let o = t === a ? [] : t.slice(a.length + 1).split("/"), s = e.recordId;
|
|
367
388
|
if (s) {
|
|
368
|
-
let e =
|
|
369
|
-
if (e) return o[0] === "record" && decodeURIComponent(o[1] ?? "") === e ?
|
|
389
|
+
let e = Z(s, i);
|
|
390
|
+
if (e) return o[0] === "record" && decodeURIComponent(o[1] ?? "") === e ? ze : 0;
|
|
370
391
|
}
|
|
371
392
|
let c = e.filters;
|
|
372
393
|
if (c && typeof c == "object" && !Array.isArray(c)) {
|
|
@@ -374,583 +395,633 @@ function Be(e, t, n, r, i) {
|
|
|
374
395
|
let e = /* @__PURE__ */ new Map();
|
|
375
396
|
for (let [t, n] of Object.entries(c)) {
|
|
376
397
|
if (n == null || t === "") continue;
|
|
377
|
-
let r =
|
|
398
|
+
let r = Z(String(n), i);
|
|
378
399
|
r !== null && e.set(t, r);
|
|
379
400
|
}
|
|
380
401
|
if (e.size !== n.size) return 0;
|
|
381
402
|
for (let [t, r] of e) if (n.get(t) !== r) return 0;
|
|
382
|
-
return
|
|
403
|
+
return Be;
|
|
383
404
|
}
|
|
384
|
-
return e.viewName ? o[0] !== "view" || !o[1] ? 0 :
|
|
405
|
+
return e.viewName ? o[0] !== "view" || !o[1] ? 0 : Ke(e.objectName, decodeURIComponent(o[1])) === Ke(e.objectName, e.viewName) ? Ve : 0 : o.length === 0 ? He : Ue;
|
|
385
406
|
}
|
|
386
407
|
let s = a.split("?")[0];
|
|
387
|
-
if (t === s) return
|
|
408
|
+
if (t === s) return He;
|
|
388
409
|
let c = e.componentRef;
|
|
389
|
-
return c && c.split(":")[1] === "directory" ? 0 : t.startsWith(`${s}/`) ?
|
|
410
|
+
return c && c.split(":")[1] === "directory" ? 0 : t.startsWith(`${s}/`) ? We : 0;
|
|
390
411
|
}
|
|
391
|
-
function
|
|
392
|
-
let a =
|
|
412
|
+
function Je(e, t, n, r, i) {
|
|
413
|
+
let a = Ge(n), o = null, s = 0, c = (e) => {
|
|
393
414
|
if (e) for (let n of e) {
|
|
394
415
|
if (n.type === "group") {
|
|
395
416
|
c(n.children);
|
|
396
417
|
continue;
|
|
397
418
|
}
|
|
398
|
-
let e =
|
|
419
|
+
let e = qe(n, t, a, r, i);
|
|
399
420
|
e > s && (o = n, s = e);
|
|
400
421
|
}
|
|
401
422
|
};
|
|
402
423
|
return c(e), o;
|
|
403
424
|
}
|
|
404
|
-
var
|
|
405
|
-
function
|
|
425
|
+
var Ye = e.createContext(null);
|
|
426
|
+
function Xe(e, t, n = (e) => Y(e)) {
|
|
406
427
|
if (!t.trim()) return e;
|
|
407
|
-
let
|
|
408
|
-
return e.reduce((e,
|
|
409
|
-
if (
|
|
410
|
-
if (
|
|
411
|
-
let
|
|
412
|
-
return
|
|
413
|
-
...
|
|
414
|
-
children:
|
|
428
|
+
let r = t.toLowerCase().trim();
|
|
429
|
+
return e.reduce((e, i) => {
|
|
430
|
+
if (i.type === "separator") return e;
|
|
431
|
+
if (i.type === "group" && i.children?.length) {
|
|
432
|
+
let r = Xe(i.children, t, n);
|
|
433
|
+
return r.length > 0 && e.push({
|
|
434
|
+
...i,
|
|
435
|
+
children: r
|
|
415
436
|
}), e;
|
|
416
437
|
}
|
|
417
|
-
return
|
|
438
|
+
return n(i).toLowerCase().includes(r) && e.push(i), e;
|
|
418
439
|
}, []);
|
|
419
440
|
}
|
|
420
|
-
var
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
};
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
441
|
+
var Ze = 5, Qe = {
|
|
442
|
+
coordinateGetter: de,
|
|
443
|
+
keyboardCodes: {
|
|
444
|
+
start: ["Space"],
|
|
445
|
+
cancel: ["Escape"],
|
|
446
|
+
end: ["Space"]
|
|
447
|
+
}
|
|
448
|
+
}, $e = () => null, et = (e) => e.activatorEvent?.type === "keydown";
|
|
449
|
+
function tt() {
|
|
450
|
+
let e = (e) => e.preventDefault();
|
|
451
|
+
window.addEventListener("click", e, { capture: !0 }), window.setTimeout(() => window.removeEventListener("click", e, { capture: !0 }), 50);
|
|
452
|
+
}
|
|
453
|
+
function nt({ items: e, onReorder: t, rowProps: n }) {
|
|
454
|
+
let r = ce(q(G, { activationConstraint: { distance: Ze } }), q(W, Qe)), i = e.map((e) => e.id);
|
|
455
|
+
return /* @__PURE__ */ F(oe, {
|
|
456
|
+
id: "nav-pinned",
|
|
457
|
+
sensors: r,
|
|
458
|
+
collisionDetection: se,
|
|
459
|
+
onDragEnd: (e) => {
|
|
460
|
+
et(e) || tt();
|
|
461
|
+
let { active: n, over: r } = e;
|
|
462
|
+
if (!r || n.id === r.id) return;
|
|
463
|
+
let a = i.indexOf(String(n.id)), o = i.indexOf(String(r.id));
|
|
464
|
+
a !== -1 && o !== -1 && t(ue(i, a, o));
|
|
465
|
+
},
|
|
466
|
+
onDragCancel: (e) => {
|
|
467
|
+
et(e) || tt();
|
|
468
|
+
},
|
|
469
|
+
children: /* @__PURE__ */ F(le, {
|
|
470
|
+
items: i,
|
|
471
|
+
strategy: $e,
|
|
472
|
+
children: /* @__PURE__ */ F(C, { children: e.map((e) => /* @__PURE__ */ F(it, {
|
|
473
|
+
item: e,
|
|
474
|
+
rowProps: n
|
|
475
|
+
}, `fav-${e.id}`)) })
|
|
450
476
|
})
|
|
451
477
|
});
|
|
452
478
|
}
|
|
453
|
-
function
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
479
|
+
function rt(e) {
|
|
480
|
+
return {
|
|
481
|
+
ref: e.ref,
|
|
482
|
+
...e.listeners,
|
|
483
|
+
"aria-describedby": e.describedBy,
|
|
484
|
+
onKeyUp: (e) => {
|
|
485
|
+
e.code === "Space" && e.preventDefault();
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
function it({ item: e, rowProps: t }) {
|
|
490
|
+
let { attributes: n, listeners: r, setNodeRef: i, setActivatorNodeRef: a, transform: o, transition: s, isDragging: c, isOver: l, activeIndex: u, index: d } = fe({ id: e.id }), { activatorEvent: f } = K(), p = {
|
|
491
|
+
transform: c && f?.type === "keydown" ? void 0 : pe.Transform.toString(o),
|
|
492
|
+
transition: s,
|
|
493
|
+
opacity: c ? .5 : void 0,
|
|
494
|
+
zIndex: c ? 10 : void 0
|
|
495
|
+
}, m = l && !c && u !== -1 ? u < d ? "after" : "before" : null;
|
|
496
|
+
return /* @__PURE__ */ F($, {
|
|
497
|
+
item: e,
|
|
498
|
+
...t,
|
|
499
|
+
dragActivator: {
|
|
500
|
+
ref: a,
|
|
501
|
+
listeners: r,
|
|
502
|
+
describedBy: n["aria-describedby"]
|
|
503
|
+
},
|
|
504
|
+
row: {
|
|
505
|
+
ref: i,
|
|
506
|
+
style: p,
|
|
507
|
+
dropIndicator: m
|
|
508
|
+
}
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
function at({ at: e }) {
|
|
512
|
+
return /* @__PURE__ */ F("span", {
|
|
513
|
+
"aria-hidden": "true",
|
|
514
|
+
"data-drop-indicator": e,
|
|
515
|
+
className: j("pointer-events-none absolute inset-x-2 h-0.5 rounded-full bg-primary", e === "before" ? "-top-px" : "-bottom-px")
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
function $({ item: t, basePath: n, evalVis: r, checkPerm: a, checkCap: s, checkDocTarget: d, onAction: f, enablePinning: m, onPinToggle: h, renderItemAction: g, dragActivator: b, row: x, inList: S = !0, resolveTargetLabel: D, locale: O, t: k, templateContext: A }) {
|
|
519
|
+
let M = N(), R = M ? "min-h-[44px] text-[15px] gap-3 rounded-xl" : void 0, z = j("shrink-0", M ? "h-5 w-5" : "h-4 w-4"), B = (() => {
|
|
520
|
+
if (typeof t.expanded == "boolean") return t.expanded;
|
|
521
|
+
if (typeof t.defaultOpen == "boolean") return t.defaultOpen;
|
|
522
|
+
})(), te = t.type === "group" ? t.children?.length ?? 0 : 0, V = e.useContext(Ye), ie = e.useMemo(() => {
|
|
523
|
+
if (t.type !== "group" || !V) return !1;
|
|
524
|
+
let e = (t) => !!t?.some((t) => t.id === V || t.type === "group" && e(t.children));
|
|
525
|
+
return e(t.children);
|
|
526
|
+
}, [t, V]) ? !0 : B ?? !(te >= 8), [H, ae] = i(ie), U = {
|
|
527
|
+
evaluateVisibility: r,
|
|
528
|
+
checkPermission: a,
|
|
529
|
+
checkCapability: s,
|
|
530
|
+
checkDocTarget: d,
|
|
531
|
+
hasActionHandler: !!f
|
|
532
|
+
};
|
|
533
|
+
if (!Pe(t, U)) return null;
|
|
534
|
+
if (t.type === "separator") return /* @__PURE__ */ F("li", {
|
|
535
|
+
"aria-hidden": "true",
|
|
536
|
+
children: /* @__PURE__ */ F(p, { className: "my-2" })
|
|
537
|
+
});
|
|
538
|
+
if (t.type === "group") {
|
|
539
|
+
let e = (t.children ?? []).slice().sort(we);
|
|
540
|
+
if (!X(e, U)) return null;
|
|
541
|
+
let i = Y(t, k, D, O), o = {
|
|
542
|
+
basePath: n,
|
|
543
|
+
evalVis: r,
|
|
544
|
+
checkPerm: a,
|
|
545
|
+
checkCap: s,
|
|
546
|
+
checkDocTarget: d,
|
|
547
|
+
onAction: f,
|
|
548
|
+
enablePinning: m,
|
|
549
|
+
onPinToggle: h,
|
|
550
|
+
renderItemAction: g,
|
|
551
|
+
resolveTargetLabel: D,
|
|
552
|
+
locale: O,
|
|
553
|
+
t: k,
|
|
554
|
+
templateContext: A
|
|
555
|
+
}, p = /* @__PURE__ */ F(c, {
|
|
556
|
+
open: H,
|
|
557
|
+
onOpenChange: ae,
|
|
558
|
+
children: /* @__PURE__ */ I(_, { children: [/* @__PURE__ */ F(y, {
|
|
472
559
|
asChild: !0,
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
560
|
+
className: j(Te, Ee),
|
|
561
|
+
children: /* @__PURE__ */ I(u, {
|
|
562
|
+
className: j("flex w-full items-center justify-between", M && "min-h-[44px] text-[15px] rounded-xl"),
|
|
563
|
+
children: [i, /* @__PURE__ */ F(ee, { className: j("ml-auto transition-transform", M ? "h-5 w-5" : "h-4 w-4", H && "rotate-90") })]
|
|
476
564
|
})
|
|
477
|
-
}), /* @__PURE__ */
|
|
565
|
+
}), /* @__PURE__ */ F(l, { children: /* @__PURE__ */ F(v, { children: /* @__PURE__ */ F(C, { children: e.map((e) => /* @__PURE__ */ F($, {
|
|
478
566
|
item: e,
|
|
479
|
-
|
|
480
|
-
evalVis: r,
|
|
481
|
-
checkPerm: o,
|
|
482
|
-
checkCap: u,
|
|
483
|
-
onAction: d,
|
|
484
|
-
enablePinning: p,
|
|
485
|
-
onPinToggle: m,
|
|
486
|
-
resolveObjectLabel: y,
|
|
487
|
-
resolveDashboardLabel: b,
|
|
488
|
-
resolveViewLabel: x,
|
|
489
|
-
t: E,
|
|
490
|
-
templateContext: D
|
|
567
|
+
...o
|
|
491
568
|
}, e.id)) }) }) })] })
|
|
492
569
|
});
|
|
570
|
+
return S ? /* @__PURE__ */ F("li", { children: p }) : p;
|
|
493
571
|
}
|
|
494
|
-
if (
|
|
495
|
-
if (!
|
|
496
|
-
let
|
|
497
|
-
return /* @__PURE__ */
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
572
|
+
if (t.type === "action") {
|
|
573
|
+
if (!f) return null;
|
|
574
|
+
let e = J(t.icon), r = Y(t, k, D, O);
|
|
575
|
+
return /* @__PURE__ */ I(E, {
|
|
576
|
+
ref: x?.ref,
|
|
577
|
+
style: x?.style,
|
|
578
|
+
children: [
|
|
579
|
+
x?.dropIndicator && /* @__PURE__ */ F(at, { at: x.dropIndicator }),
|
|
580
|
+
/* @__PURE__ */ I(T, {
|
|
581
|
+
tooltip: r,
|
|
582
|
+
onClick: () => f?.(t),
|
|
583
|
+
className: j(R, b && "cursor-grab"),
|
|
584
|
+
...b ? rt(b) : {},
|
|
585
|
+
children: [
|
|
586
|
+
/* @__PURE__ */ F(e, { className: z }),
|
|
587
|
+
/* @__PURE__ */ F("span", { children: r }),
|
|
588
|
+
t.badge != null && /* @__PURE__ */ F(o, {
|
|
589
|
+
variant: t.badgeVariant ?? "default",
|
|
590
|
+
className: "ml-auto text-[10px] px-1.5 py-0",
|
|
591
|
+
children: t.badge
|
|
592
|
+
})
|
|
593
|
+
]
|
|
594
|
+
}),
|
|
595
|
+
g ? g(t, {
|
|
596
|
+
external: !1,
|
|
597
|
+
label: r,
|
|
598
|
+
basePath: n
|
|
599
|
+
}) : m && h && /* @__PURE__ */ F(w, {
|
|
600
|
+
showOnHover: !0,
|
|
601
|
+
onClick: () => h(t.id, !t.pinned, t, n),
|
|
602
|
+
"aria-label": k ? k(t.pinned ? "console.nav.unpinItem" : "console.nav.pinItem", {
|
|
603
|
+
defaultValue: t.pinned ? `Unpin ${r}` : `Pin ${r}`,
|
|
604
|
+
name: r
|
|
605
|
+
}) : t.pinned ? `Unpin ${r}` : `Pin ${r}`,
|
|
606
|
+
children: t.pinned ? /* @__PURE__ */ F(re, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ F(ne, { className: "h-3.5 w-3.5" })
|
|
607
|
+
})
|
|
608
|
+
]
|
|
609
|
+
});
|
|
528
610
|
}
|
|
529
|
-
let
|
|
530
|
-
/* @__PURE__ */
|
|
531
|
-
/* @__PURE__ */
|
|
532
|
-
|
|
533
|
-
variant:
|
|
611
|
+
let oe = J(t.icon), { href: W, external: G } = Q(t, n, A), se = V !== null && t.id === V, K = Y(t, k, D, O), q = /* @__PURE__ */ I(P, { children: [
|
|
612
|
+
/* @__PURE__ */ F(oe, { className: z }),
|
|
613
|
+
/* @__PURE__ */ F("span", { children: K }),
|
|
614
|
+
t.badge != null && /* @__PURE__ */ F(o, {
|
|
615
|
+
variant: t.badgeVariant ?? "default",
|
|
534
616
|
className: "ml-auto text-[10px] px-1.5 py-0",
|
|
535
|
-
children:
|
|
617
|
+
children: t.badge
|
|
536
618
|
})
|
|
537
|
-
] });
|
|
538
|
-
return /* @__PURE__ */
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
619
|
+
] }), ce = b ? rt(b) : {};
|
|
620
|
+
return /* @__PURE__ */ I(E, {
|
|
621
|
+
ref: x?.ref,
|
|
622
|
+
style: x?.style,
|
|
623
|
+
children: [
|
|
624
|
+
x?.dropIndicator && /* @__PURE__ */ F(at, { at: x.dropIndicator }),
|
|
625
|
+
/* @__PURE__ */ F(T, {
|
|
626
|
+
asChild: !0,
|
|
627
|
+
isActive: se,
|
|
628
|
+
tooltip: K,
|
|
629
|
+
className: j(R, b && "cursor-grab"),
|
|
630
|
+
children: G ? /* @__PURE__ */ F("a", {
|
|
631
|
+
href: W,
|
|
632
|
+
target: "_blank",
|
|
633
|
+
rel: "noopener noreferrer",
|
|
634
|
+
...ce,
|
|
635
|
+
children: q
|
|
636
|
+
}) : /* @__PURE__ */ F(L, {
|
|
637
|
+
to: W,
|
|
638
|
+
...ce,
|
|
639
|
+
children: q
|
|
640
|
+
})
|
|
641
|
+
}),
|
|
642
|
+
g ? g(t, {
|
|
643
|
+
href: W === "#" ? void 0 : W,
|
|
644
|
+
external: G,
|
|
645
|
+
label: K,
|
|
646
|
+
basePath: n
|
|
647
|
+
}) : m && h && /* @__PURE__ */ F(w, {
|
|
648
|
+
showOnHover: !0,
|
|
649
|
+
onClick: () => h(t.id, !t.pinned, t, n),
|
|
650
|
+
"aria-label": k ? k(t.pinned ? "console.nav.unpinItem" : "console.nav.pinItem", {
|
|
651
|
+
defaultValue: t.pinned ? `Unpin ${K}` : `Pin ${K}`,
|
|
652
|
+
name: K
|
|
653
|
+
}) : t.pinned ? `Unpin ${K}` : `Pin ${K}`,
|
|
654
|
+
children: t.pinned ? /* @__PURE__ */ F(re, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ F(ne, { className: "h-3.5 w-3.5" })
|
|
558
655
|
})
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
showOnHover: !0,
|
|
562
|
-
onClick: () => m(e.id, !e.pinned, e, n),
|
|
563
|
-
"aria-label": E ? E(e.pinned ? "console.nav.unpinItem" : "console.nav.pinItem", {
|
|
564
|
-
defaultValue: e.pinned ? `Unpin ${W}` : `Pin ${W}`,
|
|
565
|
-
name: W
|
|
566
|
-
}) : e.pinned ? `Unpin ${W}` : `Pin ${W}`,
|
|
567
|
-
children: e.pinned ? /* @__PURE__ */ z(re, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ z(ne, { className: "h-3.5 w-3.5" })
|
|
568
|
-
})
|
|
569
|
-
] });
|
|
656
|
+
]
|
|
657
|
+
});
|
|
570
658
|
}
|
|
571
|
-
function
|
|
572
|
-
let
|
|
573
|
-
e,
|
|
574
|
-
b.pathname,
|
|
575
|
-
b.search,
|
|
659
|
+
function ot({ items: t, basePath: n = "", evaluateVisibility: i = je, checkPermission: a = Me, checkCapability: o = Ne, checkDocTarget: s, onAction: c, searchQuery: l, enablePinning: u, onPinToggle: d, renderItemAction: f, extraFavorites: p, pinnedOrder: m, onPinnedReorder: h, resolveTargetLabel: g, locale: b, t: x, templateContext: S }) {
|
|
660
|
+
let w = z(), T = r(() => Je(t, w.pathname, w.search, n, S)?.id ?? null, [
|
|
576
661
|
t,
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
662
|
+
w.pathname,
|
|
663
|
+
w.search,
|
|
664
|
+
n,
|
|
665
|
+
S
|
|
666
|
+
]), E = r(() => l ? Xe(t, l, (e) => Y(e, x, g, b)) : t, [
|
|
667
|
+
t,
|
|
668
|
+
l,
|
|
669
|
+
x,
|
|
670
|
+
g,
|
|
671
|
+
b
|
|
672
|
+
]), D = r(() => st(ct(E, {
|
|
673
|
+
evaluateVisibility: i,
|
|
674
|
+
checkPermission: a,
|
|
675
|
+
checkCapability: o,
|
|
676
|
+
checkDocTarget: s
|
|
677
|
+
}), m), [
|
|
678
|
+
E,
|
|
679
|
+
i,
|
|
680
|
+
a,
|
|
681
|
+
o,
|
|
682
|
+
s,
|
|
683
|
+
m
|
|
684
|
+
]), O = E.slice().sort(we), k = {
|
|
685
|
+
basePath: n,
|
|
686
|
+
evalVis: i,
|
|
687
|
+
checkPerm: a,
|
|
688
|
+
checkCap: o,
|
|
689
|
+
checkDocTarget: s,
|
|
690
|
+
onAction: c,
|
|
691
|
+
enablePinning: u,
|
|
692
|
+
onPinToggle: d,
|
|
693
|
+
renderItemAction: f,
|
|
694
|
+
resolveTargetLabel: g,
|
|
695
|
+
locale: b,
|
|
696
|
+
t: x,
|
|
697
|
+
templateContext: S
|
|
698
|
+
}, A = O.some((e) => e.type === "group"), M = !!u && D.length > 0, N = e.Children.toArray(p).length > 0, P = M || N ? /* @__PURE__ */ I(_, { children: [/* @__PURE__ */ I(y, {
|
|
699
|
+
className: j("flex items-center gap-1.5", Te, Ee),
|
|
700
|
+
children: [/* @__PURE__ */ F(H, { className: "h-3.5 w-3.5" }), x ? x("console.nav.favorites", { defaultValue: "Favorites" }) : "Favorites"]
|
|
701
|
+
}), /* @__PURE__ */ I(v, { children: [M && (h ? /* @__PURE__ */ F(nt, {
|
|
702
|
+
items: D,
|
|
703
|
+
onReorder: h,
|
|
704
|
+
rowProps: k
|
|
705
|
+
}) : /* @__PURE__ */ F(C, { children: D.map((e) => /* @__PURE__ */ F($, {
|
|
603
706
|
item: e,
|
|
604
|
-
...
|
|
605
|
-
}, `fav-${e.id}`)) })
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
items: e,
|
|
613
|
-
strategy: pe,
|
|
614
|
-
children: /* @__PURE__ */ z(S, { children: T.map((e) => /* @__PURE__ */ z(Ue, {
|
|
615
|
-
item: e,
|
|
616
|
-
enableReorder: u,
|
|
617
|
-
...O
|
|
618
|
-
}, e.id)) })
|
|
619
|
-
})
|
|
620
|
-
}) : /* @__PURE__ */ z(S, { children: T.map((e) => /* @__PURE__ */ z($, {
|
|
707
|
+
...k
|
|
708
|
+
}, `fav-${e.id}`)) })), N && /* @__PURE__ */ F(C, {
|
|
709
|
+
className: j(M && "mt-1"),
|
|
710
|
+
children: p
|
|
711
|
+
})] })] }) : null;
|
|
712
|
+
if (!A) return /* @__PURE__ */ I(Ye.Provider, {
|
|
713
|
+
value: T,
|
|
714
|
+
children: [P, /* @__PURE__ */ F(_, { children: /* @__PURE__ */ F(v, { children: /* @__PURE__ */ F(C, { children: O.map((e) => /* @__PURE__ */ F($, {
|
|
621
715
|
item: e,
|
|
622
|
-
...
|
|
623
|
-
}, e.id)) })
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
let j = [], M = [], N = (e) => {
|
|
630
|
-
if (M.length === 0) return;
|
|
631
|
-
let t = M;
|
|
632
|
-
M = [], j.push(/* @__PURE__ */ z(g, { children: /* @__PURE__ */ z(_, { children: /* @__PURE__ */ z(S, { children: t.map((e) => /* @__PURE__ */ z($, {
|
|
716
|
+
...k
|
|
717
|
+
}, e.id)) }) }) })]
|
|
718
|
+
});
|
|
719
|
+
let L = [], R = [], B = (e) => {
|
|
720
|
+
if (R.length === 0) return;
|
|
721
|
+
let t = R;
|
|
722
|
+
R = [], L.push(/* @__PURE__ */ F(_, { children: /* @__PURE__ */ F(v, { children: /* @__PURE__ */ F(C, { children: t.map((e) => /* @__PURE__ */ F($, {
|
|
633
723
|
item: e,
|
|
634
|
-
...
|
|
724
|
+
...k
|
|
635
725
|
}, e.id)) }) }) }, e));
|
|
636
726
|
};
|
|
637
|
-
return
|
|
638
|
-
e.type === "group" ? (
|
|
727
|
+
return O.forEach((e, t) => {
|
|
728
|
+
e.type === "group" ? (B(`leaf-${t}`), L.push(/* @__PURE__ */ F($, {
|
|
639
729
|
item: e,
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
730
|
+
inList: !1,
|
|
731
|
+
...k
|
|
732
|
+
}, e.id))) : R.push(e);
|
|
733
|
+
}), B("leaf-end"), /* @__PURE__ */ I(Ye.Provider, {
|
|
734
|
+
value: T,
|
|
735
|
+
children: [P, L]
|
|
645
736
|
});
|
|
646
737
|
}
|
|
647
|
-
function
|
|
648
|
-
let
|
|
649
|
-
for (let
|
|
650
|
-
return
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
if (!t) return null;
|
|
657
|
-
let n = parseInt(t[1], 16) / 255, r = parseInt(t[2], 16) / 255, i = parseInt(t[3], 16) / 255, a = Math.max(n, r, i), o = Math.min(n, r, i), s = 0, c = 0, l = (a + o) / 2;
|
|
658
|
-
if (a !== o) {
|
|
659
|
-
let e = a - o;
|
|
660
|
-
switch (c = l > .5 ? e / (2 - a - o) : e / (a + o), a) {
|
|
661
|
-
case n:
|
|
662
|
-
s = ((r - i) / e + (r < i ? 6 : 0)) / 6;
|
|
663
|
-
break;
|
|
664
|
-
case r:
|
|
665
|
-
s = ((i - n) / e + 2) / 6;
|
|
666
|
-
break;
|
|
667
|
-
case i: s = ((n - r) / e + 4) / 6;
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
return {
|
|
671
|
-
h: s * 360,
|
|
672
|
-
s: c * 100,
|
|
673
|
-
l: l * 100
|
|
674
|
-
};
|
|
675
|
-
}
|
|
676
|
-
function qe(e) {
|
|
677
|
-
let t = Ke(e);
|
|
678
|
-
return t ? `${Math.round(t.h)} ${Math.round(t.s)}% ${Math.round(t.l)}%` : null;
|
|
679
|
-
}
|
|
680
|
-
function Je(e) {
|
|
681
|
-
let t = Ke(e);
|
|
682
|
-
if (!t) return null;
|
|
683
|
-
let n = Math.max(t.l, 65), r = t.s > 80 ? Math.max(t.s - 10, 70) : t.s;
|
|
684
|
-
return `${Math.round(t.h)} ${Math.round(r)}% ${Math.round(n)}%`;
|
|
685
|
-
}
|
|
686
|
-
function Ye(e) {
|
|
687
|
-
let t = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
|
|
688
|
-
if (!t) return "0 0% 100%";
|
|
689
|
-
let n = (e) => {
|
|
690
|
-
let t = e / 255;
|
|
691
|
-
return t <= .03928 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
692
|
-
}, r = n(parseInt(t[1], 16)), i = n(parseInt(t[2], 16)), a = n(parseInt(t[3], 16));
|
|
693
|
-
return .2126 * r + .7152 * i + .0722 * a > .6 ? "222 47% 11%" : "0 0% 100%";
|
|
694
|
-
}
|
|
695
|
-
function Xe(e, t) {
|
|
696
|
-
n(() => {
|
|
697
|
-
let n = document.documentElement, r = () => n.classList.contains("dark"), i = () => {
|
|
698
|
-
if (e?.primaryColor) {
|
|
699
|
-
let t = qe(e.primaryColor), i = Je(e.primaryColor), a = r() && i || t;
|
|
700
|
-
a && (n.style.setProperty("--brand-primary", e.primaryColor), n.style.setProperty("--brand-primary-hsl", t || a), n.style.setProperty("--primary", a), n.style.setProperty("--primary-foreground", r() ? "222 47% 11%" : Ye(e.primaryColor)), n.style.setProperty("--ring", a), n.style.setProperty("--sidebar-primary", a), n.style.setProperty("--sidebar-ring", a));
|
|
701
|
-
} else n.style.removeProperty("--brand-primary"), n.style.removeProperty("--brand-primary-hsl"), n.style.removeProperty("--primary"), n.style.removeProperty("--primary-foreground"), n.style.removeProperty("--ring"), n.style.removeProperty("--sidebar-primary"), n.style.removeProperty("--sidebar-ring");
|
|
702
|
-
if (e?.accentColor) {
|
|
703
|
-
let t = qe(e.accentColor), i = Je(e.accentColor), a = r() && i || t;
|
|
704
|
-
a && (n.style.setProperty("--brand-accent", e.accentColor), n.style.setProperty("--brand-accent-hsl", t || a), n.style.setProperty("--accent", a), n.style.setProperty("--accent-foreground", r() ? "222 47% 11%" : Ye(e.accentColor)));
|
|
705
|
-
} else n.style.removeProperty("--brand-accent"), n.style.removeProperty("--brand-accent-hsl"), n.style.removeProperty("--accent"), n.style.removeProperty("--accent-foreground");
|
|
706
|
-
};
|
|
707
|
-
i();
|
|
708
|
-
let a = new MutationObserver((e) => {
|
|
709
|
-
for (let t of e) if (t.type === "attributes" && t.attributeName === "class") {
|
|
710
|
-
i();
|
|
711
|
-
break;
|
|
712
|
-
}
|
|
713
|
-
});
|
|
714
|
-
if (a.observe(n, {
|
|
715
|
-
attributes: !0,
|
|
716
|
-
attributeFilter: ["class"]
|
|
717
|
-
}), e?.favicon) {
|
|
718
|
-
let t = document.querySelector("#favicon") || document.querySelector("link[rel=\"icon\"]");
|
|
719
|
-
t && (t.href = e.favicon);
|
|
720
|
-
}
|
|
721
|
-
return t && (document.title = t), () => {
|
|
722
|
-
a.disconnect(), n.style.removeProperty("--brand-primary"), n.style.removeProperty("--brand-primary-hsl"), n.style.removeProperty("--brand-accent"), n.style.removeProperty("--brand-accent-hsl"), n.style.removeProperty("--primary"), n.style.removeProperty("--primary-foreground"), n.style.removeProperty("--ring"), n.style.removeProperty("--sidebar-primary"), n.style.removeProperty("--sidebar-ring"), n.style.removeProperty("--accent"), n.style.removeProperty("--accent-foreground");
|
|
723
|
-
};
|
|
724
|
-
}, [
|
|
725
|
-
e?.primaryColor,
|
|
726
|
-
e?.accentColor,
|
|
727
|
-
e?.favicon,
|
|
728
|
-
t
|
|
729
|
-
]);
|
|
738
|
+
function st(e, t) {
|
|
739
|
+
let n = [], r = /* @__PURE__ */ new Set();
|
|
740
|
+
for (let t of e) r.has(t.id) || (r.add(t.id), n.push(t));
|
|
741
|
+
if (!t?.length) return n;
|
|
742
|
+
let i = new Map(t.map((e, t) => [e, t]));
|
|
743
|
+
return n.map((e, n) => ({
|
|
744
|
+
item: e,
|
|
745
|
+
key: i.get(e.id) ?? t.length + n
|
|
746
|
+
})).sort((e, t) => e.key - t.key).map(({ item: e }) => e);
|
|
730
747
|
}
|
|
731
|
-
function
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
children: [/* @__PURE__ */ z("header", {
|
|
736
|
-
className: "sticky top-0 z-30 flex h-14 w-full shrink-0 items-center gap-2 border-b bg-background px-2 sm:px-4",
|
|
737
|
-
children: t
|
|
738
|
-
}), /* @__PURE__ */ B("div", {
|
|
739
|
-
className: "flex flex-1 min-h-0 w-full",
|
|
740
|
-
children: [
|
|
741
|
-
e,
|
|
742
|
-
/* @__PURE__ */ z(x, {
|
|
743
|
-
className: "min-w-0",
|
|
744
|
-
children: /* @__PURE__ */ z("main", {
|
|
745
|
-
className: A("flex-1 min-w-0 overflow-auto p-3 sm:p-4 md:p-6 pb-20 sm:pb-4 md:pb-6", r),
|
|
746
|
-
children: n
|
|
747
|
-
})
|
|
748
|
-
}),
|
|
749
|
-
o
|
|
750
|
-
]
|
|
751
|
-
})]
|
|
752
|
-
});
|
|
748
|
+
function ct(e, t) {
|
|
749
|
+
let n = [];
|
|
750
|
+
for (let r of e) Pe(r, t) && (r.type !== "group" && r.type !== "separator" && r.pinned && n.push(r), r.children?.length && n.push(...ct(r.children, t)));
|
|
751
|
+
return n;
|
|
753
752
|
}
|
|
754
753
|
//#endregion
|
|
755
754
|
//#region src/AppSchemaRenderer.tsx
|
|
756
|
-
|
|
757
|
-
|
|
755
|
+
var lt = "group-data-[state=collapsed]:group-data-[collapsible=icon]:invisible group-data-[state=collapsed]:group-data-[collapsible=icon]:transition-[margin,opacity,visibility]";
|
|
756
|
+
function ut(e) {
|
|
757
|
+
return U(e, void 0) ?? "";
|
|
758
758
|
}
|
|
759
|
-
function
|
|
760
|
-
return e.length <= 1 ? null : /* @__PURE__ */
|
|
761
|
-
className:
|
|
762
|
-
children: [/* @__PURE__ */
|
|
763
|
-
}), /* @__PURE__ */
|
|
764
|
-
let r =
|
|
765
|
-
return /* @__PURE__ */
|
|
759
|
+
function dt({ areas: e, activeAreaId: t, onAreaChange: n }) {
|
|
760
|
+
return e.length <= 1 ? null : /* @__PURE__ */ I(_, { children: [/* @__PURE__ */ I(y, {
|
|
761
|
+
className: `flex items-center gap-1.5 ${lt}`,
|
|
762
|
+
children: [/* @__PURE__ */ F(V, { className: "h-3.5 w-3.5" }), "Area"]
|
|
763
|
+
}), /* @__PURE__ */ F(v, { children: /* @__PURE__ */ F(C, { children: e.map((e) => {
|
|
764
|
+
let r = J(e.icon), i = ut(e.label);
|
|
765
|
+
return /* @__PURE__ */ F(E, { children: /* @__PURE__ */ I(T, {
|
|
766
766
|
isActive: e.id === t,
|
|
767
767
|
tooltip: i,
|
|
768
768
|
onClick: () => n(e.id),
|
|
769
|
-
children: [/* @__PURE__ */
|
|
769
|
+
children: [/* @__PURE__ */ F(r, { className: "h-4 w-4" }), /* @__PURE__ */ F("span", { children: i })]
|
|
770
770
|
}) }, e.id);
|
|
771
771
|
}) }) })] });
|
|
772
772
|
}
|
|
773
|
-
function
|
|
774
|
-
let
|
|
773
|
+
function ft({ items: e, basePath: t, guards: n, onAction: r }) {
|
|
774
|
+
let i = z(), a = (e) => {
|
|
775
775
|
let t = [];
|
|
776
|
-
for (let
|
|
776
|
+
for (let r of e.slice().sort(we)) X([r], n) && r.type !== "separator" && (r.type === "group" ? t.push(...a(r.children || [])) : t.push(r));
|
|
777
777
|
return t;
|
|
778
|
-
},
|
|
779
|
-
|
|
778
|
+
}, s = a(e).slice(0, 5);
|
|
779
|
+
if (s.length === 0) return null;
|
|
780
|
+
let c = Je(e, i.pathname, i.search, t)?.id ?? null;
|
|
781
|
+
return /* @__PURE__ */ F("div", {
|
|
780
782
|
className: "fixed bottom-0 left-0 right-0 z-50 flex items-center justify-around border-t bg-background/95 backdrop-blur-sm px-2 py-1 sm:hidden safe-area-bottom",
|
|
781
783
|
role: "navigation",
|
|
782
784
|
"aria-label": "Mobile navigation",
|
|
783
|
-
children:
|
|
784
|
-
let
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
else if (e.type === "page") i = e.pageName ? `${t}/page/${e.pageName}` : "#";
|
|
788
|
-
else if (e.type === "report") i = e.reportName ? `${t}/report/${e.reportName}` : "#";
|
|
789
|
-
else if (e.type === "url") i = e.url ?? "#";
|
|
790
|
-
else if (e.type === "component") {
|
|
791
|
-
let n = e.componentRef;
|
|
792
|
-
if (n) {
|
|
793
|
-
i = `${t}/component/${n.split(":").filter(Boolean).join("/")}`;
|
|
794
|
-
let r = e.params;
|
|
795
|
-
if (r) {
|
|
796
|
-
let e = new URLSearchParams();
|
|
797
|
-
for (let [t, n] of Object.entries(r)) n != null && e.set(t, typeof n == "string" ? n : JSON.stringify(n));
|
|
798
|
-
let t = e.toString();
|
|
799
|
-
t && (i += `?${t}`);
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
let a = i !== "#" && n.pathname.startsWith(i);
|
|
804
|
-
return /* @__PURE__ */ B(oe, {
|
|
805
|
-
to: i,
|
|
806
|
-
className: `flex flex-col items-center gap-0.5 px-2 py-1.5 transition-colors min-w-[44px] min-h-[44px] justify-center ${a ? "text-primary" : "text-muted-foreground hover:text-foreground"}`,
|
|
807
|
-
children: [/* @__PURE__ */ z(r, { className: "h-5 w-5" }), /* @__PURE__ */ z("span", {
|
|
785
|
+
children: s.map((e) => {
|
|
786
|
+
let n = J(e.icon), { href: i, external: a } = Q(e, t), s = `relative flex flex-col items-center gap-0.5 px-2 py-1.5 transition-colors min-w-[44px] min-h-[44px] justify-center ${e.id === c ? "text-primary" : "text-muted-foreground hover:text-foreground"}`, l = /* @__PURE__ */ I(P, { children: [
|
|
787
|
+
/* @__PURE__ */ F(n, { className: "h-5 w-5" }),
|
|
788
|
+
/* @__PURE__ */ F("span", {
|
|
808
789
|
className: "text-[10px] truncate max-w-[60px]",
|
|
809
|
-
children:
|
|
810
|
-
})
|
|
790
|
+
children: Y(e)
|
|
791
|
+
}),
|
|
792
|
+
e.badge != null && /* @__PURE__ */ F(o, {
|
|
793
|
+
variant: e.badgeVariant,
|
|
794
|
+
className: "absolute top-0.5 left-1/2 ml-1.5 px-1 py-0 text-[9px] leading-tight",
|
|
795
|
+
children: e.badge
|
|
796
|
+
})
|
|
797
|
+
] });
|
|
798
|
+
return e.type === "action" ? /* @__PURE__ */ F("button", {
|
|
799
|
+
type: "button",
|
|
800
|
+
onClick: () => r?.(e),
|
|
801
|
+
className: s,
|
|
802
|
+
children: l
|
|
803
|
+
}, e.id) : a ? /* @__PURE__ */ F("a", {
|
|
804
|
+
href: i,
|
|
805
|
+
target: "_blank",
|
|
806
|
+
rel: "noopener noreferrer",
|
|
807
|
+
className: s,
|
|
808
|
+
children: l
|
|
809
|
+
}, e.id) : /* @__PURE__ */ F(L, {
|
|
810
|
+
to: i,
|
|
811
|
+
className: s,
|
|
812
|
+
children: l
|
|
811
813
|
}, e.id);
|
|
812
814
|
})
|
|
813
815
|
});
|
|
814
816
|
}
|
|
815
|
-
function
|
|
816
|
-
let D =
|
|
817
|
-
return /* @__PURE__ */
|
|
817
|
+
function pt({ schema: e, basePath: t, evalVis: n, checkPerm: r, checkCap: a, checkDocTarget: o, onAction: s, sidebarHeader: c, sidebarFooter: l, sidebarExtra: u, visibleAreas: d, activeAreaId: f, setActiveAreaId: p, resolvedNavigation: _, enableSearch: v, enablePinning: y, onPinToggle: S }) {
|
|
818
|
+
let w = e.branding?.logo, D = J(e.icon), [O, k] = i("");
|
|
819
|
+
return /* @__PURE__ */ I(m, {
|
|
818
820
|
collapsible: "icon",
|
|
819
821
|
children: [
|
|
820
|
-
/* @__PURE__ */
|
|
822
|
+
/* @__PURE__ */ I(b, { children: [c ?? /* @__PURE__ */ F(C, { children: /* @__PURE__ */ F(E, { children: /* @__PURE__ */ I(T, {
|
|
821
823
|
size: "lg",
|
|
822
824
|
tooltip: e.title ?? e.name,
|
|
823
|
-
children: [/* @__PURE__ */
|
|
825
|
+
children: [/* @__PURE__ */ F("div", {
|
|
824
826
|
className: "flex aspect-square size-8 items-center justify-center rounded-lg bg-primary text-primary-foreground",
|
|
825
|
-
children:
|
|
826
|
-
src:
|
|
827
|
+
children: w ? /* @__PURE__ */ F("img", {
|
|
828
|
+
src: w,
|
|
827
829
|
alt: e.title ?? "",
|
|
828
830
|
className: "size-6 object-contain"
|
|
829
|
-
}) : /* @__PURE__ */
|
|
830
|
-
}), /* @__PURE__ */
|
|
831
|
+
}) : /* @__PURE__ */ F(D, { className: "size-4" })
|
|
832
|
+
}), /* @__PURE__ */ I("div", {
|
|
831
833
|
className: "grid flex-1 text-left text-sm leading-tight",
|
|
832
|
-
children: [/* @__PURE__ */
|
|
834
|
+
children: [/* @__PURE__ */ F("span", {
|
|
833
835
|
className: "truncate font-semibold",
|
|
834
836
|
children: e.title ?? e.name ?? "App"
|
|
835
|
-
}), e.description && /* @__PURE__ */
|
|
837
|
+
}), e.description && /* @__PURE__ */ F("span", {
|
|
836
838
|
className: "truncate text-xs text-muted-foreground",
|
|
837
839
|
children: e.description
|
|
838
840
|
})]
|
|
839
841
|
})]
|
|
840
|
-
}) }) }),
|
|
842
|
+
}) }) }), v && /* @__PURE__ */ F(x, {
|
|
841
843
|
placeholder: "Search navigation…",
|
|
842
844
|
value: O,
|
|
843
845
|
onChange: (e) => k(e.target.value),
|
|
844
846
|
"aria-label": "Search navigation"
|
|
845
847
|
})] }),
|
|
846
|
-
/* @__PURE__ */
|
|
847
|
-
|
|
848
|
-
areas:
|
|
849
|
-
activeAreaId:
|
|
850
|
-
onAreaChange:
|
|
848
|
+
/* @__PURE__ */ I(h, { children: [
|
|
849
|
+
d.length > 1 && f && /* @__PURE__ */ F(dt, {
|
|
850
|
+
areas: d,
|
|
851
|
+
activeAreaId: f,
|
|
852
|
+
onAreaChange: p
|
|
851
853
|
}),
|
|
852
|
-
/* @__PURE__ */
|
|
853
|
-
items:
|
|
854
|
+
/* @__PURE__ */ F(ot, {
|
|
855
|
+
items: _,
|
|
854
856
|
basePath: t,
|
|
855
857
|
evaluateVisibility: n,
|
|
856
858
|
checkPermission: r,
|
|
857
859
|
checkCapability: a,
|
|
858
|
-
|
|
860
|
+
checkDocTarget: o,
|
|
861
|
+
onAction: s,
|
|
859
862
|
searchQuery: O,
|
|
860
|
-
enablePinning:
|
|
861
|
-
onPinToggle:
|
|
862
|
-
enableReorder: C,
|
|
863
|
-
onReorder: E
|
|
863
|
+
enablePinning: y,
|
|
864
|
+
onPinToggle: S
|
|
864
865
|
}),
|
|
865
|
-
|
|
866
|
+
u
|
|
866
867
|
] }),
|
|
867
|
-
|
|
868
|
+
l && /* @__PURE__ */ F(g, { children: l })
|
|
868
869
|
]
|
|
869
870
|
});
|
|
870
871
|
}
|
|
871
|
-
function
|
|
872
|
-
let
|
|
873
|
-
evaluateVisibility:
|
|
874
|
-
checkPermission:
|
|
875
|
-
checkCapability:
|
|
876
|
-
|
|
877
|
-
|
|
872
|
+
function mt({ schema: e, basePath: t = "", mobileNavMode: a = "drawer", evaluateVisibility: o, checkPermission: s, checkCapability: c, checkDocTarget: l, onAction: u, navbar: d, sidebarHeader: f, sidebarFooter: p, sidebarExtra: m, children: h, className: g, defaultOpen: _ = !0, enableSearch: v, enablePinning: y, onPinToggle: b }) {
|
|
873
|
+
let x = o ?? ((e) => e !== !1 && e !== "false"), S = s ?? (() => !0), C = c ?? (() => !0), w = r(() => (e.menu ?? []).map((e, t) => ae(e, t)), [e.menu]), T = e.navigation ?? w, E = {
|
|
874
|
+
evaluateVisibility: x,
|
|
875
|
+
checkPermission: S,
|
|
876
|
+
checkCapability: C,
|
|
877
|
+
checkDocTarget: l,
|
|
878
|
+
hasActionHandler: !!u
|
|
879
|
+
}, D = (e.areas ?? []).filter((e) => X(e.navigation, E)), [O, k] = i(() => D.length > 0 ? D[0].id : null), A = D.map((e) => e.id).join(",");
|
|
878
880
|
n(() => {
|
|
879
881
|
D.length > 0 ? k((e) => D.some((t) => t.id === e) ? e : D[0].id) : k(null);
|
|
880
882
|
}, [e.name, A]);
|
|
881
|
-
let j = D.find((e) => e.id === O) ?? D[0], M = j?.navigation ??
|
|
883
|
+
let j = D.find((e) => e.id === O) ?? D[0], M = j?.navigation ?? T, N = {
|
|
882
884
|
title: e.title,
|
|
883
|
-
favicon: e.favicon
|
|
884
|
-
},
|
|
885
|
+
favicon: e.branding?.favicon
|
|
886
|
+
}, L = /* @__PURE__ */ F(pt, {
|
|
885
887
|
schema: e,
|
|
886
888
|
basePath: t,
|
|
887
|
-
evalVis:
|
|
888
|
-
checkPerm:
|
|
889
|
-
checkCap:
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
889
|
+
evalVis: x,
|
|
890
|
+
checkPerm: S,
|
|
891
|
+
checkCap: C,
|
|
892
|
+
checkDocTarget: l,
|
|
893
|
+
onAction: u,
|
|
894
|
+
sidebarHeader: f,
|
|
895
|
+
sidebarFooter: p,
|
|
896
|
+
sidebarExtra: m,
|
|
894
897
|
visibleAreas: D,
|
|
895
898
|
activeAreaId: j?.id ?? null,
|
|
896
899
|
setActiveAreaId: k,
|
|
897
900
|
resolvedNavigation: M,
|
|
898
|
-
enableSearch:
|
|
899
|
-
enablePinning:
|
|
900
|
-
onPinToggle:
|
|
901
|
-
enableReorder: b,
|
|
902
|
-
onReorder: x
|
|
901
|
+
enableSearch: v,
|
|
902
|
+
enablePinning: y,
|
|
903
|
+
onPinToggle: b
|
|
903
904
|
});
|
|
904
|
-
return /* @__PURE__ */
|
|
905
|
-
sidebar:
|
|
906
|
-
navbar:
|
|
907
|
-
className:
|
|
908
|
-
defaultOpen:
|
|
905
|
+
return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(Ce, {
|
|
906
|
+
sidebar: L,
|
|
907
|
+
navbar: d,
|
|
908
|
+
className: g,
|
|
909
|
+
defaultOpen: _,
|
|
909
910
|
branding: N,
|
|
910
|
-
children:
|
|
911
|
-
}), a === "bottom_nav" && /* @__PURE__ */
|
|
911
|
+
children: h
|
|
912
|
+
}), a === "bottom_nav" && /* @__PURE__ */ F(ft, {
|
|
912
913
|
items: M,
|
|
913
|
-
basePath: t
|
|
914
|
+
basePath: t,
|
|
915
|
+
guards: E,
|
|
916
|
+
onAction: u
|
|
914
917
|
})] });
|
|
915
918
|
}
|
|
916
919
|
//#endregion
|
|
920
|
+
//#region src/PageHeader.tsx
|
|
921
|
+
var ht = (e) => {
|
|
922
|
+
let t = e?.name ?? e?.full_name ?? e?.display_name ?? e?.label ?? e?.title ?? e?.subject;
|
|
923
|
+
return t != null && String(t).trim() ? String(t) : [
|
|
924
|
+
e?.salutation,
|
|
925
|
+
e?.first_name,
|
|
926
|
+
e?.last_name
|
|
927
|
+
].filter((e) => typeof e == "string" && e.trim()).map((e) => e.trim()).join(" ") || (typeof e?.email == "string" && e.email.trim() ? e.email.trim() : null);
|
|
928
|
+
}, gt = (e, t) => !e || typeof e != "string" ? e ?? "" : e.includes("{") ? e.replace(/\{([a-zA-Z0-9_.]+)\}/g, (e, n) => {
|
|
929
|
+
let r = n.split(".").reduce((e, t) => e == null ? e : e[t], t);
|
|
930
|
+
return r == null ? "" : typeof r == "object" ? ht(r) ?? "" : String(r);
|
|
931
|
+
}).replace(/\s*[-–—|/·,:]\s*(?=\s*[-–—|/·,:]|$)/g, "").replace(/^\s*[-–—|/·,:]\s*/, "").replace(/\s+/g, " ").trim() : e;
|
|
932
|
+
function _t({ title: t, subtitle: n, icon: r, action: i, actions: a, showBack: o, schema: c, className: l, children: u, ...d }) {
|
|
933
|
+
let p = ge(), m = typeof t == "string" && /\{[a-zA-Z0-9_.]+\}/.test(t), h = gt(t, p?.data) || (m ? "" : t), g = n, _ = typeof g == "string" && /\{[a-zA-Z0-9_.]+\}/.test(g), v = gt(g, p?.data) || (_ ? "" : g), y = !!p?.recordId, b = !!p?.embedded, x = o ?? (y && !b), S = e.useCallback(() => {
|
|
934
|
+
if (typeof window > "u") return;
|
|
935
|
+
let e = window.location.pathname, t = e.replace(/\/record\/[^/]+\/?$/, "");
|
|
936
|
+
t === e ? window.history.length > 1 && window.history.back() : (window.history.pushState({}, "", t + window.location.search), window.dispatchEvent(new PopStateEvent("popstate")));
|
|
937
|
+
}, []), C = Array.isArray(c?.children) ? c.children.filter(Boolean).map((e, t) => /* @__PURE__ */ F(me, { schema: e }, e?.id || `pgh-child-${t}`)) : null, w = Array.isArray(a) && a.length > 0 && a || Array.isArray(c?.actions) && c.actions.length > 0 && c.actions || Array.isArray(c?.properties?.actions) && c.properties.actions.length > 0 && c.properties.actions || null, T = i || u || (w ? /* @__PURE__ */ F(me, { schema: {
|
|
938
|
+
type: "record:quick_actions",
|
|
939
|
+
properties: {
|
|
940
|
+
actions: w,
|
|
941
|
+
location: "record_header",
|
|
942
|
+
align: "end",
|
|
943
|
+
inline: !0
|
|
944
|
+
}
|
|
945
|
+
} }) : null) || C;
|
|
946
|
+
return /* @__PURE__ */ F("div", {
|
|
947
|
+
className: j("flex flex-col gap-3 pb-4 border-b", l),
|
|
948
|
+
...d,
|
|
949
|
+
children: /* @__PURE__ */ I("div", {
|
|
950
|
+
className: "flex flex-wrap items-center gap-x-4 gap-y-2",
|
|
951
|
+
children: [
|
|
952
|
+
x && /* @__PURE__ */ F(s, {
|
|
953
|
+
type: "button",
|
|
954
|
+
variant: "ghost",
|
|
955
|
+
size: "icon",
|
|
956
|
+
onClick: S,
|
|
957
|
+
"aria-label": "Back to list",
|
|
958
|
+
className: "flex-shrink-0 -ml-2",
|
|
959
|
+
children: /* @__PURE__ */ F(B, { className: "size-4" })
|
|
960
|
+
}),
|
|
961
|
+
r && (h || v) && /* @__PURE__ */ F("div", {
|
|
962
|
+
className: "flex-shrink-0 grid place-items-center size-10 rounded-md bg-primary/10 text-primary",
|
|
963
|
+
children: typeof r == "string" ? /* @__PURE__ */ F(f, {
|
|
964
|
+
name: r,
|
|
965
|
+
className: "size-5"
|
|
966
|
+
}) : r
|
|
967
|
+
}),
|
|
968
|
+
/* @__PURE__ */ I("div", {
|
|
969
|
+
className: "flex flex-col min-w-48 flex-1",
|
|
970
|
+
children: [h ? /* @__PURE__ */ F("h1", {
|
|
971
|
+
className: "text-2xl font-bold tracking-tight md:text-3xl truncate",
|
|
972
|
+
children: h
|
|
973
|
+
}) : null, v && /* @__PURE__ */ F("p", {
|
|
974
|
+
className: "text-sm text-muted-foreground truncate",
|
|
975
|
+
children: v
|
|
976
|
+
})]
|
|
977
|
+
}),
|
|
978
|
+
T && /* @__PURE__ */ F("div", {
|
|
979
|
+
className: "flex items-center gap-2 ml-auto",
|
|
980
|
+
children: T
|
|
981
|
+
})
|
|
982
|
+
]
|
|
983
|
+
})
|
|
984
|
+
});
|
|
985
|
+
}
|
|
986
|
+
//#endregion
|
|
917
987
|
//#region src/SidebarNav.tsx
|
|
918
|
-
|
|
988
|
+
var vt = "group-data-[state=collapsed]:group-data-[collapsible=icon]:invisible group-data-[state=collapsed]:group-data-[collapsible=icon]:transition-[margin,opacity,visibility]";
|
|
989
|
+
function yt(e) {
|
|
919
990
|
return "items" in e && !("href" in e);
|
|
920
991
|
}
|
|
921
|
-
function
|
|
922
|
-
return e.children && e.children.length > 0 ? /* @__PURE__ */
|
|
992
|
+
function bt({ item: e, pathname: t }) {
|
|
993
|
+
return e.children && e.children.length > 0 ? /* @__PURE__ */ F(c, {
|
|
923
994
|
asChild: !0,
|
|
924
995
|
defaultOpen: !0,
|
|
925
996
|
className: "group/collapsible",
|
|
926
|
-
children: /* @__PURE__ */
|
|
997
|
+
children: /* @__PURE__ */ I(E, { children: [/* @__PURE__ */ F(u, {
|
|
927
998
|
asChild: !0,
|
|
928
|
-
children: /* @__PURE__ */
|
|
999
|
+
children: /* @__PURE__ */ I(T, {
|
|
929
1000
|
tooltip: e.title,
|
|
930
1001
|
className: "motion-safe:transition-colors motion-safe:duration-150",
|
|
931
1002
|
children: [
|
|
932
|
-
e.icon && /* @__PURE__ */
|
|
933
|
-
/* @__PURE__ */
|
|
934
|
-
e.badge != null && /* @__PURE__ */
|
|
1003
|
+
e.icon && /* @__PURE__ */ F(e.icon, {}),
|
|
1004
|
+
/* @__PURE__ */ F("span", { children: e.title }),
|
|
1005
|
+
e.badge != null && /* @__PURE__ */ F(o, {
|
|
935
1006
|
variant: e.badgeVariant || "default",
|
|
936
1007
|
className: "ml-auto mr-1 h-5 min-w-5 px-1 text-xs",
|
|
937
1008
|
children: e.badge
|
|
938
1009
|
}),
|
|
939
|
-
/* @__PURE__ */
|
|
1010
|
+
/* @__PURE__ */ F(ee, { className: "ml-auto h-4 w-4 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" })
|
|
940
1011
|
]
|
|
941
1012
|
})
|
|
942
|
-
}), /* @__PURE__ */
|
|
1013
|
+
}), /* @__PURE__ */ F(l, {
|
|
943
1014
|
className: "motion-safe:data-[state=open]:animate-in motion-safe:data-[state=closed]:animate-out motion-safe:data-[state=closed]:fade-out-0 motion-safe:data-[state=open]:fade-in-0 motion-safe:data-[state=closed]:slide-out-to-top-1 motion-safe:data-[state=open]:slide-in-from-top-1 motion-safe:duration-150",
|
|
944
|
-
children: /* @__PURE__ */
|
|
1015
|
+
children: /* @__PURE__ */ F(D, { children: e.children.map((e) => /* @__PURE__ */ F(k, { children: /* @__PURE__ */ F(O, {
|
|
945
1016
|
asChild: !0,
|
|
946
1017
|
isActive: t === e.href,
|
|
947
1018
|
className: "motion-safe:transition-colors motion-safe:duration-150",
|
|
948
|
-
children: /* @__PURE__ */
|
|
1019
|
+
children: /* @__PURE__ */ I(R, {
|
|
949
1020
|
to: e.href,
|
|
950
1021
|
children: [
|
|
951
|
-
e.icon && /* @__PURE__ */
|
|
952
|
-
/* @__PURE__ */
|
|
953
|
-
e.badge != null && /* @__PURE__ */
|
|
1022
|
+
e.icon && /* @__PURE__ */ F(e.icon, {}),
|
|
1023
|
+
/* @__PURE__ */ F("span", { children: e.title }),
|
|
1024
|
+
e.badge != null && /* @__PURE__ */ F(o, {
|
|
954
1025
|
variant: e.badgeVariant || "default",
|
|
955
1026
|
className: "ml-auto h-5 min-w-5 px-1 text-xs",
|
|
956
1027
|
children: e.badge
|
|
@@ -959,17 +1030,17 @@ function it({ item: e, pathname: t }) {
|
|
|
959
1030
|
})
|
|
960
1031
|
}) }, e.href)) })
|
|
961
1032
|
})] })
|
|
962
|
-
}) : /* @__PURE__ */
|
|
1033
|
+
}) : /* @__PURE__ */ F(E, { children: /* @__PURE__ */ F(T, {
|
|
963
1034
|
asChild: !0,
|
|
964
1035
|
isActive: t === e.href,
|
|
965
1036
|
tooltip: e.title,
|
|
966
1037
|
className: "motion-safe:transition-colors motion-safe:duration-150",
|
|
967
|
-
children: /* @__PURE__ */
|
|
1038
|
+
children: /* @__PURE__ */ I(R, {
|
|
968
1039
|
to: e.href,
|
|
969
1040
|
children: [
|
|
970
|
-
e.icon && /* @__PURE__ */
|
|
971
|
-
/* @__PURE__ */
|
|
972
|
-
e.badge != null && /* @__PURE__ */
|
|
1041
|
+
e.icon && /* @__PURE__ */ F(e.icon, {}),
|
|
1042
|
+
/* @__PURE__ */ F("span", { children: e.title }),
|
|
1043
|
+
e.badge != null && /* @__PURE__ */ F(o, {
|
|
973
1044
|
variant: e.badgeVariant || "default",
|
|
974
1045
|
className: "ml-auto h-5 min-w-5 px-1 text-xs",
|
|
975
1046
|
children: e.badge
|
|
@@ -978,26 +1049,26 @@ function it({ item: e, pathname: t }) {
|
|
|
978
1049
|
})
|
|
979
1050
|
}) });
|
|
980
1051
|
}
|
|
981
|
-
function
|
|
982
|
-
let s =
|
|
1052
|
+
function xt({ items: t, title: n = "Application", className: r, collapsible: i = "icon", searchEnabled: a = !1, searchPlaceholder: o = "Search…" }) {
|
|
1053
|
+
let s = z(), [c, l] = e.useState(""), u = e.useMemo(() => t.length === 0 ? [] : yt(t[0]) ? t.map((e) => ({
|
|
983
1054
|
groupLabel: e.label,
|
|
984
1055
|
items: e.items
|
|
985
|
-
})) : [{ items:
|
|
986
|
-
if (!c) return
|
|
1056
|
+
})) : [{ items: t }], [t]), f = e.useMemo(() => {
|
|
1057
|
+
if (!c) return u;
|
|
987
1058
|
let e = c.toLowerCase();
|
|
988
|
-
return
|
|
1059
|
+
return u.map((t) => ({
|
|
989
1060
|
...t,
|
|
990
1061
|
items: t.items.filter((t) => t.title.toLowerCase().includes(e) || t.children?.some((t) => t.title.toLowerCase().includes(e)))
|
|
991
1062
|
})).filter((e) => e.items.length > 0);
|
|
992
|
-
}, [
|
|
993
|
-
return /* @__PURE__ */
|
|
1063
|
+
}, [u, c]);
|
|
1064
|
+
return /* @__PURE__ */ F(m, {
|
|
994
1065
|
className: r,
|
|
995
1066
|
collapsible: i,
|
|
996
|
-
children: /* @__PURE__ */
|
|
1067
|
+
children: /* @__PURE__ */ I(h, { children: [a && /* @__PURE__ */ F("div", {
|
|
997
1068
|
className: "px-3 py-2",
|
|
998
|
-
children: /* @__PURE__ */
|
|
1069
|
+
children: /* @__PURE__ */ I("div", {
|
|
999
1070
|
className: "relative",
|
|
1000
|
-
children: [/* @__PURE__ */
|
|
1071
|
+
children: [/* @__PURE__ */ F(ie, { className: "absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" }), /* @__PURE__ */ F(d, {
|
|
1001
1072
|
type: "search",
|
|
1002
1073
|
placeholder: o,
|
|
1003
1074
|
value: c,
|
|
@@ -1005,16 +1076,16 @@ function at({ items: e, title: n = "Application", className: r, collapsible: i =
|
|
|
1005
1076
|
className: "pl-8 h-9"
|
|
1006
1077
|
})]
|
|
1007
1078
|
})
|
|
1008
|
-
}), f.map((e, t) => /* @__PURE__ */
|
|
1009
|
-
t > 0 && /* @__PURE__ */
|
|
1079
|
+
}), f.map((e, t) => /* @__PURE__ */ I(_, { children: [
|
|
1080
|
+
t > 0 && /* @__PURE__ */ F("div", {
|
|
1010
1081
|
className: "mx-3 mb-1 h-px bg-sidebar-border/60",
|
|
1011
1082
|
"aria-hidden": !0
|
|
1012
1083
|
}),
|
|
1013
|
-
/* @__PURE__ */
|
|
1014
|
-
className:
|
|
1084
|
+
/* @__PURE__ */ F(y, {
|
|
1085
|
+
className: `text-[10px] font-semibold uppercase tracking-wider text-sidebar-foreground/60 ${vt}`,
|
|
1015
1086
|
children: e.groupLabel || n
|
|
1016
1087
|
}),
|
|
1017
|
-
/* @__PURE__ */
|
|
1088
|
+
/* @__PURE__ */ F(v, { children: /* @__PURE__ */ F(C, { children: e.items.map((e) => /* @__PURE__ */ F(bt, {
|
|
1018
1089
|
item: e,
|
|
1019
1090
|
pathname: s.pathname
|
|
1020
1091
|
}, e.href)) }) })
|
|
@@ -1022,68 +1093,97 @@ function at({ items: e, title: n = "Application", className: r, collapsible: i =
|
|
|
1022
1093
|
});
|
|
1023
1094
|
}
|
|
1024
1095
|
//#endregion
|
|
1025
|
-
//#region src/
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1096
|
+
//#region src/ResponsiveGrid.tsx
|
|
1097
|
+
var St = {
|
|
1098
|
+
xs: {
|
|
1099
|
+
1: "grid-cols-1",
|
|
1100
|
+
2: "grid-cols-2",
|
|
1101
|
+
3: "grid-cols-3",
|
|
1102
|
+
4: "grid-cols-4",
|
|
1103
|
+
6: "grid-cols-6",
|
|
1104
|
+
12: "grid-cols-12"
|
|
1105
|
+
},
|
|
1106
|
+
sm: {
|
|
1107
|
+
1: "sm:grid-cols-1",
|
|
1108
|
+
2: "sm:grid-cols-2",
|
|
1109
|
+
3: "sm:grid-cols-3",
|
|
1110
|
+
4: "sm:grid-cols-4",
|
|
1111
|
+
6: "sm:grid-cols-6",
|
|
1112
|
+
12: "sm:grid-cols-12"
|
|
1113
|
+
},
|
|
1114
|
+
md: {
|
|
1115
|
+
1: "md:grid-cols-1",
|
|
1116
|
+
2: "md:grid-cols-2",
|
|
1117
|
+
3: "md:grid-cols-3",
|
|
1118
|
+
4: "md:grid-cols-4",
|
|
1119
|
+
6: "md:grid-cols-6",
|
|
1120
|
+
12: "md:grid-cols-12"
|
|
1121
|
+
},
|
|
1122
|
+
lg: {
|
|
1123
|
+
1: "lg:grid-cols-1",
|
|
1124
|
+
2: "lg:grid-cols-2",
|
|
1125
|
+
3: "lg:grid-cols-3",
|
|
1126
|
+
4: "lg:grid-cols-4",
|
|
1127
|
+
6: "lg:grid-cols-6",
|
|
1128
|
+
12: "lg:grid-cols-12"
|
|
1129
|
+
},
|
|
1130
|
+
xl: {
|
|
1131
|
+
1: "xl:grid-cols-1",
|
|
1132
|
+
2: "xl:grid-cols-2",
|
|
1133
|
+
3: "xl:grid-cols-3",
|
|
1134
|
+
4: "xl:grid-cols-4",
|
|
1135
|
+
6: "xl:grid-cols-6",
|
|
1136
|
+
12: "xl:grid-cols-12"
|
|
1137
|
+
},
|
|
1138
|
+
"2xl": {
|
|
1139
|
+
1: "2xl:grid-cols-1",
|
|
1140
|
+
2: "2xl:grid-cols-2",
|
|
1141
|
+
3: "2xl:grid-cols-3",
|
|
1142
|
+
4: "2xl:grid-cols-4",
|
|
1143
|
+
6: "2xl:grid-cols-6",
|
|
1144
|
+
12: "2xl:grid-cols-12"
|
|
1145
|
+
}
|
|
1146
|
+
};
|
|
1147
|
+
function Ct(e) {
|
|
1148
|
+
if (!e) return "grid-cols-1";
|
|
1149
|
+
let t = [];
|
|
1150
|
+
for (let [n, r] of Object.entries(e)) {
|
|
1151
|
+
let e = St[n];
|
|
1152
|
+
if (e && r) {
|
|
1153
|
+
let n = Object.keys(e).map(Number).reduce((e, t) => Math.abs(t - r) < Math.abs(e - r) ? t : e);
|
|
1154
|
+
t.push(e[n]);
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
return t.join(" ") || "grid-cols-1";
|
|
1158
|
+
}
|
|
1159
|
+
var wt = {
|
|
1160
|
+
0: "gap-0",
|
|
1161
|
+
1: "gap-1",
|
|
1162
|
+
2: "gap-2",
|
|
1163
|
+
3: "gap-3",
|
|
1164
|
+
4: "gap-4",
|
|
1165
|
+
5: "gap-5",
|
|
1166
|
+
6: "gap-6",
|
|
1167
|
+
8: "gap-8"
|
|
1168
|
+
}, Tt = ({ columns: e, gap: t = 4, className: n, children: r }) => {
|
|
1169
|
+
let i = Ct(e), a = typeof t == "number" ? wt[t] || `gap-${t}` : "";
|
|
1170
|
+
return /* @__PURE__ */ F("div", {
|
|
1171
|
+
className: j("grid", i, a, n),
|
|
1172
|
+
children: r
|
|
1173
|
+
});
|
|
1174
|
+
}, Et = { type: "app" }, Dt = ({ schema: e, children: n, ...r }) => t(mt, {
|
|
1175
|
+
...r,
|
|
1176
|
+
schema: e?.schema ?? Et,
|
|
1177
|
+
children: n
|
|
1178
|
+
});
|
|
1179
|
+
function Ot() {
|
|
1180
|
+
a.register("page:card", _e, {
|
|
1057
1181
|
namespace: "layout",
|
|
1058
1182
|
skipFallback: !0,
|
|
1059
1183
|
label: "Page Card",
|
|
1060
1184
|
category: "Layout",
|
|
1061
1185
|
isContainer: !0
|
|
1062
|
-
}),
|
|
1063
|
-
namespace: "layout",
|
|
1064
|
-
label: "Responsive Grid",
|
|
1065
|
-
category: "Layout",
|
|
1066
|
-
isContainer: !0,
|
|
1067
|
-
inputs: [{
|
|
1068
|
-
name: "columns",
|
|
1069
|
-
type: "object"
|
|
1070
|
-
}, {
|
|
1071
|
-
name: "gap",
|
|
1072
|
-
type: "number"
|
|
1073
|
-
}]
|
|
1074
|
-
}), e.register("navigation-renderer", We, {
|
|
1075
|
-
namespace: "layout",
|
|
1076
|
-
label: "Navigation Renderer",
|
|
1077
|
-
category: "Layout",
|
|
1078
|
-
inputs: [{
|
|
1079
|
-
name: "items",
|
|
1080
|
-
type: "array",
|
|
1081
|
-
required: !0
|
|
1082
|
-
}, {
|
|
1083
|
-
name: "basePath",
|
|
1084
|
-
type: "string"
|
|
1085
|
-
}]
|
|
1086
|
-
}), e.register("app-schema-renderer", nt, {
|
|
1186
|
+
}), a.register("app-schema-renderer", Dt, {
|
|
1087
1187
|
namespace: "layout",
|
|
1088
1188
|
label: "App Schema Renderer",
|
|
1089
1189
|
category: "Layout",
|
|
@@ -1101,15 +1201,13 @@ function ot() {
|
|
|
1101
1201
|
name: "mobileNavMode",
|
|
1102
1202
|
type: "enum",
|
|
1103
1203
|
enum: ["drawer", "bottom_nav"],
|
|
1104
|
-
defaultValue: "drawer",
|
|
1105
|
-
label: "Mobile Nav Mode",
|
|
1106
1204
|
description: "Mobile navigation mode. \"drawer\" (default) puts the sidebar in the mobile sheet overlay; \"bottom_nav\" additionally renders a fixed bottom bar. These are the only two modes the renderer implements."
|
|
1107
1205
|
}
|
|
1108
1206
|
]
|
|
1109
1207
|
});
|
|
1110
1208
|
}
|
|
1111
1209
|
try {
|
|
1112
|
-
|
|
1210
|
+
Ot();
|
|
1113
1211
|
} catch {}
|
|
1114
1212
|
//#endregion
|
|
1115
|
-
export {
|
|
1213
|
+
export { mt as AppSchemaRenderer, Ce as AppShell, Ie as NAV_RUN_ACTION_PARAM, ot as NavigationRenderer, _e as PageCard, _t as PageHeader, Tt as ResponsiveGrid, xt as SidebarNav, Xe as filterNavigationItems, X as hasVisibleNavigationItems, Ot as registerLayout, Je as resolveActiveNavItem, Q as resolveHref, J as resolveIcon, De as resolveLabel, Y as resolveNavItemLabel, Se as useAppShellBranding };
|