@nfdi4plants/arctrl 1.0.0-alpha6

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 (277) hide show
  1. package/ARCtrl.js +257 -0
  2. package/Contract/Contract.js +95 -0
  3. package/Contracts/Contracts.ARCtrl.js +35 -0
  4. package/Contracts/Contracts.ArcAssay.js +65 -0
  5. package/Contracts/Contracts.ArcInvestigation.js +58 -0
  6. package/Contracts/Contracts.ArcStudy.js +65 -0
  7. package/Contracts/Contracts.Git.js +91 -0
  8. package/FileSystem/Commit.js +18 -0
  9. package/FileSystem/DefaultGitignore.js +3 -0
  10. package/FileSystem/FileSystem.js +53 -0
  11. package/FileSystem/FileSystemTree.js +223 -0
  12. package/FileSystem/Path.js +38 -0
  13. package/FileSystemTree.js +51 -0
  14. package/ISA/ISA/ArcTypes/ArcTable.js +744 -0
  15. package/ISA/ISA/ArcTypes/ArcTableAux.js +1142 -0
  16. package/ISA/ISA/ArcTypes/ArcTables.js +380 -0
  17. package/ISA/ISA/ArcTypes/ArcTypes.js +2018 -0
  18. package/ISA/ISA/ArcTypes/CompositeCell.js +180 -0
  19. package/ISA/ISA/ArcTypes/CompositeColumn.js +42 -0
  20. package/ISA/ISA/ArcTypes/CompositeHeader.js +358 -0
  21. package/ISA/ISA/ArcTypes/CompositeRow.js +111 -0
  22. package/ISA/ISA/ArcTypes/IdentifierSetters.js +26 -0
  23. package/ISA/ISA/Builder/Types.js +243 -0
  24. package/ISA/ISA/Fable.js +50 -0
  25. package/ISA/ISA/Helper.js +326 -0
  26. package/ISA/ISA/Identifier.js +76 -0
  27. package/ISA/ISA/JsonTypes/AnnotationValue.js +56 -0
  28. package/ISA/ISA/JsonTypes/Assay.js +620 -0
  29. package/ISA/ISA/JsonTypes/AssayMaterials.js +39 -0
  30. package/ISA/ISA/JsonTypes/ColumnIndex.js +246 -0
  31. package/ISA/ISA/JsonTypes/Comment.js +58 -0
  32. package/ISA/ISA/JsonTypes/CommentList.js +139 -0
  33. package/ISA/ISA/JsonTypes/Component.js +158 -0
  34. package/ISA/ISA/JsonTypes/Data.js +55 -0
  35. package/ISA/ISA/JsonTypes/DataFile.js +68 -0
  36. package/ISA/ISA/JsonTypes/Factor.js +128 -0
  37. package/ISA/ISA/JsonTypes/FactorValue.js +109 -0
  38. package/ISA/ISA/JsonTypes/Investigation.js +204 -0
  39. package/ISA/ISA/JsonTypes/Material.js +66 -0
  40. package/ISA/ISA/JsonTypes/MaterialAttribute.js +101 -0
  41. package/ISA/ISA/JsonTypes/MaterialAttributeValue.js +126 -0
  42. package/ISA/ISA/JsonTypes/MaterialType.js +41 -0
  43. package/ISA/ISA/JsonTypes/OntologyAnnotation.js +219 -0
  44. package/ISA/ISA/JsonTypes/OntologySourceReference.js +85 -0
  45. package/ISA/ISA/JsonTypes/Person.js +137 -0
  46. package/ISA/ISA/JsonTypes/Process.js +401 -0
  47. package/ISA/ISA/JsonTypes/ProcessInput.js +297 -0
  48. package/ISA/ISA/JsonTypes/ProcessOutput.js +263 -0
  49. package/ISA/ISA/JsonTypes/ProcessParameterValue.js +129 -0
  50. package/ISA/ISA/JsonTypes/ProcessSequence.js +255 -0
  51. package/ISA/ISA/JsonTypes/Protocol.js +277 -0
  52. package/ISA/ISA/JsonTypes/ProtocolParameter.js +101 -0
  53. package/ISA/ISA/JsonTypes/Publication.js +105 -0
  54. package/ISA/ISA/JsonTypes/Sample.js +71 -0
  55. package/ISA/ISA/JsonTypes/Source.js +54 -0
  56. package/ISA/ISA/JsonTypes/Study.js +942 -0
  57. package/ISA/ISA/JsonTypes/StudyMaterials.js +45 -0
  58. package/ISA/ISA/JsonTypes/URI.js +19 -0
  59. package/ISA/ISA/JsonTypes/Value.js +210 -0
  60. package/ISA/ISA/Regex.js +588 -0
  61. package/ISA/ISA.Json/Assay.js +123 -0
  62. package/ISA/ISA.Json/Comment.js +84 -0
  63. package/ISA/ISA.Json/ConverterOptions.js +33 -0
  64. package/ISA/ISA.Json/Data.js +271 -0
  65. package/ISA/ISA.Json/Decode.js +46 -0
  66. package/ISA/ISA.Json/Factor.js +194 -0
  67. package/ISA/ISA.Json/GEncode.js +15 -0
  68. package/ISA/ISA.Json/Investigation.js +132 -0
  69. package/ISA/ISA.Json/Material.js +233 -0
  70. package/ISA/ISA.Json/Ontology.js +204 -0
  71. package/ISA/ISA.Json/Person.js +204 -0
  72. package/ISA/ISA.Json/Process.js +291 -0
  73. package/ISA/ISA.Json/Protocol.js +242 -0
  74. package/ISA/ISA.Json/Publication.js +92 -0
  75. package/ISA/ISA.Json/Study.js +230 -0
  76. package/ISA/ISA.Json/Validation/Fable.js +69 -0
  77. package/ISA/ISA.Json/Validation/JsonSchemaValidation.js +88 -0
  78. package/ISA/ISA.Json/Validation/ValidationResult.js +45 -0
  79. package/ISA/ISA.Spreadsheet/AnnotationTable/ArcTable.js +137 -0
  80. package/ISA/ISA.Spreadsheet/AnnotationTable/CompositeCell.js +78 -0
  81. package/ISA/ISA.Spreadsheet/AnnotationTable/CompositeColumn.js +59 -0
  82. package/ISA/ISA.Spreadsheet/AnnotationTable/CompositeHeader.js +478 -0
  83. package/ISA/ISA.Spreadsheet/ArcAssay.js +150 -0
  84. package/ISA/ISA.Spreadsheet/ArcInvestigation.js +314 -0
  85. package/ISA/ISA.Spreadsheet/ArcStudy.js +67 -0
  86. package/ISA/ISA.Spreadsheet/CollectionAux.js +128 -0
  87. package/ISA/ISA.Spreadsheet/Metadata/Assays.js +81 -0
  88. package/ISA/ISA.Spreadsheet/Metadata/Comment.js +60 -0
  89. package/ISA/ISA.Spreadsheet/Metadata/Contacts.js +104 -0
  90. package/ISA/ISA.Spreadsheet/Metadata/Conversions.js +180 -0
  91. package/ISA/ISA.Spreadsheet/Metadata/DesignDescriptors.js +27 -0
  92. package/ISA/ISA.Spreadsheet/Metadata/Factors.js +85 -0
  93. package/ISA/ISA.Spreadsheet/Metadata/OntologyAnnotation.js +65 -0
  94. package/ISA/ISA.Spreadsheet/Metadata/OntologySourceReference.js +73 -0
  95. package/ISA/ISA.Spreadsheet/Metadata/Protocols.js +116 -0
  96. package/ISA/ISA.Spreadsheet/Metadata/Publication.js +96 -0
  97. package/ISA/ISA.Spreadsheet/Metadata/SparseTable.js +451 -0
  98. package/ISA/ISA.Spreadsheet/Metadata/Study.js +260 -0
  99. package/README.md +277 -0
  100. package/SemVer.js +60 -0
  101. package/Templates/Templates.Json.js +40 -0
  102. package/Templates/Templates.Spreadsheet.js +315 -0
  103. package/Templates/Templates.js +179 -0
  104. package/fable_modules/FsSpreadsheet.4.1.0/Cells/FsCell.fs +387 -0
  105. package/fable_modules/FsSpreadsheet.4.1.0/Cells/FsCell.fs.js +240 -0
  106. package/fable_modules/FsSpreadsheet.4.1.0/Cells/FsCellsCollection.fs +725 -0
  107. package/fable_modules/FsSpreadsheet.4.1.0/Cells/FsCellsCollection.fs.js +522 -0
  108. package/fable_modules/FsSpreadsheet.4.1.0/DSL/CellBuilder.fs +195 -0
  109. package/fable_modules/FsSpreadsheet.4.1.0/DSL/CellBuilder.fs.js +208 -0
  110. package/fable_modules/FsSpreadsheet.4.1.0/DSL/ColumnBuilder.fs +209 -0
  111. package/fable_modules/FsSpreadsheet.4.1.0/DSL/ColumnBuilder.fs.js +137 -0
  112. package/fable_modules/FsSpreadsheet.4.1.0/DSL/DSL.fs +61 -0
  113. package/fable_modules/FsSpreadsheet.4.1.0/DSL/DSL.fs.js +62 -0
  114. package/fable_modules/FsSpreadsheet.4.1.0/DSL/Expression.fs +24 -0
  115. package/fable_modules/FsSpreadsheet.4.1.0/DSL/Expression.fs.js +56 -0
  116. package/fable_modules/FsSpreadsheet.4.1.0/DSL/Operators.fs +102 -0
  117. package/fable_modules/FsSpreadsheet.4.1.0/DSL/Operators.fs.js +6 -0
  118. package/fable_modules/FsSpreadsheet.4.1.0/DSL/RowBuilder.fs +200 -0
  119. package/fable_modules/FsSpreadsheet.4.1.0/DSL/RowBuilder.fs.js +137 -0
  120. package/fable_modules/FsSpreadsheet.4.1.0/DSL/SheetBuilder.fs +139 -0
  121. package/fable_modules/FsSpreadsheet.4.1.0/DSL/SheetBuilder.fs.js +116 -0
  122. package/fable_modules/FsSpreadsheet.4.1.0/DSL/TableBuilder.fs +120 -0
  123. package/fable_modules/FsSpreadsheet.4.1.0/DSL/TableBuilder.fs.js +120 -0
  124. package/fable_modules/FsSpreadsheet.4.1.0/DSL/Transform.fs +229 -0
  125. package/fable_modules/FsSpreadsheet.4.1.0/DSL/Transform.fs.js +421 -0
  126. package/fable_modules/FsSpreadsheet.4.1.0/DSL/Types.fs +151 -0
  127. package/fable_modules/FsSpreadsheet.4.1.0/DSL/Types.fs.js +277 -0
  128. package/fable_modules/FsSpreadsheet.4.1.0/DSL/WorkbookBuilder.fs +114 -0
  129. package/fable_modules/FsSpreadsheet.4.1.0/DSL/WorkbookBuilder.fs.js +104 -0
  130. package/fable_modules/FsSpreadsheet.4.1.0/FsAddress.fs +177 -0
  131. package/fable_modules/FsSpreadsheet.4.1.0/FsAddress.fs.js +249 -0
  132. package/fable_modules/FsSpreadsheet.4.1.0/FsColumn.fs +200 -0
  133. package/fable_modules/FsSpreadsheet.4.1.0/FsColumn.fs.js +125 -0
  134. package/fable_modules/FsSpreadsheet.4.1.0/FsRow.fs +202 -0
  135. package/fable_modules/FsSpreadsheet.4.1.0/FsRow.fs.js +135 -0
  136. package/fable_modules/FsSpreadsheet.4.1.0/FsSpreadsheet.fableproj +58 -0
  137. package/fable_modules/FsSpreadsheet.4.1.0/FsWorkbook.fs +183 -0
  138. package/fable_modules/FsSpreadsheet.4.1.0/FsWorkbook.fs.js +138 -0
  139. package/fable_modules/FsSpreadsheet.4.1.0/FsWorksheet.fs +628 -0
  140. package/fable_modules/FsSpreadsheet.4.1.0/FsWorksheet.fs.js +398 -0
  141. package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRange.fs +19 -0
  142. package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRange.fs.js +41 -0
  143. package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeAddress.fs +222 -0
  144. package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeAddress.fs.js +235 -0
  145. package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeBase.fs +93 -0
  146. package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeBase.fs.js +91 -0
  147. package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeColumn.fs +65 -0
  148. package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeColumn.fs.js +74 -0
  149. package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeRow.fs +22 -0
  150. package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeRow.fs.js +40 -0
  151. package/fable_modules/FsSpreadsheet.4.1.0/SheetBuilder.fs +249 -0
  152. package/fable_modules/FsSpreadsheet.4.1.0/SheetBuilder.fs.js +325 -0
  153. package/fable_modules/FsSpreadsheet.4.1.0/Tables/FsTable.fs +455 -0
  154. package/fable_modules/FsSpreadsheet.4.1.0/Tables/FsTable.fs.js +310 -0
  155. package/fable_modules/FsSpreadsheet.4.1.0/Tables/FsTableField.fs +140 -0
  156. package/fable_modules/FsSpreadsheet.4.1.0/Tables/FsTableField.fs.js +173 -0
  157. package/fable_modules/FsSpreadsheet.4.1.0/Tables/FsTableRow.fs +6 -0
  158. package/fable_modules/FsSpreadsheet.4.1.0/Tables/FsTableRow.fs.js +17 -0
  159. package/fable_modules/FsSpreadsheet.4.1.0/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +3 -0
  160. package/fable_modules/FsSpreadsheet.4.1.0/obj/Debug/netstandard2.0/FsSpreadsheet.AssemblyInfo.fs +19 -0
  161. package/fable_modules/FsSpreadsheet.4.1.0/obj/Release/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +3 -0
  162. package/fable_modules/FsSpreadsheet.4.1.0/obj/Release/netstandard2.0/FsSpreadsheet.AssemblyInfo.fs +19 -0
  163. package/fable_modules/Thoth.Json.10.1.0/Decode.fs +1366 -0
  164. package/fable_modules/Thoth.Json.10.1.0/Decode.fs.js +1798 -0
  165. package/fable_modules/Thoth.Json.10.1.0/Encode.fs +621 -0
  166. package/fable_modules/Thoth.Json.10.1.0/Encode.fs.js +472 -0
  167. package/fable_modules/Thoth.Json.10.1.0/Extra.fs +31 -0
  168. package/fable_modules/Thoth.Json.10.1.0/Extra.fs.js +8 -0
  169. package/fable_modules/Thoth.Json.10.1.0/Thoth.Json.fableproj +30 -0
  170. package/fable_modules/Thoth.Json.10.1.0/Types.fs +59 -0
  171. package/fable_modules/Thoth.Json.10.1.0/Types.fs.js +98 -0
  172. package/fable_modules/Thoth.Json.10.1.0/obj/Release/netstandard2.0/Thoth.Json.AssemblyInfo.fs +19 -0
  173. package/fable_modules/Thoth.Json.10.1.0/package.json +5 -0
  174. package/fable_modules/fable-library.4.1.4/Array.d.ts +120 -0
  175. package/fable_modules/fable-library.4.1.4/Array.js +1204 -0
  176. package/fable_modules/fable-library.4.1.4/Async.d.ts +32 -0
  177. package/fable_modules/fable-library.4.1.4/Async.js +158 -0
  178. package/fable_modules/fable-library.4.1.4/AsyncBuilder.d.ts +59 -0
  179. package/fable_modules/fable-library.4.1.4/AsyncBuilder.js +183 -0
  180. package/fable_modules/fable-library.4.1.4/BigInt.d.ts +115 -0
  181. package/fable_modules/fable-library.4.1.4/BigInt.js +282 -0
  182. package/fable_modules/fable-library.4.1.4/BitConverter.d.ts +27 -0
  183. package/fable_modules/fable-library.4.1.4/BitConverter.js +138 -0
  184. package/fable_modules/fable-library.4.1.4/Boolean.d.ts +3 -0
  185. package/fable_modules/fable-library.4.1.4/Boolean.js +21 -0
  186. package/fable_modules/fable-library.4.1.4/Char.d.ts +65 -0
  187. package/fable_modules/fable-library.4.1.4/Char.js +169 -0
  188. package/fable_modules/fable-library.4.1.4/Choice.d.ts +138 -0
  189. package/fable_modules/fable-library.4.1.4/Choice.js +227 -0
  190. package/fable_modules/fable-library.4.1.4/Date.d.ts +70 -0
  191. package/fable_modules/fable-library.4.1.4/Date.js +451 -0
  192. package/fable_modules/fable-library.4.1.4/DateOffset.d.ts +63 -0
  193. package/fable_modules/fable-library.4.1.4/DateOffset.js +268 -0
  194. package/fable_modules/fable-library.4.1.4/DateOnly.d.ts +18 -0
  195. package/fable_modules/fable-library.4.1.4/DateOnly.js +124 -0
  196. package/fable_modules/fable-library.4.1.4/Decimal.d.ts +45 -0
  197. package/fable_modules/fable-library.4.1.4/Decimal.js +212 -0
  198. package/fable_modules/fable-library.4.1.4/Double.d.ts +11 -0
  199. package/fable_modules/fable-library.4.1.4/Double.js +46 -0
  200. package/fable_modules/fable-library.4.1.4/Encoding.d.ts +12 -0
  201. package/fable_modules/fable-library.4.1.4/Encoding.js +173 -0
  202. package/fable_modules/fable-library.4.1.4/Event.d.ts +31 -0
  203. package/fable_modules/fable-library.4.1.4/Event.js +93 -0
  204. package/fable_modules/fable-library.4.1.4/FSharp.Collections.d.ts +7 -0
  205. package/fable_modules/fable-library.4.1.4/FSharp.Collections.js +27 -0
  206. package/fable_modules/fable-library.4.1.4/FSharp.Core.d.ts +17 -0
  207. package/fable_modules/fable-library.4.1.4/FSharp.Core.js +69 -0
  208. package/fable_modules/fable-library.4.1.4/Global.d.ts +24 -0
  209. package/fable_modules/fable-library.4.1.4/Global.js +8 -0
  210. package/fable_modules/fable-library.4.1.4/Guid.d.ts +10 -0
  211. package/fable_modules/fable-library.4.1.4/Guid.js +142 -0
  212. package/fable_modules/fable-library.4.1.4/Int32.d.ts +28 -0
  213. package/fable_modules/fable-library.4.1.4/Int32.js +135 -0
  214. package/fable_modules/fable-library.4.1.4/List.d.ts +143 -0
  215. package/fable_modules/fable-library.4.1.4/List.js +1273 -0
  216. package/fable_modules/fable-library.4.1.4/Long.d.ts +3 -0
  217. package/fable_modules/fable-library.4.1.4/Long.js +46 -0
  218. package/fable_modules/fable-library.4.1.4/MailboxProcessor.d.ts +25 -0
  219. package/fable_modules/fable-library.4.1.4/MailboxProcessor.js +93 -0
  220. package/fable_modules/fable-library.4.1.4/Map.d.ts +178 -0
  221. package/fable_modules/fable-library.4.1.4/Map.js +1396 -0
  222. package/fable_modules/fable-library.4.1.4/MapUtil.d.ts +10 -0
  223. package/fable_modules/fable-library.4.1.4/MapUtil.js +112 -0
  224. package/fable_modules/fable-library.4.1.4/MutableMap.d.ts +52 -0
  225. package/fable_modules/fable-library.4.1.4/MutableMap.js +326 -0
  226. package/fable_modules/fable-library.4.1.4/MutableSet.d.ts +39 -0
  227. package/fable_modules/fable-library.4.1.4/MutableSet.js +232 -0
  228. package/fable_modules/fable-library.4.1.4/Native.d.ts +2 -0
  229. package/fable_modules/fable-library.4.1.4/Native.js +8 -0
  230. package/fable_modules/fable-library.4.1.4/Numeric.d.ts +19 -0
  231. package/fable_modules/fable-library.4.1.4/Numeric.js +71 -0
  232. package/fable_modules/fable-library.4.1.4/Observable.d.ts +32 -0
  233. package/fable_modules/fable-library.4.1.4/Observable.js +113 -0
  234. package/fable_modules/fable-library.4.1.4/Option.d.ts +28 -0
  235. package/fable_modules/fable-library.4.1.4/Option.js +96 -0
  236. package/fable_modules/fable-library.4.1.4/README.md +3 -0
  237. package/fable_modules/fable-library.4.1.4/Random.d.ts +37 -0
  238. package/fable_modules/fable-library.4.1.4/Random.js +170 -0
  239. package/fable_modules/fable-library.4.1.4/Range.d.ts +12 -0
  240. package/fable_modules/fable-library.4.1.4/Range.js +45 -0
  241. package/fable_modules/fable-library.4.1.4/Reflection.d.ts +119 -0
  242. package/fable_modules/fable-library.4.1.4/Reflection.js +461 -0
  243. package/fable_modules/fable-library.4.1.4/RegExp.d.ts +10 -0
  244. package/fable_modules/fable-library.4.1.4/RegExp.js +132 -0
  245. package/fable_modules/fable-library.4.1.4/Seq.d.ts +165 -0
  246. package/fable_modules/fable-library.4.1.4/Seq.js +1379 -0
  247. package/fable_modules/fable-library.4.1.4/Seq2.d.ts +18 -0
  248. package/fable_modules/fable-library.4.1.4/Seq2.js +111 -0
  249. package/fable_modules/fable-library.4.1.4/Set.d.ts +190 -0
  250. package/fable_modules/fable-library.4.1.4/Set.js +1789 -0
  251. package/fable_modules/fable-library.4.1.4/String.d.ts +49 -0
  252. package/fable_modules/fable-library.4.1.4/String.js +540 -0
  253. package/fable_modules/fable-library.4.1.4/System.Collections.Generic.d.ts +71 -0
  254. package/fable_modules/fable-library.4.1.4/System.Collections.Generic.js +307 -0
  255. package/fable_modules/fable-library.4.1.4/System.Text.d.ts +30 -0
  256. package/fable_modules/fable-library.4.1.4/System.Text.js +110 -0
  257. package/fable_modules/fable-library.4.1.4/SystemException.d.ts +5 -0
  258. package/fable_modules/fable-library.4.1.4/SystemException.js +5 -0
  259. package/fable_modules/fable-library.4.1.4/TimeOnly.d.ts +15 -0
  260. package/fable_modules/fable-library.4.1.4/TimeOnly.js +122 -0
  261. package/fable_modules/fable-library.4.1.4/TimeSpan.d.ts +34 -0
  262. package/fable_modules/fable-library.4.1.4/TimeSpan.js +177 -0
  263. package/fable_modules/fable-library.4.1.4/Timer.d.ts +19 -0
  264. package/fable_modules/fable-library.4.1.4/Timer.js +67 -0
  265. package/fable_modules/fable-library.4.1.4/Types.d.ts +58 -0
  266. package/fable_modules/fable-library.4.1.4/Types.js +208 -0
  267. package/fable_modules/fable-library.4.1.4/Unicode.13.0.0.d.ts +2 -0
  268. package/fable_modules/fable-library.4.1.4/Unicode.13.0.0.js +4 -0
  269. package/fable_modules/fable-library.4.1.4/Uri.d.ts +29 -0
  270. package/fable_modules/fable-library.4.1.4/Uri.js +142 -0
  271. package/fable_modules/fable-library.4.1.4/Util.d.ts +187 -0
  272. package/fable_modules/fable-library.4.1.4/Util.js +662 -0
  273. package/fable_modules/fable-library.4.1.4/lib/big.d.ts +338 -0
  274. package/fable_modules/fable-library.4.1.4/lib/big.js +826 -0
  275. package/fable_modules/fable-library.4.1.4/package.json +23 -0
  276. package/fable_modules/project_cracked.json +1 -0
  277. package/package.json +22 -0
@@ -0,0 +1,455 @@
1
+ namespace FsSpreadsheet
2
+
3
+ open System.Collections.Generic
4
+
5
+ open Fable.Core
6
+
7
+ /// <summary>
8
+ /// Creates an FsTable from the given name and FsRangeAddres, with totals row shown and header row shown or not, accordingly.
9
+ /// </summary>
10
+ [<AttachMembers>]
11
+ type FsTable (name : string, rangeAddress : FsRangeAddress, ?showTotalsRow : bool, ?showHeaderRow : bool) =
12
+
13
+ inherit FsRangeBase(rangeAddress)
14
+
15
+ let mutable _name = name.Trim().Replace(" ","_")
16
+
17
+ let mutable _lastRangeAddress = rangeAddress
18
+ let mutable _showTotalsRow : bool = Option.defaultValue false showTotalsRow
19
+ let mutable _showHeaderRow : bool = Option.defaultValue true showHeaderRow
20
+
21
+ let mutable _fieldNames : Dictionary<string,FsTableField> = Dictionary()
22
+ let _uniqueNames : HashSet<string> = HashSet()
23
+
24
+
25
+ /// <summary>
26
+ /// The name of the FsTable.
27
+ /// </summary>
28
+ member this.Name
29
+ with get() = _name
30
+
31
+ /// <summary>
32
+ /// Returns all fieldnames as `fieldname*FsTableField` dictionary.
33
+ /// </summary>
34
+ member this.GetFieldNames (cellsCollection : FsCellsCollection) =
35
+ if (_fieldNames <> null && _lastRangeAddress <> null && _lastRangeAddress.Equals(this.RangeAddress)) then
36
+ _fieldNames;
37
+ else
38
+ _lastRangeAddress <- this.RangeAddress
39
+
40
+ //this.RescanFieldNames(cellsCollection)
41
+
42
+ _fieldNames;
43
+
44
+ /// <summary>
45
+ /// The FsTableFields of this FsTable.
46
+ /// </summary>
47
+ member this.GetFields (cellsCollection : FsCellsCollection) =
48
+ let columnCount = base.ColumnCount()
49
+ //let offset = base.RangeAddress.FirstAddress.ColumnNumber
50
+ Seq.init columnCount (fun i -> this.GetFieldAt(i, cellsCollection))
51
+
52
+ /// <summary>
53
+ /// Gets or sets if the header row is shown.
54
+ /// </summary>
55
+ member this.ShowHeaderRow
56
+ with get () = _showHeaderRow
57
+ and set(showHeaderRow) = _showHeaderRow <- showHeaderRow
58
+
59
+ /// <summary>
60
+ /// Returns the header row as FsRangeRow. Scans for new fieldnames.
61
+ /// </summary>
62
+ member this.HeadersRow() =
63
+ if (not this.ShowHeaderRow) then null;
64
+ else
65
+ FsRange(base.RangeAddress).FirstRow();
66
+
67
+ /// <summary>
68
+ /// Returns the FsColumns from the FsTable.
69
+ /// </summary>
70
+ /// <param name="cellsCollection">The FsCellsCollection associated with this FsTable.</param>
71
+ member this.GetColumns(cellsCollection : FsCellsCollection) =
72
+ seq {
73
+ for i = this.RangeAddress.FirstAddress.ColumnNumber to this.RangeAddress.LastAddress.ColumnNumber do
74
+ let firstAddress = FsAddress(this.RangeAddress.FirstAddress.RowNumber, i)
75
+ let lastAddress = FsAddress(this.RangeAddress.LastAddress.RowNumber, i)
76
+ let range = FsRangeAddress (firstAddress, lastAddress)
77
+ FsColumn(range, cellsCollection)
78
+ }
79
+
80
+ /// <summary>
81
+ /// Returns the FsRows from the FsTable.
82
+ /// </summary>
83
+ /// <param name="cellsCollection">The FsCellsCollection associated with this FsTable.</param>
84
+ member this.GetRows(cellsCollection : FsCellsCollection) =
85
+ seq {
86
+ for i = this.RangeAddress.FirstAddress.RowNumber to this.RangeAddress.LastAddress.RowNumber do
87
+ let firstAddress = FsAddress(i, this.RangeAddress.FirstAddress.ColumnNumber)
88
+ let lastAddress = FsAddress(i, this.RangeAddress.LastAddress.ColumnNumber)
89
+ let range = FsRangeAddress (firstAddress, lastAddress)
90
+ FsRow(range, cellsCollection)
91
+ }
92
+
93
+ /// <summary>
94
+ /// Updates the FsRangeAddress of the FsTable according to the FsTableFields associated.
95
+ /// </summary>
96
+ member this.RescanRange() =
97
+ let rangeAddress =
98
+ _fieldNames.Values
99
+ |> Seq.map (fun v -> v.Column.RangeAddress)
100
+ |> Seq.reduce (fun r1 r2 -> r1.Union(r2))
101
+ base.RangeAddress <- rangeAddress
102
+
103
+ /// <summary>
104
+ /// Updates the FsRangeAddress of a given FsTable according to the FsTableFields associated.
105
+ /// </summary>
106
+ static member rescanRange (table : FsTable) =
107
+ table.RescanRange()
108
+ table
109
+
110
+ /// <summary>
111
+ /// Returns a unique name consisting of the original name and an initial offset that is raised
112
+ /// if the original name with that offset is already present.
113
+ /// </summary>
114
+ /// <param name="originalName">Header name that was tried to be used.</param>
115
+ /// <param name="initialOffset">First number that together with the originalName, leads to a unique column header.</param>
116
+ /// <param name="enforceOffset">If true, the initial offset is always applied.</param>
117
+ member this.GetUniqueName(originalName : string, initialOffset : int32, enforceOffset : bool) =
118
+ let mutable name = originalName + if enforceOffset then string initialOffset else ""
119
+ if _uniqueNames.Contains(name) then
120
+
121
+ let mutable i = initialOffset
122
+ name <- originalName + string i
123
+ while _uniqueNames.Contains(name) do
124
+
125
+ i <- i + 1
126
+ name <- originalName + string i
127
+
128
+ _uniqueNames.Add name |> ignore
129
+ name
130
+
131
+ /// <summary>
132
+ /// Returns a unique name consisting of the original name and an initial offset that is raised
133
+ /// if the original name with that offset is already present.
134
+ /// </summary>
135
+ /// <param name="originalName">Header name that was tried to be used.</param>
136
+ /// <param name="initialOffset">First number that together with the originalName, leads to a unique column header.</param>
137
+ /// <param name="enforceOffset">If true, the initial offset is always applied.</param>
138
+ /// <param name="table">The FsTable on which this function is called.</param>
139
+ static member getUniqueNames originalName initialOffset enforceOffset (table : FsTable) =
140
+ table.GetUniqueName(originalName, initialOffset, enforceOffset)
141
+
142
+ /// <summary>
143
+ /// Creates and adds FsTableFields from a sequence of field names to the FsTable.
144
+ /// </summary>
145
+ member this.InitFields(fieldNames : seq<string>) =
146
+ // _fieldNames = new Dictionary<String, IXLTableField>(); // let's _not_ do it this way.
147
+ //let rangeCols = FsRangeAddress.toRangeColumns base.RangeAddress
148
+ fieldNames
149
+ |> Seq.iteri (
150
+ fun i fn ->
151
+ let tableField = FsTableField(fn, i, FsRangeColumn i)
152
+ _fieldNames.Add(fn, tableField)
153
+ )
154
+
155
+ /// <summary>
156
+ /// Creates and adds FsTableFields from a sequence of field names to a given FsTable.
157
+ /// </summary>
158
+ static member initFields (fieldNames : seq<string>) (table : FsTable) =
159
+ table.InitFields fieldNames
160
+ table
161
+
162
+ /// <summary>
163
+ /// Adds a sequence of FsTableFields to the FsTable.
164
+ /// </summary>
165
+ member this.AddFields(tableFields : seq<FsTableField>) =
166
+ tableFields
167
+ |> Seq.iter (
168
+ fun tf -> _fieldNames.Add(tf.Name, tf)
169
+ )
170
+
171
+ /// <summary>
172
+ /// Adds a sequence of FsTableFields to a given FsTable.
173
+ /// </summary>
174
+ static member addFields (tableFields : seq<FsTableField>) (table : FsTable) =
175
+ table.AddFields tableFields
176
+ table
177
+
178
+ /// <summary>
179
+ /// Returns the FsTableField with given name. If an FsTableField does not exist under this name in the FsTable, adds it.
180
+ /// </summary>
181
+ member this.Field(name : string, cellsCollection : FsCellsCollection) =
182
+ match Dictionary.tryGet name _fieldNames with
183
+ | Some field ->
184
+ field
185
+ | None ->
186
+ let maxIndex =
187
+ _fieldNames.Values
188
+ |> Seq.map (fun v -> v.Index)
189
+ |> fun s ->
190
+ if Seq.length s = 0 then 0 else Seq.max s
191
+ let range =
192
+ let offset = _fieldNames.Count
193
+ let firstAddress = FsAddress(this.RangeAddress.FirstAddress.RowNumber,this.RangeAddress.FirstAddress.ColumnNumber + offset)
194
+ let lastAddress = FsAddress(this.RangeAddress.LastAddress.RowNumber,this.RangeAddress.FirstAddress.ColumnNumber + offset)
195
+ FsRangeAddress(firstAddress,lastAddress)
196
+ let column = FsRangeColumn(range)
197
+ let newField = FsTableField(name,maxIndex + 1,column,null,null)
198
+ if this.ShowHeaderRow then
199
+ newField.HeaderCell(cellsCollection,true).SetValueAs name |> ignore
200
+ _fieldNames.Add(name,newField)
201
+ this.RescanRange()
202
+ newField
203
+
204
+ /// <summary>
205
+ /// Takes a name of an FsTableField and an FsCellsCollection (belonging to the FsWorksheet of this
206
+ /// FsTable) and returns the respective FsTableField.
207
+ /// </summary>
208
+ /// <exception cref="System.ArgumentException">if the header row has no field with the given name.</exception>
209
+ member this.GetField(name : string, cellsCollection : FsCellsCollection) =
210
+ let name = name.Replace("\r\n", "\n")
211
+ try this.GetFieldNames(cellsCollection).Item name
212
+ with _ -> failwith <| "The header row doesn't contain field name '" + name + "'."
213
+
214
+ /// <summary>
215
+ /// Takes a name of an FsTableField and an FsCellsCollection (belonging to the FsWorksheet of this
216
+ /// FsTable) and returns the respective FsTableField.
217
+ /// </summary>
218
+ /// <exception cref="System.ArgumentException">if the header row has no field with the given name.</exception>
219
+ static member getField (name : string) (cellsCollection : FsCellsCollection) (table : FsTable) =
220
+ table.GetField(name, cellsCollection)
221
+
222
+ /// <summary>
223
+ /// Takes the index of an FsTableField and an FsCellsCollection (belonging to the FsWorksheet of
224
+ /// this FsTable) and returns the respective FsTableField.
225
+ /// </summary>
226
+ /// <exception cref="System.ArgumentException">if the FsTable has no FsTableField with the given index.</exception>
227
+ member this.GetFieldAt(index, cellsCollection) =
228
+ try
229
+ this.GetFieldNames(cellsCollection).Values
230
+ |> Seq.find (fun ftf -> ftf.Index = index)
231
+ with _ -> failwith $"FsTableField with index {index} does not exist in the FsTable."
232
+
233
+ /// <summary>
234
+ /// Takes a name of an FsTableField and an FsCellsCollection (belonging to the FsWorksheet of
235
+ /// this FsTable) and returns the index of the respective FsTableField.
236
+ /// </summary>
237
+ /// <exception cref="System.ArgumentException">if the header row has no field with the given name.</exception>
238
+ member this.GetFieldIndex(name : string, cellsCollection) =
239
+ this.GetField(name, cellsCollection).Index
240
+
241
+ /// <summary>
242
+ /// Renames a fieldname of the FsTable if it exists. Else fails.
243
+ /// </summary>
244
+ /// <exception cref="System.ArgumentException">if the FsTableField does not exist in the FsTable.</exception>
245
+ member this.RenameField(oldName : string, newName : string) =
246
+ match Dictionary.tryGet oldName _fieldNames with
247
+ | Some field ->
248
+ _fieldNames.Remove(oldName) |> ignore
249
+ _fieldNames.Add(newName, field)
250
+ | None ->
251
+ raise (System.ArgumentException("The FsTabelField does not exist in this FsTable", "oldName"))
252
+
253
+ /// <summary>
254
+ /// Renames a fieldname of the FsTable if it exists. Else fails.
255
+ /// </summary>
256
+ /// <exception cref="System.ArgumentException">if the FsTableField does not exist in the FsTable.</exception>
257
+ static member renameField oldName newName (table : FsTable) =
258
+ table.RenameField(oldName, newName)
259
+ table
260
+
261
+ /// <summary>
262
+ /// Returns the header cell from a given FsCellsCollection with the given colum index if the cell exists. Else returns None.
263
+ /// </summary>
264
+ member this.TryGetHeaderCellOfColumnAt(cellsCollection : FsCellsCollection, colIndex : int) =
265
+ let fstRowIndex = this.RangeAddress.FirstAddress.RowNumber
266
+ cellsCollection.GetCellsInColumn colIndex
267
+ |> Seq.tryFind (fun c -> c.RowNumber = fstRowIndex)
268
+
269
+ /// <summary>
270
+ /// Returns the header cell from a given FsCellsCollection with the given column index in a given FsTable if the cell exists. Else
271
+ /// returns None.
272
+ /// </summary>
273
+ static member tryGetHeaderCellOfColumnIndexAt cellsCollection (colIndex : int) (table : FsTable) =
274
+ table.TryGetHeaderCellOfColumnAt(cellsCollection, colIndex)
275
+
276
+ /// <summary>
277
+ /// Returns the header cell of a given FsRangeColumn from a given FsCellsCollection if the cell exists. Else returns None.
278
+ /// </summary>
279
+ member this.TryGetHeaderCellOfColumn(cellsCollection : FsCellsCollection, column : FsRangeColumn) =
280
+ this.TryGetHeaderCellOfColumnAt(cellsCollection, column.Index)
281
+
282
+ /// <summary>
283
+ /// Returns the header cell of a given FsRangeColumn from a given FsCellsCollection in a given FsTable if the cell exists.
284
+ /// Else returns None.
285
+ /// </summary>
286
+ static member tryGetHeaderCellOfColumn cellsCollection (column : FsRangeColumn) (table : FsTable) =
287
+ table.TryGetHeaderCellOfColumn(cellsCollection, column)
288
+
289
+ /// <summary>
290
+ /// Returns the header cell from a given FsCellsCollection with the given colum index.
291
+ /// </summary>
292
+ /// <exception cref="System.NullReferenceException">if the FsCell cannot be found.</exception>
293
+ member this.GetHeaderCellOfColumnAt(cellsCollection, colIndex : int) =
294
+ this.TryGetHeaderCellOfColumnAt(cellsCollection, colIndex).Value
295
+
296
+ /// <summary>
297
+ /// Returns the header cell from a given FsCellsCollection with the given colum index in a given FsTable.
298
+ /// </summary>
299
+ /// <exception cref="System.NullReferenceException">if the FsCell cannot be found.</exception>
300
+ static member getHeaderCellOfColumnIndexAt cellsCollection (colIndex : int) (table : FsTable) =
301
+ table.GetHeaderCellOfColumnAt(cellsCollection, colIndex)
302
+
303
+ /// <summary>
304
+ /// Returns the header cell of a given FsRangeColumn from a given FsCellsCollection.
305
+ /// </summary>
306
+ /// <exception cref="System.NullReferenceException">if the FsCell cannot be found.</exception>
307
+ member this.GetHeaderCellOfColumn(cellsCollection : FsCellsCollection, column : FsRangeColumn) =
308
+ this.TryGetHeaderCellOfColumn(cellsCollection, column).Value
309
+
310
+ /// <summary>
311
+ /// Returns the header cell of a given FsRangeColumn from a given FsCellsCollection in a given FsTable.
312
+ /// </summary>
313
+ /// <exception cref="System.NullReferenceException">if the FsCell cannot be found.</exception>
314
+ static member getHeaderCellOfColumn cellsCollection (column : FsRangeColumn) (table : FsTable) =
315
+ table.GetHeaderCellOfColumn(cellsCollection, column)
316
+
317
+ /// <summary>
318
+ /// Returns the header cell of a given FsTableField from a given FsCellsCollection.
319
+ /// </summary>
320
+ member this.GetHeaderCellOfTableField(cellsCollection, tableField : FsTableField) =
321
+ tableField.HeaderCell(cellsCollection, this.ShowHeaderRow)
322
+
323
+ /// <summary>
324
+ /// Returns the header cell of a given FsTableField from a given FsCellsCollection in a given FsTable.
325
+ /// </summary>
326
+ static member getHeaderCellOfTableField cellsCollection (tableField : FsTableField) (table : FsTable) =
327
+ table.GetHeaderCellOfTableField(cellsCollection, tableField)
328
+
329
+ /// <summary>
330
+ /// Returns the header cell from an FsTableField with the given index using a given FsCellsCollection if the cell exists.
331
+ /// Else returns None.
332
+ /// </summary>
333
+ member this.TryGetHeaderCellOfTableFieldAt(cellsCollection, tableFieldIndex : int) =
334
+ _fieldNames.Values
335
+ |> Seq.tryPick (
336
+ fun tf ->
337
+ if tf.Index = tableFieldIndex then
338
+ Some (tf.HeaderCell(cellsCollection, this.ShowHeaderRow))
339
+ else None
340
+ )
341
+
342
+ /// <summary>
343
+ /// Returns the header cell from an FsTableField with the given index using a given FsCellsCollection if the cell exists
344
+ /// in a given FsTable. Else returns None.
345
+ /// </summary>
346
+ static member tryGetHeaderCellOfTableFieldIndexAt cellsCollection (tableFieldIndex : int) (table : FsTable) =
347
+ table.TryGetHeaderCellOfTableFieldAt(cellsCollection, tableFieldIndex)
348
+
349
+ /// <summary>
350
+ /// Returns the header cell from an FsTableField with the given index using a given FsCellsCollection.
351
+ /// </summary>
352
+ /// <exception cref="System.NullReferenceException">if the FsCell cannot be found.</exception>
353
+ member this.GetHeaderCellOfTableFieldAt(cellsCollection, tableFieldIndex : int) =
354
+ this.TryGetHeaderCellOfTableFieldAt(cellsCollection, tableFieldIndex).Value
355
+
356
+ /// <summary>
357
+ /// Returns the header cell from an FsTableField with the given index using a given FsCellsCollection in a given FsTable.
358
+ /// </summary>
359
+ /// <exception cref="System.NullReferenceException">if the FsCell cannot be found.</exception>
360
+ static member getHeaderCellOfTableFieldIndexAt cellsCollection (tableFieldIndex : int) (table : FsTable) =
361
+ table.GetHeaderCellOfTableFieldAt(cellsCollection, tableFieldIndex)
362
+
363
+ /// <summary>
364
+ /// Returns the header cell from an FsTableField with the given name using an FsCellsCollection in the FsTable if the cell exists.
365
+ /// Else returns None.
366
+ /// </summary>
367
+ member this.TryGetHeaderCellByFieldName(cellsCollection, fieldName : string) =
368
+ match Dictionary.tryGet fieldName _fieldNames with
369
+ | Some tf -> Some (tf.HeaderCell(cellsCollection, this.ShowHeaderRow))
370
+ | None -> None
371
+
372
+ /// <summary>
373
+ /// Returns the header cell from an FsTableField with the given name using an FsCellsCollection in a given FsTable if the cell exists.
374
+ /// Else returns None.
375
+ /// </summary>
376
+ static member tryGetHeaderCellByFieldName cellsCollection (fieldName : string) (table : FsTable) =
377
+ table.TryGetHeaderCellByFieldName(cellsCollection, fieldName)
378
+
379
+ /// <summary>
380
+ /// Returns the data cells from a given FsCellsCollection with the given colum index.
381
+ /// </summary>
382
+ /// <remarks>Column index must fit the FsCellsCollection, not the FsTable!</remarks>
383
+ member this.GetDataCellsOfColumnAt(cellsCollection : FsCellsCollection, colIndex) =
384
+ let fstRowIndex = this.RangeAddress.FirstAddress.RowNumber
385
+ let lstRowIndex = this.RangeAddress.LastAddress.RowNumber
386
+ [fstRowIndex + 1 .. lstRowIndex]
387
+ |> Seq.choose (
388
+ fun ri -> cellsCollection.TryGetCell(ri, colIndex)
389
+ )
390
+
391
+ /// <summary>
392
+ /// Returns the data cells from a given FsCellsCollection with the given colum index in a given FsTable.
393
+ /// </summary>
394
+ /// <remarks>Column index must fit the FsCellsCollection, not the FsTable!</remarks>
395
+ static member getDataCellsOfColumnIndexAt cellsCollection (colIndex : int) (table : FsTable) =
396
+ table.GetDataCellsOfColumnAt(cellsCollection, colIndex)
397
+
398
+ // TO DO: add equivalents of the other methods regarding header cell for data cells.
399
+
400
+ /// <summary>
401
+ /// Creates a deep copy of this FsTable.
402
+ /// </summary>
403
+ member this.Copy() =
404
+ let ra = this.RangeAddress.Copy()
405
+ let nam = this.Name
406
+ let shr = this.ShowHeaderRow
407
+ FsTable(nam, ra, false, shr)
408
+
409
+ /// <summary>
410
+ /// Returns a deep copy of a given FsTable.
411
+ /// </summary>
412
+ static member copy (table : FsTable) =
413
+ table.Copy()
414
+
415
+
416
+ /// Updates the TableFields according to the range of the table and the underlying cellcollection.
417
+ ///
418
+ /// For this, maps over the range of the table and sets the header of the table fields to the value of the cell. If no cell value is set, the header value and the underlying cell value are set to a default value.
419
+ member this.RescanFieldNames(cellsCollection : FsCellsCollection) =
420
+ if this.ShowHeaderRow then
421
+ let oldFieldNames = _fieldNames
422
+ _fieldNames <- new Dictionary<string, FsTableField>()
423
+ let headersRow = this.HeadersRow();
424
+ let mutable cellPos = 0
425
+ for cell in headersRow.Cells(cellsCollection) do
426
+ let mutable name = cell.Value //GetString();
427
+ match Dictionary.tryGet name oldFieldNames with
428
+ | Some tableField ->
429
+ tableField.Index <- cellPos
430
+ _fieldNames.Add(name,tableField)
431
+ cellPos <- cellPos + 1
432
+ | None ->
433
+
434
+ // Be careful here. Fields names may actually be whitespace, but not empty
435
+ if (name = null) <> (name = "") then // TO DO: ask: shouldn't this be XOR?
436
+
437
+ name <- this.GetUniqueName("Column", cellPos + 1, true)
438
+ cell.SetValueAs(name) |> ignore
439
+ cell.DataType <- DataType.String
440
+
441
+ if (_fieldNames.ContainsKey(name)) then
442
+ raise (System.ArgumentException("The header row contains more than one field name '" + name + "'."))
443
+
444
+ _fieldNames.Add(name, new FsTableField(name, cellPos))
445
+ cellPos <- cellPos + 1
446
+ else
447
+
448
+ let colCount = base.ColumnCount();
449
+ for i = 1 to colCount do
450
+
451
+ if _fieldNames.Values |> Seq.exists (fun v -> v.Index = i - 1) |> not then
452
+
453
+ let name = "Column" + string i;
454
+
455
+ _fieldNames.Add(name, new FsTableField(name, i - 1));