@eintrek/erp-shell 0.1.39 → 0.1.40
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/index.esm.js +17 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +17 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -783,13 +783,27 @@ function AppBreadcrumb({ labels = {}, homeLabel = "แดชบอร์ด", ro
|
|
|
783
783
|
if (segments.length === 0) {
|
|
784
784
|
return jsxRuntime.jsx("h1", { className: "text-xl font-semibold", children: homeLabel });
|
|
785
785
|
}
|
|
786
|
-
return (jsxRuntime.jsx(erpTheme.Breadcrumb, { children: jsxRuntime.jsxs(erpTheme.BreadcrumbList, { children: [jsxRuntime.jsx(erpTheme.BreadcrumbItem, {
|
|
786
|
+
return (jsxRuntime.jsx(erpTheme.Breadcrumb, { children: jsxRuntime.jsxs(erpTheme.BreadcrumbList, { children: [jsxRuntime.jsx(erpTheme.BreadcrumbItem, { children: jsxRuntime.jsx(erpTheme.BreadcrumbLink, { asChild: true, children: jsxRuntime.jsx(Link, { href: "/", className: "font-thai text-[14px] font-normal text-white/80 hover:text-white transition-colors", children: rootLabel }) }) }), segments.map((segment, index) => {
|
|
787
787
|
const href = "/" + segments.slice(0, index + 1).join("/");
|
|
788
788
|
const isLast = index === segments.length - 1;
|
|
789
|
-
|
|
790
|
-
|
|
789
|
+
// A record id is not a place. Falling back to the raw segment put a
|
|
790
|
+
// 36-character uuid in the trail, which pushed everything before it
|
|
791
|
+
// off a phone and told the reader nothing they could use.
|
|
792
|
+
const label = labels[segment] ?? (isRecordID(segment) ? "รายละเอียด" : segment);
|
|
793
|
+
return (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsx(erpTheme.BreadcrumbSeparator, { className: "text-white/80", children: jsxRuntime.jsx(lucideReact.ChevronRight, { strokeWidth: 2, className: "h-4 w-4" }) }), jsxRuntime.jsx(erpTheme.BreadcrumbItem, { children: isLast ? (jsxRuntime.jsx(erpTheme.BreadcrumbPage, { className: "font-thai text-[14px] font-normal text-white/95 leading-none", children: decodeURIComponent(label) })) : (jsxRuntime.jsx(erpTheme.BreadcrumbLink, { asChild: true, children: jsxRuntime.jsx(Link, { href: href, className: "font-thai text-[14px] font-normal text-white/80 hover:text-white transition-colors leading-none", children: decodeURIComponent(label) }) })) })] }, `${segment}-${index}`));
|
|
791
794
|
})] }) }));
|
|
792
795
|
}
|
|
796
|
+
/**
|
|
797
|
+
* Whether a path segment is a record identifier rather than a page.
|
|
798
|
+
*
|
|
799
|
+
* Covers the uuid the APIs issue and the long opaque ids that show up in
|
|
800
|
+
* document routes. Deliberately narrow: a real page called "settings" must
|
|
801
|
+
* never be mistaken for one of these.
|
|
802
|
+
*/
|
|
803
|
+
function isRecordID(segment) {
|
|
804
|
+
return (/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(segment) ||
|
|
805
|
+
/^[0-9a-f]{24,}$/i.test(segment));
|
|
806
|
+
}
|
|
793
807
|
|
|
794
808
|
function isExternalHref(href) {
|
|
795
809
|
return /^https?:\/\//i.test(href) || href.startsWith("//");
|