xlsxrb 0.1.17 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +256 -1
- data/README.md +111 -28
- data/lib/ruby_lsp/xlsxrb/completion_listener.rb +439 -139
- data/lib/xlsxrb/chart_builder.rb +540 -193
- data/lib/xlsxrb/dsl_helpers.rb +178 -73
- data/lib/xlsxrb/elements/cell.rb +197 -130
- data/lib/xlsxrb/elements/column.rb +88 -7
- data/lib/xlsxrb/elements/coordinate_access.rb +86 -59
- data/lib/xlsxrb/elements/image.rb +18 -19
- data/lib/xlsxrb/elements/metadata.rb +2379 -0
- data/lib/xlsxrb/elements/row.rb +84 -118
- data/lib/xlsxrb/elements/styles.rb +140 -90
- data/lib/xlsxrb/elements/types.rb +164 -22
- data/lib/xlsxrb/elements/workbook.rb +122 -140
- data/lib/xlsxrb/elements/worksheet.rb +451 -226
- data/lib/xlsxrb/elements.rb +1 -0
- data/lib/xlsxrb/ooxml/reader/listeners/core_listeners.rb +16 -5
- data/lib/xlsxrb/ooxml/reader/listeners/drawing_listeners.rb +14 -9
- data/lib/xlsxrb/ooxml/reader/listeners/feature_listeners.rb +296 -34
- data/lib/xlsxrb/ooxml/reader/listeners/style_listeners.rb +17 -3
- data/lib/xlsxrb/ooxml/reader.rb +52 -50
- data/lib/xlsxrb/ooxml/styles_parser.rb +36 -5
- data/lib/xlsxrb/ooxml/utils.rb +2 -2
- data/lib/xlsxrb/ooxml/workbook_parser.rb +0 -1
- data/lib/xlsxrb/ooxml/workbook_writer.rb +242 -109
- data/lib/xlsxrb/ooxml/worksheet_parser.rb +63 -31
- data/lib/xlsxrb/ooxml/worksheet_writer.rb +119 -56
- data/lib/xlsxrb/ooxml/writer/drawing_xml.rb +33 -13
- data/lib/xlsxrb/ooxml/writer/features_xml.rb +75 -15
- data/lib/xlsxrb/ooxml/writer/styles_xml.rb +18 -8
- data/lib/xlsxrb/ooxml/writer.rb +124 -44
- data/lib/xlsxrb/ooxml/xml_parser.rb +78 -5
- data/lib/xlsxrb/ooxml/zip_generator.rb +2 -0
- data/lib/xlsxrb/ooxml/zip_reader.rb +112 -25
- data/lib/xlsxrb/ooxml/zip_writer.rb +119 -30
- data/lib/xlsxrb/stream_row.rb +56 -81
- data/lib/xlsxrb/stream_sheet.rb +542 -273
- data/lib/xlsxrb/stream_writer.rb +1536 -870
- data/lib/xlsxrb/style_builder.rb +667 -221
- data/lib/xlsxrb/version.rb +1 -1
- data/lib/xlsxrb/workbook_builder.rb +406 -143
- data/lib/xlsxrb/worksheet_builder.rb +1009 -900
- data/lib/xlsxrb.rb +1179 -1056
- data/sig/generated/xlsxrb/chart_builder.rbs +385 -159
- data/sig/generated/xlsxrb/dsl_helpers.rbs +81 -15
- data/sig/generated/xlsxrb/elements/cell.rbs +78 -70
- data/sig/generated/xlsxrb/elements/column.rbs +55 -3
- data/sig/generated/xlsxrb/elements/coordinate_access.rbs +35 -29
- data/sig/generated/xlsxrb/elements/image.rbs +7 -11
- data/sig/generated/xlsxrb/elements/metadata.rbs +1574 -0
- data/sig/generated/xlsxrb/elements/row.rbs +39 -42
- data/sig/generated/xlsxrb/elements/styles.rbs +66 -66
- data/sig/generated/xlsxrb/elements/types.rbs +27 -0
- data/sig/generated/xlsxrb/elements/workbook.rbs +46 -99
- data/sig/generated/xlsxrb/elements/worksheet.rbs +121 -96
- data/sig/generated/xlsxrb/ooxml/reader/listeners/feature_listeners.rbs +61 -4
- data/sig/generated/xlsxrb/ooxml/reader.rbs +2 -2
- data/sig/generated/xlsxrb/ooxml/styles_parser.rbs +1 -1
- data/sig/generated/xlsxrb/ooxml/utils.rbs +3 -3
- data/sig/generated/xlsxrb/ooxml/workbook_writer.rbs +13 -1
- data/sig/generated/xlsxrb/ooxml/worksheet_parser.rbs +16 -0
- data/sig/generated/xlsxrb/ooxml/worksheet_writer.rbs +6 -4
- data/sig/generated/xlsxrb/ooxml/writer/features_xml.rbs +7 -0
- data/sig/generated/xlsxrb/ooxml/writer.rbs +22 -13
- data/sig/generated/xlsxrb/ooxml/xml_parser.rbs +70 -0
- data/sig/generated/xlsxrb/ooxml/zip_generator.rbs +2 -0
- data/sig/generated/xlsxrb/ooxml/zip_reader.rbs +24 -9
- data/sig/generated/xlsxrb/ooxml/zip_writer.rbs +26 -1
- data/sig/generated/xlsxrb/stream_row.rbs +32 -33
- data/sig/generated/xlsxrb/stream_sheet.rbs +233 -181
- data/sig/generated/xlsxrb/stream_writer.rbs +961 -667
- data/sig/generated/xlsxrb/style_builder.rbs +402 -128
- data/sig/generated/xlsxrb/workbook_builder.rbs +223 -71
- data/sig/generated/xlsxrb/worksheet_builder.rbs +579 -453
- data/sig/generated/xlsxrb.rbs +205 -144
- data/sig/rexml.rbs +8 -0
- metadata +5 -5
- data/lib/xlsxrb/utils.rb +0 -291
- data/sig/generated/xlsxrb/utils.rbs +0 -184
|
@@ -29,7 +29,7 @@ module Xlsxrb
|
|
|
29
29
|
# @param color [String, Symbol, Integer, nil]
|
|
30
30
|
# @param alpha [Boolean] Whether to include the alpha channel ("AARRGGBB" vs "RRGGBB").
|
|
31
31
|
# @return [String, nil]
|
|
32
|
-
# @api
|
|
32
|
+
# @api private
|
|
33
33
|
# : (String | Symbol | Integer | nil color, ?alpha: bool) -> String?
|
|
34
34
|
def self.normalize_color: (String | Symbol | Integer | nil color, ?alpha: bool) -> String?
|
|
35
35
|
|
|
@@ -44,10 +44,19 @@ module Xlsxrb
|
|
|
44
44
|
#
|
|
45
45
|
# @param style [Symbol, String, Integer, nil]
|
|
46
46
|
# @return [Symbol, nil]
|
|
47
|
-
# @api
|
|
47
|
+
# @api private
|
|
48
48
|
# : (Symbol | String | Integer | nil style) -> Symbol?
|
|
49
49
|
def self.normalize_border_style: (Symbol | String | Integer | nil style) -> Symbol?
|
|
50
50
|
|
|
51
|
+
# Normalizes a border style like normalize_border_style, raising ArgumentError for a style
|
|
52
|
+
# that is not one of the ST_BorderStyle values or their snake_case spellings.
|
|
53
|
+
#
|
|
54
|
+
# @param style [Symbol, String, Integer]
|
|
55
|
+
# @return [String]
|
|
56
|
+
# @api private
|
|
57
|
+
# : (Symbol | String | Integer style) -> String
|
|
58
|
+
def self.border_style!: (Symbol | String | Integer style) -> String
|
|
59
|
+
|
|
51
60
|
# Resolves a color symbol, string, or prefix to an aRGB hex string.
|
|
52
61
|
#
|
|
53
62
|
# @param color [Symbol, String, Object, nil]
|
|
@@ -55,22 +64,45 @@ module Xlsxrb
|
|
|
55
64
|
# : (untyped color) -> String?
|
|
56
65
|
def self.resolve_color: (untyped color) -> String?
|
|
57
66
|
|
|
58
|
-
def resolve_color: (untyped color) -> untyped
|
|
59
|
-
|
|
60
67
|
# : (?String? name) -> void
|
|
61
68
|
def initialize: (?String? name) -> void
|
|
62
69
|
|
|
70
|
+
# : (String | Symbol)?
|
|
63
71
|
attr_reader name: untyped
|
|
64
72
|
|
|
73
|
+
# @api private
|
|
74
|
+
# : Hash[Symbol, untyped]
|
|
65
75
|
attr_reader font_props: untyped
|
|
66
76
|
|
|
77
|
+
# @api private
|
|
78
|
+
# : Hash[Symbol, untyped]
|
|
67
79
|
attr_reader fill_props: untyped
|
|
68
80
|
|
|
81
|
+
# @api private
|
|
82
|
+
# : Hash[Symbol, untyped]
|
|
69
83
|
attr_reader border_props: untyped
|
|
70
84
|
|
|
71
|
-
|
|
85
|
+
# Top-level keys accepted by #apply_options!.
|
|
86
|
+
OPTION_KEYS: untyped
|
|
87
|
+
|
|
88
|
+
# Keys accepted inside the nested option hashes.
|
|
89
|
+
NESTED_OPTION_KEYS: untyped
|
|
90
|
+
|
|
91
|
+
# Flat keys that the nested form of each group replaces; giving both is ambiguous.
|
|
92
|
+
FLAT_KEYS_BY_GROUP: untyped
|
|
72
93
|
|
|
73
|
-
|
|
94
|
+
# Copies the option hashes, so a copy can change without affecting the original.
|
|
95
|
+
# : (StyleBuilder source) -> void
|
|
96
|
+
def initialize_copy: (StyleBuilder source) -> void
|
|
97
|
+
|
|
98
|
+
# Returns a copy of this style named +name+ that uses +number_format+.
|
|
99
|
+
#
|
|
100
|
+
# @param name [String] Name of the copy.
|
|
101
|
+
# @param number_format [String, Integer] Number format of the copy.
|
|
102
|
+
# @return [StyleBuilder]
|
|
103
|
+
# @api private
|
|
104
|
+
# : (String name, String | Integer number_format) -> StyleBuilder
|
|
105
|
+
def with_number_format: (String name, String | Integer number_format) -> StyleBuilder
|
|
74
106
|
|
|
75
107
|
# Applies option-style definitions so callers can use add_style(name, **opts)
|
|
76
108
|
# as an alternative to block-based fluent chaining.
|
|
@@ -82,164 +114,279 @@ module Xlsxrb
|
|
|
82
114
|
# : (**untyped) -> self
|
|
83
115
|
def apply_options!: (**untyped) -> self
|
|
84
116
|
|
|
85
|
-
# Configures multiple font properties at once.
|
|
117
|
+
# Configures multiple font properties at once or returns font properties.
|
|
86
118
|
# @param opts [Hash] The font properties.
|
|
87
|
-
# @return [
|
|
119
|
+
# @return [Hash, void]
|
|
88
120
|
# @api public
|
|
89
|
-
# : (
|
|
90
|
-
|
|
121
|
+
# : () -> Hash[Symbol, untyped]
|
|
122
|
+
# : (**untyped) -> void
|
|
123
|
+
def font: () -> Hash[Symbol, untyped]
|
|
124
|
+
| (**untyped) -> void
|
|
125
|
+
|
|
126
|
+
# Sets font options.
|
|
127
|
+
# @param opts [Hash]
|
|
128
|
+
# @return [Hash]
|
|
129
|
+
# @api public
|
|
130
|
+
# : (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
|
|
131
|
+
def font=: (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
|
|
91
132
|
|
|
92
|
-
# rubocop:disable Style/OptionalBooleanParameter
|
|
93
133
|
# Sets the font to bold.
|
|
94
|
-
# @param value [Boolean]
|
|
95
|
-
# @return [
|
|
134
|
+
# @param value [Boolean]
|
|
135
|
+
# @return [Boolean]
|
|
96
136
|
# @api public
|
|
97
|
-
# : (
|
|
98
|
-
def bold
|
|
137
|
+
# : (bool value) -> bool
|
|
138
|
+
def bold=: (bool value) -> bool
|
|
139
|
+
|
|
140
|
+
# Returns whether bold is enabled.
|
|
141
|
+
# @return [Boolean]
|
|
142
|
+
# @api public
|
|
143
|
+
# : () -> bool
|
|
144
|
+
def bold?: () -> bool
|
|
99
145
|
|
|
100
146
|
# Sets the font to italic.
|
|
101
|
-
# @param value [Boolean]
|
|
102
|
-
# @return [
|
|
147
|
+
# @param value [Boolean]
|
|
148
|
+
# @return [Boolean]
|
|
103
149
|
# @api public
|
|
104
|
-
# : (
|
|
105
|
-
def italic
|
|
150
|
+
# : (bool value) -> bool
|
|
151
|
+
def italic=: (bool value) -> bool
|
|
106
152
|
|
|
107
|
-
#
|
|
108
|
-
# @
|
|
109
|
-
# @
|
|
153
|
+
# Returns whether italic is enabled.
|
|
154
|
+
# @return [Boolean]
|
|
155
|
+
# @api public
|
|
156
|
+
# : () -> bool
|
|
157
|
+
def italic?: () -> bool
|
|
158
|
+
|
|
159
|
+
# Gets the font size in points.
|
|
160
|
+
# @return [Integer, Float, nil]
|
|
161
|
+
# @api public
|
|
162
|
+
# : () -> (Integer | Float | nil)
|
|
163
|
+
def font_size: () -> (Integer | Float | nil)
|
|
164
|
+
|
|
165
|
+
# Sets the font size in points.
|
|
166
|
+
# @param size_value [Integer, Float] The size in points (supports fractional sizes such as 10.5).
|
|
167
|
+
# @return [Integer, Float]
|
|
110
168
|
# @api public
|
|
111
|
-
# : (Numeric) ->
|
|
112
|
-
def
|
|
169
|
+
# : (Numeric size_value) -> Numeric
|
|
170
|
+
def font_size=: (Numeric size_value) -> Numeric
|
|
171
|
+
|
|
172
|
+
# Gets the font name.
|
|
173
|
+
# @return [String, nil]
|
|
174
|
+
# @api public
|
|
175
|
+
# : () -> String?
|
|
176
|
+
def font_name: () -> String?
|
|
113
177
|
|
|
114
178
|
# Sets the font name.
|
|
115
|
-
# @param name [String]
|
|
116
|
-
# @return [
|
|
179
|
+
# @param name [String]
|
|
180
|
+
# @return [String]
|
|
117
181
|
# @api public
|
|
118
|
-
# : (String) ->
|
|
119
|
-
def font_name
|
|
182
|
+
# : (String name) -> String
|
|
183
|
+
def font_name=: (String name) -> String
|
|
184
|
+
|
|
185
|
+
# Gets the font color.
|
|
186
|
+
# @return [String, nil]
|
|
187
|
+
# @api public
|
|
188
|
+
# : () -> String?
|
|
189
|
+
def font_color: () -> String?
|
|
120
190
|
|
|
121
191
|
# Sets the font color.
|
|
122
|
-
# @param color [String, Symbol]
|
|
123
|
-
# @return [
|
|
192
|
+
# @param color [String, Symbol]
|
|
193
|
+
# @return [String, Symbol]
|
|
124
194
|
# @api public
|
|
125
|
-
# : (String | Symbol) ->
|
|
126
|
-
def font_color
|
|
195
|
+
# : (String | Symbol color) -> (String | Symbol)
|
|
196
|
+
def font_color=: (String | Symbol color) -> (String | Symbol)
|
|
197
|
+
|
|
198
|
+
# Gets the font underline style.
|
|
199
|
+
# @return [String, Symbol, Boolean, nil]
|
|
200
|
+
# @api public
|
|
201
|
+
# : () -> (String | Symbol | bool | nil)
|
|
202
|
+
def underline: () -> (String | Symbol | bool | nil)
|
|
127
203
|
|
|
128
204
|
# Sets the font underline style.
|
|
129
|
-
# @param val [String, Symbol, Boolean]
|
|
130
|
-
# @return [
|
|
205
|
+
# @param val [String, Symbol, Boolean]
|
|
206
|
+
# @return [String, Symbol, Boolean]
|
|
207
|
+
# @api public
|
|
208
|
+
# : (String | Symbol | bool val) -> (String | Symbol | bool)
|
|
209
|
+
def underline=: (String | Symbol | bool val) -> (String | Symbol | bool)
|
|
210
|
+
|
|
211
|
+
# Returns whether underline is enabled.
|
|
212
|
+
# @return [Boolean]
|
|
131
213
|
# @api public
|
|
132
|
-
# : (
|
|
133
|
-
def underline
|
|
214
|
+
# : () -> bool
|
|
215
|
+
def underline?: () -> bool
|
|
134
216
|
|
|
135
217
|
# Sets the font strikethrough.
|
|
136
|
-
# @param value [Boolean]
|
|
137
|
-
# @return [
|
|
218
|
+
# @param value [Boolean]
|
|
219
|
+
# @return [Boolean]
|
|
220
|
+
# @api public
|
|
221
|
+
# : (bool value) -> bool
|
|
222
|
+
def strike=: (bool value) -> bool
|
|
223
|
+
|
|
224
|
+
# Returns whether strikethrough is enabled.
|
|
225
|
+
# @return [Boolean]
|
|
138
226
|
# @api public
|
|
139
|
-
# : (
|
|
140
|
-
def strike
|
|
227
|
+
# : () -> bool
|
|
228
|
+
def strike?: () -> bool
|
|
229
|
+
|
|
230
|
+
# Gets the vertical alignment of the font.
|
|
231
|
+
# @return [String, nil]
|
|
232
|
+
# @api public
|
|
233
|
+
# : () -> String?
|
|
234
|
+
def vert_align: () -> String?
|
|
141
235
|
|
|
142
236
|
# Sets the vertical alignment of the font.
|
|
143
|
-
# @param
|
|
144
|
-
# @return [
|
|
237
|
+
# @param val [String, Symbol]
|
|
238
|
+
# @return [Object]
|
|
145
239
|
# @api public
|
|
146
|
-
# : (
|
|
147
|
-
def vert_align
|
|
240
|
+
# : (untyped val) -> untyped
|
|
241
|
+
def vert_align=: (untyped val) -> untyped
|
|
148
242
|
|
|
149
243
|
# Sets the font to superscript.
|
|
150
|
-
# @param
|
|
151
|
-
# @return [
|
|
244
|
+
# @param val [Boolean]
|
|
245
|
+
# @return [Boolean]
|
|
246
|
+
# @api public
|
|
247
|
+
# : (untyped val) -> untyped
|
|
248
|
+
def superscript=: (untyped val) -> untyped
|
|
249
|
+
|
|
250
|
+
# Returns whether superscript is enabled.
|
|
251
|
+
# @return [Boolean]
|
|
152
252
|
# @api public
|
|
153
|
-
# : (
|
|
154
|
-
def superscript
|
|
253
|
+
# : () -> bool
|
|
254
|
+
def superscript?: () -> bool
|
|
155
255
|
|
|
156
256
|
# Sets the font to subscript.
|
|
157
|
-
# @param
|
|
158
|
-
# @return [
|
|
257
|
+
# @param val [Boolean]
|
|
258
|
+
# @return [Boolean]
|
|
159
259
|
# @api public
|
|
160
|
-
# : (
|
|
161
|
-
def subscript
|
|
260
|
+
# : (untyped val) -> untyped
|
|
261
|
+
def subscript=: (untyped val) -> untyped
|
|
162
262
|
|
|
163
|
-
#
|
|
164
|
-
# @
|
|
165
|
-
# @param fg_color [String, Symbol, nil] The foreground color.
|
|
166
|
-
# @param bg_color [String, Symbol, nil] The background color.
|
|
167
|
-
# @return [self]
|
|
263
|
+
# Returns whether subscript is enabled.
|
|
264
|
+
# @return [Boolean]
|
|
168
265
|
# @api public
|
|
169
|
-
#
|
|
170
|
-
|
|
266
|
+
# : () -> bool
|
|
267
|
+
def subscript?: () -> bool
|
|
268
|
+
|
|
269
|
+
# Sets or gets the fill pattern.
|
|
270
|
+
# @param pattern [String, Symbol, nil] The pattern type.
|
|
171
271
|
# @param fg_color [String, Symbol, nil] The foreground color.
|
|
172
272
|
# @param bg_color [String, Symbol, nil] The background color.
|
|
173
|
-
# @return [
|
|
273
|
+
# @return [String, Symbol, void, nil]
|
|
174
274
|
# @api public
|
|
175
|
-
# : (
|
|
176
|
-
|
|
275
|
+
# : () -> (String | Symbol | untyped)
|
|
276
|
+
# : (?untyped pattern, ?fg_color: String | Symbol | nil, ?bg_color: String | Symbol | nil) -> void
|
|
277
|
+
def fill_pattern: () -> (String | Symbol | untyped)
|
|
278
|
+
| (?untyped pattern, ?fg_color: String | Symbol | nil, ?bg_color: String | Symbol | nil) -> void
|
|
279
|
+
|
|
280
|
+
# Sets the fill pattern.
|
|
281
|
+
# @param pattern [String, Symbol, Hash]
|
|
282
|
+
# @return [Object]
|
|
283
|
+
# @api public
|
|
284
|
+
# : (untyped pattern) -> untyped
|
|
285
|
+
def fill_pattern=: (untyped pattern) -> untyped
|
|
286
|
+
|
|
287
|
+
# Gets a solid fill color.
|
|
288
|
+
# @return [String, nil]
|
|
289
|
+
# @api public
|
|
290
|
+
# : () -> String?
|
|
291
|
+
def fill_color: () -> String?
|
|
177
292
|
|
|
178
293
|
# Sets a solid fill color.
|
|
179
|
-
# @param color [String, Symbol]
|
|
180
|
-
# @return [
|
|
294
|
+
# @param color [String, Symbol]
|
|
295
|
+
# @return [String, Symbol]
|
|
181
296
|
# @api public
|
|
182
|
-
# : (String | Symbol) ->
|
|
183
|
-
def fill_color
|
|
297
|
+
# : (String | Symbol color) -> (String | Symbol)
|
|
298
|
+
def fill_color=: (String | Symbol color) -> (String | Symbol)
|
|
184
299
|
|
|
185
|
-
#
|
|
186
|
-
|
|
300
|
+
# Configures fill properties or returns current fill properties.
|
|
301
|
+
# @param pattern [String, Symbol, nil]
|
|
302
|
+
# @param fg_color [String, Symbol, nil]
|
|
303
|
+
# @param bg_color [String, Symbol, nil]
|
|
304
|
+
# @return [Hash, void]
|
|
305
|
+
# @api public
|
|
306
|
+
# : () -> Hash[Symbol, untyped]
|
|
307
|
+
# : (?pattern: untyped, ?fg_color: String | Symbol | nil, ?bg_color: String | Symbol | nil) -> void
|
|
308
|
+
def fill: () -> Hash[Symbol, untyped]
|
|
309
|
+
| (?pattern: untyped, ?fg_color: String | Symbol | nil, ?bg_color: String | Symbol | nil) -> void
|
|
187
310
|
|
|
188
|
-
# Sets
|
|
189
|
-
# @param
|
|
311
|
+
# Sets fill options.
|
|
312
|
+
# @param opts [Hash, Object]
|
|
313
|
+
# @return [Object]
|
|
314
|
+
# @api public
|
|
315
|
+
# : (untyped opts) -> untyped
|
|
316
|
+
def fill=: (untyped opts) -> untyped
|
|
317
|
+
|
|
318
|
+
# Sets or gets a gradient fill.
|
|
319
|
+
# @param type [String, nil] The gradient type.
|
|
190
320
|
# @param degree [Numeric, nil] The degree.
|
|
191
321
|
# @param stops [Array] The gradient stops.
|
|
192
|
-
# @return [
|
|
322
|
+
# @return [Hash, void, nil]
|
|
193
323
|
# @api public
|
|
194
|
-
# : (
|
|
195
|
-
|
|
324
|
+
# : () -> Hash[Symbol, untyped]?
|
|
325
|
+
# : (?type: untyped, ?degree: Numeric | nil, ?stops: Array[untyped]) -> void
|
|
326
|
+
def fill_gradient: () -> Hash[Symbol, untyped]?
|
|
327
|
+
| (?type: untyped, ?degree: Numeric | nil, ?stops: Array[untyped]) -> void
|
|
196
328
|
|
|
197
|
-
# Configures multiple border properties.
|
|
198
|
-
#
|
|
199
|
-
# @
|
|
200
|
-
# @
|
|
201
|
-
#
|
|
202
|
-
|
|
329
|
+
# Configures multiple border properties or returns current border properties.
|
|
330
|
+
#
|
|
331
|
+
# @param all [Hash, nil] Border options for all sides.
|
|
332
|
+
# @param left [Hash, nil] Options for left border.
|
|
333
|
+
# @param right [Hash, nil] Options for right border.
|
|
334
|
+
# @param top [Hash, nil] Options for top border.
|
|
335
|
+
# @param bottom [Hash, nil] Options for bottom border.
|
|
336
|
+
# @param diagonal [Hash, nil] Options for diagonal border.
|
|
337
|
+
# @return [Hash, void]
|
|
338
|
+
# @api public
|
|
339
|
+
# : () -> Hash[Symbol, untyped]
|
|
340
|
+
# : (?all: Hash[Symbol, untyped]?, ?left: Hash[Symbol, untyped]?, ?right: Hash[Symbol, untyped]?, ?top: Hash[Symbol, untyped]?, ?bottom: Hash[Symbol, untyped]?, ?diagonal: Hash[Symbol, untyped]?) -> void
|
|
341
|
+
def border: () -> Hash[Symbol, untyped]
|
|
342
|
+
| (?all: Hash[Symbol, untyped]?, ?left: Hash[Symbol, untyped]?, ?right: Hash[Symbol, untyped]?, ?top: Hash[Symbol, untyped]?, ?bottom: Hash[Symbol, untyped]?, ?diagonal: Hash[Symbol, untyped]?) -> void
|
|
343
|
+
|
|
344
|
+
# Sets border options.
|
|
345
|
+
# @param opts [Hash]
|
|
346
|
+
# @return [Hash]
|
|
347
|
+
# @api public
|
|
348
|
+
# : (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
|
|
349
|
+
def border=: (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
|
|
203
350
|
|
|
204
351
|
# Sets all borders.
|
|
205
352
|
# @param style [String, Symbol, Integer] The border style.
|
|
206
353
|
# @param color [String, Symbol, nil] The color.
|
|
207
|
-
# @return [
|
|
354
|
+
# @return [void]
|
|
208
355
|
# @api public
|
|
209
|
-
# : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) ->
|
|
210
|
-
def border_all: (?style: String | Symbol | Integer, ?color: String | Symbol | nil) ->
|
|
356
|
+
# : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
|
|
357
|
+
def border_all: (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
|
|
211
358
|
|
|
212
359
|
# Sets the left border.
|
|
213
360
|
# @param style [String, Symbol, Integer] The border style.
|
|
214
361
|
# @param color [String, Symbol, nil] The color.
|
|
215
|
-
# @return [
|
|
362
|
+
# @return [void]
|
|
216
363
|
# @api public
|
|
217
|
-
# : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) ->
|
|
218
|
-
def border_left: (?style: String | Symbol | Integer, ?color: String | Symbol | nil) ->
|
|
364
|
+
# : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
|
|
365
|
+
def border_left: (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
|
|
219
366
|
|
|
220
367
|
# Sets the right border.
|
|
221
368
|
# @param style [String, Symbol, Integer] The border style.
|
|
222
369
|
# @param color [String, Symbol, nil] The color.
|
|
223
|
-
# @return [
|
|
370
|
+
# @return [void]
|
|
224
371
|
# @api public
|
|
225
|
-
# : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) ->
|
|
226
|
-
def border_right: (?style: String | Symbol | Integer, ?color: String | Symbol | nil) ->
|
|
372
|
+
# : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
|
|
373
|
+
def border_right: (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
|
|
227
374
|
|
|
228
375
|
# Sets the top border.
|
|
229
376
|
# @param style [String, Symbol, Integer] The border style.
|
|
230
377
|
# @param color [String, Symbol, nil] The color.
|
|
231
|
-
# @return [
|
|
378
|
+
# @return [void]
|
|
232
379
|
# @api public
|
|
233
|
-
# : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) ->
|
|
234
|
-
def border_top: (?style: String | Symbol | Integer, ?color: String | Symbol | nil) ->
|
|
380
|
+
# : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
|
|
381
|
+
def border_top: (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
|
|
235
382
|
|
|
236
383
|
# Sets the bottom border.
|
|
237
384
|
# @param style [String, Symbol, Integer] The border style.
|
|
238
385
|
# @param color [String, Symbol, nil] The color.
|
|
239
|
-
# @return [
|
|
386
|
+
# @return [void]
|
|
240
387
|
# @api public
|
|
241
|
-
# : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) ->
|
|
242
|
-
def border_bottom: (?style: String | Symbol | Integer, ?color: String | Symbol | nil) ->
|
|
388
|
+
# : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
|
|
389
|
+
def border_bottom: (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
|
|
243
390
|
|
|
244
391
|
# rubocop:disable Naming/MethodParameterName
|
|
245
392
|
# Sets diagonal borders.
|
|
@@ -247,66 +394,193 @@ module Xlsxrb
|
|
|
247
394
|
# @param color [String, Symbol, nil] The color.
|
|
248
395
|
# @param up [Boolean] Diagonal up.
|
|
249
396
|
# @param down [Boolean] Diagonal down.
|
|
250
|
-
# @return [
|
|
397
|
+
# @return [void]
|
|
398
|
+
# @api public
|
|
399
|
+
# : (?style: String | Symbol | Integer, ?color: String | Symbol | nil, ?up: bool, ?down: bool) -> void
|
|
400
|
+
def border_diagonal: (?style: String | Symbol | Integer, ?color: String | Symbol | nil, ?up: bool, ?down: bool) -> void
|
|
401
|
+
|
|
402
|
+
# Configures or returns alignment properties.
|
|
403
|
+
# When called with 0 arguments/keywords, returns the current alignment Hash.
|
|
404
|
+
# When called with keyword arguments, merges the properties and returns nil.
|
|
405
|
+
#
|
|
406
|
+
# @param horizontal [String, Symbol, nil] Horizontal alignment (:left, :center, :right, :fill, :justify, etc.).
|
|
407
|
+
# @param vertical [String, Symbol, nil] Vertical alignment (:top, :center, :bottom, :justify, :distributed).
|
|
408
|
+
# @param wrap_text [Boolean, nil] Whether to wrap text within the cell.
|
|
409
|
+
# @param text_rotation [Integer, nil] Text rotation in degrees (0-180 or 255 for vertical).
|
|
410
|
+
# @param indent [Integer, nil] Indentation level (0-250).
|
|
411
|
+
# @param shrink_to_fit [Boolean, nil] Whether to shrink text to fit cell width.
|
|
412
|
+
# @param reading_order [Integer, nil] Reading order (0: context, 1: left-to-right, 2: right-to-left).
|
|
413
|
+
# @param justify_last_line [Boolean, nil] Whether to justify the last line of text.
|
|
414
|
+
# @param relative_indent [Integer, nil] Relative indentation level.
|
|
415
|
+
# @return [Hash, void]
|
|
416
|
+
# @api public
|
|
417
|
+
# : () -> Hash[Symbol, untyped]
|
|
418
|
+
# : (?horizontal: (String | Symbol)?, ?vertical: (String | Symbol)?, ?wrap_text: bool?, ?text_rotation: Integer?, ?indent: Integer?, ?shrink_to_fit: bool?, ?reading_order: Integer?, ?justify_last_line: bool?, ?relative_indent: Integer?) -> void
|
|
419
|
+
def alignment: () -> Hash[Symbol, untyped]
|
|
420
|
+
| (?horizontal: (String | Symbol)?, ?vertical: (String | Symbol)?, ?wrap_text: bool?, ?text_rotation: Integer?, ?indent: Integer?, ?shrink_to_fit: bool?, ?reading_order: Integer?, ?justify_last_line: bool?, ?relative_indent: Integer?) -> void
|
|
421
|
+
|
|
422
|
+
# Sets alignment options.
|
|
423
|
+
#
|
|
424
|
+
# @param opts [Hash]
|
|
425
|
+
# @return [Hash]
|
|
426
|
+
# @api public
|
|
427
|
+
# : (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
|
|
428
|
+
def alignment=: (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
|
|
429
|
+
|
|
430
|
+
# Gets horizontal alignment.
|
|
431
|
+
# @return [String, Symbol, nil]
|
|
251
432
|
# @api public
|
|
252
|
-
# : (
|
|
253
|
-
def
|
|
433
|
+
# : () -> (String | Symbol | nil)
|
|
434
|
+
def align_horizontal: () -> (String | Symbol | nil)
|
|
254
435
|
|
|
255
436
|
# Sets horizontal alignment.
|
|
256
|
-
# @param value [String, Symbol]
|
|
257
|
-
# @return [
|
|
437
|
+
# @param value [String, Symbol]
|
|
438
|
+
# @return [String, Symbol]
|
|
439
|
+
# @api public
|
|
440
|
+
# : (String | Symbol value) -> (String | Symbol)
|
|
441
|
+
def align_horizontal=: (String | Symbol value) -> (String | Symbol)
|
|
442
|
+
|
|
443
|
+
# Gets vertical alignment.
|
|
444
|
+
# @return [String, Symbol, nil]
|
|
258
445
|
# @api public
|
|
259
|
-
# : (String | Symbol
|
|
260
|
-
def
|
|
446
|
+
# : () -> (String | Symbol | nil)
|
|
447
|
+
def align_vertical: () -> (String | Symbol | nil)
|
|
261
448
|
|
|
262
449
|
# Sets vertical alignment.
|
|
263
|
-
# @param value [String, Symbol]
|
|
264
|
-
# @return [
|
|
450
|
+
# @param value [String, Symbol]
|
|
451
|
+
# @return [String, Symbol]
|
|
265
452
|
# @api public
|
|
266
|
-
# : (String | Symbol) ->
|
|
267
|
-
def align_vertical
|
|
453
|
+
# : (String | Symbol value) -> (String | Symbol)
|
|
454
|
+
def align_vertical=: (String | Symbol value) -> (String | Symbol)
|
|
268
455
|
|
|
269
|
-
# rubocop:disable Style/OptionalBooleanParameter
|
|
270
456
|
# Sets text wrapping.
|
|
271
|
-
# @param value [Boolean]
|
|
272
|
-
# @return [
|
|
457
|
+
# @param value [Boolean]
|
|
458
|
+
# @return [Boolean]
|
|
459
|
+
# @api public
|
|
460
|
+
# : (bool value) -> bool
|
|
461
|
+
def wrap_text=: (bool value) -> bool
|
|
462
|
+
|
|
463
|
+
# Returns whether text wrapping is enabled.
|
|
464
|
+
# @return [Boolean]
|
|
273
465
|
# @api public
|
|
274
|
-
# : (
|
|
275
|
-
def wrap_text
|
|
466
|
+
# : () -> bool
|
|
467
|
+
def wrap_text?: () -> bool
|
|
276
468
|
|
|
277
469
|
# Sets shrink to fit.
|
|
278
|
-
# @param value [Boolean]
|
|
279
|
-
# @return [
|
|
470
|
+
# @param value [Boolean]
|
|
471
|
+
# @return [Boolean]
|
|
472
|
+
# @api public
|
|
473
|
+
# : (bool value) -> bool
|
|
474
|
+
def shrink_to_fit=: (bool value) -> bool
|
|
475
|
+
|
|
476
|
+
# Returns whether shrink to fit is enabled.
|
|
477
|
+
# @return [Boolean]
|
|
478
|
+
# @api public
|
|
479
|
+
# : () -> bool
|
|
480
|
+
def shrink_to_fit?: () -> bool
|
|
481
|
+
|
|
482
|
+
# Gets text rotation.
|
|
483
|
+
# @return [Numeric, nil]
|
|
280
484
|
# @api public
|
|
281
|
-
# : (
|
|
282
|
-
def
|
|
485
|
+
# : () -> (Numeric | nil)
|
|
486
|
+
def text_rotation: () -> (Numeric | nil)
|
|
283
487
|
|
|
284
488
|
# Sets text rotation.
|
|
285
|
-
# @param value [Numeric]
|
|
286
|
-
# @return [
|
|
489
|
+
# @param value [Numeric]
|
|
490
|
+
# @return [Numeric]
|
|
491
|
+
# @api public
|
|
492
|
+
# : (Numeric value) -> Numeric
|
|
493
|
+
def text_rotation=: (Numeric value) -> Numeric
|
|
494
|
+
|
|
495
|
+
# Gets text indent.
|
|
496
|
+
# @return [Integer, nil]
|
|
287
497
|
# @api public
|
|
288
|
-
# : (
|
|
289
|
-
def
|
|
498
|
+
# : () -> (Integer | nil)
|
|
499
|
+
def indent: () -> (Integer | nil)
|
|
290
500
|
|
|
291
501
|
# Sets text indent.
|
|
292
|
-
# @param value [Numeric]
|
|
293
|
-
# @return [
|
|
502
|
+
# @param value [Numeric]
|
|
503
|
+
# @return [Numeric]
|
|
294
504
|
# @api public
|
|
295
|
-
# : (Numeric) ->
|
|
296
|
-
def indent
|
|
505
|
+
# : (Numeric value) -> Numeric
|
|
506
|
+
def indent=: (Numeric value) -> Numeric
|
|
297
507
|
|
|
298
|
-
#
|
|
299
|
-
#
|
|
300
|
-
#
|
|
508
|
+
# Configures or returns cell protection properties.
|
|
509
|
+
# When called with 0 arguments/keywords, returns the current protection Hash.
|
|
510
|
+
# When called with keyword arguments, merges the properties and returns nil.
|
|
511
|
+
#
|
|
512
|
+
# @param locked [Boolean, nil]
|
|
513
|
+
# @param hidden [Boolean, nil]
|
|
514
|
+
# @return [Hash, void]
|
|
515
|
+
# @api public
|
|
516
|
+
# : () -> Hash[Symbol, untyped]
|
|
517
|
+
# : (?locked: bool?, ?hidden: bool?) -> void
|
|
518
|
+
def protection: () -> Hash[Symbol, untyped]
|
|
519
|
+
| (?locked: bool?, ?hidden: bool?) -> void
|
|
520
|
+
|
|
521
|
+
# Sets protection options.
|
|
522
|
+
#
|
|
523
|
+
# @param opts [Hash]
|
|
524
|
+
# @return [Hash]
|
|
525
|
+
# @api public
|
|
526
|
+
# : (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
|
|
527
|
+
def protection=: (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
|
|
528
|
+
|
|
529
|
+
# Sets whether the cell is locked.
|
|
530
|
+
#
|
|
531
|
+
# @param value [Boolean]
|
|
532
|
+
# @return [Boolean]
|
|
533
|
+
# @api public
|
|
534
|
+
# : (bool value) -> bool
|
|
535
|
+
def locked=: (bool value) -> bool
|
|
536
|
+
|
|
537
|
+
# Returns whether the cell is locked.
|
|
538
|
+
# @return [Boolean]
|
|
539
|
+
# @api public
|
|
540
|
+
# : () -> bool
|
|
541
|
+
def locked?: () -> bool
|
|
542
|
+
|
|
543
|
+
# Sets whether the cell formula is hidden.
|
|
544
|
+
#
|
|
545
|
+
# @param value [Boolean]
|
|
546
|
+
# @return [Boolean]
|
|
301
547
|
# @api public
|
|
302
|
-
# : (
|
|
303
|
-
def
|
|
548
|
+
# : (bool value) -> bool
|
|
549
|
+
def hidden=: (bool value) -> bool
|
|
304
550
|
|
|
305
|
-
|
|
551
|
+
# Returns whether the cell formula is hidden.
|
|
552
|
+
# @return [Boolean]
|
|
553
|
+
# @api public
|
|
554
|
+
# : () -> bool
|
|
555
|
+
def hidden?: () -> bool
|
|
556
|
+
|
|
557
|
+
# Gets the number format.
|
|
558
|
+
# @return [String, Integer, nil]
|
|
559
|
+
# @api public
|
|
560
|
+
# : () -> (String | Integer | nil)
|
|
561
|
+
def number_format: () -> (String | Integer | nil)
|
|
562
|
+
|
|
563
|
+
# Sets the number format.
|
|
564
|
+
# @param num_fmt_id [String, Integer]
|
|
565
|
+
# @return [String, Integer]
|
|
566
|
+
# @api public
|
|
567
|
+
# : (String | Integer num_fmt_id) -> (String | Integer)
|
|
568
|
+
def number_format=: (String | Integer num_fmt_id) -> (String | Integer)
|
|
306
569
|
|
|
307
570
|
# Register this style with the given Writer, returning the style_id.
|
|
308
571
|
# writer:: Xlsxrb::Ooxml::Writer instance
|
|
309
572
|
# : (untyped writer) -> Integer
|
|
310
573
|
def register_with: (untyped writer) -> Integer
|
|
574
|
+
|
|
575
|
+
private
|
|
576
|
+
|
|
577
|
+
# Raises ArgumentError for option keys #apply_options! does not know, and for a nested
|
|
578
|
+
# group (font:, fill:, ...) given together with its flat keys, which would be ignored.
|
|
579
|
+
# : (Hash[Symbol, untyped] opts) -> void
|
|
580
|
+
def check_options!: (Hash[Symbol, untyped] opts) -> void
|
|
581
|
+
|
|
582
|
+
def unknown_option_message: (untyped key, untyped allowed, untyped kind) -> untyped
|
|
583
|
+
|
|
584
|
+
def resolve_color: (untyped color) -> untyped
|
|
311
585
|
end
|
|
312
586
|
end
|