@alepha/ui 0.16.0 → 0.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/{AdminApiKeys-GMORg-1l.js → AdminApiKeys-CoTOTfgU.js} +4 -3
- package/dist/admin/{AdminApiKeys-GMORg-1l.js.map → AdminApiKeys-CoTOTfgU.js.map} +1 -1
- package/dist/admin/{AdminAudits-pkWrjq1Z.js → AdminAudits-BmsxFbDa.js} +4 -3
- package/dist/admin/{AdminAudits-pkWrjq1Z.js.map → AdminAudits-BmsxFbDa.js.map} +1 -1
- package/dist/admin/{AdminFiles-WeQbsCsl.js → AdminFiles-BBB8knca.js} +4 -3
- package/dist/admin/{AdminFiles-WeQbsCsl.js.map → AdminFiles-BBB8knca.js.map} +1 -1
- package/dist/admin/{AdminJobs-B-q9iGO3.js → AdminJobs-C604joTz.js} +4 -3
- package/dist/admin/{AdminJobs-B-q9iGO3.js.map → AdminJobs-C604joTz.js.map} +1 -1
- package/dist/admin/{AdminLayout-D8yZ-8lG.js → AdminLayout-CsjvpeD1.js} +6 -10
- package/dist/admin/AdminLayout-CsjvpeD1.js.map +1 -0
- package/dist/admin/{AdminNotifications-Ds5Un0NJ.js → AdminNotifications-LwR6RKrx.js} +4 -3
- package/dist/admin/{AdminNotifications-Ds5Un0NJ.js.map → AdminNotifications-LwR6RKrx.js.map} +1 -1
- package/dist/admin/AdminParameters-B_83Vie9.js +767 -0
- package/dist/admin/AdminParameters-B_83Vie9.js.map +1 -0
- package/dist/admin/{AdminSessions-DzIOxM3b.js → AdminSessions-CWnPosdd.js} +4 -3
- package/dist/admin/{AdminSessions-DzIOxM3b.js.map → AdminSessions-CWnPosdd.js.map} +1 -1
- package/dist/admin/{AdminUserAudits-CiUPN2BC.js → AdminUserAudits-nHv636E_.js} +4 -3
- package/dist/admin/{AdminUserAudits-CiUPN2BC.js.map → AdminUserAudits-nHv636E_.js.map} +1 -1
- package/dist/admin/{AdminUserCreate-BwQKr4xE.js → AdminUserCreate-CjYD3Kjc.js} +4 -3
- package/dist/admin/{AdminUserCreate-BwQKr4xE.js.map → AdminUserCreate-CjYD3Kjc.js.map} +1 -1
- package/dist/admin/{AdminUserDetails-uqtC5aJ1.js → AdminUserDetails-Ccq-LsZ0.js} +4 -3
- package/dist/admin/{AdminUserDetails-uqtC5aJ1.js.map → AdminUserDetails-Ccq-LsZ0.js.map} +1 -1
- package/dist/admin/{AdminUserLayout-CiPay35T.js → AdminUserLayout-7s41DiF_.js} +6 -7
- package/dist/admin/AdminUserLayout-7s41DiF_.js.map +1 -0
- package/dist/admin/{AdminUserSessions-DAE8Nf1F.js → AdminUserSessions-Ds3ODq_d.js} +4 -3
- package/dist/admin/{AdminUserSessions-DAE8Nf1F.js.map → AdminUserSessions-Ds3ODq_d.js.map} +1 -1
- package/dist/admin/{AdminUserSettings-EbahaV2a.js → AdminUserSettings-CGh4gROo.js} +4 -3
- package/dist/admin/{AdminUserSettings-EbahaV2a.js.map → AdminUserSettings-CGh4gROo.js.map} +1 -1
- package/dist/admin/{AdminUsers-Dcjh0KNW.js → AdminUsers-CvPiBzQK.js} +4 -3
- package/dist/admin/{AdminUsers-Dcjh0KNW.js.map → AdminUsers-CvPiBzQK.js.map} +1 -1
- package/dist/admin/index.d.ts +22 -10
- package/dist/admin/index.d.ts.map +1 -1
- package/dist/admin/index.js +47 -48
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/rolldown-runtime-CjeV3_4I.js +18 -0
- package/dist/auth/{AuthLayout-mFOWbiSP.js → AuthLayout-CdJcrPs4.js} +2 -4
- package/dist/auth/AuthLayout-CdJcrPs4.js.map +1 -0
- package/dist/{demo/IconGoogle-CbBF8Hqq.js → auth/IconGoogle-Bm18QD2q.js} +2 -4
- package/dist/auth/{IconGoogle-DpSlPZ1u.js.map → IconGoogle-Bm18QD2q.js.map} +1 -1
- package/dist/auth/{Login-BBqTosqZ.js → Login-DS_OqA0G.js} +7 -6
- package/dist/auth/Login-DS_OqA0G.js.map +1 -0
- package/dist/auth/{Profile-Bxj8Nwom.js → Profile-Di7N7HZL.js} +2 -3
- package/dist/auth/{Profile-Bxj8Nwom.js.map → Profile-Di7N7HZL.js.map} +1 -1
- package/dist/auth/{Register-Ce675Crg.js → Register-BRR2_gux.js} +7 -6
- package/dist/auth/Register-BRR2_gux.js.map +1 -0
- package/dist/auth/{ResetPassword-DWdt7c40.js → ResetPassword-oQu72lod.js} +4 -3
- package/dist/auth/{ResetPassword-DWdt7c40.js.map → ResetPassword-oQu72lod.js.map} +1 -1
- package/dist/auth/{VerifyEmail-CI4JwByV.js → VerifyEmail-DC6HPZjd.js} +4 -3
- package/dist/auth/{VerifyEmail-CI4JwByV.js.map → VerifyEmail-DC6HPZjd.js.map} +1 -1
- package/dist/auth/index.d.ts +14 -14
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +13 -17
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/rolldown-runtime-CjeV3_4I.js +18 -0
- package/dist/core/index.d.ts +147 -68
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +349 -287
- package/dist/core/index.js.map +1 -1
- package/dist/demo/{DemoDataTable-CguplbR7.js → DemoDataTable-DCsJq8v5.js} +4 -5
- package/dist/demo/DemoDataTable-DCsJq8v5.js.map +1 -0
- package/dist/demo/{DemoHome-Cce2bWmg.js → DemoHome-DpRrPlBC.js} +4 -3
- package/dist/demo/{DemoHome-Cce2bWmg.js.map → DemoHome-DpRrPlBC.js.map} +1 -1
- package/dist/demo/{DemoJsonViewer-Dgdk3Txb.js → DemoJsonViewer-zeucGKHV.js} +6 -5
- package/dist/demo/DemoJsonViewer-zeucGKHV.js.map +1 -0
- package/dist/demo/{DemoLayout-B20TEuhV.js → DemoLayout-PhgbAAiQ.js} +6 -5
- package/dist/demo/DemoLayout-PhgbAAiQ.js.map +1 -0
- package/dist/demo/{DemoLogin-CvCG2WVh.js → DemoLogin-DSzP0Lkv.js} +8 -10
- package/dist/demo/DemoLogin-DSzP0Lkv.js.map +1 -0
- package/dist/demo/{DemoRegister-CmeHbOAs.js → DemoRegister-DavFBsCz.js} +8 -10
- package/dist/demo/DemoRegister-DavFBsCz.js.map +1 -0
- package/dist/demo/{DemoResetPassword-CKO5iA_6.js → DemoResetPassword-BS2rIAQK.js} +5 -7
- package/dist/demo/DemoResetPassword-BS2rIAQK.js.map +1 -0
- package/dist/demo/{DemoSidebar-MVmQKfMt.js → DemoSidebar-zNkUmHRl.js} +4 -5
- package/dist/demo/DemoSidebar-zNkUmHRl.js.map +1 -0
- package/dist/demo/{DemoTypeForm-w-qtfRlC.js → DemoTypeForm-B9q7oT0b.js} +4 -5
- package/dist/demo/DemoTypeForm-B9q7oT0b.js.map +1 -0
- package/dist/demo/{DemoVerifyEmail-C8FFJT5A.js → DemoVerifyEmail-Bi4SdWz0.js} +5 -7
- package/dist/demo/DemoVerifyEmail-Bi4SdWz0.js.map +1 -0
- package/dist/{auth/IconGoogle-DpSlPZ1u.js → demo/IconGoogle-CTeZyrek.js} +2 -4
- package/dist/demo/{IconGoogle-CbBF8Hqq.js.map → IconGoogle-CTeZyrek.js.map} +1 -1
- package/dist/demo/{Showcase-CQrMWars.js → Showcase-C9btr_SJ.js} +3 -5
- package/dist/demo/Showcase-C9btr_SJ.js.map +1 -0
- package/dist/demo/index.d.ts +2 -2
- package/dist/demo/index.d.ts.map +1 -1
- package/dist/demo/index.js +15 -15
- package/dist/demo/rolldown-runtime-CjeV3_4I.js +18 -0
- package/package.json +5 -3
- package/src/admin/AdminRouter.ts +15 -24
- package/src/admin/components/AdminLayout.tsx +6 -10
- package/src/admin/components/parameters/AdminParameters.tsx +154 -76
- package/src/admin/components/parameters/ParameterDetails.tsx +153 -93
- package/src/admin/components/parameters/ParameterEmptyState.tsx +27 -0
- package/src/admin/components/parameters/ParameterHistory.tsx +15 -20
- package/src/admin/components/parameters/ParameterTree.tsx +280 -104
- package/src/admin/components/parameters/types.ts +3 -3
- package/src/admin/primitives/$uiAdmin.ts +2 -2
- package/src/auth/AuthRouter.ts +1 -4
- package/src/auth/components/AuthLayout.tsx +0 -1
- package/src/core/components/buttons/ActionButton.tsx +4 -15
- package/src/core/components/buttons/DarkModeButton.tsx +8 -4
- package/src/core/components/buttons/ToggleSidebarButton.tsx +3 -5
- package/src/core/components/form/Control.tsx +10 -32
- package/src/core/components/form/ControlArray.tsx +200 -89
- package/src/core/components/form/TypeForm.browser.spec.tsx +727 -0
- package/src/core/components/layout/AlephaMantineProvider.tsx +1 -0
- package/src/core/components/layout/Breadcrumb.tsx +91 -0
- package/src/core/components/layout/{AdminShell.tsx → DashboardShell.tsx} +77 -32
- package/src/core/components/layout/Sidebar.tsx +58 -18
- package/src/core/constants/ui.ts +1 -1
- package/src/core/helpers/renderIcon.tsx +5 -2
- package/src/core/index.ts +9 -5
- package/src/core/styles.css +7 -6
- package/src/core/utils/string.ts +28 -4
- package/src/demo/components/DemoLayout.tsx +6 -2
- package/dist/admin/AdminApiKeys-DsmGnHNh.js +0 -3
- package/dist/admin/AdminAudits-8SM96viT.js +0 -3
- package/dist/admin/AdminFiles-B56ocq4H.js +0 -3
- package/dist/admin/AdminJobs-CED1syCn.js +0 -3
- package/dist/admin/AdminLayout-D8yZ-8lG.js.map +0 -1
- package/dist/admin/AdminNotifications-B0B1rdc4.js +0 -3
- package/dist/admin/AdminParameters-BU3lATdJ.js +0 -3
- package/dist/admin/AdminParameters-CfDUpc78.js +0 -575
- package/dist/admin/AdminParameters-CfDUpc78.js.map +0 -1
- package/dist/admin/AdminSessions-BDGK2MS6.js +0 -3
- package/dist/admin/AdminUserAudits-Cj79gENT.js +0 -3
- package/dist/admin/AdminUserCreate-Cq-mUmBs.js +0 -3
- package/dist/admin/AdminUserDetails-DRjVAPFd.js +0 -3
- package/dist/admin/AdminUserLayout-CGzmHHby.js +0 -3
- package/dist/admin/AdminUserLayout-CiPay35T.js.map +0 -1
- package/dist/admin/AdminUserSessions-DcdzuNZ9.js +0 -3
- package/dist/admin/AdminUserSettings-D7V6-ceX.js +0 -3
- package/dist/admin/AdminUsers-D9nyzGqQ.js +0 -3
- package/dist/auth/AuthLayout-mFOWbiSP.js.map +0 -1
- package/dist/auth/Login-BBqTosqZ.js.map +0 -1
- package/dist/auth/Login-CoU63mMR.js +0 -4
- package/dist/auth/Register-BV_oa_AK.js +0 -4
- package/dist/auth/Register-Ce675Crg.js.map +0 -1
- package/dist/auth/ResetPassword-D5wC8GAA.js +0 -3
- package/dist/auth/VerifyEmail-DAfqVm5s.js +0 -3
- package/dist/demo/DemoDataTable-CguplbR7.js.map +0 -1
- package/dist/demo/DemoHome-DC9qkMNe.js +0 -3
- package/dist/demo/DemoJsonViewer-DIssGVlJ.js +0 -4
- package/dist/demo/DemoJsonViewer-Dgdk3Txb.js.map +0 -1
- package/dist/demo/DemoLayout-B20TEuhV.js.map +0 -1
- package/dist/demo/DemoLayout-DSRyf4qJ.js +0 -3
- package/dist/demo/DemoLogin-CvCG2WVh.js.map +0 -1
- package/dist/demo/DemoRegister-CmeHbOAs.js.map +0 -1
- package/dist/demo/DemoResetPassword-CKO5iA_6.js.map +0 -1
- package/dist/demo/DemoSidebar-MVmQKfMt.js.map +0 -1
- package/dist/demo/DemoTypeForm-w-qtfRlC.js.map +0 -1
- package/dist/demo/DemoVerifyEmail-C8FFJT5A.js.map +0 -1
- package/dist/demo/Showcase-CQrMWars.js.map +0 -1
package/dist/core/index.js
CHANGED
|
@@ -6,12 +6,12 @@ import { $cookie } from "alepha/server/cookies";
|
|
|
6
6
|
import { ActionIcon, Anchor, AppShell, Autocomplete, Badge, Box, Burger, Button, Card, Checkbox, Collapse, ColorInput, ColorSchemeScript, Container, CopyButton, Divider, Fieldset, FileInput, Flex, Flex as Flex$1, Grid, Group, Image, Input, Kbd, MantineProvider, Menu, MultiSelect, NumberInput, Pagination, PasswordInput, Popover, ScrollArea, SegmentedControl, Select, Slider, Stack, Switch, Table, TagsInput, Text, Text as Text$1, TextInput, Textarea, ThemeIcon, Tooltip, UnstyledButton, useMantineColorScheme, useMantineTheme } from "@mantine/core";
|
|
7
7
|
import { ModalsProvider, modals } from "@mantine/modals";
|
|
8
8
|
import { IconAlertTriangle, IconArrowDown, IconArrowLeft, IconArrowUp, IconArrowsSort, IconAt, IconCalendar, IconCheck, IconChevronDown, IconChevronRight, IconClock, IconColorPicker, IconColumns, IconCopy, IconFile, IconFilter, IconGripVertical, IconHash, IconInfoCircle, IconInfoTriangle, IconKey, IconLanguage, IconLayoutSidebarLeftCollapse, IconLayoutSidebarRightCollapse, IconLetterCase, IconLink, IconList, IconMail, IconMoon, IconPalette, IconPhone, IconPlus, IconRefresh, IconSearch, IconSelector, IconSquareRounded, IconSun, IconToggleLeft, IconTrash, IconX } from "@tabler/icons-react";
|
|
9
|
-
import { Children, createElement, isValidElement, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
10
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { Children, Fragment, createElement, isValidElement, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
10
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { Notifications, notifications } from "@mantine/notifications";
|
|
12
|
-
import { $page, Link, NestedView, useActive, useRouter } from "alepha/react/router";
|
|
12
|
+
import { $page, Link, NestedView, useActive, useRouter, useRouterState } from "alepha/react/router";
|
|
13
13
|
import { NavigationProgress, nprogress } from "@mantine/nprogress";
|
|
14
|
-
import { ClientOnly, useAction, useEvents, useInject, useStore } from "alepha/react";
|
|
14
|
+
import { ClientOnly, useAction, useAlepha, useEvents, useInject, useStore } from "alepha/react";
|
|
15
15
|
import { Spotlight, spotlight } from "@mantine/spotlight";
|
|
16
16
|
import { ui as ui$1 } from "@alepha/ui";
|
|
17
17
|
import { useDebouncedCallback, useOs } from "@mantine/hooks";
|
|
@@ -357,11 +357,10 @@ const ErrorViewer = ({ error, showStack = true, copyable = true, size = "sm" })
|
|
|
357
357
|
})]
|
|
358
358
|
});
|
|
359
359
|
};
|
|
360
|
-
var ErrorViewer_default = ErrorViewer;
|
|
361
360
|
|
|
362
361
|
//#endregion
|
|
363
362
|
//#region ../../src/core/components/dialogs/AlertDialog.tsx
|
|
364
|
-
const AlertDialog = ({ options, onClose }) => /* @__PURE__ */ jsxs(Fragment, { children: [options?.message && /* @__PURE__ */ jsx(Text$1, {
|
|
363
|
+
const AlertDialog = ({ options, onClose }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [options?.message && /* @__PURE__ */ jsx(Text$1, {
|
|
365
364
|
mb: "md",
|
|
366
365
|
children: options.message
|
|
367
366
|
}), /* @__PURE__ */ jsx(Group, {
|
|
@@ -371,11 +370,10 @@ const AlertDialog = ({ options, onClose }) => /* @__PURE__ */ jsxs(Fragment, { c
|
|
|
371
370
|
children: options?.okLabel || "OK"
|
|
372
371
|
})
|
|
373
372
|
})] });
|
|
374
|
-
var AlertDialog_default = AlertDialog;
|
|
375
373
|
|
|
376
374
|
//#endregion
|
|
377
375
|
//#region ../../src/core/components/dialogs/ConfirmDialog.tsx
|
|
378
|
-
const ConfirmDialog = ({ options, onConfirm }) => /* @__PURE__ */ jsxs(Fragment, { children: [options?.message && /* @__PURE__ */ jsx(Text$1, {
|
|
376
|
+
const ConfirmDialog = ({ options, onConfirm }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [options?.message && /* @__PURE__ */ jsx(Text$1, {
|
|
379
377
|
mb: "md",
|
|
380
378
|
children: options.message
|
|
381
379
|
}), /* @__PURE__ */ jsxs(Group, {
|
|
@@ -390,7 +388,6 @@ const ConfirmDialog = ({ options, onConfirm }) => /* @__PURE__ */ jsxs(Fragment,
|
|
|
390
388
|
children: options?.confirmLabel || "Confirm"
|
|
391
389
|
})]
|
|
392
390
|
})] });
|
|
393
|
-
var ConfirmDialog_default = ConfirmDialog;
|
|
394
391
|
|
|
395
392
|
//#endregion
|
|
396
393
|
//#region ../../src/core/components/dialogs/PromptDialog.tsx
|
|
@@ -406,7 +403,7 @@ const PromptDialog = ({ options, onSubmit }) => {
|
|
|
406
403
|
const handleKeyDown = (event) => {
|
|
407
404
|
if (event.key === "Enter") handleSubmit();
|
|
408
405
|
};
|
|
409
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
406
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
410
407
|
options?.message && /* @__PURE__ */ jsx(Text$1, {
|
|
411
408
|
mb: "md",
|
|
412
409
|
children: options.message
|
|
@@ -435,7 +432,6 @@ const PromptDialog = ({ options, onSubmit }) => {
|
|
|
435
432
|
})
|
|
436
433
|
] });
|
|
437
434
|
};
|
|
438
|
-
var PromptDialog_default = PromptDialog;
|
|
439
435
|
|
|
440
436
|
//#endregion
|
|
441
437
|
//#region ../../src/core/constants/ui.ts
|
|
@@ -448,7 +444,7 @@ const ui = {
|
|
|
448
444
|
border: "var(--alepha-border)"
|
|
449
445
|
},
|
|
450
446
|
sizes: { icon: {
|
|
451
|
-
xs:
|
|
447
|
+
xs: 14,
|
|
452
448
|
sm: 16,
|
|
453
449
|
md: 20,
|
|
454
450
|
lg: 24,
|
|
@@ -480,7 +476,7 @@ var DialogService = class {
|
|
|
480
476
|
const modalId = this.open({
|
|
481
477
|
...options,
|
|
482
478
|
title: options?.title || "Alert",
|
|
483
|
-
content: /* @__PURE__ */ jsx(
|
|
479
|
+
content: /* @__PURE__ */ jsx(AlertDialog, {
|
|
484
480
|
options,
|
|
485
481
|
onClose: () => {
|
|
486
482
|
this.close(modalId);
|
|
@@ -500,7 +496,7 @@ var DialogService = class {
|
|
|
500
496
|
title: options?.title || "Confirm",
|
|
501
497
|
closeOnClickOutside: false,
|
|
502
498
|
closeOnEscape: false,
|
|
503
|
-
content: /* @__PURE__ */ jsx(
|
|
499
|
+
content: /* @__PURE__ */ jsx(ConfirmDialog, {
|
|
504
500
|
options,
|
|
505
501
|
onConfirm: (confirmed) => {
|
|
506
502
|
this.close(modalId);
|
|
@@ -520,7 +516,7 @@ var DialogService = class {
|
|
|
520
516
|
title: options?.title || "Input",
|
|
521
517
|
closeOnClickOutside: false,
|
|
522
518
|
closeOnEscape: false,
|
|
523
|
-
content: /* @__PURE__ */ jsx(
|
|
519
|
+
content: /* @__PURE__ */ jsx(PromptDialog, {
|
|
524
520
|
options,
|
|
525
521
|
onSubmit: (value) => {
|
|
526
522
|
this.close(modalId);
|
|
@@ -561,7 +557,7 @@ var DialogService = class {
|
|
|
561
557
|
flex: 1,
|
|
562
558
|
p: "sm",
|
|
563
559
|
bg: ui.colors.surface,
|
|
564
|
-
children: /* @__PURE__ */ jsx(
|
|
560
|
+
children: /* @__PURE__ */ jsx(ErrorViewer, {
|
|
565
561
|
size: "xs",
|
|
566
562
|
error,
|
|
567
563
|
showStack: options?.showStack ?? true
|
|
@@ -690,10 +686,10 @@ function isComponentType(param) {
|
|
|
690
686
|
|
|
691
687
|
//#endregion
|
|
692
688
|
//#region ../../src/core/helpers/renderIcon.tsx
|
|
693
|
-
const renderIcon = (icon) => {
|
|
689
|
+
const renderIcon = (icon, size) => {
|
|
694
690
|
if (!icon) return null;
|
|
695
691
|
if (isValidElement(icon)) return icon;
|
|
696
|
-
if (isComponentType(icon)) return /* @__PURE__ */ jsx(icon, { size: ui$1.sizes.icon.md });
|
|
692
|
+
if (isComponentType(icon)) return /* @__PURE__ */ jsx(icon, { size: size ?? ui$1.sizes.icon.md });
|
|
697
693
|
return icon;
|
|
698
694
|
};
|
|
699
695
|
|
|
@@ -728,7 +724,6 @@ const Omnibar = (props) => {
|
|
|
728
724
|
nothingFound
|
|
729
725
|
});
|
|
730
726
|
};
|
|
731
|
-
var Omnibar_default = Omnibar;
|
|
732
727
|
|
|
733
728
|
//#endregion
|
|
734
729
|
//#region ../../src/core/components/layout/AlephaMantineProvider.tsx
|
|
@@ -751,13 +746,14 @@ const AlephaMantineProvider = (props) => {
|
|
|
751
746
|
}
|
|
752
747
|
}, []);
|
|
753
748
|
const defaultColorScheme = props.mantine?.defaultColorScheme ?? theme.defaultColorScheme;
|
|
754
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ColorSchemeScript, {
|
|
749
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ColorSchemeScript, {
|
|
755
750
|
defaultColorScheme,
|
|
756
751
|
...props.colorSchemeScript
|
|
757
752
|
}), /* @__PURE__ */ jsxs(MantineProvider, {
|
|
758
753
|
...props.mantine,
|
|
759
754
|
defaultColorScheme,
|
|
760
755
|
theme: {
|
|
756
|
+
cursorType: "pointer",
|
|
761
757
|
...theme,
|
|
762
758
|
...props.mantine?.theme
|
|
763
759
|
},
|
|
@@ -766,12 +762,11 @@ const AlephaMantineProvider = (props) => {
|
|
|
766
762
|
/* @__PURE__ */ jsx(NavigationProgress, { ...props.navigationProgress }),
|
|
767
763
|
/* @__PURE__ */ jsxs(ModalsProvider, {
|
|
768
764
|
...props.modals,
|
|
769
|
-
children: [props.omnibar !== false && /* @__PURE__ */ jsx(
|
|
765
|
+
children: [props.omnibar !== false && /* @__PURE__ */ jsx(Omnibar, { ...props.omnibar }), props.children ?? /* @__PURE__ */ jsx(NestedView, {})]
|
|
770
766
|
})
|
|
771
767
|
]
|
|
772
768
|
})] });
|
|
773
769
|
};
|
|
774
|
-
var AlephaMantineProvider_default = AlephaMantineProvider;
|
|
775
770
|
|
|
776
771
|
//#endregion
|
|
777
772
|
//#region ../../src/core/UiRouter.ts
|
|
@@ -784,7 +779,7 @@ var AlephaMantineProvider_default = AlephaMantineProvider;
|
|
|
784
779
|
var UiRouter = class {
|
|
785
780
|
root = $page({
|
|
786
781
|
path: "/",
|
|
787
|
-
component:
|
|
782
|
+
component: AlephaMantineProvider
|
|
788
783
|
});
|
|
789
784
|
};
|
|
790
785
|
|
|
@@ -831,40 +826,25 @@ const ActionButton = (_props) => {
|
|
|
831
826
|
const theme = useMantineTheme();
|
|
832
827
|
const props = { ..._props };
|
|
833
828
|
const { tooltip, menu, icon, ...restProps } = props;
|
|
834
|
-
if (props.variant === "subtle")
|
|
835
|
-
restProps.c ??= "var(--mantine-color-text)";
|
|
836
|
-
restProps.color ??= "gray";
|
|
837
|
-
}
|
|
829
|
+
if (props.variant === "subtle" || props.variant === "outline") restProps.color ??= "gray";
|
|
838
830
|
if (props.intent) {
|
|
839
|
-
if (props.intent === "none")
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
} else if (props.intent === "primary") {
|
|
843
|
-
restProps.c ??= "white";
|
|
844
|
-
restProps.color ??= theme.primaryColor;
|
|
845
|
-
} else if (props.intent === "success") {
|
|
831
|
+
if (props.intent === "none") restProps.color ??= "gray";
|
|
832
|
+
else if (props.intent === "primary") restProps.color ??= theme.primaryColor;
|
|
833
|
+
else if (props.intent === "success") {
|
|
846
834
|
restProps.c ??= "white";
|
|
847
835
|
restProps.color ??= "green";
|
|
848
836
|
} else if (props.intent === "danger") {
|
|
849
837
|
restProps.c ??= "white";
|
|
850
838
|
restProps.color ??= "red";
|
|
851
|
-
} else if (props.intent === "warning")
|
|
852
|
-
|
|
853
|
-
restProps.color ??= "yellow";
|
|
854
|
-
} else if (props.intent === "info") {
|
|
839
|
+
} else if (props.intent === "warning") restProps.color ??= "yellow";
|
|
840
|
+
else if (props.intent === "info") {
|
|
855
841
|
restProps.c ??= "white";
|
|
856
842
|
restProps.color ??= "blue";
|
|
857
843
|
}
|
|
858
844
|
}
|
|
859
845
|
if (props.icon) {
|
|
860
|
-
const
|
|
861
|
-
|
|
862
|
-
variant: "transparent",
|
|
863
|
-
size: "sm",
|
|
864
|
-
c: "var(--mantine-color-text)",
|
|
865
|
-
...props.themeIconProps,
|
|
866
|
-
children: props.icon
|
|
867
|
-
});
|
|
846
|
+
const sizes = ui.sizes.icon;
|
|
847
|
+
const icon = isComponentType(props.icon) ? /* @__PURE__ */ jsx(props.icon, { size: sizes[props.size || "md"] }) : /* @__PURE__ */ jsx("span", { children: props.icon });
|
|
868
848
|
if (!props.children) {
|
|
869
849
|
restProps.children = Children.only(icon);
|
|
870
850
|
restProps.px ??= "xs";
|
|
@@ -873,7 +853,7 @@ const ActionButton = (_props) => {
|
|
|
873
853
|
if (props.leftSection && !props.children) restProps.px ??= "xs";
|
|
874
854
|
if (props.textVisibleFrom) {
|
|
875
855
|
const { children, textVisibleFrom, leftSection, ...rest } = restProps;
|
|
876
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Flex$1, {
|
|
856
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Flex$1, {
|
|
877
857
|
w: "100%",
|
|
878
858
|
visibleFrom: textVisibleFrom,
|
|
879
859
|
children: /* @__PURE__ */ jsx(ActionButton, {
|
|
@@ -967,7 +947,6 @@ const ActionButton = (_props) => {
|
|
|
967
947
|
}
|
|
968
948
|
return actionElement;
|
|
969
949
|
};
|
|
970
|
-
var ActionButton_default = ActionButton;
|
|
971
950
|
/**
|
|
972
951
|
* Action button that submits a form with loading and disabled state handling.
|
|
973
952
|
*/
|
|
@@ -1100,7 +1079,6 @@ const BurgerButton = (props) => {
|
|
|
1100
1079
|
...props
|
|
1101
1080
|
});
|
|
1102
1081
|
};
|
|
1103
|
-
var BurgerButton_default = BurgerButton;
|
|
1104
1082
|
|
|
1105
1083
|
//#endregion
|
|
1106
1084
|
//#region ../../src/core/components/buttons/ClipboardButton.tsx
|
|
@@ -1112,7 +1090,7 @@ const ClipboardButton = (props) => {
|
|
|
1112
1090
|
children: ({ copied, copy }) => /* @__PURE__ */ jsx(Tooltip, {
|
|
1113
1091
|
label: copied ? copiedLabel : copyLabel,
|
|
1114
1092
|
openDelay: 500,
|
|
1115
|
-
children: /* @__PURE__ */ jsx(
|
|
1093
|
+
children: /* @__PURE__ */ jsx(ActionButton, {
|
|
1116
1094
|
color: copied ? "teal" : void 0,
|
|
1117
1095
|
onClick: copy,
|
|
1118
1096
|
icon: copied ? IconCheck : IconCopy,
|
|
@@ -1122,7 +1100,6 @@ const ClipboardButton = (props) => {
|
|
|
1122
1100
|
})
|
|
1123
1101
|
});
|
|
1124
1102
|
};
|
|
1125
|
-
var ClipboardButton_default = ClipboardButton;
|
|
1126
1103
|
|
|
1127
1104
|
//#endregion
|
|
1128
1105
|
//#region ../../src/core/components/buttons/DarkModeButton.tsx
|
|
@@ -1138,23 +1115,29 @@ const DarkModeButton = (props) => {
|
|
|
1138
1115
|
const toggleColorScheme = () => {
|
|
1139
1116
|
setColorScheme((document.documentElement.getAttribute("data-mantine-color-scheme") ?? "light") === "dark" ? "light" : "dark");
|
|
1140
1117
|
};
|
|
1141
|
-
|
|
1118
|
+
const size = props.size ?? "md";
|
|
1119
|
+
const iconSize = ui.sizes.icon[size] ?? ui.sizes.icon.md;
|
|
1120
|
+
return /* @__PURE__ */ jsx(ActionButton, {
|
|
1142
1121
|
onClick: toggleColorScheme,
|
|
1143
1122
|
variant: props.variant ?? "subtle",
|
|
1144
|
-
size
|
|
1123
|
+
size,
|
|
1145
1124
|
"aria-label": "Toggle color scheme",
|
|
1146
|
-
|
|
1147
|
-
|
|
1125
|
+
icon: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(IconSun, {
|
|
1126
|
+
size: iconSize,
|
|
1127
|
+
className: "alepha-light-hidden"
|
|
1128
|
+
}), /* @__PURE__ */ jsx(IconMoon, {
|
|
1129
|
+
size: iconSize,
|
|
1130
|
+
className: "alepha-dark-hidden"
|
|
1131
|
+
})] }),
|
|
1148
1132
|
...props
|
|
1149
1133
|
});
|
|
1150
1134
|
};
|
|
1151
|
-
var DarkModeButton_default = DarkModeButton;
|
|
1152
1135
|
|
|
1153
1136
|
//#endregion
|
|
1154
1137
|
//#region ../../src/core/components/buttons/LanguageButton.tsx
|
|
1155
1138
|
const LanguageButton = (props) => {
|
|
1156
1139
|
const i18n = useI18n();
|
|
1157
|
-
return /* @__PURE__ */ jsx(
|
|
1140
|
+
return /* @__PURE__ */ jsx(ActionButton, {
|
|
1158
1141
|
variant: "default",
|
|
1159
1142
|
icon: IconLanguage,
|
|
1160
1143
|
menu: { items: i18n.languages.map((lang) => ({
|
|
@@ -1165,14 +1148,13 @@ const LanguageButton = (props) => {
|
|
|
1165
1148
|
...props
|
|
1166
1149
|
});
|
|
1167
1150
|
};
|
|
1168
|
-
var LanguageButton_default = LanguageButton;
|
|
1169
1151
|
|
|
1170
1152
|
//#endregion
|
|
1171
1153
|
//#region ../../src/core/components/buttons/OmnibarButton.tsx
|
|
1172
1154
|
const OmnibarButton = (props) => {
|
|
1173
1155
|
const os = useOs();
|
|
1174
1156
|
const shortcut = os === "macos" || os === "ios" ? "⌘" : "Ctrl";
|
|
1175
|
-
if (props.collapsed) return /* @__PURE__ */ jsx(
|
|
1157
|
+
if (props.collapsed) return /* @__PURE__ */ jsx(ActionButton, {
|
|
1176
1158
|
variant: "subtle",
|
|
1177
1159
|
onClick: spotlight.open,
|
|
1178
1160
|
radius: "md",
|
|
@@ -1183,7 +1165,7 @@ const OmnibarButton = (props) => {
|
|
|
1183
1165
|
},
|
|
1184
1166
|
...props.actionProps
|
|
1185
1167
|
});
|
|
1186
|
-
return /* @__PURE__ */ jsx(
|
|
1168
|
+
return /* @__PURE__ */ jsx(ActionButton, {
|
|
1187
1169
|
variant: "default",
|
|
1188
1170
|
onClick: spotlight.open,
|
|
1189
1171
|
justify: "space-between",
|
|
@@ -1212,14 +1194,13 @@ const OmnibarButton = (props) => {
|
|
|
1212
1194
|
})
|
|
1213
1195
|
});
|
|
1214
1196
|
};
|
|
1215
|
-
var OmnibarButton_default = OmnibarButton;
|
|
1216
1197
|
|
|
1217
1198
|
//#endregion
|
|
1218
1199
|
//#region ../../src/core/components/buttons/ThemeButton.tsx
|
|
1219
1200
|
const ThemeButton = (props) => {
|
|
1220
1201
|
const [theme, setTheme] = useTheme();
|
|
1221
1202
|
const themeList = useStore(alephaThemeListAtom)[0];
|
|
1222
|
-
return /* @__PURE__ */ jsx(
|
|
1203
|
+
return /* @__PURE__ */ jsx(ActionButton, {
|
|
1223
1204
|
variant: "subtle",
|
|
1224
1205
|
icon: IconPalette,
|
|
1225
1206
|
menu: { items: themeList.map((it, index) => ({
|
|
@@ -1230,14 +1211,13 @@ const ThemeButton = (props) => {
|
|
|
1230
1211
|
...props
|
|
1231
1212
|
});
|
|
1232
1213
|
};
|
|
1233
|
-
var ThemeButton_default = ThemeButton;
|
|
1234
1214
|
|
|
1235
1215
|
//#endregion
|
|
1236
1216
|
//#region ../../src/core/components/buttons/ToggleSidebarButton.tsx
|
|
1237
1217
|
const ToggleSidebarButton = (props) => {
|
|
1238
1218
|
const [sidebar, setSidebar] = useStore(alephaSidebarAtom);
|
|
1239
|
-
return /* @__PURE__ */ jsx(
|
|
1240
|
-
icon: sidebar.collapsed ?
|
|
1219
|
+
return /* @__PURE__ */ jsx(ActionButton, {
|
|
1220
|
+
icon: sidebar.collapsed ? IconLayoutSidebarRightCollapse : IconLayoutSidebarLeftCollapse,
|
|
1241
1221
|
visibleFrom: "sm",
|
|
1242
1222
|
variant: "subtle",
|
|
1243
1223
|
size: "md",
|
|
@@ -1256,7 +1236,6 @@ const ToggleSidebarButton = (props) => {
|
|
|
1256
1236
|
...props
|
|
1257
1237
|
});
|
|
1258
1238
|
};
|
|
1259
|
-
var ToggleSidebarButton_default = ToggleSidebarButton;
|
|
1260
1239
|
|
|
1261
1240
|
//#endregion
|
|
1262
1241
|
//#region ../../src/core/utils/icons.tsx
|
|
@@ -1312,15 +1291,30 @@ const capitalize = (str) => {
|
|
|
1312
1291
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
1313
1292
|
};
|
|
1314
1293
|
/**
|
|
1294
|
+
* Converts camelCase or snake_case to Title Case with spaces.
|
|
1295
|
+
*
|
|
1296
|
+
* @example
|
|
1297
|
+
* toTitleCase("userName") // "User Name"
|
|
1298
|
+
* toTitleCase("first_name") // "First Name"
|
|
1299
|
+
* toTitleCase("email") // "Email"
|
|
1300
|
+
*/
|
|
1301
|
+
const toTitleCase = (str) => {
|
|
1302
|
+
return str.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
1303
|
+
};
|
|
1304
|
+
/**
|
|
1315
1305
|
* Converts a path or identifier string into a pretty display name.
|
|
1316
|
-
*
|
|
1306
|
+
* For paths like "/contacts/0/name", extracts just the field name "Name".
|
|
1307
|
+
* Handles camelCase and snake_case conversion to Title Case.
|
|
1317
1308
|
*
|
|
1318
1309
|
* @example
|
|
1319
|
-
* prettyName("/userName") // "
|
|
1320
|
-
* prettyName("email") // "Email"
|
|
1310
|
+
* prettyName("/userName") // "User Name"
|
|
1311
|
+
* prettyName("/contacts/0/email") // "Email"
|
|
1312
|
+
* prettyName("/address/streetName") // "Street Name"
|
|
1313
|
+
* prettyName("first_name") // "First Name"
|
|
1321
1314
|
*/
|
|
1322
1315
|
const prettyName = (name) => {
|
|
1323
|
-
|
|
1316
|
+
const segments = name.split("/").filter((s) => s && !/^\d+$/.test(s));
|
|
1317
|
+
return toTitleCase(segments[segments.length - 1] || name.replaceAll("/", ""));
|
|
1324
1318
|
};
|
|
1325
1319
|
|
|
1326
1320
|
//#endregion
|
|
@@ -1364,6 +1358,107 @@ const parseInput = (props, form) => {
|
|
|
1364
1358
|
//#endregion
|
|
1365
1359
|
//#region ../../src/core/components/form/ControlArray.tsx
|
|
1366
1360
|
/**
|
|
1361
|
+
* Custom hook to sync array items with form state.
|
|
1362
|
+
* Uses form events as the source of truth, eliminating dual-state issues.
|
|
1363
|
+
*/
|
|
1364
|
+
const useArrayItems = (input) => {
|
|
1365
|
+
const alepha = useAlepha();
|
|
1366
|
+
const keyCounter = useRef(0);
|
|
1367
|
+
const [items, setItemsState] = useState(() => {
|
|
1368
|
+
const defaultValue = input?.props?.defaultValue;
|
|
1369
|
+
if (Array.isArray(defaultValue)) return defaultValue.map((value) => ({
|
|
1370
|
+
key: keyCounter.current++,
|
|
1371
|
+
value
|
|
1372
|
+
}));
|
|
1373
|
+
return [];
|
|
1374
|
+
});
|
|
1375
|
+
const syncFromFormValue = useCallback((formValue) => {
|
|
1376
|
+
if (!Array.isArray(formValue)) {
|
|
1377
|
+
setItemsState([]);
|
|
1378
|
+
return;
|
|
1379
|
+
}
|
|
1380
|
+
setItemsState((prevItems) => {
|
|
1381
|
+
if (prevItems.length === formValue.length) {
|
|
1382
|
+
if (prevItems.every((item, i) => item.value === formValue[i])) return prevItems;
|
|
1383
|
+
}
|
|
1384
|
+
keyCounter.current = 0;
|
|
1385
|
+
return formValue.map((value) => ({
|
|
1386
|
+
key: keyCounter.current++,
|
|
1387
|
+
value
|
|
1388
|
+
}));
|
|
1389
|
+
});
|
|
1390
|
+
}, []);
|
|
1391
|
+
useEffect(() => {
|
|
1392
|
+
if (!input?.form) return;
|
|
1393
|
+
const formId = input.form.id;
|
|
1394
|
+
const fieldPath = input.path;
|
|
1395
|
+
const listeners = [alepha.events.on("form:reset", (event) => {
|
|
1396
|
+
if (event.id === formId) {
|
|
1397
|
+
const defaultValue = input.props?.defaultValue;
|
|
1398
|
+
keyCounter.current = 0;
|
|
1399
|
+
if (Array.isArray(defaultValue)) setItemsState(defaultValue.map((value) => ({
|
|
1400
|
+
key: keyCounter.current++,
|
|
1401
|
+
value
|
|
1402
|
+
})));
|
|
1403
|
+
else setItemsState([]);
|
|
1404
|
+
}
|
|
1405
|
+
}), alepha.events.on("form:change", (event) => {
|
|
1406
|
+
if (event.id === formId && event.path === fieldPath) syncFromFormValue(event.value);
|
|
1407
|
+
})];
|
|
1408
|
+
return () => {
|
|
1409
|
+
for (const unsub of listeners) unsub();
|
|
1410
|
+
};
|
|
1411
|
+
}, [
|
|
1412
|
+
alepha,
|
|
1413
|
+
input,
|
|
1414
|
+
syncFromFormValue
|
|
1415
|
+
]);
|
|
1416
|
+
return {
|
|
1417
|
+
items,
|
|
1418
|
+
setItems: useCallback((newItems) => {
|
|
1419
|
+
setItemsState(newItems);
|
|
1420
|
+
input?.set(newItems.map((item) => item.value));
|
|
1421
|
+
}, [input]),
|
|
1422
|
+
nextKey: useCallback(() => keyCounter.current++, [])
|
|
1423
|
+
};
|
|
1424
|
+
};
|
|
1425
|
+
/**
|
|
1426
|
+
* Creates a proper InputField for an array item that integrates with the form system.
|
|
1427
|
+
* Uses array index for test IDs to ensure predictable, testable element identifiers.
|
|
1428
|
+
*/
|
|
1429
|
+
const createArrayItemInput = (parentInput, itemSchema, index, _itemKey, value, onValueChange) => {
|
|
1430
|
+
return {
|
|
1431
|
+
schema: itemSchema,
|
|
1432
|
+
path: `${parentInput.path}/${index}`,
|
|
1433
|
+
required: false,
|
|
1434
|
+
form: parentInput.form,
|
|
1435
|
+
props: {
|
|
1436
|
+
id: `${parentInput.props.id}-${index}`,
|
|
1437
|
+
name: `${parentInput.props.name}[${index}]`,
|
|
1438
|
+
defaultValue: value
|
|
1439
|
+
},
|
|
1440
|
+
set: onValueChange
|
|
1441
|
+
};
|
|
1442
|
+
};
|
|
1443
|
+
/**
|
|
1444
|
+
* Creates a proper InputField for a nested object field within an array item.
|
|
1445
|
+
* Uses array index for test IDs to ensure predictable, testable element identifiers.
|
|
1446
|
+
*/
|
|
1447
|
+
const createArrayItemFieldInput = (parentInput, itemSchema, fieldName, index, _itemKey, itemValue, onFieldChange) => {
|
|
1448
|
+
return {
|
|
1449
|
+
schema: itemSchema.properties[fieldName],
|
|
1450
|
+
path: `${parentInput.path}/${index}/${fieldName}`,
|
|
1451
|
+
required: itemSchema.required?.includes(fieldName) ?? false,
|
|
1452
|
+
form: parentInput.form,
|
|
1453
|
+
props: {
|
|
1454
|
+
id: `${parentInput.props.id}-${index}-${fieldName}`,
|
|
1455
|
+
name: `${parentInput.props.name}[${index}].${fieldName}`,
|
|
1456
|
+
defaultValue: itemValue?.[fieldName]
|
|
1457
|
+
},
|
|
1458
|
+
set: (value) => onFieldChange(fieldName, value)
|
|
1459
|
+
};
|
|
1460
|
+
};
|
|
1461
|
+
/**
|
|
1367
1462
|
* ControlArray component for editing arrays of schema items.
|
|
1368
1463
|
*
|
|
1369
1464
|
* Features:
|
|
@@ -1372,6 +1467,7 @@ const parseInput = (props, form) => {
|
|
|
1372
1467
|
* - Supports arrays of primitives
|
|
1373
1468
|
* - Grid layout for object items
|
|
1374
1469
|
* - Min/max constraints
|
|
1470
|
+
* - Syncs with form state (handles external updates and resets)
|
|
1375
1471
|
*
|
|
1376
1472
|
* @example
|
|
1377
1473
|
* ```tsx
|
|
@@ -1395,36 +1491,13 @@ const parseInput = (props, form) => {
|
|
|
1395
1491
|
*/
|
|
1396
1492
|
const ControlArray = (props) => {
|
|
1397
1493
|
const { inputProps } = parseInput(props, {});
|
|
1398
|
-
const
|
|
1399
|
-
const [items, setItems] = useState(() => {
|
|
1400
|
-
const defaultValue = props.input?.props?.defaultValue;
|
|
1401
|
-
if (Array.isArray(defaultValue)) return defaultValue.map((value) => ({
|
|
1402
|
-
key: idCounter.current++,
|
|
1403
|
-
value
|
|
1404
|
-
}));
|
|
1405
|
-
return [];
|
|
1406
|
-
});
|
|
1407
|
-
useEvents({ "form:reset": (event) => {
|
|
1408
|
-
if (event.id === props.input?.form?.id) {
|
|
1409
|
-
const defaultValue = props.input?.props?.defaultValue;
|
|
1410
|
-
if (Array.isArray(defaultValue)) {
|
|
1411
|
-
idCounter.current = 0;
|
|
1412
|
-
setItems(defaultValue.map((value) => ({
|
|
1413
|
-
key: idCounter.current++,
|
|
1414
|
-
value
|
|
1415
|
-
})));
|
|
1416
|
-
} else setItems([]);
|
|
1417
|
-
}
|
|
1418
|
-
} }, [props.input]);
|
|
1494
|
+
const { items, setItems, nextKey } = useArrayItems(props.input);
|
|
1419
1495
|
if (!props.input?.props) return null;
|
|
1420
1496
|
const schema = props.input.schema;
|
|
1421
1497
|
if (!schema || !("items" in schema)) return null;
|
|
1422
1498
|
const itemSchema = schema.items;
|
|
1423
1499
|
const isObjectItem = itemSchema && "properties" in itemSchema;
|
|
1424
1500
|
const { min = 0, max = Number.POSITIVE_INFINITY, columns = 1 } = props;
|
|
1425
|
-
const updateFormValue = (newItems) => {
|
|
1426
|
-
props.input.set(newItems.map((item) => item.value));
|
|
1427
|
-
};
|
|
1428
1501
|
const handleAdd = () => {
|
|
1429
1502
|
if (items.length >= max) return;
|
|
1430
1503
|
let newValue;
|
|
@@ -1433,18 +1506,14 @@ const ControlArray = (props) => {
|
|
|
1433
1506
|
const objSchema = itemSchema;
|
|
1434
1507
|
for (const [key, propSchema] of Object.entries(objSchema.properties)) if ("default" in propSchema) newValue[key] = propSchema.default;
|
|
1435
1508
|
} else newValue = "";
|
|
1436
|
-
|
|
1437
|
-
key:
|
|
1509
|
+
setItems([...items, {
|
|
1510
|
+
key: nextKey(),
|
|
1438
1511
|
value: newValue
|
|
1439
|
-
}];
|
|
1440
|
-
setItems(newItems);
|
|
1441
|
-
updateFormValue(newItems);
|
|
1512
|
+
}]);
|
|
1442
1513
|
};
|
|
1443
1514
|
const handleRemove = (index) => {
|
|
1444
1515
|
if (items.length <= min) return;
|
|
1445
|
-
|
|
1446
|
-
setItems(newItems);
|
|
1447
|
-
updateFormValue(newItems);
|
|
1516
|
+
setItems(items.filter((_, i) => i !== index));
|
|
1448
1517
|
};
|
|
1449
1518
|
const handleItemChange = (index, value) => {
|
|
1450
1519
|
const newItems = [...items];
|
|
@@ -1453,7 +1522,6 @@ const ControlArray = (props) => {
|
|
|
1453
1522
|
value
|
|
1454
1523
|
};
|
|
1455
1524
|
setItems(newItems);
|
|
1456
|
-
updateFormValue(newItems);
|
|
1457
1525
|
};
|
|
1458
1526
|
const handleFieldChange = (index, field, value) => {
|
|
1459
1527
|
const newItems = [...items];
|
|
@@ -1465,10 +1533,10 @@ const ControlArray = (props) => {
|
|
|
1465
1533
|
}
|
|
1466
1534
|
};
|
|
1467
1535
|
setItems(newItems);
|
|
1468
|
-
updateFormValue(newItems);
|
|
1469
1536
|
};
|
|
1470
1537
|
const colSpan = 12 / columns;
|
|
1471
|
-
const
|
|
1538
|
+
const objectItemSchema = isObjectItem ? itemSchema : null;
|
|
1539
|
+
const fieldNames = objectItemSchema ? Object.keys(objectItemSchema.properties) : [];
|
|
1472
1540
|
const renderItems = () => /* @__PURE__ */ jsxs(Stack, {
|
|
1473
1541
|
gap: "sm",
|
|
1474
1542
|
children: [items.map((item, index) => /* @__PURE__ */ jsxs(Flex$1, {
|
|
@@ -1484,47 +1552,24 @@ const ControlArray = (props) => {
|
|
|
1484
1552
|
style: { cursor: "grab" },
|
|
1485
1553
|
children: /* @__PURE__ */ jsx(IconGripVertical, { size: 16 })
|
|
1486
1554
|
}),
|
|
1487
|
-
|
|
1555
|
+
objectItemSchema ? /* @__PURE__ */ jsx(Grid, {
|
|
1488
1556
|
style: { flex: 1 },
|
|
1489
1557
|
gutter: "sm",
|
|
1490
1558
|
children: fieldNames.map((fieldName) => {
|
|
1491
|
-
const fieldSchema = itemSchema.properties[fieldName];
|
|
1492
1559
|
const fieldControlProps = props.controlProps?.[fieldName] ?? {};
|
|
1493
|
-
const
|
|
1494
|
-
schema: fieldSchema,
|
|
1495
|
-
props: {
|
|
1496
|
-
id: `${props.input.props.id}-${item.key}-${fieldName}`,
|
|
1497
|
-
name: `${props.input.props.name}[${index}].${fieldName}`,
|
|
1498
|
-
defaultValue: item.value?.[fieldName]
|
|
1499
|
-
},
|
|
1500
|
-
path: `${props.input.path}/${index}/${fieldName}`,
|
|
1501
|
-
required: itemSchema.required?.includes(fieldName) ?? false,
|
|
1502
|
-
form: props.input.form,
|
|
1503
|
-
set: (value) => handleFieldChange(index, fieldName, value)
|
|
1504
|
-
};
|
|
1560
|
+
const fieldInput = createArrayItemFieldInput(props.input, objectItemSchema, fieldName, index, item.key, item.value, (field, value) => handleFieldChange(index, field, value));
|
|
1505
1561
|
return /* @__PURE__ */ jsx(Grid.Col, {
|
|
1506
1562
|
span: colSpan,
|
|
1507
|
-
children: /* @__PURE__ */ jsx(
|
|
1508
|
-
input:
|
|
1563
|
+
children: /* @__PURE__ */ jsx(Control, {
|
|
1564
|
+
input: fieldInput,
|
|
1509
1565
|
...fieldControlProps
|
|
1510
1566
|
})
|
|
1511
1567
|
}, fieldName);
|
|
1512
1568
|
})
|
|
1513
1569
|
}) : /* @__PURE__ */ jsx(Flex$1, {
|
|
1514
1570
|
style: { flex: 1 },
|
|
1515
|
-
children: /* @__PURE__ */ jsx(
|
|
1516
|
-
input:
|
|
1517
|
-
schema: itemSchema,
|
|
1518
|
-
props: {
|
|
1519
|
-
id: `${props.input.props.id}-${item.key}`,
|
|
1520
|
-
name: `${props.input.props.name}[${index}]`,
|
|
1521
|
-
defaultValue: item.value
|
|
1522
|
-
},
|
|
1523
|
-
path: `${props.input.path}/${index}`,
|
|
1524
|
-
required: false,
|
|
1525
|
-
form: props.input.form,
|
|
1526
|
-
set: (value) => handleItemChange(index, value)
|
|
1527
|
-
},
|
|
1571
|
+
children: /* @__PURE__ */ jsx(Control, {
|
|
1572
|
+
input: createArrayItemInput(props.input, itemSchema, index, item.key, item.value, (value) => handleItemChange(index, value)),
|
|
1528
1573
|
...props.itemControlProps
|
|
1529
1574
|
})
|
|
1530
1575
|
}),
|
|
@@ -1609,7 +1654,6 @@ const ControlArray = (props) => {
|
|
|
1609
1654
|
})
|
|
1610
1655
|
});
|
|
1611
1656
|
};
|
|
1612
|
-
var ControlArray_default = ControlArray;
|
|
1613
1657
|
|
|
1614
1658
|
//#endregion
|
|
1615
1659
|
//#region ../../src/core/components/form/ControlDate.tsx
|
|
@@ -1667,7 +1711,6 @@ const ControlDate = (props) => {
|
|
|
1667
1711
|
}
|
|
1668
1712
|
return null;
|
|
1669
1713
|
};
|
|
1670
|
-
var ControlDate_default = ControlDate;
|
|
1671
1714
|
|
|
1672
1715
|
//#endregion
|
|
1673
1716
|
//#region ../../src/core/components/form/ControlNumber.tsx
|
|
@@ -1726,7 +1769,6 @@ const ControlNumber = (props) => {
|
|
|
1726
1769
|
}
|
|
1727
1770
|
});
|
|
1728
1771
|
};
|
|
1729
|
-
var ControlNumber_default = ControlNumber;
|
|
1730
1772
|
|
|
1731
1773
|
//#endregion
|
|
1732
1774
|
//#region ../../src/core/components/form/ControlObject.tsx
|
|
@@ -1776,7 +1818,7 @@ const ControlObject = (props) => {
|
|
|
1776
1818
|
if (!field) return null;
|
|
1777
1819
|
return /* @__PURE__ */ jsx(Grid.Col, {
|
|
1778
1820
|
span: colSpan,
|
|
1779
|
-
children: /* @__PURE__ */ jsx(
|
|
1821
|
+
children: /* @__PURE__ */ jsx(Control, {
|
|
1780
1822
|
input: field,
|
|
1781
1823
|
...fieldControlProps
|
|
1782
1824
|
})
|
|
@@ -1803,7 +1845,6 @@ const ControlObject = (props) => {
|
|
|
1803
1845
|
})
|
|
1804
1846
|
});
|
|
1805
1847
|
};
|
|
1806
|
-
var ControlObject_default = ControlObject;
|
|
1807
1848
|
|
|
1808
1849
|
//#endregion
|
|
1809
1850
|
//#region ../../src/core/utils/extractSchemaFields.ts
|
|
@@ -2033,7 +2074,7 @@ function QueryHelp({ fields, onInsert }) {
|
|
|
2033
2074
|
children: Object.entries(OPERATOR_INFO).map(([key, info]) => /* @__PURE__ */ jsxs(Group, {
|
|
2034
2075
|
gap: "xs",
|
|
2035
2076
|
wrap: "nowrap",
|
|
2036
|
-
children: [/* @__PURE__ */ jsx(
|
|
2077
|
+
children: [/* @__PURE__ */ jsx(ActionButton, {
|
|
2037
2078
|
px: "xs",
|
|
2038
2079
|
size: "xs",
|
|
2039
2080
|
h: 24,
|
|
@@ -2063,7 +2104,7 @@ function QueryHelp({ fields, onInsert }) {
|
|
|
2063
2104
|
children: [/* @__PURE__ */ jsxs(Group, {
|
|
2064
2105
|
gap: "xs",
|
|
2065
2106
|
wrap: "nowrap",
|
|
2066
|
-
children: [/* @__PURE__ */ jsx(
|
|
2107
|
+
children: [/* @__PURE__ */ jsx(ActionButton, {
|
|
2067
2108
|
px: "xs",
|
|
2068
2109
|
size: "xs",
|
|
2069
2110
|
h: 24,
|
|
@@ -2080,7 +2121,7 @@ function QueryHelp({ fields, onInsert }) {
|
|
|
2080
2121
|
}), /* @__PURE__ */ jsxs(Group, {
|
|
2081
2122
|
gap: "xs",
|
|
2082
2123
|
wrap: "nowrap",
|
|
2083
|
-
children: [/* @__PURE__ */ jsx(
|
|
2124
|
+
children: [/* @__PURE__ */ jsx(ActionButton, {
|
|
2084
2125
|
px: "xs",
|
|
2085
2126
|
size: "xs",
|
|
2086
2127
|
h: 24,
|
|
@@ -2120,7 +2161,7 @@ function QueryHelp({ fields, onInsert }) {
|
|
|
2120
2161
|
wrap: "nowrap",
|
|
2121
2162
|
align: "flex-start",
|
|
2122
2163
|
children: [
|
|
2123
|
-
/* @__PURE__ */ jsx(
|
|
2164
|
+
/* @__PURE__ */ jsx(ActionButton, {
|
|
2124
2165
|
px: "xs",
|
|
2125
2166
|
size: "xs",
|
|
2126
2167
|
h: 24,
|
|
@@ -2146,7 +2187,7 @@ function QueryHelp({ fields, onInsert }) {
|
|
|
2146
2187
|
}), field.enum && /* @__PURE__ */ jsx(Group, {
|
|
2147
2188
|
gap: 0,
|
|
2148
2189
|
wrap: "wrap",
|
|
2149
|
-
children: field.enum.map((enumValue) => /* @__PURE__ */ jsx(
|
|
2190
|
+
children: field.enum.map((enumValue) => /* @__PURE__ */ jsx(ActionButton, {
|
|
2150
2191
|
px: "xs",
|
|
2151
2192
|
size: "xs",
|
|
2152
2193
|
h: 24,
|
|
@@ -2168,7 +2209,6 @@ function QueryHelp({ fields, onInsert }) {
|
|
|
2168
2209
|
]
|
|
2169
2210
|
});
|
|
2170
2211
|
}
|
|
2171
|
-
var ControlQueryBuilder_default = ControlQueryBuilder;
|
|
2172
2212
|
|
|
2173
2213
|
//#endregion
|
|
2174
2214
|
//#region ../../src/core/components/form/ControlSelect.tsx
|
|
@@ -2268,7 +2308,6 @@ const ControlSelect = (props) => {
|
|
|
2268
2308
|
...selectProps
|
|
2269
2309
|
});
|
|
2270
2310
|
};
|
|
2271
|
-
var ControlSelect_default = ControlSelect;
|
|
2272
2311
|
|
|
2273
2312
|
//#endregion
|
|
2274
2313
|
//#region ../../src/core/components/form/Control.tsx
|
|
@@ -2304,7 +2343,7 @@ const Control = (_props) => {
|
|
|
2304
2343
|
..._props,
|
|
2305
2344
|
...schema.$control
|
|
2306
2345
|
};
|
|
2307
|
-
if (props.query) return /* @__PURE__ */ jsx(
|
|
2346
|
+
if (props.query) return /* @__PURE__ */ jsx(ControlQueryBuilder, {
|
|
2308
2347
|
...props.input.props,
|
|
2309
2348
|
...inputProps,
|
|
2310
2349
|
schema: props.query,
|
|
@@ -2332,7 +2371,7 @@ const Control = (_props) => {
|
|
|
2332
2371
|
const isObject = props.input.schema && "type" in props.input.schema && props.input.schema.type === "object" && "properties" in props.input.schema;
|
|
2333
2372
|
if (props.object || isObject) {
|
|
2334
2373
|
const controlObjectProps = typeof props.object === "object" ? props.object : {};
|
|
2335
|
-
return /* @__PURE__ */ jsx(
|
|
2374
|
+
return /* @__PURE__ */ jsx(ControlObject, {
|
|
2336
2375
|
input: props.input,
|
|
2337
2376
|
title: props.title,
|
|
2338
2377
|
description: props.description,
|
|
@@ -2343,7 +2382,7 @@ const Control = (_props) => {
|
|
|
2343
2382
|
const isArrayOfObjects = isArray && "items" in props.input.schema && props.input.schema.items && typeof props.input.schema.items === "object" && "properties" in props.input.schema.items;
|
|
2344
2383
|
if (props.array || isArrayOfObjects) {
|
|
2345
2384
|
const controlArrayProps = typeof props.array === "object" ? props.array : {};
|
|
2346
|
-
return /* @__PURE__ */ jsx(
|
|
2385
|
+
return /* @__PURE__ */ jsx(ControlArray, {
|
|
2347
2386
|
input: props.input,
|
|
2348
2387
|
title: props.title,
|
|
2349
2388
|
description: props.description,
|
|
@@ -2353,7 +2392,7 @@ const Control = (_props) => {
|
|
|
2353
2392
|
if (props.number || props.input.schema && "type" in props.input.schema && (props.input.schema.type === "number" || props.input.schema.type === "integer")) {
|
|
2354
2393
|
const controlNumberProps = typeof props.number === "object" ? props.number : {};
|
|
2355
2394
|
if (props.slider) controlNumberProps.sliderProps ??= {};
|
|
2356
|
-
return /* @__PURE__ */ jsx(
|
|
2395
|
+
return /* @__PURE__ */ jsx(ControlNumber, {
|
|
2357
2396
|
input: props.input,
|
|
2358
2397
|
title: props.title,
|
|
2359
2398
|
description: props.description,
|
|
@@ -2386,7 +2425,7 @@ const Control = (_props) => {
|
|
|
2386
2425
|
if (props.input.schema && "enum" in props.input.schema && props.input.schema.enum || isArray && !isArrayOfObjects || props.select) {
|
|
2387
2426
|
const opts = typeof props.select === "object" ? props.select : {};
|
|
2388
2427
|
if (props.segmented) opts.segmented ??= {};
|
|
2389
|
-
return /* @__PURE__ */ jsx(
|
|
2428
|
+
return /* @__PURE__ */ jsx(ControlSelect, {
|
|
2390
2429
|
input: props.input,
|
|
2391
2430
|
title: props.title,
|
|
2392
2431
|
description: props.description,
|
|
@@ -2395,42 +2434,16 @@ const Control = (_props) => {
|
|
|
2395
2434
|
});
|
|
2396
2435
|
}
|
|
2397
2436
|
if (props.input.schema && "type" in props.input.schema && props.input.schema.type === "boolean") {
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
...switchProps
|
|
2409
|
-
});
|
|
2410
|
-
}
|
|
2411
|
-
const selectProps = {
|
|
2412
|
-
loader: async () => [
|
|
2413
|
-
{
|
|
2414
|
-
value: "true",
|
|
2415
|
-
label: "Yes"
|
|
2416
|
-
},
|
|
2417
|
-
{
|
|
2418
|
-
value: "false",
|
|
2419
|
-
label: "No"
|
|
2420
|
-
},
|
|
2421
|
-
{
|
|
2422
|
-
value: "",
|
|
2423
|
-
label: ""
|
|
2424
|
-
}
|
|
2425
|
-
],
|
|
2426
|
-
...props.input.props
|
|
2427
|
-
};
|
|
2428
|
-
return /* @__PURE__ */ jsx(ControlSelect_default, {
|
|
2429
|
-
input: props.input,
|
|
2430
|
-
title: props.title,
|
|
2431
|
-
description: props.description,
|
|
2432
|
-
icon,
|
|
2433
|
-
...selectProps
|
|
2437
|
+
const switchProps = typeof props.switch === "object" ? props.switch : {};
|
|
2438
|
+
return /* @__PURE__ */ jsx(Switch, {
|
|
2439
|
+
...inputProps,
|
|
2440
|
+
id,
|
|
2441
|
+
color: "blue",
|
|
2442
|
+
defaultChecked: props.input.props.defaultValue,
|
|
2443
|
+
onChange: (event) => {
|
|
2444
|
+
props.input.set(event.currentTarget.checked);
|
|
2445
|
+
},
|
|
2446
|
+
...switchProps
|
|
2434
2447
|
});
|
|
2435
2448
|
}
|
|
2436
2449
|
if (props.password || props.input.props.name?.includes("password")) {
|
|
@@ -2453,7 +2466,7 @@ const Control = (_props) => {
|
|
|
2453
2466
|
...textAreaProps
|
|
2454
2467
|
});
|
|
2455
2468
|
}
|
|
2456
|
-
if (props.date || props.datetime || props.time || format === "date" || format === "date-time" || format === "time") return /* @__PURE__ */ jsx(
|
|
2469
|
+
if (props.date || props.datetime || props.time || format === "date" || format === "date-time" || format === "time") return /* @__PURE__ */ jsx(ControlDate, {
|
|
2457
2470
|
input: props.input,
|
|
2458
2471
|
title: props.title,
|
|
2459
2472
|
description: props.description,
|
|
@@ -2488,7 +2501,6 @@ const Control = (_props) => {
|
|
|
2488
2501
|
]
|
|
2489
2502
|
});
|
|
2490
2503
|
};
|
|
2491
|
-
var Control_default = Control;
|
|
2492
2504
|
|
|
2493
2505
|
//#endregion
|
|
2494
2506
|
//#region ../../src/core/components/form/TypeForm.tsx
|
|
@@ -2551,7 +2563,7 @@ const TypeForm = (props) => {
|
|
|
2551
2563
|
xl: columns.xl ? 12 / columns.xl : void 0
|
|
2552
2564
|
};
|
|
2553
2565
|
const renderFields = () => {
|
|
2554
|
-
if (children) return /* @__PURE__ */ jsx(Fragment, { children: children(form.input) });
|
|
2566
|
+
if (children) return /* @__PURE__ */ jsx(Fragment$1, { children: children(form.input) });
|
|
2555
2567
|
return /* @__PURE__ */ jsx(Grid, { children: supportedFields.map((fieldName) => {
|
|
2556
2568
|
const field = form.input[fieldName];
|
|
2557
2569
|
const fieldSchema = schema.properties[fieldName];
|
|
@@ -2565,7 +2577,7 @@ const TypeForm = (props) => {
|
|
|
2565
2577
|
};
|
|
2566
2578
|
return /* @__PURE__ */ jsx(Grid.Col, {
|
|
2567
2579
|
span,
|
|
2568
|
-
children: /* @__PURE__ */ jsx(
|
|
2580
|
+
children: /* @__PURE__ */ jsx(Control, {
|
|
2569
2581
|
input: field,
|
|
2570
2582
|
...mergedControlProps
|
|
2571
2583
|
})
|
|
@@ -2593,11 +2605,11 @@ const TypeForm = (props) => {
|
|
|
2593
2605
|
/* @__PURE__ */ jsx(Flex$1, { flex: 1 }),
|
|
2594
2606
|
/* @__PURE__ */ jsxs(Flex$1, {
|
|
2595
2607
|
gap: "sm",
|
|
2596
|
-
children: [/* @__PURE__ */ jsx(
|
|
2608
|
+
children: [/* @__PURE__ */ jsx(ActionButton, {
|
|
2597
2609
|
variant: "subtle",
|
|
2598
2610
|
type: "reset",
|
|
2599
2611
|
children: "Reset"
|
|
2600
|
-
}), /* @__PURE__ */ jsx(
|
|
2612
|
+
}), /* @__PURE__ */ jsx(ActionButton, {
|
|
2601
2613
|
intent: "primary",
|
|
2602
2614
|
form,
|
|
2603
2615
|
...submitButtonProps,
|
|
@@ -2617,7 +2629,6 @@ const TypeForm = (props) => {
|
|
|
2617
2629
|
children: content
|
|
2618
2630
|
});
|
|
2619
2631
|
};
|
|
2620
|
-
var TypeForm_default = TypeForm;
|
|
2621
2632
|
|
|
2622
2633
|
//#endregion
|
|
2623
2634
|
//#region ../../src/core/components/layout/AppBar.tsx
|
|
@@ -2627,10 +2638,10 @@ const AppBar = (props) => {
|
|
|
2627
2638
|
const renderItem = (item, index) => {
|
|
2628
2639
|
if (item.can && !item.can()) return null;
|
|
2629
2640
|
if ("type" in item) {
|
|
2630
|
-
if (item.type === "burger") return /* @__PURE__ */ jsx(
|
|
2631
|
-
if (item.type === "dark") return /* @__PURE__ */ jsx(
|
|
2632
|
-
if (item.type === "search") return /* @__PURE__ */ jsx(
|
|
2633
|
-
if (item.type === "lang") return /* @__PURE__ */ jsx(
|
|
2641
|
+
if (item.type === "burger") return /* @__PURE__ */ jsx(BurgerButton, {}, index);
|
|
2642
|
+
if (item.type === "dark") return /* @__PURE__ */ jsx(DarkModeButton, { ...item.props }, index);
|
|
2643
|
+
if (item.type === "search") return /* @__PURE__ */ jsx(OmnibarButton, { ...item.props }, index);
|
|
2644
|
+
if (item.type === "lang") return /* @__PURE__ */ jsx(LanguageButton, { ...item.props }, index);
|
|
2634
2645
|
if (item.type === "spacer") return /* @__PURE__ */ jsx(Flex$1, { w: 16 }, index);
|
|
2635
2646
|
if (item.type === "divider") return /* @__PURE__ */ jsx(Divider, { orientation: "vertical" }, index);
|
|
2636
2647
|
if (item.type === "logo") return renderLogo(item, index);
|
|
@@ -2672,7 +2683,7 @@ const AppBar = (props) => {
|
|
|
2672
2683
|
if (href) router.push(href);
|
|
2673
2684
|
else router.back();
|
|
2674
2685
|
};
|
|
2675
|
-
if (iconOnly) return /* @__PURE__ */ jsx(
|
|
2686
|
+
if (iconOnly) return /* @__PURE__ */ jsx(ActionButton, {
|
|
2676
2687
|
icon: iconElement,
|
|
2677
2688
|
variant: "subtle",
|
|
2678
2689
|
color: "gray",
|
|
@@ -2682,7 +2693,7 @@ const AppBar = (props) => {
|
|
|
2682
2693
|
position: "bottom"
|
|
2683
2694
|
}
|
|
2684
2695
|
}, index);
|
|
2685
|
-
return /* @__PURE__ */ jsx(
|
|
2696
|
+
return /* @__PURE__ */ jsx(ActionButton, {
|
|
2686
2697
|
leftSection: iconElement,
|
|
2687
2698
|
variant: "subtle",
|
|
2688
2699
|
color: "gray",
|
|
@@ -2732,19 +2743,71 @@ const AppBar = (props) => {
|
|
|
2732
2743
|
});
|
|
2733
2744
|
return content;
|
|
2734
2745
|
};
|
|
2735
|
-
|
|
2746
|
+
|
|
2747
|
+
//#endregion
|
|
2748
|
+
//#region ../../src/core/components/layout/Breadcrumb.tsx
|
|
2749
|
+
/**
|
|
2750
|
+
* Automatic breadcrumb component that reads the current route hierarchy
|
|
2751
|
+
* from the Alepha router's layer stack.
|
|
2752
|
+
*
|
|
2753
|
+
* Pages should define a `label` in their `$page()` options for best results.
|
|
2754
|
+
* Falls back to the page name converted to Title Case.
|
|
2755
|
+
*/
|
|
2756
|
+
const Breadcrumb = ({ home = "Home", separator, size = "xs", ...groupProps }) => {
|
|
2757
|
+
const state = useRouterState();
|
|
2758
|
+
const router = useRouter();
|
|
2759
|
+
const crumbs = [];
|
|
2760
|
+
if (home !== false) crumbs.push({
|
|
2761
|
+
label: home,
|
|
2762
|
+
href: "/"
|
|
2763
|
+
});
|
|
2764
|
+
for (let i = 1; i < state.layers.length; i++) {
|
|
2765
|
+
const layer = state.layers[i];
|
|
2766
|
+
const route = layer.route;
|
|
2767
|
+
if (route?.path === "/" || route?.path === "") continue;
|
|
2768
|
+
const label = route?.label ?? toTitleCase(layer.name);
|
|
2769
|
+
const href = router.path(layer.name);
|
|
2770
|
+
crumbs.push({
|
|
2771
|
+
label,
|
|
2772
|
+
href
|
|
2773
|
+
});
|
|
2774
|
+
}
|
|
2775
|
+
if (crumbs.length === 0) return null;
|
|
2776
|
+
const sep = separator ?? /* @__PURE__ */ jsx(IconChevronRight, {
|
|
2777
|
+
size: 12,
|
|
2778
|
+
color: "#9ca3af"
|
|
2779
|
+
});
|
|
2780
|
+
return /* @__PURE__ */ jsx(Group, {
|
|
2781
|
+
gap: 4,
|
|
2782
|
+
...groupProps,
|
|
2783
|
+
children: crumbs.map((crumb, i) => /* @__PURE__ */ jsxs(Group, {
|
|
2784
|
+
gap: 4,
|
|
2785
|
+
children: [i > 0 && sep, i < crumbs.length - 1 ? /* @__PURE__ */ jsx(Anchor, {
|
|
2786
|
+
component: Link,
|
|
2787
|
+
href: crumb.href,
|
|
2788
|
+
size,
|
|
2789
|
+
c: "dimmed",
|
|
2790
|
+
children: crumb.label
|
|
2791
|
+
}) : /* @__PURE__ */ jsx(Text$1, {
|
|
2792
|
+
size,
|
|
2793
|
+
fw: 500,
|
|
2794
|
+
children: crumb.label
|
|
2795
|
+
})]
|
|
2796
|
+
}, crumb.href))
|
|
2797
|
+
});
|
|
2798
|
+
};
|
|
2736
2799
|
|
|
2737
2800
|
//#endregion
|
|
2738
2801
|
//#region ../../src/core/components/layout/Sidebar.tsx
|
|
2739
2802
|
const Sidebar = (props) => {
|
|
2740
2803
|
const router = useRouter();
|
|
2741
2804
|
const { onItemClick } = props;
|
|
2742
|
-
const divider = (key) => {
|
|
2805
|
+
const divider = (key, fill) => {
|
|
2743
2806
|
return /* @__PURE__ */ jsx(Flex$1, {
|
|
2744
2807
|
h: 1,
|
|
2745
|
-
bg: "var(--
|
|
2808
|
+
bg: "var(--mantine-color-default-border)",
|
|
2746
2809
|
my: "xs",
|
|
2747
|
-
mx: props.collapsed ? 0 : "sm"
|
|
2810
|
+
mx: fill ? "calc(-1 * var(--mantine-spacing-md))" : props.collapsed ? 0 : "sm"
|
|
2748
2811
|
}, key);
|
|
2749
2812
|
};
|
|
2750
2813
|
const renderNode = (item, key) => {
|
|
@@ -2753,29 +2816,32 @@ const Sidebar = (props) => {
|
|
|
2753
2816
|
if (props.collapsed) return null;
|
|
2754
2817
|
return /* @__PURE__ */ jsx(Flex$1, { h: 16 }, key);
|
|
2755
2818
|
}
|
|
2756
|
-
if (item.type === "divider") return divider(key);
|
|
2819
|
+
if (item.type === "divider") return divider(key, item.fill);
|
|
2757
2820
|
if (item.type === "search") return /* @__PURE__ */ jsx(Flex$1, {
|
|
2758
2821
|
mb: "xs",
|
|
2759
|
-
children: /* @__PURE__ */ jsx(
|
|
2822
|
+
children: /* @__PURE__ */ jsx(OmnibarButton, { collapsed: props.collapsed })
|
|
2760
2823
|
}, key);
|
|
2761
|
-
if (item.type === "toggle") return /* @__PURE__ */ jsx(
|
|
2824
|
+
if (item.type === "toggle") return /* @__PURE__ */ jsx(ToggleSidebarButton, {}, key);
|
|
2762
2825
|
if (item.type === "section") {
|
|
2763
|
-
if (
|
|
2764
|
-
|
|
2826
|
+
if (item.children && item.children.length > 0) {
|
|
2827
|
+
if (!item.children.some((child) => !("can" in child) || !child.can || child.can())) return null;
|
|
2828
|
+
}
|
|
2829
|
+
if (props.collapsed) return /* @__PURE__ */ jsxs(Fragment, { children: [divider(`${key}-d`), item.children?.map((child, index) => renderNode(child, `s${key}-${index}`))] }, key);
|
|
2830
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Flex$1, {
|
|
2765
2831
|
mt: "md",
|
|
2766
2832
|
align: "center",
|
|
2767
2833
|
gap: "xs",
|
|
2768
|
-
children: [renderIcon(item.icon), /* @__PURE__ */ jsx(Text$1, {
|
|
2834
|
+
children: [renderIcon(item.icon, ui.sizes.icon.sm), /* @__PURE__ */ jsx(Text$1, {
|
|
2769
2835
|
size: "xs",
|
|
2770
2836
|
c: "dimmed",
|
|
2771
2837
|
tt: "uppercase",
|
|
2772
2838
|
fw: "bold",
|
|
2773
2839
|
children: item.label
|
|
2774
2840
|
})]
|
|
2775
|
-
}, key);
|
|
2841
|
+
}), item.children?.map((child, index) => renderNode(child, `s${key}-${index}`))] }, key);
|
|
2776
2842
|
}
|
|
2777
2843
|
}
|
|
2778
|
-
if ("element" in item) return /* @__PURE__ */ jsx(
|
|
2844
|
+
if ("element" in item) return /* @__PURE__ */ jsx(Fragment, { children: item.element }, key);
|
|
2779
2845
|
if (item.can && !item.can()) return null;
|
|
2780
2846
|
if (item.children && item.children.length > 0) {
|
|
2781
2847
|
if (!item.children.some((child) => !child.can || child.can())) return null;
|
|
@@ -2810,7 +2876,7 @@ const Sidebar = (props) => {
|
|
|
2810
2876
|
return [];
|
|
2811
2877
|
};
|
|
2812
2878
|
const padding = "md";
|
|
2813
|
-
const gap = props.items ? props.gap ??
|
|
2879
|
+
const gap = props.items ? props.gap ?? 4 : "xs";
|
|
2814
2880
|
const menu = useMemo(() => getSidebarNodes(), [props.items, props.autoPopulateMenu]);
|
|
2815
2881
|
return /* @__PURE__ */ jsxs(Flex$1, {
|
|
2816
2882
|
flex: 1,
|
|
@@ -2873,14 +2939,13 @@ const SidebarItem = (props) => {
|
|
|
2873
2939
|
direction: "column",
|
|
2874
2940
|
ps: level === 0 ? 0 : 32,
|
|
2875
2941
|
pos: "relative",
|
|
2876
|
-
children: [/* @__PURE__ */ jsx(
|
|
2942
|
+
children: [/* @__PURE__ */ jsx(ActionButton, {
|
|
2877
2943
|
w: "100%",
|
|
2878
2944
|
justify: "space-between",
|
|
2879
2945
|
href: props.item.href,
|
|
2880
2946
|
target: props.item.target,
|
|
2881
2947
|
size: props.item.theme?.size ?? props.theme.button?.size ?? (level === 0 ? "sm" : "xs"),
|
|
2882
2948
|
tooltip: item.description,
|
|
2883
|
-
c: "var(--mantine-color-text)",
|
|
2884
2949
|
color: "gray",
|
|
2885
2950
|
variant: "subtle",
|
|
2886
2951
|
variantActive: "default",
|
|
@@ -2890,7 +2955,7 @@ const SidebarItem = (props) => {
|
|
|
2890
2955
|
w: "100%",
|
|
2891
2956
|
align: "center",
|
|
2892
2957
|
gap: "sm",
|
|
2893
|
-
children: [renderIcon(item.icon), /* @__PURE__ */ jsx(Flex$1, {
|
|
2958
|
+
children: [renderIcon(item.icon, ui.sizes.icon.sm), /* @__PURE__ */ jsx(Flex$1, {
|
|
2894
2959
|
direction: "column",
|
|
2895
2960
|
children: /* @__PURE__ */ jsx(Flex$1, { children: item.label })
|
|
2896
2961
|
})]
|
|
@@ -2903,7 +2968,7 @@ const SidebarItem = (props) => {
|
|
|
2903
2968
|
children: [/* @__PURE__ */ jsx(Flex$1, { style: {
|
|
2904
2969
|
position: "absolute",
|
|
2905
2970
|
width: 1,
|
|
2906
|
-
background: "linear-gradient(to bottom, transparent, var(--
|
|
2971
|
+
background: "linear-gradient(to bottom, transparent, var(--mantine-color-default-border), transparent)",
|
|
2907
2972
|
top: 48,
|
|
2908
2973
|
left: 20 + 32 * level,
|
|
2909
2974
|
bottom: 16
|
|
@@ -2922,7 +2987,7 @@ const SidebarCollapsedItem = (props) => {
|
|
|
2922
2987
|
props.onItemClick?.(item);
|
|
2923
2988
|
item.onClick?.();
|
|
2924
2989
|
};
|
|
2925
|
-
return /* @__PURE__ */ jsx(
|
|
2990
|
+
return /* @__PURE__ */ jsx(ActionButton, {
|
|
2926
2991
|
size: props.item.theme?.size ?? props.theme.button?.size ?? (level === 0 ? "sm" : "xs"),
|
|
2927
2992
|
variant: "subtle",
|
|
2928
2993
|
variantActive: "default",
|
|
@@ -2932,7 +2997,7 @@ const SidebarCollapsedItem = (props) => {
|
|
|
2932
2997
|
},
|
|
2933
2998
|
radius: props.item.theme?.radius ?? props.theme.button?.radius ?? "md",
|
|
2934
2999
|
onClick: handleItemClick,
|
|
2935
|
-
icon: renderIcon(item.icon) ?? /* @__PURE__ */ jsx(IconSquareRounded, {}),
|
|
3000
|
+
icon: renderIcon(item.icon, ui.sizes.icon.sm) ?? /* @__PURE__ */ jsx(IconSquareRounded, { size: ui.sizes.icon.sm }),
|
|
2936
3001
|
href: props.item.href,
|
|
2937
3002
|
target: props.item.target,
|
|
2938
3003
|
...props.item.actionProps
|
|
@@ -2940,17 +3005,12 @@ const SidebarCollapsedItem = (props) => {
|
|
|
2940
3005
|
};
|
|
2941
3006
|
|
|
2942
3007
|
//#endregion
|
|
2943
|
-
//#region ../../src/core/components/layout/
|
|
2944
|
-
const
|
|
3008
|
+
//#region ../../src/core/components/layout/DashboardShell.tsx
|
|
3009
|
+
const DashboardShell = (props) => {
|
|
2945
3010
|
const router = useRouter();
|
|
2946
3011
|
const [sidebar, setSidebar] = useStore(alephaSidebarAtom);
|
|
2947
|
-
const { opened
|
|
2948
|
-
|
|
2949
|
-
if (props.sidebarProps?.collapsed !== void 0) setSidebar({
|
|
2950
|
-
...sidebar,
|
|
2951
|
-
collapsed: props.sidebarProps.collapsed
|
|
2952
|
-
});
|
|
2953
|
-
}, []);
|
|
3012
|
+
const { opened } = sidebar;
|
|
3013
|
+
const collapsed = props.sidebarProps?.collapsed !== void 0 ? props.sidebarProps.collapsed : sidebar.collapsed;
|
|
2954
3014
|
const [isResizing, setIsResizing] = useState(false);
|
|
2955
3015
|
const [isHovering, setIsHovering] = useState(false);
|
|
2956
3016
|
const [collapseEffect, setCollapseEffect] = useState({
|
|
@@ -3045,11 +3105,16 @@ const AdminShell = (props) => {
|
|
|
3045
3105
|
collapseEffect.offset
|
|
3046
3106
|
]);
|
|
3047
3107
|
const hoverTimeoutRef = useRef(null);
|
|
3108
|
+
const expandOnHover = props.sidebarProps?.expandOnHover !== false;
|
|
3048
3109
|
const handleNavbarMouseEnter = useCallback(() => {
|
|
3049
|
-
if (collapsed) hoverTimeoutRef.current = setTimeout(() => {
|
|
3110
|
+
if (collapsed && expandOnHover) hoverTimeoutRef.current = setTimeout(() => {
|
|
3050
3111
|
setIsHovering(true);
|
|
3051
3112
|
}, hoverDelay);
|
|
3052
|
-
}, [
|
|
3113
|
+
}, [
|
|
3114
|
+
collapsed,
|
|
3115
|
+
expandOnHover,
|
|
3116
|
+
hoverDelay
|
|
3117
|
+
]);
|
|
3053
3118
|
const handleNavbarMouseLeave = useCallback(() => {
|
|
3054
3119
|
if (hoverTimeoutRef.current) {
|
|
3055
3120
|
clearTimeout(hoverTimeoutRef.current);
|
|
@@ -3091,9 +3156,11 @@ const AdminShell = (props) => {
|
|
|
3091
3156
|
const appBarProps = { ...props.appBarProps };
|
|
3092
3157
|
appBarProps.container ??= props.container;
|
|
3093
3158
|
const hasSidebar = showSidebar && props.sidebarProps !== void 0;
|
|
3094
|
-
const hasAppBar =
|
|
3095
|
-
const
|
|
3096
|
-
const
|
|
3159
|
+
const hasAppBar = props.appBarProps || props.header;
|
|
3160
|
+
const hHeight = props.headerHeight ?? 60;
|
|
3161
|
+
const fHeight = props.footerHeight ?? 24;
|
|
3162
|
+
const headerHeight = hasAppBar ? hHeight : 0;
|
|
3163
|
+
const footerHeight = props.footer ? fHeight : 0;
|
|
3097
3164
|
const expandedWidth = Math.max(sidebar.width, collapsedWidth);
|
|
3098
3165
|
const isExpandedByHover = collapsed && isHovering;
|
|
3099
3166
|
const effectiveCollapsed = collapsed && !isHovering;
|
|
@@ -3102,31 +3169,28 @@ const AdminShell = (props) => {
|
|
|
3102
3169
|
props.sidebarProps?.onItemClick?.(item);
|
|
3103
3170
|
}, [isExpandedByHover, props.sidebarProps?.onItemClick]);
|
|
3104
3171
|
const hoverWidth = Math.max(defaultWidth, collapsedWidth);
|
|
3105
|
-
const sidebarWidth = hasSidebar ? effectiveCollapsed || isExpandedByHover ? collapsedWidth : expandedWidth : 0;
|
|
3106
3172
|
const canResize = props.sidebarResizable && !collapsed;
|
|
3107
3173
|
return /* @__PURE__ */ jsxs(AppShell, {
|
|
3174
|
+
layout: props.layout,
|
|
3108
3175
|
w: "100%",
|
|
3109
3176
|
flex: 1,
|
|
3110
|
-
|
|
3111
|
-
header: hasAppBar ? { height: 60 } : void 0,
|
|
3177
|
+
header: hasAppBar ? { height: hHeight } : void 0,
|
|
3112
3178
|
navbar: hasSidebar ? {
|
|
3113
3179
|
width: effectiveCollapsed || isExpandedByHover ? { base: collapsedWidth } : { base: expandedWidth },
|
|
3114
3180
|
breakpoint: "sm",
|
|
3115
3181
|
collapsed: { mobile: !opened }
|
|
3116
3182
|
} : void 0,
|
|
3117
|
-
footer: props.footer ? { height:
|
|
3183
|
+
footer: props.footer ? { height: fHeight } : void 0,
|
|
3118
3184
|
...props.appShellProps,
|
|
3119
3185
|
children: [
|
|
3120
|
-
/* @__PURE__ */ jsx(AppShell.Header, {
|
|
3121
|
-
bg: ui.colors.surface,
|
|
3186
|
+
hasAppBar && /* @__PURE__ */ jsx(AppShell.Header, {
|
|
3122
3187
|
...props.appShellHeaderProps,
|
|
3123
|
-
children: props.header ?? /* @__PURE__ */ jsx(
|
|
3188
|
+
children: props.header ?? /* @__PURE__ */ jsx(AppBar, {
|
|
3124
3189
|
items: defaultAppBarItems,
|
|
3125
3190
|
...appBarProps
|
|
3126
3191
|
})
|
|
3127
3192
|
}),
|
|
3128
3193
|
hasSidebar && /* @__PURE__ */ jsxs(AppShell.Navbar, {
|
|
3129
|
-
bg: ui.colors.surface,
|
|
3130
3194
|
className: "alepha-sidebar-navbar",
|
|
3131
3195
|
"data-resizing": isResizing,
|
|
3132
3196
|
"data-hover-expanded": isExpandedByHover,
|
|
@@ -3142,31 +3206,37 @@ const AdminShell = (props) => {
|
|
|
3142
3206
|
}
|
|
3143
3207
|
},
|
|
3144
3208
|
...props.appShellNavbarProps,
|
|
3145
|
-
children: [
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3209
|
+
children: [
|
|
3210
|
+
props.navbarHeader ? /* @__PURE__ */ jsx(Flex$1, {
|
|
3211
|
+
style: { borderBottom: "1px solid var(--mantine-color-default-border)" },
|
|
3212
|
+
h: headerHeight,
|
|
3213
|
+
children: props.navbarHeader
|
|
3214
|
+
}) : null,
|
|
3215
|
+
/* @__PURE__ */ jsx(Sidebar, {
|
|
3216
|
+
...props.sidebarProps ?? {},
|
|
3217
|
+
collapsed: effectiveCollapsed,
|
|
3218
|
+
onItemClick: handleSidebarItemClick
|
|
3219
|
+
}),
|
|
3220
|
+
props.navbarFooter ? /* @__PURE__ */ jsx(Flex$1, {
|
|
3221
|
+
style: { borderTop: "1px solid var(--mantine-color-default-border)" },
|
|
3222
|
+
h: footerHeight,
|
|
3223
|
+
children: props.navbarFooter
|
|
3224
|
+
}) : null,
|
|
3225
|
+
(canResize || isExpandedByHover) && /* @__PURE__ */ jsx(Flex$1, {
|
|
3226
|
+
pos: "absolute",
|
|
3227
|
+
right: -6,
|
|
3228
|
+
top: 0,
|
|
3229
|
+
bottom: 0,
|
|
3230
|
+
w: 12,
|
|
3231
|
+
style: {
|
|
3232
|
+
cursor: "col-resize",
|
|
3233
|
+
userSelect: "none"
|
|
3234
|
+
},
|
|
3235
|
+
onMouseDown: handleResizeStart
|
|
3236
|
+
})
|
|
3237
|
+
]
|
|
3161
3238
|
}),
|
|
3162
3239
|
/* @__PURE__ */ jsx(AppShell.Main, {
|
|
3163
|
-
pl: sidebarWidth,
|
|
3164
|
-
pt: headerHeight,
|
|
3165
|
-
pb: footerHeight,
|
|
3166
|
-
pr: 0,
|
|
3167
|
-
display: "flex",
|
|
3168
|
-
flex: 1,
|
|
3169
|
-
style: { flexDirection: "column" },
|
|
3170
3240
|
className: "alepha-sidebar-main",
|
|
3171
3241
|
"data-resizing": isResizing,
|
|
3172
3242
|
...props.appShellMainProps,
|
|
@@ -3180,14 +3250,12 @@ const AdminShell = (props) => {
|
|
|
3180
3250
|
}) : props.children ?? /* @__PURE__ */ jsx(NestedView, {})
|
|
3181
3251
|
}),
|
|
3182
3252
|
props.footer && /* @__PURE__ */ jsx(AppShell.Footer, {
|
|
3183
|
-
bg: ui.colors.surface,
|
|
3184
3253
|
...props.appShellFooterProps,
|
|
3185
3254
|
children: props.footer
|
|
3186
3255
|
})
|
|
3187
3256
|
]
|
|
3188
3257
|
});
|
|
3189
3258
|
};
|
|
3190
|
-
var AdminShell_default = AdminShell;
|
|
3191
3259
|
|
|
3192
3260
|
//#endregion
|
|
3193
3261
|
//#region ../../src/core/components/table/DataTableFilters.tsx
|
|
@@ -3207,7 +3275,7 @@ const DataTableFilters = ({ schema, form, typeFormProps, filterVisibility }) =>
|
|
|
3207
3275
|
p: "xs",
|
|
3208
3276
|
bg: ui.colors.surface,
|
|
3209
3277
|
style: { borderBottom: "1px solid var(--alepha-border)" },
|
|
3210
|
-
children: /* @__PURE__ */ jsx(
|
|
3278
|
+
children: /* @__PURE__ */ jsx(TypeForm, {
|
|
3211
3279
|
...typeFormProps,
|
|
3212
3280
|
skipSubmitButton: true,
|
|
3213
3281
|
fill: true,
|
|
@@ -3216,7 +3284,6 @@ const DataTableFilters = ({ schema, form, typeFormProps, filterVisibility }) =>
|
|
|
3216
3284
|
})
|
|
3217
3285
|
});
|
|
3218
3286
|
};
|
|
3219
|
-
var DataTableFilters_default = DataTableFilters;
|
|
3220
3287
|
|
|
3221
3288
|
//#endregion
|
|
3222
3289
|
//#region ../../src/core/components/table/DataTablePagination.tsx
|
|
@@ -3264,7 +3331,6 @@ const DataTablePagination = ({ page, size, totalPages, onPageChange, onSizeChang
|
|
|
3264
3331
|
}) })]
|
|
3265
3332
|
});
|
|
3266
3333
|
};
|
|
3267
|
-
var DataTablePagination_default = DataTablePagination;
|
|
3268
3334
|
|
|
3269
3335
|
//#endregion
|
|
3270
3336
|
//#region ../../src/core/components/table/ColumnPicker.tsx
|
|
@@ -3303,7 +3369,7 @@ const ColumnPicker = ({ columns, visibility, onVisibilityChange }) => {
|
|
|
3303
3369
|
duration: 200,
|
|
3304
3370
|
timingFunction: "ease"
|
|
3305
3371
|
},
|
|
3306
|
-
children: [/* @__PURE__ */ jsx(Popover.Target, { children: /* @__PURE__ */ jsx(
|
|
3372
|
+
children: [/* @__PURE__ */ jsx(Popover.Target, { children: /* @__PURE__ */ jsx(ActionButton, {
|
|
3307
3373
|
variant: "subtle",
|
|
3308
3374
|
icon: IconColumns
|
|
3309
3375
|
}) }), /* @__PURE__ */ jsx(Popover.Dropdown, {
|
|
@@ -3358,7 +3424,6 @@ const ColumnPicker = ({ columns, visibility, onVisibilityChange }) => {
|
|
|
3358
3424
|
})]
|
|
3359
3425
|
});
|
|
3360
3426
|
};
|
|
3361
|
-
var ColumnPicker_default = ColumnPicker;
|
|
3362
3427
|
|
|
3363
3428
|
//#endregion
|
|
3364
3429
|
//#region ../../src/core/components/table/FilterPicker.tsx
|
|
@@ -3402,7 +3467,7 @@ const FilterPicker = ({ schema, visibility, onVisibilityChange }) => {
|
|
|
3402
3467
|
duration: 200,
|
|
3403
3468
|
timingFunction: "ease"
|
|
3404
3469
|
},
|
|
3405
|
-
children: [/* @__PURE__ */ jsx(Popover.Target, { children: /* @__PURE__ */ jsx(
|
|
3470
|
+
children: [/* @__PURE__ */ jsx(Popover.Target, { children: /* @__PURE__ */ jsx(ActionButton, {
|
|
3406
3471
|
variant: "subtle",
|
|
3407
3472
|
icon: IconFilter
|
|
3408
3473
|
}) }), /* @__PURE__ */ jsx(Popover.Dropdown, {
|
|
@@ -3457,7 +3522,6 @@ const FilterPicker = ({ schema, visibility, onVisibilityChange }) => {
|
|
|
3457
3522
|
})]
|
|
3458
3523
|
});
|
|
3459
3524
|
};
|
|
3460
|
-
var FilterPicker_default = FilterPicker;
|
|
3461
3525
|
|
|
3462
3526
|
//#endregion
|
|
3463
3527
|
//#region ../../src/core/components/table/DataTableToolbar.tsx
|
|
@@ -3478,17 +3542,17 @@ const DataTableToolbar = ({ columns, filters, columnVisibility, filterVisibility
|
|
|
3478
3542
|
gap: 4,
|
|
3479
3543
|
align: "center",
|
|
3480
3544
|
children: [
|
|
3481
|
-
filters && /* @__PURE__ */ jsx(
|
|
3545
|
+
filters && /* @__PURE__ */ jsx(FilterPicker, {
|
|
3482
3546
|
schema: filters,
|
|
3483
3547
|
visibility: filterVisibility,
|
|
3484
3548
|
onVisibilityChange: onFilterVisibilityChange
|
|
3485
3549
|
}),
|
|
3486
|
-
/* @__PURE__ */ jsx(
|
|
3550
|
+
/* @__PURE__ */ jsx(ColumnPicker, {
|
|
3487
3551
|
columns,
|
|
3488
3552
|
visibility: columnVisibility,
|
|
3489
3553
|
onVisibilityChange: onColumnVisibilityChange
|
|
3490
3554
|
}),
|
|
3491
|
-
hasSelection && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3555
|
+
hasSelection && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
3492
3556
|
/* @__PURE__ */ jsx(Divider, {
|
|
3493
3557
|
orientation: "vertical",
|
|
3494
3558
|
mx: "xs"
|
|
@@ -3498,14 +3562,14 @@ const DataTableToolbar = ({ columns, filters, columnVisibility, filterVisibility
|
|
|
3498
3562
|
size: "lg",
|
|
3499
3563
|
children: [selectedItems.length, " selected"]
|
|
3500
3564
|
}),
|
|
3501
|
-
/* @__PURE__ */ jsx(
|
|
3565
|
+
/* @__PURE__ */ jsx(ActionButton, {
|
|
3502
3566
|
variant: "subtle",
|
|
3503
3567
|
size: "compact-sm",
|
|
3504
3568
|
icon: IconX,
|
|
3505
3569
|
onClick: onClearSelection,
|
|
3506
3570
|
children: "Clear"
|
|
3507
3571
|
}),
|
|
3508
|
-
checkboxActions?.map((action, index) => /* @__PURE__ */ jsx(
|
|
3572
|
+
checkboxActions?.map((action, index) => /* @__PURE__ */ jsx(ActionButton, {
|
|
3509
3573
|
variant: "light",
|
|
3510
3574
|
size: "compact-sm",
|
|
3511
3575
|
intent: action.intent,
|
|
@@ -3519,10 +3583,10 @@ const DataTableToolbar = ({ columns, filters, columnVisibility, filterVisibility
|
|
|
3519
3583
|
/* @__PURE__ */ jsx(Flex$1, { flex: 1 }),
|
|
3520
3584
|
/* @__PURE__ */ jsxs(Flex$1, {
|
|
3521
3585
|
gap: "xs",
|
|
3522
|
-
children: [actions?.map((props, index) => !isValidElement(props) ? /* @__PURE__ */ jsx(
|
|
3586
|
+
children: [actions?.map((props, index) => !isValidElement(props) ? /* @__PURE__ */ jsx(ActionButton, {
|
|
3523
3587
|
...props,
|
|
3524
3588
|
children: props.label
|
|
3525
|
-
}, index) : props), /* @__PURE__ */ jsx(
|
|
3589
|
+
}, index) : props), /* @__PURE__ */ jsx(ActionButton, {
|
|
3526
3590
|
icon: IconRefresh,
|
|
3527
3591
|
onClick: onRefresh,
|
|
3528
3592
|
children: "Refresh"
|
|
@@ -3531,7 +3595,6 @@ const DataTableToolbar = ({ columns, filters, columnVisibility, filterVisibility
|
|
|
3531
3595
|
]
|
|
3532
3596
|
});
|
|
3533
3597
|
};
|
|
3534
|
-
var DataTableToolbar_default = DataTableToolbar;
|
|
3535
3598
|
|
|
3536
3599
|
//#endregion
|
|
3537
3600
|
//#region ../../src/core/components/table/DataTable.tsx
|
|
@@ -3807,7 +3870,7 @@ const DataTable = (props) => {
|
|
|
3807
3870
|
bd: "1px solid var(--alepha-border)",
|
|
3808
3871
|
direction: "column",
|
|
3809
3872
|
children: [
|
|
3810
|
-
/* @__PURE__ */ jsx(
|
|
3873
|
+
/* @__PURE__ */ jsx(DataTableToolbar, {
|
|
3811
3874
|
columns: props.columns,
|
|
3812
3875
|
filters: props.filters,
|
|
3813
3876
|
columnVisibility,
|
|
@@ -3820,7 +3883,7 @@ const DataTable = (props) => {
|
|
|
3820
3883
|
checkboxActions: props.checkboxActions,
|
|
3821
3884
|
onClearSelection: clearSelection
|
|
3822
3885
|
}),
|
|
3823
|
-
filterSchema && props.filters && /* @__PURE__ */ jsx(
|
|
3886
|
+
filterSchema && props.filters && /* @__PURE__ */ jsx(DataTableFilters, {
|
|
3824
3887
|
schema: filterSchema,
|
|
3825
3888
|
form,
|
|
3826
3889
|
typeFormProps: props.typeFormProps,
|
|
@@ -3835,7 +3898,7 @@ const DataTable = (props) => {
|
|
|
3835
3898
|
children: [/* @__PURE__ */ jsx(Table.Thead, { children: /* @__PURE__ */ jsxs(Table.Tr, { children: [checkboxHeader, head] }) }), /* @__PURE__ */ jsx(Table.Tbody, { children: rows })]
|
|
3836
3899
|
})
|
|
3837
3900
|
}),
|
|
3838
|
-
!props.infinityScroll && /* @__PURE__ */ jsx(
|
|
3901
|
+
!props.infinityScroll && /* @__PURE__ */ jsx(DataTablePagination, {
|
|
3839
3902
|
page,
|
|
3840
3903
|
size,
|
|
3841
3904
|
totalPages: items.page?.totalPages ?? 1,
|
|
@@ -3849,7 +3912,6 @@ const DataTable = (props) => {
|
|
|
3849
3912
|
]
|
|
3850
3913
|
});
|
|
3851
3914
|
};
|
|
3852
|
-
var DataTable_default = DataTable;
|
|
3853
3915
|
|
|
3854
3916
|
//#endregion
|
|
3855
3917
|
//#region ../../src/core/hooks/useDialog.ts
|
|
@@ -3883,7 +3945,7 @@ const useDialog = () => {
|
|
|
3883
3945
|
* - AlertDialog, ConfirmDialog, PromptDialog
|
|
3884
3946
|
* - Form controls: Control, ControlArray, ControlDate, ControlNumber, ControlObject, ControlSelect, ControlQueryBuilder
|
|
3885
3947
|
* - TypeForm for automatic form generation from TypeBox schemas
|
|
3886
|
-
* -
|
|
3948
|
+
* - DashboardShell layout component
|
|
3887
3949
|
* - AppBar with configurable elements
|
|
3888
3950
|
* - Sidebar navigation with sections and menu items
|
|
3889
3951
|
* - Omnibar for command palette / search
|
|
@@ -3920,5 +3982,5 @@ const $ui = (options = {}) => {
|
|
|
3920
3982
|
};
|
|
3921
3983
|
|
|
3922
3984
|
//#endregion
|
|
3923
|
-
export { $ui,
|
|
3985
|
+
export { $ui, ActionButton, DashboardShell as AdminShell, DashboardShell, AlephaMantineProvider, AlephaUI, AlertDialog, AppBar, Breadcrumb, BurgerButton, ClipboardButton, ConfirmDialog, Control, ControlArray, ControlDate, ControlNumber, ControlObject, ControlQueryBuilder, ControlSelect, DarkModeButton, DataTable, DialogService, Flex, LanguageButton, OPERATOR_INFO, Omnibar, OmnibarButton, PromptDialog, Sidebar, Text, ThemeButton, ThemeProvider, ToastService, ToggleSidebarButton, TypeForm, UiRouter, alephaSidebarAtom, alephaThemeAtom, alephaThemeListAtom, capitalize, defaultTheme, extractSchemaFields, getDefaultIcon, getOperatorsForField, midnightTheme, prettyName, toTitleCase, ui, useDialog, useToast };
|
|
3924
3986
|
//# sourceMappingURL=index.js.map
|