@almadar/ui 2.1.11 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-7NEWMNNU.js → chunk-3JGAROCW.js} +2 -0
- package/dist/{chunk-6OACETQB.js → chunk-42WRQA7T.js} +2 -2
- package/dist/{chunk-CTNDYHXY.js → chunk-CC3UOKHI.js} +222 -260
- package/dist/{chunk-BTXQJGFB.js → chunk-DKQN5FVU.js} +1 -1
- package/dist/{chunk-JLEMVREZ.js → chunk-GOZKH7QW.js} +6 -3
- package/dist/chunk-TSETXL2E.js +103 -0
- package/dist/components/index.d.ts +15 -12
- package/dist/components/index.js +126 -134
- package/dist/components/organisms/game/three/index.d.ts +7 -1
- package/dist/context/index.d.ts +2 -2
- package/dist/context/index.js +3 -3
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +4 -3
- package/dist/locales/index.js +1 -102
- package/dist/providers/index.js +6 -5
- package/dist/renderer/index.js +0 -1
- package/dist/{useUISlots-D0mttBSP.d.ts → useUISlots-BBjNvQtb.d.ts} +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { apiClient } from './chunk-3HJHHULT.js';
|
|
2
|
-
import { SelectionContext, entityDataKeys, useEntityList } from './chunk-
|
|
2
|
+
import { SelectionContext, entityDataKeys, useEntityList } from './chunk-GOZKH7QW.js';
|
|
3
3
|
import { useEventBus } from './chunk-YXZM3WCF.js';
|
|
4
4
|
import { subscribe, getSnapshot, clearEntities, removeEntity, updateSingleton, updateEntity, spawnEntity, getSingleton, getAllEntities, getByType, getEntity } from './chunk-N7MVUW4R.js';
|
|
5
5
|
import { useCallback, useState, useEffect, useMemo, useContext, useSyncExternalStore } from 'react';
|
|
@@ -899,8 +899,8 @@ function useUIEvents(dispatch, validEvents, eventBusInstance) {
|
|
|
899
899
|
const validEventsKey = validEvents ? validEvents.slice().sort().join(",") : "";
|
|
900
900
|
const stableValidEvents = useMemo(
|
|
901
901
|
() => validEvents,
|
|
902
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
903
902
|
[validEventsKey]
|
|
903
|
+
// intentional — validEventsKey is the stable dep, not validEvents array ref
|
|
904
904
|
);
|
|
905
905
|
useEffect(() => {
|
|
906
906
|
const unsubscribes = [];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useTheme, useUISlots } from './chunk-
|
|
2
|
-
import { useTranslate, useQuerySingleton } from './chunk-
|
|
1
|
+
import { useTheme, useUISlots } from './chunk-DKQN5FVU.js';
|
|
2
|
+
import { useTranslate, useQuerySingleton } from './chunk-GOZKH7QW.js';
|
|
3
3
|
import { useEventBus } from './chunk-YXZM3WCF.js';
|
|
4
4
|
import { cn, debugGroup, debug, debugGroupEnd, getNestedValue, isDebugEnabled } from './chunk-KKCVDUK7.js';
|
|
5
5
|
import { __publicField } from './chunk-PKBMQBKP.js';
|
|
@@ -6641,8 +6641,7 @@ function DataTable({
|
|
|
6641
6641
|
] }),
|
|
6642
6642
|
/* @__PURE__ */ jsx(Box, { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs("table", { className: "w-full", children: [
|
|
6643
6643
|
/* @__PURE__ */ jsx("thead", { className: "bg-[var(--color-table-header)] border-b-2 border-[var(--color-border)]", children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
6644
|
-
selectable &&
|
|
6645
|
-
/* @__PURE__ */ jsx("th", { className: "w-12 px-4 py-3", children: /* @__PURE__ */ jsx(
|
|
6644
|
+
selectable && /* @__PURE__ */ jsx("th", { className: "w-12 px-4 py-3", children: /* @__PURE__ */ jsx(
|
|
6646
6645
|
Checkbox,
|
|
6647
6646
|
{
|
|
6648
6647
|
checked: allSelected,
|
|
@@ -6650,176 +6649,156 @@ function DataTable({
|
|
|
6650
6649
|
onChange: handleSelectAll
|
|
6651
6650
|
}
|
|
6652
6651
|
) }),
|
|
6653
|
-
normalizedColumns.map((col) => (
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
"
|
|
6657
|
-
|
|
6658
|
-
"
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
},
|
|
6670
|
-
String(col.key)
|
|
6671
|
-
)
|
|
6652
|
+
normalizedColumns.map((col) => /* @__PURE__ */ jsx(
|
|
6653
|
+
"th",
|
|
6654
|
+
{
|
|
6655
|
+
"data-column": String(col.key),
|
|
6656
|
+
className: cn(
|
|
6657
|
+
"px-4 py-3 text-left text-xs font-bold text-[var(--color-foreground)] uppercase tracking-wider whitespace-nowrap",
|
|
6658
|
+
col.sortable && "cursor-pointer select-none hover:bg-[var(--color-table-row-hover)]"
|
|
6659
|
+
),
|
|
6660
|
+
style: { width: col.width },
|
|
6661
|
+
onClick: () => col.sortable && handleSort(String(col.key)),
|
|
6662
|
+
children: /* @__PURE__ */ jsxs(HStack, { className: "items-center gap-1", children: [
|
|
6663
|
+
col.header,
|
|
6664
|
+
col.sortable && sortBy === col.key && (sortDirection === "asc" ? /* @__PURE__ */ jsx(ChevronUp, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" }))
|
|
6665
|
+
] })
|
|
6666
|
+
},
|
|
6667
|
+
String(col.key)
|
|
6672
6668
|
)),
|
|
6673
6669
|
rowActions && /* @__PURE__ */ jsx("th", { className: "w-12 px-4 py-3" })
|
|
6674
6670
|
] }) }),
|
|
6675
|
-
/* @__PURE__ */ jsx("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-700", children: isLoading ? (
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
/* @__PURE__ */ jsx(
|
|
6685
|
-
Typography,
|
|
6686
|
-
{
|
|
6687
|
-
variant: "small",
|
|
6688
|
-
className: "text-[var(--color-muted-foreground)]",
|
|
6689
|
-
children: t("common.loading")
|
|
6690
|
-
}
|
|
6691
|
-
)
|
|
6692
|
-
] })
|
|
6693
|
-
}
|
|
6694
|
-
) })
|
|
6695
|
-
) : error ? (
|
|
6696
|
-
// eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements in DataTable
|
|
6697
|
-
/* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs(
|
|
6698
|
-
"td",
|
|
6699
|
-
{
|
|
6700
|
-
colSpan: normalizedColumns.length + (selectable ? 1 : 0) + (rowActions ? 1 : 0),
|
|
6701
|
-
className: "px-4 py-12 text-center text-[var(--color-error)]",
|
|
6702
|
-
children: [
|
|
6703
|
-
t("error.generic") + ": ",
|
|
6704
|
-
error.message
|
|
6705
|
-
]
|
|
6706
|
-
}
|
|
6707
|
-
) })
|
|
6708
|
-
) : items.length === 0 ? (
|
|
6709
|
-
// eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements in DataTable
|
|
6710
|
-
/* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
|
|
6711
|
-
"td",
|
|
6712
|
-
{
|
|
6713
|
-
colSpan: normalizedColumns.length + (selectable ? 1 : 0) + (rowActions ? 1 : 0),
|
|
6714
|
-
className: "px-4 py-12",
|
|
6715
|
-
children: /* @__PURE__ */ jsx(
|
|
6716
|
-
EmptyState,
|
|
6671
|
+
/* @__PURE__ */ jsx("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-700", children: isLoading ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
|
|
6672
|
+
"td",
|
|
6673
|
+
{
|
|
6674
|
+
colSpan: normalizedColumns.length + (selectable ? 1 : 0) + (rowActions ? 1 : 0),
|
|
6675
|
+
className: "px-4 py-12 text-center",
|
|
6676
|
+
children: /* @__PURE__ */ jsxs(VStack, { className: "items-center gap-2", children: [
|
|
6677
|
+
/* @__PURE__ */ jsx(Spinner, { size: "lg" }),
|
|
6678
|
+
/* @__PURE__ */ jsx(
|
|
6679
|
+
Typography,
|
|
6717
6680
|
{
|
|
6718
|
-
|
|
6719
|
-
|
|
6720
|
-
|
|
6721
|
-
actionLabel: emptyAction?.label,
|
|
6722
|
-
actionEvent: emptyAction?.event
|
|
6681
|
+
variant: "small",
|
|
6682
|
+
className: "text-[var(--color-muted-foreground)]",
|
|
6683
|
+
children: t("common.loading")
|
|
6723
6684
|
}
|
|
6724
6685
|
)
|
|
6725
|
-
}
|
|
6726
|
-
|
|
6727
|
-
) :
|
|
6728
|
-
|
|
6729
|
-
|
|
6730
|
-
|
|
6731
|
-
|
|
6732
|
-
|
|
6733
|
-
|
|
6734
|
-
|
|
6735
|
-
|
|
6736
|
-
|
|
6737
|
-
|
|
6738
|
-
|
|
6739
|
-
|
|
6740
|
-
|
|
6741
|
-
|
|
6742
|
-
|
|
6686
|
+
] })
|
|
6687
|
+
}
|
|
6688
|
+
) }) : error ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs(
|
|
6689
|
+
"td",
|
|
6690
|
+
{
|
|
6691
|
+
colSpan: normalizedColumns.length + (selectable ? 1 : 0) + (rowActions ? 1 : 0),
|
|
6692
|
+
className: "px-4 py-12 text-center text-[var(--color-error)]",
|
|
6693
|
+
children: [
|
|
6694
|
+
t("error.generic") + ": ",
|
|
6695
|
+
error.message
|
|
6696
|
+
]
|
|
6697
|
+
}
|
|
6698
|
+
) }) : items.length === 0 ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
|
|
6699
|
+
"td",
|
|
6700
|
+
{
|
|
6701
|
+
colSpan: normalizedColumns.length + (selectable ? 1 : 0) + (rowActions ? 1 : 0),
|
|
6702
|
+
className: "px-4 py-12",
|
|
6703
|
+
children: /* @__PURE__ */ jsx(
|
|
6704
|
+
EmptyState,
|
|
6705
|
+
{
|
|
6706
|
+
icon: emptyIcon,
|
|
6707
|
+
title: resolvedEmptyTitle,
|
|
6708
|
+
description: resolvedEmptyDescription,
|
|
6709
|
+
actionLabel: emptyAction?.label,
|
|
6710
|
+
actionEvent: emptyAction?.event
|
|
6711
|
+
}
|
|
6712
|
+
)
|
|
6713
|
+
}
|
|
6714
|
+
) }) : items.map((row, rowIndex) => /* @__PURE__ */ jsxs(
|
|
6715
|
+
"tr",
|
|
6716
|
+
{
|
|
6717
|
+
"data-entity-row": true,
|
|
6718
|
+
className: cn(
|
|
6719
|
+
"border-b border-[var(--color-table-border)] last:border-0 hover:bg-[var(--color-table-row-hover)] transition-colors",
|
|
6720
|
+
selectedIds.includes(row.id) && "bg-[var(--color-primary)]/10 font-medium",
|
|
6721
|
+
isRowClickable && "cursor-pointer"
|
|
6722
|
+
),
|
|
6723
|
+
onClick: () => isRowClickable && handleRowClick(row),
|
|
6724
|
+
children: [
|
|
6725
|
+
selectable && /* @__PURE__ */ jsx("td", { className: "px-4 py-3", children: /* @__PURE__ */ jsx(
|
|
6726
|
+
Checkbox,
|
|
6727
|
+
{
|
|
6728
|
+
checked: selectedIds.includes(row.id),
|
|
6729
|
+
onChange: () => handleSelectRow(row.id)
|
|
6730
|
+
}
|
|
6731
|
+
) }),
|
|
6732
|
+
normalizedColumns.map((col) => {
|
|
6733
|
+
const cellValue = getNestedValue(
|
|
6734
|
+
row,
|
|
6735
|
+
String(col.key)
|
|
6736
|
+
);
|
|
6737
|
+
return /* @__PURE__ */ jsx(
|
|
6738
|
+
"td",
|
|
6739
|
+
{
|
|
6740
|
+
"data-column": String(col.key),
|
|
6741
|
+
className: "px-4 py-3 text-sm text-[var(--color-foreground)] whitespace-nowrap sm:whitespace-normal",
|
|
6742
|
+
children: col.render ? col.render(cellValue, row, rowIndex) : String(cellValue ?? "")
|
|
6743
|
+
},
|
|
6744
|
+
String(col.key)
|
|
6745
|
+
);
|
|
6746
|
+
}),
|
|
6747
|
+
rowActions && /* @__PURE__ */ jsxs("td", { className: "px-4 py-3 relative", children: [
|
|
6748
|
+
/* @__PURE__ */ jsx(
|
|
6749
|
+
Button,
|
|
6743
6750
|
{
|
|
6744
|
-
|
|
6745
|
-
|
|
6751
|
+
variant: "ghost",
|
|
6752
|
+
className: "p-1 rounded hover:bg-[var(--color-muted)]",
|
|
6753
|
+
onClick: (e) => {
|
|
6754
|
+
e.stopPropagation();
|
|
6755
|
+
setOpenActionMenu(
|
|
6756
|
+
openActionMenu === row.id ? null : row.id
|
|
6757
|
+
);
|
|
6758
|
+
},
|
|
6759
|
+
children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4 text-[var(--color-muted-foreground)]" })
|
|
6746
6760
|
}
|
|
6747
|
-
)
|
|
6748
|
-
|
|
6749
|
-
const cellValue = getNestedValue(
|
|
6750
|
-
row,
|
|
6751
|
-
String(col.key)
|
|
6752
|
-
);
|
|
6753
|
-
return (
|
|
6754
|
-
// eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements in DataTable
|
|
6755
|
-
/* @__PURE__ */ jsx(
|
|
6756
|
-
"td",
|
|
6757
|
-
{
|
|
6758
|
-
"data-column": String(col.key),
|
|
6759
|
-
className: "px-4 py-3 text-sm text-[var(--color-foreground)] whitespace-nowrap sm:whitespace-normal",
|
|
6760
|
-
children: col.render ? col.render(cellValue, row, rowIndex) : String(cellValue ?? "")
|
|
6761
|
-
},
|
|
6762
|
-
String(col.key)
|
|
6763
|
-
)
|
|
6764
|
-
);
|
|
6765
|
-
}),
|
|
6766
|
-
rowActions && // eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements in DataTable
|
|
6767
|
-
/* @__PURE__ */ jsxs("td", { className: "px-4 py-3 relative", children: [
|
|
6761
|
+
),
|
|
6762
|
+
openActionMenu === row.id && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6768
6763
|
/* @__PURE__ */ jsx(
|
|
6769
|
-
|
|
6764
|
+
Box,
|
|
6770
6765
|
{
|
|
6771
|
-
|
|
6772
|
-
className: "p-1 rounded hover:bg-[var(--color-muted)]",
|
|
6766
|
+
className: "fixed inset-0 z-40",
|
|
6773
6767
|
onClick: (e) => {
|
|
6774
6768
|
e.stopPropagation();
|
|
6775
|
-
setOpenActionMenu(
|
|
6776
|
-
|
|
6777
|
-
);
|
|
6778
|
-
},
|
|
6779
|
-
children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4 text-[var(--color-muted-foreground)]" })
|
|
6769
|
+
setOpenActionMenu(null);
|
|
6770
|
+
}
|
|
6780
6771
|
}
|
|
6781
6772
|
),
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6785
|
-
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
|
|
6794
|
-
(
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
|
|
6798
|
-
variant: "ghost",
|
|
6799
|
-
"data-event": action.event,
|
|
6800
|
-
"data-testid": action.event ? `action-${action.event}` : void 0,
|
|
6801
|
-
className: cn(
|
|
6802
|
-
"w-full flex items-center gap-2 px-4 py-2 text-sm",
|
|
6803
|
-
action.variant === "danger" ? "text-[var(--color-error)] hover:bg-[var(--color-error)]/10" : "text-[var(--color-foreground)] hover:bg-[var(--color-muted)]"
|
|
6804
|
-
),
|
|
6805
|
-
onClick: (e) => {
|
|
6806
|
-
e.stopPropagation();
|
|
6807
|
-
action.onClick(row);
|
|
6808
|
-
setOpenActionMenu(null);
|
|
6809
|
-
},
|
|
6810
|
-
children: [
|
|
6811
|
-
action.icon && /* @__PURE__ */ jsx(action.icon, { className: "h-4 w-4" }),
|
|
6812
|
-
action.label
|
|
6813
|
-
]
|
|
6773
|
+
/* @__PURE__ */ jsx(VStack, { className: "absolute right-0 mt-1 w-48 bg-[var(--color-card)] rounded-[var(--radius-lg)] shadow-[var(--shadow-lg)] border border-[var(--color-border)] py-1 z-50", children: (rowActions ?? []).filter(
|
|
6774
|
+
(action) => !action.show || action.show(row)
|
|
6775
|
+
).map((action, idx) => /* @__PURE__ */ jsxs(
|
|
6776
|
+
Button,
|
|
6777
|
+
{
|
|
6778
|
+
variant: "ghost",
|
|
6779
|
+
"data-event": action.event,
|
|
6780
|
+
"data-testid": action.event ? `action-${action.event}` : void 0,
|
|
6781
|
+
className: cn(
|
|
6782
|
+
"w-full flex items-center gap-2 px-4 py-2 text-sm",
|
|
6783
|
+
action.variant === "danger" ? "text-[var(--color-error)] hover:bg-[var(--color-error)]/10" : "text-[var(--color-foreground)] hover:bg-[var(--color-muted)]"
|
|
6784
|
+
),
|
|
6785
|
+
onClick: (e) => {
|
|
6786
|
+
e.stopPropagation();
|
|
6787
|
+
action.onClick(row);
|
|
6788
|
+
setOpenActionMenu(null);
|
|
6814
6789
|
},
|
|
6815
|
-
|
|
6816
|
-
|
|
6817
|
-
|
|
6790
|
+
children: [
|
|
6791
|
+
action.icon && /* @__PURE__ */ jsx(action.icon, { className: "h-4 w-4" }),
|
|
6792
|
+
action.label
|
|
6793
|
+
]
|
|
6794
|
+
},
|
|
6795
|
+
idx
|
|
6796
|
+
)) })
|
|
6818
6797
|
] })
|
|
6819
|
-
]
|
|
6820
|
-
|
|
6821
|
-
|
|
6822
|
-
|
|
6798
|
+
] })
|
|
6799
|
+
]
|
|
6800
|
+
},
|
|
6801
|
+
row.id
|
|
6823
6802
|
)) })
|
|
6824
6803
|
] }) }),
|
|
6825
6804
|
totalCount !== void 0 && totalPages > 1 && /* @__PURE__ */ jsx(Box, { className: "px-4 py-3 border-t-2 border-[var(--color-border)]", children: /* @__PURE__ */ jsx(
|
|
@@ -7057,16 +7036,13 @@ var PageHeader = ({
|
|
|
7057
7036
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
7058
7037
|
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React41__default.Fragment, { children: [
|
|
7059
7038
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
7060
|
-
crumb.href ? (
|
|
7061
|
-
|
|
7062
|
-
|
|
7063
|
-
|
|
7064
|
-
|
|
7065
|
-
|
|
7066
|
-
|
|
7067
|
-
children: crumb.label
|
|
7068
|
-
}
|
|
7069
|
-
)
|
|
7039
|
+
crumb.href ? /* @__PURE__ */ jsx(
|
|
7040
|
+
"a",
|
|
7041
|
+
{
|
|
7042
|
+
href: crumb.href,
|
|
7043
|
+
className: "text-[var(--color-muted-foreground)] hover:text-[var(--color-foreground)]",
|
|
7044
|
+
children: crumb.label
|
|
7045
|
+
}
|
|
7070
7046
|
) : /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-[var(--color-foreground)] font-medium", children: crumb.label })
|
|
7071
7047
|
] }, idx)) }) }),
|
|
7072
7048
|
/* @__PURE__ */ jsxs(Box, { className: "flex items-start justify-between gap-4", children: [
|
|
@@ -7602,11 +7578,12 @@ var Form = ({
|
|
|
7602
7578
|
const resolvedSubmitLabel = submitLabel ?? t("common.save");
|
|
7603
7579
|
const resolvedCancelLabel = cancelLabel ?? t("common.cancel");
|
|
7604
7580
|
const normalizedInitialData = initialData ?? {};
|
|
7605
|
-
const
|
|
7581
|
+
const resolvedEntity = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
7582
|
+
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
7606
7583
|
const entityDerivedFields = React41__default.useMemo(() => {
|
|
7607
7584
|
if (fields && fields.length > 0) return void 0;
|
|
7608
|
-
if (!
|
|
7609
|
-
return
|
|
7585
|
+
if (!resolvedEntity) return void 0;
|
|
7586
|
+
return resolvedEntity.fields.map(
|
|
7610
7587
|
(f) => ({
|
|
7611
7588
|
name: f.name,
|
|
7612
7589
|
type: f.type,
|
|
@@ -7963,47 +7940,44 @@ var Form = ({
|
|
|
7963
7940
|
);
|
|
7964
7941
|
}
|
|
7965
7942
|
}
|
|
7966
|
-
return (
|
|
7967
|
-
|
|
7968
|
-
|
|
7969
|
-
|
|
7970
|
-
|
|
7971
|
-
|
|
7972
|
-
|
|
7973
|
-
|
|
7974
|
-
children:
|
|
7975
|
-
|
|
7976
|
-
|
|
7977
|
-
|
|
7978
|
-
|
|
7979
|
-
|
|
7980
|
-
|
|
7981
|
-
|
|
7982
|
-
|
|
7983
|
-
|
|
7984
|
-
|
|
7985
|
-
|
|
7986
|
-
|
|
7987
|
-
|
|
7988
|
-
|
|
7989
|
-
|
|
7990
|
-
|
|
7991
|
-
|
|
7992
|
-
|
|
7993
|
-
|
|
7994
|
-
|
|
7995
|
-
|
|
7996
|
-
|
|
7997
|
-
|
|
7998
|
-
|
|
7999
|
-
|
|
8000
|
-
|
|
8001
|
-
|
|
8002
|
-
|
|
8003
|
-
|
|
8004
|
-
]
|
|
8005
|
-
}
|
|
8006
|
-
)
|
|
7943
|
+
return /* @__PURE__ */ jsxs(
|
|
7944
|
+
"form",
|
|
7945
|
+
{
|
|
7946
|
+
className: cn(layoutStyles[layout], gapStyles5[gap], className),
|
|
7947
|
+
onSubmit: handleSubmit,
|
|
7948
|
+
...props,
|
|
7949
|
+
children: [
|
|
7950
|
+
error && /* @__PURE__ */ jsx(Alert, { variant: "error", className: "mb-4", children: error.message || t("error.occurred") }),
|
|
7951
|
+
sectionElements && sectionElements.length > 0 && /* @__PURE__ */ jsx(VStack, { gap: gap === "sm" ? "sm" : gap === "lg" ? "lg" : "md", children: sectionElements }),
|
|
7952
|
+
schemaFields,
|
|
7953
|
+
children,
|
|
7954
|
+
(schemaFields && schemaFields.length > 0 || sectionElements && sectionElements.length > 0) && /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "pt-4", children: [
|
|
7955
|
+
/* @__PURE__ */ jsx(
|
|
7956
|
+
Button,
|
|
7957
|
+
{
|
|
7958
|
+
type: "submit",
|
|
7959
|
+
variant: "primary",
|
|
7960
|
+
disabled: isLoading,
|
|
7961
|
+
"data-event": submitEvent,
|
|
7962
|
+
"data-testid": `action-${submitEvent}`,
|
|
7963
|
+
children: isLoading ? t("form.saving") : resolvedSubmitLabel
|
|
7964
|
+
}
|
|
7965
|
+
),
|
|
7966
|
+
shouldShowCancel && /* @__PURE__ */ jsx(
|
|
7967
|
+
Button,
|
|
7968
|
+
{
|
|
7969
|
+
type: "button",
|
|
7970
|
+
variant: "secondary",
|
|
7971
|
+
onClick: handleCancel,
|
|
7972
|
+
disabled: isLoading,
|
|
7973
|
+
"data-event": cancelEvent,
|
|
7974
|
+
"data-testid": `action-${cancelEvent}`,
|
|
7975
|
+
children: resolvedCancelLabel
|
|
7976
|
+
}
|
|
7977
|
+
)
|
|
7978
|
+
] })
|
|
7979
|
+
]
|
|
7980
|
+
}
|
|
8007
7981
|
);
|
|
8008
7982
|
};
|
|
8009
7983
|
function formatDateValue(value) {
|
|
@@ -8408,19 +8382,16 @@ function LinkPattern({
|
|
|
8408
8382
|
emit(`UI:${onClick}`, { href });
|
|
8409
8383
|
}
|
|
8410
8384
|
};
|
|
8411
|
-
return (
|
|
8412
|
-
|
|
8413
|
-
|
|
8414
|
-
"
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
|
|
8419
|
-
|
|
8420
|
-
|
|
8421
|
-
children: label
|
|
8422
|
-
}
|
|
8423
|
-
)
|
|
8385
|
+
return /* @__PURE__ */ jsx(
|
|
8386
|
+
"a",
|
|
8387
|
+
{
|
|
8388
|
+
href: href ?? "#",
|
|
8389
|
+
target: external ? "_blank" : void 0,
|
|
8390
|
+
rel: external ? "noopener noreferrer" : void 0,
|
|
8391
|
+
onClick: onClick ? handleClick : void 0,
|
|
8392
|
+
className,
|
|
8393
|
+
children: label
|
|
8394
|
+
}
|
|
8424
8395
|
);
|
|
8425
8396
|
}
|
|
8426
8397
|
LinkPattern.displayName = "LinkPattern";
|
|
@@ -8491,19 +8462,16 @@ function ImagePattern({
|
|
|
8491
8462
|
objectFit = "cover",
|
|
8492
8463
|
className
|
|
8493
8464
|
}) {
|
|
8494
|
-
return (
|
|
8495
|
-
|
|
8496
|
-
|
|
8497
|
-
|
|
8498
|
-
|
|
8499
|
-
|
|
8500
|
-
|
|
8501
|
-
|
|
8502
|
-
|
|
8503
|
-
|
|
8504
|
-
style: { objectFit }
|
|
8505
|
-
}
|
|
8506
|
-
)
|
|
8465
|
+
return /* @__PURE__ */ jsx(
|
|
8466
|
+
"img",
|
|
8467
|
+
{
|
|
8468
|
+
src,
|
|
8469
|
+
alt,
|
|
8470
|
+
width,
|
|
8471
|
+
height,
|
|
8472
|
+
className,
|
|
8473
|
+
style: { objectFit }
|
|
8474
|
+
}
|
|
8507
8475
|
);
|
|
8508
8476
|
}
|
|
8509
8477
|
ImagePattern.displayName = "ImagePattern";
|
|
@@ -8961,30 +8929,24 @@ function CustomPattern({
|
|
|
8961
8929
|
}
|
|
8962
8930
|
);
|
|
8963
8931
|
case "a":
|
|
8964
|
-
return (
|
|
8965
|
-
|
|
8966
|
-
|
|
8967
|
-
"
|
|
8968
|
-
|
|
8969
|
-
|
|
8970
|
-
|
|
8971
|
-
|
|
8972
|
-
|
|
8973
|
-
children: renderContent
|
|
8974
|
-
}
|
|
8975
|
-
)
|
|
8932
|
+
return /* @__PURE__ */ jsx(
|
|
8933
|
+
"a",
|
|
8934
|
+
{
|
|
8935
|
+
href: href ?? "#",
|
|
8936
|
+
target: external ? "_blank" : void 0,
|
|
8937
|
+
rel: external ? "noopener noreferrer" : void 0,
|
|
8938
|
+
...commonProps,
|
|
8939
|
+
children: renderContent
|
|
8940
|
+
}
|
|
8976
8941
|
);
|
|
8977
8942
|
case "img":
|
|
8978
|
-
return (
|
|
8979
|
-
|
|
8980
|
-
|
|
8981
|
-
|
|
8982
|
-
|
|
8983
|
-
|
|
8984
|
-
|
|
8985
|
-
...commonProps
|
|
8986
|
-
}
|
|
8987
|
-
)
|
|
8943
|
+
return /* @__PURE__ */ jsx(
|
|
8944
|
+
"img",
|
|
8945
|
+
{
|
|
8946
|
+
src,
|
|
8947
|
+
alt: alt ?? "",
|
|
8948
|
+
...commonProps
|
|
8949
|
+
}
|
|
8988
8950
|
);
|
|
8989
8951
|
case "input":
|
|
8990
8952
|
return /* @__PURE__ */ jsx(
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { useEventBus } from './chunk-YXZM3WCF.js';
|
|
2
|
+
import { en_default } from './chunk-TSETXL2E.js';
|
|
2
3
|
import React2, { createContext, useContext, useState, useMemo, useCallback, useEffect } from 'react';
|
|
3
4
|
import { jsx } from 'react/jsx-runtime';
|
|
4
5
|
|
|
6
|
+
var { $meta: _meta, ...coreMessages } = en_default;
|
|
7
|
+
var coreLocale = coreMessages;
|
|
5
8
|
var I18nContext = createContext({
|
|
6
9
|
locale: "en",
|
|
7
10
|
direction: "ltr",
|
|
8
|
-
t: (key) => key
|
|
9
|
-
//
|
|
11
|
+
t: (key) => coreLocale[key] ?? key
|
|
12
|
+
// core locale fallback
|
|
10
13
|
});
|
|
11
14
|
I18nContext.displayName = "I18nContext";
|
|
12
15
|
var I18nProvider = I18nContext.Provider;
|
|
@@ -15,7 +18,7 @@ function useTranslate() {
|
|
|
15
18
|
}
|
|
16
19
|
function createTranslate(messages) {
|
|
17
20
|
return (key, params) => {
|
|
18
|
-
let msg = messages[key] ?? key;
|
|
21
|
+
let msg = messages[key] ?? coreLocale[key] ?? key;
|
|
19
22
|
if (params) {
|
|
20
23
|
for (const [k, v] of Object.entries(params)) {
|
|
21
24
|
msg = msg.split(`{{${k}}}`).join(String(v));
|