@geomak/ui 7.3.2 → 7.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +46 -57
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +46 -57
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1249,8 +1249,7 @@ function TreeNodeItem({
|
|
|
1249
1249
|
item,
|
|
1250
1250
|
onNodeClick,
|
|
1251
1251
|
defaultExpandAll,
|
|
1252
|
-
defaultExpandedKeys
|
|
1253
|
-
depth = 0
|
|
1252
|
+
defaultExpandedKeys
|
|
1254
1253
|
}) {
|
|
1255
1254
|
if (!isParent(item)) {
|
|
1256
1255
|
return /* @__PURE__ */ jsxs(
|
|
@@ -1258,7 +1257,6 @@ function TreeNodeItem({
|
|
|
1258
1257
|
{
|
|
1259
1258
|
type: "button",
|
|
1260
1259
|
className: "flex w-full items-center gap-2.5 cursor-pointer select-none group text-left rounded-md px-2 py-1.5 hover:bg-surface-raised transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",
|
|
1261
|
-
style: { paddingLeft: depth * 12 + 8 },
|
|
1262
1260
|
onClick: () => onNodeClick({
|
|
1263
1261
|
isParent: false,
|
|
1264
1262
|
key: item.key,
|
|
@@ -1274,62 +1272,53 @@ function TreeNodeItem({
|
|
|
1274
1272
|
);
|
|
1275
1273
|
}
|
|
1276
1274
|
const initialOpen = defaultExpandAll || defaultExpandedKeys.includes(item.key) ? [item.key] : [];
|
|
1277
|
-
return /* @__PURE__ */ jsx(
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1275
|
+
return /* @__PURE__ */ jsx(AccordionPrimitive.Root, { type: "multiple", defaultValue: initialOpen, children: /* @__PURE__ */ jsxs(AccordionPrimitive.Item, { value: item.key, className: "border-none", children: [
|
|
1276
|
+
/* @__PURE__ */ jsxs(
|
|
1277
|
+
AccordionPrimitive.Trigger,
|
|
1278
|
+
{
|
|
1279
|
+
onClick: () => onNodeClick({
|
|
1280
|
+
isParent: true,
|
|
1281
|
+
key: item.key,
|
|
1282
|
+
label: item.label,
|
|
1283
|
+
data: item.nodeData,
|
|
1284
|
+
parentLabel: item.parentLabel
|
|
1285
|
+
}),
|
|
1286
|
+
className: "flex items-center gap-2 cursor-pointer py-1.5 px-2 group focus:outline-none focus-visible:ring-2 focus-visible:ring-accent w-full text-left rounded-md hover:bg-surface-raised transition-colors duration-150",
|
|
1287
|
+
children: [
|
|
1288
|
+
/* @__PURE__ */ jsx(
|
|
1289
|
+
"svg",
|
|
1290
|
+
{
|
|
1291
|
+
viewBox: "0 0 24 24",
|
|
1292
|
+
fill: "none",
|
|
1293
|
+
stroke: "currentColor",
|
|
1294
|
+
strokeWidth: 2.5,
|
|
1295
|
+
className: "h-3.5 w-3.5 flex-shrink-0 text-foreground-muted transition-transform duration-200 group-data-[state=open]:rotate-0 group-data-[state=closed]:-rotate-90",
|
|
1296
|
+
"aria-hidden": "true",
|
|
1297
|
+
children: /* @__PURE__ */ jsx(
|
|
1298
|
+
"path",
|
|
1298
1299
|
{
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
strokeWidth: 2.5,
|
|
1303
|
-
className: "h-3.5 w-3.5 flex-shrink-0 text-foreground-muted transition-transform duration-200 group-data-[state=open]:rotate-0 group-data-[state=closed]:-rotate-90",
|
|
1304
|
-
"aria-hidden": "true",
|
|
1305
|
-
children: /* @__PURE__ */ jsx(
|
|
1306
|
-
"path",
|
|
1307
|
-
{
|
|
1308
|
-
strokeLinecap: "round",
|
|
1309
|
-
strokeLinejoin: "round",
|
|
1310
|
-
d: "M19 9l-7 7-7-7"
|
|
1311
|
-
}
|
|
1312
|
-
)
|
|
1300
|
+
strokeLinecap: "round",
|
|
1301
|
+
strokeLinejoin: "round",
|
|
1302
|
+
d: "M19 9l-7 7-7-7"
|
|
1313
1303
|
}
|
|
1314
|
-
)
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
}
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
);
|
|
1304
|
+
)
|
|
1305
|
+
}
|
|
1306
|
+
),
|
|
1307
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-foreground select-none", children: item.label })
|
|
1308
|
+
]
|
|
1309
|
+
}
|
|
1310
|
+
),
|
|
1311
|
+
/* @__PURE__ */ jsx(AccordionPrimitive.Content, { className: "overflow-hidden data-[state=open]:animate-accordion-down data-[state=closed]:animate-accordion-up", children: /* @__PURE__ */ jsx("div", { className: "ml-3.5 border-l border-border py-0.5", children: item.children.map((child) => /* @__PURE__ */ jsx(
|
|
1312
|
+
TreeNodeItem,
|
|
1313
|
+
{
|
|
1314
|
+
item: child,
|
|
1315
|
+
onNodeClick,
|
|
1316
|
+
defaultExpandAll,
|
|
1317
|
+
defaultExpandedKeys
|
|
1318
|
+
},
|
|
1319
|
+
child.key
|
|
1320
|
+
)) }) })
|
|
1321
|
+
] }) });
|
|
1333
1322
|
}
|
|
1334
1323
|
function Tree({
|
|
1335
1324
|
nodes,
|