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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +157 -1
- data/README.md +81 -21
- data/lib/ruby_lsp/xlsxrb/completion_listener.rb +31 -61
- data/lib/xlsxrb/chart_builder.rb +619 -98
- data/lib/xlsxrb/dsl_helpers.rb +583 -15
- data/lib/xlsxrb/elements/cell.rb +265 -53
- data/lib/xlsxrb/elements/column.rb +95 -6
- 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 +243 -7
- data/lib/xlsxrb/elements/workbook.rb +202 -65
- data/lib/xlsxrb/elements/worksheet.rb +728 -85
- data/lib/xlsxrb/elements.rb +1 -0
- data/lib/xlsxrb/ooxml/reader/listeners/core_listeners.rb +32 -3
- data/lib/xlsxrb/ooxml/reader/listeners/drawing_listeners.rb +194 -26
- data/lib/xlsxrb/ooxml/reader/listeners/feature_listeners.rb +372 -18
- data/lib/xlsxrb/ooxml/reader/listeners/style_listeners.rb +33 -14
- data/lib/xlsxrb/ooxml/reader.rb +92 -0
- data/lib/xlsxrb/ooxml/styles_parser.rb +29 -14
- data/lib/xlsxrb/ooxml/workbook_parser.rb +18 -3
- data/lib/xlsxrb/ooxml/workbook_writer.rb +351 -77
- data/lib/xlsxrb/ooxml/worksheet_parser.rb +18 -4
- data/lib/xlsxrb/ooxml/worksheet_writer.rb +349 -103
- data/lib/xlsxrb/ooxml/writer/drawing_xml.rb +584 -443
- data/lib/xlsxrb/ooxml/writer/features_xml.rb +52 -14
- data/lib/xlsxrb/ooxml/writer/styles_xml.rb +42 -18
- data/lib/xlsxrb/ooxml/writer.rb +288 -35
- data/lib/xlsxrb/ooxml/zip_generator.rb +2 -0
- data/lib/xlsxrb/ooxml/zip_reader.rb +47 -10
- data/lib/xlsxrb/ooxml/zip_writer.rb +15 -5
- data/lib/xlsxrb/stream_row.rb +97 -18
- data/lib/xlsxrb/stream_sheet.rb +827 -157
- data/lib/xlsxrb/stream_writer.rb +2766 -375
- data/lib/xlsxrb/style_builder.rb +821 -105
- data/lib/xlsxrb/utils.rb +82 -57
- data/lib/xlsxrb/version.rb +1 -1
- data/lib/xlsxrb/workbook_builder.rb +542 -62
- data/lib/xlsxrb/worksheet_builder.rb +2279 -209
- data/lib/xlsxrb.rb +1539 -344
- data/sig/generated/xlsxrb/chart_builder.rbs +336 -79
- data/sig/generated/xlsxrb/dsl_helpers.rbs +137 -4
- data/sig/generated/xlsxrb/elements/cell.rbs +104 -15
- data/sig/generated/xlsxrb/elements/column.rbs +62 -3
- 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 +29 -0
- data/sig/generated/xlsxrb/elements/workbook.rbs +92 -44
- data/sig/generated/xlsxrb/elements/worksheet.rbs +259 -38
- data/sig/generated/xlsxrb/ooxml/reader/listeners/core_listeners.rbs +2 -0
- data/sig/generated/xlsxrb/ooxml/reader/listeners/drawing_listeners.rbs +74 -2
- data/sig/generated/xlsxrb/ooxml/reader/listeners/feature_listeners.rbs +97 -0
- data/sig/generated/xlsxrb/ooxml/reader/listeners/style_listeners.rbs +3 -0
- data/sig/generated/xlsxrb/ooxml/reader.rbs +20 -0
- data/sig/generated/xlsxrb/ooxml/styles_parser.rbs +3 -0
- data/sig/generated/xlsxrb/ooxml/workbook_parser.rbs +8 -0
- data/sig/generated/xlsxrb/ooxml/workbook_writer.rbs +8 -4
- data/sig/generated/xlsxrb/ooxml/worksheet_parser.rbs +1 -1
- data/sig/generated/xlsxrb/ooxml/worksheet_writer.rbs +12 -1
- data/sig/generated/xlsxrb/ooxml/writer/drawing_xml.rbs +16 -0
- data/sig/generated/xlsxrb/ooxml/writer.rbs +45 -8
- data/sig/generated/xlsxrb/ooxml/zip_generator.rbs +2 -0
- data/sig/generated/xlsxrb/ooxml/zip_reader.rbs +2 -2
- data/sig/generated/xlsxrb/ooxml/zip_writer.rbs +8 -2
- data/sig/generated/xlsxrb/stream_row.rbs +48 -14
- data/sig/generated/xlsxrb/stream_sheet.rbs +398 -89
- data/sig/generated/xlsxrb/stream_writer.rbs +1601 -219
- data/sig/generated/xlsxrb/style_builder.rbs +403 -75
- data/sig/generated/xlsxrb/utils.rbs +49 -13
- data/sig/generated/xlsxrb/workbook_builder.rbs +308 -26
- data/sig/generated/xlsxrb/worksheet_builder.rbs +1142 -96
- data/sig/generated/xlsxrb.rbs +321 -52
- metadata +3 -1
|
@@ -317,6 +317,8 @@ module Xlsxrb
|
|
|
317
317
|
|
|
318
318
|
attr_reader col_breaks: untyped
|
|
319
319
|
|
|
320
|
+
attr_reader column_breaks: untyped
|
|
321
|
+
|
|
320
322
|
def initialize: () -> untyped
|
|
321
323
|
|
|
322
324
|
def start_element: (untyped _uri, untyped local_name, untyped qname, untyped attributes) -> untyped
|
|
@@ -437,6 +439,101 @@ module Xlsxrb
|
|
|
437
439
|
|
|
438
440
|
def element_name: (untyped local_name, untyped qname) -> untyped
|
|
439
441
|
end
|
|
442
|
+
|
|
443
|
+
# SAX2 listener for parsing <personList> element in xl/persons/person.xml.
|
|
444
|
+
class PersonListListener
|
|
445
|
+
include REXML::SAX2Listener
|
|
446
|
+
|
|
447
|
+
attr_reader persons: untyped
|
|
448
|
+
|
|
449
|
+
def initialize: () -> untyped
|
|
450
|
+
|
|
451
|
+
def start_element: (untyped _uri, untyped local_name, untyped qname, untyped attributes) -> untyped
|
|
452
|
+
|
|
453
|
+
def end_element: (untyped _uri, untyped _local_name, untyped _qname) -> untyped
|
|
454
|
+
|
|
455
|
+
private
|
|
456
|
+
|
|
457
|
+
def element_name: (untyped local_name, untyped qname) -> untyped
|
|
458
|
+
end
|
|
459
|
+
|
|
460
|
+
# SAX2 listener for parsing <ThreadedComments> element in xl/threadedComments/threadedComment{N}.xml.
|
|
461
|
+
class ThreadedCommentsListener
|
|
462
|
+
include REXML::SAX2Listener
|
|
463
|
+
|
|
464
|
+
attr_reader threaded_comments: untyped
|
|
465
|
+
|
|
466
|
+
def initialize: () -> untyped
|
|
467
|
+
|
|
468
|
+
def start_element: (untyped _uri, untyped local_name, untyped qname, untyped attributes) -> untyped
|
|
469
|
+
|
|
470
|
+
def characters: (untyped text) -> untyped
|
|
471
|
+
|
|
472
|
+
def end_element: (untyped _uri, untyped local_name, untyped qname) -> untyped
|
|
473
|
+
|
|
474
|
+
private
|
|
475
|
+
|
|
476
|
+
def element_name: (untyped local_name, untyped qname) -> untyped
|
|
477
|
+
end
|
|
478
|
+
|
|
479
|
+
# SAX2 listener for parsing <x14:sparklineGroups> and child <x14:sparklineGroup> elements.
|
|
480
|
+
class SparklineGroupsListener
|
|
481
|
+
include REXML::SAX2Listener
|
|
482
|
+
|
|
483
|
+
COLOR_TAG_MAP: untyped
|
|
484
|
+
|
|
485
|
+
# @return [Array<Hash[Symbol, untyped]>]
|
|
486
|
+
# : Array[Hash[Symbol, untyped]]
|
|
487
|
+
attr_reader groups: untyped
|
|
488
|
+
|
|
489
|
+
alias sparkline_groups groups
|
|
490
|
+
|
|
491
|
+
# : () -> void
|
|
492
|
+
def initialize: () -> void
|
|
493
|
+
|
|
494
|
+
# : (untyped _uri, String? local_name, String? qname, Hash[String, String] attributes) -> void
|
|
495
|
+
def start_element: (untyped _uri, String? local_name, String? qname, Hash[String, String] attributes) -> void
|
|
496
|
+
|
|
497
|
+
# : (String text) -> void
|
|
498
|
+
def characters: (String text) -> void
|
|
499
|
+
|
|
500
|
+
# : (untyped _uri, String? local_name, String? qname) -> void
|
|
501
|
+
def end_element: (untyped _uri, String? local_name, String? qname) -> void
|
|
502
|
+
|
|
503
|
+
private
|
|
504
|
+
|
|
505
|
+
# : (String? str) -> (Integer | Float | nil)
|
|
506
|
+
def parse_numeric: (String? str) -> (Integer | Float | nil)
|
|
507
|
+
|
|
508
|
+
# : (Hash[String, String] attributes) -> (String | Hash[Symbol, untyped] | nil)
|
|
509
|
+
def parse_color: (Hash[String, String] attributes) -> (String | Hash[Symbol, untyped] | nil)
|
|
510
|
+
|
|
511
|
+
# : (String? local_name, String? qname) -> String
|
|
512
|
+
def element_name: (String? local_name, String? qname) -> String
|
|
513
|
+
end
|
|
514
|
+
|
|
515
|
+
# SAX2 listener for parsing VML drawings of header and footer images (<v:shape> and <v:imagedata>).
|
|
516
|
+
class VmlHeaderFooterListener
|
|
517
|
+
include REXML::SAX2Listener
|
|
518
|
+
|
|
519
|
+
# @return [Array<Hash[Symbol, untyped]>]
|
|
520
|
+
# : Array[Hash[Symbol, untyped]]
|
|
521
|
+
attr_reader shapes: untyped
|
|
522
|
+
|
|
523
|
+
# : () -> void
|
|
524
|
+
def initialize: () -> void
|
|
525
|
+
|
|
526
|
+
# : (untyped _uri, String? local_name, String? qname, Hash[String, String] attributes) -> void
|
|
527
|
+
def start_element: (untyped _uri, String? local_name, String? qname, Hash[String, String] attributes) -> void
|
|
528
|
+
|
|
529
|
+
# : (untyped _uri, String? local_name, String? qname) -> void
|
|
530
|
+
def end_element: (untyped _uri, String? local_name, String? qname) -> void
|
|
531
|
+
|
|
532
|
+
private
|
|
533
|
+
|
|
534
|
+
# : (String? local_name, String? qname) -> String
|
|
535
|
+
def element_name: (String? local_name, String? qname) -> String
|
|
536
|
+
end
|
|
440
537
|
end
|
|
441
538
|
end
|
|
442
539
|
end
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Xlsxrb
|
|
4
4
|
module Ooxml
|
|
5
5
|
# Reads cells from an XLSX file.
|
|
6
|
+
#
|
|
7
|
+
# @api private
|
|
6
8
|
class Reader
|
|
7
9
|
def initialize: (untyped filepath) -> untyped
|
|
8
10
|
|
|
@@ -92,6 +94,12 @@ module Xlsxrb
|
|
|
92
94
|
# Returns sheet-level properties (tabColor, outlinePr) for the given sheet.
|
|
93
95
|
def sheet_properties: (?sheet: untyped) -> untyped
|
|
94
96
|
|
|
97
|
+
# Returns outline and grouping properties (<outlinePr>) for the given sheet.
|
|
98
|
+
def outline_properties: (?sheet: untyped) -> untyped
|
|
99
|
+
|
|
100
|
+
# @deprecated Use {#outline_properties} instead. Will be removed in 0.2.0.
|
|
101
|
+
alias outline_pr outline_properties
|
|
102
|
+
|
|
95
103
|
# Returns phonetic properties for the given sheet, or nil if not present.
|
|
96
104
|
def phonetic_properties: (?sheet: untyped) -> untyped
|
|
97
105
|
|
|
@@ -228,6 +236,18 @@ module Xlsxrb
|
|
|
228
236
|
# Each hash: { ref:, author:, text: }
|
|
229
237
|
def comments: (?sheet: untyped) -> untyped
|
|
230
238
|
|
|
239
|
+
# Returns all persons registered in xl/persons/person.xml.
|
|
240
|
+
# Each hash: { id:, display_name:, user_id:, provider_id: }
|
|
241
|
+
# : () -> Array[Hash[Symbol, untyped]]
|
|
242
|
+
def persons: () -> untyped
|
|
243
|
+
|
|
244
|
+
alias person_list persons
|
|
245
|
+
|
|
246
|
+
# Returns threaded comments for the given sheet as an array of hashes.
|
|
247
|
+
# Each hash: { ref:, text:, author:, person_id:, id:, parent_id:, dt:, done: }
|
|
248
|
+
# : (?sheet: untyped?) -> Array[Hash[Symbol, untyped]]
|
|
249
|
+
def threaded_comments: (?sheet: untyped) -> untyped
|
|
250
|
+
|
|
231
251
|
# Returns pivot tables for the given sheet as an array of hashes.
|
|
232
252
|
# Each hash: { name:, ref:, cache_id:, fields:, row_fields:, col_fields:, data_fields:, cache: }
|
|
233
253
|
def pivot_tables: (?sheet: untyped) -> untyped
|
|
@@ -23,6 +23,14 @@ module Xlsxrb
|
|
|
23
23
|
|
|
24
24
|
attr_reader full_calc_on_load: untyped
|
|
25
25
|
|
|
26
|
+
attr_reader first_sheet: untyped
|
|
27
|
+
|
|
28
|
+
attr_reader show_sheet_tabs: untyped
|
|
29
|
+
|
|
30
|
+
attr_reader tab_ratio: untyped
|
|
31
|
+
|
|
32
|
+
attr_reader code_name: untyped
|
|
33
|
+
|
|
26
34
|
def initialize: () -> untyped
|
|
27
35
|
|
|
28
36
|
def start_element: (untyped _uri, untyped localname, untyped _qname, untyped attrs) -> untyped
|
|
@@ -22,13 +22,13 @@ module Xlsxrb
|
|
|
22
22
|
alias << write
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
-
def self.write: (untyped target, sheets: untyped, ?shared_strings: untyped, ?shared_strings_index: untyped, ?styles: untyped, ?defined_names: untyped, ?core_properties: untyped, ?app_properties: untyped, ?custom_properties: untyped, ?workbook_protection: untyped, ?workbook_properties: untyped) -> untyped
|
|
25
|
+
def self.write: (untyped target, sheets: untyped, ?shared_strings: untyped, ?shared_strings_index: untyped, ?styles: untyped, ?defined_names: untyped, ?core_properties: untyped, ?app_properties: untyped, ?custom_properties: untyped, ?workbook_protection: untyped, ?workbook_properties: untyped, ?compression_level: untyped) -> untyped
|
|
26
26
|
|
|
27
|
-
def initialize: (sheets: untyped, ?shared_strings: untyped, ?shared_strings_index: untyped, ?styles: untyped, ?defined_names: untyped, ?core_properties: untyped, ?app_properties: untyped, ?custom_properties: untyped, ?workbook_protection: untyped, ?workbook_properties: untyped) -> untyped
|
|
27
|
+
def initialize: (sheets: untyped, ?shared_strings: untyped, ?shared_strings_index: untyped, ?styles: untyped, ?defined_names: untyped, ?core_properties: untyped, ?app_properties: untyped, ?custom_properties: untyped, ?workbook_protection: untyped, ?workbook_properties: untyped, ?compression_level: untyped) -> untyped
|
|
28
28
|
|
|
29
29
|
def write_to: (untyped target) -> untyped
|
|
30
30
|
|
|
31
|
-
def prepare_sheet_auxiliary: (untyped sheet, untyped
|
|
31
|
+
def prepare_sheet_auxiliary: (untyped sheet, untyped idx) -> untyped
|
|
32
32
|
|
|
33
33
|
def write_auxiliary_parts: (untyped zip) -> untyped
|
|
34
34
|
|
|
@@ -80,7 +80,7 @@ module Xlsxrb
|
|
|
80
80
|
|
|
81
81
|
def write_shared_strings_xml: (untyped zip) -> untyped
|
|
82
82
|
|
|
83
|
-
def write_worksheet_xml: (untyped io, untyped sheet, ?drawing_rid: untyped, ?sheet_protection: untyped, ?protected_ranges: untyped, ?auto_filter: untyped, ?filter_columns: untyped, ?sort_state: untyped, ?merge_cells: untyped, ?conditional_formats: untyped, ?data_validations: untyped, ?hyperlinks: untyped, ?print_options: untyped, ?page_margins: untyped, ?page_setup: untyped, ?header_footer: untyped, ?row_breaks: untyped, ?col_breaks: untyped, ?cell_watches: untyped, ?freeze_pane: untyped, ?split_pane: untyped, ?selection: untyped, ?sheet_view: untyped, ?sheet_properties: untyped, ?sheet_format: untyped, ?tables: untyped, ?table_start_rid: untyped, ?legacy_drawing_rid: untyped, ?sparkline_groups: untyped) -> untyped
|
|
83
|
+
def write_worksheet_xml: (untyped io, untyped sheet, ?drawing_rid: untyped, ?picture_rid: untyped, ?sheet_protection: untyped, ?protected_ranges: untyped, ?auto_filter: untyped, ?filter_columns: untyped, ?sort_state: untyped, ?merge_cells: untyped, ?conditional_formats: untyped, ?data_validations: untyped, ?hyperlinks: untyped, ?print_options: untyped, ?page_margins: untyped, ?page_setup: untyped, ?header_footer: untyped, ?row_breaks: untyped, ?col_breaks: untyped, ?column_breaks: untyped, ?cell_watches: untyped, ?ignored_errors: untyped, ?freeze_pane: untyped, ?split_pane: untyped, ?selection: untyped, ?sheet_view: untyped, ?sheet_properties: untyped, ?sheet_format: untyped, ?tables: untyped, ?table_start_rid: untyped, ?legacy_drawing_rid: untyped, ?sparkline_groups: untyped, ?phonetic_pr: untyped, ?sheet_calc_pr: untyped) -> untyped
|
|
84
84
|
|
|
85
85
|
def build_table_xml: (untyped tbl, untyped table_id) -> untyped
|
|
86
86
|
|
|
@@ -89,6 +89,10 @@ module Xlsxrb
|
|
|
89
89
|
def build_app_properties_xml: () -> untyped
|
|
90
90
|
|
|
91
91
|
def build_custom_properties_xml: () -> untyped
|
|
92
|
+
|
|
93
|
+
def resolve_active_tab_index: () -> untyped
|
|
94
|
+
|
|
95
|
+
def resolve_first_sheet_index: () -> untyped
|
|
92
96
|
end
|
|
93
97
|
end
|
|
94
98
|
end
|
|
@@ -45,7 +45,7 @@ module Xlsxrb
|
|
|
45
45
|
# Extract an attribute value from a small tag substring (bounded search).
|
|
46
46
|
def self.tag_attr: (untyped tag, untyped prefix) -> untyped
|
|
47
47
|
|
|
48
|
-
def self.fast_scan_cells_events: (untyped xml, untyped from, untyped to, untyped shared_strings, untyped row_source, ?untyped prefix) ?{ (?) -> untyped } -> untyped
|
|
48
|
+
def self.fast_scan_cells_events: (untyped xml, untyped from, untyped to, untyped shared_strings, untyped row_source, ?untyped prefix, ?untyped shared_masters) ?{ (?) -> untyped } -> untyped
|
|
49
49
|
|
|
50
50
|
def self.extract_inline_text: (untyped xml, untyped from, untyped to) -> untyped
|
|
51
51
|
|
|
@@ -36,7 +36,7 @@ module Xlsxrb
|
|
|
36
36
|
|
|
37
37
|
# Write the worksheet footer. Call once after all rows.
|
|
38
38
|
# Options for post-sheetData elements (in OOXML order):
|
|
39
|
-
def finish: (?drawing_rid: untyped, ?sheet_protection: untyped, ?protected_ranges: untyped, ?auto_filter: untyped, ?filter_columns: untyped, ?sort_state: untyped, ?merge_cells: untyped, ?conditional_formats: untyped, ?data_validations: untyped, ?hyperlinks: untyped, ?print_options: untyped, ?page_margins: untyped, ?page_setup: untyped, ?header_footer: untyped, ?row_breaks: untyped, ?col_breaks: untyped, ?cell_watches: untyped, ?tables: untyped, ?table_start_rid: untyped, ?legacy_drawing_rid: untyped, ?sparkline_groups: untyped) -> untyped
|
|
39
|
+
def finish: (?drawing_rid: untyped, ?picture_rid: untyped, ?sheet_protection: untyped, ?protected_ranges: untyped, ?auto_filter: untyped, ?filter_columns: untyped, ?sort_state: untyped, ?merge_cells: untyped, ?conditional_formats: untyped, ?data_validations: untyped, ?hyperlinks: untyped, ?print_options: untyped, ?page_margins: untyped, ?page_setup: untyped, ?header_footer: untyped, ?row_breaks: untyped, ?col_breaks: untyped, ?column_breaks: untyped, ?cell_watches: untyped, ?ignored_errors: untyped, ?tables: untyped, ?table_start_rid: untyped, ?legacy_drawing_rid: untyped, ?sparkline_groups: untyped, ?phonetic_pr: untyped, ?sheet_calc_pr: untyped) -> untyped
|
|
40
40
|
|
|
41
41
|
private
|
|
42
42
|
|
|
@@ -44,6 +44,8 @@ module Xlsxrb
|
|
|
44
44
|
|
|
45
45
|
def write_sheet_properties: (untyped props) -> untyped
|
|
46
46
|
|
|
47
|
+
def build_tab_color_attrs: (untyped props) -> untyped
|
|
48
|
+
|
|
47
49
|
def write_sheet_views: (?freeze_pane: untyped, ?split_pane: untyped, ?selection: untyped, ?sheet_view: untyped) -> untyped
|
|
48
50
|
|
|
49
51
|
def write_sheet_format_pr: (untyped fmt) -> untyped
|
|
@@ -78,6 +80,12 @@ module Xlsxrb
|
|
|
78
80
|
|
|
79
81
|
def write_cell_watches: (untyped watches) -> untyped
|
|
80
82
|
|
|
83
|
+
def write_ignored_errors: (untyped errors) -> untyped
|
|
84
|
+
|
|
85
|
+
def write_phonetic_pr: (untyped props) -> untyped
|
|
86
|
+
|
|
87
|
+
def write_sheet_calc_pr: (untyped props) -> untyped
|
|
88
|
+
|
|
81
89
|
def write_table_parts: (untyped tables, untyped start_rid) -> untyped
|
|
82
90
|
|
|
83
91
|
def write_sparklines: (untyped groups) -> untyped
|
|
@@ -96,6 +104,9 @@ module Xlsxrb
|
|
|
96
104
|
|
|
97
105
|
def column_letter: (untyped index) -> untyped
|
|
98
106
|
|
|
107
|
+
# : (String buf, Elements::RichText rich_text) -> void
|
|
108
|
+
def write_inline_rich_text: (String buf, Elements::RichText rich_text) -> void
|
|
109
|
+
|
|
99
110
|
INVALID_XML_CHARS_RE: ::Regexp
|
|
100
111
|
|
|
101
112
|
ESCAPE_RE: ::Regexp
|
|
@@ -62,6 +62,8 @@ module Xlsxrb
|
|
|
62
62
|
# : (untyped rotation, untyped font) -> ("" | ::String)
|
|
63
63
|
def build_axis_txpr: (untyped rotation, untyped font) -> untyped
|
|
64
64
|
|
|
65
|
+
def build_val_ax_xml: (ax_id: untyped, prefix: untyped, chart: untyped, ?default_pos: untyped, ?default_crosses: untyped) -> untyped
|
|
66
|
+
|
|
65
67
|
# : (untyped chart) -> untyped
|
|
66
68
|
def generate_chart_xml: (untyped chart) -> untyped
|
|
67
69
|
|
|
@@ -73,6 +75,20 @@ module Xlsxrb
|
|
|
73
75
|
|
|
74
76
|
# : (untyped cell_ref) -> (::Array[0] | ::Array[untyped])
|
|
75
77
|
def cell_to_col_row: (untyped cell_ref) -> untyped
|
|
78
|
+
|
|
79
|
+
THREADED_COMMENTS_NS: ::String
|
|
80
|
+
|
|
81
|
+
# Formats or generates a GUID in standard uppercase braced format {UUID}.
|
|
82
|
+
# : (?String? val) -> String
|
|
83
|
+
def format_guid: (?untyped val) -> untyped
|
|
84
|
+
|
|
85
|
+
# Generates XML for xl/threadedComments/threadedComment{N}.xml.
|
|
86
|
+
# : (Array[Hash[Symbol, untyped]] sheet_threaded_comments) -> String
|
|
87
|
+
def generate_threaded_comments_xml: (untyped sheet_threaded_comments) -> untyped
|
|
88
|
+
|
|
89
|
+
# Generates XML for xl/persons/person.xml.
|
|
90
|
+
# : (Array[Hash[Symbol, untyped]] persons) -> String
|
|
91
|
+
def generate_persons_xml: (untyped persons) -> untyped
|
|
76
92
|
end
|
|
77
93
|
end
|
|
78
94
|
end
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Xlsxrb
|
|
4
4
|
module Ooxml
|
|
5
5
|
# Writes spreadsheet data into an XLSX file.
|
|
6
|
+
#
|
|
7
|
+
# @api private
|
|
6
8
|
class Writer
|
|
7
9
|
include DrawingXml
|
|
8
10
|
|
|
@@ -48,8 +50,10 @@ module Xlsxrb
|
|
|
48
50
|
|
|
49
51
|
attr_reader num_fmts: untyped
|
|
50
52
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
attr_reader dxfs: untyped
|
|
54
|
+
|
|
55
|
+
# : (?default_font: untyped?) -> void
|
|
56
|
+
def initialize: (?default_font: untyped) -> untyped
|
|
53
57
|
|
|
54
58
|
# Adds a new sheet. Raises if name is already taken.
|
|
55
59
|
# : (untyped name) -> untyped
|
|
@@ -208,6 +212,19 @@ module Xlsxrb
|
|
|
208
212
|
# : (**untyped opts) -> untyped
|
|
209
213
|
def add_dxf: (**untyped opts) -> untyped
|
|
210
214
|
|
|
215
|
+
# Sets the workbook-wide default font (font 0).
|
|
216
|
+
#
|
|
217
|
+
# @param name [String, Hash, nil] Font name or font options Hash.
|
|
218
|
+
# @param size [Float, Integer, nil] Font size in points.
|
|
219
|
+
# @param opts [Hash] Additional font options (e.g. `bold:`, `italic:`, `family:`, `charset:`, `color:`).
|
|
220
|
+
# @return [void]
|
|
221
|
+
# @api public
|
|
222
|
+
# : (?String | Hash[Symbol, untyped]? name, ?Float | Integer | nil size, **untyped opts) -> void
|
|
223
|
+
def default_font: (?String | Hash[Symbol, untyped]? name, ?Float | Integer | nil size, **untyped opts) -> void
|
|
224
|
+
|
|
225
|
+
# @deprecated Use {#default_font} instead. Will be removed in 0.2.0.
|
|
226
|
+
alias set_default_font default_font
|
|
227
|
+
|
|
211
228
|
# Sets the indexed colors palette (array of ARGB hex strings, e.g. ["FF000000", "FFFFFFFF"]).
|
|
212
229
|
# rubocop:disable Naming/AccessorMethodName
|
|
213
230
|
# : (untyped colors) -> untyped
|
|
@@ -382,8 +399,8 @@ module Xlsxrb
|
|
|
382
399
|
# Adds a conditional formatting rule to the specified range.
|
|
383
400
|
# Options: type (:cell_is, :expression, :color_scale, :data_bar, :icon_set),
|
|
384
401
|
# operator, priority, formula/formulas, format_id, color_scale, data_bar, icon_set.
|
|
385
|
-
# : (untyped sqref, ?sheet: untyped?, **untyped opts) -> untyped
|
|
386
|
-
def add_conditional_format: (untyped sqref, ?sheet: untyped, **untyped opts) -> untyped
|
|
402
|
+
# : (?untyped sqref, ?sheet: untyped?, **untyped opts) ?{ (ConditionalFormatBuilder) -> void } -> untyped
|
|
403
|
+
def add_conditional_format: (?untyped sqref, ?sheet: untyped, **untyped opts) ?{ (?) -> untyped } -> untyped
|
|
387
404
|
|
|
388
405
|
# Returns conditional formatting rules for the first (or given) sheet.
|
|
389
406
|
# : (?sheet: untyped?) -> untyped
|
|
@@ -571,8 +588,8 @@ module Xlsxrb
|
|
|
571
588
|
# Adds a chart to the given sheet.
|
|
572
589
|
# type: :bar, :line, :pie. title: chart title string.
|
|
573
590
|
# data_ref: e.g. "Sheet1!$A$1:$B$4". cat_ref/val_ref for explicit series.
|
|
574
|
-
# : (?type: ::Symbol, ?title: untyped?, ?title_overlay: untyped?, ?title_font: untyped?, ?title_fill_color: untyped?, ?title_no_fill: untyped?, ?title_line_color: untyped?, ?title_line_width: untyped?, ?title_line_dash: untyped?, ?title_rotation: untyped?, ?auto_title_deleted: untyped?, ?cat_ref: untyped?, ?val_ref: untyped?, ?series: untyped?, ?legend: untyped?, ?data_labels: untyped?, ?cat_axis_title: untyped?, ?val_axis_title: untyped?, ?cat_axis_title_font: untyped?, ?cat_axis_title_fill: untyped?, ?cat_axis_title_no_fill: untyped?, ?cat_axis_title_line_color: untyped?, ?cat_axis_title_line_width: untyped?, ?cat_axis_title_line_dash: untyped?, ?cat_axis_title_rotation: untyped?, ?val_axis_title_font: untyped?, ?val_axis_title_fill: untyped?, ?val_axis_title_no_fill: untyped?, ?val_axis_title_line_color: untyped?, ?val_axis_title_line_width: untyped?, ?val_axis_title_line_dash: untyped?, ?val_axis_title_rotation: untyped?, ?cat_axis_tick_lbl_pos: untyped?, ?val_axis_tick_lbl_pos: untyped?, ?cat_axis_major_gridlines: untyped?, ?val_axis_major_gridlines: untyped?, ?cat_axis_minor_gridlines: untyped?, ?val_axis_minor_gridlines: untyped?, ?cat_axis_delete: untyped?, ?val_axis_delete: untyped?, ?cat_axis_orientation: untyped?, ?val_axis_orientation: untyped?, ?cat_axis_num_fmt: untyped?, ?val_axis_num_fmt: untyped?, ?cat_axis_major_tick_mark: untyped?, ?cat_axis_minor_tick_mark: untyped?, ?val_axis_major_tick_mark: untyped?, ?val_axis_minor_tick_mark: untyped?, ?cat_axis_crosses: untyped?, ?val_axis_crosses: untyped?, ?cat_axis_crosses_at: untyped?, ?val_axis_crosses_at: untyped?, ?cat_axis_tick_lbl_skip: untyped?, ?cat_axis_tick_mark_skip: untyped?, ?cat_axis_lbl_offset: untyped?, ?cat_axis_auto: untyped?, ?cat_axis_lbl_algn: untyped?, ?cat_axis_no_multi_lvl_lbl: untyped?, ?val_axis_cross_between: untyped?, ?val_axis_major_unit: untyped?, ?val_axis_minor_unit: untyped?, ?cat_axis_scaling_max: untyped?, ?cat_axis_scaling_min: untyped?, ?val_axis_scaling_max: untyped?, ?val_axis_scaling_min: untyped?, ?cat_axis_log_base: untyped?, ?val_axis_log_base: untyped?, ?val_axis_disp_units: untyped?, ?gap_width: untyped?, ?gap_depth: untyped?, ?overlap: untyped?, ?first_slice_ang: untyped?, ?hole_size: untyped?, ?smooth: untyped?, ?marker: untyped?, ?scatter_style: untyped?, ?radar_style: untyped?, ?bar_shape: untyped?, ?bubble_3d: untyped?, ?bubble_scale: untyped?, ?show_neg_bubbles: untyped?, ?size_represents: untyped?, ?wireframe: untyped?, ?grouping: untyped?, ?bar_dir: untyped?, ?vary_colors: untyped?, ?style: untyped?, ?rounded_corners: untyped?, ?view_3d: untyped?, ?cat_axis_pos: untyped?, ?val_axis_pos: untyped?, ?name: untyped?, ?description: untyped?, ?frame_title: untyped?, ?frame_hidden: untyped?, ?frame_macro: untyped?, ?frame_no_grp: untyped?, ?from_col: ::Integer, ?from_row: ::Integer, ?to_col: ::Integer, ?to_row: ::Integer, ?from_col_off: untyped?, ?from_row_off: untyped?, ?to_col_off: untyped?, ?to_row_off: untyped?, ?edit_as: untyped?, ?published: untyped?, ?locks_with_sheet: untyped?, ?prints_with_sheet: untyped?, ?plot_vis_only: untyped?, ?disp_blanks_as: untyped?, ?show_d_lbls_over_max: untyped?, ?data_table: untyped?, ?plot_area_fill: untyped?, ?plot_area_no_fill: untyped?, ?plot_area_line_color: untyped?, ?plot_area_line_width: untyped?, ?plot_area_line_dash: untyped?, ?plot_area_layout: untyped?, ?floor: untyped?, ?side_wall: untyped?, ?back_wall: untyped?, ?drop_lines: untyped?, ?hi_low_lines: untyped?, ?ser_lines: untyped?, ?up_down_bars: untyped?, ?band_fmts: untyped?, ?of_pie_type: untyped?, ?split_type: untyped?, ?split_pos: untyped?, ?cust_split: untyped?, ?second_pie_size: untyped?, ?cat_axis_label_rotation: untyped?, ?val_axis_label_rotation: untyped?, ?cat_axis_font: untyped?, ?val_axis_font: untyped?, ?cat_axis_line_color: untyped?, ?cat_axis_line_width: untyped?, ?cat_axis_line_dash: untyped?, ?val_axis_line_color: untyped?, ?val_axis_line_width: untyped?, ?val_axis_line_dash: untyped?, ?cat_axis_fill: untyped?, ?cat_axis_no_fill: untyped?, ?val_axis_fill: untyped?, ?val_axis_no_fill: untyped?, ?cat_axis_type: untyped?, ?cat_axis_base_time_unit: untyped?, ?cat_axis_major_time_unit: untyped?, ?cat_axis_minor_time_unit: untyped?, ?cat_axis_major_unit: untyped?, ?cat_axis_minor_unit: untyped?, ?chart_fill: untyped?, ?chart_no_fill: untyped?, ?chart_line_color: untyped?, ?chart_line_width: untyped?, ?chart_line_dash: untyped?, ?protection: untyped?, ?print_settings: untyped?, ?chart_font: untyped?, ?sheet: untyped
|
|
575
|
-
def add_chart: (?type: untyped, ?title: untyped, ?title_overlay: untyped, ?title_font: untyped, ?title_fill_color: untyped, ?title_no_fill: untyped, ?title_line_color: untyped, ?title_line_width: untyped, ?title_line_dash: untyped, ?title_rotation: untyped, ?auto_title_deleted: untyped, ?cat_ref: untyped, ?val_ref: untyped, ?series: untyped, ?legend: untyped, ?data_labels: untyped, ?cat_axis_title: untyped, ?val_axis_title: untyped, ?cat_axis_title_font: untyped, ?cat_axis_title_fill: untyped, ?cat_axis_title_no_fill: untyped, ?cat_axis_title_line_color: untyped, ?cat_axis_title_line_width: untyped, ?cat_axis_title_line_dash: untyped, ?cat_axis_title_rotation: untyped, ?val_axis_title_font: untyped, ?val_axis_title_fill: untyped, ?val_axis_title_no_fill: untyped, ?val_axis_title_line_color: untyped, ?val_axis_title_line_width: untyped, ?val_axis_title_line_dash: untyped, ?val_axis_title_rotation: untyped, ?cat_axis_tick_lbl_pos: untyped, ?val_axis_tick_lbl_pos: untyped, ?cat_axis_major_gridlines: untyped, ?val_axis_major_gridlines: untyped, ?cat_axis_minor_gridlines: untyped, ?val_axis_minor_gridlines: untyped, ?cat_axis_delete: untyped, ?val_axis_delete: untyped, ?cat_axis_orientation: untyped, ?val_axis_orientation: untyped, ?cat_axis_num_fmt: untyped, ?val_axis_num_fmt: untyped, ?cat_axis_major_tick_mark: untyped, ?cat_axis_minor_tick_mark: untyped, ?val_axis_major_tick_mark: untyped, ?val_axis_minor_tick_mark: untyped, ?cat_axis_crosses: untyped, ?val_axis_crosses: untyped, ?cat_axis_crosses_at: untyped, ?val_axis_crosses_at: untyped, ?cat_axis_tick_lbl_skip: untyped, ?cat_axis_tick_mark_skip: untyped, ?cat_axis_lbl_offset: untyped, ?cat_axis_auto: untyped, ?cat_axis_lbl_algn: untyped, ?cat_axis_no_multi_lvl_lbl: untyped, ?val_axis_cross_between: untyped, ?val_axis_major_unit: untyped, ?val_axis_minor_unit: untyped, ?cat_axis_scaling_max: untyped, ?cat_axis_scaling_min: untyped, ?val_axis_scaling_max: untyped, ?val_axis_scaling_min: untyped, ?cat_axis_log_base: untyped, ?val_axis_log_base: untyped, ?val_axis_disp_units: untyped, ?gap_width: untyped, ?gap_depth: untyped, ?overlap: untyped, ?first_slice_ang: untyped, ?hole_size: untyped, ?smooth: untyped, ?marker: untyped, ?scatter_style: untyped, ?radar_style: untyped, ?bar_shape: untyped, ?bubble_3d: untyped, ?bubble_scale: untyped, ?show_neg_bubbles: untyped, ?size_represents: untyped, ?wireframe: untyped, ?grouping: untyped, ?bar_dir: untyped, ?vary_colors: untyped, ?style: untyped, ?rounded_corners: untyped, ?view_3d: untyped, ?cat_axis_pos: untyped, ?val_axis_pos: untyped, ?name: untyped, ?description: untyped, ?frame_title: untyped, ?frame_hidden: untyped, ?frame_macro: untyped, ?frame_no_grp: untyped, ?from_col: untyped, ?from_row: untyped, ?to_col: untyped, ?to_row: untyped, ?from_col_off: untyped, ?from_row_off: untyped, ?to_col_off: untyped, ?to_row_off: untyped, ?edit_as: untyped, ?published: untyped, ?locks_with_sheet: untyped, ?prints_with_sheet: untyped, ?plot_vis_only: untyped, ?disp_blanks_as: untyped, ?show_d_lbls_over_max: untyped, ?data_table: untyped, ?plot_area_fill: untyped, ?plot_area_no_fill: untyped, ?plot_area_line_color: untyped, ?plot_area_line_width: untyped, ?plot_area_line_dash: untyped, ?plot_area_layout: untyped, ?floor: untyped, ?side_wall: untyped, ?back_wall: untyped, ?drop_lines: untyped, ?hi_low_lines: untyped, ?ser_lines: untyped, ?up_down_bars: untyped, ?band_fmts: untyped, ?of_pie_type: untyped, ?split_type: untyped, ?split_pos: untyped, ?cust_split: untyped, ?second_pie_size: untyped, ?cat_axis_label_rotation: untyped, ?val_axis_label_rotation: untyped, ?cat_axis_font: untyped, ?val_axis_font: untyped, ?cat_axis_line_color: untyped, ?cat_axis_line_width: untyped, ?cat_axis_line_dash: untyped, ?val_axis_line_color: untyped, ?val_axis_line_width: untyped, ?val_axis_line_dash: untyped, ?cat_axis_fill: untyped, ?cat_axis_no_fill: untyped, ?val_axis_fill: untyped, ?val_axis_no_fill: untyped, ?cat_axis_type: untyped, ?cat_axis_base_time_unit: untyped, ?cat_axis_major_time_unit: untyped, ?cat_axis_minor_time_unit: untyped, ?cat_axis_major_unit: untyped, ?cat_axis_minor_unit: untyped, ?chart_fill: untyped, ?chart_no_fill: untyped, ?chart_line_color: untyped, ?chart_line_width: untyped, ?chart_line_dash: untyped, ?protection: untyped, ?print_settings: untyped, ?chart_font: untyped, ?sheet: untyped) -> untyped
|
|
591
|
+
# : (?type: ::Symbol, ?title: untyped?, ?title_overlay: untyped?, ?title_font: untyped?, ?title_fill_color: untyped?, ?title_no_fill: untyped?, ?title_line_color: untyped?, ?title_line_width: untyped?, ?title_line_dash: untyped?, ?title_rotation: untyped?, ?auto_title_deleted: untyped?, ?cat_ref: untyped?, ?val_ref: untyped?, ?series: untyped?, ?legend: untyped?, ?data_labels: untyped?, ?cat_axis_title: untyped?, ?val_axis_title: untyped?, ?cat_axis_title_font: untyped?, ?cat_axis_title_fill: untyped?, ?cat_axis_title_no_fill: untyped?, ?cat_axis_title_line_color: untyped?, ?cat_axis_title_line_width: untyped?, ?cat_axis_title_line_dash: untyped?, ?cat_axis_title_rotation: untyped?, ?val_axis_title_font: untyped?, ?val_axis_title_fill: untyped?, ?val_axis_title_no_fill: untyped?, ?val_axis_title_line_color: untyped?, ?val_axis_title_line_width: untyped?, ?val_axis_title_line_dash: untyped?, ?val_axis_title_rotation: untyped?, ?cat_axis_tick_lbl_pos: untyped?, ?val_axis_tick_lbl_pos: untyped?, ?cat_axis_major_gridlines: untyped?, ?val_axis_major_gridlines: untyped?, ?cat_axis_minor_gridlines: untyped?, ?val_axis_minor_gridlines: untyped?, ?cat_axis_delete: untyped?, ?val_axis_delete: untyped?, ?cat_axis_orientation: untyped?, ?val_axis_orientation: untyped?, ?cat_axis_num_fmt: untyped?, ?val_axis_num_fmt: untyped?, ?cat_axis_major_tick_mark: untyped?, ?cat_axis_minor_tick_mark: untyped?, ?val_axis_major_tick_mark: untyped?, ?val_axis_minor_tick_mark: untyped?, ?cat_axis_crosses: untyped?, ?val_axis_crosses: untyped?, ?cat_axis_crosses_at: untyped?, ?val_axis_crosses_at: untyped?, ?cat_axis_tick_lbl_skip: untyped?, ?cat_axis_tick_mark_skip: untyped?, ?cat_axis_lbl_offset: untyped?, ?cat_axis_auto: untyped?, ?cat_axis_lbl_algn: untyped?, ?cat_axis_no_multi_lvl_lbl: untyped?, ?val_axis_cross_between: untyped?, ?val_axis_major_unit: untyped?, ?val_axis_minor_unit: untyped?, ?cat_axis_scaling_max: untyped?, ?cat_axis_scaling_min: untyped?, ?val_axis_scaling_max: untyped?, ?val_axis_scaling_min: untyped?, ?cat_axis_log_base: untyped?, ?val_axis_log_base: untyped?, ?val_axis_disp_units: untyped?, ?gap_width: untyped?, ?gap_depth: untyped?, ?overlap: untyped?, ?first_slice_ang: untyped?, ?hole_size: untyped?, ?smooth: untyped?, ?marker: untyped?, ?scatter_style: untyped?, ?radar_style: untyped?, ?bar_shape: untyped?, ?bubble_3d: untyped?, ?bubble_scale: untyped?, ?show_neg_bubbles: untyped?, ?size_represents: untyped?, ?wireframe: untyped?, ?grouping: untyped?, ?bar_dir: untyped?, ?vary_colors: untyped?, ?style: untyped?, ?rounded_corners: untyped?, ?view_3d: untyped?, ?cat_axis_pos: untyped?, ?val_axis_pos: untyped?, ?name: untyped?, ?description: untyped?, ?frame_title: untyped?, ?frame_hidden: untyped?, ?frame_macro: untyped?, ?frame_no_grp: untyped?, ?from_col: ::Integer, ?from_row: ::Integer, ?to_col: ::Integer, ?to_row: ::Integer, ?from_col_off: untyped?, ?from_row_off: untyped?, ?to_col_off: untyped?, ?to_row_off: untyped?, ?edit_as: untyped?, ?published: untyped?, ?locks_with_sheet: untyped?, ?prints_with_sheet: untyped?, ?plot_vis_only: untyped?, ?disp_blanks_as: untyped?, ?show_d_lbls_over_max: untyped?, ?data_table: untyped?, ?plot_area_fill: untyped?, ?plot_area_no_fill: untyped?, ?plot_area_line_color: untyped?, ?plot_area_line_width: untyped?, ?plot_area_line_dash: untyped?, ?plot_area_layout: untyped?, ?floor: untyped?, ?side_wall: untyped?, ?back_wall: untyped?, ?drop_lines: untyped?, ?hi_low_lines: untyped?, ?ser_lines: untyped?, ?up_down_bars: untyped?, ?band_fmts: untyped?, ?of_pie_type: untyped?, ?split_type: untyped?, ?split_pos: untyped?, ?cust_split: untyped?, ?second_pie_size: untyped?, ?cat_axis_label_rotation: untyped?, ?val_axis_label_rotation: untyped?, ?cat_axis_font: untyped?, ?val_axis_font: untyped?, ?cat_axis_line_color: untyped?, ?cat_axis_line_width: untyped?, ?cat_axis_line_dash: untyped?, ?val_axis_line_color: untyped?, ?val_axis_line_width: untyped?, ?val_axis_line_dash: untyped?, ?cat_axis_fill: untyped?, ?cat_axis_no_fill: untyped?, ?val_axis_fill: untyped?, ?val_axis_no_fill: untyped?, ?cat_axis_type: untyped?, ?cat_axis_base_time_unit: untyped?, ?cat_axis_major_time_unit: untyped?, ?cat_axis_minor_time_unit: untyped?, ?cat_axis_major_unit: untyped?, ?cat_axis_minor_unit: untyped?, ?chart_fill: untyped?, ?chart_no_fill: untyped?, ?chart_line_color: untyped?, ?chart_line_width: untyped?, ?chart_line_dash: untyped?, ?protection: untyped?, ?print_settings: untyped?, ?chart_font: untyped?, ?secondary_value_axis: untyped?, ?secondary_axis: untyped?, ?category_axis: untyped?, ?value_axis: untyped?, ?sheet: untyped?, **untyped extra_options) -> untyped
|
|
592
|
+
def add_chart: (?type: untyped, ?title: untyped, ?title_overlay: untyped, ?title_font: untyped, ?title_fill_color: untyped, ?title_no_fill: untyped, ?title_line_color: untyped, ?title_line_width: untyped, ?title_line_dash: untyped, ?title_rotation: untyped, ?auto_title_deleted: untyped, ?cat_ref: untyped, ?val_ref: untyped, ?series: untyped, ?legend: untyped, ?data_labels: untyped, ?cat_axis_title: untyped, ?val_axis_title: untyped, ?cat_axis_title_font: untyped, ?cat_axis_title_fill: untyped, ?cat_axis_title_no_fill: untyped, ?cat_axis_title_line_color: untyped, ?cat_axis_title_line_width: untyped, ?cat_axis_title_line_dash: untyped, ?cat_axis_title_rotation: untyped, ?val_axis_title_font: untyped, ?val_axis_title_fill: untyped, ?val_axis_title_no_fill: untyped, ?val_axis_title_line_color: untyped, ?val_axis_title_line_width: untyped, ?val_axis_title_line_dash: untyped, ?val_axis_title_rotation: untyped, ?cat_axis_tick_lbl_pos: untyped, ?val_axis_tick_lbl_pos: untyped, ?cat_axis_major_gridlines: untyped, ?val_axis_major_gridlines: untyped, ?cat_axis_minor_gridlines: untyped, ?val_axis_minor_gridlines: untyped, ?cat_axis_delete: untyped, ?val_axis_delete: untyped, ?cat_axis_orientation: untyped, ?val_axis_orientation: untyped, ?cat_axis_num_fmt: untyped, ?val_axis_num_fmt: untyped, ?cat_axis_major_tick_mark: untyped, ?cat_axis_minor_tick_mark: untyped, ?val_axis_major_tick_mark: untyped, ?val_axis_minor_tick_mark: untyped, ?cat_axis_crosses: untyped, ?val_axis_crosses: untyped, ?cat_axis_crosses_at: untyped, ?val_axis_crosses_at: untyped, ?cat_axis_tick_lbl_skip: untyped, ?cat_axis_tick_mark_skip: untyped, ?cat_axis_lbl_offset: untyped, ?cat_axis_auto: untyped, ?cat_axis_lbl_algn: untyped, ?cat_axis_no_multi_lvl_lbl: untyped, ?val_axis_cross_between: untyped, ?val_axis_major_unit: untyped, ?val_axis_minor_unit: untyped, ?cat_axis_scaling_max: untyped, ?cat_axis_scaling_min: untyped, ?val_axis_scaling_max: untyped, ?val_axis_scaling_min: untyped, ?cat_axis_log_base: untyped, ?val_axis_log_base: untyped, ?val_axis_disp_units: untyped, ?gap_width: untyped, ?gap_depth: untyped, ?overlap: untyped, ?first_slice_ang: untyped, ?hole_size: untyped, ?smooth: untyped, ?marker: untyped, ?scatter_style: untyped, ?radar_style: untyped, ?bar_shape: untyped, ?bubble_3d: untyped, ?bubble_scale: untyped, ?show_neg_bubbles: untyped, ?size_represents: untyped, ?wireframe: untyped, ?grouping: untyped, ?bar_dir: untyped, ?vary_colors: untyped, ?style: untyped, ?rounded_corners: untyped, ?view_3d: untyped, ?cat_axis_pos: untyped, ?val_axis_pos: untyped, ?name: untyped, ?description: untyped, ?frame_title: untyped, ?frame_hidden: untyped, ?frame_macro: untyped, ?frame_no_grp: untyped, ?from_col: untyped, ?from_row: untyped, ?to_col: untyped, ?to_row: untyped, ?from_col_off: untyped, ?from_row_off: untyped, ?to_col_off: untyped, ?to_row_off: untyped, ?edit_as: untyped, ?published: untyped, ?locks_with_sheet: untyped, ?prints_with_sheet: untyped, ?plot_vis_only: untyped, ?disp_blanks_as: untyped, ?show_d_lbls_over_max: untyped, ?data_table: untyped, ?plot_area_fill: untyped, ?plot_area_no_fill: untyped, ?plot_area_line_color: untyped, ?plot_area_line_width: untyped, ?plot_area_line_dash: untyped, ?plot_area_layout: untyped, ?floor: untyped, ?side_wall: untyped, ?back_wall: untyped, ?drop_lines: untyped, ?hi_low_lines: untyped, ?ser_lines: untyped, ?up_down_bars: untyped, ?band_fmts: untyped, ?of_pie_type: untyped, ?split_type: untyped, ?split_pos: untyped, ?cust_split: untyped, ?second_pie_size: untyped, ?cat_axis_label_rotation: untyped, ?val_axis_label_rotation: untyped, ?cat_axis_font: untyped, ?val_axis_font: untyped, ?cat_axis_line_color: untyped, ?cat_axis_line_width: untyped, ?cat_axis_line_dash: untyped, ?val_axis_line_color: untyped, ?val_axis_line_width: untyped, ?val_axis_line_dash: untyped, ?cat_axis_fill: untyped, ?cat_axis_no_fill: untyped, ?val_axis_fill: untyped, ?val_axis_no_fill: untyped, ?cat_axis_type: untyped, ?cat_axis_base_time_unit: untyped, ?cat_axis_major_time_unit: untyped, ?cat_axis_minor_time_unit: untyped, ?cat_axis_major_unit: untyped, ?cat_axis_minor_unit: untyped, ?chart_fill: untyped, ?chart_no_fill: untyped, ?chart_line_color: untyped, ?chart_line_width: untyped, ?chart_line_dash: untyped, ?protection: untyped, ?print_settings: untyped, ?chart_font: untyped, ?secondary_value_axis: untyped, ?secondary_axis: untyped, ?category_axis: untyped, ?value_axis: untyped, ?sheet: untyped, **untyped extra_options) -> untyped
|
|
576
593
|
|
|
577
594
|
# Returns chart definitions for the first (or given) sheet.
|
|
578
595
|
# : (?sheet: untyped?) -> untyped
|
|
@@ -597,6 +614,26 @@ module Xlsxrb
|
|
|
597
614
|
# : (?sheet: untyped?) -> untyped
|
|
598
615
|
def comments: (?sheet: untyped) -> untyped
|
|
599
616
|
|
|
617
|
+
# Adds a threaded comment to a cell in the given sheet.
|
|
618
|
+
# : (String | Integer cell_address, String text, ?author: untyped, ?timestamp: untyped, ?id: String?, ?parent_id: String?, ?done: bool?, ?user_id: String?, ?provider_id: String?, ?sheet: untyped?) -> Hash[Symbol, untyped]
|
|
619
|
+
def add_threaded_comment: (untyped cell_address, untyped text, ?author: untyped, ?timestamp: untyped, ?id: untyped, ?parent_id: untyped, ?done: untyped, ?user_id: untyped, ?provider_id: untyped, ?sheet: untyped) -> untyped
|
|
620
|
+
|
|
621
|
+
alias threaded_comment add_threaded_comment
|
|
622
|
+
|
|
623
|
+
# Returns threaded comments for the first (or given) sheet.
|
|
624
|
+
# : (?sheet: untyped?) -> Array[Hash[Symbol, untyped]]
|
|
625
|
+
def threaded_comments: (?sheet: untyped) -> untyped
|
|
626
|
+
|
|
627
|
+
# Registers a person in the workbook person list.
|
|
628
|
+
# : (String name, ?id: String?, ?user_id: String?, ?provider_id: String?) -> Hash[Symbol, untyped]
|
|
629
|
+
def add_person: (untyped name, ?id: untyped, ?user_id: untyped, ?provider_id: untyped) -> untyped
|
|
630
|
+
|
|
631
|
+
# Returns the workbook person list.
|
|
632
|
+
# : () -> Array[Hash[Symbol, untyped]]
|
|
633
|
+
def persons: () -> untyped
|
|
634
|
+
|
|
635
|
+
alias person_list persons
|
|
636
|
+
|
|
600
637
|
# Adds a pivot table to the given sheet.
|
|
601
638
|
# source_ref: data source range (e.g. "Sheet1!A1:C4").
|
|
602
639
|
# row_fields: array of 0-based field indices for row axis.
|
|
@@ -681,8 +718,8 @@ module Xlsxrb
|
|
|
681
718
|
# : (untyped sheet_hyperlinks, ?untyped sheet_tables, ?::Integer table_start_index) -> untyped
|
|
682
719
|
def generate_worksheet_rels: (untyped sheet_hyperlinks, ?untyped sheet_tables, ?untyped table_start_index) -> untyped
|
|
683
720
|
|
|
684
|
-
# : (untyped sheet_name, untyped sheet_tables, untyped table_start_index, untyped drawing_idx, untyped comment_idx, untyped pivot_start, untyped pivot_count) -> untyped
|
|
685
|
-
def build_sheet_rels_parts_v2: (untyped sheet_name, untyped sheet_tables, untyped table_start_index, untyped drawing_idx, untyped comment_idx, untyped pivot_start, untyped pivot_count) -> untyped
|
|
721
|
+
# : (untyped sheet_name, untyped sheet_tables, untyped table_start_index, untyped drawing_idx, untyped comment_idx, untyped pivot_start, untyped pivot_count, ?untyped? threaded_comment_idx) -> untyped
|
|
722
|
+
def build_sheet_rels_parts_v2: (untyped sheet_name, untyped sheet_tables, untyped table_start_index, untyped drawing_idx, untyped comment_idx, untyped pivot_start, untyped pivot_count, ?untyped threaded_comment_idx) -> untyped
|
|
686
723
|
|
|
687
724
|
# : (untyped rels_data) -> untyped
|
|
688
725
|
def generate_generic_rels: (untyped rels_data) -> untyped
|
|
@@ -70,8 +70,8 @@ module Xlsxrb
|
|
|
70
70
|
# : (untyped source, ?max_uncompressed_size: Integer) ?{ (ZipReader) -> untyped } -> (ZipReader | untyped)
|
|
71
71
|
def self.open: (untyped source, ?max_uncompressed_size: Integer) ?{ (ZipReader) -> untyped } -> (ZipReader | untyped)
|
|
72
72
|
|
|
73
|
-
# : (untyped io, ?max_uncompressed_size: Integer, ?should_close_io: bool) -> void
|
|
74
|
-
def initialize: (untyped io, ?max_uncompressed_size: Integer, ?should_close_io: bool) -> void
|
|
73
|
+
# : (untyped io, ?max_uncompressed_size: Integer, ?should_close_io: bool, ?filepath: String?) -> void
|
|
74
|
+
def initialize: (untyped io, ?max_uncompressed_size: Integer, ?should_close_io: bool, ?filepath: String?) -> void
|
|
75
75
|
|
|
76
76
|
# Returns a Hash { entry_name => raw_bytes } for all entries.
|
|
77
77
|
# : () -> Hash[String, String?]
|
|
@@ -5,9 +5,15 @@ module Xlsxrb
|
|
|
5
5
|
# Writes ZIP archives using only stdlib (zlib).
|
|
6
6
|
# Supports streaming: entries are written sequentially, central directory at close.
|
|
7
7
|
class ZipWriter
|
|
8
|
-
def self.open: (untyped target) ?{ (?) -> untyped } -> untyped
|
|
8
|
+
def self.open: (untyped target, ?compression_level: untyped) ?{ (?) -> untyped } -> untyped
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
# @return [Integer] Deflate compression level (0..9).
|
|
11
|
+
attr_reader compression_level: untyped
|
|
12
|
+
|
|
13
|
+
# @param io [IO, StringIO] Destination IO stream.
|
|
14
|
+
# @param compression_level [Integer, nil] ZIP deflate compression level (0..9, or Zlib::DEFAULT_COMPRESSION).
|
|
15
|
+
# : (untyped io, ?compression_level: Integer | nil) -> void
|
|
16
|
+
def initialize: (untyped io, ?compression_level: Integer | nil) -> void
|
|
11
17
|
|
|
12
18
|
# Add a file entry with string content.
|
|
13
19
|
def add_entry: (untyped path, untyped content) -> untyped
|
|
@@ -15,21 +15,33 @@ module Xlsxrb
|
|
|
15
15
|
#
|
|
16
16
|
# @api public
|
|
17
17
|
class StreamRow
|
|
18
|
+
# : Integer
|
|
18
19
|
attr_reader index: untyped
|
|
19
20
|
|
|
21
|
+
# : (Float | Integer)?
|
|
20
22
|
attr_reader height: untyped
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
# : Integer?
|
|
25
|
+
attr_reader outline_level: untyped
|
|
23
26
|
|
|
24
|
-
|
|
27
|
+
# : Integer?
|
|
28
|
+
attr_reader style_index: untyped
|
|
25
29
|
|
|
26
|
-
|
|
30
|
+
# @deprecated Use {#hidden?} instead. Will be removed in 0.2.0.
|
|
31
|
+
# : () -> bool
|
|
32
|
+
def hidden: () -> bool
|
|
27
33
|
|
|
28
|
-
|
|
34
|
+
# @deprecated Use {#collapsed?} instead. Will be removed in 0.2.0.
|
|
35
|
+
# : () -> bool
|
|
36
|
+
def collapsed: () -> bool
|
|
29
37
|
|
|
30
|
-
|
|
38
|
+
# @deprecated Use {#custom_height?} instead. Will be removed in 0.2.0.
|
|
39
|
+
# : () -> bool
|
|
40
|
+
def custom_height: () -> bool
|
|
31
41
|
|
|
32
|
-
|
|
42
|
+
# @deprecated Use {#pad_empty_cells?} instead. Will be removed in 0.2.0.
|
|
43
|
+
# : () -> bool
|
|
44
|
+
def pad_empty_cells: () -> bool
|
|
33
45
|
|
|
34
46
|
# @param index [Integer] 0-based row index.
|
|
35
47
|
# @param xml_bytes [String] Raw ASCII-8BIT XML bytes.
|
|
@@ -49,6 +61,7 @@ module Xlsxrb
|
|
|
49
61
|
# : (index: Integer, xml_bytes: String, from: Integer, to: Integer, shared_strings: Array[String], ?prefix: String, ?height: Float | Integer | nil, ?hidden: bool, ?custom_height: bool, ?collapsed: bool, ?outline_level: Integer | nil, ?style_index: Integer | nil, ?styles: (Elements::Styles | Hash[untyped, untyped])?, ?date1904: bool, ?pad_empty_cells: bool) -> void
|
|
50
62
|
def initialize: (index: Integer, xml_bytes: String, from: Integer, to: Integer, shared_strings: Array[String], ?prefix: String, ?height: Float | Integer | nil, ?hidden: bool, ?custom_height: bool, ?collapsed: bool, ?outline_level: Integer | nil, ?style_index: Integer | nil, ?styles: (Elements::Styles | Hash[untyped, untyped])?, ?date1904: bool, ?pad_empty_cells: bool) -> void
|
|
51
63
|
|
|
64
|
+
# @api private
|
|
52
65
|
# rubocop:disable Style/OptionalBooleanParameter
|
|
53
66
|
def self.fast_create: (untyped index, untyped xml_bytes, untyped from, untyped to, untyped shared_strings, ?untyped prefix, ?untyped height, ?untyped hidden, ?untyped custom_height, ?untyped outline_level, ?untyped style_index, ?untyped styles, ?untyped date1904, ?untyped collapsed, ?untyped pad_empty_cells) -> untyped
|
|
54
67
|
|
|
@@ -73,6 +86,21 @@ module Xlsxrb
|
|
|
73
86
|
# : () -> bool
|
|
74
87
|
def custom_height?: () -> bool
|
|
75
88
|
|
|
89
|
+
# Deconstructs row values for positional pattern matching.
|
|
90
|
+
#
|
|
91
|
+
# @return [Array<Object>]
|
|
92
|
+
# @api public
|
|
93
|
+
# : () -> Array[untyped]
|
|
94
|
+
def deconstruct: () -> Array[untyped]
|
|
95
|
+
|
|
96
|
+
# Deconstructs row attributes for pattern matching.
|
|
97
|
+
#
|
|
98
|
+
# @param _keys [Array<Symbol>, nil]
|
|
99
|
+
# @return [Hash{Symbol => Object}]
|
|
100
|
+
# @api public
|
|
101
|
+
# : (Array[Symbol]? _keys) -> Hash[Symbol, untyped]
|
|
102
|
+
def deconstruct_keys: (Array[Symbol]? _keys) -> Hash[Symbol, untyped]
|
|
103
|
+
|
|
76
104
|
# Returns a frozen Hash of row attributes.
|
|
77
105
|
#
|
|
78
106
|
# @return [Hash{Symbol => Object}]
|
|
@@ -123,24 +151,25 @@ module Xlsxrb
|
|
|
123
151
|
# : () -> Array[Elements::Cell]
|
|
124
152
|
def cells: () -> Array[Elements::Cell]
|
|
125
153
|
|
|
126
|
-
# Access a cell by 0-based column index, or access row attributes via Symbol.
|
|
154
|
+
# Access a cell by 0-based column index, column letter, or access row attributes via Symbol.
|
|
127
155
|
#
|
|
128
|
-
# @param col_index [Integer, Symbol] Column index or attribute symbol.
|
|
156
|
+
# @param col_index [Integer, String, Symbol] Column index, column letter, or attribute symbol.
|
|
129
157
|
# @return [Elements::Cell, Object, nil]
|
|
130
158
|
# @api public
|
|
131
|
-
# : (Integer | Symbol col_index) -> untyped
|
|
132
|
-
def []: (Integer | Symbol col_index) -> untyped
|
|
159
|
+
# : (Integer | String | Symbol col_index) -> untyped
|
|
160
|
+
def []: (Integer | String | Symbol col_index) -> untyped
|
|
133
161
|
|
|
134
|
-
# Access a cell by 0-based column index.
|
|
162
|
+
# Access a cell by 0-based column index or column letter/Symbol.
|
|
135
163
|
#
|
|
136
|
-
# @param col_index [Integer] 0-based column index.
|
|
164
|
+
# @param col_index [Integer, String, Symbol] 0-based column index or column letter/Symbol.
|
|
137
165
|
# @return [Elements::Cell, nil]
|
|
138
166
|
# @api public
|
|
139
|
-
# : (Integer col_index) -> Elements::Cell?
|
|
140
|
-
def cell_at: (Integer col_index) -> Elements::Cell?
|
|
167
|
+
# : (Integer | String | Symbol col_index) -> Elements::Cell?
|
|
168
|
+
def cell_at: (Integer | String | Symbol col_index) -> Elements::Cell?
|
|
141
169
|
|
|
142
170
|
# Convert row cells to a coordinate-keyed Hash (e.g. {"A1" => "value", "B1" => 123}).
|
|
143
171
|
#
|
|
172
|
+
# @deprecated Use {#values} or {#cells} instead. Will be removed in 0.2.0.
|
|
144
173
|
# @param type_cast [Boolean] Whether to coerce date/time serial numbers into Date/Time instances.
|
|
145
174
|
# @return [Hash{String => Object}]
|
|
146
175
|
# @api public
|
|
@@ -149,6 +178,7 @@ module Xlsxrb
|
|
|
149
178
|
|
|
150
179
|
# Convert row cells to an Array of raw values (sparse columns get nil).
|
|
151
180
|
#
|
|
181
|
+
# @deprecated Use {#values} to get an Array of cell values, or {#cells} for Cell objects. In 0.2.0, {#to_a} will conform to Enumerable#to_a and return Array<Cell>.
|
|
152
182
|
# @return [Array<Object>]
|
|
153
183
|
# @api public
|
|
154
184
|
# : () -> Array[untyped]
|
|
@@ -181,6 +211,10 @@ module Xlsxrb
|
|
|
181
211
|
# @return [Array<String, nil>]
|
|
182
212
|
# @api public
|
|
183
213
|
# : () -> Array[String?]
|
|
214
|
+
def formula_expressions: () -> Array[String?]
|
|
215
|
+
|
|
216
|
+
# @deprecated Use {#formula_expressions} instead. Will be removed in 0.2.0.
|
|
217
|
+
# : () -> Array[String?]
|
|
184
218
|
def formulas: () -> Array[String?]
|
|
185
219
|
|
|
186
220
|
# Returns whether the row is valid according to OOXML specifications.
|