@nfdi4plants/arctrl 1.0.0-alpha8 → 1.0.0-beta.1
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/ARC.js +5 -6
- package/ISA/ISA/ArcTypes/ArcTable.js +141 -37
- package/ISA/ISA/ArcTypes/ArcTableAux.js +13 -14
- package/ISA/ISA/ArcTypes/ArcTables.js +380 -277
- package/ISA/ISA/ArcTypes/ArcTypes.js +128 -318
- package/ISA/ISA/ArcTypes/CompositeColumn.js +7 -1
- package/ISA/ISA/ArcTypes/CompositeHeader.js +311 -1
- package/ISA/ISA/Helper.js +15 -3
- package/ISA/ISA.Spreadsheet/AnnotationTable/ArcTable.js +17 -15
- package/ISA/ISA.Spreadsheet/AnnotationTable/CompositeCell.js +2 -2
- package/ISA/ISA.Spreadsheet/AnnotationTable/CompositeColumn.js +4 -4
- package/ISA/ISA.Spreadsheet/AnnotationTable/CompositeHeader.js +6 -6
- package/ISA/ISA.Spreadsheet/ArcAssay.js +6 -9
- package/ISA/ISA.Spreadsheet/ArcInvestigation.js +4 -4
- package/ISA/ISA.Spreadsheet/ArcStudy.js +5 -5
- package/ISA/ISA.Spreadsheet/Metadata/SparseTable.js +9 -9
- package/README.md +3 -0
- package/Templates/Template.Json.js +7 -3
- package/Templates/Template.Spreadsheet.js +23 -7
- package/Templates/Template.Web.js +1 -1
- package/Templates/Templates.js +82 -0
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Cells/FsCell.fs +85 -36
- package/fable_modules/FsSpreadsheet.5.0.0/Cells/FsCell.fs.js +272 -0
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/CellBuilder.fs +1 -0
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/CellBuilder.fs.js +18 -18
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Transform.fs +1 -1
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Transform.fs.js +2 -1
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Types.fs +1 -1
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Types.fs.js +4 -4
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsColumn.fs +3 -1
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsRow.fs +2 -0
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsWorksheet.fs +10 -1
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsWorksheet.fs.js +5 -0
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/SheetBuilder.fs +4 -4
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/SheetBuilder.fs.js +3 -3
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Tables/FsTable.fs +20 -4
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Tables/FsTable.fs.js +26 -6
- package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/obj/Release/netstandard2.0/FsSpreadsheet.AssemblyInfo.fs +3 -3
- package/fable_modules/project_cracked.json +1 -1
- package/index.js +1 -0
- package/package.json +1 -1
- package/fable_modules/FsSpreadsheet.4.1.0/Cells/FsCell.fs.js +0 -240
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Cells/FsCellsCollection.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Cells/FsCellsCollection.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/ColumnBuilder.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/ColumnBuilder.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/DSL.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/DSL.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Expression.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Expression.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Operators.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Operators.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/RowBuilder.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/RowBuilder.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/SheetBuilder.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/SheetBuilder.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/TableBuilder.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/TableBuilder.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/WorkbookBuilder.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/WorkbookBuilder.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsAddress.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsAddress.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsColumn.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsRow.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsSpreadsheet.fableproj +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsWorkbook.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsWorkbook.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRange.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRange.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeAddress.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeAddress.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeBase.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeBase.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeColumn.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeColumn.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeRow.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeRow.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Tables/FsTableField.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Tables/FsTableField.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Tables/FsTableRow.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Tables/FsTableRow.fs.js +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/obj/Debug/netstandard2.0/FsSpreadsheet.AssemblyInfo.fs +0 -0
- /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/obj/Release/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +0 -0
package/ARC.js
CHANGED
|
@@ -11,11 +11,11 @@ import { FileSystemTree } from "./FileSystem/FileSystemTree.js";
|
|
|
11
11
|
import { FileSystem } from "./FileSystem/FileSystem.js";
|
|
12
12
|
import { bind, map as map_1, value as value_2, defaultArg, unwrap } from "./fable_modules/fable-library.4.1.4/Option.js";
|
|
13
13
|
import { tryISAReadContractFromPath } from "./Contracts/Contracts.ARCtrl.js";
|
|
14
|
-
import {
|
|
14
|
+
import { ArcTables } from "./ISA/ISA/ArcTypes/ArcTables.js";
|
|
15
15
|
import { addToDict } from "./fable_modules/fable-library.4.1.4/MapUtil.js";
|
|
16
16
|
import { ArcInvestigation } from "./ISA/ISA/ArcTypes/ArcTypes.js";
|
|
17
17
|
import { Assay_fileNameFromIdentifier, Study_fileNameFromIdentifier } from "./ISA/ISA/Identifier.js";
|
|
18
|
-
import { Dictionary_tryGet } from "./fable_modules/FsSpreadsheet.
|
|
18
|
+
import { Dictionary_tryGet } from "./fable_modules/FsSpreadsheet.5.0.0/Cells/FsCellsCollection.fs.js";
|
|
19
19
|
import { Contract } from "./Contract/Contract.js";
|
|
20
20
|
import { Clone_createCloneContract_5000466F, Init_createAddRemoteContract_Z721C83C5, gitignoreContract, Init_createInitContract_6DFDD678 } from "./Contracts/Contracts.Git.js";
|
|
21
21
|
import { FSharpSet__Contains, ofSeq, unionMany } from "./fable_modules/fable-library.4.1.4/Set.js";
|
|
@@ -99,9 +99,8 @@ export class ARC {
|
|
|
99
99
|
const this$ = this;
|
|
100
100
|
return choose(tryISAReadContractFromPath, this$._fs.Tree.ToFilePaths());
|
|
101
101
|
}
|
|
102
|
-
SetISAFromContracts(contracts
|
|
102
|
+
SetISAFromContracts(contracts) {
|
|
103
103
|
const this$ = this;
|
|
104
|
-
const enableLogging_1 = defaultArg(enableLogging, false);
|
|
105
104
|
const investigation = ARCAux_getArcInvestigationFromContracts(contracts);
|
|
106
105
|
const studies = map((tuple) => tuple[0], ARCAux_getArcStudiesFromContracts(contracts));
|
|
107
106
|
const assays = ARCAux_getArcAssaysFromContracts(contracts);
|
|
@@ -127,8 +126,8 @@ export class ARC {
|
|
|
127
126
|
const assay_1 = find((a_1) => (a_1.Identifier === assay.Identifier), investigation.Assays);
|
|
128
127
|
let updatedTables;
|
|
129
128
|
const array_2 = assay_1.StudiesRegisteredIn;
|
|
130
|
-
updatedTables = fold((tables, study_1) =>
|
|
131
|
-
assay_1.Tables =
|
|
129
|
+
updatedTables = fold((tables, study_1) => ArcTables.updateReferenceTablesBySheets(new ArcTables(study_1.Tables), tables, false), new ArcTables(assay_1.Tables), array_2);
|
|
130
|
+
assay_1.Tables = updatedTables.Tables;
|
|
132
131
|
});
|
|
133
132
|
this$.ISA = investigation;
|
|
134
133
|
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { Dictionary } from "../../../fable_modules/fable-library.4.1.4/MutableMap.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { compareArrays, safeHash, disposeSafe, getEnumerator, equals, comparePrimitives, arrayHash, equalArrays } from "../../../fable_modules/fable-library.4.1.4/Util.js";
|
|
3
|
+
import { value as value_9, map as map_2, defaultArg, unwrap } from "../../../fable_modules/fable-library.4.1.4/Option.js";
|
|
4
4
|
import { Unchecked_extendToRowCount, ProcessParsing_processToRows, ProcessParsing_alignByHeaders, ProcessParsing_mergeIdenticalProcesses, ProcessParsing_getProcessGetter, Unchecked_removeRowCells_withIndexChange, Unchecked_addRow, Unchecked_getEmptyCellForHeader, Unchecked_removeColumnCells_withIndexChange, tryFindDuplicateUniqueInArray, Unchecked_removeColumnCells, Unchecked_removeHeader, Unchecked_fillMissingCells, Unchecked_addColumn, tryFindDuplicateUnique, Unchecked_setCellAt, SanityChecks_validateColumn, SanityChecks_validateRowIndex, SanityChecks_validateColumnIndex, Unchecked_tryGetCellAt, getRowCount, getColumnCount } from "./ArcTableAux.js";
|
|
5
|
-
import {
|
|
5
|
+
import { item, append as append_1, indexed as indexed_1, choose, toList, zip, fold, filter, length, tryFindIndex, empty, singleton, collect, removeAt, map, delay, toArray } from "../../../fable_modules/fable-library.4.1.4/Seq.js";
|
|
6
6
|
import { rangeDouble } from "../../../fable_modules/fable-library.4.1.4/Range.js";
|
|
7
7
|
import { CompositeColumn } from "./CompositeColumn.js";
|
|
8
|
-
import { indexed, mapIndexed, singleton as singleton_1, initialize, sortDescending, iterateIndexed, map as map_1 } from "../../../fable_modules/fable-library.4.1.4/Array.js";
|
|
9
|
-
import { append, collect as collect_1, initialize as initialize_1, singleton as singleton_2, empty, iterate, isEmpty } from "../../../fable_modules/fable-library.4.1.4/List.js";
|
|
8
|
+
import { sortBy, indexed, mapIndexed, singleton as singleton_1, initialize, sortDescending, iterateIndexed, map as map_1 } from "../../../fable_modules/fable-library.4.1.4/Array.js";
|
|
9
|
+
import { append, collect as collect_1, initialize as initialize_1, singleton as singleton_2, empty as empty_1, iterate, isEmpty } from "../../../fable_modules/fable-library.4.1.4/List.js";
|
|
10
10
|
import { StringBuilder__AppendLine_Z721C83C5, StringBuilder_$ctor } from "../../../fable_modules/fable-library.4.1.4/System.Text.js";
|
|
11
11
|
import { toString } from "../../../fable_modules/fable-library.4.1.4/Types.js";
|
|
12
|
+
import { join, printf, toFail } from "../../../fable_modules/fable-library.4.1.4/String.js";
|
|
12
13
|
import { CompositeCell } from "./CompositeCell.js";
|
|
13
14
|
import { CompositeHeader } from "./CompositeHeader.js";
|
|
14
15
|
import { createMissingIdentifier } from "../Identifier.js";
|
|
@@ -21,7 +22,7 @@ import { Array_groupBy, List_distinct } from "../../../fable_modules/fable-libra
|
|
|
21
22
|
import { toProtocol } from "./CompositeRow.js";
|
|
22
23
|
import { Process_create_Z42860F3E } from "../JsonTypes/Process.js";
|
|
23
24
|
import { getItemFromDict } from "../../../fable_modules/fable-library.4.1.4/MapUtil.js";
|
|
24
|
-
import {
|
|
25
|
+
import { HashCodes_boxHashArray } from "../Helper.js";
|
|
25
26
|
import { class_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
|
|
26
27
|
|
|
27
28
|
export class ArcTable {
|
|
@@ -79,7 +80,7 @@ export class ArcTable {
|
|
|
79
80
|
let isValid = true;
|
|
80
81
|
for (let columnIndex = 0; columnIndex <= (this$.ColumnCount - 1); columnIndex++) {
|
|
81
82
|
const column = this$.GetColumn(columnIndex);
|
|
82
|
-
isValid = column.
|
|
83
|
+
isValid = column.Validate(unwrap(raiseException));
|
|
83
84
|
}
|
|
84
85
|
return isValid;
|
|
85
86
|
}
|
|
@@ -96,7 +97,7 @@ export class ArcTable {
|
|
|
96
97
|
}
|
|
97
98
|
get Columns() {
|
|
98
99
|
const this$ = this;
|
|
99
|
-
return
|
|
100
|
+
return toArray(delay(() => map((i) => this$.GetColumn(i), rangeDouble(0, 1, this$.ColumnCount - 1))));
|
|
100
101
|
}
|
|
101
102
|
Copy() {
|
|
102
103
|
const this$ = this;
|
|
@@ -136,7 +137,7 @@ export class ArcTable {
|
|
|
136
137
|
throw new Error(`Invalid input. Tried setting unique header \`${header}\`, but header of same type already exists at index ${matchValue}.`);
|
|
137
138
|
}
|
|
138
139
|
const c = new CompositeColumn(newHeader, this$.GetColumn(index).Cells);
|
|
139
|
-
if (c.
|
|
140
|
+
if (c.Validate()) {
|
|
140
141
|
let setHeader;
|
|
141
142
|
setHeader = (this$.Headers[index] = newHeader);
|
|
142
143
|
}
|
|
@@ -169,7 +170,7 @@ export class ArcTable {
|
|
|
169
170
|
const forceReplace_1 = defaultArg(forceReplace, false);
|
|
170
171
|
SanityChecks_validateColumnIndex(index_1, this$.ColumnCount, true);
|
|
171
172
|
SanityChecks_validateColumn(CompositeColumn.create(header, cells_1));
|
|
172
|
-
Unchecked_addColumn(header, cells_1, index_1, forceReplace_1, this$.Headers, this$.Values);
|
|
173
|
+
Unchecked_addColumn(header, cells_1, index_1, forceReplace_1, false, this$.Headers, this$.Values);
|
|
173
174
|
Unchecked_fillMissingCells(this$.Headers, this$.Values);
|
|
174
175
|
}
|
|
175
176
|
static addColumn(header, cells, index, forceReplace) {
|
|
@@ -245,7 +246,7 @@ export class ArcTable {
|
|
|
245
246
|
});
|
|
246
247
|
columns.forEach((col) => {
|
|
247
248
|
const prevHeadersCount = this$.Headers.length | 0;
|
|
248
|
-
Unchecked_addColumn(col.Header, col.Cells, index_1, forceReplace_1, this$.Headers, this$.Values);
|
|
249
|
+
Unchecked_addColumn(col.Header, col.Cells, index_1, forceReplace_1, false, this$.Headers, this$.Values);
|
|
249
250
|
if (this$.Headers.length > prevHeadersCount) {
|
|
250
251
|
index_1 = ((index_1 + 1) | 0);
|
|
251
252
|
}
|
|
@@ -296,26 +297,83 @@ export class ArcTable {
|
|
|
296
297
|
const this$ = this;
|
|
297
298
|
SanityChecks_validateColumnIndex(columnIndex, this$.ColumnCount, false);
|
|
298
299
|
const h = this$.Headers[columnIndex];
|
|
299
|
-
const cells = toArray(delay(() =>
|
|
300
|
+
const cells = toArray(delay(() => collect((i) => {
|
|
301
|
+
const matchValue = this$.TryGetCellAt(columnIndex, i);
|
|
302
|
+
if (matchValue != null) {
|
|
303
|
+
return singleton(matchValue);
|
|
304
|
+
}
|
|
305
|
+
else {
|
|
306
|
+
toFail(printf("Unable to find cell for index: (%i, %i)"))(columnIndex)(i);
|
|
307
|
+
return empty();
|
|
308
|
+
}
|
|
309
|
+
}, rangeDouble(0, 1, this$.RowCount - 1))));
|
|
300
310
|
return CompositeColumn.create(h, cells);
|
|
301
311
|
}
|
|
302
312
|
static getColumn(index) {
|
|
303
313
|
return (table) => table.GetColumn(index);
|
|
304
314
|
}
|
|
315
|
+
TryGetColumnByHeader(header) {
|
|
316
|
+
const this$ = this;
|
|
317
|
+
return map_2((i) => this$.GetColumn(i), tryFindIndex((x) => equals(x, header), this$.Headers));
|
|
318
|
+
}
|
|
319
|
+
static tryGetColumnByHeader(header) {
|
|
320
|
+
return (table) => table.TryGetColumnByHeader(header);
|
|
321
|
+
}
|
|
305
322
|
GetColumnByHeader(header) {
|
|
306
323
|
const this$ = this;
|
|
307
|
-
const
|
|
308
|
-
|
|
324
|
+
const matchValue = this$.TryGetColumnByHeader(header);
|
|
325
|
+
if (matchValue == null) {
|
|
326
|
+
const arg = this$.Name;
|
|
327
|
+
return toFail(printf("Unable to find column with header in table %s: %O"))(arg)(header);
|
|
328
|
+
}
|
|
329
|
+
else {
|
|
330
|
+
return matchValue;
|
|
331
|
+
}
|
|
309
332
|
}
|
|
310
333
|
static getColumnByHeader(header) {
|
|
311
334
|
return (table) => table.GetColumnByHeader(header);
|
|
312
335
|
}
|
|
313
|
-
|
|
336
|
+
TryGetInputColumn() {
|
|
314
337
|
const this$ = this;
|
|
315
|
-
return map_2((i) => this$.GetColumn(i), tryFindIndex((x) =>
|
|
338
|
+
return map_2((i) => this$.GetColumn(i), tryFindIndex((x) => x.isInput, this$.Headers));
|
|
316
339
|
}
|
|
317
|
-
static
|
|
318
|
-
return (table) => table.
|
|
340
|
+
static tryGetInputColumn() {
|
|
341
|
+
return (table) => table.TryGetInputColumn();
|
|
342
|
+
}
|
|
343
|
+
GetInputColumn() {
|
|
344
|
+
const this$ = this;
|
|
345
|
+
const matchValue = this$.TryGetInputColumn();
|
|
346
|
+
if (matchValue == null) {
|
|
347
|
+
const arg = this$.Name;
|
|
348
|
+
return toFail(printf("Unable to find input column in table %s"))(arg);
|
|
349
|
+
}
|
|
350
|
+
else {
|
|
351
|
+
return matchValue;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
static getInputColumn() {
|
|
355
|
+
return (table) => table.GetInputColumn();
|
|
356
|
+
}
|
|
357
|
+
TryGetOutputColumn() {
|
|
358
|
+
const this$ = this;
|
|
359
|
+
return map_2((i) => this$.GetColumn(i), tryFindIndex((x) => x.isOutput, this$.Headers));
|
|
360
|
+
}
|
|
361
|
+
static tryGetOutputColumn() {
|
|
362
|
+
return (table) => table.TryGetOutputColumn();
|
|
363
|
+
}
|
|
364
|
+
GetOutputColumn() {
|
|
365
|
+
const this$ = this;
|
|
366
|
+
const matchValue = this$.TryGetOutputColumn();
|
|
367
|
+
if (matchValue == null) {
|
|
368
|
+
const arg = this$.Name;
|
|
369
|
+
return toFail(printf("Unable to find output column in table %s"))(arg);
|
|
370
|
+
}
|
|
371
|
+
else {
|
|
372
|
+
return matchValue;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
static getOutputColumn() {
|
|
376
|
+
return (table) => table.GetOutputColumn();
|
|
319
377
|
}
|
|
320
378
|
AddRow(cells, index) {
|
|
321
379
|
const this$ = this;
|
|
@@ -476,6 +534,51 @@ export class ArcTable {
|
|
|
476
534
|
static getRow(index) {
|
|
477
535
|
return (table) => table.GetRow(index);
|
|
478
536
|
}
|
|
537
|
+
Join(table, joinOptions, forceReplace) {
|
|
538
|
+
const this$ = this;
|
|
539
|
+
const joinOptions_1 = defaultArg(joinOptions, "headers");
|
|
540
|
+
const forceReplace_1 = defaultArg(forceReplace, false);
|
|
541
|
+
const onlyHeaders = joinOptions_1 === "headers";
|
|
542
|
+
let columns;
|
|
543
|
+
const pre = table.Columns;
|
|
544
|
+
columns = ((joinOptions_1 === "withUnit") ? map_1((c_1) => {
|
|
545
|
+
const unitsOpt = c_1.TryGetColumnUnits();
|
|
546
|
+
if (unitsOpt == null) {
|
|
547
|
+
return new CompositeColumn(c_1.Header, []);
|
|
548
|
+
}
|
|
549
|
+
else {
|
|
550
|
+
return new CompositeColumn(c_1.Header, map_1((u) => CompositeCell.createUnitized("", u), unitsOpt));
|
|
551
|
+
}
|
|
552
|
+
}, pre) : ((joinOptions_1 === "withValues") ? pre : map_1((c) => (new CompositeColumn(c.Header, [])), pre)));
|
|
553
|
+
const duplicates = tryFindDuplicateUniqueInArray(map((x) => x.Header, columns));
|
|
554
|
+
if (!isEmpty(duplicates)) {
|
|
555
|
+
const sb = StringBuilder_$ctor();
|
|
556
|
+
StringBuilder__AppendLine_Z721C83C5(sb, "Found duplicate unique columns in `columns`.");
|
|
557
|
+
iterate((x_1) => {
|
|
558
|
+
StringBuilder__AppendLine_Z721C83C5(sb, `Duplicate \`${x_1.HeaderType}\` at index ${x_1.Index1} and ${x_1.Index2}.`);
|
|
559
|
+
}, duplicates);
|
|
560
|
+
throw new Error(toString(sb));
|
|
561
|
+
}
|
|
562
|
+
columns.forEach((x_2) => {
|
|
563
|
+
SanityChecks_validateColumn(x_2);
|
|
564
|
+
});
|
|
565
|
+
let index = this$.ColumnCount;
|
|
566
|
+
columns.forEach((col) => {
|
|
567
|
+
const prevHeadersCount = this$.Headers.length | 0;
|
|
568
|
+
Unchecked_addColumn(col.Header, col.Cells, index, forceReplace_1, onlyHeaders, this$.Headers, this$.Values);
|
|
569
|
+
if (this$.Headers.length > prevHeadersCount) {
|
|
570
|
+
index = ((index + 1) | 0);
|
|
571
|
+
}
|
|
572
|
+
});
|
|
573
|
+
Unchecked_fillMissingCells(this$.Headers, this$.Values);
|
|
574
|
+
}
|
|
575
|
+
static join(table, joinOptions, forceReplace) {
|
|
576
|
+
return (this$) => {
|
|
577
|
+
const copy = this$.Copy();
|
|
578
|
+
copy.Join(table, unwrap(joinOptions), unwrap(forceReplace));
|
|
579
|
+
return copy;
|
|
580
|
+
};
|
|
581
|
+
}
|
|
479
582
|
static insertParameterValue(t, p) {
|
|
480
583
|
throw new Error();
|
|
481
584
|
}
|
|
@@ -537,7 +640,7 @@ export class ArcTable {
|
|
|
537
640
|
}
|
|
538
641
|
static fromProtocol(p) {
|
|
539
642
|
const t = ArcTable.init(defaultArg(p.Name, createMissingIdentifier()));
|
|
540
|
-
const enumerator = getEnumerator(defaultArg(p.Parameters,
|
|
643
|
+
const enumerator = getEnumerator(defaultArg(p.Parameters, empty_1()));
|
|
541
644
|
try {
|
|
542
645
|
while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
|
|
543
646
|
const pp = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
@@ -547,7 +650,7 @@ export class ArcTable {
|
|
|
547
650
|
finally {
|
|
548
651
|
disposeSafe(enumerator);
|
|
549
652
|
}
|
|
550
|
-
const enumerator_1 = getEnumerator(defaultArg(p.Components,
|
|
653
|
+
const enumerator_1 = getEnumerator(defaultArg(p.Components, empty_1()));
|
|
551
654
|
try {
|
|
552
655
|
while (enumerator_1["System.Collections.IEnumerator.MoveNext"]()) {
|
|
553
656
|
const c = enumerator_1["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
@@ -666,15 +769,10 @@ export class ArcTable {
|
|
|
666
769
|
}, indexed_1(refTable_1.Headers)));
|
|
667
770
|
refTable_1.RemoveColumns(nonProtocolColumns);
|
|
668
771
|
Unchecked_extendToRowCount(annotationTable_1.RowCount, refTable_1.Headers, refTable_1.Values);
|
|
669
|
-
const
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
refTable_1.AddColumn(c.Header, c.Cells, void 0, true);
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
finally {
|
|
677
|
-
disposeSafe(enumerator);
|
|
772
|
+
const arr = annotationTable_1.Columns;
|
|
773
|
+
for (let idx = 0; idx <= (arr.length - 1); idx++) {
|
|
774
|
+
const c = arr[idx];
|
|
775
|
+
refTable_1.AddColumn(c.Header, c.Cells, void 0, true);
|
|
678
776
|
}
|
|
679
777
|
return refTable_1;
|
|
680
778
|
}
|
|
@@ -690,6 +788,9 @@ export class ArcTable {
|
|
|
690
788
|
StructurallyEquals(other) {
|
|
691
789
|
let a, b;
|
|
692
790
|
const this$ = this;
|
|
791
|
+
const sort = (arg) => sortBy((_arg) => _arg[0], Array.from(arg), {
|
|
792
|
+
Compare: compareArrays,
|
|
793
|
+
});
|
|
693
794
|
if ((this$.Name === other.Name) && ((a = this$.Headers, (b = other.Headers, (length(a) === length(b)) && fold((acc, e) => {
|
|
694
795
|
if (acc) {
|
|
695
796
|
return e;
|
|
@@ -698,12 +799,8 @@ export class ArcTable {
|
|
|
698
799
|
return false;
|
|
699
800
|
}
|
|
700
801
|
}, true, toList(delay(() => map((i) => equals(item(i, a), item(i, b)), rangeDouble(0, 1, length(a) - 1))))))))) {
|
|
701
|
-
const a_1 =
|
|
702
|
-
|
|
703
|
-
});
|
|
704
|
-
const b_1 = sortBy((x_2) => x_2[0], other.Values, {
|
|
705
|
-
Compare: compareArrays,
|
|
706
|
-
});
|
|
802
|
+
const a_1 = sort(this$.Values);
|
|
803
|
+
const b_1 = sort(other.Values);
|
|
707
804
|
return (length(a_1) === length(b_1)) && fold((acc_1, e_1) => {
|
|
708
805
|
if (acc_1) {
|
|
709
806
|
return e_1;
|
|
@@ -728,9 +825,16 @@ export class ArcTable {
|
|
|
728
825
|
}
|
|
729
826
|
GetHashCode() {
|
|
730
827
|
const this$ = this;
|
|
731
|
-
|
|
828
|
+
const v_2 = map_1((tupledArg) => {
|
|
829
|
+
const _arg = tupledArg[0];
|
|
830
|
+
return HashCodes_boxHashArray([_arg[0], _arg[1], tupledArg[1]]);
|
|
831
|
+
}, sortBy((tuple) => tuple[0], toArray(delay(() => collect((matchValue) => {
|
|
832
|
+
const activePatternResult = matchValue;
|
|
833
|
+
return singleton([activePatternResult[0], activePatternResult[1]]);
|
|
834
|
+
}, this$.Values))), {
|
|
732
835
|
Compare: compareArrays,
|
|
733
|
-
}))
|
|
836
|
+
}));
|
|
837
|
+
return HashCodes_boxHashArray([this$.Name, HashCodes_boxHashArray(Array.from(this$.Headers)), HashCodes_boxHashArray(Array.from(v_2))]) | 0;
|
|
734
838
|
}
|
|
735
839
|
}
|
|
736
840
|
|
|
@@ -179,7 +179,7 @@ export function SanityChecks_validateRowIndex(index, rowCount, allowAppend) {
|
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
export function SanityChecks_validateColumn(column) {
|
|
182
|
-
column.
|
|
182
|
+
column.Validate(true);
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
export function Unchecked_tryGetCellAt(column, row, cells) {
|
|
@@ -312,7 +312,10 @@ export function Unchecked_getEmptyCellForHeader(header, columCellOption) {
|
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
|
|
315
|
-
|
|
315
|
+
/**
|
|
316
|
+
*
|
|
317
|
+
*/
|
|
318
|
+
export function Unchecked_addColumn(newHeader, newCells, index, forceReplace, onlyHeaders, headers, values) {
|
|
316
319
|
let numberOfNewColumns = 1;
|
|
317
320
|
let index_1 = index;
|
|
318
321
|
const hasDuplicateUnique = tryFindDuplicateUnique(newHeader, headers);
|
|
@@ -326,12 +329,10 @@ export function Unchecked_addColumn(newHeader, newCells, index, forceReplace, he
|
|
|
326
329
|
const matchValue = getColumnCount(headers) | 0;
|
|
327
330
|
const matchValue_1 = getRowCount(values) | 0;
|
|
328
331
|
const startColCount = matchValue | 0;
|
|
329
|
-
let setNewHeader;
|
|
330
332
|
if (hasDuplicateUnique != null) {
|
|
331
333
|
Unchecked_removeHeader(index_1, headers);
|
|
332
334
|
}
|
|
333
|
-
|
|
334
|
-
let increaseColumnIndices;
|
|
335
|
+
headers.splice(index_1, 0, newHeader);
|
|
335
336
|
if ((index_1 < startColCount) && (hasDuplicateUnique == null)) {
|
|
336
337
|
const lastColumnIndex = max(startColCount - 1, 0) | 0;
|
|
337
338
|
for (let columnIndex = lastColumnIndex; columnIndex >= index_1; columnIndex--) {
|
|
@@ -340,16 +341,14 @@ export function Unchecked_addColumn(newHeader, newCells, index, forceReplace, he
|
|
|
340
341
|
}
|
|
341
342
|
}
|
|
342
343
|
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
344
|
+
if (!onlyHeaders) {
|
|
345
|
+
if (hasDuplicateUnique != null) {
|
|
346
|
+
Unchecked_removeColumnCells(index_1, values);
|
|
347
|
+
}
|
|
348
|
+
iterateIndexed((rowIndex_1, cell) => {
|
|
349
|
+
Unchecked_setCellAt(index_1, rowIndex_1, cell, values);
|
|
350
|
+
}, newCells);
|
|
349
351
|
}
|
|
350
|
-
setNewCells = iterateIndexed((rowIndex_1, cell) => {
|
|
351
|
-
Unchecked_setCellAt(index_1, rowIndex_1, cell, values);
|
|
352
|
-
}, newCells);
|
|
353
352
|
}
|
|
354
353
|
|
|
355
354
|
export function Unchecked_fillMissingCells(headers, values) {
|