@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,398 @@
|
|
|
1
|
+
import { FsCellsCollection__RemoveValueAt_Z37302880, FsCellsCollection__TryRemoveValueAt_Z37302880, FsCellsCollection__RemoveCellAt_Z37302880, FsCellsCollection__Add_2E78CE33, FsCellsCollection__Add_Z21F271A4, FsCellsCollection__Add_Z334DF64D, FsCellsCollection__TryGetCell_Z37302880, FsCellsCollection__Copy, FsCellsCollection__GetCells, FsCellsCollection_$ctor } from "./Cells/FsCellsCollection.fs.js";
|
|
2
|
+
import { empty, maxBy, filter, exists, find, tryFind, iterate, last, head, sortBy, map } from "../fable-library.4.1.4/Seq.js";
|
|
3
|
+
import { FsColumn } from "./FsColumn.fs.js";
|
|
4
|
+
import { clear, safeHash, equals, disposeSafe, getEnumerator, numberHash, comparePrimitives } from "../fable-library.4.1.4/Util.js";
|
|
5
|
+
import { FsAddress__get_ColumnNumber, FsAddress__get_RowNumber, FsAddress_$ctor_Z37302880 } from "./FsAddress.fs.js";
|
|
6
|
+
import { FsRangeAddress__get_LastAddress, FsRangeAddress__get_FirstAddress, FsRangeAddress_$ctor_7E77A4A0 } from "./Ranges/FsRangeAddress.fs.js";
|
|
7
|
+
import { groupBy } from "../fable-library.4.1.4/Seq2.js";
|
|
8
|
+
import { FsRow } from "./FsRow.fs.js";
|
|
9
|
+
import { toConsole, printf, toFail } from "../fable-library.4.1.4/String.js";
|
|
10
|
+
import { FsRangeBase__set_RangeAddress_6A2513BC } from "./Ranges/FsRangeBase.fs.js";
|
|
11
|
+
import { addRangeInPlace, removeInPlace } from "../fable-library.4.1.4/Array.js";
|
|
12
|
+
import { tryFind as tryFind_1, ofSeq } from "../fable-library.4.1.4/Map.js";
|
|
13
|
+
import { value as value_3, defaultArg } from "../fable-library.4.1.4/Option.js";
|
|
14
|
+
import { FsTable } from "./Tables/FsTable.fs.js";
|
|
15
|
+
import { iterate as iterate_1 } from "../fable-library.4.1.4/List.js";
|
|
16
|
+
import { FsCell } from "./Cells/FsCell.fs.js";
|
|
17
|
+
import { class_type } from "../fable-library.4.1.4/Reflection.js";
|
|
18
|
+
|
|
19
|
+
export class FsWorksheet {
|
|
20
|
+
constructor(name, fsRows, fsTables, fsCellsCollection) {
|
|
21
|
+
this.name = name;
|
|
22
|
+
this._name = this.name;
|
|
23
|
+
this._rows = defaultArg(fsRows, []);
|
|
24
|
+
this._tables = defaultArg(fsTables, []);
|
|
25
|
+
this._cells = defaultArg(fsCellsCollection, FsCellsCollection_$ctor());
|
|
26
|
+
}
|
|
27
|
+
static init(name) {
|
|
28
|
+
return new FsWorksheet(name, [], [], FsCellsCollection_$ctor());
|
|
29
|
+
}
|
|
30
|
+
get Name() {
|
|
31
|
+
const self = this;
|
|
32
|
+
return self._name;
|
|
33
|
+
}
|
|
34
|
+
set Name(name) {
|
|
35
|
+
const self = this;
|
|
36
|
+
self._name = name;
|
|
37
|
+
}
|
|
38
|
+
get CellCollection() {
|
|
39
|
+
const self = this;
|
|
40
|
+
return self._cells;
|
|
41
|
+
}
|
|
42
|
+
get Tables() {
|
|
43
|
+
const self = this;
|
|
44
|
+
return self._tables;
|
|
45
|
+
}
|
|
46
|
+
get Rows() {
|
|
47
|
+
const self = this;
|
|
48
|
+
return self._rows;
|
|
49
|
+
}
|
|
50
|
+
get Columns() {
|
|
51
|
+
const self = this;
|
|
52
|
+
return map((tupledArg) => {
|
|
53
|
+
let tupledArg_1, cells_1, c_2, c_3;
|
|
54
|
+
const columnIndex = tupledArg[0] | 0;
|
|
55
|
+
return new FsColumn((tupledArg_1 = ((cells_1 = sortBy((c_1) => c_1.RowNumber, tupledArg[1], {
|
|
56
|
+
Compare: comparePrimitives,
|
|
57
|
+
}), [FsAddress_$ctor_Z37302880((c_2 = head(cells_1), c_2.RowNumber), columnIndex), FsAddress_$ctor_Z37302880((c_3 = last(cells_1), c_3.RowNumber), columnIndex)])), FsRangeAddress_$ctor_7E77A4A0(tupledArg_1[0], tupledArg_1[1])), self.CellCollection);
|
|
58
|
+
}, groupBy((c) => c.ColumnNumber, FsCellsCollection__GetCells(self._cells), {
|
|
59
|
+
Equals: (x, y) => (x === y),
|
|
60
|
+
GetHashCode: numberHash,
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
Copy() {
|
|
64
|
+
let n, n_1;
|
|
65
|
+
const self = this;
|
|
66
|
+
const fcc = FsCellsCollection__Copy(self.CellCollection);
|
|
67
|
+
return new FsWorksheet(self.Name, (n = [], (iterate((r) => {
|
|
68
|
+
const arg = r.Copy();
|
|
69
|
+
void (n.push(arg));
|
|
70
|
+
}, self.Rows), n)), (n_1 = [], (iterate((t) => {
|
|
71
|
+
const arg_1 = t.Copy();
|
|
72
|
+
void (n_1.push(arg_1));
|
|
73
|
+
}, self.Tables), n_1)), fcc);
|
|
74
|
+
}
|
|
75
|
+
static copy(sheet) {
|
|
76
|
+
return sheet.Copy();
|
|
77
|
+
}
|
|
78
|
+
Row(rowIndex) {
|
|
79
|
+
const self = this;
|
|
80
|
+
const matchValue = tryFind((row) => (row.Index === rowIndex), self._rows);
|
|
81
|
+
if (matchValue == null) {
|
|
82
|
+
const row_2 = FsRow.createAt(rowIndex, self.CellCollection);
|
|
83
|
+
void (self._rows.push(row_2));
|
|
84
|
+
return row_2;
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
return matchValue;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
RowWithRange(rangeAddress) {
|
|
91
|
+
const self = this;
|
|
92
|
+
if (FsAddress__get_RowNumber(FsRangeAddress__get_FirstAddress(rangeAddress)) !== FsAddress__get_RowNumber(FsRangeAddress__get_LastAddress(rangeAddress))) {
|
|
93
|
+
toFail(printf("Row may not have a range address spanning over different row indices"));
|
|
94
|
+
}
|
|
95
|
+
FsRangeBase__set_RangeAddress_6A2513BC(self.Row(FsAddress__get_RowNumber(FsRangeAddress__get_FirstAddress(rangeAddress))), rangeAddress);
|
|
96
|
+
}
|
|
97
|
+
static appendRow(row, sheet) {
|
|
98
|
+
sheet.Row(row.Index);
|
|
99
|
+
return sheet;
|
|
100
|
+
}
|
|
101
|
+
static getRows(sheet) {
|
|
102
|
+
return sheet.Rows;
|
|
103
|
+
}
|
|
104
|
+
static getRowAt(rowIndex, sheet) {
|
|
105
|
+
return find((arg_1) => (rowIndex === FsRow.getIndex(arg_1)), FsWorksheet.getRows(sheet));
|
|
106
|
+
}
|
|
107
|
+
static tryGetRowAt(rowIndex, sheet) {
|
|
108
|
+
return tryFind((arg_1) => (rowIndex === FsRow.getIndex(arg_1)), sheet.Rows);
|
|
109
|
+
}
|
|
110
|
+
static tryGetRowAfter(rowIndex, sheet) {
|
|
111
|
+
return tryFind((r) => (r.Index >= rowIndex), sheet.Rows);
|
|
112
|
+
}
|
|
113
|
+
InsertBefore(row, refRow) {
|
|
114
|
+
const self = this;
|
|
115
|
+
let enumerator = getEnumerator(self._rows);
|
|
116
|
+
try {
|
|
117
|
+
while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
|
|
118
|
+
const row_1 = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
119
|
+
if (row_1.Index >= refRow.Index) {
|
|
120
|
+
row_1.Index = ((row_1.Index + 1) | 0);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
finally {
|
|
125
|
+
disposeSafe(enumerator);
|
|
126
|
+
}
|
|
127
|
+
self.Row(row.Index);
|
|
128
|
+
return self;
|
|
129
|
+
}
|
|
130
|
+
static insertBefore(row, refRow, sheet) {
|
|
131
|
+
return sheet.InsertBefore(row, refRow);
|
|
132
|
+
}
|
|
133
|
+
ContainsRowAt(rowIndex) {
|
|
134
|
+
const self = this;
|
|
135
|
+
return exists((t) => (t.Index === rowIndex), self.Rows);
|
|
136
|
+
}
|
|
137
|
+
static containsRowAt(rowIndex, sheet) {
|
|
138
|
+
return sheet.ContainsRowAt(rowIndex);
|
|
139
|
+
}
|
|
140
|
+
static countRows(sheet) {
|
|
141
|
+
return sheet.Rows.length;
|
|
142
|
+
}
|
|
143
|
+
RemoveRowAt(rowIndex) {
|
|
144
|
+
const self = this;
|
|
145
|
+
const enumerator = getEnumerator(filter((r) => (r.Index === rowIndex), self._rows));
|
|
146
|
+
try {
|
|
147
|
+
while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
|
|
148
|
+
removeInPlace(enumerator["System.Collections.Generic.IEnumerator`1.get_Current"](), self._rows, {
|
|
149
|
+
Equals: equals,
|
|
150
|
+
GetHashCode: safeHash,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
finally {
|
|
155
|
+
disposeSafe(enumerator);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
static removeRowAt(rowIndex, sheet) {
|
|
159
|
+
sheet.RemoveRowAt(rowIndex);
|
|
160
|
+
return sheet;
|
|
161
|
+
}
|
|
162
|
+
TryRemoveAt(rowIndex) {
|
|
163
|
+
const self = this;
|
|
164
|
+
if (self.ContainsRowAt(rowIndex)) {
|
|
165
|
+
self.RemoveRowAt(rowIndex);
|
|
166
|
+
}
|
|
167
|
+
return self;
|
|
168
|
+
}
|
|
169
|
+
static tryRemoveAt(rowIndex, sheet) {
|
|
170
|
+
if (FsWorksheet.containsRowAt(rowIndex, sheet)) {
|
|
171
|
+
sheet.RemoveRowAt(rowIndex);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
SortRows() {
|
|
175
|
+
const self = this;
|
|
176
|
+
const sorted = Array.from(sortBy((r) => r.Index, self._rows, {
|
|
177
|
+
Compare: comparePrimitives,
|
|
178
|
+
}));
|
|
179
|
+
clear(self._rows);
|
|
180
|
+
addRangeInPlace(sorted, self._rows);
|
|
181
|
+
}
|
|
182
|
+
MapRowsInPlace(f) {
|
|
183
|
+
const self = this;
|
|
184
|
+
for (let i = 0; i <= (self._rows.length - 1); i++) {
|
|
185
|
+
const r = self._rows[i];
|
|
186
|
+
self._rows[i] = f(r);
|
|
187
|
+
}
|
|
188
|
+
return self;
|
|
189
|
+
}
|
|
190
|
+
static mapRowsInPlace(f, sheet) {
|
|
191
|
+
return sheet.MapRowsInPlace(f);
|
|
192
|
+
}
|
|
193
|
+
GetMaxRowIndex() {
|
|
194
|
+
const self = this;
|
|
195
|
+
if (self.Rows.length === 0) {
|
|
196
|
+
throw new Error("The FsWorksheet has no FsRows.");
|
|
197
|
+
}
|
|
198
|
+
return maxBy((r) => r.Index, self.Rows, {
|
|
199
|
+
Compare: comparePrimitives,
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
static getMaxRowIndex(sheet) {
|
|
203
|
+
return sheet.GetMaxRowIndex();
|
|
204
|
+
}
|
|
205
|
+
GetRowValuesAt(rowIndex) {
|
|
206
|
+
const self = this;
|
|
207
|
+
return self.ContainsRowAt(rowIndex) ? map((c) => c.Value, self.Row(rowIndex).Cells) : empty();
|
|
208
|
+
}
|
|
209
|
+
static getRowValuesAt(rowIndex, sheet) {
|
|
210
|
+
return sheet.GetRowValuesAt(rowIndex);
|
|
211
|
+
}
|
|
212
|
+
TryGetRowValuesAt(rowIndex) {
|
|
213
|
+
const self = this;
|
|
214
|
+
return self.ContainsRowAt(rowIndex) ? self.GetRowValuesAt(rowIndex) : void 0;
|
|
215
|
+
}
|
|
216
|
+
static tryGetRowValuesAt(rowIndex, sheet) {
|
|
217
|
+
return sheet.TryGetRowValuesAt(rowIndex);
|
|
218
|
+
}
|
|
219
|
+
RescanRows() {
|
|
220
|
+
const self = this;
|
|
221
|
+
const rows = ofSeq(map((r) => [r.Index, r], self._rows), {
|
|
222
|
+
Compare: comparePrimitives,
|
|
223
|
+
});
|
|
224
|
+
iterate((tupledArg) => {
|
|
225
|
+
let c_2, c_3;
|
|
226
|
+
const rowIndex = tupledArg[0] | 0;
|
|
227
|
+
let newRange;
|
|
228
|
+
let tupledArg_1;
|
|
229
|
+
const cells_1 = sortBy((c_1) => c_1.ColumnNumber, tupledArg[1], {
|
|
230
|
+
Compare: comparePrimitives,
|
|
231
|
+
});
|
|
232
|
+
tupledArg_1 = [FsAddress_$ctor_Z37302880(rowIndex, (c_2 = head(cells_1), c_2.ColumnNumber)), FsAddress_$ctor_Z37302880(rowIndex, (c_3 = last(cells_1), c_3.ColumnNumber))];
|
|
233
|
+
newRange = FsRangeAddress_$ctor_7E77A4A0(tupledArg_1[0], tupledArg_1[1]);
|
|
234
|
+
const matchValue = tryFind_1(rowIndex, rows);
|
|
235
|
+
if (matchValue == null) {
|
|
236
|
+
self.RowWithRange(newRange);
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
FsRangeBase__set_RangeAddress_6A2513BC(matchValue, newRange);
|
|
240
|
+
}
|
|
241
|
+
}, groupBy((c) => c.RowNumber, FsCellsCollection__GetCells(self._cells), {
|
|
242
|
+
Equals: (x_1, y_1) => (x_1 === y_1),
|
|
243
|
+
GetHashCode: numberHash,
|
|
244
|
+
}));
|
|
245
|
+
}
|
|
246
|
+
Column(columnIndex) {
|
|
247
|
+
const self = this;
|
|
248
|
+
return FsColumn.createAt(columnIndex, self.CellCollection);
|
|
249
|
+
}
|
|
250
|
+
ColumnWithRange(rangeAddress) {
|
|
251
|
+
const self = this;
|
|
252
|
+
if (FsAddress__get_ColumnNumber(FsRangeAddress__get_FirstAddress(rangeAddress)) !== FsAddress__get_ColumnNumber(FsRangeAddress__get_LastAddress(rangeAddress))) {
|
|
253
|
+
toFail(printf("Column may not have a range address spanning over different column indices"));
|
|
254
|
+
}
|
|
255
|
+
FsRangeBase__set_RangeAddress_6A2513BC(self.Column(FsAddress__get_ColumnNumber(FsRangeAddress__get_FirstAddress(rangeAddress))), rangeAddress);
|
|
256
|
+
}
|
|
257
|
+
static getColumns(sheet) {
|
|
258
|
+
return sheet.Columns;
|
|
259
|
+
}
|
|
260
|
+
static getColumnAt(columnIndex, sheet) {
|
|
261
|
+
return find((arg_1) => (columnIndex === FsColumn.getIndex(arg_1)), FsWorksheet.getColumns(sheet));
|
|
262
|
+
}
|
|
263
|
+
static tryGetColumnAt(columnIndex, sheet) {
|
|
264
|
+
return tryFind((arg_1) => (columnIndex === FsColumn.getIndex(arg_1)), sheet.Columns);
|
|
265
|
+
}
|
|
266
|
+
Table(tableName, rangeAddress, showHeaderRow) {
|
|
267
|
+
const self = this;
|
|
268
|
+
const showHeaderRow_1 = defaultArg(showHeaderRow, true);
|
|
269
|
+
const matchValue = tryFind((table) => (table.Name === self.name), self._tables);
|
|
270
|
+
if (matchValue == null) {
|
|
271
|
+
const table_2 = new FsTable(tableName, rangeAddress, showHeaderRow_1);
|
|
272
|
+
void (self._tables.push(table_2));
|
|
273
|
+
return table_2;
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
return matchValue;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
static tryGetTableByName(tableName, sheet) {
|
|
280
|
+
return tryFind((t) => (t.Name === tableName), sheet.Tables);
|
|
281
|
+
}
|
|
282
|
+
static getTableByName(tableName, sheet) {
|
|
283
|
+
try {
|
|
284
|
+
return value_3(tryFind((t) => (t.Name === tableName), sheet.Tables));
|
|
285
|
+
}
|
|
286
|
+
catch (matchValue) {
|
|
287
|
+
throw new Error(`FsTable with name ${tableName} is not presen in the FsWorksheet ${sheet.Name}.`);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
AddTable(table) {
|
|
291
|
+
const self = this;
|
|
292
|
+
if (exists((t) => (t.Name === table.Name), self.Tables)) {
|
|
293
|
+
toConsole(`FsTable ${table.Name} could not be appended as an FsTable with this name is already present in the FsWorksheet ${self.Name}.`);
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
void (self._tables.push(table));
|
|
297
|
+
}
|
|
298
|
+
return self;
|
|
299
|
+
}
|
|
300
|
+
static addTable(table, sheet) {
|
|
301
|
+
return sheet.AddTable(table);
|
|
302
|
+
}
|
|
303
|
+
AddTables(tables) {
|
|
304
|
+
const self = this;
|
|
305
|
+
iterate_1((arg_1) => {
|
|
306
|
+
self.AddTable(arg_1);
|
|
307
|
+
}, tables);
|
|
308
|
+
return self;
|
|
309
|
+
}
|
|
310
|
+
static addTables(tables, sheet) {
|
|
311
|
+
return sheet.AddTables(tables);
|
|
312
|
+
}
|
|
313
|
+
TryGetCellAt(rowIndex, colIndex) {
|
|
314
|
+
const self = this;
|
|
315
|
+
return FsCellsCollection__TryGetCell_Z37302880(self.CellCollection, rowIndex, colIndex);
|
|
316
|
+
}
|
|
317
|
+
static tryGetCellAt(rowIndex, colIndex, sheet) {
|
|
318
|
+
return sheet.TryGetCellAt(rowIndex, colIndex);
|
|
319
|
+
}
|
|
320
|
+
GetCellAt(rowIndex, colIndex) {
|
|
321
|
+
const self = this;
|
|
322
|
+
return value_3(self.TryGetCellAt(rowIndex, colIndex));
|
|
323
|
+
}
|
|
324
|
+
static getCellAt(rowIndex, colIndex, sheet) {
|
|
325
|
+
return sheet.GetCellAt(rowIndex, colIndex);
|
|
326
|
+
}
|
|
327
|
+
AddCell(cell) {
|
|
328
|
+
const self = this;
|
|
329
|
+
const value = FsCellsCollection__Add_Z334DF64D(self.CellCollection, cell);
|
|
330
|
+
return self;
|
|
331
|
+
}
|
|
332
|
+
AddCells(cells) {
|
|
333
|
+
const self = this;
|
|
334
|
+
const value = FsCellsCollection__Add_Z21F271A4(self.CellCollection, cells);
|
|
335
|
+
return self;
|
|
336
|
+
}
|
|
337
|
+
InsertValueAt(value, rowIndex, colIndex) {
|
|
338
|
+
const self = this;
|
|
339
|
+
const cell = new FsCell(value);
|
|
340
|
+
FsCellsCollection__Add_2E78CE33(self.CellCollection, rowIndex, colIndex, cell);
|
|
341
|
+
}
|
|
342
|
+
static insertValueAt(value, rowIndex, colIndex, sheet) {
|
|
343
|
+
sheet.InsertValueAt(value, rowIndex, colIndex);
|
|
344
|
+
}
|
|
345
|
+
SetValueAt(value, rowIndex, colIndex) {
|
|
346
|
+
const self = this;
|
|
347
|
+
const matchValue = FsCellsCollection__TryGetCell_Z37302880(self.CellCollection, rowIndex, colIndex);
|
|
348
|
+
if (matchValue == null) {
|
|
349
|
+
const value_2 = FsCellsCollection__Add_2E78CE33(self.CellCollection, rowIndex, colIndex, value);
|
|
350
|
+
return self;
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
const c = matchValue;
|
|
354
|
+
const value_1 = c.SetValueAs(value);
|
|
355
|
+
return self;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
static setValueAt(value, rowIndex, colIndex, sheet) {
|
|
359
|
+
return sheet.SetValueAt(value, rowIndex, colIndex);
|
|
360
|
+
}
|
|
361
|
+
RemoveCellAt(rowIndex, colIndex) {
|
|
362
|
+
const self = this;
|
|
363
|
+
FsCellsCollection__RemoveCellAt_Z37302880(self.CellCollection, rowIndex, colIndex);
|
|
364
|
+
return self;
|
|
365
|
+
}
|
|
366
|
+
static removeCellAt(rowIndex, colIndex, sheet) {
|
|
367
|
+
return sheet.RemoveCellAt(rowIndex, colIndex);
|
|
368
|
+
}
|
|
369
|
+
TryRemoveValueAt(rowIndex, colIndex) {
|
|
370
|
+
const self = this;
|
|
371
|
+
FsCellsCollection__TryRemoveValueAt_Z37302880(self.CellCollection, rowIndex, colIndex);
|
|
372
|
+
}
|
|
373
|
+
static tryRemoveValueAt(rowIndex, colIndex, sheet) {
|
|
374
|
+
sheet.TryRemoveValueAt(rowIndex, colIndex);
|
|
375
|
+
}
|
|
376
|
+
RemoveValueAt(rowIndex, colIndex) {
|
|
377
|
+
const self = this;
|
|
378
|
+
FsCellsCollection__RemoveValueAt_Z37302880(self.CellCollection, rowIndex, colIndex);
|
|
379
|
+
}
|
|
380
|
+
static removeValueAt(rowIndex, colIndex, sheet) {
|
|
381
|
+
sheet.RemoveValueAt(rowIndex, colIndex);
|
|
382
|
+
}
|
|
383
|
+
static addCell(cell, sheet) {
|
|
384
|
+
return sheet.AddCell(cell);
|
|
385
|
+
}
|
|
386
|
+
static addCells(cell, sheet) {
|
|
387
|
+
return sheet.AddCells(cell);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
export function FsWorksheet_$reflection() {
|
|
392
|
+
return class_type("FsSpreadsheet.FsWorksheet", void 0, FsWorksheet);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
export function FsWorksheet_$ctor_7FDA5F7A(name, fsRows, fsTables, fsCellsCollection) {
|
|
396
|
+
return new FsWorksheet(name, fsRows, fsTables, fsCellsCollection);
|
|
397
|
+
}
|
|
398
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
namespace FsSpreadsheet
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
type FsRange(rangeAddress : FsRangeAddress, styleValue) =
|
|
5
|
+
|
|
6
|
+
inherit FsRangeBase(rangeAddress)
|
|
7
|
+
|
|
8
|
+
new (rangeAddress : FsRangeAddress) = FsRange(rangeAddress, null)
|
|
9
|
+
new (rangeBase : FsRangeBase) = FsRange(rangeBase.RangeAddress, null)
|
|
10
|
+
|
|
11
|
+
member self.Row(row : int32) =
|
|
12
|
+
if (row <= 0 || row + base.RangeAddress.FirstAddress.RowNumber - 1 > 1048576 ) then
|
|
13
|
+
raise (new System.ArgumentOutOfRangeException(string row,sprintf "Row number must be between 1 and %i" 1048576))
|
|
14
|
+
let firstCellAddress = FsAddress(base.RangeAddress.FirstAddress.RowNumber + row - 1,base.RangeAddress.FirstAddress.ColumnNumber)
|
|
15
|
+
let lastCellAddress = FsAddress(base.RangeAddress.FirstAddress.RowNumber + row - 1,base.RangeAddress.LastAddress.ColumnNumber)
|
|
16
|
+
FsRangeRow(FsRangeAddress(firstCellAddress, lastCellAddress))
|
|
17
|
+
|
|
18
|
+
member self.FirstRow() =
|
|
19
|
+
self.Row(1)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { FsRangeBase__get_RangeAddress, FsRangeBase_$reflection, FsRangeBase } from "./FsRangeBase.fs.js";
|
|
2
|
+
import { class_type } from "../../fable-library.4.1.4/Reflection.js";
|
|
3
|
+
import { int32ToString, defaultOf } from "../../fable-library.4.1.4/Util.js";
|
|
4
|
+
import { FsAddress__get_ColumnNumber, FsAddress_$ctor_Z37302880, FsAddress__get_RowNumber } from "../FsAddress.fs.js";
|
|
5
|
+
import { FsRangeAddress__get_LastAddress, FsRangeAddress_$ctor_7E77A4A0, FsRangeAddress__get_FirstAddress } from "./FsRangeAddress.fs.js";
|
|
6
|
+
import { printf, toText } from "../../fable-library.4.1.4/String.js";
|
|
7
|
+
import { FsRangeRow_$ctor_6A2513BC } from "./FsRangeRow.fs.js";
|
|
8
|
+
|
|
9
|
+
export class FsRange extends FsRangeBase {
|
|
10
|
+
constructor(rangeAddress, styleValue) {
|
|
11
|
+
super(rangeAddress);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function FsRange_$reflection() {
|
|
16
|
+
return class_type("FsSpreadsheet.FsRange", void 0, FsRange, FsRangeBase_$reflection());
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function FsRange_$ctor_Z1F5897D9(rangeAddress, styleValue) {
|
|
20
|
+
return new FsRange(rangeAddress, styleValue);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function FsRange_$ctor_6A2513BC(rangeAddress) {
|
|
24
|
+
return FsRange_$ctor_Z1F5897D9(rangeAddress, defaultOf());
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function FsRange_$ctor_65705F1F(rangeBase) {
|
|
28
|
+
return FsRange_$ctor_Z1F5897D9(FsRangeBase__get_RangeAddress(rangeBase), defaultOf());
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function FsRange__Row_Z524259A4(self, row) {
|
|
32
|
+
if ((row <= 0) ? true : (((row + FsAddress__get_RowNumber(FsRangeAddress__get_FirstAddress(FsRangeBase__get_RangeAddress(self)))) - 1) > 1048576)) {
|
|
33
|
+
throw new Error(int32ToString(row), toText(printf("Row number must be between 1 and %i"))(1048576));
|
|
34
|
+
}
|
|
35
|
+
return FsRangeRow_$ctor_6A2513BC(FsRangeAddress_$ctor_7E77A4A0(FsAddress_$ctor_Z37302880((FsAddress__get_RowNumber(FsRangeAddress__get_FirstAddress(FsRangeBase__get_RangeAddress(self))) + row) - 1, FsAddress__get_ColumnNumber(FsRangeAddress__get_FirstAddress(FsRangeBase__get_RangeAddress(self)))), FsAddress_$ctor_Z37302880((FsAddress__get_RowNumber(FsRangeAddress__get_FirstAddress(FsRangeBase__get_RangeAddress(self))) + row) - 1, FsAddress__get_ColumnNumber(FsRangeAddress__get_LastAddress(FsRangeBase__get_RangeAddress(self))))));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function FsRange__FirstRow(self) {
|
|
39
|
+
return FsRange__Row_Z524259A4(self, 1);
|
|
40
|
+
}
|
|
41
|
+
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
namespace rec FsSpreadsheet
|
|
2
|
+
|
|
3
|
+
open Fable.Core
|
|
4
|
+
|
|
5
|
+
// Helper functions for working with "A1:A1"-style table areas.
|
|
6
|
+
/// <summary>
|
|
7
|
+
/// The areas marks the area in which the table lies.
|
|
8
|
+
/// </summary>
|
|
9
|
+
module Range =
|
|
10
|
+
|
|
11
|
+
/// <summary>
|
|
12
|
+
/// Given A1-based top left start and bottom right end indices, returns a "A1:A1"-style area-
|
|
13
|
+
/// </summary>
|
|
14
|
+
let ofBoundaries fromCellReference toCellReference =
|
|
15
|
+
sprintf "%s:%s" fromCellReference toCellReference
|
|
16
|
+
|
|
17
|
+
/// <summary>
|
|
18
|
+
/// Given a "A1:A1"-style area, returns A1-based cell start and end cellReferences.
|
|
19
|
+
/// </summary>
|
|
20
|
+
let toBoundaries (area : string) =
|
|
21
|
+
area.Split ':'
|
|
22
|
+
|> fun a -> a.[0], a.[1]
|
|
23
|
+
|
|
24
|
+
/// <summary>
|
|
25
|
+
/// Gets the right boundary of the area.
|
|
26
|
+
/// </summary>
|
|
27
|
+
let rightBoundary (area : string) =
|
|
28
|
+
toBoundaries area
|
|
29
|
+
|> snd
|
|
30
|
+
|> CellReference.toIndices
|
|
31
|
+
|> fst
|
|
32
|
+
|
|
33
|
+
/// <summary>
|
|
34
|
+
/// Gets the left boundary of the area.
|
|
35
|
+
/// </summary>
|
|
36
|
+
let leftBoundary (area : string) =
|
|
37
|
+
toBoundaries area
|
|
38
|
+
|> fst
|
|
39
|
+
|> CellReference.toIndices
|
|
40
|
+
|> fst
|
|
41
|
+
|
|
42
|
+
/// <summary>
|
|
43
|
+
/// Gets the Upper boundary of the area.
|
|
44
|
+
/// </summary>
|
|
45
|
+
let upperBoundary (area : string) =
|
|
46
|
+
toBoundaries area
|
|
47
|
+
|> fst
|
|
48
|
+
|> CellReference.toIndices
|
|
49
|
+
|> snd
|
|
50
|
+
|
|
51
|
+
/// <summary>
|
|
52
|
+
/// Gets the lower boundary of the area.
|
|
53
|
+
/// </summary>
|
|
54
|
+
let lowerBoundary (area : string) =
|
|
55
|
+
toBoundaries area
|
|
56
|
+
|> snd
|
|
57
|
+
|> CellReference.toIndices
|
|
58
|
+
|> snd
|
|
59
|
+
|
|
60
|
+
/// <summary>
|
|
61
|
+
/// Moves both start and end of the area by the given amount (positive amount moves area to right and vice versa).
|
|
62
|
+
/// </summary>
|
|
63
|
+
let moveHorizontal amount (area : string) =
|
|
64
|
+
area
|
|
65
|
+
|> toBoundaries
|
|
66
|
+
|> fun (f,t) -> CellReference.moveHorizontal amount f, CellReference.moveHorizontal amount t
|
|
67
|
+
||> ofBoundaries
|
|
68
|
+
|
|
69
|
+
/// <summary>
|
|
70
|
+
/// Moves both start and end of the area by the given amount (positive amount moves area to right and vice versa).
|
|
71
|
+
/// </summary>
|
|
72
|
+
let moveVertical amount (area : string) =
|
|
73
|
+
area
|
|
74
|
+
|> toBoundaries
|
|
75
|
+
|> fun (f,t) -> CellReference.moveHorizontal amount f, CellReference.moveHorizontal amount t
|
|
76
|
+
||> ofBoundaries
|
|
77
|
+
|
|
78
|
+
/// <summary>
|
|
79
|
+
/// Extends the right boundary of the area by the given amount (positive amount increases area to right and vice versa).
|
|
80
|
+
/// </summary>
|
|
81
|
+
let extendRight amount (area : string) =
|
|
82
|
+
area
|
|
83
|
+
|> toBoundaries
|
|
84
|
+
|> fun (f,t) -> f, CellReference.moveHorizontal amount t
|
|
85
|
+
||> ofBoundaries
|
|
86
|
+
|
|
87
|
+
/// <summary>
|
|
88
|
+
/// Extends the left boundary of the area by the given amount (positive amount decreases the area to left and vice versa).
|
|
89
|
+
/// </summary>
|
|
90
|
+
let extendLeft amount (area : string) =
|
|
91
|
+
area
|
|
92
|
+
|> toBoundaries
|
|
93
|
+
|> fun (f,t) -> CellReference.moveHorizontal amount f, t
|
|
94
|
+
||> ofBoundaries
|
|
95
|
+
|
|
96
|
+
/// <summary>
|
|
97
|
+
/// Returns true if the column index of the reference exceeds the right boundary of the area.
|
|
98
|
+
/// </summary>
|
|
99
|
+
let referenceExceedsAreaRight reference area =
|
|
100
|
+
(reference |> CellReference.toIndices |> fst)
|
|
101
|
+
> (area |> rightBoundary)
|
|
102
|
+
|
|
103
|
+
/// <summary>
|
|
104
|
+
/// Returns true if the column index of the reference exceeds the left boundary of the area.
|
|
105
|
+
/// </summary>
|
|
106
|
+
let referenceExceedsAreaLeft reference area =
|
|
107
|
+
(reference |> CellReference.toIndices |> fst)
|
|
108
|
+
< (area |> leftBoundary)
|
|
109
|
+
|
|
110
|
+
/// <summary>
|
|
111
|
+
/// Returns true if the column index of the reference exceeds the upper boundary of the area.
|
|
112
|
+
/// </summary>
|
|
113
|
+
let referenceExceedsAreaAbove reference area =
|
|
114
|
+
(reference |> CellReference.toIndices |> snd)
|
|
115
|
+
> (area |> upperBoundary)
|
|
116
|
+
|
|
117
|
+
/// <summary>
|
|
118
|
+
/// Returns true if the column index of the reference exceeds the lower boundary of the area.
|
|
119
|
+
/// </summary>
|
|
120
|
+
let referenceExceedsAreaBelow reference area =
|
|
121
|
+
(reference |> CellReference.toIndices |> snd)
|
|
122
|
+
< (area |> lowerBoundary )
|
|
123
|
+
|
|
124
|
+
/// <summary>
|
|
125
|
+
/// Returns true if the reference does not lie in the boundary of the area.
|
|
126
|
+
/// </summary>
|
|
127
|
+
let referenceExceedsArea reference area =
|
|
128
|
+
referenceExceedsAreaRight reference area
|
|
129
|
+
||
|
|
130
|
+
referenceExceedsAreaLeft reference area
|
|
131
|
+
||
|
|
132
|
+
referenceExceedsAreaAbove reference area
|
|
133
|
+
||
|
|
134
|
+
referenceExceedsAreaBelow reference area
|
|
135
|
+
|
|
136
|
+
/// <summary>
|
|
137
|
+
/// Returns true if the A1:A1-style area is of correct format.
|
|
138
|
+
/// </summary>
|
|
139
|
+
let isCorrect area =
|
|
140
|
+
try
|
|
141
|
+
let hor = leftBoundary area <= rightBoundary area
|
|
142
|
+
let ver = upperBoundary area <= lowerBoundary area
|
|
143
|
+
|
|
144
|
+
if not hor then printfn "Right area boundary must be higher or equal to left area boundary."
|
|
145
|
+
if not ver then printfn "Lower area boundary must be higher or equal to upper area boundary."
|
|
146
|
+
|
|
147
|
+
hor && ver
|
|
148
|
+
|
|
149
|
+
with
|
|
150
|
+
| err ->
|
|
151
|
+
printfn "Area \"%s\" could not be parsed: %s" area err.Message
|
|
152
|
+
false
|
|
153
|
+
|
|
154
|
+
[<AllowNullLiteral>]
|
|
155
|
+
type FsRangeAddress(firstAddress : FsAddress, lastAddress : FsAddress) =
|
|
156
|
+
|
|
157
|
+
let mutable _firstAddress = firstAddress
|
|
158
|
+
let mutable _lastAddress = lastAddress
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
new(rangeAddress) =
|
|
162
|
+
let firstAdress,lastAddress = Range.toBoundaries rangeAddress
|
|
163
|
+
FsRangeAddress(FsAddress(firstAdress),FsAddress(lastAddress))
|
|
164
|
+
|
|
165
|
+
/// <summary>
|
|
166
|
+
/// Creates a deep copy of this FsRangeAddress.
|
|
167
|
+
/// </summary>
|
|
168
|
+
member self.Copy() =
|
|
169
|
+
FsRangeAddress(self.Range)
|
|
170
|
+
|
|
171
|
+
/// <summary>
|
|
172
|
+
/// Returns a deep copy of a given FsRangeAddress.
|
|
173
|
+
/// </summary>
|
|
174
|
+
static member copy (rangeAddress : FsRangeAddress) =
|
|
175
|
+
rangeAddress.Copy()
|
|
176
|
+
|
|
177
|
+
member self.Extend (address : FsAddress) =
|
|
178
|
+
if address.RowNumber < _firstAddress.RowNumber then
|
|
179
|
+
_firstAddress.RowNumber <- address.RowNumber
|
|
180
|
+
|
|
181
|
+
if address.RowNumber > _lastAddress.RowNumber then
|
|
182
|
+
_lastAddress.RowNumber <- address.RowNumber
|
|
183
|
+
|
|
184
|
+
if address.ColumnNumber < _firstAddress.ColumnNumber then
|
|
185
|
+
_firstAddress.ColumnNumber <- address.ColumnNumber
|
|
186
|
+
|
|
187
|
+
if address.ColumnNumber > _lastAddress.ColumnNumber then
|
|
188
|
+
_lastAddress.ColumnNumber <- address.ColumnNumber
|
|
189
|
+
|
|
190
|
+
member self.Normalize() =
|
|
191
|
+
|
|
192
|
+
let firstRow,lastRow =
|
|
193
|
+
if firstAddress.RowNumber < lastAddress.RowNumber then
|
|
194
|
+
firstAddress.RowNumber,lastAddress.RowNumber
|
|
195
|
+
else lastAddress.RowNumber,firstAddress.RowNumber
|
|
196
|
+
|
|
197
|
+
let firstColumn,lastColumn =
|
|
198
|
+
if firstAddress.RowNumber < lastAddress.RowNumber then
|
|
199
|
+
firstAddress.RowNumber,lastAddress.RowNumber
|
|
200
|
+
else lastAddress.RowNumber,firstAddress.RowNumber
|
|
201
|
+
|
|
202
|
+
_firstAddress <- FsAddress(firstRow,firstColumn)
|
|
203
|
+
_lastAddress <- FsAddress(lastRow,lastColumn)
|
|
204
|
+
|
|
205
|
+
member self.Range
|
|
206
|
+
with get() = Range.ofBoundaries _firstAddress.Address _lastAddress.Address
|
|
207
|
+
and set(address) =
|
|
208
|
+
let firstAdress, lastAdress = Range.toBoundaries address
|
|
209
|
+
_firstAddress <- FsAddress (firstAdress)
|
|
210
|
+
_lastAddress <- FsAddress (lastAdress)
|
|
211
|
+
|
|
212
|
+
override self.ToString() =
|
|
213
|
+
self.Range
|
|
214
|
+
|
|
215
|
+
member self.FirstAddress : FsAddress = _firstAddress
|
|
216
|
+
|
|
217
|
+
member self.LastAddress : FsAddress = _lastAddress
|
|
218
|
+
|
|
219
|
+
member self.Union(rangeAddress : FsRangeAddress) =
|
|
220
|
+
self.Extend(rangeAddress.FirstAddress)
|
|
221
|
+
self.Extend(rangeAddress.LastAddress)
|
|
222
|
+
self
|