@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.
- package/CHANGELOG.md +19 -0
- package/dist/content-transfer.cjs +12 -5
- package/dist/content-transfer.cjs.map +1 -1
- package/dist/content-transfer.d.cts +4 -0
- package/dist/content-transfer.d.ts +4 -0
- package/dist/content-transfer.js +12 -5
- package/dist/content-transfer.js.map +1 -1
- package/dist/data-table/copy-helpers.cjs +53 -0
- package/dist/data-table/copy-helpers.cjs.map +1 -1
- package/dist/data-table/copy-helpers.d.cts +13 -2
- package/dist/data-table/copy-helpers.d.ts +13 -2
- package/dist/data-table/copy-helpers.js +55 -0
- package/dist/data-table/copy-helpers.js.map +1 -1
- package/dist/data-table/copy-types.cjs.map +1 -1
- package/dist/data-table/copy-types.d.cts +5 -0
- package/dist/data-table/copy-types.d.ts +5 -0
- package/dist/data-table/data-row-inspector.cjs +70 -50
- package/dist/data-table/data-row-inspector.cjs.map +1 -1
- package/dist/data-table/data-row-inspector.js +70 -50
- package/dist/data-table/data-row-inspector.js.map +1 -1
- package/dist/data-table/data-row-window.cjs +70 -50
- package/dist/data-table/data-row-window.cjs.map +1 -1
- package/dist/data-table/data-row-window.js +70 -50
- package/dist/data-table/data-row-window.js.map +1 -1
- package/dist/data-table/filter-engine.d.cts +1 -1
- package/dist/data-table/filter-engine.d.ts +1 -1
- package/dist/data-table/index.cjs +621 -422
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.d.cts +2 -2
- package/dist/data-table/index.d.ts +2 -2
- package/dist/data-table/index.js +623 -422
- package/dist/data-table/index.js.map +1 -1
- package/dist/data-table/infer-filter.d.cts +1 -1
- package/dist/data-table/infer-filter.d.ts +1 -1
- package/dist/data-table/layered-filters.d.cts +1 -1
- package/dist/data-table/layered-filters.d.ts +1 -1
- package/dist/data-table/pagination.cjs +148 -90
- package/dist/data-table/pagination.cjs.map +1 -1
- package/dist/data-table/pagination.js +143 -85
- package/dist/data-table/pagination.js.map +1 -1
- package/dist/data-table/query-control.d.cts +1 -1
- package/dist/data-table/query-control.d.ts +1 -1
- package/dist/data-table/types.cjs.map +1 -1
- package/dist/data-table/types.d.cts +1 -1
- package/dist/data-table/types.d.ts +1 -1
- package/dist/data-table/url-state.d.cts +1 -1
- package/dist/data-table/url-state.d.ts +1 -1
- package/dist/data-table/uuid-cell.cjs +58 -45
- package/dist/data-table/uuid-cell.cjs.map +1 -1
- package/dist/data-table/uuid-cell.js +58 -45
- package/dist/data-table/uuid-cell.js.map +1 -1
- package/dist/data-table/xlsx.d.cts +1 -1
- package/dist/data-table/xlsx.d.ts +1 -1
- package/dist/{types-Bx9SfdJM.d.cts → types-0CNCWvdK.d.cts} +2 -2
- package/dist/{types-DyByb6tW.d.ts → types-cH8oLqUx.d.ts} +2 -2
- 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>;
|
package/dist/content-transfer.js
CHANGED
|
@@ -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
|
|
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:
|
|
695
|
-
id:
|
|
696
|
-
label:
|
|
697
|
-
path: `/${
|
|
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
|
};
|