XLSXComposer.CellDef (xlsx_composer v0.1.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_options(), any()}]

excel_cells()

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

section_cells()

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

style_options()

@type style_options() ::
  {: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

build(args \\ %{})

@spec build(map()) :: t()

displace(excel_coords, section_cords)

match_configuration?(cell_def, key, func)

@spec match_configuration?(t(), atom(), fun()) :: 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_options()) :: t()

to_elixlsx_cell_def(cell_def)

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