xlsxrb 0.1.17 → 0.1.18
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 +93 -1
- data/README.md +79 -19
- data/lib/ruby_lsp/xlsxrb/completion_listener.rb +31 -61
- data/lib/xlsxrb/chart_builder.rb +595 -113
- data/lib/xlsxrb/dsl_helpers.rb +72 -20
- data/lib/xlsxrb/elements/cell.rb +243 -56
- data/lib/xlsxrb/elements/column.rb +94 -5
- data/lib/xlsxrb/elements/coordinate_access.rb +108 -10
- data/lib/xlsxrb/elements/image.rb +81 -15
- data/lib/xlsxrb/elements/metadata.rb +2733 -0
- data/lib/xlsxrb/elements/row.rb +130 -46
- data/lib/xlsxrb/elements/styles.rb +184 -76
- data/lib/xlsxrb/elements/types.rb +242 -7
- data/lib/xlsxrb/elements/workbook.rb +171 -82
- data/lib/xlsxrb/elements/worksheet.rb +598 -102
- data/lib/xlsxrb/elements.rb +1 -0
- data/lib/xlsxrb/ooxml/reader/listeners/core_listeners.rb +12 -4
- data/lib/xlsxrb/ooxml/reader/listeners/drawing_listeners.rb +7 -2
- data/lib/xlsxrb/ooxml/reader/listeners/feature_listeners.rb +264 -17
- data/lib/xlsxrb/ooxml/reader/listeners/style_listeners.rb +17 -3
- data/lib/xlsxrb/ooxml/reader.rb +4 -0
- data/lib/xlsxrb/ooxml/styles_parser.rb +10 -3
- data/lib/xlsxrb/ooxml/workbook_writer.rb +90 -36
- data/lib/xlsxrb/ooxml/worksheet_parser.rb +2 -2
- data/lib/xlsxrb/ooxml/worksheet_writer.rb +64 -19
- data/lib/xlsxrb/ooxml/writer/drawing_xml.rb +5 -2
- data/lib/xlsxrb/ooxml/writer/features_xml.rb +26 -5
- data/lib/xlsxrb/ooxml/writer/styles_xml.rb +19 -9
- data/lib/xlsxrb/ooxml/writer.rb +22 -6
- data/lib/xlsxrb/ooxml/zip_generator.rb +2 -0
- data/lib/xlsxrb/ooxml/zip_reader.rb +47 -10
- data/lib/xlsxrb/stream_row.rb +97 -18
- data/lib/xlsxrb/stream_sheet.rb +706 -190
- data/lib/xlsxrb/stream_writer.rb +1893 -374
- data/lib/xlsxrb/style_builder.rb +774 -111
- data/lib/xlsxrb/utils.rb +66 -106
- data/lib/xlsxrb/version.rb +1 -1
- data/lib/xlsxrb/workbook_builder.rb +380 -83
- data/lib/xlsxrb/worksheet_builder.rb +1210 -233
- data/lib/xlsxrb.rb +1266 -326
- data/sig/generated/xlsxrb/chart_builder.rbs +319 -90
- data/sig/generated/xlsxrb/dsl_helpers.rbs +20 -2
- data/sig/generated/xlsxrb/elements/cell.rbs +92 -20
- data/sig/generated/xlsxrb/elements/column.rbs +61 -2
- data/sig/generated/xlsxrb/elements/coordinate_access.rbs +49 -7
- data/sig/generated/xlsxrb/elements/image.rbs +30 -8
- data/sig/generated/xlsxrb/elements/metadata.rbs +1587 -0
- data/sig/generated/xlsxrb/elements/row.rbs +61 -21
- data/sig/generated/xlsxrb/elements/styles.rbs +96 -58
- data/sig/generated/xlsxrb/elements/types.rbs +27 -0
- data/sig/generated/xlsxrb/elements/workbook.rbs +63 -52
- data/sig/generated/xlsxrb/elements/worksheet.rbs +192 -51
- data/sig/generated/xlsxrb/ooxml/reader/listeners/feature_listeners.rbs +61 -0
- data/sig/generated/xlsxrb/ooxml/reader.rbs +3 -0
- data/sig/generated/xlsxrb/ooxml/workbook_writer.rbs +1 -1
- data/sig/generated/xlsxrb/ooxml/worksheet_writer.rbs +1 -1
- data/sig/generated/xlsxrb/ooxml/writer.rbs +3 -0
- data/sig/generated/xlsxrb/ooxml/zip_generator.rbs +2 -0
- data/sig/generated/xlsxrb/ooxml/zip_reader.rbs +2 -2
- data/sig/generated/xlsxrb/stream_row.rbs +48 -14
- data/sig/generated/xlsxrb/stream_sheet.rbs +324 -115
- data/sig/generated/xlsxrb/stream_writer.rbs +1068 -255
- data/sig/generated/xlsxrb/style_builder.rbs +389 -79
- data/sig/generated/xlsxrb/utils.rbs +34 -18
- data/sig/generated/xlsxrb/workbook_builder.rbs +234 -34
- data/sig/generated/xlsxrb/worksheet_builder.rbs +628 -126
- data/sig/generated/xlsxrb.rbs +257 -49
- metadata +3 -1
data/sig/generated/xlsxrb.rbs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Modern, streaming-capable, low-memory XLSX reading and writing library for Ruby.
|
|
4
4
|
#
|
|
5
|
-
# Provides high-level facade methods ({Xlsxrb.read}, {Xlsxrb.write}, {Xlsxrb.build}, {Xlsxrb.
|
|
5
|
+
# Provides high-level facade methods ({Xlsxrb.read}, {Xlsxrb.write}, {Xlsxrb.build}, {Xlsxrb.load})
|
|
6
6
|
# with full ECMA-376 OpenXML compliance, MS-OFFCRYPTO password protection, and zero core dependencies.
|
|
7
7
|
#
|
|
8
8
|
# @api public
|
|
@@ -11,11 +11,19 @@ module Xlsxrb
|
|
|
11
11
|
MAX_ROW: ::Integer
|
|
12
12
|
|
|
13
13
|
# Maximum number of columns supported by Excel / OpenXML.
|
|
14
|
-
|
|
14
|
+
MAX_COLUMN: ::Integer
|
|
15
|
+
|
|
16
|
+
# @deprecated Use {MAX_COLUMN} instead. Will be removed in 0.2.0.
|
|
17
|
+
MAX_COL: untyped
|
|
15
18
|
|
|
16
19
|
# Maximum number of individual cell/range references allowed in a single data validation element by Excel.
|
|
17
20
|
MAX_REFS_PER_VALIDATION: ::Integer
|
|
18
21
|
|
|
22
|
+
# @api private
|
|
23
|
+
module Deprecation
|
|
24
|
+
def self.warn: (untyped message, ?uplevel: untyped) -> untyped
|
|
25
|
+
end
|
|
26
|
+
|
|
19
27
|
# Base class for all exceptions raised by Xlsxrb.
|
|
20
28
|
# Predefined cell error constants are exposed on this class for convenience.
|
|
21
29
|
class Error < StandardError
|
|
@@ -32,6 +40,8 @@ module Xlsxrb
|
|
|
32
40
|
REF: untyped
|
|
33
41
|
|
|
34
42
|
VALUE: untyped
|
|
43
|
+
|
|
44
|
+
GETTING_DATA: untyped
|
|
35
45
|
end
|
|
36
46
|
|
|
37
47
|
# Raised when parsing malformed or invalid XML structures.
|
|
@@ -118,35 +128,38 @@ module Xlsxrb
|
|
|
118
128
|
# Creates a shared formula {Elements::Formula} object for master or follower cell.
|
|
119
129
|
#
|
|
120
130
|
# @example Create a shared formula master
|
|
121
|
-
# formula = Xlsxrb.shared_formula("A2*2",
|
|
131
|
+
# formula = Xlsxrb.shared_formula("A2*2", shared_index: 0, ref: "B2:B10")
|
|
122
132
|
#
|
|
123
133
|
# @example Create a shared formula follower
|
|
124
|
-
# formula = Xlsxrb.shared_formula(
|
|
134
|
+
# formula = Xlsxrb.shared_formula(shared_index: 0)
|
|
125
135
|
#
|
|
126
136
|
# @param expression [String, nil] The formula expression (nil for follower cells).
|
|
127
|
-
# @param
|
|
137
|
+
# @param shared_index [Integer, nil] Shared formula group index (0-based).
|
|
138
|
+
# @param si [Integer, nil] Legacy alias for shared_index.
|
|
128
139
|
# @param ref [String, nil] Target range for master cell (e.g. "B2:B10").
|
|
129
140
|
# @param cached_value [Object, nil] Optional precomputed value.
|
|
130
141
|
# @return [Elements::Formula]
|
|
131
142
|
# @api public
|
|
132
|
-
# : (?String? expression, si: Integer
|
|
133
|
-
def self.shared_formula: (?String? expression, si: Integer
|
|
143
|
+
# : (?String? expression, ?shared_index: Integer?, ?si: Integer?, ?ref: String?, ?cached_value: (String | Numeric | bool | Elements::CellError | nil)) -> Elements::Formula
|
|
144
|
+
def self.shared_formula: (?String? expression, ?shared_index: Integer?, ?si: Integer?, ?ref: String?, ?cached_value: String | Numeric | bool | Elements::CellError | nil) -> Elements::Formula
|
|
134
145
|
|
|
135
146
|
# Creates an array or dynamic array {Elements::Formula} object.
|
|
136
147
|
#
|
|
137
148
|
# @example Create a multi-cell array formula
|
|
138
149
|
# formula = Xlsxrb.array_formula("SUM(B1:B10*C1:C10)", "A1:C1", cached_value: 0)
|
|
150
|
+
# formula = Xlsxrb.array_formula("SUM(B1:B10*C1:C10)", ref: "A1:C1", cached_value: 0)
|
|
139
151
|
#
|
|
140
152
|
# @example Create a dynamic array formula
|
|
141
153
|
# formula = Xlsxrb.array_formula("SORT(UNIQUE(A1:A10))", "D1")
|
|
142
154
|
#
|
|
143
155
|
# @param expression [String] The formula expression without leading '='.
|
|
144
|
-
# @param
|
|
156
|
+
# @param pos_ref [String, nil] Target cell or range reference (positional).
|
|
157
|
+
# @param ref [String, nil] Target cell or range reference (keyword).
|
|
145
158
|
# @param cached_value [Object, nil] Optional precomputed value.
|
|
146
159
|
# @return [Elements::Formula]
|
|
147
160
|
# @api public
|
|
148
|
-
# : (String expression, ?String?
|
|
149
|
-
def self.array_formula: (String expression, ?String?
|
|
161
|
+
# : (String expression, ?String? pos_ref, ?ref: String?, ?cached_value: (String | Numeric | bool | Elements::CellError | nil), **untyped attrs) -> Elements::Formula
|
|
162
|
+
def self.array_formula: (String expression, ?String? pos_ref, ?ref: String?, ?cached_value: String | Numeric | bool | Elements::CellError | nil, **untyped attrs) -> Elements::Formula
|
|
150
163
|
|
|
151
164
|
# Creates an {Elements::Hyperlink} object for use in cell hyperlinks.
|
|
152
165
|
#
|
|
@@ -165,6 +178,32 @@ module Xlsxrb
|
|
|
165
178
|
# : (?String? url, ?display: String?, ?tooltip: String?, ?location: String?) -> Elements::Hyperlink
|
|
166
179
|
def self.hyperlink: (?String? url, ?display: String?, ?tooltip: String?, ?location: String?) -> Elements::Hyperlink
|
|
167
180
|
|
|
181
|
+
# Creates an {Elements::Comment} object for use in cell comments.
|
|
182
|
+
#
|
|
183
|
+
# @example Create a cell comment
|
|
184
|
+
# comment = Xlsxrb.comment("Review this value", author: "Auditor")
|
|
185
|
+
#
|
|
186
|
+
# @param text [String, nil] Comment body text.
|
|
187
|
+
# @param author [String] Comment author.
|
|
188
|
+
# @param visible [Boolean] Whether comment is visible by default.
|
|
189
|
+
# @param ref [String, nil] Cell coordinate (e.g. "A1").
|
|
190
|
+
# @return [Elements::Comment]
|
|
191
|
+
# @api public
|
|
192
|
+
# : (?String? text, ?author: String, ?visible: bool, ?ref: String?, **untyped extra) -> Elements::Comment
|
|
193
|
+
def self.comment: (?String? text, ?author: String, ?visible: bool, ?ref: String?, **untyped extra) -> Elements::Comment
|
|
194
|
+
|
|
195
|
+
# Creates or returns an {Elements::CellError} object.
|
|
196
|
+
#
|
|
197
|
+
# @example
|
|
198
|
+
# err = Xlsxrb.cell_error("#VALUE!")
|
|
199
|
+
# err = Xlsxrb.cell_error(:value)
|
|
200
|
+
#
|
|
201
|
+
# @param code [String, Symbol, Elements::CellError] Error code or symbol.
|
|
202
|
+
# @return [Elements::CellError]
|
|
203
|
+
# @api public
|
|
204
|
+
# : (String | Symbol | Elements::CellError code) -> Elements::CellError
|
|
205
|
+
def self.cell_error: (String | Symbol | Elements::CellError code) -> Elements::CellError
|
|
206
|
+
|
|
168
207
|
# Formats a cell value according to an Excel format code string.
|
|
169
208
|
#
|
|
170
209
|
# @param value [Object, nil] Value to format.
|
|
@@ -173,6 +212,10 @@ module Xlsxrb
|
|
|
173
212
|
# @return [String] Formatted string representation.
|
|
174
213
|
# @api public
|
|
175
214
|
# : (untyped value, ?String? format_code, ?date1904: bool) -> String
|
|
215
|
+
def self.format_value: (untyped value, ?String? format_code, ?date1904: bool) -> String
|
|
216
|
+
|
|
217
|
+
# @deprecated Use {.format_value} instead. Will be removed in 0.2.0.
|
|
218
|
+
# : (untyped value, ?String? format_code, ?date1904: bool) -> String
|
|
176
219
|
def self.format: (untyped value, ?String? format_code, ?date1904: bool) -> String
|
|
177
220
|
|
|
178
221
|
# Converts a Date or Time to an Excel numeric serial number (1900 or 1904 system).
|
|
@@ -215,13 +258,17 @@ module Xlsxrb
|
|
|
215
258
|
# Converts a Time or Date to a fractional Excel serial number.
|
|
216
259
|
#
|
|
217
260
|
# @example
|
|
218
|
-
# Xlsxrb.
|
|
261
|
+
# Xlsxrb.time_to_serial(Time.utc(2026, 1, 1, 12, 0, 0)) #=> 46023.5
|
|
219
262
|
#
|
|
220
263
|
# @param time [Time, Date] Time or Date instance.
|
|
221
264
|
# @param date1904 [Boolean] Whether to use the 1904 date system.
|
|
222
265
|
# @return [Float] Fractional serial number.
|
|
223
266
|
# @api public
|
|
224
267
|
# : (Time | Date time, ?date1904: bool) -> Float
|
|
268
|
+
def self.time_to_serial: (Time | Date time, ?date1904: bool) -> Float
|
|
269
|
+
|
|
270
|
+
# @deprecated Use {.time_to_serial} instead. Will be removed in 0.2.0.
|
|
271
|
+
# : (Time | Date time, ?date1904: bool) -> Float
|
|
225
272
|
def self.datetime_to_serial: (Time | Date time, ?date1904: bool) -> Float
|
|
226
273
|
|
|
227
274
|
# Converts an Excel serial number to a Time (UTC).
|
|
@@ -236,7 +283,58 @@ module Xlsxrb
|
|
|
236
283
|
# : (Numeric serial, ?date1904: bool) -> Time
|
|
237
284
|
def self.serial_to_time: (Numeric serial, ?date1904: bool) -> Time
|
|
238
285
|
|
|
239
|
-
|
|
286
|
+
# @deprecated Use {.serial_to_time} instead. Will be removed in 0.2.0.
|
|
287
|
+
# : (Numeric serial, ?date1904: bool) -> Time
|
|
288
|
+
def self.serial_to_datetime: (Numeric serial, ?date1904: bool) -> Time
|
|
289
|
+
|
|
290
|
+
# Converts a cell reference string (e.g. "A1", "BC100") to 0-based [row, col] coordinates.
|
|
291
|
+
#
|
|
292
|
+
# @example
|
|
293
|
+
# Xlsxrb.parse_ref("A1") #=> [0, 0]
|
|
294
|
+
# Xlsxrb.parse_ref("BC100") #=> [99, 54]
|
|
295
|
+
#
|
|
296
|
+
# @param ref [String, nil] Excel cell reference string.
|
|
297
|
+
# @return [Array(Integer, Integer), nil] 0-based [row, col] tuple, or nil if invalid.
|
|
298
|
+
# @api public
|
|
299
|
+
# : (String? ref) -> [Integer, Integer]?
|
|
300
|
+
def self.parse_ref: (String? ref) -> [ Integer, Integer ]?
|
|
301
|
+
|
|
302
|
+
# Converts 0-based [row, col] coordinates to an A1-style reference string.
|
|
303
|
+
#
|
|
304
|
+
# @example
|
|
305
|
+
# Xlsxrb.cell_to_ref(0, 0) #=> "A1"
|
|
306
|
+
# Xlsxrb.cell_to_ref(99, 54) #=> "BC100"
|
|
307
|
+
#
|
|
308
|
+
# @param row [Integer] 0-based row index.
|
|
309
|
+
# @param column [Integer] 0-based column index.
|
|
310
|
+
# @return [String] A1-style reference string.
|
|
311
|
+
# @api public
|
|
312
|
+
# : (Integer row, Integer column) -> String
|
|
313
|
+
def self.cell_to_ref: (Integer row, Integer column) -> String
|
|
314
|
+
|
|
315
|
+
# Converts a column letter (e.g. "A", :AA) to a 0-based column index.
|
|
316
|
+
#
|
|
317
|
+
# @example
|
|
318
|
+
# Xlsxrb.column_index("A") #=> 0
|
|
319
|
+
# Xlsxrb.column_index(:AA) #=> 26
|
|
320
|
+
#
|
|
321
|
+
# @param col [String, Symbol, Integer] Column letter or integer index.
|
|
322
|
+
# @return [Integer] 0-based column index.
|
|
323
|
+
# @api public
|
|
324
|
+
# : (String | Symbol | Integer col) -> Integer
|
|
325
|
+
def self.column_index: (String | Symbol | Integer col) -> Integer
|
|
326
|
+
|
|
327
|
+
# Converts a 0-based column index to an Excel letter (0 -> "A", 25 -> "Z", 26 -> "AA").
|
|
328
|
+
#
|
|
329
|
+
# @example
|
|
330
|
+
# Xlsxrb.column_letter(0) #=> "A"
|
|
331
|
+
# Xlsxrb.column_letter(26) #=> "AA"
|
|
332
|
+
#
|
|
333
|
+
# @param index [Integer] 0-based column index.
|
|
334
|
+
# @return [String] Excel column letter.
|
|
335
|
+
# @api public
|
|
336
|
+
# : (Integer index) -> String
|
|
337
|
+
def self.column_letter: (Integer index) -> String
|
|
240
338
|
|
|
241
339
|
# Converts a cell range reference string (e.g. "A1:C10", "A1") to 0-based [[top_row, left_col], [bottom_row, right_col]].
|
|
242
340
|
#
|
|
@@ -250,18 +348,59 @@ module Xlsxrb
|
|
|
250
348
|
def self.parse_range: (String? range_ref) -> [ [ Integer, Integer ], [ Integer, Integer ] ]?
|
|
251
349
|
|
|
252
350
|
# Converts 0-based bounding coordinates to an A1-style range reference string.
|
|
351
|
+
# Accepts either 4 flat integers (top_row, left_column, bottom_row, right_column)
|
|
352
|
+
# or a nested pair ([[top_row, left_column], [bottom_row, right_column]]) as returned by parse_range.
|
|
253
353
|
#
|
|
254
|
-
# @example
|
|
354
|
+
# @example 4 flat integers
|
|
255
355
|
# Xlsxrb.range_to_ref(0, 0, 9, 2) #=> "A1:C10"
|
|
256
356
|
#
|
|
257
|
-
# @
|
|
258
|
-
#
|
|
259
|
-
#
|
|
260
|
-
# @param
|
|
261
|
-
# @
|
|
357
|
+
# @example Nested pair from parse_range
|
|
358
|
+
# Xlsxrb.range_to_ref([[0, 0], [9, 2]]) #=> "A1:C10"
|
|
359
|
+
#
|
|
360
|
+
# @param top_row_or_bounds [Integer, Array] 0-based start row index or nested bounding coordinates.
|
|
361
|
+
# @param left_column [Integer, nil] 0-based start column index.
|
|
362
|
+
# @param bottom_row [Integer, nil] 0-based end row index.
|
|
363
|
+
# @param right_column [Integer, nil] 0-based end column index.
|
|
364
|
+
# @return [String] A1-style range reference string.
|
|
365
|
+
# @api public
|
|
366
|
+
# : (Integer | [[Integer, Integer], [Integer, Integer]] top_row_or_bounds, ?Integer? left_column, ?Integer? bottom_row, ?Integer? right_column) -> String
|
|
367
|
+
def self.range_to_ref: (Integer | [ [ Integer, Integer ], [ Integer, Integer ] ] top_row_or_bounds, ?Integer? left_column, ?Integer? bottom_row, ?Integer? right_column) -> String
|
|
368
|
+
|
|
369
|
+
# Splits an A1-style cell reference into its column name and 1-based row number.
|
|
370
|
+
#
|
|
371
|
+
# @example
|
|
372
|
+
# Xlsxrb.split_coordinate("A1") #=> ["A", 1]
|
|
373
|
+
# Xlsxrb.split_coordinate("BC100") #=> ["BC", 100]
|
|
374
|
+
#
|
|
375
|
+
# @param cell_ref [String, nil] Excel cell reference string.
|
|
376
|
+
# @return [Array(String, Integer), nil] [col_name, row_number] tuple (1-based row), or nil if invalid.
|
|
262
377
|
# @api public
|
|
263
|
-
# : (
|
|
264
|
-
def self.
|
|
378
|
+
# : (String? cell_ref) -> [String, Integer]?
|
|
379
|
+
def self.split_coordinate: (String? cell_ref) -> [ String, Integer ]?
|
|
380
|
+
|
|
381
|
+
FORMULA_TOKEN_RE: ::Regexp
|
|
382
|
+
|
|
383
|
+
# Expands a formula by shifting relative cell references from a master cell to a target cell or by offset amounts.
|
|
384
|
+
#
|
|
385
|
+
# @example Shift formula down one row
|
|
386
|
+
# Xlsxrb.expand_formula("A2*2", 1, 0) #=> "A3*2"
|
|
387
|
+
# Xlsxrb.expand_formula("A2*2", from_ref: "B2", to_ref: "B3") #=> "A3*2"
|
|
388
|
+
#
|
|
389
|
+
# @example Shift formula with absolute references
|
|
390
|
+
# Xlsxrb.expand_formula("$A$1+A2", 2, 0) #=> "$A$1+A4"
|
|
391
|
+
#
|
|
392
|
+
# @param formula [String, nil] Formula expression to expand.
|
|
393
|
+
# @param offset_row [Integer, nil] Optional row shift amount (positive = down, negative = up).
|
|
394
|
+
# @param offset_col [Integer, nil] Optional column shift amount (positive = right, negative = left).
|
|
395
|
+
# @param from_ref [String, nil] Master cell reference (e.g. "B2").
|
|
396
|
+
# @param to_ref [String, nil] Target cell reference (e.g. "B3").
|
|
397
|
+
# @param row_delta [Integer, nil] Row shift amount (positive = down, negative = up).
|
|
398
|
+
# @param column_delta [Integer, nil] Column shift amount (positive = right, negative = left).
|
|
399
|
+
# @param col_delta [Integer, nil] Deprecated alias for column_delta.
|
|
400
|
+
# @return [String, nil] Expanded formula expression.
|
|
401
|
+
# @api public
|
|
402
|
+
# : (String? formula, ?Integer? offset_row, ?Integer? offset_col, ?from_ref: String?, ?to_ref: String?, ?row_delta: Integer?, ?column_delta: Integer?, ?col_delta: Integer?) -> String?
|
|
403
|
+
def self.expand_formula: (String? formula, ?Integer? offset_row, ?Integer? offset_col, ?from_ref: String?, ?to_ref: String?, ?row_delta: Integer?, ?column_delta: Integer?, ?col_delta: Integer?) -> String?
|
|
265
404
|
|
|
266
405
|
# Resolves an ECMA-376 indexed color palette index (0..63) to an RRGGBB hex string (or AARRGGBB if alpha: true).
|
|
267
406
|
#
|
|
@@ -291,7 +430,9 @@ module Xlsxrb
|
|
|
291
430
|
# : (Integer | String | Symbol | nil color, ?alpha: bool) -> String?
|
|
292
431
|
def self.to_hex_color: (Integer | String | Symbol | nil color, ?alpha: bool) -> String?
|
|
293
432
|
|
|
294
|
-
|
|
433
|
+
# @deprecated Use {.to_hex_color} instead. Will be removed in 0.2.0.
|
|
434
|
+
# : (Integer | String | Symbol | nil color, ?alpha: bool) -> String?
|
|
435
|
+
def self.color_to_hex: (Integer | String | Symbol | nil color, ?alpha: bool) -> String?
|
|
295
436
|
|
|
296
437
|
# Sanitizes a worksheet name to ensure it conforms to Excel constraints within 31 characters.
|
|
297
438
|
# Replaces forbidden characters (\ / ? * [ ] : and control characters),
|
|
@@ -308,7 +449,9 @@ module Xlsxrb
|
|
|
308
449
|
# : (untyped name, ?replace_char: String) -> String
|
|
309
450
|
def self.sanitize_sheet_name: (untyped name, ?replace_char: String) -> String
|
|
310
451
|
|
|
311
|
-
|
|
452
|
+
# @deprecated Use {.sanitize_sheet_name} instead. Will be removed in 0.2.0.
|
|
453
|
+
# : (untyped name, ?replace_char: String) -> String
|
|
454
|
+
def self.sheet_name: (untyped name, ?replace_char: String) -> String
|
|
312
455
|
|
|
313
456
|
# Reads an XLSX file (streaming and lazy-loaded by default) from a file path, IO stream, or binary String.
|
|
314
457
|
#
|
|
@@ -350,6 +493,11 @@ module Xlsxrb
|
|
|
350
493
|
# doc_sheet = sheet.load # explicitly load into memory
|
|
351
494
|
# puts doc_sheet["A1"].value # coordinate random access
|
|
352
495
|
#
|
|
496
|
+
# Reads an XLSX file or IO stream. When called with a block, yields each {StreamSheet}
|
|
497
|
+
# for low-memory streaming iteration. When called without a block, returns an {Elements::Workbook}
|
|
498
|
+
# containing {StreamSheet} instances.
|
|
499
|
+
#
|
|
500
|
+
# @deprecated Calling {Xlsxrb.read} without a block is deprecated; use {Xlsxrb.load} for in-memory random access. Will be removed in 0.2.0.
|
|
353
501
|
# @param max_uncompressed_size [Integer, nil] Maximum allowed uncompressed size in bytes per entry (ZIP bomb defense).
|
|
354
502
|
# @raise [ZipBombError] If an uncompressed entry exceeds max_uncompressed_size.
|
|
355
503
|
# @raise [EncryptedFileError] If the file is encrypted and no password was supplied.
|
|
@@ -361,7 +509,33 @@ module Xlsxrb
|
|
|
361
509
|
def self.read: (untyped source, ?password: String?, ?trim_empty_rows: bool, ?pad_empty_rows: bool, ?pad_empty_cells: bool, ?max_uncompressed_size: Integer?) { (StreamSheet) -> void } -> void
|
|
362
510
|
| (untyped source, ?password: String?, ?trim_empty_rows: bool, ?pad_empty_rows: bool, ?pad_empty_cells: bool, ?max_uncompressed_size: Integer?) -> Elements::Workbook
|
|
363
511
|
|
|
364
|
-
|
|
512
|
+
# Loads all sheets into memory, returning an {Elements::Workbook} where every
|
|
513
|
+
# worksheet is a fully-parsed {Elements::Worksheet} supporting coordinate random access.
|
|
514
|
+
# The underlying zip resources are closed immediately.
|
|
515
|
+
#
|
|
516
|
+
# @example
|
|
517
|
+
# wb = Xlsxrb.load("report.xlsx")
|
|
518
|
+
# puts wb["Sheet1"]["A1"].value
|
|
519
|
+
#
|
|
520
|
+
# @param source [String, IO, StringIO] Path to the .xlsx file or an IO-like stream.
|
|
521
|
+
# @param password [String, nil] Password for decrypting password-protected (ECMA-376 Standard/Agile) workbooks.
|
|
522
|
+
# @param trim_empty_rows [Boolean] Whether to omit trailing empty rows from worksheet data.
|
|
523
|
+
# @param pad_empty_rows [Boolean] Whether to pad missing rows with empty row objects.
|
|
524
|
+
# @param pad_empty_cells [Boolean] Whether to pad missing cells within rows with nil cells.
|
|
525
|
+
# @param max_uncompressed_size [Integer, nil] Maximum uncompressed file size threshold in bytes for zip bomb protection.
|
|
526
|
+
# @return [Elements::Workbook] The fully loaded in-memory workbook.
|
|
527
|
+
# @api public
|
|
528
|
+
# : (untyped source, ?password: String?, ?trim_empty_rows: bool, ?pad_empty_rows: bool, ?pad_empty_cells: bool, ?max_uncompressed_size: Integer?) -> Elements::Workbook
|
|
529
|
+
def self.load: (untyped source, ?password: String?, ?trim_empty_rows: bool, ?pad_empty_rows: bool, ?pad_empty_cells: bool, ?max_uncompressed_size: Integer?) -> Elements::Workbook
|
|
530
|
+
|
|
531
|
+
# Internal reader helper returning a Workbook with StreamSheet instances without deprecation warning.
|
|
532
|
+
# @api private
|
|
533
|
+
# : (untyped source, ?password: String?, ?trim_empty_rows: bool, ?pad_empty_rows: bool, ?pad_empty_cells: bool, ?max_uncompressed_size: Integer?) -> Elements::Workbook
|
|
534
|
+
def self._read_workbook: (untyped source, ?password: String?, ?trim_empty_rows: bool, ?pad_empty_rows: bool, ?pad_empty_cells: bool, ?max_uncompressed_size: Integer?) -> Elements::Workbook
|
|
535
|
+
|
|
536
|
+
# @deprecated Use {.read} instead. Will be removed in 0.2.0.
|
|
537
|
+
# : (*untyped, **untyped) ?{ (*untyped) -> untyped } -> untyped
|
|
538
|
+
def self.stream: (*untyped, **untyped) ?{ (*untyped) -> untyped } -> untyped
|
|
365
539
|
|
|
366
540
|
# Writes an XLSX file or IO stream (streaming or in-memory), or returns a binary string.
|
|
367
541
|
#
|
|
@@ -420,6 +594,33 @@ module Xlsxrb
|
|
|
420
594
|
# : (?untyped target_or_workbook, ?Elements::Workbook | untyped workbook_or_nil, ?password: String?, ?encryption_mode: Symbol, ?strict_excel_mode: bool, ?escape_formulas: bool, ?default_font: untyped?, ?shared_strings: bool, ?compression_level: Integer | nil) ?{ (StreamWriter) -> void } -> untyped
|
|
421
595
|
def self.write: (?untyped target_or_workbook, ?Elements::Workbook | untyped workbook_or_nil, ?password: String?, ?encryption_mode: Symbol, ?strict_excel_mode: bool, ?escape_formulas: bool, ?default_font: untyped?, ?shared_strings: bool, ?compression_level: Integer | nil) ?{ (StreamWriter) -> void } -> untyped
|
|
422
596
|
|
|
597
|
+
# Serializes an in-memory workbook to a destination target (path or IO).
|
|
598
|
+
#
|
|
599
|
+
# @deprecated Use {.write} instead. Will be removed in 0.2.0.
|
|
600
|
+
# @param target [String, IO, StringIO] Target destination.
|
|
601
|
+
# @param workbook [Elements::Workbook] The workbook instance to write.
|
|
602
|
+
# @param shared_strings [Boolean] Whether to intern strings into sharedStrings.xml.
|
|
603
|
+
# @param compression_level [Integer, nil] ZIP deflate compression level (0..9).
|
|
604
|
+
# @param password [String, nil] Optional encryption password.
|
|
605
|
+
# @param encryption_mode [Symbol] Encryption algorithm (:standard or :agile).
|
|
606
|
+
# @return [void]
|
|
607
|
+
# @api public
|
|
608
|
+
# : (String | IO | StringIO target, Elements::Workbook workbook, ?shared_strings: bool, ?compression_level: Integer?, ?password: String?, ?encryption_mode: Symbol) -> void
|
|
609
|
+
def self.write_workbook: (String | IO | StringIO target, Elements::Workbook workbook, ?shared_strings: bool, ?compression_level: Integer?, ?password: String?, ?encryption_mode: Symbol) -> void
|
|
610
|
+
|
|
611
|
+
# Serializes an in-memory workbook to a binary XLSX data string.
|
|
612
|
+
#
|
|
613
|
+
# @deprecated Use {.write} instead. Will be removed in 0.2.0.
|
|
614
|
+
# @param workbook [Elements::Workbook] The workbook instance to serialize.
|
|
615
|
+
# @param shared_strings [Boolean] Whether to intern strings into sharedStrings.xml.
|
|
616
|
+
# @param compression_level [Integer, nil] ZIP deflate compression level (0..9).
|
|
617
|
+
# @param password [String, nil] Optional encryption password.
|
|
618
|
+
# @param encryption_mode [Symbol] Encryption algorithm (:standard or :agile).
|
|
619
|
+
# @return [String] Binary XLSX data.
|
|
620
|
+
# @api public
|
|
621
|
+
# : (Elements::Workbook workbook, ?shared_strings: bool, ?compression_level: Integer?, ?password: String?, ?encryption_mode: Symbol) -> String
|
|
622
|
+
def self.workbook_to_data: (Elements::Workbook workbook, ?shared_strings: bool, ?compression_level: Integer?, ?password: String?, ?encryption_mode: Symbol) -> String
|
|
623
|
+
|
|
423
624
|
# Modifies an existing XLSX file in-memory using an immutable transformation block.
|
|
424
625
|
#
|
|
425
626
|
# Reads the workbook, passes it to the block, and writes the resulting workbook.
|
|
@@ -435,14 +636,16 @@ module Xlsxrb
|
|
|
435
636
|
#
|
|
436
637
|
# @param source [String, IO, StringIO] The source file path or IO object.
|
|
437
638
|
# @param target [String, IO, StringIO, nil] Target file path or IO object (overwrites source if nil).
|
|
438
|
-
# @param password [String, nil] Optional password for encrypted files.
|
|
639
|
+
# @param password [String, nil] Optional password for decrypting encrypted source files.
|
|
640
|
+
# @deprecated Use {Xlsxrb.read} + {Xlsxrb.write} for streaming transformations or {Xlsxrb.write} DSL for report generation. Will be removed in 0.2.0.
|
|
641
|
+
# @param new_password [String, nil] Optional password for encrypting the output file (defaults to password).
|
|
439
642
|
# @yield [workbook]
|
|
440
643
|
# @yieldparam workbook [Elements::Workbook] The loaded workbook.
|
|
441
644
|
# @yieldreturn [Elements::Workbook] The modified workbook.
|
|
442
|
-
# @return [
|
|
645
|
+
# @return [Elements::Workbook] The modified workbook returned by the block.
|
|
443
646
|
# @api public
|
|
444
|
-
# : (untyped source, ?untyped target, ?password: String?) ?{ (Elements::Workbook) -> untyped } ->
|
|
445
|
-
def self.modify: (untyped source, ?untyped target, ?password: String?) ?{ (Elements::Workbook) -> untyped } ->
|
|
647
|
+
# : (untyped source, ?untyped target, ?password: String?, ?new_password: String?, **untyped opts) ?{ (Elements::Workbook) -> untyped } -> untyped
|
|
648
|
+
def self.modify: (untyped source, ?untyped target, ?password: String?, ?new_password: String?, **untyped opts) ?{ (Elements::Workbook) -> untyped } -> untyped
|
|
446
649
|
|
|
447
650
|
# Builds an in-memory {Elements::Workbook} using a declarative DSL.
|
|
448
651
|
#
|
|
@@ -455,12 +658,14 @@ module Xlsxrb
|
|
|
455
658
|
# end
|
|
456
659
|
#
|
|
457
660
|
# @param strict_excel_mode [Boolean] Whether to enforce Microsoft Excel specification limits.
|
|
661
|
+
# @param escape_formulas [Boolean] Whether to treat strings starting with formula prefixes as plain text.
|
|
662
|
+
# @param default_font [Hash, nil] Optional default font options.
|
|
458
663
|
# @yield [builder]
|
|
459
664
|
# @yieldparam builder [Xlsxrb::WorkbookBuilder]
|
|
460
665
|
# @return [Elements::Workbook] The compiled in-memory workbook.
|
|
461
666
|
# @api public
|
|
462
|
-
# : (?strict_excel_mode: bool, ?default_font: untyped?) ?{ (WorkbookBuilder) -> void } -> Elements::Workbook
|
|
463
|
-
def self.build: (?strict_excel_mode: bool, ?default_font: untyped?) ?{ (WorkbookBuilder) -> void } -> Elements::Workbook
|
|
667
|
+
# : (?strict_excel_mode: bool, ?escape_formulas: bool, ?default_font: untyped?) ?{ (WorkbookBuilder) -> void } -> Elements::Workbook
|
|
668
|
+
def self.build: (?strict_excel_mode: bool, ?escape_formulas: bool, ?default_font: untyped?) ?{ (WorkbookBuilder) -> void } -> Elements::Workbook
|
|
464
669
|
|
|
465
670
|
private def self.resolve_workbook_entry: (untyped zip_reader) -> untyped
|
|
466
671
|
|
|
@@ -474,8 +679,8 @@ module Xlsxrb
|
|
|
474
679
|
|
|
475
680
|
private def self.resolve_part_entry: (untyped zip_reader, untyped rels, untyped rel_type_sub, untyped fallback_name, untyped wb_dir) -> untyped
|
|
476
681
|
|
|
477
|
-
# : (String name, String? sheet_xml, Array[String] shared_strings, untyped styles, ?state: Symbol, ?zip_reader: Ooxml::ZipReader?, ?entry_name: String?, ?hyperlinks: Hash[String, untyped]?, ?comments: Array[Hash[Symbol, untyped]]?, ?images: Array[Elements::Image]?, ?date1904: bool, ?dimension: String?, ?trim_empty_rows: bool, ?pad_empty_rows: bool, ?pad_empty_cells: bool, ?merged_cells: Array[String]?, ?auto_filter: String?, ?tables: Array[Hash[Symbol, untyped]]?, ?shapes: Array[Hash[Symbol, untyped]]?, ?freeze_pane: Hash[Symbol, untyped]?, ?page_setup: Hash[Symbol, untyped]?, ?page_margins: Hash[Symbol, untyped]?, ?header_footer: Hash[Symbol, untyped]?, ?print_options: Hash[Symbol, untyped]?, ?sheet_protection: Hash[Symbol, untyped]?, ?sheet_view: Hash[Symbol, untyped]?, ?sheet_properties: Hash[Symbol, untyped]?, ?sheet_format: Hash[Symbol, untyped]?, ?row_breaks: Array[untyped]?, ?col_breaks: Array[untyped]?, ?protected_ranges: Array[Hash[Symbol, untyped]]?, ?cell_watches: Array[String]?, ?ignored_errors: Array[Hash[Symbol, untyped]]?, ?phonetic_properties: Hash[Symbol, untyped]?, ?selection: (Hash[Symbol, untyped] | Array[Hash[Symbol, untyped]])?, ?sheet_calc_pr: Hash[Symbol, untyped]?, ?background_image: Hash[Symbol, untyped]?, ?threaded_comments: Array[Hash[Symbol, untyped]]?) -> Elements::Worksheet
|
|
478
|
-
private def self.build_worksheet: (String name, String? sheet_xml, Array[String] shared_strings, untyped styles, ?state: Symbol, ?zip_reader: Ooxml::ZipReader?, ?entry_name: String?, ?hyperlinks: Hash[String, untyped]?, ?comments: Array[Hash[Symbol, untyped]]?, ?images: Array[Elements::Image]?, ?date1904: bool, ?dimension: String?, ?trim_empty_rows: bool, ?pad_empty_rows: bool, ?pad_empty_cells: bool, ?merged_cells: Array[String]?, ?auto_filter: String?, ?tables: Array[Hash[Symbol, untyped]]?, ?shapes: Array[Hash[Symbol, untyped]]?, ?freeze_pane: Hash[Symbol, untyped]?, ?page_setup: Hash[Symbol, untyped]?, ?page_margins: Hash[Symbol, untyped]?, ?header_footer: Hash[Symbol, untyped]?, ?print_options: Hash[Symbol, untyped]?, ?sheet_protection: Hash[Symbol, untyped]?, ?sheet_view: Hash[Symbol, untyped]?, ?sheet_properties: Hash[Symbol, untyped]?, ?sheet_format: Hash[Symbol, untyped]?, ?row_breaks: Array[untyped]?, ?col_breaks: Array[untyped]?, ?protected_ranges: Array[Hash[Symbol, untyped]]?, ?cell_watches: Array[String]?, ?ignored_errors: Array[Hash[Symbol, untyped]]?, ?phonetic_properties: Hash[Symbol, untyped]?, ?selection: (Hash[Symbol, untyped] | Array[Hash[Symbol, untyped]])?, ?sheet_calc_pr: Hash[Symbol, untyped]?, ?background_image: Hash[Symbol, untyped]?, ?threaded_comments: Array[Hash[Symbol, untyped]]?) -> Elements::Worksheet
|
|
682
|
+
# : (String name, String? sheet_xml, Array[String] shared_strings, untyped styles, ?state: Symbol, ?zip_reader: Ooxml::ZipReader?, ?entry_name: String?, ?hyperlinks: Hash[String, untyped]?, ?comments: Array[Hash[Symbol, untyped]]?, ?images: Array[Elements::Image]?, ?date1904: bool, ?dimension: String?, ?trim_empty_rows: bool, ?pad_empty_rows: bool, ?pad_empty_cells: bool, ?merged_cells: Array[String]?, ?auto_filter: String?, ?tables: Array[Hash[Symbol, untyped]]?, ?shapes: Array[Hash[Symbol, untyped]]?, ?freeze_pane: Hash[Symbol, untyped]?, ?page_setup: Hash[Symbol, untyped]?, ?page_margins: Hash[Symbol, untyped]?, ?header_footer: Hash[Symbol, untyped]?, ?print_options: Hash[Symbol, untyped]?, ?sheet_protection: Hash[Symbol, untyped]?, ?sheet_view: Hash[Symbol, untyped]?, ?sheet_properties: Hash[Symbol, untyped]?, ?sheet_format: Hash[Symbol, untyped]?, ?row_breaks: Array[untyped]?, ?column_breaks: Array[untyped]?, ?col_breaks: Array[untyped]?, ?protected_ranges: Array[Hash[Symbol, untyped]]?, ?cell_watches: Array[String]?, ?ignored_errors: Array[Hash[Symbol, untyped]]?, ?phonetic_properties: Hash[Symbol, untyped]?, ?selection: (Hash[Symbol, untyped] | Array[Hash[Symbol, untyped]])?, ?sheet_calc_properties: Hash[Symbol, untyped]?, ?sheet_calc_pr: Hash[Symbol, untyped]?, ?background_image: Hash[Symbol, untyped]?, ?threaded_comments: Array[Hash[Symbol, untyped]]?, ?columns: Array[Elements::Column]?, ?pivot_tables: Array[Hash[Symbol, untyped]]?, ?split_pane: Hash[Symbol, untyped]?, ?filter_columns: Hash[Integer, Hash[Symbol, untyped]]?, ?sort_state: Hash[Symbol, untyped]?, ?header_footer_images: (Array[Elements::HeaderFooterImage] | Array[Hash[Symbol, untyped]])?, ?charts: (Array[Elements::Chart] | Array[Hash[Symbol, untyped]])?, ?sparkline_groups: (Array[Elements::SparklineGroup] | Array[Hash[Symbol, untyped]])?, ?print_area: String?, ?print_titles: (Elements::PrintTitles | Hash[Symbol, untyped])?) -> Elements::Worksheet
|
|
683
|
+
private def self.build_worksheet: (String name, String? sheet_xml, Array[String] shared_strings, untyped styles, ?state: Symbol, ?zip_reader: Ooxml::ZipReader?, ?entry_name: String?, ?hyperlinks: Hash[String, untyped]?, ?comments: Array[Hash[Symbol, untyped]]?, ?images: Array[Elements::Image]?, ?date1904: bool, ?dimension: String?, ?trim_empty_rows: bool, ?pad_empty_rows: bool, ?pad_empty_cells: bool, ?merged_cells: Array[String]?, ?auto_filter: String?, ?tables: Array[Hash[Symbol, untyped]]?, ?shapes: Array[Hash[Symbol, untyped]]?, ?freeze_pane: Hash[Symbol, untyped]?, ?page_setup: Hash[Symbol, untyped]?, ?page_margins: Hash[Symbol, untyped]?, ?header_footer: Hash[Symbol, untyped]?, ?print_options: Hash[Symbol, untyped]?, ?sheet_protection: Hash[Symbol, untyped]?, ?sheet_view: Hash[Symbol, untyped]?, ?sheet_properties: Hash[Symbol, untyped]?, ?sheet_format: Hash[Symbol, untyped]?, ?row_breaks: Array[untyped]?, ?column_breaks: Array[untyped]?, ?col_breaks: Array[untyped]?, ?protected_ranges: Array[Hash[Symbol, untyped]]?, ?cell_watches: Array[String]?, ?ignored_errors: Array[Hash[Symbol, untyped]]?, ?phonetic_properties: Hash[Symbol, untyped]?, ?selection: (Hash[Symbol, untyped] | Array[Hash[Symbol, untyped]])?, ?sheet_calc_properties: Hash[Symbol, untyped]?, ?sheet_calc_pr: Hash[Symbol, untyped]?, ?background_image: Hash[Symbol, untyped]?, ?threaded_comments: Array[Hash[Symbol, untyped]]?, ?columns: Array[Elements::Column]?, ?pivot_tables: Array[Hash[Symbol, untyped]]?, ?split_pane: Hash[Symbol, untyped]?, ?filter_columns: Hash[Integer, Hash[Symbol, untyped]]?, ?sort_state: Hash[Symbol, untyped]?, ?header_footer_images: (Array[Elements::HeaderFooterImage] | Array[Hash[Symbol, untyped]])?, ?charts: (Array[Elements::Chart] | Array[Hash[Symbol, untyped]])?, ?sparkline_groups: (Array[Elements::SparklineGroup] | Array[Hash[Symbol, untyped]])?, ?print_area: String?, ?print_titles: (Elements::PrintTitles | Hash[Symbol, untyped])?) -> Elements::Worksheet
|
|
479
684
|
|
|
480
685
|
# : (String? sheet_xml, ?zip_reader: Ooxml::ZipReader?, ?entry_name: String?, ?rels_xml: String?) -> Hash[String, Hash[Symbol, untyped]]
|
|
481
686
|
private def self.resolve_hyperlinks: (String? sheet_xml, ?zip_reader: Ooxml::ZipReader?, ?entry_name: String?, ?rels_xml: String?) -> Hash[String, Hash[Symbol, untyped]]
|
|
@@ -504,14 +709,29 @@ module Xlsxrb
|
|
|
504
709
|
# : (?zip_reader: Ooxml::ZipReader?, ?entry_name: String?) -> Array[Hash[Symbol, untyped]]
|
|
505
710
|
private def self.resolve_shapes: (?zip_reader: Ooxml::ZipReader?, ?entry_name: String?) -> Array[Hash[Symbol, untyped]]
|
|
506
711
|
|
|
507
|
-
# : (
|
|
508
|
-
private def self.
|
|
712
|
+
# : (?zip_reader: Ooxml::ZipReader?, ?entry_name: String?) -> Array[Hash[Symbol, untyped]]
|
|
713
|
+
private def self.resolve_pivot_tables: (?zip_reader: Ooxml::ZipReader?, ?entry_name: String?) -> Array[Hash[Symbol, untyped]]
|
|
714
|
+
|
|
715
|
+
# : (?zip_reader: Ooxml::ZipReader?, ?entry_name: String?) -> Array[Elements::Chart]
|
|
716
|
+
private def self.resolve_charts: (?zip_reader: Ooxml::ZipReader?, ?entry_name: String?) -> Array[Elements::Chart]
|
|
717
|
+
|
|
718
|
+
# : (String? sheet_xml) -> Array[Elements::SparklineGroup]
|
|
719
|
+
private def self.resolve_sparkline_groups: (String? sheet_xml) -> Array[Elements::SparklineGroup]
|
|
720
|
+
|
|
721
|
+
# : (String? sheet_xml, ?zip_reader: Ooxml::ZipReader?, ?entry_name: String?) -> Array[Elements::HeaderFooterImage]
|
|
722
|
+
private def self.resolve_header_footer_images: (String? sheet_xml, ?zip_reader: Ooxml::ZipReader?, ?entry_name: String?) -> Array[Elements::HeaderFooterImage]
|
|
723
|
+
|
|
724
|
+
# : (Array[untyped]? defined_names, String? sheet_name, Integer? sheet_index) -> String?
|
|
725
|
+
private def self.extract_sheet_print_area: (Array[untyped]? defined_names, String? sheet_name, Integer? sheet_index) -> String?
|
|
509
726
|
|
|
510
|
-
# : (
|
|
511
|
-
private def self.
|
|
727
|
+
# : (Array[untyped]? defined_names, String? sheet_name, Integer? sheet_index) -> Elements::PrintTitles?
|
|
728
|
+
private def self.extract_sheet_print_titles: (Array[untyped]? defined_names, String? sheet_name, Integer? sheet_index) -> Elements::PrintTitles?
|
|
512
729
|
|
|
513
|
-
# : (
|
|
514
|
-
private def self.
|
|
730
|
+
# : (untyped defined_name, String? sheet_name, Integer? sheet_index) -> bool
|
|
731
|
+
private def self.match_sheet_defined_name?: (untyped defined_name, String? sheet_name, Integer? sheet_index) -> bool
|
|
732
|
+
|
|
733
|
+
# : (untyped raw_row, ?Hash[String, untyped] hyperlinks, ?(Array[untyped] | Hash[String, untyped]) comments, ?Hash[untyped, untyped]? styles, ?date1904: bool, ?threaded_comments: (Array[untyped] | Hash[String, untyped])) -> (Elements::Row | untyped)
|
|
734
|
+
private def self.build_row_from_raw: (untyped raw_row, ?Hash[String, untyped] hyperlinks, ?Array[untyped] | Hash[String, untyped] comments, ?Hash[untyped, untyped]? styles, ?date1904: bool, ?threaded_comments: Array[untyped] | Hash[String, untyped]) -> (Elements::Row | untyped)
|
|
515
735
|
|
|
516
736
|
# : (untyped source, String? password) -> untyped
|
|
517
737
|
private def self.prepare_source_io: (untyped source, String? password) -> untyped
|
|
@@ -536,16 +756,4 @@ module Xlsxrb
|
|
|
536
756
|
|
|
537
757
|
# : (Array[Elements::Row] rows, Array[untyped] shared_strings, Hash[untyped, Integer] sst_index, ?use_sst: bool, ?date1904: bool) -> String
|
|
538
758
|
private def self.serialize_sheet_data_xml: (Array[Elements::Row] rows, Array[untyped] shared_strings, Hash[untyped, Integer] sst_index, ?use_sst: bool, ?date1904: bool) -> String
|
|
539
|
-
|
|
540
|
-
# Builds a raw cell hash from a value for streaming writes.
|
|
541
|
-
#
|
|
542
|
-
# @param row_index [Integer] 0-based row index.
|
|
543
|
-
# @param col_index [Integer] 0-based column index.
|
|
544
|
-
# @param value [Object] Cell value.
|
|
545
|
-
# @param sst [Array<String>] Shared strings array.
|
|
546
|
-
# @param sst_index [Hash{String => Integer}] Shared strings index mapping.
|
|
547
|
-
# @return [Hash{Symbol => Object}] Raw cell hash.
|
|
548
|
-
# @api public
|
|
549
|
-
# : (Integer row_index, Integer col_index, untyped value, Array[String] sst, Hash[String, Integer] sst_index, ?date1904: bool) -> Hash[Symbol, untyped]
|
|
550
|
-
def self.build_raw_cell_from_value: (Integer row_index, Integer col_index, untyped value, Array[String] sst, Hash[String, Integer] sst_index, ?date1904: bool) -> Hash[Symbol, untyped]
|
|
551
759
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: xlsxrb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.18
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- niku
|
|
@@ -61,6 +61,7 @@ files:
|
|
|
61
61
|
- lib/xlsxrb/elements/column.rb
|
|
62
62
|
- lib/xlsxrb/elements/coordinate_access.rb
|
|
63
63
|
- lib/xlsxrb/elements/image.rb
|
|
64
|
+
- lib/xlsxrb/elements/metadata.rb
|
|
64
65
|
- lib/xlsxrb/elements/row.rb
|
|
65
66
|
- lib/xlsxrb/elements/styles.rb
|
|
66
67
|
- lib/xlsxrb/elements/types.rb
|
|
@@ -111,6 +112,7 @@ files:
|
|
|
111
112
|
- sig/generated/xlsxrb/elements/column.rbs
|
|
112
113
|
- sig/generated/xlsxrb/elements/coordinate_access.rbs
|
|
113
114
|
- sig/generated/xlsxrb/elements/image.rbs
|
|
115
|
+
- sig/generated/xlsxrb/elements/metadata.rbs
|
|
114
116
|
- sig/generated/xlsxrb/elements/row.rbs
|
|
115
117
|
- sig/generated/xlsxrb/elements/styles.rbs
|
|
116
118
|
- sig/generated/xlsxrb/elements/types.rbs
|