@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.
- package/ARCtrl.js +257 -0
- package/Contract/Contract.js +95 -0
- package/Contracts/Contracts.ARCtrl.js +35 -0
- package/Contracts/Contracts.ArcAssay.js +65 -0
- package/Contracts/Contracts.ArcInvestigation.js +58 -0
- package/Contracts/Contracts.ArcStudy.js +65 -0
- package/Contracts/Contracts.Git.js +91 -0
- package/FileSystem/Commit.js +18 -0
- package/FileSystem/DefaultGitignore.js +3 -0
- package/FileSystem/FileSystem.js +53 -0
- package/FileSystem/FileSystemTree.js +223 -0
- package/FileSystem/Path.js +38 -0
- package/FileSystemTree.js +51 -0
- package/ISA/ISA/ArcTypes/ArcTable.js +744 -0
- package/ISA/ISA/ArcTypes/ArcTableAux.js +1142 -0
- package/ISA/ISA/ArcTypes/ArcTables.js +380 -0
- package/ISA/ISA/ArcTypes/ArcTypes.js +2018 -0
- package/ISA/ISA/ArcTypes/CompositeCell.js +180 -0
- package/ISA/ISA/ArcTypes/CompositeColumn.js +42 -0
- package/ISA/ISA/ArcTypes/CompositeHeader.js +358 -0
- package/ISA/ISA/ArcTypes/CompositeRow.js +111 -0
- package/ISA/ISA/ArcTypes/IdentifierSetters.js +26 -0
- package/ISA/ISA/Builder/Types.js +243 -0
- package/ISA/ISA/Fable.js +50 -0
- package/ISA/ISA/Helper.js +326 -0
- package/ISA/ISA/Identifier.js +76 -0
- package/ISA/ISA/JsonTypes/AnnotationValue.js +56 -0
- package/ISA/ISA/JsonTypes/Assay.js +620 -0
- package/ISA/ISA/JsonTypes/AssayMaterials.js +39 -0
- package/ISA/ISA/JsonTypes/ColumnIndex.js +246 -0
- package/ISA/ISA/JsonTypes/Comment.js +58 -0
- package/ISA/ISA/JsonTypes/CommentList.js +139 -0
- package/ISA/ISA/JsonTypes/Component.js +158 -0
- package/ISA/ISA/JsonTypes/Data.js +55 -0
- package/ISA/ISA/JsonTypes/DataFile.js +68 -0
- package/ISA/ISA/JsonTypes/Factor.js +128 -0
- package/ISA/ISA/JsonTypes/FactorValue.js +109 -0
- package/ISA/ISA/JsonTypes/Investigation.js +204 -0
- package/ISA/ISA/JsonTypes/Material.js +66 -0
- package/ISA/ISA/JsonTypes/MaterialAttribute.js +101 -0
- package/ISA/ISA/JsonTypes/MaterialAttributeValue.js +126 -0
- package/ISA/ISA/JsonTypes/MaterialType.js +41 -0
- package/ISA/ISA/JsonTypes/OntologyAnnotation.js +219 -0
- package/ISA/ISA/JsonTypes/OntologySourceReference.js +85 -0
- package/ISA/ISA/JsonTypes/Person.js +137 -0
- package/ISA/ISA/JsonTypes/Process.js +401 -0
- package/ISA/ISA/JsonTypes/ProcessInput.js +297 -0
- package/ISA/ISA/JsonTypes/ProcessOutput.js +263 -0
- package/ISA/ISA/JsonTypes/ProcessParameterValue.js +129 -0
- package/ISA/ISA/JsonTypes/ProcessSequence.js +255 -0
- package/ISA/ISA/JsonTypes/Protocol.js +277 -0
- package/ISA/ISA/JsonTypes/ProtocolParameter.js +101 -0
- package/ISA/ISA/JsonTypes/Publication.js +105 -0
- package/ISA/ISA/JsonTypes/Sample.js +71 -0
- package/ISA/ISA/JsonTypes/Source.js +54 -0
- package/ISA/ISA/JsonTypes/Study.js +942 -0
- package/ISA/ISA/JsonTypes/StudyMaterials.js +45 -0
- package/ISA/ISA/JsonTypes/URI.js +19 -0
- package/ISA/ISA/JsonTypes/Value.js +210 -0
- package/ISA/ISA/Regex.js +588 -0
- package/ISA/ISA.Json/Assay.js +123 -0
- package/ISA/ISA.Json/Comment.js +84 -0
- package/ISA/ISA.Json/ConverterOptions.js +33 -0
- package/ISA/ISA.Json/Data.js +271 -0
- package/ISA/ISA.Json/Decode.js +46 -0
- package/ISA/ISA.Json/Factor.js +194 -0
- package/ISA/ISA.Json/GEncode.js +15 -0
- package/ISA/ISA.Json/Investigation.js +132 -0
- package/ISA/ISA.Json/Material.js +233 -0
- package/ISA/ISA.Json/Ontology.js +204 -0
- package/ISA/ISA.Json/Person.js +204 -0
- package/ISA/ISA.Json/Process.js +291 -0
- package/ISA/ISA.Json/Protocol.js +242 -0
- package/ISA/ISA.Json/Publication.js +92 -0
- package/ISA/ISA.Json/Study.js +230 -0
- package/ISA/ISA.Json/Validation/Fable.js +69 -0
- package/ISA/ISA.Json/Validation/JsonSchemaValidation.js +88 -0
- package/ISA/ISA.Json/Validation/ValidationResult.js +45 -0
- package/ISA/ISA.Spreadsheet/AnnotationTable/ArcTable.js +137 -0
- package/ISA/ISA.Spreadsheet/AnnotationTable/CompositeCell.js +78 -0
- package/ISA/ISA.Spreadsheet/AnnotationTable/CompositeColumn.js +59 -0
- package/ISA/ISA.Spreadsheet/AnnotationTable/CompositeHeader.js +478 -0
- package/ISA/ISA.Spreadsheet/ArcAssay.js +150 -0
- package/ISA/ISA.Spreadsheet/ArcInvestigation.js +314 -0
- package/ISA/ISA.Spreadsheet/ArcStudy.js +67 -0
- package/ISA/ISA.Spreadsheet/CollectionAux.js +128 -0
- package/ISA/ISA.Spreadsheet/Metadata/Assays.js +81 -0
- package/ISA/ISA.Spreadsheet/Metadata/Comment.js +60 -0
- package/ISA/ISA.Spreadsheet/Metadata/Contacts.js +104 -0
- package/ISA/ISA.Spreadsheet/Metadata/Conversions.js +180 -0
- package/ISA/ISA.Spreadsheet/Metadata/DesignDescriptors.js +27 -0
- package/ISA/ISA.Spreadsheet/Metadata/Factors.js +85 -0
- package/ISA/ISA.Spreadsheet/Metadata/OntologyAnnotation.js +65 -0
- package/ISA/ISA.Spreadsheet/Metadata/OntologySourceReference.js +73 -0
- package/ISA/ISA.Spreadsheet/Metadata/Protocols.js +116 -0
- package/ISA/ISA.Spreadsheet/Metadata/Publication.js +96 -0
- package/ISA/ISA.Spreadsheet/Metadata/SparseTable.js +451 -0
- package/ISA/ISA.Spreadsheet/Metadata/Study.js +260 -0
- package/README.md +277 -0
- package/SemVer.js +60 -0
- package/Templates/Templates.Json.js +40 -0
- package/Templates/Templates.Spreadsheet.js +315 -0
- package/Templates/Templates.js +179 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Cells/FsCell.fs +387 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Cells/FsCell.fs.js +240 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Cells/FsCellsCollection.fs +725 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Cells/FsCellsCollection.fs.js +522 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/CellBuilder.fs +195 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/CellBuilder.fs.js +208 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/ColumnBuilder.fs +209 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/ColumnBuilder.fs.js +137 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/DSL.fs +61 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/DSL.fs.js +62 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/Expression.fs +24 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/Expression.fs.js +56 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/Operators.fs +102 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/Operators.fs.js +6 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/RowBuilder.fs +200 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/RowBuilder.fs.js +137 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/SheetBuilder.fs +139 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/SheetBuilder.fs.js +116 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/TableBuilder.fs +120 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/TableBuilder.fs.js +120 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/Transform.fs +229 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/Transform.fs.js +421 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/Types.fs +151 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/Types.fs.js +277 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/WorkbookBuilder.fs +114 -0
- package/fable_modules/FsSpreadsheet.4.1.0/DSL/WorkbookBuilder.fs.js +104 -0
- package/fable_modules/FsSpreadsheet.4.1.0/FsAddress.fs +177 -0
- package/fable_modules/FsSpreadsheet.4.1.0/FsAddress.fs.js +249 -0
- package/fable_modules/FsSpreadsheet.4.1.0/FsColumn.fs +200 -0
- package/fable_modules/FsSpreadsheet.4.1.0/FsColumn.fs.js +125 -0
- package/fable_modules/FsSpreadsheet.4.1.0/FsRow.fs +202 -0
- package/fable_modules/FsSpreadsheet.4.1.0/FsRow.fs.js +135 -0
- package/fable_modules/FsSpreadsheet.4.1.0/FsSpreadsheet.fableproj +58 -0
- package/fable_modules/FsSpreadsheet.4.1.0/FsWorkbook.fs +183 -0
- package/fable_modules/FsSpreadsheet.4.1.0/FsWorkbook.fs.js +138 -0
- package/fable_modules/FsSpreadsheet.4.1.0/FsWorksheet.fs +628 -0
- package/fable_modules/FsSpreadsheet.4.1.0/FsWorksheet.fs.js +398 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRange.fs +19 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRange.fs.js +41 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeAddress.fs +222 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeAddress.fs.js +235 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeBase.fs +93 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeBase.fs.js +91 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeColumn.fs +65 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeColumn.fs.js +74 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeRow.fs +22 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Ranges/FsRangeRow.fs.js +40 -0
- package/fable_modules/FsSpreadsheet.4.1.0/SheetBuilder.fs +249 -0
- package/fable_modules/FsSpreadsheet.4.1.0/SheetBuilder.fs.js +325 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Tables/FsTable.fs +455 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Tables/FsTable.fs.js +310 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Tables/FsTableField.fs +140 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Tables/FsTableField.fs.js +173 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Tables/FsTableRow.fs +6 -0
- package/fable_modules/FsSpreadsheet.4.1.0/Tables/FsTableRow.fs.js +17 -0
- package/fable_modules/FsSpreadsheet.4.1.0/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +3 -0
- package/fable_modules/FsSpreadsheet.4.1.0/obj/Debug/netstandard2.0/FsSpreadsheet.AssemblyInfo.fs +19 -0
- package/fable_modules/FsSpreadsheet.4.1.0/obj/Release/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +3 -0
- package/fable_modules/FsSpreadsheet.4.1.0/obj/Release/netstandard2.0/FsSpreadsheet.AssemblyInfo.fs +19 -0
- package/fable_modules/Thoth.Json.10.1.0/Decode.fs +1366 -0
- package/fable_modules/Thoth.Json.10.1.0/Decode.fs.js +1798 -0
- package/fable_modules/Thoth.Json.10.1.0/Encode.fs +621 -0
- package/fable_modules/Thoth.Json.10.1.0/Encode.fs.js +472 -0
- package/fable_modules/Thoth.Json.10.1.0/Extra.fs +31 -0
- package/fable_modules/Thoth.Json.10.1.0/Extra.fs.js +8 -0
- package/fable_modules/Thoth.Json.10.1.0/Thoth.Json.fableproj +30 -0
- package/fable_modules/Thoth.Json.10.1.0/Types.fs +59 -0
- package/fable_modules/Thoth.Json.10.1.0/Types.fs.js +98 -0
- package/fable_modules/Thoth.Json.10.1.0/obj/Release/netstandard2.0/Thoth.Json.AssemblyInfo.fs +19 -0
- package/fable_modules/Thoth.Json.10.1.0/package.json +5 -0
- package/fable_modules/fable-library.4.1.4/Array.d.ts +120 -0
- package/fable_modules/fable-library.4.1.4/Array.js +1204 -0
- package/fable_modules/fable-library.4.1.4/Async.d.ts +32 -0
- package/fable_modules/fable-library.4.1.4/Async.js +158 -0
- package/fable_modules/fable-library.4.1.4/AsyncBuilder.d.ts +59 -0
- package/fable_modules/fable-library.4.1.4/AsyncBuilder.js +183 -0
- package/fable_modules/fable-library.4.1.4/BigInt.d.ts +115 -0
- package/fable_modules/fable-library.4.1.4/BigInt.js +282 -0
- package/fable_modules/fable-library.4.1.4/BitConverter.d.ts +27 -0
- package/fable_modules/fable-library.4.1.4/BitConverter.js +138 -0
- package/fable_modules/fable-library.4.1.4/Boolean.d.ts +3 -0
- package/fable_modules/fable-library.4.1.4/Boolean.js +21 -0
- package/fable_modules/fable-library.4.1.4/Char.d.ts +65 -0
- package/fable_modules/fable-library.4.1.4/Char.js +169 -0
- package/fable_modules/fable-library.4.1.4/Choice.d.ts +138 -0
- package/fable_modules/fable-library.4.1.4/Choice.js +227 -0
- package/fable_modules/fable-library.4.1.4/Date.d.ts +70 -0
- package/fable_modules/fable-library.4.1.4/Date.js +451 -0
- package/fable_modules/fable-library.4.1.4/DateOffset.d.ts +63 -0
- package/fable_modules/fable-library.4.1.4/DateOffset.js +268 -0
- package/fable_modules/fable-library.4.1.4/DateOnly.d.ts +18 -0
- package/fable_modules/fable-library.4.1.4/DateOnly.js +124 -0
- package/fable_modules/fable-library.4.1.4/Decimal.d.ts +45 -0
- package/fable_modules/fable-library.4.1.4/Decimal.js +212 -0
- package/fable_modules/fable-library.4.1.4/Double.d.ts +11 -0
- package/fable_modules/fable-library.4.1.4/Double.js +46 -0
- package/fable_modules/fable-library.4.1.4/Encoding.d.ts +12 -0
- package/fable_modules/fable-library.4.1.4/Encoding.js +173 -0
- package/fable_modules/fable-library.4.1.4/Event.d.ts +31 -0
- package/fable_modules/fable-library.4.1.4/Event.js +93 -0
- package/fable_modules/fable-library.4.1.4/FSharp.Collections.d.ts +7 -0
- package/fable_modules/fable-library.4.1.4/FSharp.Collections.js +27 -0
- package/fable_modules/fable-library.4.1.4/FSharp.Core.d.ts +17 -0
- package/fable_modules/fable-library.4.1.4/FSharp.Core.js +69 -0
- package/fable_modules/fable-library.4.1.4/Global.d.ts +24 -0
- package/fable_modules/fable-library.4.1.4/Global.js +8 -0
- package/fable_modules/fable-library.4.1.4/Guid.d.ts +10 -0
- package/fable_modules/fable-library.4.1.4/Guid.js +142 -0
- package/fable_modules/fable-library.4.1.4/Int32.d.ts +28 -0
- package/fable_modules/fable-library.4.1.4/Int32.js +135 -0
- package/fable_modules/fable-library.4.1.4/List.d.ts +143 -0
- package/fable_modules/fable-library.4.1.4/List.js +1273 -0
- package/fable_modules/fable-library.4.1.4/Long.d.ts +3 -0
- package/fable_modules/fable-library.4.1.4/Long.js +46 -0
- package/fable_modules/fable-library.4.1.4/MailboxProcessor.d.ts +25 -0
- package/fable_modules/fable-library.4.1.4/MailboxProcessor.js +93 -0
- package/fable_modules/fable-library.4.1.4/Map.d.ts +178 -0
- package/fable_modules/fable-library.4.1.4/Map.js +1396 -0
- package/fable_modules/fable-library.4.1.4/MapUtil.d.ts +10 -0
- package/fable_modules/fable-library.4.1.4/MapUtil.js +112 -0
- package/fable_modules/fable-library.4.1.4/MutableMap.d.ts +52 -0
- package/fable_modules/fable-library.4.1.4/MutableMap.js +326 -0
- package/fable_modules/fable-library.4.1.4/MutableSet.d.ts +39 -0
- package/fable_modules/fable-library.4.1.4/MutableSet.js +232 -0
- package/fable_modules/fable-library.4.1.4/Native.d.ts +2 -0
- package/fable_modules/fable-library.4.1.4/Native.js +8 -0
- package/fable_modules/fable-library.4.1.4/Numeric.d.ts +19 -0
- package/fable_modules/fable-library.4.1.4/Numeric.js +71 -0
- package/fable_modules/fable-library.4.1.4/Observable.d.ts +32 -0
- package/fable_modules/fable-library.4.1.4/Observable.js +113 -0
- package/fable_modules/fable-library.4.1.4/Option.d.ts +28 -0
- package/fable_modules/fable-library.4.1.4/Option.js +96 -0
- package/fable_modules/fable-library.4.1.4/README.md +3 -0
- package/fable_modules/fable-library.4.1.4/Random.d.ts +37 -0
- package/fable_modules/fable-library.4.1.4/Random.js +170 -0
- package/fable_modules/fable-library.4.1.4/Range.d.ts +12 -0
- package/fable_modules/fable-library.4.1.4/Range.js +45 -0
- package/fable_modules/fable-library.4.1.4/Reflection.d.ts +119 -0
- package/fable_modules/fable-library.4.1.4/Reflection.js +461 -0
- package/fable_modules/fable-library.4.1.4/RegExp.d.ts +10 -0
- package/fable_modules/fable-library.4.1.4/RegExp.js +132 -0
- package/fable_modules/fable-library.4.1.4/Seq.d.ts +165 -0
- package/fable_modules/fable-library.4.1.4/Seq.js +1379 -0
- package/fable_modules/fable-library.4.1.4/Seq2.d.ts +18 -0
- package/fable_modules/fable-library.4.1.4/Seq2.js +111 -0
- package/fable_modules/fable-library.4.1.4/Set.d.ts +190 -0
- package/fable_modules/fable-library.4.1.4/Set.js +1789 -0
- package/fable_modules/fable-library.4.1.4/String.d.ts +49 -0
- package/fable_modules/fable-library.4.1.4/String.js +540 -0
- package/fable_modules/fable-library.4.1.4/System.Collections.Generic.d.ts +71 -0
- package/fable_modules/fable-library.4.1.4/System.Collections.Generic.js +307 -0
- package/fable_modules/fable-library.4.1.4/System.Text.d.ts +30 -0
- package/fable_modules/fable-library.4.1.4/System.Text.js +110 -0
- package/fable_modules/fable-library.4.1.4/SystemException.d.ts +5 -0
- package/fable_modules/fable-library.4.1.4/SystemException.js +5 -0
- package/fable_modules/fable-library.4.1.4/TimeOnly.d.ts +15 -0
- package/fable_modules/fable-library.4.1.4/TimeOnly.js +122 -0
- package/fable_modules/fable-library.4.1.4/TimeSpan.d.ts +34 -0
- package/fable_modules/fable-library.4.1.4/TimeSpan.js +177 -0
- package/fable_modules/fable-library.4.1.4/Timer.d.ts +19 -0
- package/fable_modules/fable-library.4.1.4/Timer.js +67 -0
- package/fable_modules/fable-library.4.1.4/Types.d.ts +58 -0
- package/fable_modules/fable-library.4.1.4/Types.js +208 -0
- package/fable_modules/fable-library.4.1.4/Unicode.13.0.0.d.ts +2 -0
- package/fable_modules/fable-library.4.1.4/Unicode.13.0.0.js +4 -0
- package/fable_modules/fable-library.4.1.4/Uri.d.ts +29 -0
- package/fable_modules/fable-library.4.1.4/Uri.js +142 -0
- package/fable_modules/fable-library.4.1.4/Util.d.ts +187 -0
- package/fable_modules/fable-library.4.1.4/Util.js +662 -0
- package/fable_modules/fable-library.4.1.4/lib/big.d.ts +338 -0
- package/fable_modules/fable-library.4.1.4/lib/big.js +826 -0
- package/fable_modules/fable-library.4.1.4/package.json +23 -0
- package/fable_modules/project_cracked.json +1 -0
- package/package.json +22 -0
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
namespace FsSpreadsheet
|
|
2
|
+
|
|
3
|
+
module SheetBuilder =
|
|
4
|
+
|
|
5
|
+
module internal Dictionary =
|
|
6
|
+
|
|
7
|
+
let tryGetValue k (dict : System.Collections.Generic.Dictionary<'K,'V>) =
|
|
8
|
+
let b,v = dict.TryGetValue(k)
|
|
9
|
+
// Only get value if
|
|
10
|
+
if b
|
|
11
|
+
then
|
|
12
|
+
Some v
|
|
13
|
+
else
|
|
14
|
+
None
|
|
15
|
+
|
|
16
|
+
let length (dict : System.Collections.Generic.Dictionary<'K,'V>) =
|
|
17
|
+
dict.Count
|
|
18
|
+
|
|
19
|
+
type FieldMap<'T> =
|
|
20
|
+
{
|
|
21
|
+
CellTransformers : ('T -> FsCell -> FsCell) list
|
|
22
|
+
HeaderTransformers : ('T -> FsCell -> FsCell) list
|
|
23
|
+
ColumnWidth : float option
|
|
24
|
+
RowHeight : ('T -> float option) option
|
|
25
|
+
AdjustToContents: bool
|
|
26
|
+
Hash : string
|
|
27
|
+
}
|
|
28
|
+
with
|
|
29
|
+
static member empty<'T>() = {
|
|
30
|
+
CellTransformers = []
|
|
31
|
+
HeaderTransformers = []
|
|
32
|
+
ColumnWidth = None
|
|
33
|
+
RowHeight = None
|
|
34
|
+
AdjustToContents = false
|
|
35
|
+
Hash = System.Guid.NewGuid().ToString()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
static member create<'T>(mapRow : 'T -> FsCell -> FsCell) =
|
|
39
|
+
let empty = FieldMap<'T>.empty()
|
|
40
|
+
{ empty with
|
|
41
|
+
CellTransformers = List.append empty.CellTransformers [mapRow]
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
member self.header(name : string) =
|
|
45
|
+
let transformer _ (cell : FsCell) = cell.SetValueAs(name); cell
|
|
46
|
+
{ self with HeaderTransformers = List.append self.HeaderTransformers [transformer] }
|
|
47
|
+
|
|
48
|
+
member self.header(mapHeader : 'T -> string) =
|
|
49
|
+
let transformer (value : 'T) (cell : FsCell) = cell.SetValueAs(mapHeader value); cell
|
|
50
|
+
{ self with HeaderTransformers = List.append self.HeaderTransformers [transformer] }
|
|
51
|
+
|
|
52
|
+
member self.adjustToContents() =
|
|
53
|
+
{ self with AdjustToContents = true }
|
|
54
|
+
|
|
55
|
+
static member field<'T>(map: 'T -> int) = FieldMap<'T>.create(fun row cell -> cell.SetValueAs(map row); cell)
|
|
56
|
+
static member field<'T>(map: 'T -> string) = FieldMap<'T>.create(fun row cell -> cell.SetValueAs(map row); cell)
|
|
57
|
+
static member field<'T>(map: 'T -> System.DateTime) = FieldMap<'T>.create(fun row cell -> cell.SetValueAs(map row); cell)
|
|
58
|
+
static member field<'T>(map: 'T -> bool) = FieldMap<'T>.create(fun row cell -> cell.SetValueAs(map row); cell)
|
|
59
|
+
static member field<'T>(map: 'T -> double) = FieldMap<'T>.create(fun row cell -> cell.SetValueAs(map row); cell)
|
|
60
|
+
static member field<'T>(map: 'T -> int option) = FieldMap<'T>.create(fun row cell -> cell.SetValueAs(Option.toNullable (map row)); cell)
|
|
61
|
+
static member field<'T>(map: 'T -> System.DateTime option) = FieldMap<'T>.create(fun row cell -> cell.SetValueAs(Option.toNullable (map row)); cell)
|
|
62
|
+
static member field<'T>(map: 'T -> bool option) = FieldMap<'T>.create(fun row cell -> cell.SetValueAs(Option.toNullable (map row)); cell)
|
|
63
|
+
static member field<'T>(map: 'T -> double option) = FieldMap<'T>.create(fun row cell -> cell.SetValueAs(Option.toNullable (map row)); cell)
|
|
64
|
+
static member field<'T>(map: 'T -> string option) = FieldMap<'T>.create(fun row cell ->
|
|
65
|
+
match map row with
|
|
66
|
+
| None -> cell
|
|
67
|
+
| Some text -> cell.SetValueAs(text); cell
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
type FsTable with
|
|
71
|
+
|
|
72
|
+
member self.Populate(cells : FsCellsCollection, data : seq<'T>, fields : FieldMap<'T> list) =
|
|
73
|
+
let headerTransformerGroups = fields |> List.map (fun field -> field.HeaderTransformers)
|
|
74
|
+
let noHeadersAvailable =
|
|
75
|
+
headerTransformerGroups
|
|
76
|
+
|> List.concat
|
|
77
|
+
|> List.isEmpty
|
|
78
|
+
|
|
79
|
+
let headersAvailable = not noHeadersAvailable
|
|
80
|
+
|
|
81
|
+
if headersAvailable && (self.ShowHeaderRow = false) then self.ShowHeaderRow <- headersAvailable
|
|
82
|
+
|
|
83
|
+
let startAddress = self.RangeAddress.FirstAddress
|
|
84
|
+
|
|
85
|
+
let startRowIndex = if headersAvailable then startAddress.RowNumber + 1 else startAddress.RowNumber
|
|
86
|
+
|
|
87
|
+
for (rowIndex, row) in Seq.indexed data do
|
|
88
|
+
let activeRowIndex = rowIndex + startRowIndex
|
|
89
|
+
for field in fields do
|
|
90
|
+
|
|
91
|
+
let headerCell = FsCell.createEmpty()
|
|
92
|
+
for header in field.HeaderTransformers do ignore (header row headerCell)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
let headerString =
|
|
96
|
+
if headerCell.Value = "" then
|
|
97
|
+
field.Hash
|
|
98
|
+
else headerCell.Value
|
|
99
|
+
|
|
100
|
+
let tableField = self.Field(headerString,cells)
|
|
101
|
+
|
|
102
|
+
let activeCell = tableField.Column.Cell(activeRowIndex,cells) // .Cell(index,self.CellCollection)
|
|
103
|
+
for transformer in field.CellTransformers do
|
|
104
|
+
ignore (transformer row activeCell)
|
|
105
|
+
|
|
106
|
+
//if field.AdjustToContents then
|
|
107
|
+
// let currentColumn = activeCell.WorksheetColumn()
|
|
108
|
+
// currentColumn.AdjustToContents() |> ignore
|
|
109
|
+
// activeRow.AdjustToContents() |> ignore
|
|
110
|
+
|
|
111
|
+
//match field.ColumnWidth with
|
|
112
|
+
//| Some givenWidth ->
|
|
113
|
+
// let currentColumn = activeCell.WorksheetColumn()
|
|
114
|
+
// currentColumn.Width <- givenWidth
|
|
115
|
+
//| None -> ()
|
|
116
|
+
|
|
117
|
+
//match field.RowHeight with
|
|
118
|
+
//| Some givenHeightFn ->
|
|
119
|
+
// match givenHeightFn row with
|
|
120
|
+
// | Some givenHeight ->
|
|
121
|
+
// activeRow.Height <- givenHeight
|
|
122
|
+
// | None ->
|
|
123
|
+
// ()
|
|
124
|
+
//| None ->
|
|
125
|
+
// ()
|
|
126
|
+
|
|
127
|
+
static member populate<'T> (table : FsTable, cells : FsCellsCollection, data : seq<'T>, fields : FieldMap<'T> list) : unit =
|
|
128
|
+
table.Populate(cells,data,fields)
|
|
129
|
+
|
|
130
|
+
type FsWorksheet with
|
|
131
|
+
|
|
132
|
+
member self.Populate(data : seq<'T>, fields : FieldMap<'T> list) =
|
|
133
|
+
let headerTransformerGroups = fields |> List.map (fun field -> field.HeaderTransformers)
|
|
134
|
+
let noHeadersAvailable =
|
|
135
|
+
headerTransformerGroups
|
|
136
|
+
|> List.concat
|
|
137
|
+
|> List.isEmpty
|
|
138
|
+
|
|
139
|
+
let headersAvailable = not noHeadersAvailable
|
|
140
|
+
|
|
141
|
+
let headers : System.Collections.Generic.Dictionary<string,int> = System.Collections.Generic.Dictionary()
|
|
142
|
+
|
|
143
|
+
for (rowIndex, row) in Seq.indexed data do
|
|
144
|
+
let startRowIndex = if headersAvailable then 2 else 1
|
|
145
|
+
let activeRow = self.Row(rowIndex + startRowIndex)
|
|
146
|
+
for field in fields do
|
|
147
|
+
|
|
148
|
+
let headerCell = FsCell.createEmpty()
|
|
149
|
+
for header in field.HeaderTransformers do ignore (header row headerCell)
|
|
150
|
+
|
|
151
|
+
let index =
|
|
152
|
+
let hasHeader, headerString =
|
|
153
|
+
if headerCell.Value = "" then
|
|
154
|
+
false, field.Hash
|
|
155
|
+
else true, headerCell.Value
|
|
156
|
+
|
|
157
|
+
match Dictionary.tryGetValue (headerString) headers with
|
|
158
|
+
| Some int -> int
|
|
159
|
+
| None ->
|
|
160
|
+
let v = headerString
|
|
161
|
+
let i = headers.Count + 1
|
|
162
|
+
headers.Add(v,i)
|
|
163
|
+
if hasHeader then
|
|
164
|
+
self.Row(1).[i].CopyFrom(headerCell) |> ignore
|
|
165
|
+
i
|
|
166
|
+
|
|
167
|
+
let activeCell = activeRow.[index]
|
|
168
|
+
for transformer in field.CellTransformers do
|
|
169
|
+
ignore (transformer row activeCell)
|
|
170
|
+
|
|
171
|
+
//if field.AdjustToContents then
|
|
172
|
+
// let currentColumn = activeCell.WorksheetColumn()
|
|
173
|
+
// currentColumn.AdjustToContents() |> ignore
|
|
174
|
+
// activeRow.AdjustToContents() |> ignore
|
|
175
|
+
|
|
176
|
+
//match field.ColumnWidth with
|
|
177
|
+
//| Some givenWidth ->
|
|
178
|
+
// let currentColumn = activeCell.WorksheetColumn()
|
|
179
|
+
// currentColumn.Width <- givenWidth
|
|
180
|
+
//| None -> ()
|
|
181
|
+
|
|
182
|
+
//match field.RowHeight with
|
|
183
|
+
//| Some givenHeightFn ->
|
|
184
|
+
// match givenHeightFn row with
|
|
185
|
+
// | Some givenHeight ->
|
|
186
|
+
// activeRow.Height <- givenHeight
|
|
187
|
+
// | None ->
|
|
188
|
+
// ()
|
|
189
|
+
//| None ->
|
|
190
|
+
// ()
|
|
191
|
+
|
|
192
|
+
self.SortRows()
|
|
193
|
+
|
|
194
|
+
static member populate<'T>(sheet : FsWorksheet, data : seq<'T>, fields : FieldMap<'T> list) : unit =
|
|
195
|
+
sheet.Populate(data,fields)
|
|
196
|
+
|
|
197
|
+
static member createFrom (name : string, data : seq<'T>, fields : FieldMap<'T> list) (*: byte[]*) =
|
|
198
|
+
let sheet = FsWorksheet(name)
|
|
199
|
+
FsWorksheet.populate(sheet, data, fields)
|
|
200
|
+
sheet
|
|
201
|
+
|
|
202
|
+
static member createFrom (data : seq<'T>, fields : FieldMap<'T> list) (*: byte[]*) =
|
|
203
|
+
FsWorksheet.createFrom("Sheet1", data, fields)
|
|
204
|
+
|
|
205
|
+
member self.PopulateTable(tableName : string, startAddress : FsAddress, data : seq<'T>, fields : FieldMap<'T> list) =
|
|
206
|
+
let headerTransformerGroups = fields |> List.map (fun field -> field.HeaderTransformers)
|
|
207
|
+
let noHeadersAvailable =
|
|
208
|
+
headerTransformerGroups
|
|
209
|
+
|> List.concat
|
|
210
|
+
|> List.isEmpty
|
|
211
|
+
|
|
212
|
+
let headersAvailable = not noHeadersAvailable
|
|
213
|
+
|
|
214
|
+
let table = self.Table(tableName,FsRangeAddress(startAddress,startAddress),headersAvailable)
|
|
215
|
+
|
|
216
|
+
table.Populate(self.CellCollection,data,fields)
|
|
217
|
+
|
|
218
|
+
self.SortRows()
|
|
219
|
+
|
|
220
|
+
static member createTableFrom (name : string, tableName : string, data : seq<'T>, fields : FieldMap<'T> list) (*: byte[]*) =
|
|
221
|
+
let sheet = FsWorksheet(name)
|
|
222
|
+
sheet.PopulateTable(tableName, FsAddress (1,1), data, fields)
|
|
223
|
+
sheet
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
type FsWorkbook with
|
|
228
|
+
|
|
229
|
+
member self.Populate<'T>(name : string, data : seq<'T>, fields : FieldMap<'T> list) : unit =
|
|
230
|
+
self.InitWorksheet(name) |> ignore
|
|
231
|
+
let sheet = self.GetWorksheets() |> Seq.find (fun s -> s.Name = name)
|
|
232
|
+
FsWorksheet.populate(sheet, data, fields)
|
|
233
|
+
|
|
234
|
+
static member populate<'T> (workbook : FsWorkbook, name : string, data : seq<'T>, fields : FieldMap<'T> list) : unit =
|
|
235
|
+
workbook.Populate(name, data, fields)
|
|
236
|
+
|
|
237
|
+
static member createFrom (name : string, data : seq<'T>, fields : FieldMap<'T> list) (*: byte[]*) =
|
|
238
|
+
let workbook = new FsWorkbook()
|
|
239
|
+
FsWorkbook.populate(workbook, name, data, fields)
|
|
240
|
+
workbook
|
|
241
|
+
|
|
242
|
+
static member createFrom (data: seq<'T>, fields: FieldMap<'T> list) (*: byte[]*) =
|
|
243
|
+
FsWorkbook.createFrom("Sheet1", data, fields)
|
|
244
|
+
|
|
245
|
+
static member createFrom (sheets : FsWorksheet list)=
|
|
246
|
+
let workbook = new FsWorkbook()
|
|
247
|
+
sheets
|
|
248
|
+
|> List.iter (fun sheet -> workbook.AddWorksheet(sheet) |> ignore)
|
|
249
|
+
workbook
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import { disposeSafe, getEnumerator, curry2, defaultOf } from "../fable-library.4.1.4/Util.js";
|
|
2
|
+
import { addToDict, tryGetValue } from "../fable-library.4.1.4/MapUtil.js";
|
|
3
|
+
import { Record, FSharpRef } from "../fable-library.4.1.4/Types.js";
|
|
4
|
+
import { toNullable, some } from "../fable-library.4.1.4/Option.js";
|
|
5
|
+
import { FsCell, FsCell_$reflection } from "./Cells/FsCell.fs.js";
|
|
6
|
+
import { record_type, string_type, bool_type, option_type, float64_type, list_type, lambda_type } from "../fable-library.4.1.4/Reflection.js";
|
|
7
|
+
import { iterate, isEmpty, map as map_1, concat, singleton, append, empty as empty_1 } from "../fable-library.4.1.4/List.js";
|
|
8
|
+
import { newGuid } from "../fable-library.4.1.4/Guid.js";
|
|
9
|
+
import { FsRangeAddress_$ctor_7E77A4A0, FsRangeAddress__get_FirstAddress } from "./Ranges/FsRangeAddress.fs.js";
|
|
10
|
+
import { FsRangeBase__get_RangeAddress } from "./Ranges/FsRangeBase.fs.js";
|
|
11
|
+
import { FsAddress_$ctor_Z37302880, FsAddress__get_RowNumber } from "./FsAddress.fs.js";
|
|
12
|
+
import { find, indexed } from "../fable-library.4.1.4/Seq.js";
|
|
13
|
+
import { FsRangeColumn__Cell_Z4232C216 } from "./Ranges/FsRangeColumn.fs.js";
|
|
14
|
+
import { FsTableField__get_Column } from "./Tables/FsTableField.fs.js";
|
|
15
|
+
import { FsWorksheet } from "./FsWorksheet.fs.js";
|
|
16
|
+
import { FsWorkbook } from "./FsWorkbook.fs.js";
|
|
17
|
+
|
|
18
|
+
export function Dictionary_tryGetValue(k, dict) {
|
|
19
|
+
let patternInput;
|
|
20
|
+
let outArg = defaultOf();
|
|
21
|
+
patternInput = [tryGetValue(dict, k, new FSharpRef(() => outArg, (v) => {
|
|
22
|
+
outArg = v;
|
|
23
|
+
})), outArg];
|
|
24
|
+
if (patternInput[0]) {
|
|
25
|
+
return some(patternInput[1]);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
return void 0;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function Dictionary_length(dict) {
|
|
33
|
+
return dict.size;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export class FieldMap$1 extends Record {
|
|
37
|
+
constructor(CellTransformers, HeaderTransformers, ColumnWidth, RowHeight, AdjustToContents, Hash) {
|
|
38
|
+
super();
|
|
39
|
+
this.CellTransformers = CellTransformers;
|
|
40
|
+
this.HeaderTransformers = HeaderTransformers;
|
|
41
|
+
this.ColumnWidth = ColumnWidth;
|
|
42
|
+
this.RowHeight = RowHeight;
|
|
43
|
+
this.AdjustToContents = AdjustToContents;
|
|
44
|
+
this.Hash = Hash;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function FieldMap$1_$reflection(gen0) {
|
|
49
|
+
return record_type("FsSpreadsheet.SheetBuilder.FieldMap`1", [gen0], FieldMap$1, () => [["CellTransformers", list_type(lambda_type(gen0, lambda_type(FsCell_$reflection(), FsCell_$reflection())))], ["HeaderTransformers", list_type(lambda_type(gen0, lambda_type(FsCell_$reflection(), FsCell_$reflection())))], ["ColumnWidth", option_type(float64_type)], ["RowHeight", option_type(lambda_type(gen0, option_type(float64_type)))], ["AdjustToContents", bool_type], ["Hash", string_type]]);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function FieldMap$1_empty() {
|
|
53
|
+
let copyOfStruct;
|
|
54
|
+
return new FieldMap$1(empty_1(), empty_1(), void 0, void 0, false, (copyOfStruct = newGuid(), copyOfStruct));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function FieldMap$1_create_Z3BCCB7EB(mapRow) {
|
|
58
|
+
const empty = FieldMap$1_empty();
|
|
59
|
+
return new FieldMap$1(append(empty.CellTransformers, singleton(curry2(mapRow))), empty.HeaderTransformers, empty.ColumnWidth, empty.RowHeight, empty.AdjustToContents, empty.Hash);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function FieldMap$1__header_Z721C83C5(self, name) {
|
|
63
|
+
return new FieldMap$1(self.CellTransformers, append(self.HeaderTransformers, singleton((_arg) => ((cell) => {
|
|
64
|
+
cell.SetValueAs(name);
|
|
65
|
+
return cell;
|
|
66
|
+
}))), self.ColumnWidth, self.RowHeight, self.AdjustToContents, self.Hash);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function FieldMap$1__header_54F19B58(self, mapHeader) {
|
|
70
|
+
return new FieldMap$1(self.CellTransformers, append(self.HeaderTransformers, singleton((value) => ((cell) => {
|
|
71
|
+
cell.SetValueAs(mapHeader(value));
|
|
72
|
+
return cell;
|
|
73
|
+
}))), self.ColumnWidth, self.RowHeight, self.AdjustToContents, self.Hash);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function FieldMap$1__adjustToContents(self) {
|
|
77
|
+
return new FieldMap$1(self.CellTransformers, self.HeaderTransformers, self.ColumnWidth, self.RowHeight, true, self.Hash);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function FieldMap$1_field_Z5C94BCA1(map) {
|
|
81
|
+
return FieldMap$1_create_Z3BCCB7EB((row, cell) => {
|
|
82
|
+
cell.SetValueAs(map(row));
|
|
83
|
+
return cell;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function FieldMap$1_field_54F19B58(map) {
|
|
88
|
+
return FieldMap$1_create_Z3BCCB7EB((row, cell) => {
|
|
89
|
+
cell.SetValueAs(map(row));
|
|
90
|
+
return cell;
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function FieldMap$1_field_477D79EC(map) {
|
|
95
|
+
return FieldMap$1_create_Z3BCCB7EB((row, cell) => {
|
|
96
|
+
cell.SetValueAs(map(row));
|
|
97
|
+
return cell;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function FieldMap$1_field_Z1D55A0D7(map) {
|
|
102
|
+
return FieldMap$1_create_Z3BCCB7EB((row, cell) => {
|
|
103
|
+
cell.SetValueAs(map(row));
|
|
104
|
+
return cell;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function FieldMap$1_field_298D8758(map) {
|
|
109
|
+
return FieldMap$1_create_Z3BCCB7EB((row, cell) => {
|
|
110
|
+
cell.SetValueAs(map(row));
|
|
111
|
+
return cell;
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export function FieldMap$1_field_Z78848E24(map) {
|
|
116
|
+
return FieldMap$1_create_Z3BCCB7EB((row, cell) => {
|
|
117
|
+
cell.SetValueAs(toNullable(map(row)));
|
|
118
|
+
return cell;
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function FieldMap$1_field_4C14CE8F(map) {
|
|
123
|
+
return FieldMap$1_create_Z3BCCB7EB((row, cell) => {
|
|
124
|
+
cell.SetValueAs(toNullable(map(row)));
|
|
125
|
+
return cell;
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export function FieldMap$1_field_Z404517D6(map) {
|
|
130
|
+
return FieldMap$1_create_Z3BCCB7EB((row, cell) => {
|
|
131
|
+
cell.SetValueAs(toNullable(map(row)));
|
|
132
|
+
return cell;
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export function FieldMap$1_field_Z14464045(map) {
|
|
137
|
+
return FieldMap$1_create_Z3BCCB7EB((row, cell) => {
|
|
138
|
+
cell.SetValueAs(toNullable(map(row)));
|
|
139
|
+
return cell;
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export function FieldMap$1_field_33F53BB(map) {
|
|
144
|
+
return FieldMap$1_create_Z3BCCB7EB((row, cell) => {
|
|
145
|
+
const matchValue = map(row);
|
|
146
|
+
if (matchValue != null) {
|
|
147
|
+
const text = matchValue;
|
|
148
|
+
cell.SetValueAs(text);
|
|
149
|
+
return cell;
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
return cell;
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export function FsSpreadsheet_FsTable__FsTable_Populate_526F9CF7(self, cells, data, fields) {
|
|
158
|
+
const headersAvailable = !isEmpty(concat(map_1((field) => field.HeaderTransformers, fields)));
|
|
159
|
+
if (headersAvailable && (self.ShowHeaderRow === false)) {
|
|
160
|
+
self.ShowHeaderRow = headersAvailable;
|
|
161
|
+
}
|
|
162
|
+
const startAddress = FsRangeAddress__get_FirstAddress(FsRangeBase__get_RangeAddress(self));
|
|
163
|
+
const startRowIndex = (headersAvailable ? (FsAddress__get_RowNumber(startAddress) + 1) : FsAddress__get_RowNumber(startAddress)) | 0;
|
|
164
|
+
const enumerator = getEnumerator(indexed(data));
|
|
165
|
+
try {
|
|
166
|
+
while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
|
|
167
|
+
const forLoopVar = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
168
|
+
const row = forLoopVar[1];
|
|
169
|
+
const activeRowIndex = (forLoopVar[0] + startRowIndex) | 0;
|
|
170
|
+
const enumerator_1 = getEnumerator(fields);
|
|
171
|
+
try {
|
|
172
|
+
while (enumerator_1["System.Collections.IEnumerator.MoveNext"]()) {
|
|
173
|
+
const field_1 = enumerator_1["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
174
|
+
const headerCell = FsCell.createEmpty();
|
|
175
|
+
const enumerator_2 = getEnumerator(field_1.HeaderTransformers);
|
|
176
|
+
try {
|
|
177
|
+
while (enumerator_2["System.Collections.IEnumerator.MoveNext"]()) {
|
|
178
|
+
enumerator_2["System.Collections.Generic.IEnumerator`1.get_Current"]()(row)(headerCell);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
finally {
|
|
182
|
+
disposeSafe(enumerator_2);
|
|
183
|
+
}
|
|
184
|
+
const headerString = (headerCell.Value === "") ? field_1.Hash : headerCell.Value;
|
|
185
|
+
const activeCell = FsRangeColumn__Cell_Z4232C216(FsTableField__get_Column(self.Field(headerString, cells)), activeRowIndex, cells);
|
|
186
|
+
const enumerator_3 = getEnumerator(field_1.CellTransformers);
|
|
187
|
+
try {
|
|
188
|
+
while (enumerator_3["System.Collections.IEnumerator.MoveNext"]()) {
|
|
189
|
+
enumerator_3["System.Collections.Generic.IEnumerator`1.get_Current"]()(row)(activeCell);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
finally {
|
|
193
|
+
disposeSafe(enumerator_3);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
finally {
|
|
198
|
+
disposeSafe(enumerator_1);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
finally {
|
|
203
|
+
disposeSafe(enumerator);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export function FsSpreadsheet_FsTable__FsTable_populate_Static_Z735E4C44(table, cells, data, fields) {
|
|
208
|
+
FsSpreadsheet_FsTable__FsTable_Populate_526F9CF7(table, cells, data, fields);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export function FsSpreadsheet_FsWorksheet__FsWorksheet_Populate_Z2A1350BF(self, data, fields) {
|
|
212
|
+
const headersAvailable = !isEmpty(concat(map_1((field) => field.HeaderTransformers, fields)));
|
|
213
|
+
const headers = new Map([]);
|
|
214
|
+
const enumerator = getEnumerator(indexed(data));
|
|
215
|
+
try {
|
|
216
|
+
while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
|
|
217
|
+
const forLoopVar = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
218
|
+
const row = forLoopVar[1];
|
|
219
|
+
const startRowIndex = (headersAvailable ? 2 : 1) | 0;
|
|
220
|
+
const activeRow = self.Row(forLoopVar[0] + startRowIndex);
|
|
221
|
+
const enumerator_1 = getEnumerator(fields);
|
|
222
|
+
try {
|
|
223
|
+
while (enumerator_1["System.Collections.IEnumerator.MoveNext"]()) {
|
|
224
|
+
const field_1 = enumerator_1["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
225
|
+
const headerCell = FsCell.createEmpty();
|
|
226
|
+
const enumerator_2 = getEnumerator(field_1.HeaderTransformers);
|
|
227
|
+
try {
|
|
228
|
+
while (enumerator_2["System.Collections.IEnumerator.MoveNext"]()) {
|
|
229
|
+
enumerator_2["System.Collections.Generic.IEnumerator`1.get_Current"]()(row)(headerCell);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
finally {
|
|
233
|
+
disposeSafe(enumerator_2);
|
|
234
|
+
}
|
|
235
|
+
let index;
|
|
236
|
+
const patternInput = (headerCell.Value === "") ? [false, field_1.Hash] : [true, headerCell.Value];
|
|
237
|
+
const headerString = patternInput[1];
|
|
238
|
+
const matchValue = Dictionary_tryGetValue(headerString, headers);
|
|
239
|
+
if (matchValue == null) {
|
|
240
|
+
const i = (headers.size + 1) | 0;
|
|
241
|
+
addToDict(headers, headerString, i);
|
|
242
|
+
if (patternInput[0]) {
|
|
243
|
+
const value = self.Row(1).Item(i).CopyFrom(headerCell);
|
|
244
|
+
}
|
|
245
|
+
index = i;
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
index = matchValue;
|
|
249
|
+
}
|
|
250
|
+
const activeCell = activeRow.Item(index);
|
|
251
|
+
const enumerator_3 = getEnumerator(field_1.CellTransformers);
|
|
252
|
+
try {
|
|
253
|
+
while (enumerator_3["System.Collections.IEnumerator.MoveNext"]()) {
|
|
254
|
+
enumerator_3["System.Collections.Generic.IEnumerator`1.get_Current"]()(row)(activeCell);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
finally {
|
|
258
|
+
disposeSafe(enumerator_3);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
finally {
|
|
263
|
+
disposeSafe(enumerator_1);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
finally {
|
|
268
|
+
disposeSafe(enumerator);
|
|
269
|
+
}
|
|
270
|
+
self.SortRows();
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export function FsSpreadsheet_FsWorksheet__FsWorksheet_populate_Static_Z2578A106(sheet, data, fields) {
|
|
274
|
+
FsSpreadsheet_FsWorksheet__FsWorksheet_Populate_Z2A1350BF(sheet, data, fields);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export function FsSpreadsheet_FsWorksheet__FsWorksheet_createFrom_Static_Z2DEFA746(name, data, fields) {
|
|
278
|
+
const sheet = new FsWorksheet(name);
|
|
279
|
+
FsSpreadsheet_FsWorksheet__FsWorksheet_populate_Static_Z2578A106(sheet, data, fields);
|
|
280
|
+
return sheet;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export function FsSpreadsheet_FsWorksheet__FsWorksheet_createFrom_Static_Z2A1350BF(data, fields) {
|
|
284
|
+
return FsSpreadsheet_FsWorksheet__FsWorksheet_createFrom_Static_Z2DEFA746("Sheet1", data, fields);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export function FsSpreadsheet_FsWorksheet__FsWorksheet_PopulateTable_59F260F9(self, tableName, startAddress, data, fields) {
|
|
288
|
+
const headersAvailable = !isEmpty(concat(map_1((field) => field.HeaderTransformers, fields)));
|
|
289
|
+
FsSpreadsheet_FsTable__FsTable_Populate_526F9CF7(self.Table(tableName, FsRangeAddress_$ctor_7E77A4A0(startAddress, startAddress), headersAvailable), self.CellCollection, data, fields);
|
|
290
|
+
self.SortRows();
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
export function FsSpreadsheet_FsWorksheet__FsWorksheet_createTableFrom_Static_30234BE1(name, tableName, data, fields) {
|
|
294
|
+
const sheet = new FsWorksheet(name);
|
|
295
|
+
FsSpreadsheet_FsWorksheet__FsWorksheet_PopulateTable_59F260F9(sheet, tableName, FsAddress_$ctor_Z37302880(1, 1), data, fields);
|
|
296
|
+
return sheet;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export function FsSpreadsheet_FsWorkbook__FsWorkbook_Populate_Z2DEFA746(self, name, data, fields) {
|
|
300
|
+
self.InitWorksheet(name);
|
|
301
|
+
FsSpreadsheet_FsWorksheet__FsWorksheet_populate_Static_Z2578A106(find((s) => (s.Name === name), self.GetWorksheets()), data, fields);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export function FsSpreadsheet_FsWorkbook__FsWorkbook_populate_Static_Z7163EB39(workbook, name, data, fields) {
|
|
305
|
+
FsSpreadsheet_FsWorkbook__FsWorkbook_Populate_Z2DEFA746(workbook, name, data, fields);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export function FsSpreadsheet_FsWorkbook__FsWorkbook_createFrom_Static_Z2DEFA746(name, data, fields) {
|
|
309
|
+
const workbook = new FsWorkbook();
|
|
310
|
+
FsSpreadsheet_FsWorkbook__FsWorkbook_populate_Static_Z7163EB39(workbook, name, data, fields);
|
|
311
|
+
return workbook;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
export function FsSpreadsheet_FsWorkbook__FsWorkbook_createFrom_Static_Z2A1350BF(data, fields) {
|
|
315
|
+
return FsSpreadsheet_FsWorkbook__FsWorkbook_createFrom_Static_Z2DEFA746("Sheet1", data, fields);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export function FsSpreadsheet_FsWorkbook__FsWorkbook_createFrom_Static_Z2E36FAE7(sheets) {
|
|
319
|
+
const workbook = new FsWorkbook();
|
|
320
|
+
iterate((sheet) => {
|
|
321
|
+
const value = workbook.AddWorksheet(sheet);
|
|
322
|
+
}, sheets);
|
|
323
|
+
return workbook;
|
|
324
|
+
}
|
|
325
|
+
|