BoxComponentBuilder
in package
implements
ComponentBuilder
A builder class for box component.
Interfaces, Classes and Traits
- ComponentBuilder
- The interface that has a responsibility to build component.
Table of Contents
- $actionBuilder : TemplateActionBuilder
- $alignItems : ComponentAlignItems
- $backgroundAngle : string
- $backgroundCenterColor : string
- $backgroundCenterPosition : string
- $backgroundColor : string
- $backgroundEndColor : string
- $backgroundStartColor : string
- $backgroundType : ComponentBackgroundType
- $borderColor : string
- $borderWidth : string
- $component : array<string|int, mixed>|null
- $componentBuilders : array<string|int, ComponentBuilder>
- $cornerRadius : string
- $flex : int
- $height : string
- $justifyContent : ComponentJustifyContent
- $layout : ComponentLayout
- $margin : ComponentMargin
- $maxHeight : string
- $maxWidth : string
- $offsetBottom : string
- $offsetEnd : string
- $offsetStart : string
- $offsetTop : string
- $paddingAll : string
- $paddingBottom : string
- $paddingEnd : string
- $paddingStart : string
- $paddingTop : string
- $position : string
- $spacing : ComponentSpacing
- $width : string
- __construct() : mixed
- BoxComponentBuilder constructor.
- build() : array<string|int, mixed>
- Builds box component structure.
- builder() : BoxComponentBuilder
- Create empty BoxComponentBuilder.
- setAction() : $this
- Set action.
- setAlignItems() : $this
- Set alignItems
- setBackgroundAngle() : $this
- Set backgroundAngle
- setBackgroundCenterColor() : $this
- Set backgroundCenterColor
- setBackgroundCenterPosition() : $this
- Set backgroundCenterPosition
- setBackgroundColor() : $this
- Set background color
- setBackgroundEndColor() : $this
- Set backgroundEndColor
- setBackgroundStartColor() : $this
- Set backgroundStartColor
- setBackgroundType() : $this
- Set backgroundType
- setBorderColor() : $this
- Set border color
- setBorderWidth() : $this
- Set border width
- setContents() : $this
- Set contents.
- setCornerRadius() : $this
- Set corner radius
- setFlex() : $this
- Set flex.
- setHeight() : $this
- Set height
- setJustifyContent() : $this
- Set justifyContent
- setLayout() : $this
- Set laytout.
- setMargin() : $this
- Set margin.
- setMaxHeight() : $this
- Set maxHeight
- setMaxWidth() : $this
- Set maxWidth
- setOffsetBottom() : $this
- Set offsetBottom.
- setOffsetEnd() : $this
- Set offsetEnd.
- setOffsetStart() : $this
- Set offsetStart.
- setOffsetTop() : $this
- Set offsetTop.
- setPaddingAll() : $this
- Set paddingAll.
- setPaddingBottom() : $this
- Set paddingBottom.
- setPaddingEnd() : $this
- Set paddingEnd.
- setPaddingStart() : $this
- Set paddingStart.
- setPaddingTop() : $this
- Set paddingTop.
- setPosition() : $this
- Set position.
- setSpacing() : $this
- Set spacing.
- setWidth() : $this
- Set width
Properties
$actionBuilder
private
TemplateActionBuilder
$actionBuilder
$alignItems
private
ComponentAlignItems
$alignItems
$backgroundAngle
private
string
$backgroundAngle
$backgroundCenterColor
private
string
$backgroundCenterColor
$backgroundCenterPosition
private
string
$backgroundCenterPosition
$backgroundColor
private
string
$backgroundColor
$backgroundEndColor
private
string
$backgroundEndColor
$backgroundStartColor
private
string
$backgroundStartColor
$backgroundType
private
ComponentBackgroundType
$backgroundType
$borderColor
private
string
$borderColor
$borderWidth
private
string
$borderWidth
$component
private
array<string|int, mixed>|null
$component
$componentBuilders
private
array<string|int, ComponentBuilder>
$componentBuilders
$cornerRadius
private
string
$cornerRadius
$flex
private
int
$flex
$height
private
string
$height
$justifyContent
private
ComponentJustifyContent
$justifyContent
$layout
private
ComponentLayout
$layout
$margin
private
ComponentMargin
$margin
$maxHeight
private
string
$maxHeight
$maxWidth
private
string
$maxWidth
$offsetBottom
private
string
$offsetBottom
$offsetEnd
private
string
$offsetEnd
$offsetStart
private
string
$offsetStart
$offsetTop
private
string
$offsetTop
$paddingAll
private
string
$paddingAll
$paddingBottom
private
string
$paddingBottom
$paddingEnd
private
string
$paddingEnd
$paddingStart
private
string
$paddingStart
$paddingTop
private
string
$paddingTop
$position
private
string
$position
$spacing
private
ComponentSpacing
$spacing
$width
private
string
$width
Methods
__construct()
BoxComponentBuilder constructor.
public
__construct(ComponentLayout|string|null $layout, array<string|int, ComponentBuilder>|null $componentBuilders[, int|null $flex = null ][, ComponentSpacing|string|null $spacing = null ][, ComponentMargin|null $margin = null ][, mixed $actionBuilder = null ]) : mixed
Parameters
- $layout : ComponentLayout|string|null
- $componentBuilders : array<string|int, ComponentBuilder>|null
- $flex : int|null = null
- $spacing : ComponentSpacing|string|null = null
- $margin : ComponentMargin|null = null
- $actionBuilder : mixed = null
Return values
mixed —build()
Builds box component structure.
public
build() : array<string|int, mixed>
Return values
array<string|int, mixed> —builder()
Create empty BoxComponentBuilder.
public
static builder() : BoxComponentBuilder
Return values
BoxComponentBuilder —setAction()
Set action.
public
setAction(TemplateActionBuilder|null $actionBuilder) : $this
Parameters
- $actionBuilder : TemplateActionBuilder|null
Return values
$this —setAlignItems()
Set alignItems
public
setAlignItems(string|ComponentAlignItems|null $alignItems) : $this
Parameters
- $alignItems : string|ComponentAlignItems|null
Return values
$this —setBackgroundAngle()
Set backgroundAngle
public
setBackgroundAngle(string $backgroundAngle) : $this
specifiable "**deg". (e.g. 90deg, 23.5deg
Parameters
- $backgroundAngle : string
Return values
$this —setBackgroundCenterColor()
Set backgroundCenterColor
public
setBackgroundCenterColor(string $backgroundCenterColor) : $this
Hex color string: #RRGGBB or #RRGGBBAA
Parameters
- $backgroundCenterColor : string
Return values
$this —setBackgroundCenterPosition()
Set backgroundCenterPosition
public
setBackgroundCenterPosition(string $backgroundCenterPosition) : $this
specifiable percentage (0%~100%). (e.g. 5%, 10.1%, 100%
Parameters
- $backgroundCenterPosition : string
Return values
$this —setBackgroundColor()
Set background color
public
setBackgroundColor(string|null $backgroundColor) : $this
Hex color string: #RRGGBB or #RRGGBBAA
Parameters
- $backgroundColor : string|null
Return values
$this —setBackgroundEndColor()
Set backgroundEndColor
public
setBackgroundEndColor(string $backgroundEndColor) : $this
Hex color string: #RRGGBB or #RRGGBBAA
Parameters
- $backgroundEndColor : string
Return values
$this —setBackgroundStartColor()
Set backgroundStartColor
public
setBackgroundStartColor(string $backgroundStartColor) : $this
Hex color string: #RRGGBB or #RRGGBBAA
Parameters
- $backgroundStartColor : string
Return values
$this —setBackgroundType()
Set backgroundType
public
setBackgroundType(string|ComponentBackgroundType|null $backgroundType) : $this
Parameters
- $backgroundType : string|ComponentBackgroundType|null
Return values
$this —setBorderColor()
Set border color
public
setBorderColor(string|null $borderColor) : $this
Hex color string: #RRGGBB or #RRGGBBAA
Parameters
- $borderColor : string|null
Return values
$this —setBorderWidth()
Set border width
public
setBorderWidth(ComponentBorderWidth|string|null $borderWidth) : $this
specifiable pixel and keyword. (e.g. pixel: 5px keyword: none (defined in ComponentBorderWidth)
Parameters
- $borderWidth : ComponentBorderWidth|string|null
Return values
$this —setContents()
Set contents.
public
setContents(array<string|int, ComponentBuilder> $componentBuilders) : $this
Parameters
- $componentBuilders : array<string|int, ComponentBuilder>
Return values
$this —setCornerRadius()
Set corner radius
public
setCornerRadius(ComponentSpacing|string|null $cornerRadius) : $this
specifiable pixel and keyword. (e.g. pixel: 5px keyword: none (defined in ComponentSpacing)
Parameters
- $cornerRadius : ComponentSpacing|string|null
Return values
$this —setFlex()
Set flex.
public
setFlex(int|null $flex) : $this
Parameters
- $flex : int|null
Return values
$this —setHeight()
Set height
public
setHeight(string|null $height) : $this
specifiable percentage and pixel. (e.g. percentage: 5% pixel: 5px
※In horizontal and baseline box,
flex
property is ignored and the value is regarded as 0
Parameters
- $height : string|null
Return values
$this —setJustifyContent()
Set justifyContent
public
setJustifyContent(string|ComponentJustifyContent|null $justifyContent) : $this
Parameters
- $justifyContent : string|ComponentJustifyContent|null
Return values
$this —setLayout()
Set laytout.
public
setLayout(ComponentLayout|string $layout) : $this
Parameters
- $layout : ComponentLayout|string
Return values
$this —setMargin()
Set margin.
public
setMargin(ComponentMargin|string|null $margin) : $this
Parameters
- $margin : ComponentMargin|string|null
Return values
$this —setMaxHeight()
Set maxHeight
public
setMaxHeight(string|null $maxHeight) : $this
specifiable percentage and pixel. (e.g. percentage: 5% pixel: 5px
※If the height of the box calculated from the height property is greater than the height of the box calculated from the maxHeight property, the height of the box will shrink to the value specified by the maxHeight property.
Parameters
- $maxHeight : string|null
Return values
$this —setMaxWidth()
Set maxWidth
public
setMaxWidth(string|null $maxWidth) : $this
specifiable percentage and pixel. (e.g. percentage: 5% pixel: 5px
※If the width of the box calculated from the width property is greater than the width of the box calculated from the maxWidth property, the width of the box will shrink to the value specified by the maxWidth property.
Parameters
- $maxWidth : string|null
Return values
$this —setOffsetBottom()
Set offsetBottom.
public
setOffsetBottom(string|ComponentSpacing|null $offsetBottom) : $this
specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)
Parameters
- $offsetBottom : string|ComponentSpacing|null
Return values
$this —setOffsetEnd()
Set offsetEnd.
public
setOffsetEnd(string|ComponentSpacing|null $offsetEnd) : $this
specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)
Parameters
- $offsetEnd : string|ComponentSpacing|null
Return values
$this —setOffsetStart()
Set offsetStart.
public
setOffsetStart(string|ComponentSpacing|null $offsetStart) : $this
specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)
Parameters
- $offsetStart : string|ComponentSpacing|null
Return values
$this —setOffsetTop()
Set offsetTop.
public
setOffsetTop(string|ComponentSpacing|null $offsetTop) : $this
specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)
Parameters
- $offsetTop : string|ComponentSpacing|null
Return values
$this —setPaddingAll()
Set paddingAll.
public
setPaddingAll(string|ComponentSpacing|null $paddingAll) : $this
specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)
Parameters
- $paddingAll : string|ComponentSpacing|null
Return values
$this —setPaddingBottom()
Set paddingBottom.
public
setPaddingBottom(string|ComponentSpacing|null $paddingBottom) : $this
specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)
Parameters
- $paddingBottom : string|ComponentSpacing|null
Return values
$this —setPaddingEnd()
Set paddingEnd.
public
setPaddingEnd(string|ComponentSpacing|null $paddingEnd) : $this
specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)
Parameters
- $paddingEnd : string|ComponentSpacing|null
Return values
$this —setPaddingStart()
Set paddingStart.
public
setPaddingStart(string|ComponentSpacing|null $paddingStart) : $this
specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)
Parameters
- $paddingStart : string|ComponentSpacing|null
Return values
$this —setPaddingTop()
Set paddingTop.
public
setPaddingTop(string|ComponentSpacing|null $paddingTop) : $this
specifiable percentage, pixel and keyword. (e.g. percentage: 5% pixel: 5px keyword: none (defined in ComponentSpacing)
Parameters
- $paddingTop : string|ComponentSpacing|null
Return values
$this —setPosition()
Set position.
public
setPosition(string|ComponentPosition|null $position) : $this
specifiable relative or absolute
Parameters
- $position : string|ComponentPosition|null
Return values
$this —setSpacing()
Set spacing.
public
setSpacing(ComponentSpacing|string|null $spacing) : $this
Parameters
- $spacing : ComponentSpacing|string|null
Return values
$this —setWidth()
Set width
public
setWidth(string|null $width) : $this
specifiable percentage and pixel. (e.g. percentage: 5% pixel: 5px
※In horizontal and baseline box,
flex
property is ignored and the value is regarded as 0
Parameters
- $width : string|null