@ai-matrx/design-system 0.18.4 → 0.18.5

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.
Files changed (56) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/content-transfer.cjs +12 -5
  3. package/dist/content-transfer.cjs.map +1 -1
  4. package/dist/content-transfer.d.cts +4 -0
  5. package/dist/content-transfer.d.ts +4 -0
  6. package/dist/content-transfer.js +12 -5
  7. package/dist/content-transfer.js.map +1 -1
  8. package/dist/data-table/copy-helpers.cjs +53 -0
  9. package/dist/data-table/copy-helpers.cjs.map +1 -1
  10. package/dist/data-table/copy-helpers.d.cts +13 -2
  11. package/dist/data-table/copy-helpers.d.ts +13 -2
  12. package/dist/data-table/copy-helpers.js +55 -0
  13. package/dist/data-table/copy-helpers.js.map +1 -1
  14. package/dist/data-table/copy-types.cjs.map +1 -1
  15. package/dist/data-table/copy-types.d.cts +4 -0
  16. package/dist/data-table/copy-types.d.ts +4 -0
  17. package/dist/data-table/data-row-inspector.cjs +70 -50
  18. package/dist/data-table/data-row-inspector.cjs.map +1 -1
  19. package/dist/data-table/data-row-inspector.js +70 -50
  20. package/dist/data-table/data-row-inspector.js.map +1 -1
  21. package/dist/data-table/data-row-window.cjs +70 -50
  22. package/dist/data-table/data-row-window.cjs.map +1 -1
  23. package/dist/data-table/data-row-window.js +70 -50
  24. package/dist/data-table/data-row-window.js.map +1 -1
  25. package/dist/data-table/filter-engine.d.cts +1 -1
  26. package/dist/data-table/filter-engine.d.ts +1 -1
  27. package/dist/data-table/index.cjs +621 -422
  28. package/dist/data-table/index.cjs.map +1 -1
  29. package/dist/data-table/index.d.cts +2 -2
  30. package/dist/data-table/index.d.ts +2 -2
  31. package/dist/data-table/index.js +623 -422
  32. package/dist/data-table/index.js.map +1 -1
  33. package/dist/data-table/infer-filter.d.cts +1 -1
  34. package/dist/data-table/infer-filter.d.ts +1 -1
  35. package/dist/data-table/layered-filters.d.cts +1 -1
  36. package/dist/data-table/layered-filters.d.ts +1 -1
  37. package/dist/data-table/pagination.cjs +148 -90
  38. package/dist/data-table/pagination.cjs.map +1 -1
  39. package/dist/data-table/pagination.js +143 -85
  40. package/dist/data-table/pagination.js.map +1 -1
  41. package/dist/data-table/query-control.d.cts +1 -1
  42. package/dist/data-table/query-control.d.ts +1 -1
  43. package/dist/data-table/types.cjs.map +1 -1
  44. package/dist/data-table/types.d.cts +1 -1
  45. package/dist/data-table/types.d.ts +1 -1
  46. package/dist/data-table/url-state.d.cts +1 -1
  47. package/dist/data-table/url-state.d.ts +1 -1
  48. package/dist/data-table/uuid-cell.cjs +58 -45
  49. package/dist/data-table/uuid-cell.cjs.map +1 -1
  50. package/dist/data-table/uuid-cell.js +58 -45
  51. package/dist/data-table/uuid-cell.js.map +1 -1
  52. package/dist/data-table/xlsx.d.cts +1 -1
  53. package/dist/data-table/xlsx.d.ts +1 -1
  54. package/dist/{types-Bx9SfdJM.d.cts → types-0CNCWvdK.d.cts} +2 -2
  55. package/dist/{types-DyByb6tW.d.ts → types-cH8oLqUx.d.ts} +2 -2
  56. package/package.json +1 -1
@@ -1624,14 +1624,21 @@ function MatrxCopyMenuSession(props) {
1624
1624
  ))
1625
1625
  throw new Error("Sheet rows must be JSON objects.");
1626
1626
  const rows = value;
1627
- const keys = [...new Set(rows.flatMap((row) => Object.keys(row)))];
1627
+ const suppliedColumns = props.export.sheetColumns?.();
1628
+ const columns = suppliedColumns ?? [...new Set(rows.flatMap((row) => Object.keys(row)))].map((id) => ({ id, label: id }));
1629
+ const ids = /* @__PURE__ */ new Set();
1630
+ for (const column of columns) {
1631
+ if (!column.id || !column.label || ids.has(column.id)) throw new Error("Sheet columns require unique nonempty ids and labels.");
1632
+ ids.add(column.id);
1633
+ }
1634
+ for (const row of rows) for (const key of Object.keys(row)) if (!ids.has(key)) throw new Error(`Sheet row key "${key}" is not declared in sheetColumns.`);
1628
1635
  return {
1629
1636
  kind: "rows",
1630
1637
  rows,
1631
- columns: keys.map((key) => ({
1632
- id: key,
1633
- label: key,
1634
- path: `/${key.replace(/~/g, "~0").replace(/\//g, "~1")}`,
1638
+ columns: columns.map((column) => ({
1639
+ id: column.id,
1640
+ label: column.label,
1641
+ path: `/${column.id.replace(/~/g, "~0").replace(/\//g, "~1")}`,
1635
1642
  visible: true
1636
1643
  }))
1637
1644
  };
@@ -2257,7 +2264,7 @@ function MatrxUuidCell({
2257
2264
  }
2258
2265
  return /* @__PURE__ */ jsx15("span", { className: "min-w-0 truncate font-mono text-xs text-muted-foreground tabular-nums select-all", children: display });
2259
2266
  })();
2260
- return /* @__PURE__ */ jsxs9(
2267
+ return /* @__PURE__ */ jsx15(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxs9(
2261
2268
  "span",
2262
2269
  {
2263
2270
  "data-matrx-cell-control": true,
@@ -2267,51 +2274,64 @@ function MatrxUuidCell({
2267
2274
  ),
2268
2275
  onClick: stop,
2269
2276
  children: [
2270
- /* @__PURE__ */ jsx15(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxs9(Tooltip, { children: [
2277
+ /* @__PURE__ */ jsxs9(Tooltip, { children: [
2271
2278
  /* @__PURE__ */ jsx15(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx15("span", { className: "inline-flex min-w-0 max-w-full items-center", children: idNode }) }),
2272
2279
  /* @__PURE__ */ jsx15(TooltipContent, { side: "top", className: "max-w-sm break-all font-mono", children: forbidden ? `No access \xB7 ${tip}` : tip })
2273
- ] }) }),
2274
- /* @__PURE__ */ jsx15(
2275
- "button",
2276
- {
2277
- type: "button",
2278
- onClick: onCopy,
2279
- "aria-label": copied ? "Copied" : `Copy ${label ?? "id"}`,
2280
- title: `Copy ${label ?? "id"}: ${value}`,
2281
- className: cn(
2282
- "inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground focus:outline-none",
2283
- copied && "text-primary"
2284
- ),
2285
- children: copied ? /* @__PURE__ */ jsx15(Check, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx15(Copy, { className: "h-3 w-3" })
2286
- }
2287
- ),
2288
- canPeek ? /* @__PURE__ */ jsx15(
2289
- "button",
2290
- {
2291
- type: "button",
2292
- onClick: (e) => {
2293
- stop(e);
2294
- setPeekOpen(true);
2295
- },
2296
- "aria-label": `Quick look at ${label ?? "record"}`,
2297
- title: `Quick look at ${label ?? "record"}`,
2298
- className: "inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground focus:outline-none",
2299
- children: /* @__PURE__ */ jsx15(Lightbulb, { className: "h-3 w-3" })
2300
- }
2301
- ) : null,
2302
- onOpen && resolvedHref && !forbidden ? /* @__PURE__ */ jsx15(
2303
- "a",
2304
- {
2305
- href: resolvedHref,
2306
- target: "_blank",
2307
- rel: "noopener noreferrer",
2308
- onClick: stop,
2309
- "aria-label": `Open ${label ?? "record"} in a new tab`,
2310
- title: `Open ${label ?? "record"} in a new tab`,
2311
- className: "inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground focus:outline-none",
2312
- children: /* @__PURE__ */ jsx15(ExternalLink, { className: "h-3 w-3" })
2313
- }
2314
- ) : null,
2280
+ ] }),
2281
+ /* @__PURE__ */ jsxs9(Tooltip, { children: [
2282
+ /* @__PURE__ */ jsx15(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx15(
2283
+ "button",
2284
+ {
2285
+ type: "button",
2286
+ onClick: onCopy,
2287
+ "aria-label": copied ? "Copied" : `Copy ${label ?? "id"}`,
2288
+ className: cn(
2289
+ "inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground focus:outline-none",
2290
+ copied && "text-primary"
2291
+ ),
2292
+ children: copied ? /* @__PURE__ */ jsx15(Check, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx15(Copy, { className: "h-3 w-3" })
2293
+ }
2294
+ ) }),
2295
+ /* @__PURE__ */ jsx15(TooltipContent, { side: "top", children: copied ? "Copied" : `Copy ${label ?? "id"}: ${value}` })
2296
+ ] }),
2297
+ canPeek ? /* @__PURE__ */ jsxs9(Tooltip, { children: [
2298
+ /* @__PURE__ */ jsx15(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx15(
2299
+ "button",
2300
+ {
2301
+ type: "button",
2302
+ onClick: (e) => {
2303
+ stop(e);
2304
+ setPeekOpen(true);
2305
+ },
2306
+ "aria-label": `Quick look at ${label ?? "record"}`,
2307
+ className: "inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground focus:outline-none",
2308
+ children: /* @__PURE__ */ jsx15(Lightbulb, { className: "h-3 w-3" })
2309
+ }
2310
+ ) }),
2311
+ /* @__PURE__ */ jsxs9(TooltipContent, { side: "top", children: [
2312
+ "Quick look at ",
2313
+ label ?? "record"
2314
+ ] })
2315
+ ] }) : null,
2316
+ onOpen && resolvedHref && !forbidden ? /* @__PURE__ */ jsxs9(Tooltip, { children: [
2317
+ /* @__PURE__ */ jsx15(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx15(
2318
+ "a",
2319
+ {
2320
+ href: resolvedHref,
2321
+ target: "_blank",
2322
+ rel: "noopener noreferrer",
2323
+ onClick: stop,
2324
+ "aria-label": `Open ${label ?? "record"} in a new tab`,
2325
+ className: "inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground focus:outline-none",
2326
+ children: /* @__PURE__ */ jsx15(ExternalLink, { className: "h-3 w-3" })
2327
+ }
2328
+ ) }),
2329
+ /* @__PURE__ */ jsxs9(TooltipContent, { side: "top", children: [
2330
+ "Open ",
2331
+ label ?? "record",
2332
+ " in a new tab"
2333
+ ] })
2334
+ ] }) : null,
2315
2335
  trailing,
2316
2336
  notice,
2317
2337
  canPeek && peekOpen && ResourcePeek ? /* @__PURE__ */ jsx15(
@@ -2325,7 +2345,7 @@ function MatrxUuidCell({
2325
2345
  ) : null
2326
2346
  ]
2327
2347
  }
2328
- );
2348
+ ) });
2329
2349
  }
2330
2350
 
2331
2351
  // src/data-table/entity.ts