xlsxrb 0.1.18 → 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 +163 -0
- data/README.md +34 -11
- data/lib/ruby_lsp/xlsxrb/completion_listener.rb +410 -80
- data/lib/xlsxrb/chart_builder.rb +251 -386
- data/lib/xlsxrb/dsl_helpers.rb +120 -67
- data/lib/xlsxrb/elements/cell.rb +37 -157
- data/lib/xlsxrb/elements/column.rb +11 -19
- data/lib/xlsxrb/elements/coordinate_access.rb +15 -86
- data/lib/xlsxrb/elements/image.rb +5 -72
- data/lib/xlsxrb/elements/metadata.rb +463 -817
- data/lib/xlsxrb/elements/row.rb +27 -145
- data/lib/xlsxrb/elements/styles.rb +30 -88
- data/lib/xlsxrb/elements/types.rb +6 -99
- data/lib/xlsxrb/elements/workbook.rb +19 -126
- data/lib/xlsxrb/elements/worksheet.rb +43 -314
- data/lib/xlsxrb/ooxml/reader/listeners/core_listeners.rb +4 -1
- data/lib/xlsxrb/ooxml/reader/listeners/drawing_listeners.rb +7 -7
- data/lib/xlsxrb/ooxml/reader/listeners/feature_listeners.rb +32 -17
- data/lib/xlsxrb/ooxml/reader.rb +49 -51
- data/lib/xlsxrb/ooxml/styles_parser.rb +26 -2
- data/lib/xlsxrb/ooxml/utils.rb +2 -2
- data/lib/xlsxrb/ooxml/workbook_parser.rb +0 -1
- data/lib/xlsxrb/ooxml/workbook_writer.rb +172 -93
- data/lib/xlsxrb/ooxml/worksheet_parser.rb +61 -29
- data/lib/xlsxrb/ooxml/worksheet_writer.rb +65 -47
- data/lib/xlsxrb/ooxml/writer/drawing_xml.rb +28 -11
- data/lib/xlsxrb/ooxml/writer/features_xml.rb +53 -14
- data/lib/xlsxrb/ooxml/writer/styles_xml.rb +1 -1
- data/lib/xlsxrb/ooxml/writer.rb +105 -41
- data/lib/xlsxrb/ooxml/xml_parser.rb +78 -5
- data/lib/xlsxrb/ooxml/zip_reader.rb +65 -15
- data/lib/xlsxrb/ooxml/zip_writer.rb +119 -30
- data/lib/xlsxrb/stream_row.rb +12 -116
- data/lib/xlsxrb/stream_sheet.rb +14 -261
- data/lib/xlsxrb/stream_writer.rb +623 -1476
- data/lib/xlsxrb/style_builder.rb +376 -593
- data/lib/xlsxrb/version.rb +1 -1
- data/lib/xlsxrb/workbook_builder.rb +192 -226
- data/lib/xlsxrb/worksheet_builder.rb +456 -1324
- data/lib/xlsxrb.rb +266 -1083
- data/sig/generated/xlsxrb/chart_builder.rbs +202 -205
- data/sig/generated/xlsxrb/dsl_helpers.rbs +64 -16
- data/sig/generated/xlsxrb/elements/cell.rbs +12 -76
- data/sig/generated/xlsxrb/elements/column.rbs +0 -7
- data/sig/generated/xlsxrb/elements/coordinate_access.rbs +5 -41
- data/sig/generated/xlsxrb/elements/image.rbs +3 -29
- data/sig/generated/xlsxrb/elements/metadata.rbs +138 -151
- data/sig/generated/xlsxrb/elements/row.rbs +10 -53
- data/sig/generated/xlsxrb/elements/styles.rbs +1 -39
- data/sig/generated/xlsxrb/elements/workbook.rbs +14 -78
- data/sig/generated/xlsxrb/elements/worksheet.rbs +5 -121
- data/sig/generated/xlsxrb/ooxml/reader/listeners/feature_listeners.rbs +0 -4
- data/sig/generated/xlsxrb/ooxml/reader.rbs +0 -3
- 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 +12 -0
- data/sig/generated/xlsxrb/ooxml/worksheet_parser.rbs +16 -0
- data/sig/generated/xlsxrb/ooxml/worksheet_writer.rbs +5 -3
- data/sig/generated/xlsxrb/ooxml/writer/features_xml.rbs +7 -0
- data/sig/generated/xlsxrb/ooxml/writer.rbs +20 -14
- data/sig/generated/xlsxrb/ooxml/xml_parser.rbs +70 -0
- data/sig/generated/xlsxrb/ooxml/zip_reader.rbs +22 -7
- data/sig/generated/xlsxrb/ooxml/zip_writer.rbs +26 -1
- data/sig/generated/xlsxrb/stream_row.rbs +7 -42
- data/sig/generated/xlsxrb/stream_sheet.rbs +1 -158
- data/sig/generated/xlsxrb/stream_writer.rbs +457 -976
- data/sig/generated/xlsxrb/style_builder.rbs +206 -242
- data/sig/generated/xlsxrb/workbook_builder.rbs +84 -132
- data/sig/generated/xlsxrb/worksheet_builder.rbs +309 -685
- data/sig/generated/xlsxrb.rbs +43 -190
- data/sig/rexml.rbs +8 -0
- metadata +3 -5
- data/lib/xlsxrb/utils.rb +0 -251
- data/sig/generated/xlsxrb/utils.rbs +0 -200
|
@@ -17,8 +17,6 @@ module Xlsxrb
|
|
|
17
17
|
|
|
18
18
|
VERT_ALIGN_MAP: untyped
|
|
19
19
|
|
|
20
|
-
OMITTED: untyped
|
|
21
|
-
|
|
22
20
|
# Normalizes a color definition (CSS color name, hex code, or RGB integer) to an OpenXML hex color string.
|
|
23
21
|
#
|
|
24
22
|
# @example
|
|
@@ -50,6 +48,15 @@ module Xlsxrb
|
|
|
50
48
|
# : (Symbol | String | Integer | nil style) -> Symbol?
|
|
51
49
|
def self.normalize_border_style: (Symbol | String | Integer | nil style) -> Symbol?
|
|
52
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
|
+
|
|
53
60
|
# Resolves a color symbol, string, or prefix to an aRGB hex string.
|
|
54
61
|
#
|
|
55
62
|
# @param color [Symbol, String, Object, nil]
|
|
@@ -75,6 +82,28 @@ module Xlsxrb
|
|
|
75
82
|
# : Hash[Symbol, untyped]
|
|
76
83
|
attr_reader border_props: untyped
|
|
77
84
|
|
|
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
|
|
93
|
+
|
|
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
|
|
106
|
+
|
|
78
107
|
# Applies option-style definitions so callers can use add_style(name, **opts)
|
|
79
108
|
# as an alternative to block-based fluent chaining.
|
|
80
109
|
# Applies option-style definitions so callers can use add_style(name, **opts)
|
|
@@ -85,21 +114,21 @@ module Xlsxrb
|
|
|
85
114
|
# : (**untyped) -> self
|
|
86
115
|
def apply_options!: (**untyped) -> self
|
|
87
116
|
|
|
88
|
-
# Configures multiple font properties at once.
|
|
117
|
+
# Configures multiple font properties at once or returns font properties.
|
|
89
118
|
# @param opts [Hash] The font properties.
|
|
90
|
-
# @return [
|
|
119
|
+
# @return [Hash, void]
|
|
91
120
|
# @api public
|
|
92
|
-
# : (
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
121
|
+
# : () -> Hash[Symbol, untyped]
|
|
122
|
+
# : (**untyped) -> void
|
|
123
|
+
def font: () -> Hash[Symbol, untyped]
|
|
124
|
+
| (**untyped) -> void
|
|
96
125
|
|
|
97
|
-
# Sets
|
|
98
|
-
# @param
|
|
99
|
-
# @return [
|
|
126
|
+
# Sets font options.
|
|
127
|
+
# @param opts [Hash]
|
|
128
|
+
# @return [Hash]
|
|
100
129
|
# @api public
|
|
101
|
-
# : (
|
|
102
|
-
def
|
|
130
|
+
# : (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
|
|
131
|
+
def font=: (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
|
|
103
132
|
|
|
104
133
|
# Sets the font to bold.
|
|
105
134
|
# @param value [Boolean]
|
|
@@ -114,13 +143,6 @@ module Xlsxrb
|
|
|
114
143
|
# : () -> bool
|
|
115
144
|
def bold?: () -> bool
|
|
116
145
|
|
|
117
|
-
# Sets the font to italic.
|
|
118
|
-
# @param value [Boolean] Whether to apply italic.
|
|
119
|
-
# @return [self]
|
|
120
|
-
# @api public
|
|
121
|
-
# : (?untyped) -> (self | bool)
|
|
122
|
-
def italic: (?untyped) -> (self | bool)
|
|
123
|
-
|
|
124
146
|
# Sets the font to italic.
|
|
125
147
|
# @param value [Boolean]
|
|
126
148
|
# @return [Boolean]
|
|
@@ -134,12 +156,11 @@ module Xlsxrb
|
|
|
134
156
|
# : () -> bool
|
|
135
157
|
def italic?: () -> bool
|
|
136
158
|
|
|
137
|
-
#
|
|
138
|
-
# @
|
|
139
|
-
# @return [Integer, Float, self, nil]
|
|
159
|
+
# Gets the font size in points.
|
|
160
|
+
# @return [Integer, Float, nil]
|
|
140
161
|
# @api public
|
|
141
|
-
# : (
|
|
142
|
-
def font_size: (
|
|
162
|
+
# : () -> (Integer | Float | nil)
|
|
163
|
+
def font_size: () -> (Integer | Float | nil)
|
|
143
164
|
|
|
144
165
|
# Sets the font size in points.
|
|
145
166
|
# @param size_value [Integer, Float] The size in points (supports fractional sizes such as 10.5).
|
|
@@ -148,29 +169,11 @@ module Xlsxrb
|
|
|
148
169
|
# : (Numeric size_value) -> Numeric
|
|
149
170
|
def font_size=: (Numeric size_value) -> Numeric
|
|
150
171
|
|
|
151
|
-
#
|
|
152
|
-
#
|
|
153
|
-
def size: (?Numeric? size_value) -> (Numeric | self | nil)
|
|
154
|
-
|
|
155
|
-
# @deprecated Use {#font_size=} instead. Will be removed in 0.2.0.
|
|
156
|
-
# : (Numeric size_value) -> Numeric
|
|
157
|
-
def size=: (Numeric size_value) -> Numeric
|
|
158
|
-
|
|
159
|
-
# @deprecated Use {#font_size} instead. Will be removed in 0.2.0.
|
|
160
|
-
# : (?Numeric? size_value) -> (Numeric | self | nil)
|
|
161
|
-
def sz: (?Numeric? size_value) -> (Numeric | self | nil)
|
|
162
|
-
|
|
163
|
-
# @deprecated Use {#font_size=} instead. Will be removed in 0.2.0.
|
|
164
|
-
# : (Numeric size_value) -> Numeric
|
|
165
|
-
def sz=: (Numeric size_value) -> Numeric
|
|
166
|
-
|
|
167
|
-
# Sets the font name.
|
|
168
|
-
# Gets or sets the font name.
|
|
169
|
-
# @param name [String, Object] The font name.
|
|
170
|
-
# @return [String, self, nil]
|
|
172
|
+
# Gets the font name.
|
|
173
|
+
# @return [String, nil]
|
|
171
174
|
# @api public
|
|
172
|
-
# : (
|
|
173
|
-
def font_name: (
|
|
175
|
+
# : () -> String?
|
|
176
|
+
def font_name: () -> String?
|
|
174
177
|
|
|
175
178
|
# Sets the font name.
|
|
176
179
|
# @param name [String]
|
|
@@ -179,12 +182,11 @@ module Xlsxrb
|
|
|
179
182
|
# : (String name) -> String
|
|
180
183
|
def font_name=: (String name) -> String
|
|
181
184
|
|
|
182
|
-
# Gets
|
|
183
|
-
# @
|
|
184
|
-
# @return [String, Symbol, self, nil]
|
|
185
|
+
# Gets the font color.
|
|
186
|
+
# @return [String, nil]
|
|
185
187
|
# @api public
|
|
186
|
-
# : (
|
|
187
|
-
def font_color: (
|
|
188
|
+
# : () -> String?
|
|
189
|
+
def font_color: () -> String?
|
|
188
190
|
|
|
189
191
|
# Sets the font color.
|
|
190
192
|
# @param color [String, Symbol]
|
|
@@ -193,12 +195,11 @@ module Xlsxrb
|
|
|
193
195
|
# : (String | Symbol color) -> (String | Symbol)
|
|
194
196
|
def font_color=: (String | Symbol color) -> (String | Symbol)
|
|
195
197
|
|
|
196
|
-
#
|
|
197
|
-
# @
|
|
198
|
-
# @return [self]
|
|
198
|
+
# Gets the font underline style.
|
|
199
|
+
# @return [String, Symbol, Boolean, nil]
|
|
199
200
|
# @api public
|
|
200
|
-
# : (
|
|
201
|
-
def underline: (
|
|
201
|
+
# : () -> (String | Symbol | bool | nil)
|
|
202
|
+
def underline: () -> (String | Symbol | bool | nil)
|
|
202
203
|
|
|
203
204
|
# Sets the font underline style.
|
|
204
205
|
# @param val [String, Symbol, Boolean]
|
|
@@ -213,13 +214,6 @@ module Xlsxrb
|
|
|
213
214
|
# : () -> bool
|
|
214
215
|
def underline?: () -> bool
|
|
215
216
|
|
|
216
|
-
# Sets the font strikethrough.
|
|
217
|
-
# @param value [Boolean] Whether to apply strike.
|
|
218
|
-
# @return [self]
|
|
219
|
-
# @api public
|
|
220
|
-
# : (?untyped) -> (self | bool)
|
|
221
|
-
def strike: (?untyped) -> (self | bool)
|
|
222
|
-
|
|
223
217
|
# Sets the font strikethrough.
|
|
224
218
|
# @param value [Boolean]
|
|
225
219
|
# @return [Boolean]
|
|
@@ -233,51 +227,55 @@ module Xlsxrb
|
|
|
233
227
|
# : () -> bool
|
|
234
228
|
def strike?: () -> bool
|
|
235
229
|
|
|
236
|
-
# Gets
|
|
237
|
-
# @
|
|
238
|
-
# @return [String, self, nil]
|
|
230
|
+
# Gets the vertical alignment of the font.
|
|
231
|
+
# @return [String, nil]
|
|
239
232
|
# @api public
|
|
240
|
-
# : (
|
|
241
|
-
def vert_align: (
|
|
233
|
+
# : () -> String?
|
|
234
|
+
def vert_align: () -> String?
|
|
242
235
|
|
|
243
|
-
|
|
236
|
+
# Sets the vertical alignment of the font.
|
|
237
|
+
# @param val [String, Symbol]
|
|
238
|
+
# @return [Object]
|
|
239
|
+
# @api public
|
|
240
|
+
# : (untyped val) -> untyped
|
|
241
|
+
def vert_align=: (untyped val) -> untyped
|
|
244
242
|
|
|
245
243
|
# Sets the font to superscript.
|
|
246
|
-
# @param
|
|
247
|
-
# @return [
|
|
244
|
+
# @param val [Boolean]
|
|
245
|
+
# @return [Boolean]
|
|
248
246
|
# @api public
|
|
249
|
-
# : (
|
|
250
|
-
def superscript
|
|
247
|
+
# : (untyped val) -> untyped
|
|
248
|
+
def superscript=: (untyped val) -> untyped
|
|
251
249
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
250
|
+
# Returns whether superscript is enabled.
|
|
251
|
+
# @return [Boolean]
|
|
252
|
+
# @api public
|
|
253
|
+
# : () -> bool
|
|
254
|
+
def superscript?: () -> bool
|
|
255
255
|
|
|
256
256
|
# Sets the font to subscript.
|
|
257
|
-
# @param
|
|
258
|
-
# @return [
|
|
257
|
+
# @param val [Boolean]
|
|
258
|
+
# @return [Boolean]
|
|
259
259
|
# @api public
|
|
260
|
-
# : (
|
|
261
|
-
def subscript
|
|
262
|
-
|
|
263
|
-
def subscript=: (untyped value) -> untyped
|
|
264
|
-
|
|
265
|
-
def subscript?: () -> untyped
|
|
260
|
+
# : (untyped val) -> untyped
|
|
261
|
+
def subscript=: (untyped val) -> untyped
|
|
266
262
|
|
|
267
|
-
#
|
|
268
|
-
# @
|
|
269
|
-
# @param fg_color [String, Symbol, nil] The foreground color.
|
|
270
|
-
# @param bg_color [String, Symbol, nil] The background color.
|
|
271
|
-
# @return [self]
|
|
263
|
+
# Returns whether subscript is enabled.
|
|
264
|
+
# @return [Boolean]
|
|
272
265
|
# @api public
|
|
273
|
-
#
|
|
274
|
-
|
|
266
|
+
# : () -> bool
|
|
267
|
+
def subscript?: () -> bool
|
|
268
|
+
|
|
269
|
+
# Sets or gets the fill pattern.
|
|
270
|
+
# @param pattern [String, Symbol, nil] The pattern type.
|
|
275
271
|
# @param fg_color [String, Symbol, nil] The foreground color.
|
|
276
272
|
# @param bg_color [String, Symbol, nil] The background color.
|
|
277
|
-
# @return [
|
|
273
|
+
# @return [String, Symbol, void, nil]
|
|
278
274
|
# @api public
|
|
279
|
-
# : (
|
|
280
|
-
|
|
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
|
|
281
279
|
|
|
282
280
|
# Sets the fill pattern.
|
|
283
281
|
# @param pattern [String, Symbol, Hash]
|
|
@@ -286,12 +284,11 @@ module Xlsxrb
|
|
|
286
284
|
# : (untyped pattern) -> untyped
|
|
287
285
|
def fill_pattern=: (untyped pattern) -> untyped
|
|
288
286
|
|
|
289
|
-
# Gets
|
|
290
|
-
# @
|
|
291
|
-
# @return [String, Symbol, self, nil]
|
|
287
|
+
# Gets a solid fill color.
|
|
288
|
+
# @return [String, nil]
|
|
292
289
|
# @api public
|
|
293
|
-
# : (
|
|
294
|
-
def fill_color: (
|
|
290
|
+
# : () -> String?
|
|
291
|
+
def fill_color: () -> String?
|
|
295
292
|
|
|
296
293
|
# Sets a solid fill color.
|
|
297
294
|
# @param color [String, Symbol]
|
|
@@ -300,73 +297,96 @@ module Xlsxrb
|
|
|
300
297
|
# : (String | Symbol color) -> (String | Symbol)
|
|
301
298
|
def fill_color=: (String | Symbol color) -> (String | Symbol)
|
|
302
299
|
|
|
303
|
-
#
|
|
304
|
-
|
|
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
|
|
305
310
|
|
|
311
|
+
# Sets fill options.
|
|
312
|
+
# @param opts [Hash, Object]
|
|
313
|
+
# @return [Object]
|
|
314
|
+
# @api public
|
|
315
|
+
# : (untyped opts) -> untyped
|
|
306
316
|
def fill=: (untyped opts) -> untyped
|
|
307
317
|
|
|
308
|
-
# Sets a gradient fill.
|
|
309
|
-
# @param type [String] The gradient type.
|
|
318
|
+
# Sets or gets a gradient fill.
|
|
319
|
+
# @param type [String, nil] The gradient type.
|
|
310
320
|
# @param degree [Numeric, nil] The degree.
|
|
311
321
|
# @param stops [Array] The gradient stops.
|
|
312
|
-
# @return [
|
|
322
|
+
# @return [Hash, void, nil]
|
|
313
323
|
# @api public
|
|
314
|
-
# : (
|
|
315
|
-
|
|
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
|
|
316
328
|
|
|
317
|
-
# Configures multiple border properties.
|
|
318
|
-
#
|
|
319
|
-
# @param
|
|
320
|
-
# @param
|
|
321
|
-
# @param
|
|
322
|
-
# @param
|
|
323
|
-
# @param
|
|
324
|
-
# @
|
|
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]
|
|
325
347
|
# @api public
|
|
326
|
-
# : (
|
|
327
|
-
def border
|
|
328
|
-
|
|
329
|
-
def border=: (untyped opts) -> untyped
|
|
348
|
+
# : (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
|
|
349
|
+
def border=: (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
|
|
330
350
|
|
|
331
351
|
# Sets all borders.
|
|
332
352
|
# @param style [String, Symbol, Integer] The border style.
|
|
333
353
|
# @param color [String, Symbol, nil] The color.
|
|
334
|
-
# @return [
|
|
354
|
+
# @return [void]
|
|
335
355
|
# @api public
|
|
336
|
-
# : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) ->
|
|
337
|
-
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
|
|
338
358
|
|
|
339
359
|
# Sets the left border.
|
|
340
360
|
# @param style [String, Symbol, Integer] The border style.
|
|
341
361
|
# @param color [String, Symbol, nil] The color.
|
|
342
|
-
# @return [
|
|
362
|
+
# @return [void]
|
|
343
363
|
# @api public
|
|
344
|
-
# : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) ->
|
|
345
|
-
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
|
|
346
366
|
|
|
347
367
|
# Sets the right border.
|
|
348
368
|
# @param style [String, Symbol, Integer] The border style.
|
|
349
369
|
# @param color [String, Symbol, nil] The color.
|
|
350
|
-
# @return [
|
|
370
|
+
# @return [void]
|
|
351
371
|
# @api public
|
|
352
|
-
# : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) ->
|
|
353
|
-
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
|
|
354
374
|
|
|
355
375
|
# Sets the top border.
|
|
356
376
|
# @param style [String, Symbol, Integer] The border style.
|
|
357
377
|
# @param color [String, Symbol, nil] The color.
|
|
358
|
-
# @return [
|
|
378
|
+
# @return [void]
|
|
359
379
|
# @api public
|
|
360
|
-
# : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) ->
|
|
361
|
-
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
|
|
362
382
|
|
|
363
383
|
# Sets the bottom border.
|
|
364
384
|
# @param style [String, Symbol, Integer] The border style.
|
|
365
385
|
# @param color [String, Symbol, nil] The color.
|
|
366
|
-
# @return [
|
|
386
|
+
# @return [void]
|
|
367
387
|
# @api public
|
|
368
|
-
# : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) ->
|
|
369
|
-
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
|
|
370
390
|
|
|
371
391
|
# rubocop:disable Naming/MethodParameterName
|
|
372
392
|
# Sets diagonal borders.
|
|
@@ -374,28 +394,30 @@ module Xlsxrb
|
|
|
374
394
|
# @param color [String, Symbol, nil] The color.
|
|
375
395
|
# @param up [Boolean] Diagonal up.
|
|
376
396
|
# @param down [Boolean] Diagonal down.
|
|
377
|
-
# @return [
|
|
397
|
+
# @return [void]
|
|
378
398
|
# @api public
|
|
379
|
-
# : (?style: String | Symbol | Integer, ?color: String | Symbol | nil, ?up: bool, ?down: bool) ->
|
|
380
|
-
def border_diagonal: (?style: String | Symbol | Integer, ?color: String | Symbol | nil, ?up: bool, ?down: bool) ->
|
|
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
|
|
381
401
|
|
|
382
402
|
# Configures or returns alignment properties.
|
|
383
403
|
# When called with 0 arguments/keywords, returns the current alignment Hash.
|
|
384
|
-
# When called with keyword arguments, merges the properties and returns
|
|
404
|
+
# When called with keyword arguments, merges the properties and returns nil.
|
|
385
405
|
#
|
|
386
|
-
# @param horizontal [String, Symbol, nil]
|
|
387
|
-
# @param vertical [String, Symbol, nil]
|
|
388
|
-
# @param wrap_text [Boolean, nil]
|
|
389
|
-
# @param text_rotation [Integer, nil]
|
|
390
|
-
# @param indent [Integer, nil]
|
|
391
|
-
# @param shrink_to_fit [Boolean, nil]
|
|
392
|
-
# @param reading_order [Integer, nil]
|
|
393
|
-
# @param justify_last_line [Boolean, nil]
|
|
394
|
-
# @param relative_indent [Integer, nil]
|
|
395
|
-
# @return [Hash,
|
|
396
|
-
# @api public
|
|
397
|
-
# : (
|
|
398
|
-
|
|
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
|
|
399
421
|
|
|
400
422
|
# Sets alignment options.
|
|
401
423
|
#
|
|
@@ -405,12 +427,11 @@ module Xlsxrb
|
|
|
405
427
|
# : (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
|
|
406
428
|
def alignment=: (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
|
|
407
429
|
|
|
408
|
-
# Gets
|
|
409
|
-
# @
|
|
410
|
-
# @return [String, Symbol, self, nil]
|
|
430
|
+
# Gets horizontal alignment.
|
|
431
|
+
# @return [String, Symbol, nil]
|
|
411
432
|
# @api public
|
|
412
|
-
# : (
|
|
413
|
-
def align_horizontal: (
|
|
433
|
+
# : () -> (String | Symbol | nil)
|
|
434
|
+
def align_horizontal: () -> (String | Symbol | nil)
|
|
414
435
|
|
|
415
436
|
# Sets horizontal alignment.
|
|
416
437
|
# @param value [String, Symbol]
|
|
@@ -419,12 +440,11 @@ module Xlsxrb
|
|
|
419
440
|
# : (String | Symbol value) -> (String | Symbol)
|
|
420
441
|
def align_horizontal=: (String | Symbol value) -> (String | Symbol)
|
|
421
442
|
|
|
422
|
-
# Gets
|
|
423
|
-
# @
|
|
424
|
-
# @return [String, Symbol, self, nil]
|
|
443
|
+
# Gets vertical alignment.
|
|
444
|
+
# @return [String, Symbol, nil]
|
|
425
445
|
# @api public
|
|
426
|
-
# : (
|
|
427
|
-
def align_vertical: (
|
|
446
|
+
# : () -> (String | Symbol | nil)
|
|
447
|
+
def align_vertical: () -> (String | Symbol | nil)
|
|
428
448
|
|
|
429
449
|
# Sets vertical alignment.
|
|
430
450
|
# @param value [String, Symbol]
|
|
@@ -433,13 +453,6 @@ module Xlsxrb
|
|
|
433
453
|
# : (String | Symbol value) -> (String | Symbol)
|
|
434
454
|
def align_vertical=: (String | Symbol value) -> (String | Symbol)
|
|
435
455
|
|
|
436
|
-
# Sets text wrapping.
|
|
437
|
-
# @param value [Boolean] Whether to wrap text.
|
|
438
|
-
# @return [self]
|
|
439
|
-
# @api public
|
|
440
|
-
# : (?untyped) -> (self | bool)
|
|
441
|
-
def wrap_text: (?untyped) -> (self | bool)
|
|
442
|
-
|
|
443
456
|
# Sets text wrapping.
|
|
444
457
|
# @param value [Boolean]
|
|
445
458
|
# @return [Boolean]
|
|
@@ -453,13 +466,6 @@ module Xlsxrb
|
|
|
453
466
|
# : () -> bool
|
|
454
467
|
def wrap_text?: () -> bool
|
|
455
468
|
|
|
456
|
-
# Sets shrink to fit.
|
|
457
|
-
# @param value [Boolean] Whether to shrink text.
|
|
458
|
-
# @return [self]
|
|
459
|
-
# @api public
|
|
460
|
-
# : (?untyped) -> (self | bool)
|
|
461
|
-
def shrink_to_fit: (?untyped) -> (self | bool)
|
|
462
|
-
|
|
463
469
|
# Sets shrink to fit.
|
|
464
470
|
# @param value [Boolean]
|
|
465
471
|
# @return [Boolean]
|
|
@@ -473,12 +479,11 @@ module Xlsxrb
|
|
|
473
479
|
# : () -> bool
|
|
474
480
|
def shrink_to_fit?: () -> bool
|
|
475
481
|
|
|
476
|
-
# Gets
|
|
477
|
-
# @
|
|
478
|
-
# @return [Numeric, self, nil]
|
|
482
|
+
# Gets text rotation.
|
|
483
|
+
# @return [Numeric, nil]
|
|
479
484
|
# @api public
|
|
480
|
-
# : (
|
|
481
|
-
def text_rotation: (
|
|
485
|
+
# : () -> (Numeric | nil)
|
|
486
|
+
def text_rotation: () -> (Numeric | nil)
|
|
482
487
|
|
|
483
488
|
# Sets text rotation.
|
|
484
489
|
# @param value [Numeric]
|
|
@@ -487,12 +492,11 @@ module Xlsxrb
|
|
|
487
492
|
# : (Numeric value) -> Numeric
|
|
488
493
|
def text_rotation=: (Numeric value) -> Numeric
|
|
489
494
|
|
|
490
|
-
# Gets
|
|
491
|
-
# @
|
|
492
|
-
# @return [Numeric, self, nil]
|
|
495
|
+
# Gets text indent.
|
|
496
|
+
# @return [Integer, nil]
|
|
493
497
|
# @api public
|
|
494
|
-
# : (
|
|
495
|
-
def indent: (
|
|
498
|
+
# : () -> (Integer | nil)
|
|
499
|
+
def indent: () -> (Integer | nil)
|
|
496
500
|
|
|
497
501
|
# Sets text indent.
|
|
498
502
|
# @param value [Numeric]
|
|
@@ -503,14 +507,16 @@ module Xlsxrb
|
|
|
503
507
|
|
|
504
508
|
# Configures or returns cell protection properties.
|
|
505
509
|
# When called with 0 arguments/keywords, returns the current protection Hash.
|
|
506
|
-
# When called with keyword arguments, merges the properties and returns
|
|
510
|
+
# When called with keyword arguments, merges the properties and returns nil.
|
|
507
511
|
#
|
|
508
512
|
# @param locked [Boolean, nil]
|
|
509
513
|
# @param hidden [Boolean, nil]
|
|
510
|
-
# @return [Hash,
|
|
514
|
+
# @return [Hash, void]
|
|
511
515
|
# @api public
|
|
512
|
-
# : (
|
|
513
|
-
|
|
516
|
+
# : () -> Hash[Symbol, untyped]
|
|
517
|
+
# : (?locked: bool?, ?hidden: bool?) -> void
|
|
518
|
+
def protection: () -> Hash[Symbol, untyped]
|
|
519
|
+
| (?locked: bool?, ?hidden: bool?) -> void
|
|
514
520
|
|
|
515
521
|
# Sets protection options.
|
|
516
522
|
#
|
|
@@ -520,14 +526,6 @@ module Xlsxrb
|
|
|
520
526
|
# : (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
|
|
521
527
|
def protection=: (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
|
|
522
528
|
|
|
523
|
-
# Sets whether the cell is locked.
|
|
524
|
-
#
|
|
525
|
-
# @param value [Boolean]
|
|
526
|
-
# @return [self]
|
|
527
|
-
# @api public
|
|
528
|
-
# : (?untyped value) -> (self | bool)
|
|
529
|
-
def locked: (?untyped value) -> (self | bool)
|
|
530
|
-
|
|
531
529
|
# Sets whether the cell is locked.
|
|
532
530
|
#
|
|
533
531
|
# @param value [Boolean]
|
|
@@ -542,14 +540,6 @@ module Xlsxrb
|
|
|
542
540
|
# : () -> bool
|
|
543
541
|
def locked?: () -> bool
|
|
544
542
|
|
|
545
|
-
# Sets whether the cell formula is hidden.
|
|
546
|
-
#
|
|
547
|
-
# @param value [Boolean]
|
|
548
|
-
# @return [self]
|
|
549
|
-
# @api public
|
|
550
|
-
# : (?untyped value) -> (self | bool)
|
|
551
|
-
def hidden: (?untyped value) -> (self | bool)
|
|
552
|
-
|
|
553
543
|
# Sets whether the cell formula is hidden.
|
|
554
544
|
#
|
|
555
545
|
# @param value [Boolean]
|
|
@@ -564,12 +554,11 @@ module Xlsxrb
|
|
|
564
554
|
# : () -> bool
|
|
565
555
|
def hidden?: () -> bool
|
|
566
556
|
|
|
567
|
-
#
|
|
568
|
-
# @
|
|
569
|
-
# @return [String, Integer, self, nil]
|
|
557
|
+
# Gets the number format.
|
|
558
|
+
# @return [String, Integer, nil]
|
|
570
559
|
# @api public
|
|
571
|
-
# : (
|
|
572
|
-
def number_format: (
|
|
560
|
+
# : () -> (String | Integer | nil)
|
|
561
|
+
def number_format: () -> (String | Integer | nil)
|
|
573
562
|
|
|
574
563
|
# Sets the number format.
|
|
575
564
|
# @param num_fmt_id [String, Integer]
|
|
@@ -578,38 +567,6 @@ module Xlsxrb
|
|
|
578
567
|
# : (String | Integer num_fmt_id) -> (String | Integer)
|
|
579
568
|
def number_format=: (String | Integer num_fmt_id) -> (String | Integer)
|
|
580
569
|
|
|
581
|
-
# Sets or gets the number format ID.
|
|
582
|
-
# @deprecated Use {#number_format} instead. Will be removed in 0.2.0.
|
|
583
|
-
# @param id [String, Integer, nil]
|
|
584
|
-
# @return [String, Integer, self, nil]
|
|
585
|
-
# @api public
|
|
586
|
-
# : (?String | Integer | nil id) -> (String | Integer | self | nil)
|
|
587
|
-
def number_format_id: (?String | Integer | nil id) -> (String | Integer | self | nil)
|
|
588
|
-
|
|
589
|
-
# Sets the number format ID.
|
|
590
|
-
# @deprecated Use {#number_format=} instead. Will be removed in 0.2.0.
|
|
591
|
-
# @param id [String, Integer]
|
|
592
|
-
# @return [String, Integer]
|
|
593
|
-
# @api public
|
|
594
|
-
# : (String | Integer id) -> (String | Integer)
|
|
595
|
-
def number_format_id=: (String | Integer id) -> (String | Integer)
|
|
596
|
-
|
|
597
|
-
# @deprecated Use {#number_format} instead. Will be removed in 0.2.0.
|
|
598
|
-
# : (?String | Integer | nil num_fmt_id) -> (String | Integer | self | nil)
|
|
599
|
-
def num_fmt: (?String | Integer | nil num_fmt_id) -> (String | Integer | self | nil)
|
|
600
|
-
|
|
601
|
-
# @deprecated Use {#number_format=} instead. Will be removed in 0.2.0.
|
|
602
|
-
# : (String | Integer num_fmt_id) -> (String | Integer)
|
|
603
|
-
def num_fmt=: (String | Integer num_fmt_id) -> (String | Integer)
|
|
604
|
-
|
|
605
|
-
# @deprecated Use {#number_format_id} instead. Will be removed in 0.2.0.
|
|
606
|
-
# : (?String | Integer | nil id) -> (String | Integer | self | nil)
|
|
607
|
-
def num_fmt_id: (?String | Integer | nil id) -> (String | Integer | self | nil)
|
|
608
|
-
|
|
609
|
-
# @deprecated Use {#number_format_id=} instead. Will be removed in 0.2.0.
|
|
610
|
-
# : (String | Integer id) -> (String | Integer)
|
|
611
|
-
def num_fmt_id=: (String | Integer id) -> (String | Integer)
|
|
612
|
-
|
|
613
570
|
# Register this style with the given Writer, returning the style_id.
|
|
614
571
|
# writer:: Xlsxrb::Ooxml::Writer instance
|
|
615
572
|
# : (untyped writer) -> Integer
|
|
@@ -617,6 +574,13 @@ module Xlsxrb
|
|
|
617
574
|
|
|
618
575
|
private
|
|
619
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
|
+
|
|
620
584
|
def resolve_color: (untyped color) -> untyped
|
|
621
585
|
end
|
|
622
586
|
end
|