diff --git a/Sources/CoreXLSX/Workbook.swift b/Sources/CoreXLSX/Workbook.swift
index 4f259ca9..cca696f7 100644
--- a/Sources/CoreXLSX/Workbook.swift
+++ b/Sources/CoreXLSX/Workbook.swift
@@ -46,10 +46,19 @@ public struct Workbook: Codable, Equatable {
public let id: String
public let relationship: String
+ public enum State: String, Codable {
+ case visible
+ case hidden
+ case veryHidden
+ }
+
+ public let state: State?
+
enum CodingKeys: String, CodingKey {
case name
case id = "sheetId"
case relationship = "r:id"
+ case state
}
}
diff --git a/Tests/CoreXLSXTests/Workbook.swift b/Tests/CoreXLSXTests/Workbook.swift
index f940c720..85f0e03f 100644
--- a/Tests/CoreXLSXTests/Workbook.swift
+++ b/Tests/CoreXLSXTests/Workbook.swift
@@ -22,14 +22,15 @@ import XMLCoder
private let parsedSheet = [
Workbook.Sheet(name: "Sheet 1",
id: "1",
- relationship: "rId4"),
+ relationship: "rId4",
+ state: nil),
]
// swiftlint:disable line_length
private let workbookNoViews =
"""
-
+
""".data(using: .utf8)!
// swiftlint:enable line_length
@@ -38,12 +39,14 @@ private let expectedWorkbook =
.init(
name: "Summary",
id: "1",
- relationship: "rId4"
+ relationship: "rId4",
+ state: .visible
),
.init(
name: "General",
id: "2",
- relationship: "rId5"
+ relationship: "rId5",
+ state: .hidden
),
]))