@inf-monkeys-tech/monkeys-design 0.4.37 → 0.4.39
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/README.md +6 -0
- package/dist/components/data-explorer/index.d.mts +6 -59
- package/dist/components/data-explorer/index.d.ts +6 -59
- package/dist/components/data-explorer/index.js +412 -8
- package/dist/components/data-explorer/index.js.map +1 -1
- package/dist/components/data-explorer/index.mjs +413 -10
- package/dist/components/data-explorer/index.mjs.map +1 -1
- package/dist/components/login/index.d.mts +11 -0
- package/dist/components/login/index.d.ts +11 -0
- package/dist/components/login/index.js +36 -4
- package/dist/components/login/index.js.map +1 -1
- package/dist/components/login/index.mjs +37 -5
- package/dist/components/login/index.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +38 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +38 -4
- package/dist/index.mjs.map +1 -1
- package/dist/styles/login-page.scss +12 -0
- package/dist/theme-DnbkgyCq.d.mts +61 -0
- package/dist/theme-rXHbVr6l.d.ts +61 -0
- package/dist/theme-system/index.d.mts +1 -1
- package/dist/theme-system/index.d.ts +1 -1
- package/dist/theme-system/index.js +3 -0
- package/dist/theme-system/index.js.map +1 -1
- package/dist/theme-system/index.mjs +3 -0
- package/dist/theme-system/index.mjs.map +1 -1
- package/dist/{types-B81dpI1o.d.mts → types-BnC3Z85r.d.mts} +98 -1
- package/dist/{types-B81dpI1o.d.ts → types-BnC3Z85r.d.ts} +98 -1
- package/package.json +3 -1
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import * as DropdownMenu3 from '@radix-ui/react-dropdown-menu';
|
|
2
|
-
import { forwardRef, useState,
|
|
2
|
+
import { forwardRef, useState, useEffect, useMemo, useRef, useCallback, Fragment as Fragment$1, useLayoutEffect } from 'react';
|
|
3
3
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
4
|
+
import { useSensors, useSensor, PointerSensor, KeyboardSensor, DndContext, closestCenter } from '@dnd-kit/core';
|
|
5
|
+
import { sortableKeyboardCoordinates, SortableContext, verticalListSortingStrategy, useSortable } from '@dnd-kit/sortable';
|
|
6
|
+
import { CSS } from '@dnd-kit/utilities';
|
|
4
7
|
|
|
5
8
|
// src/components/data-explorer/DataExplorerToolbarActions.tsx
|
|
6
9
|
|
|
@@ -1668,6 +1671,406 @@ function DataExplorerDetailShell({
|
|
|
1668
1671
|
}
|
|
1669
1672
|
);
|
|
1670
1673
|
}
|
|
1674
|
+
var treeItemDropTransition = "transform 320ms cubic-bezier(0.22, 1, 0.36, 1)";
|
|
1675
|
+
function resolveTreeItemTransition(transition, dragging) {
|
|
1676
|
+
if (dragging) return transition;
|
|
1677
|
+
if (!transition || transition.includes("0ms")) return treeItemDropTransition;
|
|
1678
|
+
return transition;
|
|
1679
|
+
}
|
|
1680
|
+
function ChevronIcon({ expanded }) {
|
|
1681
|
+
return /* @__PURE__ */ jsx(
|
|
1682
|
+
"svg",
|
|
1683
|
+
{
|
|
1684
|
+
"aria-hidden": "true",
|
|
1685
|
+
viewBox: "0 0 24 24",
|
|
1686
|
+
className: cn(
|
|
1687
|
+
"h-4 w-4 transition-transform duration-200 ease-out",
|
|
1688
|
+
expanded ? "rotate-90" : "rotate-0"
|
|
1689
|
+
),
|
|
1690
|
+
fill: "none",
|
|
1691
|
+
stroke: "currentColor",
|
|
1692
|
+
strokeLinecap: "round",
|
|
1693
|
+
strokeLinejoin: "round",
|
|
1694
|
+
strokeWidth: "2",
|
|
1695
|
+
children: /* @__PURE__ */ jsx("path", { d: "m9 18 6-6-6-6" })
|
|
1696
|
+
}
|
|
1697
|
+
);
|
|
1698
|
+
}
|
|
1699
|
+
function GripIcon() {
|
|
1700
|
+
return /* @__PURE__ */ jsxs(
|
|
1701
|
+
"svg",
|
|
1702
|
+
{
|
|
1703
|
+
"aria-hidden": "true",
|
|
1704
|
+
viewBox: "0 0 24 24",
|
|
1705
|
+
className: "h-3.5 w-3.5",
|
|
1706
|
+
fill: "none",
|
|
1707
|
+
stroke: "currentColor",
|
|
1708
|
+
strokeLinecap: "round",
|
|
1709
|
+
strokeLinejoin: "round",
|
|
1710
|
+
strokeWidth: "2",
|
|
1711
|
+
children: [
|
|
1712
|
+
/* @__PURE__ */ jsx("circle", { cx: "9", cy: "5", r: "1" }),
|
|
1713
|
+
/* @__PURE__ */ jsx("circle", { cx: "9", cy: "12", r: "1" }),
|
|
1714
|
+
/* @__PURE__ */ jsx("circle", { cx: "9", cy: "19", r: "1" }),
|
|
1715
|
+
/* @__PURE__ */ jsx("circle", { cx: "15", cy: "5", r: "1" }),
|
|
1716
|
+
/* @__PURE__ */ jsx("circle", { cx: "15", cy: "12", r: "1" }),
|
|
1717
|
+
/* @__PURE__ */ jsx("circle", { cx: "15", cy: "19", r: "1" })
|
|
1718
|
+
]
|
|
1719
|
+
}
|
|
1720
|
+
);
|
|
1721
|
+
}
|
|
1722
|
+
function collectDefaultExpandedNodeIds(nodes, ids) {
|
|
1723
|
+
for (const node of nodes) {
|
|
1724
|
+
if (node.defaultExpanded) ids.add(node.id);
|
|
1725
|
+
collectDefaultExpandedNodeIds(node.children ?? [], ids);
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
1728
|
+
function buildDefaultExpandedNodeIds(nodes, defaultExpandedNodeIds) {
|
|
1729
|
+
const ids = new Set(defaultExpandedNodeIds ?? []);
|
|
1730
|
+
collectDefaultExpandedNodeIds(nodes, ids);
|
|
1731
|
+
return ids;
|
|
1732
|
+
}
|
|
1733
|
+
function flattenTree(nodes, expandedNodeIds, parentId, depth, entries) {
|
|
1734
|
+
nodes.forEach((node, index) => {
|
|
1735
|
+
entries.push({ node, parentId, index, depth });
|
|
1736
|
+
const hasChildren = Array.isArray(node.children) && node.children.length > 0;
|
|
1737
|
+
const isExpanded = node.collapsible === false || expandedNodeIds.has(node.id);
|
|
1738
|
+
if (hasChildren && isExpanded) {
|
|
1739
|
+
flattenTree(node.children ?? [], expandedNodeIds, node.id, depth + 1, entries);
|
|
1740
|
+
}
|
|
1741
|
+
});
|
|
1742
|
+
}
|
|
1743
|
+
function buildFlattenedTree(nodes, expandedNodeIds) {
|
|
1744
|
+
const entries = [];
|
|
1745
|
+
flattenTree(nodes, expandedNodeIds, void 0, 0, entries);
|
|
1746
|
+
return entries;
|
|
1747
|
+
}
|
|
1748
|
+
function DraggableTreeItem({
|
|
1749
|
+
entry,
|
|
1750
|
+
selected,
|
|
1751
|
+
expanded,
|
|
1752
|
+
active,
|
|
1753
|
+
over,
|
|
1754
|
+
indentSize,
|
|
1755
|
+
activationMode,
|
|
1756
|
+
dragHandleLabel,
|
|
1757
|
+
expandLabel,
|
|
1758
|
+
collapseLabel,
|
|
1759
|
+
themeSlots,
|
|
1760
|
+
classNames,
|
|
1761
|
+
context,
|
|
1762
|
+
renderNodeActions,
|
|
1763
|
+
renderNodeChildren,
|
|
1764
|
+
onSelect,
|
|
1765
|
+
onToggle
|
|
1766
|
+
}) {
|
|
1767
|
+
const { node, depth } = entry;
|
|
1768
|
+
const hasChildren = Boolean(node.children?.length);
|
|
1769
|
+
const disabled = Boolean(node.disabled);
|
|
1770
|
+
const selectable = node.selectable !== false && !disabled;
|
|
1771
|
+
const draggable = node.draggable !== false && !disabled;
|
|
1772
|
+
const {
|
|
1773
|
+
attributes,
|
|
1774
|
+
listeners,
|
|
1775
|
+
setNodeRef,
|
|
1776
|
+
transform,
|
|
1777
|
+
transition,
|
|
1778
|
+
isDragging
|
|
1779
|
+
} = useSortable({
|
|
1780
|
+
id: node.id,
|
|
1781
|
+
disabled: !draggable,
|
|
1782
|
+
transition: {
|
|
1783
|
+
duration: 220,
|
|
1784
|
+
easing: "cubic-bezier(0.22,1,0.36,1)"
|
|
1785
|
+
}
|
|
1786
|
+
});
|
|
1787
|
+
const {
|
|
1788
|
+
role: _sortableRole,
|
|
1789
|
+
tabIndex: _sortableTabIndex,
|
|
1790
|
+
"aria-disabled": _sortableAriaDisabled,
|
|
1791
|
+
...sortableAttributes
|
|
1792
|
+
} = attributes;
|
|
1793
|
+
const sortableListeners = activationMode === "row" ? listeners : void 0;
|
|
1794
|
+
const handleListeners = activationMode === "handle" ? listeners : void 0;
|
|
1795
|
+
const renderContext = {
|
|
1796
|
+
node,
|
|
1797
|
+
depth,
|
|
1798
|
+
expanded,
|
|
1799
|
+
selected,
|
|
1800
|
+
dragging: isDragging || active,
|
|
1801
|
+
disabled,
|
|
1802
|
+
context: node.context ?? context
|
|
1803
|
+
};
|
|
1804
|
+
const style = {
|
|
1805
|
+
transform: CSS.Transform.toString(transform),
|
|
1806
|
+
transition: resolveTreeItemTransition(transition, isDragging)
|
|
1807
|
+
};
|
|
1808
|
+
return /* @__PURE__ */ jsxs(
|
|
1809
|
+
"div",
|
|
1810
|
+
{
|
|
1811
|
+
ref: setNodeRef,
|
|
1812
|
+
style,
|
|
1813
|
+
className: cn(
|
|
1814
|
+
"min-w-0",
|
|
1815
|
+
classNames?.item,
|
|
1816
|
+
node.className,
|
|
1817
|
+
isDragging && "relative z-20"
|
|
1818
|
+
),
|
|
1819
|
+
children: [
|
|
1820
|
+
/* @__PURE__ */ jsxs(
|
|
1821
|
+
"div",
|
|
1822
|
+
{
|
|
1823
|
+
"data-data-explorer-draggable-tree-item": true,
|
|
1824
|
+
className: cn(
|
|
1825
|
+
themeSlots.treeNodeButton,
|
|
1826
|
+
"min-h-8 touch-none border border-transparent bg-background/70 py-0 pl-1 pr-2 font-medium",
|
|
1827
|
+
selectable && "cursor-pointer",
|
|
1828
|
+
draggable && activationMode === "row" && "cursor-grab active:cursor-grabbing",
|
|
1829
|
+
selected && themeSlots.treeNodeSelected,
|
|
1830
|
+
disabled && themeSlots.treeNodeDisabled,
|
|
1831
|
+
(isDragging || active) && themeSlots.treeNodeDragging,
|
|
1832
|
+
over && "border-primary/30 bg-primary/[0.08] ring-1 ring-primary/15",
|
|
1833
|
+
selected && classNames?.itemSelected,
|
|
1834
|
+
disabled && classNames?.itemDisabled,
|
|
1835
|
+
(isDragging || active) && classNames?.itemDragging,
|
|
1836
|
+
over && classNames?.itemOver,
|
|
1837
|
+
classNames?.itemButton,
|
|
1838
|
+
node.itemClassName
|
|
1839
|
+
),
|
|
1840
|
+
style: { paddingLeft: `${depth * indentSize + 4}px` },
|
|
1841
|
+
role: "treeitem",
|
|
1842
|
+
"aria-selected": selected || void 0,
|
|
1843
|
+
"aria-disabled": disabled || void 0,
|
|
1844
|
+
"aria-expanded": hasChildren ? expanded : void 0,
|
|
1845
|
+
"aria-label": node.ariaLabel,
|
|
1846
|
+
tabIndex: selectable ? 0 : -1,
|
|
1847
|
+
...sortableAttributes,
|
|
1848
|
+
...sortableListeners,
|
|
1849
|
+
onClick: () => {
|
|
1850
|
+
if (!selectable) return;
|
|
1851
|
+
onSelect?.(node);
|
|
1852
|
+
},
|
|
1853
|
+
onKeyDown: (event) => {
|
|
1854
|
+
if (!selectable) return;
|
|
1855
|
+
if (event.key !== "Enter" && event.key !== " ") return;
|
|
1856
|
+
event.preventDefault();
|
|
1857
|
+
onSelect?.(node);
|
|
1858
|
+
},
|
|
1859
|
+
children: [
|
|
1860
|
+
draggable ? /* @__PURE__ */ jsx(
|
|
1861
|
+
"span",
|
|
1862
|
+
{
|
|
1863
|
+
className: cn(
|
|
1864
|
+
themeSlots.treeNodeDragHandle,
|
|
1865
|
+
"opacity-100",
|
|
1866
|
+
classNames?.dragHandle
|
|
1867
|
+
),
|
|
1868
|
+
"aria-label": dragHandleLabel,
|
|
1869
|
+
title: dragHandleLabel,
|
|
1870
|
+
...handleListeners,
|
|
1871
|
+
onClick: (event) => event.stopPropagation(),
|
|
1872
|
+
children: /* @__PURE__ */ jsx(GripIcon, {})
|
|
1873
|
+
}
|
|
1874
|
+
) : /* @__PURE__ */ jsx("span", { className: cn("h-5 w-5 shrink-0", classNames?.dragHandle) }),
|
|
1875
|
+
hasChildren ? /* @__PURE__ */ jsx(
|
|
1876
|
+
"button",
|
|
1877
|
+
{
|
|
1878
|
+
type: "button",
|
|
1879
|
+
className: cn(themeSlots.treeNodeToggle, classNames?.toggle),
|
|
1880
|
+
"aria-label": expanded ? collapseLabel : expandLabel,
|
|
1881
|
+
onClick: (event) => {
|
|
1882
|
+
event.stopPropagation();
|
|
1883
|
+
onToggle(node.id);
|
|
1884
|
+
},
|
|
1885
|
+
children: /* @__PURE__ */ jsx(ChevronIcon, { expanded })
|
|
1886
|
+
}
|
|
1887
|
+
) : /* @__PURE__ */ jsx("span", { className: cn(themeSlots.treeNodeToggle, classNames?.toggle) }),
|
|
1888
|
+
node.icon ? /* @__PURE__ */ jsx("span", { className: cn(themeSlots.treeNodeIcon, classNames?.icon), children: node.icon }) : null,
|
|
1889
|
+
/* @__PURE__ */ jsxs(
|
|
1890
|
+
"span",
|
|
1891
|
+
{
|
|
1892
|
+
className: cn(
|
|
1893
|
+
"flex min-w-0 flex-1 flex-col",
|
|
1894
|
+
classNames?.itemContent
|
|
1895
|
+
),
|
|
1896
|
+
children: [
|
|
1897
|
+
/* @__PURE__ */ jsx("span", { className: cn(themeSlots.treeNodeLabel, classNames?.label), children: node.label }),
|
|
1898
|
+
node.description ? /* @__PURE__ */ jsx(
|
|
1899
|
+
"span",
|
|
1900
|
+
{
|
|
1901
|
+
className: cn(
|
|
1902
|
+
themeSlots.treeNodeDescription,
|
|
1903
|
+
classNames?.description
|
|
1904
|
+
),
|
|
1905
|
+
children: node.description
|
|
1906
|
+
}
|
|
1907
|
+
) : null
|
|
1908
|
+
]
|
|
1909
|
+
}
|
|
1910
|
+
),
|
|
1911
|
+
node.meta ? /* @__PURE__ */ jsx("span", { className: cn(themeSlots.treeNodeMeta, classNames?.meta), children: node.meta }) : null,
|
|
1912
|
+
node.badge ? /* @__PURE__ */ jsx("span", { className: cn(themeSlots.treeNodeBadge, classNames?.badge), children: node.badge }) : null,
|
|
1913
|
+
renderNodeActions ? /* @__PURE__ */ jsx("span", { className: cn("ml-1 shrink-0", classNames?.actions), children: renderNodeActions(renderContext) }) : null
|
|
1914
|
+
]
|
|
1915
|
+
}
|
|
1916
|
+
),
|
|
1917
|
+
renderNodeChildren ? /* @__PURE__ */ jsx(
|
|
1918
|
+
"div",
|
|
1919
|
+
{
|
|
1920
|
+
className: cn(
|
|
1921
|
+
"min-w-0",
|
|
1922
|
+
classNames?.children,
|
|
1923
|
+
node.childrenClassName
|
|
1924
|
+
),
|
|
1925
|
+
children: renderNodeChildren(renderContext)
|
|
1926
|
+
}
|
|
1927
|
+
) : null
|
|
1928
|
+
]
|
|
1929
|
+
}
|
|
1930
|
+
);
|
|
1931
|
+
}
|
|
1932
|
+
function DataExplorerDraggableTree({
|
|
1933
|
+
nodes,
|
|
1934
|
+
context,
|
|
1935
|
+
selectedNodeId,
|
|
1936
|
+
expandedNodeIds,
|
|
1937
|
+
defaultExpandedNodeIds,
|
|
1938
|
+
resetExpansionKey,
|
|
1939
|
+
indentSize = 16,
|
|
1940
|
+
activationMode = "row",
|
|
1941
|
+
loading,
|
|
1942
|
+
empty,
|
|
1943
|
+
labels,
|
|
1944
|
+
appearance,
|
|
1945
|
+
className,
|
|
1946
|
+
classNames,
|
|
1947
|
+
renderNodeActions,
|
|
1948
|
+
renderNodeChildren,
|
|
1949
|
+
onSelectNode,
|
|
1950
|
+
onExpandedNodeIdsChange,
|
|
1951
|
+
onDragEnd
|
|
1952
|
+
}) {
|
|
1953
|
+
const theme = resolveDataExplorerAppearance(appearance);
|
|
1954
|
+
const [internalExpandedNodeIds, setInternalExpandedNodeIds] = useState(
|
|
1955
|
+
() => buildDefaultExpandedNodeIds(nodes, defaultExpandedNodeIds)
|
|
1956
|
+
);
|
|
1957
|
+
const [activeNodeId, setActiveNodeId] = useState();
|
|
1958
|
+
const [overNodeId, setOverNodeId] = useState();
|
|
1959
|
+
const sensors = useSensors(
|
|
1960
|
+
useSensor(PointerSensor, { activationConstraint: { distance: 4 } }),
|
|
1961
|
+
useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates })
|
|
1962
|
+
);
|
|
1963
|
+
useEffect(() => {
|
|
1964
|
+
setInternalExpandedNodeIds(
|
|
1965
|
+
buildDefaultExpandedNodeIds(nodes, defaultExpandedNodeIds)
|
|
1966
|
+
);
|
|
1967
|
+
}, [defaultExpandedNodeIds, resetExpansionKey]);
|
|
1968
|
+
const resolvedExpandedNodeIds = expandedNodeIds !== void 0 ? new Set(expandedNodeIds) : internalExpandedNodeIds;
|
|
1969
|
+
const flattenedNodes = useMemo(
|
|
1970
|
+
() => buildFlattenedTree(nodes, resolvedExpandedNodeIds),
|
|
1971
|
+
[nodes, resolvedExpandedNodeIds]
|
|
1972
|
+
);
|
|
1973
|
+
const flattenedNodeMap = useMemo(() => {
|
|
1974
|
+
const map = /* @__PURE__ */ new Map();
|
|
1975
|
+
for (const entry of flattenedNodes) map.set(entry.node.id, entry);
|
|
1976
|
+
return map;
|
|
1977
|
+
}, [flattenedNodes]);
|
|
1978
|
+
const sortableIds = flattenedNodes.map((entry) => entry.node.id);
|
|
1979
|
+
const setNodeExpanded = (nodeId, expanded) => {
|
|
1980
|
+
const next = new Set(resolvedExpandedNodeIds);
|
|
1981
|
+
if (expanded) {
|
|
1982
|
+
next.add(nodeId);
|
|
1983
|
+
} else {
|
|
1984
|
+
next.delete(nodeId);
|
|
1985
|
+
}
|
|
1986
|
+
if (expandedNodeIds === void 0) {
|
|
1987
|
+
setInternalExpandedNodeIds(next);
|
|
1988
|
+
}
|
|
1989
|
+
onExpandedNodeIdsChange?.([...next]);
|
|
1990
|
+
};
|
|
1991
|
+
const handleDragEnd = (event) => {
|
|
1992
|
+
const activeId = String(event.active.id || "");
|
|
1993
|
+
const overId = event.over ? String(event.over.id || "") : "";
|
|
1994
|
+
setActiveNodeId(void 0);
|
|
1995
|
+
setOverNodeId(void 0);
|
|
1996
|
+
if (!activeId || !overId || activeId === overId || !onDragEnd) return;
|
|
1997
|
+
const activeEntry = flattenedNodeMap.get(activeId);
|
|
1998
|
+
const overEntry = flattenedNodeMap.get(overId);
|
|
1999
|
+
if (!activeEntry || !overEntry) return;
|
|
2000
|
+
const payload = {
|
|
2001
|
+
activeNode: activeEntry.node,
|
|
2002
|
+
overNode: overEntry.node,
|
|
2003
|
+
activeParentId: activeEntry.parentId,
|
|
2004
|
+
overParentId: overEntry.parentId,
|
|
2005
|
+
activeIndex: activeEntry.index,
|
|
2006
|
+
overIndex: overEntry.index,
|
|
2007
|
+
sameParent: activeEntry.parentId === overEntry.parentId,
|
|
2008
|
+
context
|
|
2009
|
+
};
|
|
2010
|
+
void onDragEnd(payload);
|
|
2011
|
+
};
|
|
2012
|
+
if (loading) {
|
|
2013
|
+
return /* @__PURE__ */ jsx("div", { className: cn(theme.slots.treeRoot, classNames?.root, className), children: /* @__PURE__ */ jsx("div", { className: cn(theme.slots.treeLoading, classNames?.loading), children: labels?.loading ?? "Loading..." }) });
|
|
2014
|
+
}
|
|
2015
|
+
if (nodes.length === 0) {
|
|
2016
|
+
return /* @__PURE__ */ jsx("div", { className: cn(theme.slots.treeRoot, classNames?.root, className), children: /* @__PURE__ */ jsx("div", { className: cn(theme.slots.treeEmpty, classNames?.empty), children: empty ?? labels?.empty ?? "No data" }) });
|
|
2017
|
+
}
|
|
2018
|
+
return /* @__PURE__ */ jsx(
|
|
2019
|
+
DndContext,
|
|
2020
|
+
{
|
|
2021
|
+
sensors,
|
|
2022
|
+
collisionDetection: closestCenter,
|
|
2023
|
+
onDragStart: (event) => setActiveNodeId(String(event.active.id || "")),
|
|
2024
|
+
onDragOver: (event) => {
|
|
2025
|
+
setOverNodeId(event.over ? String(event.over.id || "") : void 0);
|
|
2026
|
+
},
|
|
2027
|
+
onDragEnd: handleDragEnd,
|
|
2028
|
+
onDragCancel: () => {
|
|
2029
|
+
setActiveNodeId(void 0);
|
|
2030
|
+
setOverNodeId(void 0);
|
|
2031
|
+
},
|
|
2032
|
+
children: /* @__PURE__ */ jsx(SortableContext, { items: sortableIds, strategy: verticalListSortingStrategy, children: /* @__PURE__ */ jsx(
|
|
2033
|
+
"div",
|
|
2034
|
+
{
|
|
2035
|
+
className: cn(
|
|
2036
|
+
theme.slots.treeRoot,
|
|
2037
|
+
"space-y-1 overflow-visible",
|
|
2038
|
+
classNames?.root,
|
|
2039
|
+
className
|
|
2040
|
+
),
|
|
2041
|
+
role: "tree",
|
|
2042
|
+
children: /* @__PURE__ */ jsx("div", { className: cn("min-w-0 space-y-1", classNames?.list), children: flattenedNodes.map((entry) => {
|
|
2043
|
+
const node = entry.node;
|
|
2044
|
+
const expanded = node.collapsible === false || resolvedExpandedNodeIds.has(node.id);
|
|
2045
|
+
return /* @__PURE__ */ jsx(
|
|
2046
|
+
DraggableTreeItem,
|
|
2047
|
+
{
|
|
2048
|
+
entry,
|
|
2049
|
+
selected: selectedNodeId === node.id,
|
|
2050
|
+
expanded,
|
|
2051
|
+
active: activeNodeId === node.id,
|
|
2052
|
+
over: overNodeId === node.id && activeNodeId !== node.id,
|
|
2053
|
+
indentSize,
|
|
2054
|
+
activationMode,
|
|
2055
|
+
dragHandleLabel: labels?.dragHandle ?? "Drag",
|
|
2056
|
+
expandLabel: labels?.expand ?? "Expand",
|
|
2057
|
+
collapseLabel: labels?.collapse ?? "Collapse",
|
|
2058
|
+
themeSlots: theme.slots,
|
|
2059
|
+
classNames,
|
|
2060
|
+
context,
|
|
2061
|
+
renderNodeActions,
|
|
2062
|
+
renderNodeChildren,
|
|
2063
|
+
onSelect: (nextNode) => onSelectNode?.(nextNode, context),
|
|
2064
|
+
onToggle: (nodeId) => setNodeExpanded(nodeId, !expanded)
|
|
2065
|
+
},
|
|
2066
|
+
node.id
|
|
2067
|
+
);
|
|
2068
|
+
}) })
|
|
2069
|
+
}
|
|
2070
|
+
) })
|
|
2071
|
+
}
|
|
2072
|
+
);
|
|
2073
|
+
}
|
|
1671
2074
|
function MoreIcon() {
|
|
1672
2075
|
return /* @__PURE__ */ jsxs(
|
|
1673
2076
|
"svg",
|
|
@@ -3704,7 +4107,7 @@ function DataExplorerTreeShell({
|
|
|
3704
4107
|
}
|
|
3705
4108
|
);
|
|
3706
4109
|
}
|
|
3707
|
-
function
|
|
4110
|
+
function ChevronIcon2({ expanded }) {
|
|
3708
4111
|
return /* @__PURE__ */ jsx(
|
|
3709
4112
|
"svg",
|
|
3710
4113
|
{
|
|
@@ -3740,7 +4143,7 @@ function MoreIcon2() {
|
|
|
3740
4143
|
}
|
|
3741
4144
|
);
|
|
3742
4145
|
}
|
|
3743
|
-
function
|
|
4146
|
+
function GripIcon2() {
|
|
3744
4147
|
return /* @__PURE__ */ jsxs(
|
|
3745
4148
|
"svg",
|
|
3746
4149
|
{
|
|
@@ -3763,18 +4166,18 @@ function GripIcon() {
|
|
|
3763
4166
|
}
|
|
3764
4167
|
);
|
|
3765
4168
|
}
|
|
3766
|
-
function
|
|
4169
|
+
function collectDefaultExpandedNodeIds2(nodes, defaults) {
|
|
3767
4170
|
for (const node of nodes ?? []) {
|
|
3768
4171
|
if (node.defaultExpanded) {
|
|
3769
4172
|
defaults.add(node.id);
|
|
3770
4173
|
}
|
|
3771
|
-
|
|
4174
|
+
collectDefaultExpandedNodeIds2(node.children, defaults);
|
|
3772
4175
|
}
|
|
3773
4176
|
}
|
|
3774
4177
|
function buildDefaultNodeExpandedSet(groups, defaultExpandedNodeIds) {
|
|
3775
4178
|
const defaults = new Set(defaultExpandedNodeIds ?? []);
|
|
3776
4179
|
for (const group of groups) {
|
|
3777
|
-
|
|
4180
|
+
collectDefaultExpandedNodeIds2(group.nodes, defaults);
|
|
3778
4181
|
}
|
|
3779
4182
|
return defaults;
|
|
3780
4183
|
}
|
|
@@ -4104,7 +4507,7 @@ function DataExplorerViewTree({
|
|
|
4104
4507
|
setDraggingNodeId(void 0);
|
|
4105
4508
|
setDragOverNodeId(void 0);
|
|
4106
4509
|
},
|
|
4107
|
-
children: /* @__PURE__ */ jsx(
|
|
4510
|
+
children: /* @__PURE__ */ jsx(GripIcon2, {})
|
|
4108
4511
|
}
|
|
4109
4512
|
) : null,
|
|
4110
4513
|
hasChildren ? /* @__PURE__ */ jsx(
|
|
@@ -4117,7 +4520,7 @@ function DataExplorerViewTree({
|
|
|
4117
4520
|
event.stopPropagation();
|
|
4118
4521
|
setNodeExpanded(node.id, !isExpanded);
|
|
4119
4522
|
},
|
|
4120
|
-
children: /* @__PURE__ */ jsx(
|
|
4523
|
+
children: /* @__PURE__ */ jsx(ChevronIcon2, { expanded: isExpanded })
|
|
4121
4524
|
}
|
|
4122
4525
|
) : /* @__PURE__ */ jsx("span", { className: cn(theme.slots.treeNodeToggle, classNames?.nodeToggle) }),
|
|
4123
4526
|
node.icon ? /* @__PURE__ */ jsx("span", { className: cn(theme.slots.treeNodeIcon, classNames?.nodeIcon), children: node.icon }) : null,
|
|
@@ -4202,7 +4605,7 @@ function DataExplorerViewTree({
|
|
|
4202
4605
|
setGroupExpanded(group.id, !groupExpanded);
|
|
4203
4606
|
},
|
|
4204
4607
|
children: [
|
|
4205
|
-
group.collapsible === false ? /* @__PURE__ */ jsx("span", { className: theme.slots.treeNodeToggle }) : /* @__PURE__ */ jsx("span", { className: theme.slots.treeNodeToggle, children: /* @__PURE__ */ jsx(
|
|
4608
|
+
group.collapsible === false ? /* @__PURE__ */ jsx("span", { className: theme.slots.treeNodeToggle }) : /* @__PURE__ */ jsx("span", { className: theme.slots.treeNodeToggle, children: /* @__PURE__ */ jsx(ChevronIcon2, { expanded: groupExpanded }) }),
|
|
4206
4609
|
group.icon ? /* @__PURE__ */ jsx("span", { className: cn(theme.slots.treeNodeIcon, classNames?.nodeIcon), children: group.icon }) : null,
|
|
4207
4610
|
/* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
4208
4611
|
group.label ? /* @__PURE__ */ jsx("span", { className: cn(theme.slots.treeNodeLabel, classNames?.nodeLabel), children: group.label }) : null,
|
|
@@ -4427,6 +4830,6 @@ function DataExplorerViewShell({
|
|
|
4427
4830
|
);
|
|
4428
4831
|
}
|
|
4429
4832
|
|
|
4430
|
-
export { DataExplorerActionBar, DataExplorerButton, DataExplorerCheckbox, DataExplorerCollectionFooter, DataExplorerDetailField, DataExplorerDetailSection, DataExplorerDetailShell, DataExplorerDisplayActionMenu, DataExplorerDisplayCard, DataExplorerDisplayCollectionView, DataExplorerDisplayListItem, DataExplorerDisplayMedia, DataExplorerImagePreview, DataExplorerPage, DataExplorerRecordCard, DataExplorerSelect, DataExplorerToolbarActions, DataExplorerToolbarShell, DataExplorerTree, DataExplorerTreeShell, DataExplorerView, DataExplorerViewCollection, DataExplorerViewItem, DataExplorerViewItemShell, DataExplorerViewShell, DataExplorerViewTree, getDataExplorerActionToneClassName, getDataExplorerMenuItemToneClassName, resolveDataExplorerAppearance };
|
|
4833
|
+
export { DataExplorerActionBar, DataExplorerButton, DataExplorerCheckbox, DataExplorerCollectionFooter, DataExplorerDetailField, DataExplorerDetailSection, DataExplorerDetailShell, DataExplorerDisplayActionMenu, DataExplorerDisplayCard, DataExplorerDisplayCollectionView, DataExplorerDisplayListItem, DataExplorerDisplayMedia, DataExplorerDraggableTree, DataExplorerImagePreview, DataExplorerPage, DataExplorerRecordCard, DataExplorerSelect, DataExplorerToolbarActions, DataExplorerToolbarShell, DataExplorerTree, DataExplorerTreeShell, DataExplorerView, DataExplorerViewCollection, DataExplorerViewItem, DataExplorerViewItemShell, DataExplorerViewShell, DataExplorerViewTree, getDataExplorerActionToneClassName, getDataExplorerMenuItemToneClassName, resolveDataExplorerAppearance };
|
|
4431
4834
|
//# sourceMappingURL=index.mjs.map
|
|
4432
4835
|
//# sourceMappingURL=index.mjs.map
|