caxlsx 4.0.0 → 4.4.1
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 +48 -12
- data/README.md +18 -9
- data/Rakefile +2 -9
- data/examples/generate.rb +3 -1
- data/lib/axlsx/content_type/abstract_content_type.rb +6 -3
- data/lib/axlsx/content_type/content_type.rb +4 -4
- data/lib/axlsx/content_type/default.rb +4 -1
- data/lib/axlsx/content_type/override.rb +4 -1
- data/lib/axlsx/doc_props/app.rb +91 -24
- data/lib/axlsx/drawing/area_chart.rb +3 -3
- data/lib/axlsx/drawing/area_series.rb +10 -4
- data/lib/axlsx/drawing/ax_data_source.rb +1 -1
- data/lib/axlsx/drawing/axes.rb +1 -1
- data/lib/axlsx/drawing/axis.rb +25 -7
- data/lib/axlsx/drawing/bar_3D_chart.rb +14 -4
- data/lib/axlsx/drawing/bar_chart.rb +14 -4
- data/lib/axlsx/drawing/bar_series.rb +14 -5
- data/lib/axlsx/drawing/bubble_chart.rb +2 -2
- data/lib/axlsx/drawing/bubble_series.rb +2 -2
- data/lib/axlsx/drawing/cat_axis.rb +23 -8
- data/lib/axlsx/drawing/chart.rb +33 -8
- data/lib/axlsx/drawing/d_lbls.rb +9 -8
- data/lib/axlsx/drawing/drawing.rb +50 -49
- data/lib/axlsx/drawing/hyperlink.rb +13 -4
- data/lib/axlsx/drawing/line_3D_chart.rb +3 -3
- data/lib/axlsx/drawing/line_chart.rb +3 -3
- data/lib/axlsx/drawing/line_series.rb +10 -4
- data/lib/axlsx/drawing/marker.rb +19 -4
- data/lib/axlsx/drawing/num_val.rb +1 -1
- data/lib/axlsx/drawing/one_cell_anchor.rb +8 -2
- data/lib/axlsx/drawing/pic.rb +17 -8
- data/lib/axlsx/drawing/pie_3D_chart.rb +3 -3
- data/lib/axlsx/drawing/pie_chart.rb +36 -0
- data/lib/axlsx/drawing/pie_series.rb +18 -6
- data/lib/axlsx/drawing/scaling.rb +18 -4
- data/lib/axlsx/drawing/scatter_chart.rb +2 -2
- data/lib/axlsx/drawing/scatter_series.rb +2 -2
- data/lib/axlsx/drawing/ser_axis.rb +11 -5
- data/lib/axlsx/drawing/series.rb +8 -2
- data/lib/axlsx/drawing/two_cell_anchor.rb +1 -1
- data/lib/axlsx/drawing/val_axis.rb +2 -2
- data/lib/axlsx/drawing/view_3D.rb +8 -2
- data/lib/axlsx/drawing/vml_shape.rb +1 -1
- data/lib/axlsx/package.rb +54 -21
- data/lib/axlsx/rels/relationship.rb +15 -5
- data/lib/axlsx/rels/relationships.rb +3 -3
- data/lib/axlsx/stylesheet/border.rb +12 -3
- data/lib/axlsx/stylesheet/border_pr.rb +16 -4
- data/lib/axlsx/stylesheet/cell_alignment.rb +39 -10
- data/lib/axlsx/stylesheet/cell_protection.rb +9 -2
- data/lib/axlsx/stylesheet/cell_style.rb +30 -7
- data/lib/axlsx/stylesheet/color.rb +10 -4
- data/lib/axlsx/stylesheet/dxf.rb +29 -6
- data/lib/axlsx/stylesheet/fill.rb +4 -1
- data/lib/axlsx/stylesheet/font.rb +59 -13
- data/lib/axlsx/stylesheet/gradient_fill.rb +9 -3
- data/lib/axlsx/stylesheet/gradient_stop.rb +9 -2
- data/lib/axlsx/stylesheet/num_fmt.rb +8 -2
- data/lib/axlsx/stylesheet/pattern_fill.rb +15 -3
- data/lib/axlsx/stylesheet/styles.rb +84 -43
- data/lib/axlsx/stylesheet/table_style.rb +15 -4
- data/lib/axlsx/stylesheet/table_style_element.rb +12 -3
- data/lib/axlsx/stylesheet/table_styles.rb +10 -3
- data/lib/axlsx/stylesheet/theme.rb +163 -0
- data/lib/axlsx/stylesheet/xf.rb +70 -16
- data/lib/axlsx/util/accessors.rb +9 -7
- data/lib/axlsx/util/buffered_zip_output_stream.rb +6 -2
- data/lib/axlsx/util/constants.rb +14 -2
- data/lib/axlsx/util/mime_type_utils.rb +72 -13
- data/lib/axlsx/util/serialized_attributes.rb +2 -2
- data/lib/axlsx/util/simple_typed_list.rb +26 -14
- data/lib/axlsx/util/storage.rb +4 -4
- data/lib/axlsx/util/uri_utils.rb +70 -0
- data/lib/axlsx/util/validators.rb +6 -6
- data/lib/axlsx/version.rb +1 -1
- data/lib/axlsx/workbook/defined_name.rb +2 -1
- data/lib/axlsx/workbook/defined_names.rb +1 -1
- data/lib/axlsx/workbook/shared_strings_table.rb +3 -3
- data/lib/axlsx/workbook/workbook.rb +87 -67
- data/lib/axlsx/workbook/workbook_view.rb +1 -1
- data/lib/axlsx/workbook/workbook_views.rb +1 -1
- data/lib/axlsx/workbook/worksheet/auto_filter/auto_filter.rb +4 -4
- data/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb +5 -3
- data/lib/axlsx/workbook/worksheet/auto_filter/filters.rb +4 -4
- data/lib/axlsx/workbook/worksheet/auto_filter/sort_condition.rb +1 -1
- data/lib/axlsx/workbook/worksheet/auto_filter/sort_state.rb +2 -2
- data/lib/axlsx/workbook/worksheet/border_creator.rb +4 -4
- data/lib/axlsx/workbook/worksheet/cell.rb +40 -20
- data/lib/axlsx/workbook/worksheet/cell_serializer.rb +1 -1
- data/lib/axlsx/workbook/worksheet/cfvo.rb +8 -2
- data/lib/axlsx/workbook/worksheet/col.rb +23 -9
- data/lib/axlsx/workbook/worksheet/col_breaks.rb +1 -1
- data/lib/axlsx/workbook/worksheet/cols.rb +1 -1
- data/lib/axlsx/workbook/worksheet/comment.rb +2 -2
- data/lib/axlsx/workbook/worksheet/comments.rb +1 -1
- data/lib/axlsx/workbook/worksheet/conditional_formatting.rb +9 -3
- data/lib/axlsx/workbook/worksheet/conditional_formatting_rule.rb +70 -15
- data/lib/axlsx/workbook/worksheet/conditional_formattings.rb +3 -3
- data/lib/axlsx/workbook/worksheet/data_validation.rb +53 -14
- data/lib/axlsx/workbook/worksheet/data_validations.rb +3 -3
- data/lib/axlsx/workbook/worksheet/date_time_converter.rb +2 -2
- data/lib/axlsx/workbook/worksheet/dimension.rb +1 -1
- data/lib/axlsx/workbook/worksheet/header_footer.rb +1 -1
- data/lib/axlsx/workbook/worksheet/icon_set.rb +17 -5
- data/lib/axlsx/workbook/worksheet/merged_cells.rb +1 -1
- data/lib/axlsx/workbook/worksheet/outline_pr.rb +1 -1
- data/lib/axlsx/workbook/worksheet/page_margins.rb +30 -7
- data/lib/axlsx/workbook/worksheet/page_set_up_pr.rb +1 -2
- data/lib/axlsx/workbook/worksheet/page_setup.rb +32 -9
- data/lib/axlsx/workbook/worksheet/pane.rb +9 -2
- data/lib/axlsx/workbook/worksheet/pivot_table.rb +30 -6
- data/lib/axlsx/workbook/worksheet/pivot_tables.rb +1 -1
- data/lib/axlsx/workbook/worksheet/print_options.rb +1 -0
- data/lib/axlsx/workbook/worksheet/protected_ranges.rb +1 -1
- data/lib/axlsx/workbook/worksheet/rich_text_run.rb +31 -11
- data/lib/axlsx/workbook/worksheet/row.rb +5 -2
- data/lib/axlsx/workbook/worksheet/row_breaks.rb +1 -1
- data/lib/axlsx/workbook/worksheet/selection.rb +8 -2
- data/lib/axlsx/workbook/worksheet/sheet_calc_pr.rb +1 -0
- data/lib/axlsx/workbook/worksheet/sheet_pr.rb +1 -1
- data/lib/axlsx/workbook/worksheet/sheet_protection.rb +1 -1
- data/lib/axlsx/workbook/worksheet/sheet_view.rb +30 -9
- data/lib/axlsx/workbook/worksheet/table_style_info.rb +3 -2
- data/lib/axlsx/workbook/worksheet/tables.rb +1 -1
- data/lib/axlsx/workbook/worksheet/worksheet.rb +28 -14
- data/lib/axlsx/workbook/worksheet/worksheet_comments.rb +4 -4
- data/lib/axlsx/workbook/worksheet/worksheet_drawing.rb +1 -1
- data/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb +3 -2
- data/lib/axlsx/workbook/worksheet/worksheet_hyperlinks.rb +2 -2
- data/lib/axlsx.rb +46 -30
- data/lib/caxlsx.rb +1 -1
- metadata +13 -52
|
@@ -43,15 +43,24 @@ module Axlsx
|
|
|
43
43
|
attr_reader :prs
|
|
44
44
|
|
|
45
45
|
# @see diagonalUp
|
|
46
|
-
def diagonal_up=(v)
|
|
46
|
+
def diagonal_up=(v)
|
|
47
|
+
Axlsx.validate_boolean v
|
|
48
|
+
@diagonal_up = v
|
|
49
|
+
end
|
|
47
50
|
alias :diagonalUp= :diagonal_up=
|
|
48
51
|
|
|
49
52
|
# @see diagonalDown
|
|
50
|
-
def diagonal_down=(v)
|
|
53
|
+
def diagonal_down=(v)
|
|
54
|
+
Axlsx.validate_boolean v
|
|
55
|
+
@diagonal_down = v
|
|
56
|
+
end
|
|
51
57
|
alias :diagonalDown= :diagonal_down=
|
|
52
58
|
|
|
53
59
|
# @see outline
|
|
54
|
-
def outline=(v)
|
|
60
|
+
def outline=(v)
|
|
61
|
+
Axlsx.validate_boolean v
|
|
62
|
+
@outline = v
|
|
63
|
+
end
|
|
55
64
|
|
|
56
65
|
# Serializes the object
|
|
57
66
|
# @param [String] str
|
|
@@ -4,10 +4,11 @@ module Axlsx
|
|
|
4
4
|
# A border part.
|
|
5
5
|
class BorderPr
|
|
6
6
|
include Axlsx::OptionsParser
|
|
7
|
+
|
|
7
8
|
# @return [Color] The color of this border part.
|
|
8
9
|
attr_reader :color
|
|
9
10
|
|
|
10
|
-
# @return [Symbol] The
|
|
11
|
+
# @return [Symbol] The style of this border part.
|
|
11
12
|
# @note
|
|
12
13
|
# The following are allowed
|
|
13
14
|
# :none
|
|
@@ -53,11 +54,22 @@ module Axlsx
|
|
|
53
54
|
end
|
|
54
55
|
|
|
55
56
|
# @see name
|
|
56
|
-
def name=(v)
|
|
57
|
+
def name=(v)
|
|
58
|
+
RestrictionValidator.validate "BorderPr.name", [:start, :end, :left, :right, :top, :bottom, :diagonal, :vertical, :horizontal], v
|
|
59
|
+
@name = v
|
|
60
|
+
end
|
|
61
|
+
|
|
57
62
|
# @see color
|
|
58
|
-
def color=(v)
|
|
63
|
+
def color=(v)
|
|
64
|
+
DataTypeValidator.validate(:color, Color, v)
|
|
65
|
+
@color = v
|
|
66
|
+
end
|
|
67
|
+
|
|
59
68
|
# @see style
|
|
60
|
-
def style=(v)
|
|
69
|
+
def style=(v)
|
|
70
|
+
RestrictionValidator.validate "BorderPr.style", [:none, :thin, :medium, :dashed, :dotted, :thick, :double, :hair, :mediumDashed, :dashDot, :mediumDashDot, :dashDotDot, :mediumDashDotDot, :slantDashDot], v
|
|
71
|
+
@style = v
|
|
72
|
+
end
|
|
61
73
|
|
|
62
74
|
# Serializes the object
|
|
63
75
|
# @param [String] str
|
|
@@ -25,7 +25,7 @@ module Axlsx
|
|
|
25
25
|
|
|
26
26
|
# The horizontal alignment of the cell.
|
|
27
27
|
# @note
|
|
28
|
-
# The horizontal cell
|
|
28
|
+
# The horizontal cell alignment style must be one of
|
|
29
29
|
# :general
|
|
30
30
|
# :left
|
|
31
31
|
# :center
|
|
@@ -86,34 +86,63 @@ module Axlsx
|
|
|
86
86
|
alias :readingOrder :reading_order
|
|
87
87
|
|
|
88
88
|
# @see horizontal
|
|
89
|
-
def horizontal=(v)
|
|
89
|
+
def horizontal=(v)
|
|
90
|
+
Axlsx.validate_horizontal_alignment v
|
|
91
|
+
@horizontal = v
|
|
92
|
+
end
|
|
93
|
+
|
|
90
94
|
# @see vertical
|
|
91
|
-
def vertical=(v)
|
|
95
|
+
def vertical=(v)
|
|
96
|
+
Axlsx.validate_vertical_alignment v
|
|
97
|
+
@vertical = v
|
|
98
|
+
end
|
|
99
|
+
|
|
92
100
|
# @see textRotation
|
|
93
|
-
def text_rotation=(v)
|
|
101
|
+
def text_rotation=(v)
|
|
102
|
+
Axlsx.validate_unsigned_int v
|
|
103
|
+
@text_rotation = v
|
|
104
|
+
end
|
|
94
105
|
alias :textRotation= :text_rotation=
|
|
95
106
|
|
|
96
107
|
# @see wrapText
|
|
97
|
-
def wrap_text=(v)
|
|
108
|
+
def wrap_text=(v)
|
|
109
|
+
Axlsx.validate_boolean v
|
|
110
|
+
@wrap_text = v
|
|
111
|
+
end
|
|
98
112
|
alias :wrapText= :wrap_text=
|
|
99
113
|
|
|
100
114
|
# @see indent
|
|
101
|
-
def indent=(v)
|
|
115
|
+
def indent=(v)
|
|
116
|
+
Axlsx.validate_unsigned_int v
|
|
117
|
+
@indent = v
|
|
118
|
+
end
|
|
102
119
|
|
|
103
120
|
# @see relativeIndent
|
|
104
|
-
def relative_indent=(v)
|
|
121
|
+
def relative_indent=(v)
|
|
122
|
+
Axlsx.validate_int v
|
|
123
|
+
@relative_indent = v
|
|
124
|
+
end
|
|
105
125
|
alias :relativeIndent= :relative_indent=
|
|
106
126
|
|
|
107
127
|
# @see justifyLastLine
|
|
108
|
-
def justify_last_line=(v)
|
|
128
|
+
def justify_last_line=(v)
|
|
129
|
+
Axlsx.validate_boolean v
|
|
130
|
+
@justify_last_line = v
|
|
131
|
+
end
|
|
109
132
|
alias :justifyLastLine= :justify_last_line=
|
|
110
133
|
|
|
111
134
|
# @see shrinkToFit
|
|
112
|
-
def shrink_to_fit=(v)
|
|
135
|
+
def shrink_to_fit=(v)
|
|
136
|
+
Axlsx.validate_boolean v
|
|
137
|
+
@shrink_to_fit = v
|
|
138
|
+
end
|
|
113
139
|
alias :shrinkToFit= :shrink_to_fit=
|
|
114
140
|
|
|
115
141
|
# @see readingOrder
|
|
116
|
-
def reading_order=(v)
|
|
142
|
+
def reading_order=(v)
|
|
143
|
+
Axlsx.validate_unsigned_int v
|
|
144
|
+
@reading_order = v
|
|
145
|
+
end
|
|
117
146
|
alias :readingOrder= :reading_order=
|
|
118
147
|
|
|
119
148
|
# Serializes the object
|
|
@@ -26,9 +26,16 @@ module Axlsx
|
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
# @see hidden
|
|
29
|
-
def hidden=(v)
|
|
29
|
+
def hidden=(v)
|
|
30
|
+
Axlsx.validate_boolean v
|
|
31
|
+
@hidden = v
|
|
32
|
+
end
|
|
33
|
+
|
|
30
34
|
# @see locked
|
|
31
|
-
def locked=(v)
|
|
35
|
+
def locked=(v)
|
|
36
|
+
Axlsx.validate_boolean v
|
|
37
|
+
@locked = v
|
|
38
|
+
end
|
|
32
39
|
|
|
33
40
|
# Serializes the object
|
|
34
41
|
# @param [String] str
|
|
@@ -8,7 +8,7 @@ module Axlsx
|
|
|
8
8
|
include Axlsx::OptionsParser
|
|
9
9
|
include Axlsx::SerializedAttributes
|
|
10
10
|
|
|
11
|
-
#
|
|
11
|
+
# Creates a new CellStyle object
|
|
12
12
|
# @option options [String] name
|
|
13
13
|
# @option options [Integer] xfId
|
|
14
14
|
# @option options [Integer] buildinId
|
|
@@ -48,17 +48,40 @@ module Axlsx
|
|
|
48
48
|
attr_reader :customBuiltin
|
|
49
49
|
|
|
50
50
|
# @see name
|
|
51
|
-
def name=(v)
|
|
51
|
+
def name=(v)
|
|
52
|
+
Axlsx.validate_string v
|
|
53
|
+
@name = v
|
|
54
|
+
end
|
|
55
|
+
|
|
52
56
|
# @see xfId
|
|
53
|
-
def xfId=(v)
|
|
57
|
+
def xfId=(v)
|
|
58
|
+
Axlsx.validate_unsigned_int v
|
|
59
|
+
@xfId = v
|
|
60
|
+
end
|
|
61
|
+
|
|
54
62
|
# @see builtinId
|
|
55
|
-
def builtinId=(v)
|
|
63
|
+
def builtinId=(v)
|
|
64
|
+
Axlsx.validate_unsigned_int v
|
|
65
|
+
@builtinId = v
|
|
66
|
+
end
|
|
67
|
+
|
|
56
68
|
# @see iLivel
|
|
57
|
-
def iLevel=(v)
|
|
69
|
+
def iLevel=(v)
|
|
70
|
+
Axlsx.validate_unsigned_int v
|
|
71
|
+
@iLevel = v
|
|
72
|
+
end
|
|
73
|
+
|
|
58
74
|
# @see hidden
|
|
59
|
-
def hidden=(v)
|
|
75
|
+
def hidden=(v)
|
|
76
|
+
Axlsx.validate_boolean v
|
|
77
|
+
@hidden = v
|
|
78
|
+
end
|
|
79
|
+
|
|
60
80
|
# @see customBuiltin
|
|
61
|
-
def customBuiltin=(v)
|
|
81
|
+
def customBuiltin=(v)
|
|
82
|
+
Axlsx.validate_boolean v
|
|
83
|
+
@customBuiltin = v
|
|
84
|
+
end
|
|
62
85
|
|
|
63
86
|
# Serializes the object
|
|
64
87
|
# @param [String] str
|
|
@@ -17,7 +17,7 @@ module Axlsx
|
|
|
17
17
|
|
|
18
18
|
serializable_attributes :auto, :rgb, :tint
|
|
19
19
|
|
|
20
|
-
# Determines if the color is system color
|
|
20
|
+
# Determines if the color is system color dependent
|
|
21
21
|
# @return [Boolean]
|
|
22
22
|
attr_reader :auto
|
|
23
23
|
|
|
@@ -47,7 +47,10 @@ module Axlsx
|
|
|
47
47
|
attr_reader :tint
|
|
48
48
|
|
|
49
49
|
# @see auto
|
|
50
|
-
def auto=(v)
|
|
50
|
+
def auto=(v)
|
|
51
|
+
Axlsx.validate_boolean v
|
|
52
|
+
@auto = v
|
|
53
|
+
end
|
|
51
54
|
|
|
52
55
|
# @see color
|
|
53
56
|
def rgb=(v)
|
|
@@ -61,12 +64,15 @@ module Axlsx
|
|
|
61
64
|
end
|
|
62
65
|
|
|
63
66
|
# @see tint
|
|
64
|
-
def tint=(v)
|
|
67
|
+
def tint=(v)
|
|
68
|
+
Axlsx.validate_float v
|
|
69
|
+
@tint = v
|
|
70
|
+
end
|
|
65
71
|
|
|
66
72
|
# This version does not support themes
|
|
67
73
|
# def theme=(v) Axlsx::validate_unsigned_integer v; @theme = v end
|
|
68
74
|
|
|
69
|
-
# Indexed colors are for backward
|
|
75
|
+
# Indexed colors are for backward compatibility which I am choosing not to support
|
|
70
76
|
# def indexed=(v) Axlsx::validate_unsigned_integer v; @indexed = v end
|
|
71
77
|
|
|
72
78
|
# Serializes the object
|
data/lib/axlsx/stylesheet/dxf.rb
CHANGED
|
@@ -49,17 +49,40 @@ module Axlsx
|
|
|
49
49
|
end
|
|
50
50
|
|
|
51
51
|
# @see Dxf#alignment
|
|
52
|
-
def alignment=(v)
|
|
52
|
+
def alignment=(v)
|
|
53
|
+
DataTypeValidator.validate "Dxf.alignment", CellAlignment, v
|
|
54
|
+
@alignment = v
|
|
55
|
+
end
|
|
56
|
+
|
|
53
57
|
# @see protection
|
|
54
|
-
def protection=(v)
|
|
58
|
+
def protection=(v)
|
|
59
|
+
DataTypeValidator.validate "Dxf.protection", CellProtection, v
|
|
60
|
+
@protection = v
|
|
61
|
+
end
|
|
62
|
+
|
|
55
63
|
# @see numFmt
|
|
56
|
-
def numFmt=(v)
|
|
64
|
+
def numFmt=(v)
|
|
65
|
+
DataTypeValidator.validate "Dxf.numFmt", NumFmt, v
|
|
66
|
+
@numFmt = v
|
|
67
|
+
end
|
|
68
|
+
|
|
57
69
|
# @see font
|
|
58
|
-
def font=(v)
|
|
70
|
+
def font=(v)
|
|
71
|
+
DataTypeValidator.validate "Dxf.font", Font, v
|
|
72
|
+
@font = v
|
|
73
|
+
end
|
|
74
|
+
|
|
59
75
|
# @see border
|
|
60
|
-
def border=(v)
|
|
76
|
+
def border=(v)
|
|
77
|
+
DataTypeValidator.validate "Dxf.border", Border, v
|
|
78
|
+
@border = v
|
|
79
|
+
end
|
|
80
|
+
|
|
61
81
|
# @see fill
|
|
62
|
-
def fill=(v)
|
|
82
|
+
def fill=(v)
|
|
83
|
+
DataTypeValidator.validate "Dxf.fill", Fill, v
|
|
84
|
+
@fill = v
|
|
85
|
+
end
|
|
63
86
|
|
|
64
87
|
# Serializes the object
|
|
65
88
|
# @param [String] str
|
|
@@ -28,6 +28,9 @@ module Axlsx
|
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
# @see fill_type
|
|
31
|
-
def fill_type=(v)
|
|
31
|
+
def fill_type=(v)
|
|
32
|
+
DataTypeValidator.validate "Fill.fill_type", [PatternFill, GradientFill], v
|
|
33
|
+
@fill_type = v
|
|
34
|
+
end
|
|
32
35
|
end
|
|
33
36
|
end
|
|
@@ -33,7 +33,7 @@ module Axlsx
|
|
|
33
33
|
# The charset of the font
|
|
34
34
|
# @return [Integer]
|
|
35
35
|
# @note
|
|
36
|
-
# The following values are defined in the OOXML specification and are OS
|
|
36
|
+
# The following values are defined in the OOXML specification and are OS dependent values
|
|
37
37
|
# 0 ANSI_CHARSET
|
|
38
38
|
# 1 DEFAULT_CHARSET
|
|
39
39
|
# 2 SYMBOL_CHARSET
|
|
@@ -112,15 +112,34 @@ module Axlsx
|
|
|
112
112
|
attr_reader :sz
|
|
113
113
|
|
|
114
114
|
# @see name
|
|
115
|
-
def name=(v)
|
|
115
|
+
def name=(v)
|
|
116
|
+
Axlsx.validate_string v
|
|
117
|
+
@name = v
|
|
118
|
+
end
|
|
119
|
+
|
|
116
120
|
# @see charset
|
|
117
|
-
def charset=(v)
|
|
121
|
+
def charset=(v)
|
|
122
|
+
Axlsx.validate_unsigned_int v
|
|
123
|
+
@charset = v
|
|
124
|
+
end
|
|
125
|
+
|
|
118
126
|
# @see family
|
|
119
|
-
def family=(v)
|
|
127
|
+
def family=(v)
|
|
128
|
+
Axlsx.validate_unsigned_int v
|
|
129
|
+
@family = v
|
|
130
|
+
end
|
|
131
|
+
|
|
120
132
|
# @see b
|
|
121
|
-
def b=(v)
|
|
133
|
+
def b=(v)
|
|
134
|
+
Axlsx.validate_boolean v
|
|
135
|
+
@b = v
|
|
136
|
+
end
|
|
137
|
+
|
|
122
138
|
# @see i
|
|
123
|
-
def i=(v)
|
|
139
|
+
def i=(v)
|
|
140
|
+
Axlsx.validate_boolean v
|
|
141
|
+
@i = v
|
|
142
|
+
end
|
|
124
143
|
|
|
125
144
|
# @see u
|
|
126
145
|
def u=(v)
|
|
@@ -131,19 +150,46 @@ module Axlsx
|
|
|
131
150
|
end
|
|
132
151
|
|
|
133
152
|
# @see strike
|
|
134
|
-
def strike=(v)
|
|
153
|
+
def strike=(v)
|
|
154
|
+
Axlsx.validate_boolean v
|
|
155
|
+
@strike = v
|
|
156
|
+
end
|
|
157
|
+
|
|
135
158
|
# @see outline
|
|
136
|
-
def outline=(v)
|
|
159
|
+
def outline=(v)
|
|
160
|
+
Axlsx.validate_boolean v
|
|
161
|
+
@outline = v
|
|
162
|
+
end
|
|
163
|
+
|
|
137
164
|
# @see shadow
|
|
138
|
-
def shadow=(v)
|
|
165
|
+
def shadow=(v)
|
|
166
|
+
Axlsx.validate_boolean v
|
|
167
|
+
@shadow = v
|
|
168
|
+
end
|
|
169
|
+
|
|
139
170
|
# @see condense
|
|
140
|
-
def condense=(v)
|
|
171
|
+
def condense=(v)
|
|
172
|
+
Axlsx.validate_boolean v
|
|
173
|
+
@condense = v
|
|
174
|
+
end
|
|
175
|
+
|
|
141
176
|
# @see extend
|
|
142
|
-
def extend=(v)
|
|
177
|
+
def extend=(v)
|
|
178
|
+
Axlsx.validate_boolean v
|
|
179
|
+
@extend = v
|
|
180
|
+
end
|
|
181
|
+
|
|
143
182
|
# @see color
|
|
144
|
-
def color=(v)
|
|
183
|
+
def color=(v)
|
|
184
|
+
DataTypeValidator.validate "Font.color", Color, v
|
|
185
|
+
@color = v
|
|
186
|
+
end
|
|
187
|
+
|
|
145
188
|
# @see sz
|
|
146
|
-
def sz=(v)
|
|
189
|
+
def sz=(v)
|
|
190
|
+
Axlsx.validate_unsigned_int v
|
|
191
|
+
@sz = v
|
|
192
|
+
end
|
|
147
193
|
|
|
148
194
|
# Serializes the object
|
|
149
195
|
# @param [String] str
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Axlsx
|
|
4
|
-
# A GradientFill defines the color and positioning for
|
|
4
|
+
# A GradientFill defines the color and positioning for gradient cell fill.
|
|
5
5
|
# @see Open Office XML Part 1 §18.8.24
|
|
6
6
|
class GradientFill
|
|
7
7
|
include Axlsx::OptionsParser
|
|
@@ -55,10 +55,16 @@ module Axlsx
|
|
|
55
55
|
attr_reader :stop
|
|
56
56
|
|
|
57
57
|
# @see type
|
|
58
|
-
def type=(v)
|
|
58
|
+
def type=(v)
|
|
59
|
+
Axlsx.validate_gradient_type v
|
|
60
|
+
@type = v
|
|
61
|
+
end
|
|
59
62
|
|
|
60
63
|
# @see degree
|
|
61
|
-
def degree=(v)
|
|
64
|
+
def degree=(v)
|
|
65
|
+
Axlsx.validate_float v
|
|
66
|
+
@degree = v
|
|
67
|
+
end
|
|
62
68
|
|
|
63
69
|
# @see left
|
|
64
70
|
def left=(v)
|
|
@@ -22,9 +22,16 @@ module Axlsx
|
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
# @see color
|
|
25
|
-
def color=(v)
|
|
25
|
+
def color=(v)
|
|
26
|
+
DataTypeValidator.validate "GradientStop.color", Color, v
|
|
27
|
+
@color = v
|
|
28
|
+
end
|
|
29
|
+
|
|
26
30
|
# @see position
|
|
27
|
-
def position=(v)
|
|
31
|
+
def position=(v)
|
|
32
|
+
DataTypeValidator.validate "GradientStop.position", Float, v, ->(arg) { arg >= 0 && arg <= 1 }
|
|
33
|
+
@position = v
|
|
34
|
+
end
|
|
28
35
|
|
|
29
36
|
# Serializes the object
|
|
30
37
|
# @param [String] str
|
|
@@ -61,10 +61,16 @@ module Axlsx
|
|
|
61
61
|
attr_reader :numFmtId
|
|
62
62
|
|
|
63
63
|
# @see numFmtId
|
|
64
|
-
def numFmtId=(v)
|
|
64
|
+
def numFmtId=(v)
|
|
65
|
+
Axlsx.validate_unsigned_int v
|
|
66
|
+
@numFmtId = v
|
|
67
|
+
end
|
|
65
68
|
|
|
66
69
|
# @see formatCode
|
|
67
|
-
def formatCode=(v)
|
|
70
|
+
def formatCode=(v)
|
|
71
|
+
Axlsx.validate_string v
|
|
72
|
+
@formatCode = v
|
|
73
|
+
end
|
|
68
74
|
|
|
69
75
|
# Serializes the object
|
|
70
76
|
# @param [String] str
|
|
@@ -6,6 +6,7 @@ module Axlsx
|
|
|
6
6
|
# @see Style#add_style
|
|
7
7
|
class PatternFill
|
|
8
8
|
include Axlsx::OptionsParser
|
|
9
|
+
|
|
9
10
|
# Creates a new PatternFill Object
|
|
10
11
|
# @option options [Symbol] patternType
|
|
11
12
|
# @option options [Color] fgColor
|
|
@@ -49,11 +50,22 @@ module Axlsx
|
|
|
49
50
|
attr_reader :patternType
|
|
50
51
|
|
|
51
52
|
# @see fgColor
|
|
52
|
-
def fgColor=(v)
|
|
53
|
+
def fgColor=(v)
|
|
54
|
+
DataTypeValidator.validate "PatternFill.fgColor", Color, v
|
|
55
|
+
@fgColor = v
|
|
56
|
+
end
|
|
57
|
+
|
|
53
58
|
# @see bgColor
|
|
54
|
-
def bgColor=(v)
|
|
59
|
+
def bgColor=(v)
|
|
60
|
+
DataTypeValidator.validate "PatternFill.bgColor", Color, v
|
|
61
|
+
@bgColor = v
|
|
62
|
+
end
|
|
63
|
+
|
|
55
64
|
# @see patternType
|
|
56
|
-
def patternType=(v)
|
|
65
|
+
def patternType=(v)
|
|
66
|
+
Axlsx.validate_pattern_type v
|
|
67
|
+
@patternType = v
|
|
68
|
+
end
|
|
57
69
|
|
|
58
70
|
# Serializes the object
|
|
59
71
|
# @param [String] str
|