@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.
Files changed (84) hide show
  1. package/ARC.js +5 -6
  2. package/ISA/ISA/ArcTypes/ArcTable.js +141 -37
  3. package/ISA/ISA/ArcTypes/ArcTableAux.js +13 -14
  4. package/ISA/ISA/ArcTypes/ArcTables.js +380 -277
  5. package/ISA/ISA/ArcTypes/ArcTypes.js +128 -318
  6. package/ISA/ISA/ArcTypes/CompositeColumn.js +7 -1
  7. package/ISA/ISA/ArcTypes/CompositeHeader.js +311 -1
  8. package/ISA/ISA/Helper.js +15 -3
  9. package/ISA/ISA.Spreadsheet/AnnotationTable/ArcTable.js +17 -15
  10. package/ISA/ISA.Spreadsheet/AnnotationTable/CompositeCell.js +2 -2
  11. package/ISA/ISA.Spreadsheet/AnnotationTable/CompositeColumn.js +4 -4
  12. package/ISA/ISA.Spreadsheet/AnnotationTable/CompositeHeader.js +6 -6
  13. package/ISA/ISA.Spreadsheet/ArcAssay.js +6 -9
  14. package/ISA/ISA.Spreadsheet/ArcInvestigation.js +4 -4
  15. package/ISA/ISA.Spreadsheet/ArcStudy.js +5 -5
  16. package/ISA/ISA.Spreadsheet/Metadata/SparseTable.js +9 -9
  17. package/README.md +3 -0
  18. package/Templates/Template.Json.js +7 -3
  19. package/Templates/Template.Spreadsheet.js +23 -7
  20. package/Templates/Template.Web.js +1 -1
  21. package/Templates/Templates.js +82 -0
  22. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Cells/FsCell.fs +85 -36
  23. package/fable_modules/FsSpreadsheet.5.0.0/Cells/FsCell.fs.js +272 -0
  24. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/CellBuilder.fs +1 -0
  25. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/CellBuilder.fs.js +18 -18
  26. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Transform.fs +1 -1
  27. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Transform.fs.js +2 -1
  28. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Types.fs +1 -1
  29. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Types.fs.js +4 -4
  30. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsColumn.fs +3 -1
  31. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsRow.fs +2 -0
  32. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsWorksheet.fs +10 -1
  33. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsWorksheet.fs.js +5 -0
  34. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/SheetBuilder.fs +4 -4
  35. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/SheetBuilder.fs.js +3 -3
  36. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Tables/FsTable.fs +20 -4
  37. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Tables/FsTable.fs.js +26 -6
  38. package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/obj/Release/netstandard2.0/FsSpreadsheet.AssemblyInfo.fs +3 -3
  39. package/fable_modules/project_cracked.json +1 -1
  40. package/index.js +1 -0
  41. package/package.json +1 -1
  42. package/fable_modules/FsSpreadsheet.4.1.0/Cells/FsCell.fs.js +0 -240
  43. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Cells/FsCellsCollection.fs +0 -0
  44. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Cells/FsCellsCollection.fs.js +0 -0
  45. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/ColumnBuilder.fs +0 -0
  46. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/ColumnBuilder.fs.js +0 -0
  47. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/DSL.fs +0 -0
  48. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/DSL.fs.js +0 -0
  49. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Expression.fs +0 -0
  50. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Expression.fs.js +0 -0
  51. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Operators.fs +0 -0
  52. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/Operators.fs.js +0 -0
  53. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/RowBuilder.fs +0 -0
  54. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/RowBuilder.fs.js +0 -0
  55. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/SheetBuilder.fs +0 -0
  56. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/SheetBuilder.fs.js +0 -0
  57. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/TableBuilder.fs +0 -0
  58. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/TableBuilder.fs.js +0 -0
  59. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/WorkbookBuilder.fs +0 -0
  60. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/DSL/WorkbookBuilder.fs.js +0 -0
  61. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsAddress.fs +0 -0
  62. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsAddress.fs.js +0 -0
  63. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsColumn.fs.js +0 -0
  64. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsRow.fs.js +0 -0
  65. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsSpreadsheet.fableproj +0 -0
  66. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsWorkbook.fs +0 -0
  67. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/FsWorkbook.fs.js +0 -0
  68. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRange.fs +0 -0
  69. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRange.fs.js +0 -0
  70. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeAddress.fs +0 -0
  71. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeAddress.fs.js +0 -0
  72. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeBase.fs +0 -0
  73. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeBase.fs.js +0 -0
  74. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeColumn.fs +0 -0
  75. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeColumn.fs.js +0 -0
  76. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeRow.fs +0 -0
  77. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Ranges/FsRangeRow.fs.js +0 -0
  78. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Tables/FsTableField.fs +0 -0
  79. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Tables/FsTableField.fs.js +0 -0
  80. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Tables/FsTableRow.fs +0 -0
  81. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/Tables/FsTableRow.fs.js +0 -0
  82. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +0 -0
  83. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/obj/Debug/netstandard2.0/FsSpreadsheet.AssemblyInfo.fs +0 -0
  84. /package/fable_modules/{FsSpreadsheet.4.1.0 → FsSpreadsheet.5.0.0}/obj/Release/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +0 -0
@@ -0,0 +1,272 @@
1
+ import { toString, Union } from "../../fable-library.4.1.4/Types.js";
2
+ import { class_type, union_type } from "../../fable-library.4.1.4/Reflection.js";
3
+ import { map, defaultArg, unwrap } from "../../fable-library.4.1.4/Option.js";
4
+ import { FsAddress__get_FixedRow, FsAddress__get_FixedColumn, FsAddress__get_Address, FsAddress__Copy, CellReference_indexToColAdress, FsAddress__get_ColumnNumber, FsAddress__get_RowNumber, FsAddress_$ctor_Z37302880 } from "../FsAddress.fs.js";
5
+ import { parse as parse_3 } from "../../fable-library.4.1.4/Decimal.js";
6
+ import Decimal from "../../fable-library.4.1.4/Decimal.js";
7
+ import { parse } from "../../fable-library.4.1.4/Double.js";
8
+ import { parse as parse_1 } from "../../fable-library.4.1.4/Int32.js";
9
+ import { toUInt64, toInt64 } from "../../fable-library.4.1.4/BigInt.js";
10
+ import { parse as parse_2 } from "../../fable-library.4.1.4/Long.js";
11
+ import { parse as parse_4 } from "../../fable-library.4.1.4/Date.js";
12
+ import { parse as parse_5 } from "../../fable-library.4.1.4/Guid.js";
13
+ import { parse as parse_6 } from "../../fable-library.4.1.4/Char.js";
14
+ import { forAll } from "../../fable-library.4.1.4/Seq.js";
15
+ import { equals } from "../../fable-library.4.1.4/Util.js";
16
+
17
+ export class DataType extends Union {
18
+ constructor(tag, fields) {
19
+ super();
20
+ this.tag = tag;
21
+ this.fields = fields;
22
+ }
23
+ cases() {
24
+ return ["String", "Boolean", "Number", "Date", "Empty"];
25
+ }
26
+ }
27
+
28
+ export function DataType_$reflection() {
29
+ return union_type("FsSpreadsheet.DataType", [], DataType, () => [[], [], [], [], []]);
30
+ }
31
+
32
+ export function FsCellAux_boolConverter(bool) {
33
+ if (bool) {
34
+ return "1";
35
+ }
36
+ else {
37
+ return "0";
38
+ }
39
+ }
40
+
41
+ export class FsCell {
42
+ constructor(value, dataType, address) {
43
+ this._cellValue = value;
44
+ this._dataType = defaultArg(dataType, new DataType(0, []));
45
+ this._comment = "";
46
+ this._hyperlink = "";
47
+ this._richText = "";
48
+ this._formulaA1 = "";
49
+ this._formulaR1C1 = "";
50
+ this._rowIndex = (defaultArg(map(FsAddress__get_RowNumber, address), 0) | 0);
51
+ this._columnIndex = (defaultArg(map(FsAddress__get_ColumnNumber, address), 0) | 0);
52
+ }
53
+ static ".ctor"(value, dataType, address) {
54
+ return new FsCell(value, unwrap(dataType), unwrap(address));
55
+ }
56
+ get Value() {
57
+ const self = this;
58
+ return self._cellValue;
59
+ }
60
+ set Value(value) {
61
+ const self = this;
62
+ self._cellValue = value;
63
+ }
64
+ get DataType() {
65
+ const self = this;
66
+ return self._dataType;
67
+ }
68
+ set DataType(dataType) {
69
+ const self = this;
70
+ self._dataType = dataType;
71
+ }
72
+ get ColumnNumber() {
73
+ const self = this;
74
+ return self._columnIndex | 0;
75
+ }
76
+ set ColumnNumber(colI) {
77
+ const self = this;
78
+ self._columnIndex = (colI | 0);
79
+ }
80
+ get RowNumber() {
81
+ const self = this;
82
+ return self._rowIndex | 0;
83
+ }
84
+ set RowNumber(rowI) {
85
+ const self = this;
86
+ self._rowIndex = (rowI | 0);
87
+ }
88
+ get Address() {
89
+ const self = this;
90
+ return FsAddress_$ctor_Z37302880(self._rowIndex, self._columnIndex);
91
+ }
92
+ set Address(address) {
93
+ const self = this;
94
+ self._rowIndex = (FsAddress__get_RowNumber(address) | 0);
95
+ self._columnIndex = (FsAddress__get_ColumnNumber(address) | 0);
96
+ }
97
+ static create(rowNumber, colNumber, value) {
98
+ let patternInput;
99
+ const value_1_1 = value;
100
+ patternInput = ((typeof value_1_1 === "string") ? [new DataType(0, []), value_1_1] : ((typeof value_1_1 === "boolean") ? (value_1_1 ? [new DataType(1, []), true] : [new DataType(1, []), false]) : ((typeof value_1_1 === "number") ? [new DataType(2, []), value_1_1] : ((typeof value_1_1 === "number") ? [new DataType(2, []), value_1_1] : ((typeof value_1_1 === "number") ? [new DataType(2, []), value_1_1] : ((typeof value_1_1 === "number") ? [new DataType(2, []), value_1_1] : ((typeof value_1_1 === "bigint") ? [new DataType(2, []), value_1_1] : ((typeof value_1_1 === "number") ? [new DataType(2, []), value_1_1] : ((typeof value_1_1 === "number") ? [new DataType(2, []), value_1_1] : ((typeof value_1_1 === "bigint") ? [new DataType(2, []), value_1_1] : ((typeof value_1_1 === "number") ? [new DataType(2, []), value_1_1] : ((typeof value_1_1 === "number") ? [new DataType(2, []), value_1_1] : ((value_1_1 instanceof Decimal) ? [new DataType(2, []), value_1_1] : ((value_1_1 instanceof Date) ? [new DataType(3, []), value_1_1] : ((typeof value_1_1 === "string") ? [new DataType(0, []), value_1_1] : [new DataType(0, []), value_1_1])))))))))))))));
101
+ return new FsCell(patternInput[1], patternInput[0], FsAddress_$ctor_Z37302880(rowNumber, colNumber));
102
+ }
103
+ static createEmpty() {
104
+ return new FsCell("", new DataType(4, []), FsAddress_$ctor_Z37302880(0, 0));
105
+ }
106
+ static createWithAdress(adress, value) {
107
+ let patternInput;
108
+ const value_1_1 = value;
109
+ patternInput = ((typeof value_1_1 === "string") ? [new DataType(0, []), value_1_1] : ((typeof value_1_1 === "boolean") ? (value_1_1 ? [new DataType(1, []), true] : [new DataType(1, []), false]) : ((typeof value_1_1 === "number") ? [new DataType(2, []), value_1_1] : ((typeof value_1_1 === "number") ? [new DataType(2, []), value_1_1] : ((typeof value_1_1 === "number") ? [new DataType(2, []), value_1_1] : ((typeof value_1_1 === "number") ? [new DataType(2, []), value_1_1] : ((typeof value_1_1 === "bigint") ? [new DataType(2, []), value_1_1] : ((typeof value_1_1 === "number") ? [new DataType(2, []), value_1_1] : ((typeof value_1_1 === "number") ? [new DataType(2, []), value_1_1] : ((typeof value_1_1 === "bigint") ? [new DataType(2, []), value_1_1] : ((typeof value_1_1 === "number") ? [new DataType(2, []), value_1_1] : ((typeof value_1_1 === "number") ? [new DataType(2, []), value_1_1] : ((value_1_1 instanceof Decimal) ? [new DataType(2, []), value_1_1] : ((value_1_1 instanceof Date) ? [new DataType(3, []), value_1_1] : ((typeof value_1_1 === "string") ? [new DataType(0, []), value_1_1] : [new DataType(0, []), value_1_1])))))))))))))));
110
+ return new FsCell(patternInput[1], patternInput[0], adress);
111
+ }
112
+ static createEmptyWithAdress(adress) {
113
+ return new FsCell("", new DataType(4, []), adress);
114
+ }
115
+ static createWithDataType(dataType, rowNumber, colNumber, value) {
116
+ return new FsCell(value, dataType, FsAddress_$ctor_Z37302880(rowNumber, colNumber));
117
+ }
118
+ toString() {
119
+ const self = this;
120
+ return `${CellReference_indexToColAdress(self.ColumnNumber >>> 0)}${self.RowNumber} : ${self.Value} | ${self.DataType}`;
121
+ }
122
+ CopyFrom(otherCell) {
123
+ const self = this;
124
+ self.DataType = otherCell.DataType;
125
+ self.Value = otherCell.Value;
126
+ }
127
+ CopyTo(target) {
128
+ const self = this;
129
+ target.DataType = self.DataType;
130
+ target.Value = self.Value;
131
+ }
132
+ static copyFromTo(sourceCell, targetCell) {
133
+ targetCell.DataType = sourceCell.DataType;
134
+ targetCell.Value = sourceCell.Value;
135
+ return targetCell;
136
+ }
137
+ Copy() {
138
+ const self = this;
139
+ return new FsCell(self.Value, self.DataType, FsAddress__Copy(self.Address));
140
+ }
141
+ static copy(cell) {
142
+ return cell.Copy();
143
+ }
144
+ ValueAsString() {
145
+ const self = this;
146
+ const v = self.Value;
147
+ const matchValue = self.DataType;
148
+ switch (matchValue.tag) {
149
+ case 2:
150
+ return toString(v);
151
+ default:
152
+ return toString(v);
153
+ }
154
+ }
155
+ static getValueAsString(cell) {
156
+ return cell.ValueAsString();
157
+ }
158
+ ValueAsBool() {
159
+ const self = this;
160
+ const matchValue = toString(self.Value).toLocaleLowerCase();
161
+ switch (matchValue) {
162
+ case "1":
163
+ case "true":
164
+ case "true()":
165
+ return true;
166
+ case "0":
167
+ case "false":
168
+ case "false()":
169
+ return false;
170
+ default:
171
+ throw new Error(`String '${matchValue}' was not recognized as a valid Boolean`);
172
+ }
173
+ }
174
+ static getValueAsBool(cell) {
175
+ return cell.ValueAsBool();
176
+ }
177
+ ValueAsFloat() {
178
+ const self = this;
179
+ return parse(toString(self.Value));
180
+ }
181
+ static getValueAsFloat(cell) {
182
+ return cell.ValueAsFloat();
183
+ }
184
+ ValueAsInt() {
185
+ const self = this;
186
+ return parse_1(toString(self.Value), 511, false, 32) | 0;
187
+ }
188
+ static getValueAsInt(cell) {
189
+ return cell.ValueAsInt();
190
+ }
191
+ ValueAsUInt() {
192
+ const self = this;
193
+ return parse_1(toString(self.Value), 511, true, 32);
194
+ }
195
+ static getValueAsUInt(cell) {
196
+ return cell.ValueAsUInt();
197
+ }
198
+ ValueAsLong() {
199
+ const self = this;
200
+ return toInt64(parse_2(toString(self.Value), 511, false, 64));
201
+ }
202
+ static getValueAsLong(cell) {
203
+ return cell.ValueAsLong();
204
+ }
205
+ ValueAsULong() {
206
+ const self = this;
207
+ return toUInt64(parse_2(toString(self.Value), 511, true, 64));
208
+ }
209
+ static getValueAsULong(cell) {
210
+ return cell.ValueAsULong();
211
+ }
212
+ ValueAsDouble() {
213
+ const self = this;
214
+ return parse(toString(self.Value));
215
+ }
216
+ static getValueAsDouble(cell) {
217
+ return cell.ValueAsDouble();
218
+ }
219
+ ValueAsDecimal() {
220
+ const self = this;
221
+ return parse_3(toString(self.Value));
222
+ }
223
+ static getValueAsDecimal(cell) {
224
+ return cell.ValueAsDecimal();
225
+ }
226
+ ValueAsDateTime() {
227
+ const self = this;
228
+ return parse_4(toString(self.Value));
229
+ }
230
+ static getValueAsDateTime(cell) {
231
+ return cell.ValueAsDateTime();
232
+ }
233
+ ValueAsGuid() {
234
+ const self = this;
235
+ return parse_5(toString(self.Value));
236
+ }
237
+ static getValueAsGuid(cell) {
238
+ return cell.ValueAsGuid();
239
+ }
240
+ ValueAsChar() {
241
+ const self = this;
242
+ return parse_6(toString(self.Value));
243
+ }
244
+ static getValueAsChar(cell) {
245
+ return cell.ValueAsChar();
246
+ }
247
+ SetValueAs(value) {
248
+ const self = this;
249
+ let patternInput;
250
+ const value_1_1 = value;
251
+ patternInput = ((typeof value_1_1 === "string") ? [new DataType(0, []), value_1_1] : ((typeof value_1_1 === "boolean") ? (value_1_1 ? [new DataType(1, []), true] : [new DataType(1, []), false]) : ((typeof value_1_1 === "number") ? [new DataType(2, []), value_1_1] : ((typeof value_1_1 === "number") ? [new DataType(2, []), value_1_1] : ((typeof value_1_1 === "number") ? [new DataType(2, []), value_1_1] : ((typeof value_1_1 === "number") ? [new DataType(2, []), value_1_1] : ((typeof value_1_1 === "bigint") ? [new DataType(2, []), value_1_1] : ((typeof value_1_1 === "number") ? [new DataType(2, []), value_1_1] : ((typeof value_1_1 === "number") ? [new DataType(2, []), value_1_1] : ((typeof value_1_1 === "bigint") ? [new DataType(2, []), value_1_1] : ((typeof value_1_1 === "number") ? [new DataType(2, []), value_1_1] : ((typeof value_1_1 === "number") ? [new DataType(2, []), value_1_1] : ((value_1_1 instanceof Decimal) ? [new DataType(2, []), value_1_1] : ((value_1_1 instanceof Date) ? [new DataType(3, []), value_1_1] : ((typeof value_1_1 === "string") ? [new DataType(0, []), value_1_1] : [new DataType(0, []), value_1_1])))))))))))))));
252
+ self._dataType = patternInput[0];
253
+ self._cellValue = patternInput[1];
254
+ }
255
+ static setValueAs(value, cell) {
256
+ cell.SetValueAs(value);
257
+ return cell;
258
+ }
259
+ StructurallyEquals(other) {
260
+ const this$ = this;
261
+ return forAll((x_1) => (x_1 === true), [equals(this$.Value, other.Value), equals(this$.DataType, other.DataType), forAll((x) => (x === true), [FsAddress__get_Address(this$.Address) === FsAddress__get_Address(other.Address), FsAddress__get_ColumnNumber(this$.Address) === FsAddress__get_ColumnNumber(other.Address), FsAddress__get_RowNumber(this$.Address) === FsAddress__get_RowNumber(other.Address), FsAddress__get_FixedColumn(this$.Address) === FsAddress__get_FixedColumn(other.Address), FsAddress__get_FixedRow(this$.Address) === FsAddress__get_FixedRow(other.Address)]), this$.ColumnNumber === other.ColumnNumber, this$.RowNumber === other.RowNumber]);
262
+ }
263
+ }
264
+
265
+ export function FsCell_$reflection() {
266
+ return class_type("FsSpreadsheet.FsCell", void 0, FsCell);
267
+ }
268
+
269
+ export function FsCell_$ctor_2BEF9BB0(value, dataType, address) {
270
+ return new FsCell(value, dataType, address);
271
+ }
272
+
@@ -14,6 +14,7 @@ type ReduceOperation =
14
14
  values
15
15
  |> List.map (snd >> string)
16
16
  |> List.reduce (fun a b -> $"{a}{separator}{b}")
17
+ |> box
17
18
 
18
19
  type CellBuilder() =
19
20
 
@@ -1,4 +1,4 @@
1
- import { Union } from "../../fable-library.4.1.4/Types.js";
1
+ import { toString, Union } from "../../fable-library.4.1.4/Types.js";
2
2
  import { class_type, union_type, char_type } from "../../fable-library.4.1.4/Reflection.js";
3
3
  import { DataType } from "../Cells/FsCell.fs.js";
4
4
  import { head, tail, isEmpty, append, empty, map, reduce } from "../../fable-library.4.1.4/List.js";
@@ -21,8 +21,8 @@ export function ReduceOperation_$reflection() {
21
21
  return union_type("FsSpreadsheet.DSL.ReduceOperation", [], ReduceOperation, () => [[["Item", char_type]]]);
22
22
  }
23
23
 
24
- export function ReduceOperation__Reduce_Z26A4E3C2(this$, values) {
25
- return [new DataType(0, []), reduce((a, b) => (`${a}${this$.fields[0]}${b}`), map((arg) => arg[1], values))];
24
+ export function ReduceOperation__Reduce_70D1A69E(this$, values) {
25
+ return [new DataType(0, []), reduce((a, b) => (`${a}${this$.fields[0]}${b}`), map((arg) => toString(arg[1]), values))];
26
26
  }
27
27
 
28
28
  export class CellBuilder {
@@ -55,7 +55,7 @@ export function CellBuilder__Yield_36B9E420(this$, ro) {
55
55
  return new SheetEntity$1(1, [empty()]);
56
56
  }
57
57
 
58
- export function CellBuilder__Combine_4F8B6A0(this$, wx1, wx2) {
58
+ export function CellBuilder__Combine_F07E260(this$, wx1, wx2) {
59
59
  let matchResult, l1, l2, messages1, messages2, messages2_1, messages1_1, f1, messages1_2, messages2_2, f2, messages1_3, messages2_3, messages1_4, messages2_4;
60
60
  switch (wx1.tag) {
61
61
  case 2: {
@@ -130,39 +130,39 @@ export function CellBuilder__Combine_4F8B6A0(this$, wx1, wx2) {
130
130
  }
131
131
  }
132
132
 
133
- export function CellBuilder__Combine_2C6C5E1E(this$, wx1, wx2) {
133
+ export function CellBuilder__Combine_4BCE267E(this$, wx1, wx2) {
134
134
  return RequiredSource$1_$ctor_2B595(wx2);
135
135
  }
136
136
 
137
- export function CellBuilder__Combine_Z40A4EDE2(this$, wx1, wx2) {
137
+ export function CellBuilder__Combine_Z2CF9C142(this$, wx1, wx2) {
138
138
  return RequiredSource$1_$ctor_2B595(wx1);
139
139
  }
140
140
 
141
- export function CellBuilder__Combine_3F9D1279(this$, wx1, wx2) {
141
+ export function CellBuilder__Combine_583F6A19(this$, wx1, wx2) {
142
142
  return OptionalSource$1_$ctor_2B595(wx2);
143
143
  }
144
144
 
145
- export function CellBuilder__Combine_7AD05659(this$, wx1, wx2) {
145
+ export function CellBuilder__Combine_168D7AF9(this$, wx1, wx2) {
146
146
  return OptionalSource$1_$ctor_2B595(wx1);
147
147
  }
148
148
 
149
- export function CellBuilder__Combine_Z674DE191(this$, wx1, wx2) {
150
- return RequiredSource$1_$ctor_2B595(CellBuilder__Combine_4F8B6A0(this$, RequiredSource$1__get_Source(wx1), wx2));
149
+ export function CellBuilder__Combine_32507AAF(this$, wx1, wx2) {
150
+ return RequiredSource$1_$ctor_2B595(CellBuilder__Combine_F07E260(this$, RequiredSource$1__get_Source(wx1), wx2));
151
151
  }
152
152
 
153
- export function CellBuilder__Combine_1F389C8F(this$, wx1, wx2) {
154
- return RequiredSource$1_$ctor_2B595(CellBuilder__Combine_4F8B6A0(this$, wx1, RequiredSource$1__get_Source(wx2)));
153
+ export function CellBuilder__Combine_Z3ABF6771(this$, wx1, wx2) {
154
+ return RequiredSource$1_$ctor_2B595(CellBuilder__Combine_F07E260(this$, wx1, RequiredSource$1__get_Source(wx2)));
155
155
  }
156
156
 
157
- export function CellBuilder__Combine_512E85C8(this$, wx1, wx2) {
158
- return OptionalSource$1_$ctor_2B595(CellBuilder__Combine_4F8B6A0(this$, OptionalSource$1__get_Source(wx1), wx2));
157
+ export function CellBuilder__Combine_Z2BFC83F8(this$, wx1, wx2) {
158
+ return OptionalSource$1_$ctor_2B595(CellBuilder__Combine_F07E260(this$, OptionalSource$1__get_Source(wx1), wx2));
159
159
  }
160
160
 
161
- export function CellBuilder__Combine_6390E688(this$, wx1, wx2) {
162
- return OptionalSource$1_$ctor_2B595(CellBuilder__Combine_4F8B6A0(this$, wx1, OptionalSource$1__get_Source(wx2)));
161
+ export function CellBuilder__Combine_245D6C8(this$, wx1, wx2) {
162
+ return OptionalSource$1_$ctor_2B595(CellBuilder__Combine_F07E260(this$, wx1, OptionalSource$1__get_Source(wx2)));
163
163
  }
164
164
 
165
- export function CellBuilder__AsCellElement_825BA8D(this$, children) {
165
+ export function CellBuilder__AsCellElement_6F87C2ED(this$, children) {
166
166
  let matchResult, messages, v, messages_1, vals, messages_2, messages_3;
167
167
  switch (children.tag) {
168
168
  case 2: {
@@ -198,7 +198,7 @@ export function CellBuilder__AsCellElement_825BA8D(this$, children) {
198
198
  case 0:
199
199
  return new SheetEntity$1(0, [[v, void 0], messages]);
200
200
  case 1:
201
- return new SheetEntity$1(0, [[ReduceOperation__Reduce_Z26A4E3C2(this$.reducer, vals), void 0], messages_1]);
201
+ return new SheetEntity$1(0, [[ReduceOperation__Reduce_70D1A69E(this$.reducer, vals), void 0], messages_1]);
202
202
  case 2:
203
203
  return new SheetEntity$1(2, [messages_2]);
204
204
  default:
@@ -72,7 +72,7 @@ module Transform =
72
72
  match col with
73
73
  | [] -> failwith "Empty column"
74
74
  | header :: fields ->
75
- let field = table.Field(snd header, cellCollection)
75
+ let field = table.Field(snd >> string <| header, cellCollection)
76
76
  fields
77
77
  |> List.iteri (fun i (dataType,value) ->
78
78
  let cell = field.Column.Cell(i + 2,cellCollection)
@@ -1,5 +1,6 @@
1
1
  import { choose, transpose, map, iterateIndexed, iterate, ofArrayWithTail, empty, reverse, singleton, tail as tail_25, cons, head, isEmpty } from "../../fable-library.4.1.4/List.js";
2
2
  import { RowIndex__get_Index, ColumnIndex__get_Index, TableElement__get_IsColumn, SheetElement } from "./Types.fs.js";
3
+ import { toString } from "../../fable-library.4.1.4/Types.js";
3
4
  import { FsRangeColumn__Cell_Z4232C216 } from "../Ranges/FsRangeColumn.fs.js";
4
5
  import { FsTableField__get_Column } from "../Tables/FsTableField.fs.js";
5
6
  import { add, FSharpSet__Contains, ofSeq } from "../../fable-library.4.1.4/Set.js";
@@ -166,7 +167,7 @@ export function splitRowsAndColumns(els) {
166
167
  export function FsSpreadsheet_DSL_Workbook__Workbook_parseTable_Static(cellCollection, table, els) {
167
168
  iterate((col_2) => {
168
169
  if (!isEmpty(col_2)) {
169
- const field = table.Field(head(col_2)[1], cellCollection);
170
+ const field = table.Field(toString(head(col_2)[1]), cellCollection);
170
171
  iterateIndexed((i, tupledArg) => {
171
172
  const cell_4 = FsRangeColumn__Cell_Z4232C216(FsTableField__get_Column(field), i + 2, cellCollection);
172
173
  cell_4.DataType = tupledArg[0];
@@ -95,7 +95,7 @@ module SheetEntityExtensions =
95
95
  failwith $"SheetEntity of type {typeof<'T>.Name} does not contain Value: \n\t{appendedMessages}"
96
96
  #endif
97
97
 
98
- type Value = DataType * string
98
+ type Value = DataType * obj
99
99
 
100
100
  type CellElement = Value * int option
101
101
 
@@ -1,5 +1,5 @@
1
1
  import { Union } from "../../fable-library.4.1.4/Types.js";
2
- import { tuple_type, int32_type, list_type, union_type, class_type, string_type } from "../../fable-library.4.1.4/Reflection.js";
2
+ import { tuple_type, obj_type, int32_type, list_type, union_type, class_type, string_type } from "../../fable-library.4.1.4/Reflection.js";
3
3
  import { empty, pick, exists, map, reduce } from "../../fable-library.4.1.4/List.js";
4
4
  import { printf, toConsole } from "../../fable-library.4.1.4/String.js";
5
5
  import { DataType_$reflection } from "../Cells/FsCell.fs.js";
@@ -179,7 +179,7 @@ export class ColumnElement extends Union {
179
179
  }
180
180
 
181
181
  export function ColumnElement_$reflection() {
182
- return union_type("FsSpreadsheet.DSL.ColumnElement", [], ColumnElement, () => [[["Item1", RowIndex_$reflection()], ["Item2", tuple_type(DataType_$reflection(), string_type)]], [["Item", tuple_type(DataType_$reflection(), string_type)]]]);
182
+ return union_type("FsSpreadsheet.DSL.ColumnElement", [], ColumnElement, () => [[["Item1", RowIndex_$reflection()], ["Item2", tuple_type(DataType_$reflection(), obj_type)]], [["Item", tuple_type(DataType_$reflection(), obj_type)]]]);
183
183
  }
184
184
 
185
185
  export class RowElement extends Union {
@@ -194,7 +194,7 @@ export class RowElement extends Union {
194
194
  }
195
195
 
196
196
  export function RowElement_$reflection() {
197
- return union_type("FsSpreadsheet.DSL.RowElement", [], RowElement, () => [[["Item1", ColumnIndex_$reflection()], ["Item2", tuple_type(DataType_$reflection(), string_type)]], [["Item", tuple_type(DataType_$reflection(), string_type)]]]);
197
+ return union_type("FsSpreadsheet.DSL.RowElement", [], RowElement, () => [[["Item1", ColumnIndex_$reflection()], ["Item2", tuple_type(DataType_$reflection(), obj_type)]], [["Item", tuple_type(DataType_$reflection(), obj_type)]]]);
198
198
  }
199
199
 
200
200
  export class TableElement extends Union {
@@ -242,7 +242,7 @@ export class SheetElement extends Union {
242
242
  }
243
243
 
244
244
  export function SheetElement_$reflection() {
245
- return union_type("FsSpreadsheet.DSL.SheetElement", [], SheetElement, () => [[["Item1", string_type], ["Item2", list_type(TableElement_$reflection())]], [["Item1", RowIndex_$reflection()], ["Item2", list_type(RowElement_$reflection())]], [["Item", list_type(RowElement_$reflection())]], [["Item1", ColumnIndex_$reflection()], ["Item2", list_type(ColumnElement_$reflection())]], [["Item", list_type(ColumnElement_$reflection())]], [["Item1", RowIndex_$reflection()], ["Item2", ColumnIndex_$reflection()], ["Item3", tuple_type(DataType_$reflection(), string_type)]], [["Item", tuple_type(DataType_$reflection(), string_type)]]]);
245
+ return union_type("FsSpreadsheet.DSL.SheetElement", [], SheetElement, () => [[["Item1", string_type], ["Item2", list_type(TableElement_$reflection())]], [["Item1", RowIndex_$reflection()], ["Item2", list_type(RowElement_$reflection())]], [["Item", list_type(RowElement_$reflection())]], [["Item1", ColumnIndex_$reflection()], ["Item2", list_type(ColumnElement_$reflection())]], [["Item", list_type(ColumnElement_$reflection())]], [["Item1", RowIndex_$reflection()], ["Item2", ColumnIndex_$reflection()], ["Item3", tuple_type(DataType_$reflection(), obj_type)]], [["Item", tuple_type(DataType_$reflection(), obj_type)]]]);
246
246
  }
247
247
 
248
248
  export class WorkbookElement extends Union {
@@ -114,7 +114,8 @@ type FsColumn (rangeAddress : FsRangeAddress, cells : FsCellsCollection)=
114
114
  /// <summary>
115
115
  /// Checks if there is an FsCell at given row index of a given FsColumn.
116
116
  /// </summary>
117
- /// <param name="colIndex">The number of the row where the presence of an FsCell shall be checked.</param>
117
+ /// <param name="rowIndex">The number of the row where the presence of an FsCell shall be checked.</param>
118
+ /// <param name="column"></param>
118
119
  static member hasCellAt rowIndex (column : FsColumn) =
119
120
  column.HasCellAt rowIndex
120
121
 
@@ -143,6 +144,7 @@ type FsColumn (rangeAddress : FsRangeAddress, cells : FsCellsCollection)=
143
144
  /// Returns the FsCell at the given rowIndex if it exists in the given FsColumn. Else returns None.
144
145
  /// </summary>
145
146
  /// <param name="rowIndex">The number of the column where the FsCell shall be retrieved.</param>
147
+ /// <param name="column"></param>
146
148
  static member tryItem rowIndex (column : FsColumn) =
147
149
  column.TryItem rowIndex
148
150
 
@@ -117,6 +117,7 @@ type FsRow (rangeAddress : FsRangeAddress, cells : FsCellsCollection)=
117
117
  /// Checks if there is an FsCell at given column index of a given FsRow.
118
118
  /// </summary>
119
119
  /// <param name="colIndex">The number of the column where the presence of an FsCell shall be checked.</param>
120
+ /// <param name="row"></param>
120
121
  static member hasCellAt colIndex (row : FsRow) =
121
122
  row.HasCellAt colIndex
122
123
 
@@ -145,6 +146,7 @@ type FsRow (rangeAddress : FsRangeAddress, cells : FsCellsCollection)=
145
146
  /// Returns the FsCell at the given columnIndex if it exists in the given FsRow. Else returns None.
146
147
  /// </summary>
147
148
  /// <param name="colIndex">The number of the column where the FsCell shall be retrieved.</param>
149
+ /// <param name="row"></param>
148
150
  static member tryItem colIndex (row : FsRow) =
149
151
  row.TryItem colIndex
150
152
 
@@ -517,7 +517,16 @@ type FsWorksheet (name, ?fsRows, ?fsTables, ?fsCellsCollection) =
517
517
  ///
518
518
  /// If a cell exists at the given postion, it is shoved to the right.
519
519
  /// </summary>
520
- member self.InsertValueAt(value : 'a, rowIndex, colIndex)=
520
+ member self.InsertValueAt(value : System.IConvertible, rowIndex, colIndex)=
521
+ let cell = FsCell(value)
522
+ self.CellCollection.Add(int32 rowIndex, int32 colIndex, cell)
523
+
524
+ /// <summary>
525
+ /// Adds a value at the given row- and columnIndex to the FsWorksheet.
526
+ ///
527
+ /// If a cell exists at the given postion, it is shoved to the right.
528
+ /// </summary>
529
+ member self.InsertValueAt(value : obj, rowIndex, colIndex)=
521
530
  let cell = FsCell(value)
522
531
  self.CellCollection.Add(int32 rowIndex, int32 colIndex, cell)
523
532
 
@@ -339,6 +339,11 @@ export class FsWorksheet {
339
339
  const cell = new FsCell(value);
340
340
  FsCellsCollection__Add_2E78CE33(self.CellCollection, rowIndex, colIndex, cell);
341
341
  }
342
+ InsertValueAt(value, rowIndex, colIndex) {
343
+ const self = this;
344
+ const cell = new FsCell(value);
345
+ FsCellsCollection__Add_2E78CE33(self.CellCollection, rowIndex, colIndex, cell);
346
+ }
342
347
  static insertValueAt(value, rowIndex, colIndex, sheet) {
343
348
  sheet.InsertValueAt(value, rowIndex, colIndex);
344
349
  }
@@ -91,11 +91,11 @@ module SheetBuilder =
91
91
  let headerCell = FsCell.createEmpty()
92
92
  for header in field.HeaderTransformers do ignore (header row headerCell)
93
93
 
94
-
95
94
  let headerString =
96
- if headerCell.Value = "" then
95
+ if headerCell.ValueAsString() = "" then
97
96
  field.Hash
98
- else headerCell.Value
97
+ else
98
+ headerCell.ValueAsString()
99
99
 
100
100
  let tableField = self.Field(headerString,cells)
101
101
 
@@ -152,7 +152,7 @@ module SheetBuilder =
152
152
  let hasHeader, headerString =
153
153
  if headerCell.Value = "" then
154
154
  false, field.Hash
155
- else true, headerCell.Value
155
+ else true, headerCell.ValueAsString()
156
156
 
157
157
  match Dictionary.tryGetValue (headerString) headers with
158
158
  | Some int -> int
@@ -1,4 +1,4 @@
1
- import { disposeSafe, getEnumerator, curry2, defaultOf } from "../fable-library.4.1.4/Util.js";
1
+ import { equals, disposeSafe, getEnumerator, curry2, defaultOf } from "../fable-library.4.1.4/Util.js";
2
2
  import { addToDict, tryGetValue } from "../fable-library.4.1.4/MapUtil.js";
3
3
  import { Record, FSharpRef } from "../fable-library.4.1.4/Types.js";
4
4
  import { toNullable, some } from "../fable-library.4.1.4/Option.js";
@@ -181,7 +181,7 @@ export function FsSpreadsheet_FsTable__FsTable_Populate_526F9CF7(self, cells, da
181
181
  finally {
182
182
  disposeSafe(enumerator_2);
183
183
  }
184
- const headerString = (headerCell.Value === "") ? field_1.Hash : headerCell.Value;
184
+ const headerString = (headerCell.ValueAsString() === "") ? field_1.Hash : headerCell.ValueAsString();
185
185
  const activeCell = FsRangeColumn__Cell_Z4232C216(FsTableField__get_Column(self.Field(headerString, cells)), activeRowIndex, cells);
186
186
  const enumerator_3 = getEnumerator(field_1.CellTransformers);
187
187
  try {
@@ -233,7 +233,7 @@ export function FsSpreadsheet_FsWorksheet__FsWorksheet_Populate_Z2A1350BF(self,
233
233
  disposeSafe(enumerator_2);
234
234
  }
235
235
  let index;
236
- const patternInput = (headerCell.Value === "") ? [false, field_1.Hash] : [true, headerCell.Value];
236
+ const patternInput = equals(headerCell.Value, "") ? [false, field_1.Hash] : [true, headerCell.ValueAsString()];
237
237
  const headerString = patternInput[1];
238
238
  const matchValue = Dictionary_tryGetValue(headerString, headers);
239
239
  if (matchValue == null) {
@@ -59,10 +59,26 @@ type FsTable (name : string, rangeAddress : FsRangeAddress, ?showTotalsRow : boo
59
59
  /// <summary>
60
60
  /// Returns the header row as FsRangeRow. Scans for new fieldnames.
61
61
  /// </summary>
62
+ [<System.ObsoleteAttribute("Obsolete after `4.0.0`. Use TryGetHeaderRow or GetHeaderRow instead!")>]
62
63
  member this.HeadersRow() =
63
64
  if (not this.ShowHeaderRow) then null;
64
65
  else
65
- FsRange(base.RangeAddress).FirstRow();
66
+ FsRange(base.RangeAddress).FirstRow()
67
+
68
+ member this.TryGetHeaderRow(cellsCollection) =
69
+ match this.ShowHeaderRow with
70
+ | false -> None
71
+ | true ->
72
+ let rowIndex = this.RangeAddress.FirstAddress.RowNumber
73
+ let firstAddress = FsAddress(rowIndex, this.RangeAddress.FirstAddress.ColumnNumber)
74
+ let lastAddress = FsAddress(rowIndex, this.RangeAddress.LastAddress.ColumnNumber)
75
+ let range = FsRangeAddress (firstAddress, lastAddress)
76
+ FsRow(range, cellsCollection) |> Some
77
+
78
+ member this.GetHeaderRow(cellsCollection) =
79
+ match this.TryGetHeaderRow(cellsCollection) with
80
+ | Some hr -> hr
81
+ | None -> failwith $"""Error. Unable to get header row for table "{this.Name}" as `ShowHeaderRow` is set to `false`."""
66
82
 
67
83
  /// <summary>
68
84
  /// Returns the FsColumns from the FsTable.
@@ -420,10 +436,10 @@ type FsTable (name : string, rangeAddress : FsRangeAddress, ?showTotalsRow : boo
420
436
  if this.ShowHeaderRow then
421
437
  let oldFieldNames = _fieldNames
422
438
  _fieldNames <- new Dictionary<string, FsTableField>()
423
- let headersRow = this.HeadersRow();
439
+ let headersRow = this.GetHeaderRow(cellsCollection);
424
440
  let mutable cellPos = 0
425
- for cell in headersRow.Cells(cellsCollection) do
426
- let mutable name = cell.Value //GetString();
441
+ for cell in headersRow do
442
+ let mutable name = cell.ValueAsString() //GetString();
427
443
  match Dictionary.tryGet name oldFieldNames with
428
444
  | Some tableField ->
429
445
  tableField.Index <- cellPos