caxlsx 4.0.0 → 4.1.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 +8 -0
- data/examples/generate.rb +3 -1
- data/lib/axlsx/content_type/abstract_content_type.rb +4 -1
- data/lib/axlsx/content_type/content_type.rb +1 -1
- 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_series.rb +8 -2
- data/lib/axlsx/drawing/axis.rb +24 -6
- data/lib/axlsx/drawing/bar_series.rb +12 -3
- data/lib/axlsx/drawing/cat_axis.rb +20 -5
- data/lib/axlsx/drawing/chart.rb +32 -8
- data/lib/axlsx/drawing/d_lbls.rb +4 -4
- data/lib/axlsx/drawing/drawing.rb +1 -0
- data/lib/axlsx/drawing/hyperlink.rb +12 -3
- data/lib/axlsx/drawing/line_series.rb +8 -2
- data/lib/axlsx/drawing/marker.rb +19 -4
- data/lib/axlsx/drawing/one_cell_anchor.rb +8 -2
- data/lib/axlsx/drawing/pic.rb +13 -4
- data/lib/axlsx/drawing/pie_3D_chart.rb +1 -1
- data/lib/axlsx/drawing/pie_chart.rb +36 -0
- data/lib/axlsx/drawing/pie_series.rb +16 -4
- data/lib/axlsx/drawing/scaling.rb +18 -4
- data/lib/axlsx/drawing/ser_axis.rb +8 -2
- data/lib/axlsx/drawing/series.rb +8 -2
- data/lib/axlsx/drawing/view_3D.rb +8 -2
- data/lib/axlsx/package.rb +4 -1
- data/lib/axlsx/rels/relationship.rb +13 -3
- data/lib/axlsx/rels/relationships.rb +1 -1
- data/lib/axlsx/stylesheet/border.rb +12 -3
- data/lib/axlsx/stylesheet/border_pr.rb +14 -3
- data/lib/axlsx/stylesheet/cell_alignment.rb +38 -9
- data/lib/axlsx/stylesheet/cell_protection.rb +9 -2
- data/lib/axlsx/stylesheet/cell_style.rb +29 -6
- data/lib/axlsx/stylesheet/color.rb +8 -2
- data/lib/axlsx/stylesheet/dxf.rb +29 -6
- data/lib/axlsx/stylesheet/fill.rb +4 -1
- data/lib/axlsx/stylesheet/font.rb +58 -12
- data/lib/axlsx/stylesheet/gradient_fill.rb +8 -2
- 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 +14 -3
- data/lib/axlsx/stylesheet/styles.rb +57 -13
- 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/xf.rb +68 -15
- data/lib/axlsx/util/accessors.rb +8 -6
- data/lib/axlsx/util/storage.rb +1 -1
- data/lib/axlsx/version.rb +1 -1
- data/lib/axlsx/workbook/defined_names.rb +1 -1
- data/lib/axlsx/workbook/workbook.rb +19 -6
- data/lib/axlsx/workbook/workbook_views.rb +1 -1
- data/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb +4 -2
- data/lib/axlsx/workbook/worksheet/cell.rb +30 -10
- data/lib/axlsx/workbook/worksheet/cfvo.rb +8 -2
- data/lib/axlsx/workbook/worksheet/col_breaks.rb +1 -1
- data/lib/axlsx/workbook/worksheet/cols.rb +1 -1
- data/lib/axlsx/workbook/worksheet/conditional_formatting.rb +8 -2
- data/lib/axlsx/workbook/worksheet/conditional_formatting_rule.rb +69 -14
- data/lib/axlsx/workbook/worksheet/conditional_formattings.rb +1 -1
- data/lib/axlsx/workbook/worksheet/data_validation.rb +52 -13
- data/lib/axlsx/workbook/worksheet/data_validations.rb +1 -1
- data/lib/axlsx/workbook/worksheet/icon_set.rb +16 -4
- data/lib/axlsx/workbook/worksheet/merged_cells.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 +30 -7
- data/lib/axlsx/workbook/worksheet/pane.rb +8 -2
- data/lib/axlsx/workbook/worksheet/pivot_tables.rb +1 -1
- data/lib/axlsx/workbook/worksheet/protected_ranges.rb +1 -1
- data/lib/axlsx/workbook/worksheet/rich_text_run.rb +30 -10
- 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_protection.rb +1 -1
- data/lib/axlsx/workbook/worksheet/sheet_view.rb +30 -9
- data/lib/axlsx/workbook/worksheet/table_style_info.rb +1 -1
- data/lib/axlsx/workbook/worksheet/tables.rb +1 -1
- data/lib/axlsx/workbook/worksheet/worksheet.rb +18 -2
- data/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb +1 -1
- data/lib/axlsx/workbook/worksheet/worksheet_hyperlinks.rb +1 -1
- metadata +6 -44
data/lib/axlsx/drawing/pic.rb
CHANGED
@@ -69,7 +69,7 @@ module Axlsx
|
|
69
69
|
options[:href] = v
|
70
70
|
if hyperlink.is_a?(Hyperlink)
|
71
71
|
options.each do |o|
|
72
|
-
hyperlink.send("#{o[0]}=", o[1]) if hyperlink.respond_to? "#{o[0]}="
|
72
|
+
hyperlink.send(:"#{o[0]}=", o[1]) if hyperlink.respond_to? :"#{o[0]}="
|
73
73
|
end
|
74
74
|
else
|
75
75
|
@hyperlink = Hyperlink.new(self, options)
|
@@ -91,13 +91,22 @@ module Axlsx
|
|
91
91
|
end
|
92
92
|
|
93
93
|
# @see name
|
94
|
-
def name=(v)
|
94
|
+
def name=(v)
|
95
|
+
Axlsx.validate_string(v)
|
96
|
+
@name = v
|
97
|
+
end
|
95
98
|
|
96
99
|
# @see descr
|
97
|
-
def descr=(v)
|
100
|
+
def descr=(v)
|
101
|
+
Axlsx.validate_string(v)
|
102
|
+
@descr = v
|
103
|
+
end
|
98
104
|
|
99
105
|
# @see remote
|
100
|
-
def remote=(v)
|
106
|
+
def remote=(v)
|
107
|
+
Axlsx.validate_boolean(v)
|
108
|
+
@remote = v
|
109
|
+
end
|
101
110
|
|
102
111
|
def remote?
|
103
112
|
remote == 1 || remote.to_s == 'true'
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Axlsx
|
4
|
-
# The Pie3DChart is a three
|
4
|
+
# The Pie3DChart is a three dimensional pie chart (who would have guessed?) that you can add to your worksheet.
|
5
5
|
# @see Worksheet#add_chart
|
6
6
|
# @see Chart#add_series
|
7
7
|
# @see README for an example
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Axlsx
|
4
|
+
# The PieChart is a pie chart that you can add to your worksheet.
|
5
|
+
# @see Worksheet#add_chart
|
6
|
+
# @see Chart#add_series
|
7
|
+
# @see README for an example
|
8
|
+
class PieChart < Chart
|
9
|
+
# Creates a new pie chart object
|
10
|
+
# @param [GraphicFrame] frame The workbook that owns this chart.
|
11
|
+
# @option options [Cell, String] title
|
12
|
+
# @option options [Boolean] show_legend
|
13
|
+
# @option options [Symbol] grouping
|
14
|
+
# @option options [String] gap_depth
|
15
|
+
# @see Chart
|
16
|
+
def initialize(frame, options = {})
|
17
|
+
@vary_colors = true
|
18
|
+
super(frame, options)
|
19
|
+
@series_type = PieSeries
|
20
|
+
@d_lbls = nil
|
21
|
+
end
|
22
|
+
|
23
|
+
# Serializes the object
|
24
|
+
# @param [String] str
|
25
|
+
# @return [String]
|
26
|
+
def to_xml_string(str = +'')
|
27
|
+
super(str) do
|
28
|
+
str << '<c:pieChart>'
|
29
|
+
str << '<c:varyColors val="' << vary_colors.to_s << '"/>'
|
30
|
+
@series.each { |ser| ser.to_xml_string(str) }
|
31
|
+
d_lbls.to_xml_string(str) if @d_lbls
|
32
|
+
str << '</c:pieChart>'
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -36,10 +36,16 @@ module Axlsx
|
|
36
36
|
end
|
37
37
|
|
38
38
|
# @see colors
|
39
|
-
def colors=(v)
|
39
|
+
def colors=(v)
|
40
|
+
DataTypeValidator.validate "BarSeries.colors", [Array], v
|
41
|
+
@colors = v
|
42
|
+
end
|
40
43
|
|
41
44
|
# @see explosion
|
42
|
-
def explosion=(v)
|
45
|
+
def explosion=(v)
|
46
|
+
Axlsx.validate_unsigned_int(v)
|
47
|
+
@explosion = v
|
48
|
+
end
|
43
49
|
|
44
50
|
# Serializes the object
|
45
51
|
# @param [String] str
|
@@ -63,9 +69,15 @@ module Axlsx
|
|
63
69
|
private
|
64
70
|
|
65
71
|
# assigns the data for this series
|
66
|
-
def data=(v)
|
72
|
+
def data=(v)
|
73
|
+
DataTypeValidator.validate "Series.data", [NumDataSource], v
|
74
|
+
@data = v
|
75
|
+
end
|
67
76
|
|
68
77
|
# assigns the labels for this series
|
69
|
-
def labels=(v)
|
78
|
+
def labels=(v)
|
79
|
+
DataTypeValidator.validate "Series.labels", [AxDataSource], v
|
80
|
+
@labels = v
|
81
|
+
end
|
70
82
|
end
|
71
83
|
end
|
@@ -35,14 +35,28 @@ module Axlsx
|
|
35
35
|
attr_reader :min
|
36
36
|
|
37
37
|
# @see logBase
|
38
|
-
def logBase=(v)
|
38
|
+
def logBase=(v)
|
39
|
+
DataTypeValidator.validate "Scaling.logBase", [Integer], v, ->(arg) { arg >= 2 && arg <= 1000 }
|
40
|
+
@logBase = v
|
41
|
+
end
|
42
|
+
|
39
43
|
# @see orientation
|
40
|
-
def orientation=(v)
|
44
|
+
def orientation=(v)
|
45
|
+
RestrictionValidator.validate "Scaling.orientation", [:minMax, :maxMin], v
|
46
|
+
@orientation = v
|
47
|
+
end
|
48
|
+
|
41
49
|
# @see max
|
42
|
-
def max=(v)
|
50
|
+
def max=(v)
|
51
|
+
DataTypeValidator.validate "Scaling.max", Float, v
|
52
|
+
@max = v
|
53
|
+
end
|
43
54
|
|
44
55
|
# @see min
|
45
|
-
def min=(v)
|
56
|
+
def min=(v)
|
57
|
+
DataTypeValidator.validate "Scaling.min", Float, v
|
58
|
+
@min = v
|
59
|
+
end
|
46
60
|
|
47
61
|
# Serializes the object
|
48
62
|
# @param [String] str
|
@@ -22,11 +22,17 @@ module Axlsx
|
|
22
22
|
end
|
23
23
|
|
24
24
|
# @see tickLblSkip
|
25
|
-
def tick_lbl_skip=(v)
|
25
|
+
def tick_lbl_skip=(v)
|
26
|
+
Axlsx.validate_unsigned_int(v)
|
27
|
+
@tick_lbl_skip = v
|
28
|
+
end
|
26
29
|
alias :tickLblSkip= :tick_lbl_skip=
|
27
30
|
|
28
31
|
# @see tickMarkSkip
|
29
|
-
def tick_mark_skip=(v)
|
32
|
+
def tick_mark_skip=(v)
|
33
|
+
Axlsx.validate_unsigned_int(v)
|
34
|
+
@tick_mark_skip = v
|
35
|
+
end
|
30
36
|
alias :tickMarkSkip= :tick_mark_skip=
|
31
37
|
|
32
38
|
# Serializes the object
|
data/lib/axlsx/drawing/series.rb
CHANGED
@@ -40,7 +40,10 @@ module Axlsx
|
|
40
40
|
end
|
41
41
|
|
42
42
|
# @see order
|
43
|
-
def order=(v)
|
43
|
+
def order=(v)
|
44
|
+
Axlsx.validate_unsigned_int(v)
|
45
|
+
@order = v
|
46
|
+
end
|
44
47
|
|
45
48
|
# @see title
|
46
49
|
def title=(v)
|
@@ -52,7 +55,10 @@ module Axlsx
|
|
52
55
|
private
|
53
56
|
|
54
57
|
# assigns the chart for this series
|
55
|
-
def chart=(v)
|
58
|
+
def chart=(v)
|
59
|
+
DataTypeValidator.validate "Series.chart", Chart, v
|
60
|
+
@chart = v
|
61
|
+
end
|
56
62
|
|
57
63
|
# Serializes the object
|
58
64
|
# @param [String] str
|
@@ -78,11 +78,17 @@ module Axlsx
|
|
78
78
|
alias :rotY= :rot_y=
|
79
79
|
|
80
80
|
# @see depth_percent
|
81
|
-
def depth_percent=(v)
|
81
|
+
def depth_percent=(v)
|
82
|
+
RegexValidator.validate "#{self.class}.depth_percent", DEPTH_PERCENT_REGEX, v
|
83
|
+
@depth_percent = v
|
84
|
+
end
|
82
85
|
alias :depthPercent= :depth_percent=
|
83
86
|
|
84
87
|
# @see r_ang_ax
|
85
|
-
def r_ang_ax=(v)
|
88
|
+
def r_ang_ax=(v)
|
89
|
+
Axlsx.validate_boolean(v)
|
90
|
+
@r_ang_ax = v
|
91
|
+
end
|
86
92
|
alias :rAngAx= :r_ang_ax=
|
87
93
|
|
88
94
|
# @see perspective
|
data/lib/axlsx/package.rb
CHANGED
@@ -69,7 +69,10 @@ module Axlsx
|
|
69
69
|
end
|
70
70
|
|
71
71
|
# @see workbook
|
72
|
-
def workbook=(workbook)
|
72
|
+
def workbook=(workbook)
|
73
|
+
DataTypeValidator.validate :Package_workbook, Workbook, workbook
|
74
|
+
@workbook = workbook
|
75
|
+
end
|
73
76
|
|
74
77
|
# Serialize your workbook to disk as an xlsx document.
|
75
78
|
#
|
@@ -92,12 +92,22 @@ module Axlsx
|
|
92
92
|
end
|
93
93
|
|
94
94
|
# @see Target
|
95
|
-
def Target=(v)
|
95
|
+
def Target=(v)
|
96
|
+
Axlsx.validate_string v
|
97
|
+
@Target = v
|
98
|
+
end
|
99
|
+
|
96
100
|
# @see Type
|
97
|
-
def Type=(v)
|
101
|
+
def Type=(v)
|
102
|
+
Axlsx.validate_relationship_type v
|
103
|
+
@Type = v
|
104
|
+
end
|
98
105
|
|
99
106
|
# @see TargetMode
|
100
|
-
def TargetMode=(v)
|
107
|
+
def TargetMode=(v)
|
108
|
+
RestrictionValidator.validate 'Relationship.TargetMode', [:External, :Internal], v
|
109
|
+
@TargetMode = v
|
110
|
+
end
|
101
111
|
|
102
112
|
# serialize relationship
|
103
113
|
# @param [String] str
|
@@ -8,7 +8,7 @@ module Axlsx
|
|
8
8
|
class Relationships < SimpleTypedList
|
9
9
|
# Creates a new Relationships collection based on SimpleTypedList
|
10
10
|
def initialize
|
11
|
-
super
|
11
|
+
super(Relationship)
|
12
12
|
end
|
13
13
|
|
14
14
|
# The relationship instance for the given source object, or nil if none exists.
|
@@ -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
|
@@ -53,11 +53,22 @@ module Axlsx
|
|
53
53
|
end
|
54
54
|
|
55
55
|
# @see name
|
56
|
-
def name=(v)
|
56
|
+
def name=(v)
|
57
|
+
RestrictionValidator.validate "BorderPr.name", [:start, :end, :left, :right, :top, :bottom, :diagonal, :vertical, :horizontal], v
|
58
|
+
@name = v
|
59
|
+
end
|
60
|
+
|
57
61
|
# @see color
|
58
|
-
def color=(v)
|
62
|
+
def color=(v)
|
63
|
+
DataTypeValidator.validate(:color, Color, v)
|
64
|
+
@color = v
|
65
|
+
end
|
66
|
+
|
59
67
|
# @see style
|
60
|
-
def style=(v)
|
68
|
+
def style=(v)
|
69
|
+
RestrictionValidator.validate "BorderPr.style", [:none, :thin, :medium, :dashed, :dotted, :thick, :double, :hair, :mediumDashed, :dashDot, :mediumDashDot, :dashDotDot, :mediumDashDotDot, :slantDashDot], v
|
70
|
+
@style = v
|
71
|
+
end
|
61
72
|
|
62
73
|
# Serializes the object
|
63
74
|
# @param [String] str
|
@@ -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
|
@@ -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
|
@@ -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,7 +64,10 @@ 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
|
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
|
@@ -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
|
@@ -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
|