@ai-matrx/design-system 0.18.4 → 0.18.6

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 +19 -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 +5 -0
  16. package/dist/data-table/copy-types.d.ts +5 -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
@@ -122,6 +122,10 @@ interface MatrxCopyMenuProps {
122
122
  export?: {
123
123
  items: AlchemyExportItem[];
124
124
  sheetRows?: () => Array<Record<string, unknown>>;
125
+ sheetColumns?: () => Array<{
126
+ id: string;
127
+ label: string;
128
+ }>;
125
129
  };
126
130
  /** Host-owned authenticated destination, not a second export serializer. */
127
131
  sendToSheet?: (rows: Array<Record<string, unknown>>, label: string) => Promise<TransferOutcome>;
@@ -122,6 +122,10 @@ interface MatrxCopyMenuProps {
122
122
  export?: {
123
123
  items: AlchemyExportItem[];
124
124
  sheetRows?: () => Array<Record<string, unknown>>;
125
+ sheetColumns?: () => Array<{
126
+ id: string;
127
+ label: string;
128
+ }>;
125
129
  };
126
130
  /** Host-owned authenticated destination, not a second export serializer. */
127
131
  sendToSheet?: (rows: Array<Record<string, unknown>>, label: string) => Promise<TransferOutcome>;
@@ -687,14 +687,21 @@ function MatrxCopyMenuSession(props) {
687
687
  ))
688
688
  throw new Error("Sheet rows must be JSON objects.");
689
689
  const rows = value;
690
- const keys = [...new Set(rows.flatMap((row) => Object.keys(row)))];
690
+ const suppliedColumns = props.export.sheetColumns?.();
691
+ const columns = suppliedColumns ?? [...new Set(rows.flatMap((row) => Object.keys(row)))].map((id) => ({ id, label: id }));
692
+ const ids = /* @__PURE__ */ new Set();
693
+ for (const column of columns) {
694
+ if (!column.id || !column.label || ids.has(column.id)) throw new Error("Sheet columns require unique nonempty ids and labels.");
695
+ ids.add(column.id);
696
+ }
697
+ for (const row of rows) for (const key of Object.keys(row)) if (!ids.has(key)) throw new Error("Table data contains a field outside its declared columns.");
691
698
  return {
692
699
  kind: "rows",
693
700
  rows,
694
- columns: keys.map((key) => ({
695
- id: key,
696
- label: key,
697
- path: `/${key.replace(/~/g, "~0").replace(/\//g, "~1")}`,
701
+ columns: columns.map((column) => ({
702
+ id: column.id,
703
+ label: column.label,
704
+ path: `/${column.id.replace(/~/g, "~0").replace(/\//g, "~1")}`,
698
705
  visible: true
699
706
  }))
700
707
  };