xlsxrb 0.1.17 → 0.2.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +256 -1
- data/README.md +111 -28
- data/lib/ruby_lsp/xlsxrb/completion_listener.rb +439 -139
- data/lib/xlsxrb/chart_builder.rb +540 -193
- data/lib/xlsxrb/dsl_helpers.rb +178 -73
- data/lib/xlsxrb/elements/cell.rb +197 -130
- data/lib/xlsxrb/elements/column.rb +88 -7
- data/lib/xlsxrb/elements/coordinate_access.rb +86 -59
- data/lib/xlsxrb/elements/image.rb +18 -19
- data/lib/xlsxrb/elements/metadata.rb +2379 -0
- data/lib/xlsxrb/elements/row.rb +84 -118
- data/lib/xlsxrb/elements/styles.rb +140 -90
- data/lib/xlsxrb/elements/types.rb +164 -22
- data/lib/xlsxrb/elements/workbook.rb +122 -140
- data/lib/xlsxrb/elements/worksheet.rb +451 -226
- data/lib/xlsxrb/elements.rb +1 -0
- data/lib/xlsxrb/ooxml/reader/listeners/core_listeners.rb +16 -5
- data/lib/xlsxrb/ooxml/reader/listeners/drawing_listeners.rb +14 -9
- data/lib/xlsxrb/ooxml/reader/listeners/feature_listeners.rb +296 -34
- data/lib/xlsxrb/ooxml/reader/listeners/style_listeners.rb +17 -3
- data/lib/xlsxrb/ooxml/reader.rb +52 -50
- data/lib/xlsxrb/ooxml/styles_parser.rb +36 -5
- data/lib/xlsxrb/ooxml/utils.rb +2 -2
- data/lib/xlsxrb/ooxml/workbook_parser.rb +0 -1
- data/lib/xlsxrb/ooxml/workbook_writer.rb +242 -109
- data/lib/xlsxrb/ooxml/worksheet_parser.rb +63 -31
- data/lib/xlsxrb/ooxml/worksheet_writer.rb +119 -56
- data/lib/xlsxrb/ooxml/writer/drawing_xml.rb +33 -13
- data/lib/xlsxrb/ooxml/writer/features_xml.rb +75 -15
- data/lib/xlsxrb/ooxml/writer/styles_xml.rb +18 -8
- data/lib/xlsxrb/ooxml/writer.rb +124 -44
- data/lib/xlsxrb/ooxml/xml_parser.rb +78 -5
- data/lib/xlsxrb/ooxml/zip_generator.rb +2 -0
- data/lib/xlsxrb/ooxml/zip_reader.rb +112 -25
- data/lib/xlsxrb/ooxml/zip_writer.rb +119 -30
- data/lib/xlsxrb/stream_row.rb +56 -81
- data/lib/xlsxrb/stream_sheet.rb +542 -273
- data/lib/xlsxrb/stream_writer.rb +1536 -870
- data/lib/xlsxrb/style_builder.rb +667 -221
- data/lib/xlsxrb/version.rb +1 -1
- data/lib/xlsxrb/workbook_builder.rb +406 -143
- data/lib/xlsxrb/worksheet_builder.rb +1009 -900
- data/lib/xlsxrb.rb +1179 -1056
- data/sig/generated/xlsxrb/chart_builder.rbs +385 -159
- data/sig/generated/xlsxrb/dsl_helpers.rbs +81 -15
- data/sig/generated/xlsxrb/elements/cell.rbs +78 -70
- data/sig/generated/xlsxrb/elements/column.rbs +55 -3
- data/sig/generated/xlsxrb/elements/coordinate_access.rbs +35 -29
- data/sig/generated/xlsxrb/elements/image.rbs +7 -11
- data/sig/generated/xlsxrb/elements/metadata.rbs +1574 -0
- data/sig/generated/xlsxrb/elements/row.rbs +39 -42
- data/sig/generated/xlsxrb/elements/styles.rbs +66 -66
- data/sig/generated/xlsxrb/elements/types.rbs +27 -0
- data/sig/generated/xlsxrb/elements/workbook.rbs +46 -99
- data/sig/generated/xlsxrb/elements/worksheet.rbs +121 -96
- data/sig/generated/xlsxrb/ooxml/reader/listeners/feature_listeners.rbs +61 -4
- data/sig/generated/xlsxrb/ooxml/reader.rbs +2 -2
- data/sig/generated/xlsxrb/ooxml/styles_parser.rbs +1 -1
- data/sig/generated/xlsxrb/ooxml/utils.rbs +3 -3
- data/sig/generated/xlsxrb/ooxml/workbook_writer.rbs +13 -1
- data/sig/generated/xlsxrb/ooxml/worksheet_parser.rbs +16 -0
- data/sig/generated/xlsxrb/ooxml/worksheet_writer.rbs +6 -4
- data/sig/generated/xlsxrb/ooxml/writer/features_xml.rbs +7 -0
- data/sig/generated/xlsxrb/ooxml/writer.rbs +22 -13
- data/sig/generated/xlsxrb/ooxml/xml_parser.rbs +70 -0
- data/sig/generated/xlsxrb/ooxml/zip_generator.rbs +2 -0
- data/sig/generated/xlsxrb/ooxml/zip_reader.rbs +24 -9
- data/sig/generated/xlsxrb/ooxml/zip_writer.rbs +26 -1
- data/sig/generated/xlsxrb/stream_row.rbs +32 -33
- data/sig/generated/xlsxrb/stream_sheet.rbs +233 -181
- data/sig/generated/xlsxrb/stream_writer.rbs +961 -667
- data/sig/generated/xlsxrb/style_builder.rbs +402 -128
- data/sig/generated/xlsxrb/workbook_builder.rbs +223 -71
- data/sig/generated/xlsxrb/worksheet_builder.rbs +579 -453
- data/sig/generated/xlsxrb.rbs +205 -144
- data/sig/rexml.rbs +8 -0
- metadata +5 -5
- data/lib/xlsxrb/utils.rb +0 -291
- data/sig/generated/xlsxrb/utils.rbs +0 -184
|
@@ -53,8 +53,15 @@ module Xlsxrb
|
|
|
53
53
|
# @param pad_empty_rows [Boolean] Whether to yield empty rows for skipped row numbers.
|
|
54
54
|
# @param pad_empty_cells [Boolean] Whether to pad missing cells within rows.
|
|
55
55
|
# @param images [Array<Elements::Image>, nil] Optional preloaded images array.
|
|
56
|
-
#
|
|
57
|
-
|
|
56
|
+
# @param defined_names [Array<Hash, Elements::DefinedName>, nil] Optional workbook defined names.
|
|
57
|
+
# @param sheet_index [Integer, nil] 0-based worksheet index.
|
|
58
|
+
# @param charts [Array<Elements::Chart>, nil] Optional preloaded charts.
|
|
59
|
+
# @param sparkline_groups [Array<Elements::SparklineGroup>, nil] Optional preloaded sparkline groups.
|
|
60
|
+
# @param print_area [String, nil] Optional print area range.
|
|
61
|
+
# @param print_titles [Elements::PrintTitles, nil] Optional repeating print titles.
|
|
62
|
+
# @param header_footer_images [Array<Elements::HeaderFooterImage>, nil] Optional preloaded header/footer images.
|
|
63
|
+
# : (String name, untyped sheet_source, Array[String] shared_strings, ?(Elements::Styles | Hash[untyped, untyped])? styles, ?zip_reader: Ooxml::ZipReader?, ?entry_name: String?, ?state: Symbol, ?date1904: bool, ?dimension: String?, ?trim_empty_rows: bool, ?pad_empty_rows: bool, ?pad_empty_cells: bool, ?images: Array[Elements::Image]?, ?defined_names: Array[untyped]?, ?sheet_index: Integer?, ?charts: Array[Elements::Chart]?, ?sparkline_groups: Array[Elements::SparklineGroup]?, ?print_area: String?, ?print_titles: Elements::PrintTitles?, ?header_footer_images: Array[Elements::HeaderFooterImage]?) -> void
|
|
64
|
+
def initialize: (String name, untyped sheet_source, Array[String] shared_strings, ?(Elements::Styles | Hash[untyped, untyped])? styles, ?zip_reader: Ooxml::ZipReader?, ?entry_name: String?, ?state: Symbol, ?date1904: bool, ?dimension: String?, ?trim_empty_rows: bool, ?pad_empty_rows: bool, ?pad_empty_cells: bool, ?images: Array[Elements::Image]?, ?defined_names: Array[untyped]?, ?sheet_index: Integer?, ?charts: Array[Elements::Chart]?, ?sparkline_groups: Array[Elements::SparklineGroup]?, ?print_area: String?, ?print_titles: Elements::PrintTitles?, ?header_footer_images: Array[Elements::HeaderFooterImage]?) -> void
|
|
58
65
|
|
|
59
66
|
# Returns whether trailing empty rows are omitted during iteration.
|
|
60
67
|
#
|
|
@@ -63,8 +70,6 @@ module Xlsxrb
|
|
|
63
70
|
# : () -> bool
|
|
64
71
|
def trim_empty_rows?: () -> bool
|
|
65
72
|
|
|
66
|
-
alias trim_empty_rows trim_empty_rows?
|
|
67
|
-
|
|
68
73
|
# Returns whether skipped rows are padded during iteration.
|
|
69
74
|
#
|
|
70
75
|
# @return [Boolean]
|
|
@@ -72,8 +77,6 @@ module Xlsxrb
|
|
|
72
77
|
# : () -> bool
|
|
73
78
|
def pad_empty_rows?: () -> bool
|
|
74
79
|
|
|
75
|
-
alias pad_empty_rows pad_empty_rows?
|
|
76
|
-
|
|
77
80
|
# Returns whether missing cells within rows are padded during iteration.
|
|
78
81
|
#
|
|
79
82
|
# @return [Boolean]
|
|
@@ -81,8 +84,6 @@ module Xlsxrb
|
|
|
81
84
|
# : () -> bool
|
|
82
85
|
def pad_empty_cells?: () -> bool
|
|
83
86
|
|
|
84
|
-
alias pad_empty_cells pad_empty_cells?
|
|
85
|
-
|
|
86
87
|
# Returns the dimension reference string (e.g. "A1:Z50000"), or nil if not present.
|
|
87
88
|
#
|
|
88
89
|
# @return [String, nil]
|
|
@@ -90,37 +91,25 @@ module Xlsxrb
|
|
|
90
91
|
# : () -> String?
|
|
91
92
|
def dimension: () -> String?
|
|
92
93
|
|
|
93
|
-
# Returns the
|
|
94
|
+
# Returns the 0-based range of rows defined in the sheet dimension, or nil.
|
|
94
95
|
#
|
|
95
|
-
# @
|
|
96
|
-
#
|
|
97
|
-
# : () -> Integer?
|
|
98
|
-
def first_row: () -> Integer?
|
|
99
|
-
|
|
100
|
-
# Returns the 1-based index of the first column defined in the sheet dimension, or nil.
|
|
96
|
+
# @example
|
|
97
|
+
# sheet.row_range #=> 0..9
|
|
101
98
|
#
|
|
102
|
-
# @return [Integer
|
|
99
|
+
# @return [Range<Integer>, nil]
|
|
103
100
|
# @api public
|
|
104
|
-
# : () -> Integer?
|
|
105
|
-
def
|
|
106
|
-
|
|
107
|
-
alias first_col first_column
|
|
101
|
+
# : () -> Range[Integer]?
|
|
102
|
+
def row_range: () -> Range[Integer]?
|
|
108
103
|
|
|
109
|
-
# Returns the
|
|
104
|
+
# Returns the 0-based range of columns defined in the sheet dimension, or nil.
|
|
110
105
|
#
|
|
111
|
-
# @
|
|
112
|
-
#
|
|
113
|
-
# : () -> Integer?
|
|
114
|
-
def last_row: () -> Integer?
|
|
115
|
-
|
|
116
|
-
# Returns the 1-based index of the last column defined in the sheet dimension, or nil.
|
|
106
|
+
# @example
|
|
107
|
+
# sheet.column_range #=> 0..4
|
|
117
108
|
#
|
|
118
|
-
# @return [Integer
|
|
109
|
+
# @return [Range<Integer>, nil]
|
|
119
110
|
# @api public
|
|
120
|
-
# : () -> Integer?
|
|
121
|
-
def
|
|
122
|
-
|
|
123
|
-
alias last_col last_column
|
|
111
|
+
# : () -> Range[Integer]?
|
|
112
|
+
def column_range: () -> Range[Integer]?
|
|
124
113
|
|
|
125
114
|
# Returns whether the sheet uses the 1904 date system.
|
|
126
115
|
#
|
|
@@ -238,77 +227,83 @@ module Xlsxrb
|
|
|
238
227
|
| (?trim_empty_rows: bool?, ?pad_empty_rows: bool?, ?pad_empty_cells: bool?) -> Enumerator[StreamRow | Elements::Row, void]
|
|
239
228
|
|
|
240
229
|
# Loads this sheet completely into an in-memory {Elements::Worksheet},
|
|
241
|
-
# enabling coordinate random access (`sheet["A1"]`)
|
|
242
|
-
# and immutable cell updates (`update_cell`).
|
|
230
|
+
# enabling coordinate random access (`sheet["A1"]`) and row lookups (`row_at`).
|
|
243
231
|
#
|
|
244
232
|
# @return [Elements::Worksheet] The fully parsed in-memory worksheet.
|
|
245
233
|
# @api public
|
|
246
234
|
# : () -> Elements::Worksheet
|
|
247
235
|
def load: () -> Elements::Worksheet
|
|
248
236
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
# Returns hyperlinks configured for this worksheet as a Hash of cell references to hyperlink hashes.
|
|
237
|
+
# Returns hyperlinks configured for this worksheet as a Hash of cell references to {Elements::Hyperlink} objects.
|
|
252
238
|
#
|
|
253
|
-
# @return [Hash<String,
|
|
239
|
+
# @return [Hash<String, Elements::Hyperlink>]
|
|
254
240
|
# @api public
|
|
255
|
-
# : () -> Hash[String,
|
|
256
|
-
def hyperlinks: () -> Hash[String,
|
|
241
|
+
# : () -> Hash[String, Elements::Hyperlink]
|
|
242
|
+
def hyperlinks: () -> Hash[String, Elements::Hyperlink]
|
|
257
243
|
|
|
258
244
|
# Returns hyperlink metadata for a specific cell reference, or nil.
|
|
259
245
|
#
|
|
260
246
|
# @param ref_or_row [String, Symbol, Integer] Cell reference (e.g. "A1") or 0-based row index.
|
|
261
|
-
# @param col [Integer, nil] Optional 0-based column index.
|
|
262
|
-
# @return [
|
|
247
|
+
# @param col [Integer, String, Symbol, nil] Optional 0-based column index or column letter/Symbol.
|
|
248
|
+
# @return [Elements::Hyperlink, nil]
|
|
263
249
|
# @api public
|
|
264
|
-
# : (String | Symbol | Integer ref_or_row, ?Integer
|
|
265
|
-
def hyperlink: (String | Symbol | Integer ref_or_row, ?Integer
|
|
250
|
+
# : (String | Symbol | Integer ref_or_row, ?Integer | String | Symbol | nil col) -> Elements::Hyperlink?
|
|
251
|
+
def hyperlink: (String | Symbol | Integer ref_or_row, ?Integer | String | Symbol | nil col) -> Elements::Hyperlink?
|
|
266
252
|
|
|
267
|
-
# Returns comments configured for this worksheet as an Array of
|
|
253
|
+
# Returns comments configured for this worksheet as an Array of {Elements::Comment} objects.
|
|
268
254
|
#
|
|
269
|
-
# @return [Array<
|
|
255
|
+
# @return [Array<Elements::Comment>]
|
|
270
256
|
# @api public
|
|
271
|
-
# : () -> Array[
|
|
272
|
-
def comments: () -> Array[
|
|
257
|
+
# : () -> Array[Elements::Comment]
|
|
258
|
+
def comments: () -> Array[Elements::Comment]
|
|
273
259
|
|
|
274
260
|
# Returns comment metadata for a specific cell reference, or nil.
|
|
275
261
|
#
|
|
276
262
|
# @param ref_or_row [String, Symbol, Integer] Cell reference (e.g. "A1") or 0-based row index.
|
|
277
|
-
# @param col [Integer, nil] Optional 0-based column index.
|
|
278
|
-
# @return [
|
|
263
|
+
# @param col [Integer, String, Symbol, nil] Optional 0-based column index or column letter/Symbol.
|
|
264
|
+
# @return [Elements::Comment, nil]
|
|
279
265
|
# @api public
|
|
280
|
-
# : (String | Symbol | Integer ref_or_row, ?Integer
|
|
281
|
-
def comment: (String | Symbol | Integer ref_or_row, ?Integer
|
|
266
|
+
# : (String | Symbol | Integer ref_or_row, ?Integer | String | Symbol | nil col) -> Elements::Comment?
|
|
267
|
+
def comment: (String | Symbol | Integer ref_or_row, ?Integer | String | Symbol | nil col) -> Elements::Comment?
|
|
282
268
|
|
|
283
269
|
# Returns comments indexed by cell reference.
|
|
284
270
|
#
|
|
285
|
-
# @return [Hash<String,
|
|
271
|
+
# @return [Hash<String, Elements::Comment>]
|
|
272
|
+
# @api public
|
|
273
|
+
# : () -> Hash[String, Elements::Comment]
|
|
274
|
+
def comments_by_ref: () -> Hash[String, Elements::Comment]
|
|
275
|
+
|
|
276
|
+
# Returns threaded comments configured for this worksheet as an Array of {Elements::ThreadedComment} objects.
|
|
277
|
+
#
|
|
278
|
+
# @return [Array<Elements::ThreadedComment>]
|
|
286
279
|
# @api public
|
|
287
|
-
# : () ->
|
|
288
|
-
def
|
|
280
|
+
# : () -> Array[Elements::ThreadedComment]
|
|
281
|
+
def threaded_comments: () -> Array[Elements::ThreadedComment]
|
|
289
282
|
|
|
290
|
-
# Returns threaded
|
|
283
|
+
# Returns the root threaded comment for a specific cell reference, or nil.
|
|
291
284
|
#
|
|
292
|
-
# @
|
|
285
|
+
# @param ref_or_row [String, Symbol, Integer] Cell reference (e.g. "A1") or 0-based row index.
|
|
286
|
+
# @param col [Integer, String, Symbol, nil] Optional 0-based column index or column letter/Symbol.
|
|
287
|
+
# @return [Elements::ThreadedComment, nil]
|
|
293
288
|
# @api public
|
|
294
|
-
# : (
|
|
295
|
-
def
|
|
289
|
+
# : (String | Symbol | Integer ref_or_row, ?Integer | String | Symbol | nil col) -> Elements::ThreadedComment?
|
|
290
|
+
def threaded_comment: (String | Symbol | Integer ref_or_row, ?Integer | String | Symbol | nil col) -> Elements::ThreadedComment?
|
|
296
291
|
|
|
297
292
|
# Returns threaded comments for a specific cell reference, or empty array.
|
|
298
293
|
#
|
|
299
294
|
# @param ref_or_row [String, Symbol, Integer] Cell reference (e.g. "A1") or 0-based row index.
|
|
300
|
-
# @param col [Integer, nil] Optional 0-based column index.
|
|
301
|
-
# @return [Array<
|
|
295
|
+
# @param col [Integer, String, Symbol, nil] Optional 0-based column index or column letter/Symbol.
|
|
296
|
+
# @return [Array<Elements::ThreadedComment>]
|
|
302
297
|
# @api public
|
|
303
|
-
# : (String | Symbol | Integer ref_or_row, ?Integer
|
|
304
|
-
def
|
|
298
|
+
# : (String | Symbol | Integer ref_or_row, ?Integer | String | Symbol | nil col) -> Array[Elements::ThreadedComment]
|
|
299
|
+
def threaded_comments_at: (String | Symbol | Integer ref_or_row, ?Integer | String | Symbol | nil col) -> Array[Elements::ThreadedComment]
|
|
305
300
|
|
|
306
301
|
# Returns threaded comments indexed by cell reference.
|
|
307
302
|
#
|
|
308
|
-
# @return [Hash<String, Array<
|
|
303
|
+
# @return [Hash<String, Array<Elements::ThreadedComment>>]
|
|
309
304
|
# @api public
|
|
310
|
-
# : () -> Hash[String, Array[
|
|
311
|
-
def threaded_comments_by_ref: () -> Hash[String, Array[
|
|
305
|
+
# : () -> Hash[String, Array[Elements::ThreadedComment]]
|
|
306
|
+
def threaded_comments_by_ref: () -> Hash[String, Array[Elements::ThreadedComment]]
|
|
312
307
|
|
|
313
308
|
# Returns all embedded images in this worksheet.
|
|
314
309
|
#
|
|
@@ -320,40 +315,11 @@ module Xlsxrb
|
|
|
320
315
|
# Returns all images anchored at a specific cell reference or 0-based coordinate.
|
|
321
316
|
#
|
|
322
317
|
# @param ref_or_row [String, Symbol, Integer] Cell reference (e.g. "A1") or 0-based row index.
|
|
323
|
-
# @param col [Integer, nil] Optional 0-based column index.
|
|
318
|
+
# @param col [Integer, String, Symbol, nil] Optional 0-based column index or column letter/Symbol.
|
|
324
319
|
# @return [Array<Elements::Image>]
|
|
325
320
|
# @api public
|
|
326
|
-
# : (String | Symbol | Integer ref_or_row, ?Integer
|
|
327
|
-
def images_at: (String | Symbol | Integer ref_or_row, ?Integer
|
|
328
|
-
|
|
329
|
-
# Loads and returns images for this worksheet, optionally yielding self for block syntax.
|
|
330
|
-
#
|
|
331
|
-
# @yield [sheet]
|
|
332
|
-
# @yieldparam sheet [StreamSheet]
|
|
333
|
-
# @return [StreamSheet, void]
|
|
334
|
-
# @api public
|
|
335
|
-
# : () { (StreamSheet) -> void } -> void
|
|
336
|
-
# : () -> StreamSheet
|
|
337
|
-
def with_images: () { (StreamSheet) -> void } -> void
|
|
338
|
-
| () -> StreamSheet
|
|
339
|
-
|
|
340
|
-
# Access a cell by reference or 0-based coordinates.
|
|
341
|
-
#
|
|
342
|
-
# @param ref_or_row [String, Symbol, Integer] Cell reference (e.g. "A1") or 0-based row index.
|
|
343
|
-
# @param col [Integer, nil] Optional 0-based column index.
|
|
344
|
-
# @return [Elements::Cell, nil]
|
|
345
|
-
# @api public
|
|
346
|
-
# : (String | Symbol | Integer ref_or_row, ?Integer? col) -> Elements::Cell?
|
|
347
|
-
def cell: (String | Symbol | Integer ref_or_row, ?Integer? col) -> Elements::Cell?
|
|
348
|
-
|
|
349
|
-
# Returns the formatted string representation of a cell's value.
|
|
350
|
-
#
|
|
351
|
-
# @param ref_or_row [String, Symbol, Integer] Cell reference (e.g. "A1") or 0-based row index.
|
|
352
|
-
# @param col [Integer, nil] Optional 0-based column index.
|
|
353
|
-
# @return [String, nil]
|
|
354
|
-
# @api public
|
|
355
|
-
# : (String | Symbol | Integer ref_or_row, ?Integer? col) -> String?
|
|
356
|
-
def formatted_value: (String | Symbol | Integer ref_or_row, ?Integer? col) -> String?
|
|
321
|
+
# : (String | Symbol | Integer ref_or_row, ?Integer | String | Symbol | nil col) -> Array[Elements::Image]
|
|
322
|
+
def images_at: (String | Symbol | Integer ref_or_row, ?Integer | String | Symbol | nil col) -> Array[Elements::Image]
|
|
357
323
|
|
|
358
324
|
# Returns merged cell ranges (e.g. ["A1:B2"]) for this worksheet.
|
|
359
325
|
#
|
|
@@ -369,70 +335,98 @@ module Xlsxrb
|
|
|
369
335
|
# : () -> String?
|
|
370
336
|
def auto_filter: () -> String?
|
|
371
337
|
|
|
338
|
+
# Returns column filter rules defined for this worksheet.
|
|
339
|
+
#
|
|
340
|
+
# @return [Hash<Integer, Elements::FilterColumn>]
|
|
341
|
+
# @api public
|
|
342
|
+
# : () -> Hash[Integer, Elements::FilterColumn]
|
|
343
|
+
def filter_columns: () -> Hash[Integer, Elements::FilterColumn]
|
|
344
|
+
|
|
372
345
|
# Returns data validation rules configured for this worksheet.
|
|
373
346
|
#
|
|
374
|
-
# @return [Array<
|
|
347
|
+
# @return [Array<Elements::DataValidation>]
|
|
375
348
|
# @api public
|
|
376
|
-
# : () -> Array[
|
|
377
|
-
def data_validations: () -> Array[
|
|
349
|
+
# : () -> Array[Elements::DataValidation]
|
|
350
|
+
def data_validations: () -> Array[Elements::DataValidation]
|
|
378
351
|
|
|
379
352
|
# Returns conditional formatting rules configured for this worksheet.
|
|
380
353
|
#
|
|
381
|
-
#
|
|
354
|
+
# Corresponds to ECMA-376 Part 4 §18.3.1.18 (<conditionalFormatting> and <cfRule> elements).
|
|
355
|
+
#
|
|
356
|
+
# @return [Array<Elements::ConditionalFormat>]
|
|
382
357
|
# @api public
|
|
383
|
-
# : () -> Array[
|
|
384
|
-
def conditional_formats: () -> Array[
|
|
385
|
-
|
|
386
|
-
alias conditional_formatting conditional_formats
|
|
358
|
+
# : () -> Array[Elements::ConditionalFormat]
|
|
359
|
+
def conditional_formats: () -> Array[Elements::ConditionalFormat]
|
|
387
360
|
|
|
388
361
|
# Returns tables defined in this worksheet.
|
|
389
362
|
#
|
|
390
|
-
# @return [Array<
|
|
363
|
+
# @return [Array<Elements::Table>]
|
|
391
364
|
# @api public
|
|
392
|
-
# : () -> Array[
|
|
393
|
-
def tables: () -> Array[
|
|
365
|
+
# : () -> Array[Elements::Table]
|
|
366
|
+
def tables: () -> Array[Elements::Table]
|
|
367
|
+
|
|
368
|
+
# Returns pivot tables defined in this worksheet.
|
|
369
|
+
#
|
|
370
|
+
# @return [Array<Elements::PivotTable>]
|
|
371
|
+
# @api public
|
|
372
|
+
# : () -> Array[Elements::PivotTable]
|
|
373
|
+
def pivot_tables: () -> Array[Elements::PivotTable]
|
|
394
374
|
|
|
395
375
|
# Returns shapes defined in this worksheet.
|
|
396
376
|
#
|
|
397
|
-
# @return [Array<
|
|
377
|
+
# @return [Array<Elements::Shape>]
|
|
398
378
|
# @api public
|
|
399
|
-
# : () -> Array[
|
|
400
|
-
def shapes: () -> Array[
|
|
379
|
+
# : () -> Array[Elements::Shape]
|
|
380
|
+
def shapes: () -> Array[Elements::Shape]
|
|
401
381
|
|
|
402
382
|
# Returns freeze pane settings for this worksheet, or nil if none.
|
|
403
383
|
#
|
|
404
|
-
# @return [
|
|
384
|
+
# @return [Elements::FreezePane, nil]
|
|
385
|
+
# @api public
|
|
386
|
+
# : () -> Elements::FreezePane?
|
|
387
|
+
def freeze_pane: () -> Elements::FreezePane?
|
|
388
|
+
|
|
389
|
+
# Returns split pane settings for this worksheet, or nil if none.
|
|
390
|
+
#
|
|
391
|
+
# @return [Elements::SplitPane, nil]
|
|
405
392
|
# @api public
|
|
406
|
-
# : () ->
|
|
407
|
-
def
|
|
393
|
+
# : () -> Elements::SplitPane?
|
|
394
|
+
def split_pane: () -> Elements::SplitPane?
|
|
408
395
|
|
|
409
396
|
# Returns sheet view properties for this worksheet.
|
|
410
397
|
#
|
|
411
|
-
# @return [
|
|
398
|
+
# @return [Elements::SheetView]
|
|
412
399
|
# @api public
|
|
413
|
-
# : () ->
|
|
414
|
-
def sheet_view: () ->
|
|
400
|
+
# : () -> Elements::SheetView
|
|
401
|
+
def sheet_view: () -> Elements::SheetView
|
|
402
|
+
|
|
403
|
+
# Returns sort state configuration for this worksheet, or nil if none.
|
|
404
|
+
#
|
|
405
|
+
# @return [Elements::SortState, nil]
|
|
406
|
+
# @api public
|
|
407
|
+
# : () -> Elements::SortState?
|
|
408
|
+
def sort_state: () -> Elements::SortState?
|
|
415
409
|
|
|
416
410
|
# Returns selection settings for this worksheet, or nil if none.
|
|
417
411
|
#
|
|
418
|
-
# @return [
|
|
412
|
+
# @return [Elements::Selection, nil]
|
|
419
413
|
# @api public
|
|
420
|
-
# : () ->
|
|
421
|
-
def selection: () ->
|
|
414
|
+
# : () -> Elements::Selection?
|
|
415
|
+
def selection: () -> Elements::Selection?
|
|
422
416
|
|
|
423
417
|
# Returns sheet protection settings as a hash, or nil if unprotected.
|
|
424
418
|
#
|
|
425
|
-
# @return [
|
|
419
|
+
# @return [Elements::SheetProtection, nil]
|
|
426
420
|
# @api public
|
|
427
|
-
# : () ->
|
|
428
|
-
def sheet_protection: () ->
|
|
421
|
+
# : () -> Elements::SheetProtection?
|
|
422
|
+
def sheet_protection: () -> Elements::SheetProtection?
|
|
429
423
|
|
|
430
424
|
# Returns sheet-level properties (tabColor, outlinePr, sheetPr) for this worksheet.
|
|
431
425
|
#
|
|
432
|
-
# @return [
|
|
426
|
+
# @return [Elements::SheetProperties]
|
|
433
427
|
# @api public
|
|
434
|
-
# : () ->
|
|
435
|
-
def sheet_properties: () ->
|
|
428
|
+
# : () -> Elements::SheetProperties
|
|
429
|
+
def sheet_properties: () -> Elements::SheetProperties
|
|
436
430
|
|
|
437
431
|
# Returns the internal VBA or application code name of the worksheet, or nil if not specified.
|
|
438
432
|
#
|
|
@@ -448,8 +442,6 @@ module Xlsxrb
|
|
|
448
442
|
# : () -> bool
|
|
449
443
|
def fit_to_page?: () -> bool
|
|
450
444
|
|
|
451
|
-
alias fit_to_page fit_to_page?
|
|
452
|
-
|
|
453
445
|
# Returns whether full calculation on load is enabled on this worksheet.
|
|
454
446
|
#
|
|
455
447
|
# @return [Boolean]
|
|
@@ -457,16 +449,12 @@ module Xlsxrb
|
|
|
457
449
|
# : () -> bool
|
|
458
450
|
def full_calc_on_load?: () -> bool
|
|
459
451
|
|
|
460
|
-
alias full_calc_on_load full_calc_on_load?
|
|
461
|
-
|
|
462
452
|
# Returns sheet calculation properties (<sheetCalcPr>), or nil if not present.
|
|
463
453
|
#
|
|
464
|
-
# @return [
|
|
454
|
+
# @return [Elements::SheetCalcProperties, nil]
|
|
465
455
|
# @api public
|
|
466
|
-
# : () ->
|
|
467
|
-
def
|
|
468
|
-
|
|
469
|
-
alias calc_pr sheet_calc_pr
|
|
456
|
+
# : () -> Elements::SheetCalcProperties?
|
|
457
|
+
def sheet_calc_properties: () -> Elements::SheetCalcProperties?
|
|
470
458
|
|
|
471
459
|
# Returns the worksheet tab color specification, or nil if not set.
|
|
472
460
|
#
|
|
@@ -482,63 +470,61 @@ module Xlsxrb
|
|
|
482
470
|
# : () -> Hash[Symbol, untyped]
|
|
483
471
|
def outline_properties: () -> Hash[Symbol, untyped]
|
|
484
472
|
|
|
485
|
-
alias outline_pr outline_properties
|
|
486
|
-
|
|
487
473
|
# Returns sheet format properties (defaultRowHeight, defaultColWidth, baseColWidth) for this worksheet.
|
|
488
474
|
#
|
|
489
|
-
# @return [
|
|
475
|
+
# @return [Elements::SheetFormat]
|
|
490
476
|
# @api public
|
|
491
|
-
# : () ->
|
|
492
|
-
def sheet_format: () ->
|
|
477
|
+
# : () -> Elements::SheetFormat
|
|
478
|
+
def sheet_format: () -> Elements::SheetFormat
|
|
493
479
|
|
|
494
480
|
# Returns page setup configurations for this worksheet.
|
|
495
481
|
#
|
|
496
|
-
# @return [
|
|
482
|
+
# @return [Elements::PageSetup]
|
|
497
483
|
# @api public
|
|
498
|
-
# : () ->
|
|
499
|
-
def page_setup: () ->
|
|
484
|
+
# : () -> Elements::PageSetup
|
|
485
|
+
def page_setup: () -> Elements::PageSetup
|
|
500
486
|
|
|
501
487
|
# Returns page margins for this worksheet, or nil if none.
|
|
502
488
|
#
|
|
503
|
-
# @return [
|
|
489
|
+
# @return [Elements::PageMargins, nil]
|
|
504
490
|
# @api public
|
|
505
|
-
# : () ->
|
|
506
|
-
def page_margins: () ->
|
|
491
|
+
# : () -> Elements::PageMargins?
|
|
492
|
+
def page_margins: () -> Elements::PageMargins?
|
|
507
493
|
|
|
508
494
|
# Returns header/footer configurations for this worksheet.
|
|
509
495
|
#
|
|
510
|
-
# @return [
|
|
496
|
+
# @return [Elements::HeaderFooter]
|
|
511
497
|
# @api public
|
|
512
|
-
# : () ->
|
|
513
|
-
def header_footer: () ->
|
|
498
|
+
# : () -> Elements::HeaderFooter
|
|
499
|
+
def header_footer: () -> Elements::HeaderFooter
|
|
514
500
|
|
|
515
501
|
# Returns print options for this worksheet.
|
|
516
502
|
#
|
|
517
|
-
# @return [
|
|
503
|
+
# @return [Elements::PrintOptions]
|
|
518
504
|
# @api public
|
|
519
|
-
# : () ->
|
|
520
|
-
def print_options: () ->
|
|
505
|
+
# : () -> Elements::PrintOptions
|
|
506
|
+
def print_options: () -> Elements::PrintOptions
|
|
521
507
|
|
|
522
508
|
# Returns explicit row page breaks for this worksheet.
|
|
523
509
|
#
|
|
524
|
-
# @return [Array<
|
|
510
|
+
# @return [Array<Elements::PageBreak>]
|
|
525
511
|
# @api public
|
|
526
|
-
# : () -> Array[
|
|
527
|
-
def row_breaks: () -> Array[
|
|
512
|
+
# : () -> Array[Elements::PageBreak]
|
|
513
|
+
def row_breaks: () -> Array[Elements::PageBreak]
|
|
528
514
|
|
|
529
515
|
# Returns explicit column page breaks for this worksheet.
|
|
530
516
|
#
|
|
531
|
-
# @return [Array<
|
|
517
|
+
# @return [Array<Elements::PageBreak>]
|
|
532
518
|
# @api public
|
|
533
|
-
# : () -> Array[
|
|
534
|
-
def
|
|
519
|
+
# : () -> Array[Elements::PageBreak]
|
|
520
|
+
def column_breaks: () -> Array[Elements::PageBreak]
|
|
535
521
|
|
|
536
522
|
# Returns protected ranges defined for this worksheet.
|
|
537
523
|
#
|
|
538
|
-
# @return [Array<
|
|
524
|
+
# @return [Array<Elements::ProtectedRange>]
|
|
539
525
|
# @api public
|
|
540
|
-
# : () -> Array[
|
|
541
|
-
def protected_ranges: () -> Array[
|
|
526
|
+
# : () -> Array[Elements::ProtectedRange]
|
|
527
|
+
def protected_ranges: () -> Array[Elements::ProtectedRange]
|
|
542
528
|
|
|
543
529
|
# Returns cell watch cell references defined for this worksheet.
|
|
544
530
|
#
|
|
@@ -549,37 +535,107 @@ module Xlsxrb
|
|
|
549
535
|
|
|
550
536
|
# Returns ignored error rules defined for this worksheet.
|
|
551
537
|
#
|
|
552
|
-
# @return [Array<
|
|
538
|
+
# @return [Array<Elements::IgnoredError>]
|
|
553
539
|
# @api public
|
|
554
|
-
# : () -> Array[
|
|
555
|
-
def ignored_errors: () -> Array[
|
|
540
|
+
# : () -> Array[Elements::IgnoredError]
|
|
541
|
+
def ignored_errors: () -> Array[Elements::IgnoredError]
|
|
556
542
|
|
|
557
543
|
# Returns phonetic properties defined for this worksheet, or nil.
|
|
558
544
|
#
|
|
559
|
-
# @return [
|
|
545
|
+
# @return [Elements::PhoneticProperties, nil]
|
|
560
546
|
# @api public
|
|
561
|
-
# : () ->
|
|
562
|
-
def phonetic_properties: () ->
|
|
563
|
-
|
|
564
|
-
alias phonetic_pr phonetic_properties
|
|
547
|
+
# : () -> Elements::PhoneticProperties?
|
|
548
|
+
def phonetic_properties: () -> Elements::PhoneticProperties?
|
|
565
549
|
|
|
566
550
|
# Returns the background image configured for this worksheet, or nil.
|
|
567
551
|
#
|
|
568
|
-
# @return [
|
|
552
|
+
# @return [Elements::BackgroundImage, nil]
|
|
569
553
|
# @api public
|
|
570
|
-
# : () ->
|
|
571
|
-
def background_image: () ->
|
|
572
|
-
|
|
573
|
-
alias background_picture background_image
|
|
574
|
-
|
|
575
|
-
alias picture background_image
|
|
554
|
+
# : () -> Elements::BackgroundImage?
|
|
555
|
+
def background_image: () -> Elements::BackgroundImage?
|
|
576
556
|
|
|
577
557
|
# Closes any underlying reader resources.
|
|
578
558
|
# : () -> void
|
|
579
559
|
def close: () -> void
|
|
580
560
|
|
|
561
|
+
# Returns 0-based bounds { min_row: r1, max_row: r2, min_column: c1, max_column: c2 } from dimension ref.
|
|
562
|
+
#
|
|
563
|
+
# @example
|
|
564
|
+
# sheet.dimension_bounds #=> { min_row: 0, max_row: 4, min_column: 0, max_column: 2 }
|
|
565
|
+
#
|
|
566
|
+
# @return [Hash{Symbol => Integer}, nil]
|
|
567
|
+
# @api public
|
|
568
|
+
# : () -> Hash[Symbol, Integer]?
|
|
569
|
+
def dimension_bounds: () -> Hash[Symbol, Integer]?
|
|
570
|
+
|
|
571
|
+
# Returns column definitions for this worksheet.
|
|
572
|
+
#
|
|
573
|
+
# @return [Array<Elements::Column>]
|
|
574
|
+
# @api public
|
|
575
|
+
# : () -> Array[Elements::Column]
|
|
576
|
+
def columns: () -> Array[Elements::Column]
|
|
577
|
+
|
|
578
|
+
# Returns charts defined in this worksheet.
|
|
579
|
+
#
|
|
580
|
+
# @return [Array<Elements::Chart>]
|
|
581
|
+
# @api public
|
|
582
|
+
# : () -> Array[Elements::Chart]
|
|
583
|
+
def charts: () -> Array[Elements::Chart]
|
|
584
|
+
|
|
585
|
+
# Returns sparkline groups defined in this worksheet.
|
|
586
|
+
#
|
|
587
|
+
# @return [Array<Elements::SparklineGroup>]
|
|
588
|
+
# @api public
|
|
589
|
+
# : () -> Array[Elements::SparklineGroup]
|
|
590
|
+
def sparkline_groups: () -> Array[Elements::SparklineGroup]
|
|
591
|
+
|
|
592
|
+
# Returns the print area range for this worksheet, or nil if unset.
|
|
593
|
+
#
|
|
594
|
+
# @return [String, nil]
|
|
595
|
+
# @api public
|
|
596
|
+
# : () -> String?
|
|
597
|
+
def print_area: () -> String?
|
|
598
|
+
|
|
599
|
+
# Returns print titles configuration for this worksheet, or nil if unset.
|
|
600
|
+
#
|
|
601
|
+
# @return [Elements::PrintTitles, nil]
|
|
602
|
+
# @api public
|
|
603
|
+
# : () -> Elements::PrintTitles?
|
|
604
|
+
def print_titles: () -> Elements::PrintTitles?
|
|
605
|
+
|
|
606
|
+
# Returns whether the worksheet has any structural or schema validation errors.
|
|
607
|
+
#
|
|
608
|
+
# @return [Boolean]
|
|
609
|
+
# @api public
|
|
610
|
+
# : () -> bool
|
|
611
|
+
def valid?: () -> bool
|
|
612
|
+
|
|
613
|
+
# Returns validation error messages for this worksheet.
|
|
614
|
+
#
|
|
615
|
+
# @return [Array<String>]
|
|
616
|
+
# @api public
|
|
617
|
+
# : () -> Array[String]
|
|
618
|
+
def errors: () -> Array[String]
|
|
619
|
+
|
|
620
|
+
# Returns unmapped metadata for this worksheet.
|
|
621
|
+
#
|
|
622
|
+
# @return [Hash[Symbol, untyped]]
|
|
623
|
+
# @api public
|
|
624
|
+
# : () -> Hash[Symbol, untyped]
|
|
625
|
+
def unmapped_data: () -> Hash[Symbol, untyped]
|
|
626
|
+
|
|
627
|
+
# Returns header/footer images configured for this worksheet.
|
|
628
|
+
#
|
|
629
|
+
# @return [Array<Elements::HeaderFooterImage>]
|
|
630
|
+
# @api public
|
|
631
|
+
# : () -> Array[Elements::HeaderFooterImage]
|
|
632
|
+
def header_footer_images: () -> Array[Elements::HeaderFooterImage]
|
|
633
|
+
|
|
581
634
|
private
|
|
582
635
|
|
|
636
|
+
# : () -> Hash[Symbol, untyped]
|
|
637
|
+
def auto_filter_data: () -> Hash[Symbol, untyped]
|
|
638
|
+
|
|
583
639
|
# : () -> Hash[Symbol, untyped]
|
|
584
640
|
def sheet_view_data: () -> Hash[Symbol, untyped]
|
|
585
641
|
|
|
@@ -589,10 +645,6 @@ module Xlsxrb
|
|
|
589
645
|
# : () -> String
|
|
590
646
|
def raw_sheet_xml: () -> String
|
|
591
647
|
|
|
592
|
-
# Returns 1-based bounds [first_row, first_col, last_row, last_col] from dimension ref.
|
|
593
|
-
# : () -> Array[Integer]?
|
|
594
|
-
def dimension_bounds: () -> Array[Integer]?
|
|
595
|
-
|
|
596
648
|
# Extracts dimension reference from XML source lazily without parsing the entire file.
|
|
597
649
|
# : () -> String?
|
|
598
650
|
def extract_dimension: () -> String?
|