xlsxrb 0.1.16 → 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.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +157 -1
  3. data/README.md +81 -21
  4. data/lib/ruby_lsp/xlsxrb/completion_listener.rb +31 -61
  5. data/lib/xlsxrb/chart_builder.rb +619 -98
  6. data/lib/xlsxrb/dsl_helpers.rb +583 -15
  7. data/lib/xlsxrb/elements/cell.rb +265 -53
  8. data/lib/xlsxrb/elements/column.rb +95 -6
  9. data/lib/xlsxrb/elements/coordinate_access.rb +108 -10
  10. data/lib/xlsxrb/elements/image.rb +81 -15
  11. data/lib/xlsxrb/elements/metadata.rb +2733 -0
  12. data/lib/xlsxrb/elements/row.rb +130 -46
  13. data/lib/xlsxrb/elements/styles.rb +184 -76
  14. data/lib/xlsxrb/elements/types.rb +243 -7
  15. data/lib/xlsxrb/elements/workbook.rb +202 -65
  16. data/lib/xlsxrb/elements/worksheet.rb +728 -85
  17. data/lib/xlsxrb/elements.rb +1 -0
  18. data/lib/xlsxrb/ooxml/reader/listeners/core_listeners.rb +32 -3
  19. data/lib/xlsxrb/ooxml/reader/listeners/drawing_listeners.rb +194 -26
  20. data/lib/xlsxrb/ooxml/reader/listeners/feature_listeners.rb +372 -18
  21. data/lib/xlsxrb/ooxml/reader/listeners/style_listeners.rb +33 -14
  22. data/lib/xlsxrb/ooxml/reader.rb +92 -0
  23. data/lib/xlsxrb/ooxml/styles_parser.rb +29 -14
  24. data/lib/xlsxrb/ooxml/workbook_parser.rb +18 -3
  25. data/lib/xlsxrb/ooxml/workbook_writer.rb +351 -77
  26. data/lib/xlsxrb/ooxml/worksheet_parser.rb +18 -4
  27. data/lib/xlsxrb/ooxml/worksheet_writer.rb +349 -103
  28. data/lib/xlsxrb/ooxml/writer/drawing_xml.rb +584 -443
  29. data/lib/xlsxrb/ooxml/writer/features_xml.rb +52 -14
  30. data/lib/xlsxrb/ooxml/writer/styles_xml.rb +42 -18
  31. data/lib/xlsxrb/ooxml/writer.rb +288 -35
  32. data/lib/xlsxrb/ooxml/zip_generator.rb +2 -0
  33. data/lib/xlsxrb/ooxml/zip_reader.rb +47 -10
  34. data/lib/xlsxrb/ooxml/zip_writer.rb +15 -5
  35. data/lib/xlsxrb/stream_row.rb +97 -18
  36. data/lib/xlsxrb/stream_sheet.rb +827 -157
  37. data/lib/xlsxrb/stream_writer.rb +2766 -375
  38. data/lib/xlsxrb/style_builder.rb +821 -105
  39. data/lib/xlsxrb/utils.rb +82 -57
  40. data/lib/xlsxrb/version.rb +1 -1
  41. data/lib/xlsxrb/workbook_builder.rb +542 -62
  42. data/lib/xlsxrb/worksheet_builder.rb +2279 -209
  43. data/lib/xlsxrb.rb +1539 -344
  44. data/sig/generated/xlsxrb/chart_builder.rbs +336 -79
  45. data/sig/generated/xlsxrb/dsl_helpers.rbs +137 -4
  46. data/sig/generated/xlsxrb/elements/cell.rbs +104 -15
  47. data/sig/generated/xlsxrb/elements/column.rbs +62 -3
  48. data/sig/generated/xlsxrb/elements/coordinate_access.rbs +49 -7
  49. data/sig/generated/xlsxrb/elements/image.rbs +30 -8
  50. data/sig/generated/xlsxrb/elements/metadata.rbs +1587 -0
  51. data/sig/generated/xlsxrb/elements/row.rbs +61 -21
  52. data/sig/generated/xlsxrb/elements/styles.rbs +96 -58
  53. data/sig/generated/xlsxrb/elements/types.rbs +29 -0
  54. data/sig/generated/xlsxrb/elements/workbook.rbs +92 -44
  55. data/sig/generated/xlsxrb/elements/worksheet.rbs +259 -38
  56. data/sig/generated/xlsxrb/ooxml/reader/listeners/core_listeners.rbs +2 -0
  57. data/sig/generated/xlsxrb/ooxml/reader/listeners/drawing_listeners.rbs +74 -2
  58. data/sig/generated/xlsxrb/ooxml/reader/listeners/feature_listeners.rbs +97 -0
  59. data/sig/generated/xlsxrb/ooxml/reader/listeners/style_listeners.rbs +3 -0
  60. data/sig/generated/xlsxrb/ooxml/reader.rbs +20 -0
  61. data/sig/generated/xlsxrb/ooxml/styles_parser.rbs +3 -0
  62. data/sig/generated/xlsxrb/ooxml/workbook_parser.rbs +8 -0
  63. data/sig/generated/xlsxrb/ooxml/workbook_writer.rbs +8 -4
  64. data/sig/generated/xlsxrb/ooxml/worksheet_parser.rbs +1 -1
  65. data/sig/generated/xlsxrb/ooxml/worksheet_writer.rbs +12 -1
  66. data/sig/generated/xlsxrb/ooxml/writer/drawing_xml.rbs +16 -0
  67. data/sig/generated/xlsxrb/ooxml/writer.rbs +45 -8
  68. data/sig/generated/xlsxrb/ooxml/zip_generator.rbs +2 -0
  69. data/sig/generated/xlsxrb/ooxml/zip_reader.rbs +2 -2
  70. data/sig/generated/xlsxrb/ooxml/zip_writer.rbs +8 -2
  71. data/sig/generated/xlsxrb/stream_row.rbs +48 -14
  72. data/sig/generated/xlsxrb/stream_sheet.rbs +398 -89
  73. data/sig/generated/xlsxrb/stream_writer.rbs +1601 -219
  74. data/sig/generated/xlsxrb/style_builder.rbs +403 -75
  75. data/sig/generated/xlsxrb/utils.rbs +49 -13
  76. data/sig/generated/xlsxrb/workbook_builder.rbs +308 -26
  77. data/sig/generated/xlsxrb/worksheet_builder.rbs +1142 -96
  78. data/sig/generated/xlsxrb.rbs +321 -52
  79. metadata +3 -1
@@ -13,79 +13,199 @@ module Xlsxrb
13
13
  #
14
14
  # @api public
15
15
  class Worksheet
16
+ # @return [Array<Hash[Symbol, untyped]>]
17
+ #
18
+ # Corresponds to ECMA-376 Part 4 §18.3.1.18 (<conditionalFormatting> and <cfRule> elements).
19
+ # In the OpenXML specification, conditional formatting definitions are emitted as
20
+ # `<conditionalFormatting>` elements containing individual rule definitions (`<cfRule>`).
21
+ # While ECMA-376 uses the uncountable noun `conditionalFormatting` as the XML element name,
22
+ # xlsxrb exposes these rules collectively as {#conditional_formats} (Array of Hashes)
23
+ # to maintain symmetric plural collection naming alongside other collections
24
+ # (e.g. {#tables}, {#data_validations}, {#merged_cells}) and paired with the singular builder
25
+ # method {WorksheetBuilder#conditional_format}.
26
+ #
27
+ # @api public
28
+ # : Array[Elements::ConditionalFormat]
29
+ attr_reader conditional_formats: untyped
30
+
31
+ # : String?
16
32
  attr_reader name: untyped
17
33
 
34
+ # : Array[Elements::Row]
18
35
  attr_reader rows: untyped
19
36
 
37
+ # : Array[Elements::Column]
20
38
  attr_reader columns: untyped
21
39
 
40
+ # : Array[Elements::Chart]
22
41
  attr_reader charts: untyped
23
42
 
24
- attr_reader conditional_formatting: untyped
25
-
43
+ # : Array[Elements::DataValidation]
26
44
  attr_reader data_validations: untyped
27
45
 
46
+ # : Hash[untyped, untyped]
28
47
  attr_reader unmapped_data: untyped
29
48
 
49
+ # : Array[String]
30
50
  attr_reader errors: untyped
31
51
 
52
+ # : Symbol
32
53
  attr_reader state: untyped
33
54
 
55
+ # : Hash[String, Elements::Hyperlink]
34
56
  attr_reader hyperlinks: untyped
35
57
 
58
+ # : Array[Elements::Comment]
36
59
  attr_reader comments: untyped
37
60
 
61
+ # : Array[Elements::Image]
38
62
  attr_reader images: untyped
39
63
 
64
+ # : (Elements::Styles | Hash[untyped, untyped])?
40
65
  attr_reader styles: untyped
41
66
 
42
- attr_reader date1904: untyped
43
-
67
+ # : String?
44
68
  attr_reader print_area: untyped
45
69
 
70
+ # : Elements::PrintTitles?
46
71
  attr_reader print_titles: untyped
47
72
 
73
+ # : Array[Elements::SparklineGroup]
48
74
  attr_reader sparkline_groups: untyped
49
75
 
76
+ # : Array[String]
50
77
  attr_reader merged_cells: untyped
51
78
 
79
+ # : String?
52
80
  attr_reader auto_filter: untyped
53
81
 
82
+ # : Array[Elements::Table]
54
83
  attr_reader tables: untyped
55
84
 
85
+ # : Array[Elements::Shape]
56
86
  attr_reader shapes: untyped
57
87
 
88
+ # : Elements::FreezePane?
58
89
  attr_reader freeze_pane: untyped
59
90
 
91
+ # : Elements::PageSetup
60
92
  attr_reader page_setup: untyped
61
93
 
94
+ # : Elements::PageMargins?
62
95
  attr_reader page_margins: untyped
63
96
 
97
+ # : Elements::HeaderFooter
64
98
  attr_reader header_footer: untyped
65
99
 
100
+ # : Elements::PrintOptions
66
101
  attr_reader print_options: untyped
67
102
 
103
+ # : Elements::SheetProtection?
68
104
  attr_reader sheet_protection: untyped
69
105
 
106
+ # : Elements::SheetView
70
107
  attr_reader sheet_view: untyped
71
108
 
109
+ # : Elements::SheetProperties
72
110
  attr_reader sheet_properties: untyped
73
111
 
112
+ # : Elements::SheetFormat
74
113
  attr_reader sheet_format: untyped
75
114
 
115
+ # : Array[Elements::PageBreak]
76
116
  attr_reader row_breaks: untyped
77
117
 
78
- attr_reader col_breaks: untyped
118
+ # : Array[Elements::PageBreak]
119
+ attr_reader column_breaks: untyped
79
120
 
121
+ # : Array[Elements::ProtectedRange]
80
122
  attr_reader protected_ranges: untyped
81
123
 
124
+ # : Array[String]
82
125
  attr_reader cell_watches: untyped
83
126
 
127
+ # : Array[Elements::IgnoredError]
128
+ attr_reader ignored_errors: untyped
129
+
130
+ # : Elements::PhoneticProperties?
131
+ attr_reader phonetic_properties: untyped
132
+
133
+ # : (Elements::Selection | Array[Elements::Selection])?
84
134
  attr_reader selection: untyped
85
135
 
86
- attr_writer dimension: untyped
136
+ # : Elements::BackgroundImage?
137
+ attr_reader background_image: untyped
138
+
139
+ # : Array[Elements::ThreadedComment]
140
+ attr_reader threaded_comments: untyped
141
+
142
+ # : Array[Elements::PivotTable]
143
+ attr_reader pivot_tables: untyped
87
144
 
88
- alias conditional_formats conditional_formatting
145
+ # : Elements::SplitPane?
146
+ attr_reader split_pane: untyped
147
+
148
+ # : Hash[Integer, Elements::FilterColumn]
149
+ attr_reader filter_columns: untyped
150
+
151
+ # : Elements::SortState?
152
+ attr_reader sort_state: untyped
153
+
154
+ # : Array[Elements::HeaderFooterImage]
155
+ attr_reader header_footer_images: untyped
156
+
157
+ # @deprecated Worksheet instances are immutable value objects. In 0.2.0, #dimension= will be removed.
158
+ # : (String? new_dim) -> String?
159
+ def dimension=: (String? new_dim) -> String?
160
+
161
+ # @deprecated Use {#date1904?} instead. Will be removed in 0.2.0.
162
+ # : () -> bool
163
+ def date1904: () -> bool
164
+
165
+ # Closes the worksheet resources (no-op for in-memory worksheet).
166
+ #
167
+ # @return [void]
168
+ # @api public
169
+ # : () -> void
170
+ def close: () -> void
171
+
172
+ # Support array pattern matching.
173
+ #
174
+ # @return [Array<Object>]
175
+ # @api public
176
+ # : () -> Array[untyped]
177
+ def deconstruct: () -> Array[untyped]
178
+
179
+ # @deprecated Use {#column_breaks} instead.
180
+ # : () -> Array[Elements::PageBreak]
181
+ def col_breaks: () -> Array[Elements::PageBreak]
182
+
183
+ # Returns worksheet calculation properties (<sheetCalcPr>), or nil if none configured.
184
+ #
185
+ # @return [Elements::SheetCalcProperties, nil]
186
+ # @api public
187
+ # : () -> Elements::SheetCalcProperties?
188
+ def sheet_calc_properties: () -> Elements::SheetCalcProperties?
189
+
190
+ # @deprecated Use {#sheet_calc_properties} instead. Will be removed in 0.2.0.
191
+ # : () -> Elements::SheetCalcProperties?
192
+ def sheet_calc_pr: () -> Elements::SheetCalcProperties?
193
+
194
+ # @deprecated Use {#sheet_calc_properties} instead. Will be removed in 0.2.0.
195
+ # : () -> Elements::SheetCalcProperties?
196
+ def calc_pr: () -> Elements::SheetCalcProperties?
197
+
198
+ # @deprecated Use {#conditional_formats} instead. Matches the ECMA-376 XML element name (<conditionalFormatting>), but {#conditional_formats} is canonical in xlsxrb. Will be removed in version 0.2.0.
199
+ alias conditional_formatting conditional_formats
200
+
201
+ # @deprecated Use {#phonetic_properties} instead. Will be removed in 0.2.0.
202
+ alias phonetic_pr phonetic_properties
203
+
204
+ # @deprecated Use {#background_image} instead. Will be removed in 0.2.0.
205
+ alias background_picture background_image
206
+
207
+ # @deprecated Use {#background_image} instead. Will be removed in 0.2.0.
208
+ alias picture background_image
89
209
 
90
210
  # @param name [String] The worksheet name (max 31 characters).
91
211
  # @param rows [Array<Elements::Row>] Rows in the sheet.
@@ -122,12 +242,18 @@ module Xlsxrb
122
242
  # @param sheet_properties [Hash] Sheet properties (e.g. tabColor, outlinePr).
123
243
  # @param sheet_format [Hash] Sheet format properties (e.g. defaultRowHeight, defaultColWidth).
124
244
  # @param row_breaks [Array<Integer | Hash>] Explicit page row breaks.
125
- # @param col_breaks [Array<Integer | Hash>] Explicit page column breaks.
245
+ # @param column_breaks [Array<Integer | Hash>] Explicit page column breaks.
246
+ # @param col_breaks [Array<Integer | Hash>] Deprecated alias for column_breaks.
126
247
  # @param protected_ranges [Array<Hash>] Protected range definitions.
127
248
  # @param cell_watches [Array<String>] Watched cell references.
249
+ # @param ignored_errors [Array<Hash>] Ignored error rules.
250
+ # @param phonetic_properties [Hash, nil] Phonetic text properties.
128
251
  # @param selection [Hash, Array<Hash>, nil] Active cell and selection settings.
129
- # : (name: String?, ?rows: Array[Elements::Row], ?columns: Array[Elements::Column], ?charts: Array[Hash[Symbol, untyped]], ?conditional_formatting: Array[Hash[Symbol, untyped]]?, ?data_validations: Array[Hash[Symbol, untyped]], ?unmapped_data: Hash[untyped, untyped], ?errors: Array[String]?, ?conditional_formats: Array[Hash[Symbol, untyped]]?, ?state: Symbol, ?hyperlinks: Hash[String, untyped], ?comments: Array[Hash[Symbol, untyped]], ?images: Array[Elements::Image], ?styles: (Elements::Styles | Hash[untyped, untyped])?, ?date1904: bool, ?dimension: String?, ?trim_empty_rows: bool, ?pad_empty_rows: bool, ?pad_empty_cells: bool, ?print_area: String?, ?print_titles: Hash[Symbol, untyped]?, ?sparkline_groups: Array[Hash[Symbol, untyped]], ?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], ?selection: (Hash[Symbol, untyped] | Array[Hash[Symbol, untyped]])?) -> void
130
- def initialize: (name: String?, ?rows: Array[Elements::Row], ?columns: Array[Elements::Column], ?charts: Array[Hash[Symbol, untyped]], ?conditional_formatting: Array[Hash[Symbol, untyped]]?, ?data_validations: Array[Hash[Symbol, untyped]], ?unmapped_data: Hash[untyped, untyped], ?errors: Array[String]?, ?conditional_formats: Array[Hash[Symbol, untyped]]?, ?state: Symbol, ?hyperlinks: Hash[String, untyped], ?comments: Array[Hash[Symbol, untyped]], ?images: Array[Elements::Image], ?styles: (Elements::Styles | Hash[untyped, untyped])?, ?date1904: bool, ?dimension: String?, ?trim_empty_rows: bool, ?pad_empty_rows: bool, ?pad_empty_cells: bool, ?print_area: String?, ?print_titles: Hash[Symbol, untyped]?, ?sparkline_groups: Array[Hash[Symbol, untyped]], ?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], ?selection: (Hash[Symbol, untyped] | Array[Hash[Symbol, untyped]])?) -> void
252
+ # @param sheet_calc_pr [Hash, nil] Worksheet calculation properties.
253
+ # @param background_image [Hash, nil] Worksheet background image specification.
254
+ # @param threaded_comments [Array<Hash>] Threaded comments in the sheet.
255
+ # : (name: String?, ?rows: Array[Elements::Row], ?columns: Array[Elements::Column], ?charts: Array[untyped], ?conditional_formatting: Array[untyped]?, ?data_validations: Array[untyped], ?unmapped_data: Hash[untyped, untyped], ?errors: Array[String]?, ?conditional_formats: Array[untyped]?, ?state: Symbol, ?hyperlinks: Hash[String, untyped], ?comments: Array[untyped], ?images: Array[Elements::Image], ?styles: (Elements::Styles | Hash[untyped, untyped])?, ?date1904: bool, ?dimension: String?, ?trim_empty_rows: bool, ?pad_empty_rows: bool, ?pad_empty_cells: bool, ?print_area: String?, ?print_titles: untyped, ?sparkline_groups: Array[untyped], ?merged_cells: Array[String], ?auto_filter: String?, ?tables: Array[untyped], ?shapes: Array[untyped], ?freeze_pane: untyped, ?page_setup: untyped, ?page_margins: untyped, ?header_footer: untyped, ?print_options: untyped, ?sheet_protection: untyped, ?sheet_view: untyped, ?sheet_properties: untyped, ?sheet_format: untyped, ?row_breaks: Array[untyped], ?column_breaks: Array[untyped]?, ?col_breaks: Array[untyped]?, ?protected_ranges: Array[untyped], ?cell_watches: Array[String], ?ignored_errors: Array[untyped], ?phonetic_properties: untyped, ?selection: untyped, ?sheet_calc_properties: untyped, ?sheet_calc_pr: untyped, ?background_image: untyped, ?threaded_comments: Array[untyped], ?pivot_tables: Array[untyped]?, ?split_pane: untyped, ?filter_columns: Hash[Integer, untyped]?, ?sort_state: untyped, ?header_footer_images: Array[untyped]?) -> void
256
+ def initialize: (name: String?, ?rows: Array[Elements::Row], ?columns: Array[Elements::Column], ?charts: Array[untyped], ?conditional_formatting: Array[untyped]?, ?data_validations: Array[untyped], ?unmapped_data: Hash[untyped, untyped], ?errors: Array[String]?, ?conditional_formats: Array[untyped]?, ?state: Symbol, ?hyperlinks: Hash[String, untyped], ?comments: Array[untyped], ?images: Array[Elements::Image], ?styles: (Elements::Styles | Hash[untyped, untyped])?, ?date1904: bool, ?dimension: String?, ?trim_empty_rows: bool, ?pad_empty_rows: bool, ?pad_empty_cells: bool, ?print_area: String?, ?print_titles: untyped, ?sparkline_groups: Array[untyped], ?merged_cells: Array[String], ?auto_filter: String?, ?tables: Array[untyped], ?shapes: Array[untyped], ?freeze_pane: untyped, ?page_setup: untyped, ?page_margins: untyped, ?header_footer: untyped, ?print_options: untyped, ?sheet_protection: untyped, ?sheet_view: untyped, ?sheet_properties: untyped, ?sheet_format: untyped, ?row_breaks: Array[untyped], ?column_breaks: Array[untyped]?, ?col_breaks: Array[untyped]?, ?protected_ranges: Array[untyped], ?cell_watches: Array[String], ?ignored_errors: Array[untyped], ?phonetic_properties: untyped, ?selection: untyped, ?sheet_calc_properties: untyped, ?sheet_calc_pr: untyped, ?background_image: untyped, ?threaded_comments: Array[untyped], ?pivot_tables: Array[untyped]?, ?split_pane: untyped, ?filter_columns: Hash[Integer, untyped]?, ?sort_state: untyped, ?header_footer_images: Array[untyped]?) -> void
131
257
 
132
258
  # Returns whether trailing empty rows are omitted during iteration.
133
259
  #
@@ -136,7 +262,9 @@ module Xlsxrb
136
262
  # : () -> bool
137
263
  def trim_empty_rows?: () -> bool
138
264
 
139
- alias trim_empty_rows trim_empty_rows?
265
+ # @deprecated Use {#trim_empty_rows?} instead. Will be removed in 0.2.0.
266
+ # : () -> bool
267
+ def trim_empty_rows: () -> bool
140
268
 
141
269
  # Returns whether skipped rows are padded during iteration.
142
270
  #
@@ -145,7 +273,9 @@ module Xlsxrb
145
273
  # : () -> bool
146
274
  def pad_empty_rows?: () -> bool
147
275
 
148
- alias pad_empty_rows pad_empty_rows?
276
+ # @deprecated Use {#pad_empty_rows?} instead. Will be removed in 0.2.0.
277
+ # : () -> bool
278
+ def pad_empty_rows: () -> bool
149
279
 
150
280
  # Returns whether missing cells within rows are padded during iteration.
151
281
  #
@@ -154,7 +284,9 @@ module Xlsxrb
154
284
  # : () -> bool
155
285
  def pad_empty_cells?: () -> bool
156
286
 
157
- alias pad_empty_cells pad_empty_cells?
287
+ # @deprecated Use {#pad_empty_cells?} instead. Will be removed in 0.2.0.
288
+ # : () -> bool
289
+ def pad_empty_cells: () -> bool
158
290
 
159
291
  # Returns whether the worksheet uses the 1904 date system.
160
292
  #
@@ -171,6 +303,52 @@ module Xlsxrb
171
303
  # : () -> String?
172
304
  def dimension: () -> String?
173
305
 
306
+ # Returns the worksheet tab color specification, or nil if not set.
307
+ #
308
+ # @return [String, Hash, nil] RGB hex string (e.g. "FFFF0000") or color hash (e.g. { theme: 3, tint: -0.5 }).
309
+ # @api public
310
+ # : () -> (String | Hash[Symbol, untyped])?
311
+ def tab_color: () -> (String | Hash[Symbol, untyped])?
312
+
313
+ # Returns the internal VBA or application code name of the worksheet, or nil if not specified.
314
+ #
315
+ # @return [String, nil]
316
+ # @api public
317
+ # : () -> String?
318
+ def code_name: () -> String?
319
+
320
+ # Returns whether fit-to-page is enabled for page setup on this worksheet.
321
+ #
322
+ # @return [Boolean]
323
+ # @api public
324
+ # : () -> bool
325
+ def fit_to_page?: () -> bool
326
+
327
+ # @deprecated Use {#fit_to_page?} instead. Will be removed in 0.2.0.
328
+ # : () -> bool
329
+ def fit_to_page: () -> bool
330
+
331
+ # Returns whether full calculation on load is enabled on this worksheet.
332
+ #
333
+ # @return [Boolean]
334
+ # @api public
335
+ # : () -> bool
336
+ def full_calc_on_load?: () -> bool
337
+
338
+ # @deprecated Use {#full_calc_on_load?} instead. Will be removed in 0.2.0.
339
+ # : () -> bool
340
+ def full_calc_on_load: () -> bool
341
+
342
+ # Returns the outline and grouping properties of the worksheet, or an empty hash if none configured.
343
+ #
344
+ # @return [Hash]
345
+ # @api public
346
+ # : () -> Hash[Symbol, untyped]
347
+ def outline_properties: () -> Hash[Symbol, untyped]
348
+
349
+ # @deprecated Use {#outline_properties} instead. Will be removed in 0.2.0.
350
+ alias outline_pr outline_properties
351
+
174
352
  # Iterate over rows in the worksheet.
175
353
  #
176
354
  # @example
@@ -263,14 +441,15 @@ module Xlsxrb
263
441
  # Returns all images anchored at a specific cell reference or 0-based coordinate.
264
442
  #
265
443
  # @param ref_or_row [String, Symbol, Integer] Cell reference (e.g. "A1") or 0-based row index.
266
- # @param col [Integer, nil] Optional 0-based column index.
444
+ # @param col [Integer, String, Symbol, nil] Optional 0-based column index or column letter/Symbol.
267
445
  # @return [Array<Elements::Image>]
268
446
  # @api public
269
- # : (String | Symbol | Integer ref_or_row, ?Integer? col) -> Array[Elements::Image]
270
- def images_at: (String | Symbol | Integer ref_or_row, ?Integer? col) -> Array[Elements::Image]
447
+ # : (String | Symbol | Integer ref_or_row, ?Integer | String | Symbol | nil col) -> Array[Elements::Image]
448
+ def images_at: (String | Symbol | Integer ref_or_row, ?Integer | String | Symbol | nil col) -> Array[Elements::Image]
271
449
 
272
450
  # Yields self with images loaded or returns self.
273
451
  #
452
+ # @deprecated Access {#images} directly. Lazy-loading is automatic. Will be removed in 0.2.0.
274
453
  # @yield [sheet]
275
454
  # @yieldparam sheet [Elements::Worksheet]
276
455
  # @return [Elements::Worksheet, void]
@@ -310,61 +489,96 @@ module Xlsxrb
310
489
  # Returns hyperlink metadata for the given cell reference, or nil.
311
490
  #
312
491
  # @param ref_or_row [String, Symbol, Integer] Cell reference (e.g. "A1") or 0-based row index.
313
- # @param col [Integer, nil] Optional 0-based column index if ref_or_row is a row index.
314
- # @return [Hash, nil]
492
+ # @param col [Integer, String, Symbol, nil] Optional 0-based column index or column letter/Symbol.
493
+ # @return [Elements::Hyperlink, nil]
315
494
  # @api public
316
- # : (String | Symbol | Integer ref_or_row, ?Integer? col) -> Hash[Symbol, untyped]?
317
- def hyperlink: (String | Symbol | Integer ref_or_row, ?Integer? col) -> Hash[Symbol, untyped]?
495
+ # : (String | Symbol | Integer | nil ref_or_row, ?Integer | String | Symbol | nil col) -> Elements::Hyperlink?
496
+ def hyperlink: (String | Symbol | Integer | nil ref_or_row, ?Integer | String | Symbol | nil col) -> Elements::Hyperlink?
318
497
 
319
498
  # Returns comment metadata for the given cell reference, or nil.
320
499
  #
321
500
  # @param ref_or_row [String, Symbol, Integer] Cell reference (e.g. "A1") or 0-based row index.
322
- # @param col [Integer, nil] Optional 0-based column index if ref_or_row is a row index.
323
- # @return [Hash, nil]
501
+ # @param col [Integer, String, Symbol, nil] Optional 0-based column index or column letter/Symbol.
502
+ # @return [Elements::Comment, nil]
324
503
  # @api public
325
- # : (String | Symbol | Integer ref_or_row, ?Integer? col) -> Hash[Symbol, untyped]?
326
- def comment: (String | Symbol | Integer ref_or_row, ?Integer? col) -> Hash[Symbol, untyped]?
504
+ # : (String | Symbol | Integer | nil ref_or_row, ?Integer | String | Symbol | nil col) -> Elements::Comment?
505
+ def comment: (String | Symbol | Integer | nil ref_or_row, ?Integer | String | Symbol | nil col) -> Elements::Comment?
327
506
 
328
507
  # Returns comments indexed by cell reference.
329
508
  #
330
- # @return [Hash<String, Hash[Symbol, untyped]>]
509
+ # @return [Hash<String, Elements::Comment>]
510
+ # @api public
511
+ # : () -> Hash[String, Elements::Comment]
512
+ def comments_by_ref: () -> Hash[String, Elements::Comment]
513
+
514
+ # Returns the root threaded comment for the given cell reference, or nil.
515
+ #
516
+ # @param ref_or_row [String, Symbol, Integer] Cell reference (e.g. "A1") or 0-based row index.
517
+ # @param col [Integer, String, Symbol, nil] Optional 0-based column index or column letter/Symbol.
518
+ # @return [Elements::ThreadedComment, nil]
519
+ # @api public
520
+ # : (String | Symbol | Integer ref_or_row, ?Integer | String | Symbol | nil col) -> Elements::ThreadedComment?
521
+ def threaded_comment: (String | Symbol | Integer ref_or_row, ?Integer | String | Symbol | nil col) -> Elements::ThreadedComment?
522
+
523
+ # Returns threaded comments for the given cell reference, or empty array.
524
+ #
525
+ # @param ref_or_row [String, Symbol, Integer] Cell reference (e.g. "A1") or 0-based row index.
526
+ # @param col [Integer, String, Symbol, nil] Optional 0-based column index or column letter/Symbol.
527
+ # @return [Array<Elements::ThreadedComment>]
331
528
  # @api public
332
- # : () -> Hash[String, Hash[Symbol, untyped]]
333
- def comments_by_ref: () -> Hash[String, Hash[Symbol, untyped]]
529
+ # : (String | Symbol | Integer ref_or_row, ?Integer | String | Symbol | nil col) -> Array[Elements::ThreadedComment]
530
+ def threaded_comments_at: (String | Symbol | Integer ref_or_row, ?Integer | String | Symbol | nil col) -> Array[Elements::ThreadedComment]
531
+
532
+ # Returns threaded comments indexed by cell reference.
533
+ #
534
+ # @return [Hash<String, Array<Elements::ThreadedComment>>]
535
+ # @api public
536
+ # : () -> Hash[String, Array[Elements::ThreadedComment]]
537
+ def threaded_comments_by_ref: () -> Hash[String, Array[Elements::ThreadedComment]]
334
538
 
335
539
  # Access a cell by reference or 0-based coordinates.
336
540
  #
337
541
  # @param ref_or_row [String, Symbol, Integer] Cell reference (e.g. "A1") or 0-based row index.
338
- # @param col [Integer, nil] Optional 0-based column index.
542
+ # @param col [Integer, String, Symbol, nil] Optional 0-based column index or column letter/Symbol.
339
543
  # @return [Elements::Cell, nil]
340
544
  # @api public
341
- # : (String | Symbol | Integer ref_or_row, ?Integer? col) -> Elements::Cell?
342
- def cell: (String | Symbol | Integer ref_or_row, ?Integer? col) -> Elements::Cell?
545
+ # Access a cell by reference (e.g. "A1") or 0-based coordinate indices (row, col).
546
+ #
547
+ # @deprecated Use {#[]} instead (e.g. sheet["A1"] or sheet[0, 0]). Will be removed in 0.2.0.
548
+ # @param ref_or_row [String, Symbol, Integer] Cell reference (e.g. "A1") or 0-based row index.
549
+ # @param col [Integer, String, Symbol, nil] Optional 0-based column index or column letter/Symbol.
550
+ # @return [Elements::Cell, nil]
551
+ # @api public
552
+ # : (String | Symbol | Integer ref_or_row, ?Integer | String | Symbol | nil col) -> Elements::Cell?
553
+ def cell: (String | Symbol | Integer ref_or_row, ?Integer | String | Symbol | nil col) -> Elements::Cell?
343
554
 
344
555
  # Returns the formatted string representation of a cell's value.
345
556
  #
346
557
  # @param ref_or_row [String, Symbol, Integer] Cell reference (e.g. "A1") or 0-based row index.
347
- # @param col [Integer, nil] Optional 0-based column index.
558
+ # @param col [Integer, String, Symbol, nil] Optional 0-based column index or column letter/Symbol.
348
559
  # @return [String, nil]
349
560
  # @api public
350
- # : (String | Symbol | Integer ref_or_row, ?Integer? col) -> String?
351
- def formatted_value: (String | Symbol | Integer ref_or_row, ?Integer? col) -> String?
561
+ # : (String | Symbol | Integer ref_or_row, ?Integer | String | Symbol | nil col) -> String?
562
+ def formatted_value: (String | Symbol | Integer ref_or_row, ?Integer | String | Symbol | nil col) -> String?
352
563
 
353
564
  # Returns a new Worksheet with the specified cell updated.
354
565
  #
355
566
  # @example
356
567
  # new_sheet = sheet.update_cell("B1", value: "Updated")
357
568
  #
358
- # @param ref [String] The cell reference (e.g. "B1").
569
+ # @param ref_or_row [String, Symbol, Integer] Cell reference (e.g. "B1") or 0-based row index.
570
+ # @param col_or_value [Integer, String, Symbol, nil] 0-based column index or column letter/Symbol when ref_or_row is a row index.
359
571
  # @param value [Object] The new cell value.
360
- # @param style_index [Integer, String, nil] Optional new style index.
572
+ # @param style [String, Symbol, Hash, nil] Optional new style name or inline style properties.
573
+ # @param style_index [Integer, nil] Optional new 0-based style index.
361
574
  # @param formula [Elements::Formula, nil] Optional new formula.
362
575
  # @param hyperlink [Hash, String, nil] Optional new hyperlink.
576
+ # @deprecated Use {Xlsxrb.read} + {Xlsxrb.write} for streaming transformations or {Xlsxrb.write} DSL for report generation. Will be removed in 0.2.0.
363
577
  # @param comment [Hash, String, nil] Optional new comment.
364
578
  # @return [Worksheet] A new Worksheet instance.
365
579
  # @api public
366
- # : (String ref, ?value: untyped, ?style_index: Integer | String | nil, ?formula: Elements::Formula?, ?hyperlink: (Hash[Symbol, untyped] | String)?, ?comment: (Hash[Symbol, untyped] | String)?) -> Elements::Worksheet
367
- def update_cell: (String ref, ?value: untyped, ?style_index: Integer | String | nil, ?formula: Elements::Formula?, ?hyperlink: (Hash[Symbol, untyped] | String)?, ?comment: (Hash[Symbol, untyped] | String)?) -> Elements::Worksheet
580
+ # : (String | Symbol | Integer ref_or_row, ?Integer | String | Symbol | nil col_or_value, ?value: untyped, ?style: (String | Symbol | Hash[Symbol, untyped])?, ?style_index: (Integer | String | Symbol | Hash[Symbol, untyped])?, ?formula: Elements::Formula?, ?hyperlink: (Hash[Symbol, untyped] | String)?, ?comment: (Hash[Symbol, untyped] | String)?) -> Elements::Worksheet
581
+ def update_cell: (String | Symbol | Integer ref_or_row, ?Integer | String | Symbol | nil col_or_value, ?value: untyped, ?style: (String | Symbol | Hash[Symbol, untyped])?, ?style_index: (Integer | String | Symbol | Hash[Symbol, untyped])?, ?formula: Elements::Formula?, ?hyperlink: (Hash[Symbol, untyped] | String)?, ?comment: (Hash[Symbol, untyped] | String)?) -> Elements::Worksheet
368
582
 
369
583
  # Returns a new Worksheet with attributes replaced (Data-like behavior).
370
584
  #
@@ -394,10 +608,16 @@ module Xlsxrb
394
608
  # : () -> Elements::Worksheet
395
609
  def load: () -> Elements::Worksheet
396
610
 
397
- alias to_worksheet load
611
+ # @deprecated Use {#load} instead. Will be removed in 0.2.0.
612
+ # : () -> Elements::Worksheet
613
+ def to_worksheet: () -> Elements::Worksheet
398
614
 
399
615
  FORBIDDEN_NAME_CHARS: ::Regexp
400
616
 
617
+ # @api private
618
+ # : () -> Regexp
619
+ def self.forbidden_name_chars: () -> Regexp
620
+
401
621
  # Returns whether the worksheet name is valid according to OOXML specifications (1..31 chars, no forbidden chars).
402
622
  #
403
623
  # @param name [Object]
@@ -410,6 +630,7 @@ module Xlsxrb
410
630
  # @param name [String]
411
631
  # @param rows [Array<Elements::Row>]
412
632
  # @return [Array<String>] List of errors.
633
+ # @api private
413
634
  # : (untyped name, untyped rows) -> Array[String]
414
635
  def self.validate: (untyped name, untyped rows) -> Array[String]
415
636
 
@@ -46,6 +46,8 @@ module Xlsxrb
46
46
 
47
47
  def store_cell_value: () -> untyped
48
48
 
49
+ def expand_shared_formulas!: () -> untyped
50
+
49
51
  def numeric_value: (untyped raw) -> untyped
50
52
 
51
53
  def element_name: (untyped local_name, untyped qname) -> untyped
@@ -70,8 +70,6 @@ module Xlsxrb
70
70
  class ChartTypeListener
71
71
  include REXML::SAX2Listener
72
72
 
73
- attr_reader chart_type: untyped
74
-
75
73
  attr_reader title: untyped
76
74
 
77
75
  attr_reader title_overlay: untyped
@@ -98,6 +96,78 @@ module Xlsxrb
98
96
 
99
97
  attr_reader val_axis_title: untyped
100
98
 
99
+ attr_reader secondary_value_axis: untyped
100
+
101
+ attr_reader sec_val_axis_title: untyped
102
+
103
+ attr_reader chart_types: untyped
104
+
105
+ attr_reader sec_val_axis_major_gridlines: untyped
106
+
107
+ attr_reader sec_val_axis_minor_gridlines: untyped
108
+
109
+ attr_reader sec_val_axis_delete: untyped
110
+
111
+ attr_reader sec_val_axis_orientation: untyped
112
+
113
+ attr_reader sec_val_axis_num_fmt: untyped
114
+
115
+ attr_reader sec_val_axis_major_tick_mark: untyped
116
+
117
+ attr_reader sec_val_axis_minor_tick_mark: untyped
118
+
119
+ attr_reader sec_val_axis_crosses: untyped
120
+
121
+ attr_reader sec_val_axis_crosses_at: untyped
122
+
123
+ attr_reader sec_val_axis_cross_between: untyped
124
+
125
+ attr_reader sec_val_axis_major_unit: untyped
126
+
127
+ attr_reader sec_val_axis_minor_unit: untyped
128
+
129
+ attr_reader sec_val_axis_disp_units: untyped
130
+
131
+ attr_reader sec_val_axis_scaling_max: untyped
132
+
133
+ attr_reader sec_val_axis_scaling_min: untyped
134
+
135
+ attr_reader sec_val_axis_log_base: untyped
136
+
137
+ attr_reader sec_val_axis_pos: untyped
138
+
139
+ attr_reader sec_val_axis_label_rotation: untyped
140
+
141
+ attr_reader sec_val_axis_font: untyped
142
+
143
+ attr_reader sec_val_axis_fill: untyped
144
+
145
+ attr_reader sec_val_axis_no_fill: untyped
146
+
147
+ attr_reader sec_val_axis_line_color: untyped
148
+
149
+ attr_reader sec_val_axis_line_width: untyped
150
+
151
+ attr_reader sec_val_axis_line_dash: untyped
152
+
153
+ attr_reader sec_val_axis_tick_lbl_pos: untyped
154
+
155
+ attr_reader sec_val_axis_title_font: untyped
156
+
157
+ attr_reader sec_val_axis_title_fill: untyped
158
+
159
+ attr_reader sec_val_axis_title_no_fill: untyped
160
+
161
+ attr_reader sec_val_axis_title_line_color: untyped
162
+
163
+ attr_reader sec_val_axis_title_line_width: untyped
164
+
165
+ attr_reader sec_val_axis_title_line_dash: untyped
166
+
167
+ attr_reader sec_val_axis_title_layout: untyped
168
+
169
+ attr_reader sec_val_axis_title_rotation: untyped
170
+
101
171
  attr_reader grouping: untyped
102
172
 
103
173
  attr_reader bar_dir: untyped
@@ -360,6 +430,8 @@ module Xlsxrb
360
430
 
361
431
  CHART_TYPES: untyped
362
432
 
433
+ def chart_type: () -> untyped
434
+
363
435
  def initialize: () -> untyped
364
436
 
365
437
  def start_element: (untyped _uri, untyped local_name, untyped qname, untyped attributes) -> untyped