XLSXComposer.CellDef (xlsx_composer v0.2.0)

View Source

Elixir.XLSXComposer.CellDef showcases all supported options as a struct that is later folded into representation required by Elixlsx.

:configuration is a map of settings you might want to use to tag elements and later on, globally collect and apply an additional style if required.

Summary

Types

border_style()

@type border_style() :: list()

content()

@type content() :: any()

elixlsx_definition()

@type elixlsx_definition() :: [content() | {style_option(), any()}]

excel_cells()

@type excel_cells() :: %{required(XLSXComposer.ExcelCoords.t()) => t()}

new_attrs()

@type new_attrs() :: %{
  optional(:content) => content(),
  optional(:wrap_text) => boolean(),
  optional(:font) => String.t(),
  optional(:align_vertical) => boolean(),
  optional(:align_horizontal) => boolean(),
  optional(:bold) => boolean(),
  optional(:italic) => boolean(),
  optional(:underline) => boolean(),
  optional(:strike) => boolean(),
  optional(:size) => pos_integer(),
  optional(:color) => String.t(),
  optional(:bg_color) => String.t(),
  optional(:num_format) => String.t(),
  optional(:datetime) => boolean(),
  optional(:yyyymmdd) => String.t(),
  optional(:border) => Keyword.t(),
  optional(:configuration) => %{required(String.t()) => any()}
}

section_cells()

@type section_cells() :: %{required(XLSXComposer.SectionCoords.t()) => t()}

style_option()

@type style_option() ::
  {:wrap_text, boolean()}
  | {:font, String.t()}
  | {:align_vertical, boolean()}
  | {:align_horizontal, boolean()}
  | {:bold, boolean()}
  | {:italic, boolean()}
  | {:underline, boolean()}
  | {:strike, boolean()}
  | {:size, pos_integer()}
  | {:color, String.t()}
  | {:bg_color, String.t()}
  | {:num_format, String.t()}
  | {:datetime, boolean()}
  | {:yyyymmdd, boolean()}

t()

@type t() :: %XLSXComposer.CellDef{
  align_horizontal: boolean() | nil,
  align_vertical: boolean() | nil,
  bg_color: String.t() | nil,
  bold: boolean() | nil,
  border: Keyword.t() | nil,
  color: String.t() | nil,
  configuration: %{required(String.t()) => any()},
  content: content(),
  datetime: boolean() | nil,
  font: String | nil,
  italic: boolean() | nil,
  num_format: String.t() | nil,
  size: pos_integer() | nil,
  strike: boolean() | nil,
  underline: boolean() | nil,
  wrap_text: boolean() | nil,
  yyyymmdd: String.t() | nil
}

Functions

displace(excel_coords, section_cords)

match_configuration?(cell_def, key, func)

@spec match_configuration?(t(), atom(), fun()) :: t()

new(args \\ %{})

@spec new(new_attrs()) :: t()

set_configuration(cell_def, key, value)

@spec set_configuration(t(), atom(), any()) :: t()

set_content(cell_def, content)

@spec set_content(t(), content()) :: t()

set_style_option(cell_def, arg)

@spec set_style_option(t(), style_option()) :: t()

to_elixlsx_cell_def(cell_def)

@spec to_elixlsx_cell_def(t() | nil) :: elixlsx_definition() | nil