Skip to content

Helper Nodes ​

Child nodes that only live inside a specific component, such as Column for Table or Tab for Tabs. They are not in the Catalog and cannot be used alone.

AccordionItem ​

class

Cg\ComponentFramework\Component\Accordion\AccordionItem

Extends:Component → Node · Implements:RenderableNode、Htmlable · View:cg-component::Accordion.AccordionItemView

MethodReturns
content(mixed $content)static
getContent()NodeCollection
getIcon()?Icon
getLabel()Htmlable|string
icon(Icon|string|null $icon)static
isOpen()bool
label(Htmlable|Closure|string $label)static
static make(string $key, Htmlable|Closure|string $label)static
open(Closure|bool $condition = true)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

class

Cg\ComponentFramework\Component\Breadcrumbs\BreadcrumbItem

Extends:Component → Node · Implements:RenderableNode、Htmlable · View:cg-component::Breadcrumbs.BreadcrumbItemView

MethodReturns
current(Closure|bool $condition = true)static
icon(Icon|string|null $icon)static
static make(string $key, Htmlable|Closure|string $label)static
resolve()array
url(Closure|string|null $url)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

CarouselSlide ​

class

Cg\ComponentFramework\Component\Carousel\CarouselSlide

Extends:Component → Node · Implements:RenderableNode、Htmlable · View:cg-component::Carousel.CarouselSlideView

MethodReturns
caption(Htmlable|Closure|string|null $title, Htmlable|Closure|string|null $description = null)static
content(mixed $content)static
label(Closure|string|null $label)static
static make(string $key, mixed $content = null)static
resolve()array
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

ChartSeries ​

final class not extendable

Cg\ComponentFramework\Component\Chart\ChartSeries

Chart 的一條資料序列。純值物件:所有欄位在建構時驗證, 輸出成 Chart 規格(data-chart)的 series 項目。

Constants (allowed values)

  • TYPES:line · area · step · column · scatter
  • LABEL_STYLES:plain · badge · pill
MethodReturnsNotes
axis(int $axis)self1 = 左側 Y1;2 = 右側 Y2(獨立刻度)。
color(string $color)self
dashed(bool $condition = true)self
static flushMacros()—Flush the existing macros.
static hasMacro($name)—Checks if macro is registered.
hidden(bool $condition = true)self
key()string
labels(int $angle = 0, string $style = 'plain', int $minGap = 36, ?string $format = null)self資料點標籤。minGap 是相鄰標籤的最小像素間距,過密時自動減少顯示。
lineWidth(int $width)self
static macro($name, $macro)—Register a custom macro.
static make(string $key, ?string $name = null)self
static mixin($mixin, $replace = true)—Mix another object into the class.
smooth(bool $condition = true)self
stacked(bool $condition = true)self
toArray()array
tooltip(string $template)self自訂 tooltip 範本;中立佔位 {name} {category} {date} {value},各驅動自行轉成原生語法。
type(string $type)self單條序列覆寫圖表型態,用來做折線+柱狀混合圖。
y2()self

Column ​

class

Cg\ComponentFramework\Component\Table\Column

表格欄位。可直接使用,也可以繼承成特定用途的欄位:覆寫 formatCellState() 就能改變 cell 的呈現(見 Columns\ImageColumn、Columns\TextInputColumn 等)。

Extends:Component → Node · Implements:Htmlable、RenderableNode、TableColumnNode · View:cg-component::Table.ColumnView

Constants (allowed values)

  • BREAKPOINTS:sm · md · lg · xl
  • RELATION_AGGREGATES:count · exists · sum · avg · min · max
  • ALIGNS:start · center · end
  • SORT_DIRECTIONS:asc · desc
MethodReturnsNotes
align(string $align)static
avg(string $relation, string $column)static
badge(Closure|array|bool $colors = true)static以 Badge 呈現。$colors 可為「原始值 → 顏色」對照表,或 fn ($state, $record) => 'success'。
boolean(string $trueLabel = '是', string $falseLabel = '否')static以圖示呈現真偽值,並保留可被螢幕閱讀器讀出的文字。
collapsible(bool $condition = true)static收進每列的展開面板,以「標籤:值」呈現,不佔主表格的欄寬。
colspan(Closure|int $span)static這一格往右合併幾欄(被合併的欄位在該列不輸出)。Closure 收到 ($record, $column)。
copyable(Closure|bool $condition = true, string $label = '複製')static在 cell 旁加上複製按鈕。Closure 可自訂複製的內容:fn ($record, $state) => ...
counts(string $relation)static關聯筆數(withCount),結果放在這一欄的 key 上。
date(string $format = 'Y-m-d', ?string $timezone = null)static
dateTime(string $format = 'Y-m-d H:i', ?string $timezone = null)static
description(Htmlable|Closure|string|null $description)staticcell 下方的次要說明;Closure 收到 ($record, $column)。
formatStateUsing(?Closure $formatter)static
formatSummaryValue(mixed $value)Htmlable|string|null格式化彙總值:沿用欄位的 numeric/money/date/limit 與字串 prefix、suffix。
formula(?string $formula)static類 Excel 公式,參照同一列的其他欄位(或紀錄上的任何屬性)。 公式欄位可以互相參照;循環參照會在 cell 顯示 #CYCLE!。
getColspan(mixed $record)int
getDatabaseAttribute()?string能在資料庫直接聚合或比對的欄位名稱;公式、stateUsing、關聯聚合回傳 null。
getLabel()Htmlable|string
getRelationAggregate()?array
getSearchAttributes()array
getSearchQueryCallback()?Closure
getSearchValues(mixed $record, ?ColumnSet $columns = null)array未格式化的原始 state,供記憶體資料源搜尋。
getSortAttribute()string
getSortQueryCallback()?Closure
getSortValue(mixed $record, ?ColumnSet $columns = null)mixed未格式化的原始 state,供記憶體資料源排序。
getState(mixed $record, string|int|null $rowKey = null, int $rowIndex = 0, ?ColumnSet $columns = null)mixed未格式化的 state。公式欄位需要 $columns 才能解析對其他欄位的參照; 沒有時參照會直接讀紀錄屬性。
getSummarizers()array
getVisibleFrom()?string
hasColspan()bool
hasFormula()bool
headingData(array $context = [])array
isCollapsible()bool
isManagedSortable()bool由 Table 依 query string 排序(相對於 sortUrl/linkerSort 的外部排序)。
isSearchable()bool
isSortable()bool
isToggleable()bool
isToggledHiddenByDefault()bool
label(Htmlable|Closure|string $label)static
leafColumns()array
limit(?int $length, string $end = '…')static
linkerSort(string $method, array $extra = [])static
static make(string $key, Htmlable|Closure|string|null $label = null)static
max(string $relation, string $column)static
min(string $relation, string $column)static
money(string $currency = 'TWD', int $decimals = 0, ?string $locale = null)static
numeric(int $decimals = 0, string $decimalSeparator = '.', string $thousandsSeparator = ',')static
placeholder(Htmlable|Closure|string|null $placeholder)static
prefix(Closure|string|null $prefix)static
relationAggregate(string $relation, string $function, ?string $column = null)static關聯聚合欄位:只適用 Eloquent 資料源,以子查詢計算,可排序。
resolveCell(mixed $record, string|int $rowKey, int $rowIndex, ?ColumnSet $columns = null)HtmlString
searchable(array|bool $condition = true)static加入表格全域搜尋。傳入陣列可指定實際搜尋的欄位(可含關聯點號)。
searchUsing(Closure $callback)static
sortable(Closure|string|null $url = null)static
sortAttribute(string $attribute)static排序實際使用的欄位,預設與 key 相同;Eloquent 關聯點號會轉成子查詢排序。
sortDirection(?string $direction)static
sortUrl(Closure|string|null $url)static
sortUsing(Closure $callback)static
stateUsing(?Closure $resolver)static
suffix(Closure|string|null $suffix)static
sum(string $relation, string $column)static關聯加總(withSum)。
summarize(Summarizer|Traversable|array $summarizers)static
toggleable(bool $condition = true, bool $hiddenByDefault = false)static讓使用者在「欄位」選單切換顯示;hiddenByDefault 決定初始狀態。
visibleFrom(?string $breakpoint)static容器寬度小於斷點時隱藏這一欄(以 container query 判斷,不需要 JavaScript)。
wrap(bool $condition = true)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

ColumnGroup ​

class

Cg\ComponentFramework\Component\Table\ColumnGroup

跨欄標題:把相鄰欄位收在同一個上層標題下,輸出兩列 thead 與 scope="colgroup"。

Extends:Component → Node · Implements:Htmlable、RenderableNode、TableColumnNode · View:cg-component::Table.ColumnGroupView

MethodReturns
align(string $align)static
columns(iterable $columns)static
getAlign()string
getLabel()Htmlable|string
label(Htmlable|Closure|string $label)static
leafColumns()array
static make(Htmlable|Closure|string $label, iterable $columns = [])static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

ComboboxOption ​

class

Cg\ComponentFramework\Component\Combobox\ComboboxOption

Extends:Component → Node · Implements:RenderableNode、Htmlable · View:cg-component::Combobox.ComboboxOptionView

MethodReturns
description(Closure|string|null $description)static
disabled(Closure|bool $condition = true)static
keywords(array|string $keywords)static
static make(string|int|float $value, Closure|string $label)static
resolve()array
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

ListItem ​

class

Cg\ComponentFramework\Component\ItemList\ListItem

Extends:Component → Node · Implements:RenderableNode、Htmlable · View:cg-component::ItemList.ListItemView

MethodReturns
current(Closure|bool $condition = true)static
description(Htmlable|Closure|string|null $description)static
disabled(Closure|bool $condition = true)static
icon(Icon|string|null $icon)static
static make(string $key, Htmlable|Closure|string $label)static
meta(Htmlable|Closure|string|null $meta)static
resolve()array
url(Closure|string|null $url)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

class

Cg\ComponentFramework\Component\Navigation\NavigationItem

Extends:Component → Node · Implements:RenderableNode、Htmlable · View:cg-component::Navigation.NavigationItemView

MethodReturns
badge(Htmlable|Closure|string|null $badge)static
children(iterable $children)static
current(Closure|bool $condition = true)static
description(Closure|string|null $description)static
disabled(Closure|bool $condition = true)static
expanded(Closure|bool $condition = true)static
getChildren()NodeCollection
icon(Icon|string|null $icon)static
static make(string $key, Htmlable|Closure|string $label)static
push(NavigationItem $child)static
resolve()array
url(Closure|string|null $url)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

SoundSource ​

class

Cg\ComponentFramework\Component\Sound\SoundSource

Extends:Component → Node · Implements:RenderableNode、Htmlable · View:cg-component::Sound.SoundSourceView

MethodReturns
static make(Closure|string $source, ?string $type = null)static
resolve()array
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

SoundTrack ​

class

Cg\ComponentFramework\Component\Sound\SoundTrack

Extends:Component → Node · Implements:RenderableNode、Htmlable · View:cg-component::Sound.SoundTrackView

Constants (allowed values)

  • KINDS:subtitles · captions · descriptions · chapters · metadata
MethodReturns
default(bool $condition = true)static
static make(Closure|string $source, string $kind, string $label, ?string $language = null)static
resolve()array
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

Step ​

class

Cg\ComponentFramework\Component\Stepper\Step

Extends:Component → Node · Implements:RenderableNode、Htmlable · View:cg-component::Stepper.StepView

Constants (allowed values)

  • STATUSES:pending · current · complete · error
MethodReturns
complete(bool $condition = true)static
current(bool $condition = true)static
description(Closure|string|null $description)static
disabled(Closure|bool $condition = true)static
error(bool $condition = true)static
icon(Icon|string|null $icon)static
static make(string $key, Htmlable|Closure|string $label)static
resolve()array
status(Closure|string $status)static
url(Closure|string|null $url)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

Tab ​

class

Cg\ComponentFramework\Component\Tabs\Tab

Extends:Component → Node · Implements:RenderableNode、Htmlable · View:cg-component::Tabs.TabView

MethodReturns
content(mixed $content)static
disabled(Closure|bool $condition = true)static
getContent()NodeCollection
getIcon()?Icon
getLabel()Htmlable|string
icon(Icon|string|null $icon)static
isDisabled()bool
label(Htmlable|Closure|string $label)static
static make(string $key, Htmlable|Closure|string $label)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

TreeNode ​

class

Cg\ComponentFramework\Component\TreeView\TreeNode

Extends:Component → Node · Implements:RenderableNode、Htmlable · View:cg-component::TreeView.TreeNodeView

MethodReturns
children(iterable $children)static
description(Closure|string|null $description)static
disabled(Closure|bool $condition = true)static
expanded(Closure|bool $condition = true)static
getChildren()NodeCollection
getDescription()?string
getIcon()?Icon
getLabel()Htmlable|string
getUrl()?string
icon(Icon|string|null $icon)static
isDisabled()bool
isExpanded()bool
isSelected()bool
label(Htmlable|Closure|string $label)static
static make(string $key, Htmlable|Closure|string $label)static
push(TreeNode $child)static
selected(Closure|bool $condition = true)static
url(Closure|string|null $url)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

VideoSource ​

class

Cg\ComponentFramework\Component\Video\VideoSource

Extends:Component → Node · Implements:RenderableNode、Htmlable · View:cg-component::Video.VideoSourceView

MethodReturns
static make(Closure|string $source, ?string $type = null)static
resolve()array
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

VideoTrack ​

class

Cg\ComponentFramework\Component\Video\VideoTrack

Extends:Component → Node · Implements:RenderableNode、Htmlable · View:cg-component::Video.VideoTrackView

Constants (allowed values)

  • KINDS:subtitles · captions · descriptions · chapters · metadata
MethodReturns
default(bool $condition = true)static
static make(Closure|string $source, string $kind, string $label, ?string $language = null)static
resolve()array
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData


Generated from source by scripts/wiki-components/generate.php via reflection. Do not edit by hand.