@nfdi4plants/arctrl 1.0.0-alpha9 → 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.
Files changed (76) hide show
  1. package/ARC.js +5 -6
  2. package/ISA/ISA/ArcTypes/ArcTables.js +275 -271
  3. package/ISA/ISA/ArcTypes/ArcTypes.js +29 -313
  4. package/ISA/ISA.Spreadsheet/AnnotationTable/ArcTable.js +15 -13
  5. package/ISA/ISA.Spreadsheet/AnnotationTable/CompositeCell.js +2 -2
  6. package/ISA/ISA.Spreadsheet/AnnotationTable/CompositeColumn.js +4 -4
  7. package/ISA/ISA.Spreadsheet/AnnotationTable/CompositeHeader.js +6 -6
  8. package/ISA/ISA.Spreadsheet/ArcAssay.js +6 -9
  9. package/ISA/ISA.Spreadsheet/ArcInvestigation.js +4 -4
  10. package/ISA/ISA.Spreadsheet/ArcStudy.js +5 -5
  11. package/ISA/ISA.Spreadsheet/Metadata/SparseTable.js +9 -9
  12. package/README.md +3 -0
  13. package/Templates/Template.Json.js +5 -2
  14. package/Templates/Template.Spreadsheet.js +23 -7
  15. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Cells/FsCell.fs +85 -36
  16. package/fable_modules/FsSpreadsheet.5.0.0/Cells/FsCell.fs.js +272 -0
  17. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/CellBuilder.fs +1 -0
  18. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/CellBuilder.fs.js +18 -18
  19. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Transform.fs +1 -1
  20. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Transform.fs.js +2 -1
  21. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Types.fs +1 -1
  22. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Types.fs.js +4 -4
  23. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsColumn.fs +3 -1
  24. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsRow.fs +2 -0
  25. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsWorksheet.fs +10 -1
  26. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsWorksheet.fs.js +5 -0
  27. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/SheetBuilder.fs +4 -4
  28. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/SheetBuilder.fs.js +3 -3
  29. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Tables/FsTable.fs +20 -4
  30. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Tables/FsTable.fs.js +26 -6
  31. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/obj/Release/netstandard2.0/FsSpreadsheet.AssemblyInfo.fs +3 -3
  32. package/fable_modules/project_cracked.json +1 -1
  33. package/package.json +1 -1
  34. package/fable_modules/FsSpreadsheet.4.1.0/Cells/FsCell.fs.js +0 -240
  35. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Cells/FsCellsCollection.fs +0 -0
  36. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Cells/FsCellsCollection.fs.js +0 -0
  37. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/ColumnBuilder.fs +0 -0
  38. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/ColumnBuilder.fs.js +0 -0
  39. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/DSL.fs +0 -0
  40. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/DSL.fs.js +0 -0
  41. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Expression.fs +0 -0
  42. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Expression.fs.js +0 -0
  43. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Operators.fs +0 -0
  44. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Operators.fs.js +0 -0
  45. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/RowBuilder.fs +0 -0
  46. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/RowBuilder.fs.js +0 -0
  47. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/SheetBuilder.fs +0 -0
  48. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/SheetBuilder.fs.js +0 -0
  49. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/TableBuilder.fs +0 -0
  50. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/TableBuilder.fs.js +0 -0
  51. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/WorkbookBuilder.fs +0 -0
  52. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/WorkbookBuilder.fs.js +0 -0
  53. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsAddress.fs +0 -0
  54. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsAddress.fs.js +0 -0
  55. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsColumn.fs.js +0 -0
  56. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsRow.fs.js +0 -0
  57. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsSpreadsheet.fableproj +0 -0
  58. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsWorkbook.fs +0 -0
  59. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsWorkbook.fs.js +0 -0
  60. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRange.fs +0 -0
  61. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRange.fs.js +0 -0
  62. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeAddress.fs +0 -0
  63. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeAddress.fs.js +0 -0
  64. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeBase.fs +0 -0
  65. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeBase.fs.js +0 -0
  66. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeColumn.fs +0 -0
  67. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeColumn.fs.js +0 -0
  68. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeRow.fs +0 -0
  69. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeRow.fs.js +0 -0
  70. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Tables/FsTableField.fs +0 -0
  71. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Tables/FsTableField.fs.js +0 -0
  72. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Tables/FsTableRow.fs +0 -0
  73. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Tables/FsTableRow.fs.js +0 -0
  74. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +0 -0
  75. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/obj/Debug/netstandard2.0/FsSpreadsheet.AssemblyInfo.fs +0 -0
  76. /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 { ArcTables__get_Tables, ArcTables_$ctor_Z18C2F36D, ArcTables_updateReferenceTablesBySheets_Z2EE88E97 } from "./ISA/ISA/ArcTypes/ArcTables.js";
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.4.1.0/Cells/FsCellsCollection.fs.js";
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, enableLogging) {
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) => ArcTables_updateReferenceTablesBySheets_Z2EE88E97(ArcTables_$ctor_Z18C2F36D(study_1.Tables), tables, false), ArcTables_$ctor_Z18C2F36D(assay_1.Tables), array_2);
131
- assay_1.Tables = ArcTables__get_Tables(updatedTables);
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,17 +1,17 @@
1
1
  import { append, toArray, reduce, choose, map as map_1, delay, toList, length, findIndex, tryFindIndex } from "../../../fable_modules/fable-library.4.1.4/Seq.js";
2
2
  import { Dict_tryFind } from "../Helper.js";
3
3
  import { addToSet, addToDict } from "../../../fable_modules/fable-library.4.1.4/MapUtil.js";
4
- import { equals, comparePrimitives, stringHash, compare, disposeSafe, getEnumerator } from "../../../fable_modules/fable-library.4.1.4/Util.js";
4
+ import { toIterator, equals, comparePrimitives, stringHash, compare, disposeSafe, getEnumerator } from "../../../fable_modules/fable-library.4.1.4/Util.js";
5
5
  import { bind, map as map_3, unwrap, defaultArg, value as value_2 } from "../../../fable_modules/fable-library.4.1.4/Option.js";
6
6
  import { collect as collect_1, map as map_4, insertRangeInPlace, fold } from "../../../fable_modules/fable-library.4.1.4/Array.js";
7
7
  import { CompositeHeader } from "./CompositeHeader.js";
8
8
  import { Array_groupBy, distinct } from "../../../fable_modules/fable-library.4.1.4/Seq2.js";
9
9
  import { FSharpSet__get_IsEmpty, ofSeq, intersect } from "../../../fable_modules/fable-library.4.1.4/Set.js";
10
- import { class_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
11
10
  import { ArcTable } from "./ArcTable.js";
12
11
  import { map as map_2, collect } from "../../../fable_modules/fable-library.4.1.4/List.js";
13
12
  import { Unchecked_fillMissingCells, ProcessParsing_groupProcesses, ProcessParsing_processToRows, ProcessParsing_alignByHeaders } from "./ArcTableAux.js";
14
13
  import { tryFind, ofSeq as ofSeq_1 } from "../../../fable_modules/fable-library.4.1.4/Map.js";
14
+ import { class_type } from "../../../fable_modules/fable-library.4.1.4/Reflection.js";
15
15
 
16
16
  /**
17
17
  * If a table with the given name exists in the TableList, returns it, else returns None.
@@ -199,281 +199,285 @@ export function ArcTablesAux_SanityChecks_validateNewNamesUnique(newNames, exist
199
199
  }
200
200
 
201
201
  export class ArcTables {
202
- constructor(thisTables) {
203
- this.thisTables = thisTables;
202
+ constructor(initTables) {
203
+ this["Tables@"] = initTables;
204
204
  }
205
- }
206
-
207
- export function ArcTables_$reflection() {
208
- return class_type("ARCtrl.ISA.ArcTables", void 0, ArcTables);
209
- }
210
-
211
- export function ArcTables_$ctor_Z18C2F36D(thisTables) {
212
- return new ArcTables(thisTables);
213
- }
214
-
215
- export function ArcTables__get_Count(this$) {
216
- return this$.thisTables.length;
217
- }
218
-
219
- export function ArcTables__get_TableNames(this$) {
220
- return toList(delay(() => map_1((s) => s.Name, this$.thisTables)));
221
- }
222
-
223
- export function ArcTables__get_Tables(this$) {
224
- return this$.thisTables;
225
- }
226
-
227
- export function ArcTables__get_Item_Z524259A4(this$, index) {
228
- return this$.thisTables[index];
229
- }
230
-
231
- export function ArcTables__AddTable_EC12B15(this$, table, index) {
232
- const index_1 = defaultArg(index, ArcTables__get_Count(this$)) | 0;
233
- ArcTablesAux_SanityChecks_validateSheetIndex(index_1, true, this$.thisTables);
234
- ArcTablesAux_SanityChecks_validateNewNameUnique(table.Name, ArcTables__get_TableNames(this$));
235
- this$.thisTables.splice(index_1, 0, table);
236
- }
237
-
238
- export function ArcTables__AddTables_Z2D453886(this$, tables, index) {
239
- const index_1 = defaultArg(index, ArcTables__get_Count(this$)) | 0;
240
- ArcTablesAux_SanityChecks_validateSheetIndex(index_1, true, this$.thisTables);
241
- ArcTablesAux_SanityChecks_validateNewNamesUnique(map_1((x) => x.Name, tables), ArcTables__get_TableNames(this$));
242
- insertRangeInPlace(index_1, tables, this$.thisTables);
243
- }
244
-
245
- export function ArcTables__InitTable_3B406CA4(this$, tableName, index) {
246
- const index_1 = defaultArg(index, ArcTables__get_Count(this$)) | 0;
247
- const table = ArcTable.init(tableName);
248
- ArcTablesAux_SanityChecks_validateSheetIndex(index_1, true, this$.thisTables);
249
- ArcTablesAux_SanityChecks_validateNewNameUnique(table.Name, ArcTables__get_TableNames(this$));
250
- this$.thisTables.splice(index_1, 0, table);
251
- return table;
252
- }
253
-
254
- export function ArcTables__InitTables_7B28792B(this$, tableNames, index) {
255
- const index_1 = defaultArg(index, ArcTables__get_Count(this$)) | 0;
256
- const tables = map_1((x) => ArcTable.init(x), tableNames);
257
- ArcTablesAux_SanityChecks_validateSheetIndex(index_1, true, this$.thisTables);
258
- ArcTablesAux_SanityChecks_validateNewNamesUnique(map_1((x_1) => x_1.Name, tables), ArcTables__get_TableNames(this$));
259
- insertRangeInPlace(index_1, tables, this$.thisTables);
260
- }
261
-
262
- export function ArcTables__GetTableAt_Z524259A4(this$, index) {
263
- ArcTablesAux_SanityChecks_validateSheetIndex(index, false, this$.thisTables);
264
- return this$.thisTables[index];
265
- }
266
-
267
- export function ArcTables__GetTable_Z721C83C5(this$, name) {
268
- return ArcTables__GetTableAt_Z524259A4(this$, ArcTablesAux_findIndexByTableName(name, this$.thisTables));
269
- }
270
-
271
- export function ArcTables__UpdateTableAt_7E571736(this$, index, table) {
272
- ArcTablesAux_SanityChecks_validateSheetIndex(index, false, this$.thisTables);
273
- ArcTablesAux_SanityChecks_validateNewNameAtUnique(index, table.Name, ArcTables__get_TableNames(this$));
274
- this$.thisTables[index] = table;
275
- }
276
-
277
- export function ArcTables__UpdateTable_51766571(this$, name, table) {
278
- const tupledArg = [ArcTablesAux_findIndexByTableName(name, this$.thisTables), table];
279
- ArcTables__UpdateTableAt_7E571736(this$, tupledArg[0], tupledArg[1]);
280
- }
281
-
282
- export function ArcTables__SetTableAt_7E571736(this$, index, table) {
283
- ArcTablesAux_SanityChecks_validateSheetIndex(index, true, this$.thisTables);
284
- ArcTablesAux_SanityChecks_validateNewNameAtUnique(index, table.Name, ArcTables__get_TableNames(this$));
285
- this$.thisTables[index] = table;
286
- }
287
-
288
- export function ArcTables__SetTable_51766571(this$, name, table) {
289
- const matchValue = ArcTablesAux_tryFindIndexByTableName(name, this$.thisTables);
290
- if (matchValue == null) {
291
- ArcTables__AddTable_EC12B15(this$, table);
205
+ get Tables() {
206
+ const __ = this;
207
+ return __["Tables@"];
292
208
  }
293
- else {
294
- ArcTables__SetTableAt_7E571736(this$, matchValue, table);
209
+ set Tables(v) {
210
+ const __ = this;
211
+ __["Tables@"] = v;
295
212
  }
296
- }
297
-
298
- export function ArcTables__RemoveTableAt_Z524259A4(this$, index) {
299
- ArcTablesAux_SanityChecks_validateSheetIndex(index, false, this$.thisTables);
300
- this$.thisTables.splice(index, 1);
301
- }
302
-
303
- export function ArcTables__RemoveTable_Z721C83C5(this$, name) {
304
- ArcTables__RemoveTableAt_Z524259A4(this$, ArcTablesAux_findIndexByTableName(name, this$.thisTables));
305
- }
306
-
307
- export function ArcTables__MapTableAt_8FC095C(this$, index, updateFun) {
308
- ArcTablesAux_SanityChecks_validateSheetIndex(index, false, this$.thisTables);
309
- updateFun(this$.thisTables[index]);
310
- }
311
-
312
- export function ArcTables__MapTable_27DD7B1B(this$, name, updateFun) {
313
- const tupledArg = [ArcTablesAux_findIndexByTableName(name, this$.thisTables), updateFun];
314
- ArcTables__MapTableAt_8FC095C(this$, tupledArg[0], tupledArg[1]);
315
- }
316
-
317
- export function ArcTables__RenameTableAt_Z176EF219(this$, index, newName) {
318
- ArcTablesAux_SanityChecks_validateSheetIndex(index, false, this$.thisTables);
319
- ArcTablesAux_SanityChecks_validateNewNameUnique(newName, ArcTables__get_TableNames(this$));
320
- const table = ArcTables__GetTableAt_Z524259A4(this$, index);
321
- table.Name = newName;
322
- }
323
-
324
- export function ArcTables__RenameTable_Z384F8060(this$, name, newName) {
325
- const tupledArg = [ArcTablesAux_findIndexByTableName(name, this$.thisTables), newName];
326
- ArcTables__RenameTableAt_Z176EF219(this$, tupledArg[0], tupledArg[1]);
327
- }
328
-
329
- export function ArcTables__AddColumnAt_6A9784DB(this$, tableIndex, header, cells, columnIndex, forceReplace) {
330
- ArcTables__MapTableAt_8FC095C(this$, tableIndex, (table) => {
331
- table.AddColumn(header, unwrap(cells), unwrap(columnIndex), unwrap(forceReplace));
332
- });
333
- }
334
-
335
- export function ArcTables__AddColumn_1FF50D3C(this$, tableName, header, cells, columnIndex, forceReplace) {
336
- ArcTables__AddColumnAt_6A9784DB(this$, ArcTablesAux_findIndexByTableName(tableName, this$.thisTables), header, unwrap(cells), unwrap(columnIndex), unwrap(forceReplace));
337
- }
338
-
339
- export function ArcTables__RemoveColumnAt_Z37302880(this$, tableIndex, columnIndex) {
340
- ArcTables__MapTableAt_8FC095C(this$, tableIndex, (table) => {
341
- table.RemoveColumn(columnIndex);
342
- });
343
- }
344
-
345
- export function ArcTables__RemoveColumn_Z18115A39(this$, tableName, columnIndex) {
346
- const tupledArg = [ArcTablesAux_findIndexByTableName(tableName, this$.thisTables), columnIndex];
347
- ArcTables__RemoveColumnAt_Z37302880(this$, tupledArg[0], tupledArg[1]);
348
- }
349
-
350
- export function ArcTables__UpdateColumnAt_21300791(this$, tableIndex, columnIndex, header, cells) {
351
- ArcTables__MapTableAt_8FC095C(this$, tableIndex, (table) => {
352
- table.UpdateColumn(columnIndex, header, unwrap(cells));
353
- });
354
- }
355
-
356
- export function ArcTables__UpdateColumn_Z6083042A(this$, tableName, columnIndex, header, cells) {
357
- ArcTables__UpdateColumnAt_21300791(this$, ArcTablesAux_findIndexByTableName(tableName, this$.thisTables), columnIndex, header, unwrap(cells));
358
- }
359
-
360
- export function ArcTables__GetColumnAt_Z37302880(this$, tableIndex, columnIndex) {
361
- const table = ArcTables__GetTableAt_Z524259A4(this$, tableIndex);
362
- return table.GetColumn(columnIndex);
363
- }
364
-
365
- export function ArcTables__GetColumn_Z18115A39(this$, tableName, columnIndex) {
366
- const tupledArg = [ArcTablesAux_findIndexByTableName(tableName, this$.thisTables), columnIndex];
367
- return ArcTables__GetColumnAt_Z37302880(this$, tupledArg[0], tupledArg[1]);
368
- }
369
-
370
- export function ArcTables__AddRowAt_Z12CDB784(this$, tableIndex, cells, rowIndex) {
371
- ArcTables__MapTableAt_8FC095C(this$, tableIndex, (table) => {
372
- table.AddRow(unwrap(cells), unwrap(rowIndex));
373
- });
374
- }
375
-
376
- export function ArcTables__AddRow_Z16315DE5(this$, tableName, cells, rowIndex) {
377
- ArcTables__AddRowAt_Z12CDB784(this$, ArcTablesAux_findIndexByTableName(tableName, this$.thisTables), unwrap(cells), unwrap(rowIndex));
378
- }
379
-
380
- export function ArcTables__RemoveRowAt_Z37302880(this$, tableIndex, rowIndex) {
381
- ArcTables__MapTableAt_8FC095C(this$, tableIndex, (table) => {
382
- table.RemoveRow(rowIndex);
383
- });
384
- }
385
-
386
- export function ArcTables__RemoveRow_Z18115A39(this$, tableName, rowIndex) {
387
- const tupledArg = [ArcTablesAux_findIndexByTableName(tableName, this$.thisTables), rowIndex];
388
- ArcTables__RemoveRowAt_Z37302880(this$, tupledArg[0], tupledArg[1]);
389
- }
390
-
391
- export function ArcTables__UpdateRowAt_1CF7B5DC(this$, tableIndex, rowIndex, cells) {
392
- ArcTables__MapTableAt_8FC095C(this$, tableIndex, (table) => {
393
- table.UpdateRow(rowIndex, cells);
394
- });
395
- }
396
-
397
- export function ArcTables__UpdateRow_1BFE2CFB(this$, tableName, rowIndex, cells) {
398
- const tupledArg = [ArcTablesAux_findIndexByTableName(tableName, this$.thisTables), rowIndex, cells];
399
- ArcTables__UpdateRowAt_1CF7B5DC(this$, tupledArg[0], tupledArg[1], tupledArg[2]);
400
- }
401
-
402
- export function ArcTables__GetRowAt_Z37302880(this$, tableIndex, rowIndex) {
403
- const table = ArcTables__GetTableAt_Z524259A4(this$, tableIndex);
404
- return table.GetRow(rowIndex);
405
- }
406
-
407
- export function ArcTables__GetRow_Z18115A39(this$, tableName, rowIndex) {
408
- const tupledArg = [ArcTablesAux_findIndexByTableName(tableName, this$.thisTables), rowIndex];
409
- return ArcTables__GetRowAt_Z37302880(this$, tupledArg[0], tupledArg[1]);
410
- }
411
-
412
- /**
413
- * Return a list of all the processes in all the tables.
414
- */
415
- export function ArcTables__GetProcesses(this$) {
416
- return collect((t) => t.GetProcesses(), toList(ArcTables__get_Tables(this$)));
417
- }
418
-
419
- export function ArcTables_ofSeq_3B4333A5(tables) {
420
- return ArcTables_$ctor_Z18C2F36D(Array.from(tables));
421
- }
422
-
423
- /**
424
- * Create a collection of tables from a list of processes.
425
- *
426
- * For this, the processes are grouped by nameroot ("nameroot_1", "nameroot_2" ...) or exectued protocol if no name exists
427
- *
428
- * Then each group is converted to a table with this nameroot as sheetname
429
- */
430
- export function ArcTables_fromProcesses_134EBDED(ps) {
431
- let arg;
432
- return ArcTables_$ctor_Z18C2F36D((arg = map_2((tupledArg) => {
433
- const tupledArg_1 = ProcessParsing_alignByHeaders(true, collect(ProcessParsing_processToRows, tupledArg[1]));
434
- return ArcTable.create(tupledArg[0], tupledArg_1[0], tupledArg_1[1]);
435
- }, ProcessParsing_groupProcesses(ps)), Array.from(arg)));
436
- }
437
-
438
- export function ArcTables_updateReferenceTablesBySheets_Z2EE88E97(referenceTables, sheetTables, keepUnusedRefTables) {
439
- let arg_4, s, array;
440
- const keepUnusedRefTables_1 = defaultArg(keepUnusedRefTables, false);
441
- const usedTables = new Set([]);
442
- const referenceTableMap = ofSeq_1(choose((t) => map_3((c) => [c.Cells[0].AsFreeText, t], t.TryGetProtocolNameColumn()), ArcTables__get_Tables(referenceTables)), {
443
- Compare: comparePrimitives,
444
- });
445
- return ArcTables_$ctor_Z18C2F36D((arg_4 = ((s = map_4((t_3) => {
446
- Unchecked_fillMissingCells(t_3.Headers, t_3.Values);
447
- return t_3;
448
- }, map_4((tupledArg) => reduce((arg_2, arg_3) => ArcTable.append(arg_2, arg_3), tupledArg[1]), Array_groupBy((t_2) => t_2.Name, map_4((t_1) => {
449
- const k = defaultArg(bind((c_1) => {
450
- if (c_1.AsFreeText === "") {
451
- return void 0;
452
- }
453
- else {
454
- return c_1.AsFreeText;
455
- }
456
- }, bind((i) => t_1.TryGetCellAt(i, 0), tryFindIndex((x_1) => equals(x_1, new CompositeHeader(8, [])), t_1.Headers))), t_1.Name);
457
- const matchValue = tryFind(k, referenceTableMap);
213
+ get TableNames() {
214
+ const this$ = this;
215
+ return toList(delay(() => map_1((s) => s.Name, this$.Tables)));
216
+ }
217
+ get TableCount() {
218
+ const this$ = this;
219
+ return this$.Tables.length | 0;
220
+ }
221
+ AddTable(table, index) {
222
+ const this$ = this;
223
+ const index_1 = defaultArg(index, this$.TableCount) | 0;
224
+ ArcTablesAux_SanityChecks_validateSheetIndex(index_1, true, this$.Tables);
225
+ ArcTablesAux_SanityChecks_validateNewNameUnique(table.Name, this$.TableNames);
226
+ this$.Tables.splice(index_1, 0, table);
227
+ }
228
+ AddTables(tables, index) {
229
+ const this$ = this;
230
+ const index_1 = defaultArg(index, this$.TableCount) | 0;
231
+ ArcTablesAux_SanityChecks_validateSheetIndex(index_1, true, this$.Tables);
232
+ ArcTablesAux_SanityChecks_validateNewNamesUnique(map_1((x) => x.Name, tables), this$.TableNames);
233
+ insertRangeInPlace(index_1, tables, this$.Tables);
234
+ }
235
+ InitTable(tableName, index) {
236
+ const this$ = this;
237
+ const index_1 = defaultArg(index, this$.TableCount) | 0;
238
+ const table = ArcTable.init(tableName);
239
+ ArcTablesAux_SanityChecks_validateSheetIndex(index_1, true, this$.Tables);
240
+ ArcTablesAux_SanityChecks_validateNewNameUnique(table.Name, this$.TableNames);
241
+ this$.Tables.splice(index_1, 0, table);
242
+ return table;
243
+ }
244
+ InitTables(tableNames, index) {
245
+ const this$ = this;
246
+ const index_1 = defaultArg(index, this$.TableCount) | 0;
247
+ const tables = map_1((x) => ArcTable.init(x), tableNames);
248
+ ArcTablesAux_SanityChecks_validateSheetIndex(index_1, true, this$.Tables);
249
+ ArcTablesAux_SanityChecks_validateNewNamesUnique(map_1((x_1) => x_1.Name, tables), this$.TableNames);
250
+ insertRangeInPlace(index_1, tables, this$.Tables);
251
+ }
252
+ GetTableAt(index) {
253
+ const this$ = this;
254
+ ArcTablesAux_SanityChecks_validateSheetIndex(index, false, this$.Tables);
255
+ return this$.Tables[index];
256
+ }
257
+ GetTable(name) {
258
+ const this$ = this;
259
+ const arg = ArcTablesAux_findIndexByTableName(name, this$.Tables) | 0;
260
+ return this$.GetTableAt(arg);
261
+ }
262
+ UpdateTableAt(index, table) {
263
+ const this$ = this;
264
+ ArcTablesAux_SanityChecks_validateSheetIndex(index, false, this$.Tables);
265
+ ArcTablesAux_SanityChecks_validateNewNameAtUnique(index, table.Name, this$.TableNames);
266
+ this$.Tables[index] = table;
267
+ }
268
+ UpdateTable(name, table) {
269
+ const this$ = this;
270
+ const tupledArg = [ArcTablesAux_findIndexByTableName(name, this$.Tables), table];
271
+ this$.UpdateTableAt(tupledArg[0], tupledArg[1]);
272
+ }
273
+ SetTableAt(index, table) {
274
+ const this$ = this;
275
+ ArcTablesAux_SanityChecks_validateSheetIndex(index, true, this$.Tables);
276
+ ArcTablesAux_SanityChecks_validateNewNameAtUnique(index, table.Name, this$.TableNames);
277
+ this$.Tables[index] = table;
278
+ }
279
+ SetTable(name, table) {
280
+ const this$ = this;
281
+ const matchValue = ArcTablesAux_tryFindIndexByTableName(name, this$.Tables);
458
282
  if (matchValue == null) {
459
- return t_1;
460
- }
461
- else {
462
- const rt = matchValue;
463
- addToSet(k, usedTables);
464
- const updatedTable = ArcTable.updateReferenceByAnnotationTable(rt, t_1);
465
- return ArcTable.create(t_1.Name, updatedTable.Headers, updatedTable.Values);
466
- }
467
- }, (array = toArray(ArcTables__get_Tables(sheetTables)), collect_1(ArcTable.SplitByProtocolREF, array))), {
468
- Equals: (x_2, y_1) => (x_2 === y_1),
469
- GetHashCode: stringHash,
470
- }))), keepUnusedRefTables_1 ? append(choose((kv) => {
471
- if (usedTables.has(kv[0])) {
472
- return void 0;
283
+ this$.AddTable(table);
473
284
  }
474
285
  else {
475
- return kv[1];
286
+ const index = matchValue | 0;
287
+ this$.SetTableAt(index, table);
476
288
  }
477
- }, referenceTableMap), s) : s)), Array.from(arg_4)));
289
+ }
290
+ RemoveTableAt(index) {
291
+ const this$ = this;
292
+ ArcTablesAux_SanityChecks_validateSheetIndex(index, false, this$.Tables);
293
+ this$.Tables.splice(index, 1);
294
+ }
295
+ RemoveTable(name) {
296
+ const this$ = this;
297
+ const arg = ArcTablesAux_findIndexByTableName(name, this$.Tables) | 0;
298
+ this$.RemoveTableAt(arg);
299
+ }
300
+ MapTableAt(index, updateFun) {
301
+ const this$ = this;
302
+ ArcTablesAux_SanityChecks_validateSheetIndex(index, false, this$.Tables);
303
+ updateFun(this$.Tables[index]);
304
+ }
305
+ MapTable(name, updateFun) {
306
+ const this$ = this;
307
+ const tupledArg = [ArcTablesAux_findIndexByTableName(name, this$.Tables), updateFun];
308
+ this$.MapTableAt(tupledArg[0], tupledArg[1]);
309
+ }
310
+ RenameTableAt(index, newName) {
311
+ const this$ = this;
312
+ ArcTablesAux_SanityChecks_validateSheetIndex(index, false, this$.Tables);
313
+ ArcTablesAux_SanityChecks_validateNewNameUnique(newName, this$.TableNames);
314
+ const table = this$.GetTableAt(index);
315
+ table.Name = newName;
316
+ }
317
+ RenameTable(name, newName) {
318
+ const this$ = this;
319
+ const tupledArg = [ArcTablesAux_findIndexByTableName(name, this$.Tables), newName];
320
+ this$.RenameTableAt(tupledArg[0], tupledArg[1]);
321
+ }
322
+ AddColumnAt(tableIndex, header, cells, columnIndex, forceReplace) {
323
+ const this$ = this;
324
+ this$.MapTableAt(tableIndex, (table) => {
325
+ table.AddColumn(header, unwrap(cells), unwrap(columnIndex), unwrap(forceReplace));
326
+ });
327
+ }
328
+ AddColumn(tableName, header, cells, columnIndex, forceReplace) {
329
+ const this$ = this;
330
+ const i = ArcTablesAux_findIndexByTableName(tableName, this$.Tables) | 0;
331
+ this$.AddColumnAt(i, header, unwrap(cells), unwrap(columnIndex), unwrap(forceReplace));
332
+ }
333
+ RemoveColumnAt(tableIndex, columnIndex) {
334
+ const this$ = this;
335
+ this$.MapTableAt(tableIndex, (table) => {
336
+ table.RemoveColumn(columnIndex);
337
+ });
338
+ }
339
+ RemoveColumn(tableName, columnIndex) {
340
+ const this$ = this;
341
+ const tupledArg = [ArcTablesAux_findIndexByTableName(tableName, this$.Tables), columnIndex];
342
+ this$.RemoveColumnAt(tupledArg[0], tupledArg[1]);
343
+ }
344
+ UpdateColumnAt(tableIndex, columnIndex, header, cells) {
345
+ const this$ = this;
346
+ this$.MapTableAt(tableIndex, (table) => {
347
+ table.UpdateColumn(columnIndex, header, unwrap(cells));
348
+ });
349
+ }
350
+ UpdateColumn(tableName, columnIndex, header, cells) {
351
+ const this$ = this;
352
+ const tableIndex = ArcTablesAux_findIndexByTableName(tableName, this$.Tables) | 0;
353
+ this$.UpdateColumnAt(tableIndex, columnIndex, header, unwrap(cells));
354
+ }
355
+ GetColumnAt(tableIndex, columnIndex) {
356
+ const this$ = this;
357
+ const table = this$.GetTableAt(tableIndex);
358
+ return table.GetColumn(columnIndex);
359
+ }
360
+ GetColumn(tableName, columnIndex) {
361
+ const this$ = this;
362
+ const tupledArg = [ArcTablesAux_findIndexByTableName(tableName, this$.Tables), columnIndex];
363
+ return this$.GetColumnAt(tupledArg[0], tupledArg[1]);
364
+ }
365
+ AddRowAt(tableIndex, cells, rowIndex) {
366
+ const this$ = this;
367
+ this$.MapTableAt(tableIndex, (table) => {
368
+ table.AddRow(unwrap(cells), unwrap(rowIndex));
369
+ });
370
+ }
371
+ AddRow(tableName, cells, rowIndex) {
372
+ const this$ = this;
373
+ const i = ArcTablesAux_findIndexByTableName(tableName, this$.Tables) | 0;
374
+ this$.AddRowAt(i, unwrap(cells), unwrap(rowIndex));
375
+ }
376
+ RemoveRowAt(tableIndex, rowIndex) {
377
+ const this$ = this;
378
+ this$.MapTableAt(tableIndex, (table) => {
379
+ table.RemoveRow(rowIndex);
380
+ });
381
+ }
382
+ RemoveRow(tableName, rowIndex) {
383
+ const this$ = this;
384
+ const tupledArg = [ArcTablesAux_findIndexByTableName(tableName, this$.Tables), rowIndex];
385
+ this$.RemoveRowAt(tupledArg[0], tupledArg[1]);
386
+ }
387
+ UpdateRowAt(tableIndex, rowIndex, cells) {
388
+ const this$ = this;
389
+ this$.MapTableAt(tableIndex, (table) => {
390
+ table.UpdateRow(rowIndex, cells);
391
+ });
392
+ }
393
+ UpdateRow(tableName, rowIndex, cells) {
394
+ const this$ = this;
395
+ const tupledArg = [ArcTablesAux_findIndexByTableName(tableName, this$.Tables), rowIndex, cells];
396
+ this$.UpdateRowAt(tupledArg[0], tupledArg[1], tupledArg[2]);
397
+ }
398
+ GetRowAt(tableIndex, rowIndex) {
399
+ const this$ = this;
400
+ const table = this$.GetTableAt(tableIndex);
401
+ return table.GetRow(rowIndex);
402
+ }
403
+ GetRow(tableName, rowIndex) {
404
+ const this$ = this;
405
+ const tupledArg = [ArcTablesAux_findIndexByTableName(tableName, this$.Tables), rowIndex];
406
+ return this$.GetRowAt(tupledArg[0], tupledArg[1]);
407
+ }
408
+ GetProcesses() {
409
+ const this$ = this;
410
+ return collect((t) => t.GetProcesses(), toList(this$.Tables));
411
+ }
412
+ static ofSeq(tables) {
413
+ return new ArcTables(Array.from(tables));
414
+ }
415
+ static fromProcesses(ps) {
416
+ let arg;
417
+ return new ArcTables((arg = map_2((tupledArg) => {
418
+ const tupledArg_1 = ProcessParsing_alignByHeaders(true, collect(ProcessParsing_processToRows, tupledArg[1]));
419
+ return ArcTable.create(tupledArg[0], tupledArg_1[0], tupledArg_1[1]);
420
+ }, ProcessParsing_groupProcesses(ps)), Array.from(arg)));
421
+ }
422
+ static updateReferenceTablesBySheets(referenceTables, sheetTables, keepUnusedRefTables) {
423
+ let arg_4, s, array;
424
+ const keepUnusedRefTables_1 = defaultArg(keepUnusedRefTables, false);
425
+ const usedTables = new Set([]);
426
+ const referenceTableMap = ofSeq_1(choose((t) => map_3((c) => [c.Cells[0].AsFreeText, t], t.TryGetProtocolNameColumn()), referenceTables.Tables), {
427
+ Compare: comparePrimitives,
428
+ });
429
+ return new ArcTables((arg_4 = ((s = map_4((t_3) => {
430
+ Unchecked_fillMissingCells(t_3.Headers, t_3.Values);
431
+ return t_3;
432
+ }, map_4((tupledArg) => reduce((arg_2, arg_3) => ArcTable.append(arg_2, arg_3), tupledArg[1]), Array_groupBy((t_2) => t_2.Name, map_4((t_1) => {
433
+ const k = defaultArg(bind((c_1) => {
434
+ if (c_1.AsFreeText === "") {
435
+ return void 0;
436
+ }
437
+ else {
438
+ return c_1.AsFreeText;
439
+ }
440
+ }, bind((i) => t_1.TryGetCellAt(i, 0), tryFindIndex((x_1) => equals(x_1, new CompositeHeader(8, [])), t_1.Headers))), t_1.Name);
441
+ const matchValue = tryFind(k, referenceTableMap);
442
+ if (matchValue == null) {
443
+ return t_1;
444
+ }
445
+ else {
446
+ const rt = matchValue;
447
+ addToSet(k, usedTables);
448
+ const updatedTable = ArcTable.updateReferenceByAnnotationTable(rt, t_1);
449
+ return ArcTable.create(t_1.Name, updatedTable.Headers, updatedTable.Values);
450
+ }
451
+ }, (array = toArray(sheetTables.Tables), collect_1(ArcTable.SplitByProtocolREF, array))), {
452
+ Equals: (x_2, y_1) => (x_2 === y_1),
453
+ GetHashCode: stringHash,
454
+ }))), keepUnusedRefTables_1 ? append(choose((kv) => {
455
+ if (usedTables.has(kv[0])) {
456
+ return void 0;
457
+ }
458
+ else {
459
+ return kv[1];
460
+ }
461
+ }, referenceTableMap), s) : s)), Array.from(arg_4)));
462
+ }
463
+ GetEnumerator() {
464
+ const this$ = this;
465
+ return getEnumerator(this$.Tables);
466
+ }
467
+ [Symbol.iterator]() {
468
+ return toIterator(getEnumerator(this));
469
+ }
470
+ "System.Collections.IEnumerable.GetEnumerator"() {
471
+ const this$ = this;
472
+ return getEnumerator(this$.Tables);
473
+ }
474
+ }
475
+
476
+ export function ArcTables_$reflection() {
477
+ return class_type("ARCtrl.ISA.ArcTables", void 0, ArcTables);
478
+ }
479
+
480
+ export function ArcTables_$ctor_Z18C2F36D(initTables) {
481
+ return new ArcTables(initTables);
478
482
  }
479
483