@lavalogic/scoria 0.3.6 → 0.3.7
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.
|
@@ -1175,10 +1175,11 @@ export class TableContext {
|
|
|
1175
1175
|
const value = await (async () => {
|
|
1176
1176
|
const selectColumns = new Map();
|
|
1177
1177
|
for (let i = affectedColumns.length - 1; i > -1; i--) {
|
|
1178
|
-
const
|
|
1179
|
-
if (
|
|
1178
|
+
const columnDef = affectedColumns[i];
|
|
1179
|
+
if (columnDef instanceof SelectDef) {
|
|
1180
1180
|
const item = items[i];
|
|
1181
|
-
selectColumns.set(i, await (
|
|
1181
|
+
selectColumns.set(i, await (columnDef.getSpecificOptions?.(item, indicesByItem.get(item)) ??
|
|
1182
|
+
columnDef.getOptions()));
|
|
1182
1183
|
}
|
|
1183
1184
|
}
|
|
1184
1185
|
const separator = this.commaSeparatedCopy ? ',' : '\t';
|
|
@@ -1748,16 +1749,17 @@ export class TableContext {
|
|
|
1748
1749
|
const targetRow = selectedCells[rowIndex];
|
|
1749
1750
|
const colLength = affectedColumns.length;
|
|
1750
1751
|
for (let colIndex = 0; colIndex < colLength; colIndex++) {
|
|
1751
|
-
const
|
|
1752
|
-
if (
|
|
1752
|
+
const columnDef = affectedColumns[colIndex];
|
|
1753
|
+
if (columnDef instanceof RowSelectionDef) {
|
|
1753
1754
|
targetRow.push(key !== undefined && this.selectedItems.has(key) ? 'true' : 'false');
|
|
1754
1755
|
continue;
|
|
1755
1756
|
}
|
|
1756
|
-
if (uncopyableColumns.has(
|
|
1757
|
+
if (uncopyableColumns.has(columnDef.columnType)) {
|
|
1757
1758
|
continue;
|
|
1758
1759
|
}
|
|
1759
|
-
const x = (await
|
|
1760
|
-
('accessorFn' in
|
|
1760
|
+
const x = (await columnDef.getDisplayValue?.(item, this.sortedData.lastIndexOf(item))) ||
|
|
1761
|
+
('accessorFn' in columnDef &&
|
|
1762
|
+
(await columnDef.accessorFn?.(item, this.sortedData.indexOf(item))));
|
|
1761
1763
|
if (x && typeof x === 'string') {
|
|
1762
1764
|
targetRow.push(x);
|
|
1763
1765
|
continue;
|
|
@@ -1766,7 +1768,7 @@ export class TableContext {
|
|
|
1766
1768
|
targetRow.push(x.join(', '));
|
|
1767
1769
|
continue;
|
|
1768
1770
|
}
|
|
1769
|
-
const toCopy =
|
|
1771
|
+
const toCopy = columnDef.id && columnDef.id in item ? item[columnDef.id] : null;
|
|
1770
1772
|
const y = toCopy && typeof toCopy === 'object' && toCopy instanceof Date
|
|
1771
1773
|
? toCopy.toLocaleDateString()
|
|
1772
1774
|
: (toCopy?.toString() ?? '');
|
|
@@ -1820,13 +1822,17 @@ export class TableContext {
|
|
|
1820
1822
|
const targetRow = selectedCells[rowIndex];
|
|
1821
1823
|
const colLength = affectedColumns.length;
|
|
1822
1824
|
for (let colIndex = 0; colIndex < colLength; colIndex++) {
|
|
1823
|
-
const
|
|
1824
|
-
if (
|
|
1825
|
+
const columnDef = affectedColumns[colIndex];
|
|
1826
|
+
if (columnDef instanceof RowSelectionDef) {
|
|
1825
1827
|
targetRow.push(key !== undefined && this.selectedItems.has(key) ? 'true' : 'false');
|
|
1826
1828
|
continue;
|
|
1827
1829
|
}
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
+
if (uncopyableColumns.has(columnDef.columnType)) {
|
|
1831
|
+
continue;
|
|
1832
|
+
}
|
|
1833
|
+
const x = (await columnDef.getDisplayValue?.(item, this.sortedData.lastIndexOf(item))) ||
|
|
1834
|
+
('accessorFn' in columnDef &&
|
|
1835
|
+
(await columnDef.accessorFn?.(item, this.sortedData.indexOf(item))));
|
|
1830
1836
|
if (x && typeof x === 'string') {
|
|
1831
1837
|
targetRow.push(x);
|
|
1832
1838
|
continue;
|
|
@@ -1835,7 +1841,7 @@ export class TableContext {
|
|
|
1835
1841
|
targetRow.push(x.join(', '));
|
|
1836
1842
|
continue;
|
|
1837
1843
|
}
|
|
1838
|
-
const toCopy =
|
|
1844
|
+
const toCopy = columnDef.id && columnDef.id in item ? item[columnDef.id] : null;
|
|
1839
1845
|
const y = toCopy && typeof toCopy === 'object' && toCopy instanceof Date
|
|
1840
1846
|
? toCopy.toLocaleDateString()
|
|
1841
1847
|
: (toCopy?.toString() ?? '');
|