@plumile/ui 0.1.68 → 0.1.69
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/lib/esm/admin/organisms/admin_sidebar/AdminSidebar.js +62 -0
- package/lib/esm/admin/organisms/admin_sidebar/AdminSidebar.js.map +1 -0
- package/lib/esm/admin/organisms/admin_sidebar/adminSidebar.css.js +17 -0
- package/lib/esm/admin/organisms/admin_sidebar/adminSidebar.css.js.map +1 -0
- package/lib/esm/{backoffice/organisms/backoffice_topbar/BackofficeTopbar.js → admin/organisms/admin_topbar/AdminTopbar.js} +4 -4
- package/lib/esm/admin/organisms/admin_topbar/AdminTopbar.js.map +1 -0
- package/lib/esm/admin/organisms/admin_topbar/adminTopbar.css.js +8 -0
- package/lib/esm/admin/organisms/admin_topbar/adminTopbar.css.js.map +1 -0
- package/lib/esm/admin/templates/admin_shell_layout/AdminShellLayout.js +19 -0
- package/lib/esm/admin/templates/admin_shell_layout/AdminShellLayout.js.map +1 -0
- package/lib/esm/admin/theme/AdminThemeProvider.js +11 -0
- package/lib/esm/admin/theme/AdminThemeProvider.js.map +1 -0
- package/lib/esm/admin/theme/adminTheme.css.js +7 -0
- package/lib/esm/admin/theme/adminTheme.css.js.map +1 -0
- package/lib/esm/atomic/atoms/badge/Badge.js +3 -3
- package/lib/esm/atomic/atoms/button/Button.js +1 -1
- package/lib/esm/atomic/atoms/checkbox/Checkbox.js +1 -1
- package/lib/esm/atomic/atoms/error_message/ErrorMessage.js +1 -1
- package/lib/esm/atomic/atoms/formatted-date/FormattedDate.js +4 -4
- package/lib/esm/atomic/atoms/label/Label.js +1 -1
- package/lib/esm/atomic/atoms/modal/Modal.js +13 -13
- package/lib/esm/atomic/molecules/breadcrumb_navigation/BreadcrumbMenuDropdown.js +12 -12
- package/lib/esm/atomic/molecules/breadcrumb_navigation/BreadcrumbMenuPopover.js +20 -20
- package/lib/esm/atomic/molecules/breadcrumb_navigation/BreadcrumbNavigation.js +14 -14
- package/lib/esm/atomic/molecules/card/Card.js +6 -6
- package/lib/esm/atomic/molecules/checkbox_field/CheckboxField.js +1 -1
- package/lib/esm/atomic/molecules/dropdown/Dropdown.js +80 -80
- package/lib/esm/atomic/molecules/dropdown/Dropdown.js.map +1 -1
- package/lib/esm/atomic/molecules/form/Form.js +1 -1
- package/lib/esm/atomic/molecules/form_error/FormError.js +1 -1
- package/lib/esm/atomic/molecules/highlight/HighlightCode.js +25 -25
- package/lib/esm/atomic/molecules/markdown/LazyMarkdownRenderer.js +7 -7
- package/lib/esm/atomic/molecules/markdown/MarkdownRenderer.js +33 -33
- package/lib/esm/atomic/molecules/markdown/MarkdownRenderer.js.map +1 -1
- package/lib/esm/atomic/molecules/markdown/components/LazyMarkdownCodeBlock.js +9 -9
- package/lib/esm/atomic/molecules/markdown/components/MarkdownCodeBlock.js +7 -7
- package/lib/esm/atomic/molecules/markdown/components/MarkdownCodeCopyButton.js +9 -9
- package/lib/esm/atomic/molecules/markdown/components/MarkdownFootnotesSection.js +7 -7
- package/lib/esm/atomic/molecules/markdown/components/MarkdownMermaidBlock.js +34 -34
- package/lib/esm/atomic/molecules/markdown/components/MarkdownShikiCodeBlock.js +4 -4
- package/lib/esm/atomic/molecules/profile_dropdown/ProfileDropdown.js +25 -25
- package/lib/esm/atomic/molecules/toast/ToastProvider.js +15 -15
- package/lib/esm/atomic/molecules/toast/ToastViewport.js +15 -15
- package/lib/esm/atomic/organisms/login_form/LoginForm.js +1 -1
- package/lib/esm/atomic/organisms/sidebar/NavigationSidebar.js +34 -34
- package/lib/esm/atomic/organisms/sidebar/icons.js +13 -13
- package/lib/esm/atomic/templates/auth_layout/AuthLayout.js +1 -1
- package/lib/esm/backoffice/atoms/copyable_text/CopyableText.js +10 -10
- package/lib/esm/backoffice/atoms/shortcut_hint/ShortcutHint.js +6 -6
- package/lib/esm/backoffice/atoms/tag/Tag.js +7 -7
- package/lib/esm/backoffice/molecules/backoffice_filter_drawer/BackofficeFilterDrawer.js +22 -22
- package/lib/esm/backoffice/molecules/backoffice_json_viewer/BackofficeJsonViewer.js +12 -12
- package/lib/esm/backoffice/molecules/backoffice_json_viewer/LazyBackofficeJsonViewer.js +11 -11
- package/lib/esm/backoffice/molecules/backoffice_relations_menu/BackofficeRelationsMenu.js +12 -12
- package/lib/esm/backoffice/molecules/confirm_dialog/ConfirmDialog.js +9 -9
- package/lib/esm/backoffice/molecules/global_search_input/GlobalSearchInput.js +5 -5
- package/lib/esm/backoffice/molecules/sidebar_collapse_toggle/SidebarCollapseToggle.js +7 -7
- package/lib/esm/backoffice/molecules/sidebar_nav_item/SidebarNavItem.js +26 -26
- package/lib/esm/backoffice/molecules/sidebar_nav_item/SidebarNavItem.js.map +1 -1
- package/lib/esm/backoffice/molecules/sidebar_nav_section/SidebarNavSection.js +11 -11
- package/lib/esm/backoffice/organisms/backoffice_data_table/BackofficeDataTable.js +20 -20
- package/lib/esm/components/data-table/TableCell.js +17 -17
- package/lib/esm/components/data-table/VirtualizedConnectionTable.js +27 -27
- package/lib/esm/components/layout/AppShell.js +14 -0
- package/lib/esm/components/layout/AppShell.js.map +1 -0
- package/lib/esm/components/layout/PageShell.js +65 -65
- package/lib/esm/components/layout/PageShell.js.map +1 -1
- package/lib/esm/components/layout/SettingsLayout.css.js +8 -0
- package/lib/esm/components/layout/SettingsLayout.css.js.map +1 -0
- package/lib/esm/{backoffice/templates/settings_template/SettingsTemplate.js → components/layout/SettingsLayout.js} +5 -5
- package/lib/esm/components/layout/SettingsLayout.js.map +1 -0
- package/lib/esm/components/layout/SplitViewLayout.css.js +8 -0
- package/lib/esm/components/layout/SplitViewLayout.css.js.map +1 -0
- package/lib/esm/{backoffice/templates/split_view_template/SplitViewTemplate.js → components/layout/SplitViewLayout.js} +5 -5
- package/lib/esm/components/layout/SplitViewLayout.js.map +1 -0
- package/lib/esm/components/select/SimpleSelect.js +23 -23
- package/lib/esm/index.js +105 -104
- package/lib/esm/node_modules/react-shiki/dist/chunk-QPJZGYHO.js +23 -23
- package/lib/esm/node_modules/react-shiki/dist/chunk-QPJZGYHO.js.map +1 -1
- package/lib/esm/style.css +1 -1
- package/lib/esm/theme/ThemeProvider.js +11 -11
- package/lib/esm/theme/VisuallyHidden.js +3 -3
- package/lib/esm/theme/index.js +9 -9
- package/lib/types/{backoffice/organisms/backoffice_sidebar/BackofficeSidebar.d.ts → admin/organisms/admin_sidebar/AdminSidebar.d.ts} +7 -7
- package/lib/types/admin/organisms/admin_sidebar/AdminSidebar.d.ts.map +1 -0
- package/lib/types/{backoffice/organisms/backoffice_sidebar/backofficeSidebar.css.d.ts → admin/organisms/admin_sidebar/adminSidebar.css.d.ts} +1 -1
- package/lib/types/admin/organisms/admin_sidebar/adminSidebar.css.d.ts.map +1 -0
- package/lib/types/admin/organisms/admin_topbar/AdminTopbar.d.ts +10 -0
- package/lib/types/admin/organisms/admin_topbar/AdminTopbar.d.ts.map +1 -0
- package/lib/types/{backoffice/organisms/backoffice_topbar/backofficeTopbar.css.d.ts → admin/organisms/admin_topbar/adminTopbar.css.d.ts} +1 -1
- package/lib/types/admin/organisms/admin_topbar/adminTopbar.css.d.ts.map +1 -0
- package/lib/types/admin/templates/admin_shell_layout/AdminShellLayout.d.ts +14 -0
- package/lib/types/admin/templates/admin_shell_layout/AdminShellLayout.d.ts.map +1 -0
- package/lib/types/admin/theme/AdminThemeProvider.d.ts +7 -0
- package/lib/types/admin/theme/AdminThemeProvider.d.ts.map +1 -0
- package/lib/types/admin/theme/adminTheme.css.d.ts +2 -0
- package/lib/types/admin/theme/adminTheme.css.d.ts.map +1 -0
- package/lib/types/components/layout/AppShell.d.ts +12 -0
- package/lib/types/components/layout/AppShell.d.ts.map +1 -0
- package/lib/types/{backoffice/templates/settings_template/settingsTemplate.css.d.ts → components/layout/SettingsLayout.css.d.ts} +1 -1
- package/lib/types/components/layout/SettingsLayout.css.d.ts.map +1 -0
- package/lib/types/components/layout/SettingsLayout.d.ts +11 -0
- package/lib/types/components/layout/SettingsLayout.d.ts.map +1 -0
- package/lib/types/{backoffice/templates/split_view_template/splitViewTemplate.css.d.ts → components/layout/SplitViewLayout.css.d.ts} +1 -1
- package/lib/types/components/layout/SplitViewLayout.css.d.ts.map +1 -0
- package/lib/types/components/layout/SplitViewLayout.d.ts +11 -0
- package/lib/types/components/layout/SplitViewLayout.d.ts.map +1 -0
- package/lib/types/index.d.ts +9 -8
- package/lib/types/index.d.ts.map +1 -1
- package/package.json +10 -10
- package/lib/esm/backoffice/organisms/backoffice_app_shell/BackofficeAppShell.js +0 -14
- package/lib/esm/backoffice/organisms/backoffice_app_shell/BackofficeAppShell.js.map +0 -1
- package/lib/esm/backoffice/organisms/backoffice_sidebar/BackofficeSidebar.js +0 -62
- package/lib/esm/backoffice/organisms/backoffice_sidebar/BackofficeSidebar.js.map +0 -1
- package/lib/esm/backoffice/organisms/backoffice_sidebar/backofficeSidebar.css.js +0 -17
- package/lib/esm/backoffice/organisms/backoffice_sidebar/backofficeSidebar.css.js.map +0 -1
- package/lib/esm/backoffice/organisms/backoffice_topbar/BackofficeTopbar.js.map +0 -1
- package/lib/esm/backoffice/organisms/backoffice_topbar/backofficeTopbar.css.js +0 -8
- package/lib/esm/backoffice/organisms/backoffice_topbar/backofficeTopbar.css.js.map +0 -1
- package/lib/esm/backoffice/templates/backoffice_shell_template/BackofficeShellTemplate.js +0 -19
- package/lib/esm/backoffice/templates/backoffice_shell_template/BackofficeShellTemplate.js.map +0 -1
- package/lib/esm/backoffice/templates/settings_template/SettingsTemplate.js.map +0 -1
- package/lib/esm/backoffice/templates/settings_template/settingsTemplate.css.js +0 -8
- package/lib/esm/backoffice/templates/settings_template/settingsTemplate.css.js.map +0 -1
- package/lib/esm/backoffice/templates/split_view_template/SplitViewTemplate.js.map +0 -1
- package/lib/esm/backoffice/templates/split_view_template/splitViewTemplate.css.js +0 -8
- package/lib/esm/backoffice/templates/split_view_template/splitViewTemplate.css.js.map +0 -1
- package/lib/esm/backoffice/theme/BackofficeThemeProvider.js +0 -11
- package/lib/esm/backoffice/theme/BackofficeThemeProvider.js.map +0 -1
- package/lib/esm/backoffice/theme/backofficeTheme.css.js +0 -7
- package/lib/esm/backoffice/theme/backofficeTheme.css.js.map +0 -1
- package/lib/types/backoffice/organisms/backoffice_app_shell/BackofficeAppShell.d.ts +0 -12
- package/lib/types/backoffice/organisms/backoffice_app_shell/BackofficeAppShell.d.ts.map +0 -1
- package/lib/types/backoffice/organisms/backoffice_sidebar/BackofficeSidebar.d.ts.map +0 -1
- package/lib/types/backoffice/organisms/backoffice_sidebar/backofficeSidebar.css.d.ts.map +0 -1
- package/lib/types/backoffice/organisms/backoffice_topbar/BackofficeTopbar.d.ts +0 -10
- package/lib/types/backoffice/organisms/backoffice_topbar/BackofficeTopbar.d.ts.map +0 -1
- package/lib/types/backoffice/organisms/backoffice_topbar/backofficeTopbar.css.d.ts.map +0 -1
- package/lib/types/backoffice/templates/backoffice_shell_template/BackofficeShellTemplate.d.ts +0 -14
- package/lib/types/backoffice/templates/backoffice_shell_template/BackofficeShellTemplate.d.ts.map +0 -1
- package/lib/types/backoffice/templates/settings_template/SettingsTemplate.d.ts +0 -11
- package/lib/types/backoffice/templates/settings_template/SettingsTemplate.d.ts.map +0 -1
- package/lib/types/backoffice/templates/settings_template/settingsTemplate.css.d.ts.map +0 -1
- package/lib/types/backoffice/templates/split_view_template/SplitViewTemplate.d.ts +0 -11
- package/lib/types/backoffice/templates/split_view_template/SplitViewTemplate.d.ts.map +0 -1
- package/lib/types/backoffice/templates/split_view_template/splitViewTemplate.css.d.ts.map +0 -1
- package/lib/types/backoffice/theme/BackofficeThemeProvider.d.ts +0 -7
- package/lib/types/backoffice/theme/BackofficeThemeProvider.d.ts.map +0 -1
- package/lib/types/backoffice/theme/backofficeTheme.css.d.ts +0 -2
- package/lib/types/backoffice/theme/backofficeTheme.css.d.ts.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./LazyBackofficeJsonViewer.css.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Suspense as e, lazy as t } from "react";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
4
|
//#region src/backoffice/molecules/backoffice_json_viewer/LazyBackofficeJsonViewer.tsx
|
|
5
|
-
var r =
|
|
5
|
+
var r = t(async () => ({ default: (await import("./BackofficeJsonViewer.js")).BackofficeJsonViewer })), i = (e) => {
|
|
6
6
|
try {
|
|
7
7
|
return JSON.stringify(e, null, 2);
|
|
8
8
|
} catch (e) {
|
|
@@ -12,15 +12,15 @@ var r = n(async () => ({ default: (await import("./BackofficeJsonViewer.js")).Ba
|
|
|
12
12
|
message: t
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
-
}, a = ({ value:
|
|
16
|
-
className:
|
|
17
|
-
children: i(
|
|
18
|
-
}), o = (
|
|
19
|
-
fallback: /* @__PURE__ */
|
|
20
|
-
value:
|
|
21
|
-
className:
|
|
15
|
+
}, a = ({ value: e, className: t }) => /* @__PURE__ */ n("pre", {
|
|
16
|
+
className: t ?? "_13lprza0",
|
|
17
|
+
children: i(e)
|
|
18
|
+
}), o = (t) => /* @__PURE__ */ n(e, {
|
|
19
|
+
fallback: /* @__PURE__ */ n(a, {
|
|
20
|
+
value: t.value,
|
|
21
|
+
className: t.className
|
|
22
22
|
}),
|
|
23
|
-
children: /* @__PURE__ */
|
|
23
|
+
children: /* @__PURE__ */ n(r, { ...t })
|
|
24
24
|
});
|
|
25
25
|
//#endregion
|
|
26
26
|
export { o as LazyBackofficeJsonViewer, o as default };
|
|
@@ -3,13 +3,13 @@ import { Button as t } from "../../../atomic/atoms/button/Button.js";
|
|
|
3
3
|
import { container as n, triggerIcon as r, triggerIconOpen as i } from "./backofficeRelationsMenu.css.js";
|
|
4
4
|
import { ChevronDownIcon as a } from "../../../svg/ChevronDownIcon.js";
|
|
5
5
|
import "../../../index.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { useEffect as o, useRef as s, useState as c } from "react";
|
|
7
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
8
|
import { Link as d } from "@plumile/router";
|
|
9
9
|
//#region src/backoffice/molecules/backoffice_relations_menu/BackofficeRelationsMenu.tsx
|
|
10
10
|
var f = ({ label: f = "Relations", items: p }) => {
|
|
11
|
-
let [m, h] =
|
|
12
|
-
return
|
|
11
|
+
let [m, h] = c(!1), g = s(null);
|
|
12
|
+
return o(() => {
|
|
13
13
|
if (!m) return;
|
|
14
14
|
let e = (e) => {
|
|
15
15
|
e.target instanceof Node && (g.current?.contains(e.target) || h(!1));
|
|
@@ -17,16 +17,16 @@ var f = ({ label: f = "Relations", items: p }) => {
|
|
|
17
17
|
return document.addEventListener("pointerdown", e), () => {
|
|
18
18
|
document.removeEventListener("pointerdown", e);
|
|
19
19
|
};
|
|
20
|
-
}, [m]), p.length === 0 ? /* @__PURE__ */
|
|
20
|
+
}, [m]), p.length === 0 ? /* @__PURE__ */ l(t, {
|
|
21
21
|
type: "button",
|
|
22
22
|
variant: "secondary",
|
|
23
23
|
size: "small",
|
|
24
24
|
disabled: !0,
|
|
25
25
|
children: f
|
|
26
|
-
}) : /* @__PURE__ */
|
|
26
|
+
}) : /* @__PURE__ */ u("div", {
|
|
27
27
|
className: n,
|
|
28
28
|
ref: g,
|
|
29
|
-
children: [/* @__PURE__ */
|
|
29
|
+
children: [/* @__PURE__ */ u(t, {
|
|
30
30
|
type: "button",
|
|
31
31
|
variant: "secondary",
|
|
32
32
|
size: "small",
|
|
@@ -35,25 +35,25 @@ var f = ({ label: f = "Relations", items: p }) => {
|
|
|
35
35
|
},
|
|
36
36
|
"aria-expanded": m,
|
|
37
37
|
"aria-haspopup": "menu",
|
|
38
|
-
children: [f, /* @__PURE__ */
|
|
38
|
+
children: [f, /* @__PURE__ */ l(a, {
|
|
39
39
|
size: 14,
|
|
40
40
|
className: e(r, { [i]: m })
|
|
41
41
|
})]
|
|
42
|
-
}), m && /* @__PURE__ */
|
|
42
|
+
}), m && /* @__PURE__ */ l("div", {
|
|
43
43
|
className: "_16f61fj3",
|
|
44
44
|
role: "menu",
|
|
45
45
|
children: p.map((e) => {
|
|
46
46
|
let t = null;
|
|
47
|
-
return typeof e.count == "number" && (t = e.count), /* @__PURE__ */
|
|
47
|
+
return typeof e.count == "number" && (t = e.count), /* @__PURE__ */ u(d, {
|
|
48
48
|
to: e.href,
|
|
49
49
|
className: "_16f61fj4",
|
|
50
50
|
onClick: (t) => {
|
|
51
51
|
h(!1), (e.onClick?.(t))?.catch(() => {});
|
|
52
52
|
},
|
|
53
|
-
children: [/* @__PURE__ */
|
|
53
|
+
children: [/* @__PURE__ */ l("span", {
|
|
54
54
|
className: "_16f61fj5",
|
|
55
55
|
children: e.label
|
|
56
|
-
}), t != null && /* @__PURE__ */
|
|
56
|
+
}), t != null && /* @__PURE__ */ l("span", {
|
|
57
57
|
className: "_16f61fj6",
|
|
58
58
|
children: t
|
|
59
59
|
})]
|
|
@@ -2,13 +2,13 @@ import { Button as e } from "../../../atomic/atoms/button/Button.js";
|
|
|
2
2
|
import { ErrorMessage as t } from "../../../atomic/atoms/error_message/ErrorMessage.js";
|
|
3
3
|
import { Modal as n } from "../../../atomic/atoms/modal/Modal.js";
|
|
4
4
|
import { body as r, footer as i } from "./confirmDialog.css.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { useCallback as a, useState as o } from "react";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
7
|
//#region src/backoffice/molecules/confirm_dialog/ConfirmDialog.tsx
|
|
8
8
|
var l = ({ isOpen: l, title: u, children: d, confirmLabel: f = "Confirm", cancelLabel: p = "Cancel", confirmTone: m = "default", onClose: h, onConfirm: g, closeOnConfirm: _ = !0 }) => {
|
|
9
|
-
let [v, y] =
|
|
9
|
+
let [v, y] = o(!1), [b, x] = o(null), S = a(() => {
|
|
10
10
|
v || (x(null), h());
|
|
11
|
-
}, [v, h]), C =
|
|
11
|
+
}, [v, h]), C = a(async () => {
|
|
12
12
|
if (!v) {
|
|
13
13
|
x(null), y(!0);
|
|
14
14
|
try {
|
|
@@ -27,15 +27,15 @@ var l = ({ isOpen: l, title: u, children: d, confirmLabel: f = "Confirm", cancel
|
|
|
27
27
|
g
|
|
28
28
|
]), w = "primary";
|
|
29
29
|
m === "danger" && (w = "danger");
|
|
30
|
-
let T = /* @__PURE__ */
|
|
30
|
+
let T = /* @__PURE__ */ c("div", {
|
|
31
31
|
className: i,
|
|
32
|
-
children: [/* @__PURE__ */
|
|
32
|
+
children: [/* @__PURE__ */ s(e, {
|
|
33
33
|
type: "button",
|
|
34
34
|
variant: "secondary",
|
|
35
35
|
onClick: S,
|
|
36
36
|
disabled: v,
|
|
37
37
|
children: p
|
|
38
|
-
}), /* @__PURE__ */
|
|
38
|
+
}), /* @__PURE__ */ s(e, {
|
|
39
39
|
type: "button",
|
|
40
40
|
variant: w,
|
|
41
41
|
onClick: () => {
|
|
@@ -45,12 +45,12 @@ var l = ({ isOpen: l, title: u, children: d, confirmLabel: f = "Confirm", cancel
|
|
|
45
45
|
children: f
|
|
46
46
|
})]
|
|
47
47
|
}), E = null;
|
|
48
|
-
return b != null && (E = /* @__PURE__ */
|
|
48
|
+
return b != null && (E = /* @__PURE__ */ s(t, { children: b })), /* @__PURE__ */ s(n, {
|
|
49
49
|
isOpen: l,
|
|
50
50
|
onClose: S,
|
|
51
51
|
title: u,
|
|
52
52
|
footer: T,
|
|
53
|
-
children: /* @__PURE__ */
|
|
53
|
+
children: /* @__PURE__ */ c("div", {
|
|
54
54
|
className: r,
|
|
55
55
|
children: [E, d]
|
|
56
56
|
})
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Input as e } from "../../../atomic/atoms/input/Input.js";
|
|
2
2
|
import { ModalCloseSvg as t } from "../../../icons/ModalCloseSvg.js";
|
|
3
3
|
import { SidebarSearchSvg as n } from "../../../icons/SidebarSearchSvg.js";
|
|
4
|
-
import {
|
|
5
|
-
import { clearButton as i, container as a } from "./globalSearchInput.css.js";
|
|
4
|
+
import { clearButton as r, container as i } from "./globalSearchInput.css.js";
|
|
6
5
|
import "../../../index.js";
|
|
6
|
+
import { ShortcutHint as a } from "../../atoms/shortcut_hint/ShortcutHint.js";
|
|
7
7
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
8
|
//#region src/backoffice/molecules/global_search_input/GlobalSearchInput.tsx
|
|
9
9
|
var c = ({ value: c, onChange: l, placeholder: u = "Search…", ariaLabel: d, className: f, shortcut: p, rightSlot: m, clearLabel: h = "Clear search" }) => {
|
|
@@ -14,7 +14,7 @@ var c = ({ value: c, onChange: l, placeholder: u = "Search…", ariaLabel: d, cl
|
|
|
14
14
|
onClick: () => {
|
|
15
15
|
l("");
|
|
16
16
|
},
|
|
17
|
-
className:
|
|
17
|
+
className: r,
|
|
18
18
|
children: /* @__PURE__ */ o(t, {
|
|
19
19
|
width: 16,
|
|
20
20
|
height: 16,
|
|
@@ -22,9 +22,9 @@ var c = ({ value: c, onChange: l, placeholder: u = "Search…", ariaLabel: d, cl
|
|
|
22
22
|
})
|
|
23
23
|
}));
|
|
24
24
|
let y = null;
|
|
25
|
-
p != null && (y = /* @__PURE__ */ o(
|
|
25
|
+
p != null && (y = /* @__PURE__ */ o(a, { keys: p }));
|
|
26
26
|
let b = /* @__PURE__ */ s("span", {
|
|
27
|
-
className:
|
|
27
|
+
className: i,
|
|
28
28
|
children: [
|
|
29
29
|
v,
|
|
30
30
|
y,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { ChevronLeftSvg as e } from "../../../icons/ChevronLeftSvg.js";
|
|
2
|
+
import { ChevronRightSvg as t } from "../../../icons/ChevronRightSvg.js";
|
|
3
|
+
import { cx as n } from "../../../theme/tools.js";
|
|
4
|
+
import "../../../index.js";
|
|
4
5
|
import { ShortcutHint as r } from "../../atoms/shortcut_hint/ShortcutHint.js";
|
|
5
6
|
import { button as i, icon as a, label as o } from "./sidebarCollapseToggle.css.js";
|
|
6
|
-
import "../../../index.js";
|
|
7
7
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
8
|
//#region src/backoffice/molecules/sidebar_collapse_toggle/SidebarCollapseToggle.tsx
|
|
9
9
|
var l = ({ isCollapsed: l, onToggle: u, label: d = "Collapse", shortcut: f, className: p }) => {
|
|
10
|
-
let m =
|
|
11
|
-
l && (m =
|
|
10
|
+
let m = e, h = d;
|
|
11
|
+
l && (m = t, h = "Expand");
|
|
12
12
|
let g = null;
|
|
13
13
|
return f != null && (g = /* @__PURE__ */ s(r, { keys: f })), /* @__PURE__ */ c("button", {
|
|
14
14
|
type: "button",
|
|
15
|
-
className:
|
|
15
|
+
className: n(i, p),
|
|
16
16
|
onClick: u,
|
|
17
17
|
"aria-pressed": l,
|
|
18
18
|
children: [
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { cx as e } from "../../../theme/tools.js";
|
|
2
|
-
import { actionSlot as t, actions as ee, actionsVisible as te, badge as
|
|
2
|
+
import { actionSlot as t, actions as ee, actionsVisible as te, badge as n, badgeCollapsed as r, dragHandle as i, icon as a, item as o, itemActive as s, itemCollapsed as c, itemDisabled as l, label as u, labelCollapsed as ne, link as d } from "./sidebarNavItem.css.js";
|
|
3
3
|
import "../../../index.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { useCallback as re, useEffect as ie, useRef as f, useState as p } from "react";
|
|
5
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
6
6
|
import { Link as _ } from "@plumile/router";
|
|
7
7
|
//#region src/backoffice/molecules/sidebar_nav_item/SidebarNavItem.tsx
|
|
8
8
|
var v = _, y = ({ label: _, href: y, icon: b, badge: x, isActive: S = !1, disabled: C = !1, onClick: ae, onDragStart: oe, onDragOver: se, onDrop: ce, onDragEnd: le, collapsed: w = !1, ariaLabel: ue, className: T, actionSlot: E, dragHandleSlot: D, dragHandleLabel: O, draggable: k = !1 }) => {
|
|
9
|
-
let A =
|
|
10
|
-
w && I.push(
|
|
9
|
+
let A = f(null), j = f(null), [M, N] = p(!1), [P, F] = p(!1), I = [o];
|
|
10
|
+
w && I.push(c), S && I.push(s), C && I.push(l), T != null && I.push(T);
|
|
11
11
|
let L = e(...I), R = ue;
|
|
12
12
|
R == null && typeof _ == "string" && (R = _);
|
|
13
13
|
let z, B;
|
|
@@ -15,33 +15,33 @@ var v = _, y = ({ label: _, href: y, icon: b, badge: x, isActive: S = !1, disabl
|
|
|
15
15
|
let V;
|
|
16
16
|
S && (V = "page");
|
|
17
17
|
let H = null;
|
|
18
|
-
b != null && (H = /* @__PURE__ */
|
|
19
|
-
className:
|
|
18
|
+
b != null && (H = /* @__PURE__ */ h("span", {
|
|
19
|
+
className: a,
|
|
20
20
|
children: b
|
|
21
21
|
}));
|
|
22
22
|
let U = null;
|
|
23
|
-
w && (U =
|
|
24
|
-
let de = e(
|
|
23
|
+
w && (U = ne);
|
|
24
|
+
let de = e(u, U), W = null;
|
|
25
25
|
if (x != null) {
|
|
26
26
|
let t = null;
|
|
27
|
-
w && (t =
|
|
28
|
-
className: e(
|
|
27
|
+
w && (t = r), W = /* @__PURE__ */ h("span", {
|
|
28
|
+
className: e(n, t),
|
|
29
29
|
children: x
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
let G = /* @__PURE__ */
|
|
32
|
+
let G = /* @__PURE__ */ g(m, { children: [
|
|
33
33
|
H,
|
|
34
|
-
/* @__PURE__ */
|
|
34
|
+
/* @__PURE__ */ h("span", {
|
|
35
35
|
className: de,
|
|
36
36
|
children: _
|
|
37
37
|
}),
|
|
38
38
|
W
|
|
39
39
|
] }), K = () => {
|
|
40
40
|
ae?.();
|
|
41
|
-
}, q = !w && !C && (E != null || D != null), J =
|
|
41
|
+
}, q = !w && !C && (E != null || D != null), J = re(() => {
|
|
42
42
|
j.current != null && (clearTimeout(j.current), j.current = null);
|
|
43
43
|
}, []);
|
|
44
|
-
|
|
44
|
+
ie(() => (q || (N(!1), F(!1), J()), () => {
|
|
45
45
|
J();
|
|
46
46
|
}), [J, q]);
|
|
47
47
|
let fe = () => {
|
|
@@ -60,23 +60,23 @@ var v = _, y = ({ label: _, href: y, icon: b, badge: x, isActive: S = !1, disabl
|
|
|
60
60
|
let t = e.relatedTarget;
|
|
61
61
|
t != null && A.current?.contains(t) || F(!1);
|
|
62
62
|
}, Y;
|
|
63
|
-
Y = C ? /* @__PURE__ */
|
|
64
|
-
className:
|
|
63
|
+
Y = C ? /* @__PURE__ */ h("span", {
|
|
64
|
+
className: d,
|
|
65
65
|
"aria-disabled": "true",
|
|
66
66
|
"aria-label": z,
|
|
67
67
|
title: B,
|
|
68
68
|
children: G
|
|
69
|
-
}) : y == null ? /* @__PURE__ */
|
|
69
|
+
}) : y == null ? /* @__PURE__ */ h("button", {
|
|
70
70
|
type: "button",
|
|
71
|
-
className:
|
|
71
|
+
className: d,
|
|
72
72
|
onClick: K,
|
|
73
73
|
"aria-current": V,
|
|
74
74
|
"aria-label": z,
|
|
75
75
|
title: B,
|
|
76
76
|
children: G
|
|
77
|
-
}) : /* @__PURE__ */
|
|
77
|
+
}) : /* @__PURE__ */ h(v, {
|
|
78
78
|
to: y,
|
|
79
|
-
className:
|
|
79
|
+
className: d,
|
|
80
80
|
"aria-current": V,
|
|
81
81
|
"aria-label": z,
|
|
82
82
|
title: B,
|
|
@@ -86,9 +86,9 @@ var v = _, y = ({ label: _, href: y, icon: b, badge: x, isActive: S = !1, disabl
|
|
|
86
86
|
let ge = q && (M || P), X;
|
|
87
87
|
ge && (X = te);
|
|
88
88
|
let _e = e(ee, X), Z = null;
|
|
89
|
-
D != null && !w && (Z = /* @__PURE__ */
|
|
89
|
+
D != null && !w && (Z = /* @__PURE__ */ h("button", {
|
|
90
90
|
type: "button",
|
|
91
|
-
className:
|
|
91
|
+
className: i,
|
|
92
92
|
draggable: k,
|
|
93
93
|
onDragStart: oe,
|
|
94
94
|
onDragEnd: le,
|
|
@@ -97,15 +97,15 @@ var v = _, y = ({ label: _, href: y, icon: b, badge: x, isActive: S = !1, disabl
|
|
|
97
97
|
children: D
|
|
98
98
|
}));
|
|
99
99
|
let Q = null;
|
|
100
|
-
E != null && !w && (Q = /* @__PURE__ */
|
|
100
|
+
E != null && !w && (Q = /* @__PURE__ */ h("span", {
|
|
101
101
|
className: t,
|
|
102
102
|
children: E
|
|
103
103
|
}));
|
|
104
104
|
let $ = null;
|
|
105
|
-
return q && ($ = /* @__PURE__ */
|
|
105
|
+
return q && ($ = /* @__PURE__ */ g("span", {
|
|
106
106
|
className: _e,
|
|
107
107
|
children: [Z, Q]
|
|
108
|
-
})), /* @__PURE__ */
|
|
108
|
+
})), /* @__PURE__ */ g("div", {
|
|
109
109
|
className: L,
|
|
110
110
|
onDragOver: se,
|
|
111
111
|
onDrop: ce,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarNavItem.js","names":[],"sources":["../../../../../src/backoffice/molecules/sidebar_nav_item/SidebarNavItem.tsx"],"sourcesContent":["import { Link } from '@plumile/router';\nimport {\n type AnchorHTMLAttributes,\n type ComponentPropsWithoutRef,\n type DragEvent,\n type FocusEvent,\n type JSX,\n type ReactNode,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport * as styles from './sidebarNavItem.css.js';\nimport { cx } from '@plumile/ui';\n\ntype RouterLinkProps = ComponentPropsWithoutRef<typeof Link> &\n AnchorHTMLAttributes<HTMLAnchorElement>;\nconst RouterLink = Link as unknown as (props: RouterLinkProps) => JSX.Element;\n\nexport type SidebarNavItemProps = {\n label: ReactNode;\n href?: string;\n icon?: ReactNode;\n badge?: ReactNode;\n isActive?: boolean;\n disabled?: boolean;\n onClick?: () => void;\n onDragStart?: (event: DragEvent) => void;\n onDragOver?: (event: DragEvent) => void;\n onDrop?: (event: DragEvent) => void;\n onDragEnd?: (event: DragEvent) => void;\n collapsed?: boolean;\n ariaLabel?: string;\n className?: string;\n actionSlot?: ReactNode;\n dragHandleSlot?: ReactNode;\n dragHandleLabel?: string;\n draggable?: boolean;\n};\n\nexport const SidebarNavItem = ({\n label,\n href,\n icon,\n badge,\n isActive = false,\n disabled = false,\n onClick,\n onDragStart,\n onDragOver,\n onDrop,\n onDragEnd,\n collapsed = false,\n ariaLabel,\n className,\n actionSlot,\n dragHandleSlot,\n dragHandleLabel,\n draggable = false,\n}: SidebarNavItemProps): JSX.Element => {\n const itemRef = useRef<HTMLDivElement | null>(null);\n const hoverTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const [isHoverIntent, setIsHoverIntent] = useState(false);\n const [isFocusWithin, setIsFocusWithin] = useState(false);\n\n const itemClassNames: (string | null | undefined)[] = [styles.item];\n if (collapsed) {\n itemClassNames.push(styles.itemCollapsed);\n }\n if (isActive) {\n itemClassNames.push(styles.itemActive);\n }\n if (disabled) {\n itemClassNames.push(styles.itemDisabled);\n }\n if (className != null) {\n itemClassNames.push(className);\n }\n const itemClassName = cx(...itemClassNames);\n\n let resolvedAriaLabel: string | undefined = ariaLabel;\n if (resolvedAriaLabel == null && typeof label === 'string') {\n resolvedAriaLabel = label;\n }\n\n let collapsedAriaLabel: string | undefined;\n let collapsedTitle: string | undefined;\n if (collapsed) {\n collapsedAriaLabel = resolvedAriaLabel;\n collapsedTitle = resolvedAriaLabel;\n }\n\n let ariaCurrent: 'page' | undefined;\n if (isActive) {\n ariaCurrent = 'page';\n }\n\n let iconNode: JSX.Element | null = null;\n if (icon != null) {\n iconNode = <span className={styles.icon}>{icon}</span>;\n }\n\n let labelExtraClass: string | null = null;\n if (collapsed) {\n labelExtraClass = styles.labelCollapsed;\n }\n const labelClassName = cx(styles.label, labelExtraClass);\n\n let badgeNode: JSX.Element | null = null;\n if (badge != null) {\n let badgeExtraClass: string | null = null;\n if (collapsed) {\n badgeExtraClass = styles.badgeCollapsed;\n }\n badgeNode = (\n <span className={cx(styles.badge, badgeExtraClass)}>{badge}</span>\n );\n }\n\n const content = (\n <>\n {iconNode}\n <span className={labelClassName}>{label}</span>\n {badgeNode}\n </>\n );\n\n const handleClick = (): void => {\n if (onClick != null) {\n onClick();\n }\n };\n\n const shouldRenderActions =\n !collapsed && !disabled && (actionSlot != null || dragHandleSlot != null);\n\n const clearHoverTimeout = useCallback((): void => {\n if (hoverTimeoutRef.current != null) {\n clearTimeout(hoverTimeoutRef.current);\n hoverTimeoutRef.current = null;\n }\n }, []);\n\n useEffect(() => {\n if (!shouldRenderActions) {\n setIsHoverIntent(false);\n setIsFocusWithin(false);\n clearHoverTimeout();\n }\n\n return () => {\n clearHoverTimeout();\n };\n }, [clearHoverTimeout, shouldRenderActions]);\n\n const handleMouseEnter = (): void => {\n if (!shouldRenderActions) {\n return;\n }\n clearHoverTimeout();\n hoverTimeoutRef.current = setTimeout(() => {\n setIsHoverIntent(true);\n }, 150);\n };\n\n const handleMouseLeave = (): void => {\n clearHoverTimeout();\n setIsHoverIntent(false);\n };\n\n const handleFocusCapture = (): void => {\n if (!shouldRenderActions) {\n return;\n }\n setIsFocusWithin(true);\n };\n\n const handleBlurCapture = (event: FocusEvent<HTMLDivElement>): void => {\n if (!shouldRenderActions) {\n setIsFocusWithin(false);\n return;\n }\n const nextTarget = event.relatedTarget as Node | null;\n if (nextTarget != null && itemRef.current?.contains(nextTarget)) {\n return;\n }\n setIsFocusWithin(false);\n };\n\n let mainNode: JSX.Element;\n if (disabled) {\n mainNode = (\n <span\n className={styles.link}\n aria-disabled=\"true\"\n aria-label={collapsedAriaLabel}\n title={collapsedTitle}\n >\n {content}\n </span>\n );\n } else if (href != null) {\n mainNode = (\n <RouterLink\n to={href}\n className={styles.link}\n aria-current={ariaCurrent}\n aria-label={collapsedAriaLabel}\n title={collapsedTitle}\n onClick={handleClick}\n >\n {content}\n </RouterLink>\n );\n } else {\n mainNode = (\n <button\n type=\"button\"\n className={styles.link}\n onClick={handleClick}\n aria-current={ariaCurrent}\n aria-label={collapsedAriaLabel}\n title={collapsedTitle}\n >\n {content}\n </button>\n );\n }\n\n const isActionsVisible =\n shouldRenderActions && (isHoverIntent || isFocusWithin);\n let actionsVisibilityClass: string | undefined;\n if (isActionsVisible) {\n actionsVisibilityClass = styles.actionsVisible;\n }\n const actionsClassName = cx(styles.actions, actionsVisibilityClass);\n\n let dragHandleNode: JSX.Element | null = null;\n if (dragHandleSlot != null && !collapsed) {\n dragHandleNode = (\n <button\n type=\"button\"\n className={styles.dragHandle}\n draggable={draggable}\n onDragStart={onDragStart}\n onDragEnd={onDragEnd}\n aria-label={dragHandleLabel}\n title={dragHandleLabel}\n >\n {dragHandleSlot}\n </button>\n );\n }\n\n let actionNode: JSX.Element | null = null;\n if (actionSlot != null && !collapsed) {\n actionNode = <span className={styles.actionSlot}>{actionSlot}</span>;\n }\n\n let actionsNode: JSX.Element | null = null;\n if (shouldRenderActions) {\n actionsNode = (\n <span className={actionsClassName}>\n {dragHandleNode}\n {actionNode}\n </span>\n );\n }\n\n return (\n <div\n className={itemClassName}\n onDragOver={onDragOver}\n onDrop={onDrop}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onFocusCapture={handleFocusCapture}\n onBlurCapture={handleBlurCapture}\n ref={itemRef}\n >\n {mainNode}\n {actionsNode}\n </div>\n );\n};\n\nexport default SidebarNavItem;\n"],"mappings":";;;;;;;AAmBA,IAAM,IAAa,GAuBN,KAAkB,EAC7B,OAAA,GACA,SACA,MAAA,GACA,OAAA,GACA,cAAW,IACX,cAAW,IACX,aACA,iBACA,gBACA,YACA,eACA,eAAY,IACZ,eACA,cACA,YAAA,GACA,mBACA,oBACA,eAAY,SAC0B;CACtC,IAAM,IAAU,EAA8B,KAAK,EAC7C,IAAkB,EAA6C,KAAK,EACpE,CAAC,GAAe,KAAoB,EAAS,GAAM,EACnD,CAAC,GAAe,KAAoB,EAAS,GAAM,EAEnD,IAAgD,CAAC,EAAY;AAUnE,CATI,KACF,EAAe,KAAK,EAAqB,EAEvC,KACF,EAAe,KAAK,EAAkB,EAEpC,KACF,EAAe,KAAK,EAAoB,EAEtC,KAAa,QACf,EAAe,KAAK,EAAU;CAEhC,IAAM,IAAgB,EAAG,GAAG,EAAe,EAEvC,IAAwC;AAC5C,CAAI,KAAqB,QAAQ,OAAO,KAAU,aAChD,IAAoB;CAGtB,IAAI,GACA;AACJ,CAAI,MACF,IAAqB,GACrB,IAAiB;CAGnB,IAAI;AACJ,CAAI,MACF,IAAc;CAGhB,IAAI,IAA+B;AACnC,CAAI,KAAQ,SACV,IAAW,kBAAC,QAAD;EAAM,WAAW;YAAc;EAAY,CAAA;CAGxD,IAAI,IAAiC;AACrC,CAAI,MACF,IAAkB;CAEpB,IAAM,KAAiB,EAAG,GAAc,EAAgB,EAEpD,IAAgC;AACpC,KAAI,KAAS,MAAM;EACjB,IAAI,IAAiC;AAIrC,EAHI,MACF,IAAkB,IAEpB,IACE,kBAAC,QAAD;GAAM,WAAW,EAAG,
|
|
1
|
+
{"version":3,"file":"SidebarNavItem.js","names":[],"sources":["../../../../../src/backoffice/molecules/sidebar_nav_item/SidebarNavItem.tsx"],"sourcesContent":["import { Link } from '@plumile/router';\nimport {\n type AnchorHTMLAttributes,\n type ComponentPropsWithoutRef,\n type DragEvent,\n type FocusEvent,\n type JSX,\n type ReactNode,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport * as styles from './sidebarNavItem.css.js';\nimport { cx } from '@plumile/ui';\n\ntype RouterLinkProps = ComponentPropsWithoutRef<typeof Link> &\n AnchorHTMLAttributes<HTMLAnchorElement>;\nconst RouterLink = Link as unknown as (props: RouterLinkProps) => JSX.Element;\n\nexport type SidebarNavItemProps = {\n label: ReactNode;\n href?: string;\n icon?: ReactNode;\n badge?: ReactNode;\n isActive?: boolean;\n disabled?: boolean;\n onClick?: () => void;\n onDragStart?: (event: DragEvent) => void;\n onDragOver?: (event: DragEvent) => void;\n onDrop?: (event: DragEvent) => void;\n onDragEnd?: (event: DragEvent) => void;\n collapsed?: boolean;\n ariaLabel?: string;\n className?: string;\n actionSlot?: ReactNode;\n dragHandleSlot?: ReactNode;\n dragHandleLabel?: string;\n draggable?: boolean;\n};\n\nexport const SidebarNavItem = ({\n label,\n href,\n icon,\n badge,\n isActive = false,\n disabled = false,\n onClick,\n onDragStart,\n onDragOver,\n onDrop,\n onDragEnd,\n collapsed = false,\n ariaLabel,\n className,\n actionSlot,\n dragHandleSlot,\n dragHandleLabel,\n draggable = false,\n}: SidebarNavItemProps): JSX.Element => {\n const itemRef = useRef<HTMLDivElement | null>(null);\n const hoverTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const [isHoverIntent, setIsHoverIntent] = useState(false);\n const [isFocusWithin, setIsFocusWithin] = useState(false);\n\n const itemClassNames: (string | null | undefined)[] = [styles.item];\n if (collapsed) {\n itemClassNames.push(styles.itemCollapsed);\n }\n if (isActive) {\n itemClassNames.push(styles.itemActive);\n }\n if (disabled) {\n itemClassNames.push(styles.itemDisabled);\n }\n if (className != null) {\n itemClassNames.push(className);\n }\n const itemClassName = cx(...itemClassNames);\n\n let resolvedAriaLabel: string | undefined = ariaLabel;\n if (resolvedAriaLabel == null && typeof label === 'string') {\n resolvedAriaLabel = label;\n }\n\n let collapsedAriaLabel: string | undefined;\n let collapsedTitle: string | undefined;\n if (collapsed) {\n collapsedAriaLabel = resolvedAriaLabel;\n collapsedTitle = resolvedAriaLabel;\n }\n\n let ariaCurrent: 'page' | undefined;\n if (isActive) {\n ariaCurrent = 'page';\n }\n\n let iconNode: JSX.Element | null = null;\n if (icon != null) {\n iconNode = <span className={styles.icon}>{icon}</span>;\n }\n\n let labelExtraClass: string | null = null;\n if (collapsed) {\n labelExtraClass = styles.labelCollapsed;\n }\n const labelClassName = cx(styles.label, labelExtraClass);\n\n let badgeNode: JSX.Element | null = null;\n if (badge != null) {\n let badgeExtraClass: string | null = null;\n if (collapsed) {\n badgeExtraClass = styles.badgeCollapsed;\n }\n badgeNode = (\n <span className={cx(styles.badge, badgeExtraClass)}>{badge}</span>\n );\n }\n\n const content = (\n <>\n {iconNode}\n <span className={labelClassName}>{label}</span>\n {badgeNode}\n </>\n );\n\n const handleClick = (): void => {\n if (onClick != null) {\n onClick();\n }\n };\n\n const shouldRenderActions =\n !collapsed && !disabled && (actionSlot != null || dragHandleSlot != null);\n\n const clearHoverTimeout = useCallback((): void => {\n if (hoverTimeoutRef.current != null) {\n clearTimeout(hoverTimeoutRef.current);\n hoverTimeoutRef.current = null;\n }\n }, []);\n\n useEffect(() => {\n if (!shouldRenderActions) {\n setIsHoverIntent(false);\n setIsFocusWithin(false);\n clearHoverTimeout();\n }\n\n return () => {\n clearHoverTimeout();\n };\n }, [clearHoverTimeout, shouldRenderActions]);\n\n const handleMouseEnter = (): void => {\n if (!shouldRenderActions) {\n return;\n }\n clearHoverTimeout();\n hoverTimeoutRef.current = setTimeout(() => {\n setIsHoverIntent(true);\n }, 150);\n };\n\n const handleMouseLeave = (): void => {\n clearHoverTimeout();\n setIsHoverIntent(false);\n };\n\n const handleFocusCapture = (): void => {\n if (!shouldRenderActions) {\n return;\n }\n setIsFocusWithin(true);\n };\n\n const handleBlurCapture = (event: FocusEvent<HTMLDivElement>): void => {\n if (!shouldRenderActions) {\n setIsFocusWithin(false);\n return;\n }\n const nextTarget = event.relatedTarget as Node | null;\n if (nextTarget != null && itemRef.current?.contains(nextTarget)) {\n return;\n }\n setIsFocusWithin(false);\n };\n\n let mainNode: JSX.Element;\n if (disabled) {\n mainNode = (\n <span\n className={styles.link}\n aria-disabled=\"true\"\n aria-label={collapsedAriaLabel}\n title={collapsedTitle}\n >\n {content}\n </span>\n );\n } else if (href != null) {\n mainNode = (\n <RouterLink\n to={href}\n className={styles.link}\n aria-current={ariaCurrent}\n aria-label={collapsedAriaLabel}\n title={collapsedTitle}\n onClick={handleClick}\n >\n {content}\n </RouterLink>\n );\n } else {\n mainNode = (\n <button\n type=\"button\"\n className={styles.link}\n onClick={handleClick}\n aria-current={ariaCurrent}\n aria-label={collapsedAriaLabel}\n title={collapsedTitle}\n >\n {content}\n </button>\n );\n }\n\n const isActionsVisible =\n shouldRenderActions && (isHoverIntent || isFocusWithin);\n let actionsVisibilityClass: string | undefined;\n if (isActionsVisible) {\n actionsVisibilityClass = styles.actionsVisible;\n }\n const actionsClassName = cx(styles.actions, actionsVisibilityClass);\n\n let dragHandleNode: JSX.Element | null = null;\n if (dragHandleSlot != null && !collapsed) {\n dragHandleNode = (\n <button\n type=\"button\"\n className={styles.dragHandle}\n draggable={draggable}\n onDragStart={onDragStart}\n onDragEnd={onDragEnd}\n aria-label={dragHandleLabel}\n title={dragHandleLabel}\n >\n {dragHandleSlot}\n </button>\n );\n }\n\n let actionNode: JSX.Element | null = null;\n if (actionSlot != null && !collapsed) {\n actionNode = <span className={styles.actionSlot}>{actionSlot}</span>;\n }\n\n let actionsNode: JSX.Element | null = null;\n if (shouldRenderActions) {\n actionsNode = (\n <span className={actionsClassName}>\n {dragHandleNode}\n {actionNode}\n </span>\n );\n }\n\n return (\n <div\n className={itemClassName}\n onDragOver={onDragOver}\n onDrop={onDrop}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onFocusCapture={handleFocusCapture}\n onBlurCapture={handleBlurCapture}\n ref={itemRef}\n >\n {mainNode}\n {actionsNode}\n </div>\n );\n};\n\nexport default SidebarNavItem;\n"],"mappings":"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"}
|
|
@@ -3,11 +3,11 @@ import { ChevronDownSvg as t } from "../../../icons/ChevronDownSvg.js";
|
|
|
3
3
|
import { SidebarNavItem as n } from "../sidebar_nav_item/SidebarNavItem.js";
|
|
4
4
|
import { header as r, items as i, section as a, title as o, toggle as s } from "./sidebarNavSection.css.js";
|
|
5
5
|
import "../../../index.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { useCallback as c, useMemo as l, useState as u } from "react";
|
|
7
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
8
8
|
//#region src/backoffice/molecules/sidebar_nav_section/SidebarNavSection.tsx
|
|
9
9
|
var p = ({ title: p, items: m, collapsible: h = !1, isCollapsed: g, defaultCollapsed: _ = !1, onCollapsedChange: v, collapsed: y = !1, className: b }) => {
|
|
10
|
-
let [x, S] =
|
|
10
|
+
let [x, S] = u(_), C = g ?? x, w = h, T = c(() => {
|
|
11
11
|
if (!w) return;
|
|
12
12
|
let e = !C;
|
|
13
13
|
g ?? S(e), v?.(e);
|
|
@@ -16,7 +16,7 @@ var p = ({ title: p, items: m, collapsible: h = !1, isCollapsed: g, defaultColla
|
|
|
16
16
|
C,
|
|
17
17
|
g,
|
|
18
18
|
v
|
|
19
|
-
]), E =
|
|
19
|
+
]), E = l(() => {
|
|
20
20
|
let e = "rotate(0deg)";
|
|
21
21
|
return C && (e = "rotate(-90deg)"), {
|
|
22
22
|
transform: e,
|
|
@@ -25,35 +25,35 @@ var p = ({ title: p, items: m, collapsible: h = !1, isCollapsed: g, defaultColla
|
|
|
25
25
|
}, [C]), D = null;
|
|
26
26
|
if (p != null) {
|
|
27
27
|
let e = null;
|
|
28
|
-
w && (e = /* @__PURE__ */
|
|
28
|
+
w && (e = /* @__PURE__ */ d("button", {
|
|
29
29
|
type: "button",
|
|
30
30
|
className: s,
|
|
31
31
|
onClick: T,
|
|
32
32
|
"aria-expanded": !C,
|
|
33
|
-
children: /* @__PURE__ */
|
|
33
|
+
children: /* @__PURE__ */ d(t, {
|
|
34
34
|
width: 18,
|
|
35
35
|
height: 18,
|
|
36
36
|
style: E
|
|
37
37
|
})
|
|
38
|
-
})), D = /* @__PURE__ */
|
|
38
|
+
})), D = /* @__PURE__ */ f("div", {
|
|
39
39
|
className: r,
|
|
40
|
-
children: [/* @__PURE__ */
|
|
40
|
+
children: [/* @__PURE__ */ d("div", {
|
|
41
41
|
className: o,
|
|
42
42
|
children: p
|
|
43
43
|
}), e]
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
let O = null;
|
|
47
|
-
return C || (O = /* @__PURE__ */
|
|
47
|
+
return C || (O = /* @__PURE__ */ d("div", {
|
|
48
48
|
className: i,
|
|
49
49
|
children: m.map((e) => {
|
|
50
50
|
let { id: t, data: r, ...i } = e;
|
|
51
|
-
return /* @__PURE__ */
|
|
51
|
+
return /* @__PURE__ */ d(n, {
|
|
52
52
|
...i,
|
|
53
53
|
collapsed: y
|
|
54
54
|
}, t);
|
|
55
55
|
})
|
|
56
|
-
})), /* @__PURE__ */
|
|
56
|
+
})), /* @__PURE__ */ f("section", {
|
|
57
57
|
className: e(a, b),
|
|
58
58
|
children: [D, O]
|
|
59
59
|
});
|
|
@@ -5,15 +5,15 @@ import { BulkActionsBar as r } from "../../molecules/bulk_actions_bar/BulkAction
|
|
|
5
5
|
import { TableToolbar as i } from "../../molecules/table_toolbar/TableToolbar.js";
|
|
6
6
|
import { selectionCell as a, wrapper as o } from "./backofficeDataTable.css.js";
|
|
7
7
|
import "../../../index.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { useCallback as s, useMemo as c } from "react";
|
|
9
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
10
10
|
//#region src/backoffice/organisms/backoffice_data_table/BackofficeDataTable.tsx
|
|
11
11
|
var d = (e) => {
|
|
12
12
|
let { rows: n, selection: r } = e, i = [];
|
|
13
13
|
for (let e of n) e.selectable && i.push(e.id);
|
|
14
|
-
let o = i.filter((e) => r.selectedRowIds.has(e)).length,
|
|
14
|
+
let o = i.filter((e) => r.selectedRowIds.has(e)).length, s = i.length > 0 && o === i.length, c = () => {
|
|
15
15
|
if (i.length !== 0) {
|
|
16
|
-
if (
|
|
16
|
+
if (s) {
|
|
17
17
|
r.onSelectionChange(/* @__PURE__ */ new Set());
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
@@ -22,21 +22,21 @@ var d = (e) => {
|
|
|
22
22
|
};
|
|
23
23
|
return {
|
|
24
24
|
id: "__select",
|
|
25
|
-
header: /* @__PURE__ */
|
|
25
|
+
header: /* @__PURE__ */ l("div", {
|
|
26
26
|
className: a,
|
|
27
|
-
children: /* @__PURE__ */
|
|
28
|
-
checked:
|
|
27
|
+
children: /* @__PURE__ */ l(t, {
|
|
28
|
+
checked: s,
|
|
29
29
|
onChange: () => {
|
|
30
|
-
|
|
30
|
+
c();
|
|
31
31
|
},
|
|
32
32
|
"aria-label": "Select all"
|
|
33
33
|
})
|
|
34
34
|
}),
|
|
35
35
|
cell: (e) => {
|
|
36
36
|
let { id: n, selectable: i } = e;
|
|
37
|
-
return /* @__PURE__ */
|
|
37
|
+
return /* @__PURE__ */ l("div", {
|
|
38
38
|
className: a,
|
|
39
|
-
children: /* @__PURE__ */
|
|
39
|
+
children: /* @__PURE__ */ l(t, {
|
|
40
40
|
checked: r.selectedRowIds.has(n),
|
|
41
41
|
disabled: !i,
|
|
42
42
|
onChange: () => {
|
|
@@ -50,7 +50,7 @@ var d = (e) => {
|
|
|
50
50
|
className: a
|
|
51
51
|
};
|
|
52
52
|
}, f = ({ columns: t, rows: a, getRowId: f, toolbar: p, selection: m, bulkActions: h, emptyState: g, className: _ }) => {
|
|
53
|
-
let v =
|
|
53
|
+
let v = c(() => a.map((e, t) => ({
|
|
54
54
|
row: e,
|
|
55
55
|
index: t,
|
|
56
56
|
id: f(e, t),
|
|
@@ -59,41 +59,41 @@ var d = (e) => {
|
|
|
59
59
|
f,
|
|
60
60
|
a,
|
|
61
61
|
m
|
|
62
|
-
]), y =
|
|
62
|
+
]), y = c(() => m == null ? null : d({
|
|
63
63
|
rows: v,
|
|
64
64
|
selection: m
|
|
65
|
-
}), [m, v]), b =
|
|
65
|
+
}), [m, v]), b = c(() => {
|
|
66
66
|
let e = t.map((e) => ({
|
|
67
67
|
...e,
|
|
68
68
|
cell: (t) => e.cell(t.row)
|
|
69
69
|
}));
|
|
70
70
|
return y == null ? e : [y, ...e];
|
|
71
|
-
}, [t, y]), x =
|
|
71
|
+
}, [t, y]), x = c(() => {
|
|
72
72
|
if (b.some((e) => e.isPrimary === !0) || b.length === 0) return b;
|
|
73
73
|
let e = 0;
|
|
74
74
|
return y != null && b.length > 1 && (e = 1), b.map((t, n) => n === e ? {
|
|
75
75
|
...t,
|
|
76
76
|
isPrimary: !0
|
|
77
77
|
} : t);
|
|
78
|
-
}, [b, y]), S =
|
|
78
|
+
}, [b, y]), S = c(() => {
|
|
79
79
|
if (y != null) return `2.75rem repeat(${Math.max(0, b.length - 1)}, minmax(0, 1fr))`;
|
|
80
80
|
}, [b.length, y]), C = 0;
|
|
81
81
|
m != null && (C = m.selectedRowIds.size);
|
|
82
|
-
let w =
|
|
82
|
+
let w = s(() => {
|
|
83
83
|
m?.onSelectionChange(/* @__PURE__ */ new Set());
|
|
84
84
|
}, [m]), T = null;
|
|
85
|
-
p != null && (T = /* @__PURE__ */
|
|
85
|
+
p != null && (T = /* @__PURE__ */ l(i, { ...p }));
|
|
86
86
|
let E = null;
|
|
87
|
-
return m != null && (E = /* @__PURE__ */
|
|
87
|
+
return m != null && (E = /* @__PURE__ */ l(r, {
|
|
88
88
|
selectedCount: C,
|
|
89
89
|
actions: h,
|
|
90
90
|
onClearSelection: w
|
|
91
|
-
})), /* @__PURE__ */
|
|
91
|
+
})), /* @__PURE__ */ u("div", {
|
|
92
92
|
className: e(o, _),
|
|
93
93
|
children: [
|
|
94
94
|
T,
|
|
95
95
|
E,
|
|
96
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ l(n, {
|
|
97
97
|
columns: x,
|
|
98
98
|
rows: v,
|
|
99
99
|
getRowId: (e) => e.id,
|
|
@@ -3,8 +3,8 @@ import { Badge as t } from "../../atomic/atoms/badge/Badge.js";
|
|
|
3
3
|
import { FormattedDate as n } from "../../atomic/atoms/formatted-date/FormattedDate.js";
|
|
4
4
|
import { date as r, muted as i, number as a, text as o } from "./TableCell.css.js";
|
|
5
5
|
import { TableCellBase as s } from "./TableCellBase.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { useMemo as c } from "react";
|
|
7
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/data-table/TableCell.tsx
|
|
9
9
|
var u = "—", d = u, f = { maximumFractionDigits: 2 }, p = {
|
|
10
10
|
dateStyle: "medium",
|
|
@@ -12,22 +12,22 @@ var u = "—", d = u, f = { maximumFractionDigits: 2 }, p = {
|
|
|
12
12
|
}, m = {
|
|
13
13
|
Base: s,
|
|
14
14
|
Text: ({ value: t, fallback: n = d, children: r, ellipsis: i = !1, className: a }) => {
|
|
15
|
-
let
|
|
16
|
-
if (
|
|
17
|
-
else if (typeof
|
|
18
|
-
let e =
|
|
19
|
-
|
|
15
|
+
let c = r ?? t;
|
|
16
|
+
if (c == null) c = n;
|
|
17
|
+
else if (typeof c == "string") {
|
|
18
|
+
let e = c.trim();
|
|
19
|
+
c = e.length === 0 ? n : e;
|
|
20
20
|
}
|
|
21
|
-
return /* @__PURE__ */
|
|
21
|
+
return /* @__PURE__ */ l(s, {
|
|
22
22
|
ellipsis: i,
|
|
23
23
|
className: e(o, a),
|
|
24
|
-
children:
|
|
24
|
+
children: c
|
|
25
25
|
});
|
|
26
26
|
},
|
|
27
|
-
Number: ({ value: e, fallback: t = d, locale: n, formatOptions: r = f }) => /* @__PURE__ */
|
|
27
|
+
Number: ({ value: e, fallback: t = d, locale: n, formatOptions: r = f }) => /* @__PURE__ */ l(s, {
|
|
28
28
|
align: "end",
|
|
29
29
|
className: a,
|
|
30
|
-
children:
|
|
30
|
+
children: c(() => {
|
|
31
31
|
if (e == null || Number.isNaN(Number(e))) return t;
|
|
32
32
|
try {
|
|
33
33
|
return new Intl.NumberFormat(n, r).format(e);
|
|
@@ -41,30 +41,30 @@ var u = "—", d = u, f = { maximumFractionDigits: 2 }, p = {
|
|
|
41
41
|
r
|
|
42
42
|
])
|
|
43
43
|
}),
|
|
44
|
-
Status: ({ label: e, tone: n, isLoading: r = !1 }) => /* @__PURE__ */
|
|
44
|
+
Status: ({ label: e, tone: n, isLoading: r = !1 }) => /* @__PURE__ */ l(s, { children: /* @__PURE__ */ l(t, {
|
|
45
45
|
tone: n,
|
|
46
46
|
loading: r,
|
|
47
47
|
children: e
|
|
48
48
|
}) }),
|
|
49
|
-
Date: ({ value: e, fallback: t = u, locale: i, options: a = p }) => /* @__PURE__ */
|
|
49
|
+
Date: ({ value: e, fallback: t = u, locale: i, options: a = p }) => /* @__PURE__ */ l(s, {
|
|
50
50
|
className: r,
|
|
51
|
-
children: /* @__PURE__ */
|
|
51
|
+
children: /* @__PURE__ */ l(n, {
|
|
52
52
|
value: e,
|
|
53
53
|
fallback: t,
|
|
54
54
|
locale: i,
|
|
55
55
|
options: a
|
|
56
56
|
})
|
|
57
57
|
}),
|
|
58
|
-
Badge: ({ label: e, tone: n }) => /* @__PURE__ */
|
|
58
|
+
Badge: ({ label: e, tone: n }) => /* @__PURE__ */ l(s, { children: /* @__PURE__ */ l(t, {
|
|
59
59
|
tone: n,
|
|
60
60
|
children: e
|
|
61
61
|
}) }),
|
|
62
|
-
Actions: ({ children: e, className: t }) => /* @__PURE__ */
|
|
62
|
+
Actions: ({ children: e, className: t }) => /* @__PURE__ */ l(s, {
|
|
63
63
|
align: "end",
|
|
64
64
|
className: t,
|
|
65
65
|
children: e
|
|
66
66
|
}),
|
|
67
|
-
Muted: ({ children: e }) => /* @__PURE__ */
|
|
67
|
+
Muted: ({ children: e }) => /* @__PURE__ */ l("span", {
|
|
68
68
|
className: i,
|
|
69
69
|
children: e
|
|
70
70
|
})
|