元件類別
Catalog 中公開的 61 個頂層元件,依類別名稱 A–Z 排列。每個條目只列本類別的方法;繼承自 Component/Action/Field 的方法收在摺疊區塊裡。
TIP
想看可以直接複製的範例,請到元件總覽。這裡是完整的方法簽名字典。
Accordion
類別Cg\ComponentFramework\Component\Accordion\Accordion
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:accordion · 分類:資料組合 · 用法與範例 → · View:cg-component::Accordion.AccordionView
| 方法 | 回傳 |
|---|---|
getItems() | NodeCollection |
items(iterable $items) | static |
label(?string $label) | static |
static make(iterable $items = []) | static |
push(AccordionItem $item) | static |
single(bool $condition = true) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Alert
類別Cg\ComponentFramework\Component\Alert\Alert
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:alert · 分類:回饋 · 用法與範例 → · View:cg-component::Alert.AlertView
| 方法 | 回傳 |
|---|---|
actions(Actions|Traversable|array $actions) | static |
danger() | static |
dismissible(bool $condition = true, string $label = '關閉通知') | static |
icon(Icon|string|null $icon) | static |
info() | static |
static make(Htmlable|Closure|string $message) | static |
message(Htmlable|Closure|string $message) | static |
success() | static |
title(Htmlable|Closure|string|null $title) | static |
type(NotifyType|string $type) | static |
visibilityState(string $key) | static |
warning() | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Avatar
類別Cg\ComponentFramework\Component\Avatar\Avatar
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:avatar · 分類:內容與媒體 · 用法與範例 → · View:cg-component::Avatar.AvatarView
常數(可用選項值)
SHAPES:circle·rounded·squareSIZES:xs·sm·md·lg·xl·2xlSTATUSES:online·offline·away·busy
| 方法 | 回傳 |
|---|---|
decorative(bool $condition = true) | static |
eager(bool $condition = true) | static |
initials(Closure|string|null $initials) | static |
static make(Closure|string $name, Closure|string|null $source = null) | static |
shape(string $shape) | static |
size(string $size) | static |
source(Closure|string|null $source) | static |
status(?string $status) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Badge
類別Cg\ComponentFramework\Component\Badge\Badge
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:badge · 分類:基礎呈現 · 用法與範例 → · View:cg-component::Badge.BadgeView
常數(可用選項值)
COLORS:neutral·primary·success·warning·danger·infoSIZES:sm·md·lg
| 方法 | 回傳 |
|---|---|
color(string $color) | static |
icon(Icon|string|null $icon) | static |
static make(Htmlable|Closure|string $label) | static |
rounded(bool $condition = true) | static |
size(string $size) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Breadcrumbs
類別Cg\ComponentFramework\Component\Breadcrumbs\Breadcrumbs
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:breadcrumbs · 分類:導覽 · 用法與範例 → · View:cg-component::Breadcrumbs.BreadcrumbsView
| 方法 | 回傳 |
|---|---|
items(iterable $items) | static |
label(string $label) | static |
static make(iterable $items = []) | static |
push(BreadcrumbItem $item) | static |
separator(Htmlable|string $separator) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Button
類別Cg\ComponentFramework\Component\Button\Button
繼承:Action → Component → Node · 實作:ActionComponent、RenderableNode、Htmlable · Catalog ID:button · 分類:動作 · 用法與範例 → · View:cg-component::Button.ButtonView
常數(可用選項值)
TYPES:button·submit·resetCOLORS:neutral·primary·success·warning·danger·infoSIZES:sm·md·lgVARIANTS:solid·outline·ghost
| 方法 | 回傳 |
|---|---|
static make(Htmlable|Closure|string $label) | static |
name(?string $name) | static |
type(string $type) | static |
value(string|int|float|bool|null $value) | static |
繼承來的方法 (34)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
來自 Action:closesModal color disabled icon iconOnly linkerCall opensModal size stateSet stateToggle variant
ButtonGroup
類別Cg\ComponentFramework\Component\ButtonGroup\ButtonGroup
繼承:Component → Node · 實作:Htmlable、RenderableNode、ActionComponent · Catalog ID:button-group · 分類:動作 · 用法與範例 → · View:cg-component::ButtonGroup.ButtonGroupView
常數(可用選項值)
ORIENTATIONS:horizontal·vertical
| 方法 | 回傳 |
|---|---|
actions(iterable $actions) | static |
attached(bool $condition = true) | static |
getActions() | NodeCollection |
label(?string $label) | static |
static make(iterable $actions = []) | static |
orientation(string $orientation) | static |
push(ActionComponent $action) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Callout
類別Cg\ComponentFramework\Component\Callout\Callout
繼承:Alert → Component → Node · 實作:Htmlable、RenderableNode · Catalog ID:callout · 分類:回饋 · 用法與範例 → · View:cg-component::Callout.CalloutView
| 方法 | 回傳 |
|---|---|
static make(Htmlable|Closure|string $message) | static |
繼承來的方法 (34)
來自 Alert:actions danger dismissible icon info message success title type visibilityState warning
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Card
類別Cg\ComponentFramework\Component\Card\Card
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:card · 分類:內容與媒體 · 用法與範例 → · View:cg-component::Card.CardView
常數(可用選項值)
COLORS:default·primary·success·warning·danger·info
| 方法 | 回傳 | 說明 |
|---|---|---|
actions(Actions|Traversable|array $actions) | static | |
body(mixed $content) | static | |
collapsible(bool $condition = true, bool $collapsed = false) | static | 純客戶端展開/收合,不發 request。 |
color(string $color) | static | |
description(Htmlable|Closure|string|null $description) | static | |
getActions() | Actions | |
getBody() | NodeCollection | |
getDescription() | Htmlable|string|null | |
getImage() | ?string | |
getTitle() | Htmlable|string|null | |
getUrl() | ?string | |
headingLevel(int $level) | static | |
image(?string $image) | static | |
isCollapsed() | bool | |
isCollapseServerControlled() | bool | |
isCollapsible() | bool | |
static isSafeUrl(?string $url) | bool | |
static make(Htmlable|Closure|string|null $title = null) | static | |
schema(Schema $schema) | static | |
serverCollapsible(bool $collapsed = false) | static | 用 CardLinker 保存展開狀態;只有需要伺服器 guard 時才使用。 |
title(Htmlable|Closure|string|null $title) | static | |
url(?string $url) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Carousel
類別Cg\ComponentFramework\Component\Carousel\Carousel
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:carousel · 分類:內容與媒體 · 用法與範例 → · View:cg-component::Carousel.CarouselView
常數(可用選項值)
ASPECTS:auto·video·square·portraitEFFECTS:slide·fade
| 方法 | 回傳 |
|---|---|
active(?string $key) | static |
aspect(string $aspect) | static |
autoplay(int $seconds = 5) | static |
controls(bool $condition = true) | static |
effect(string $effect) | static |
indicators(bool $condition = true) | static |
label(string $label) | static |
loop(bool $condition = true) | static |
static make(iterable $slides = []) | static |
push(CarouselSlide $slide) | static |
slides(iterable $slides) | static |
stateKey(string $key) | static |
withoutAutoplay() | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Chart
類別Cg\ComponentFramework\Component\Chart\Chart
圖表元件。繪圖由「驅動」負責(預設 amCharts 5,內建 Chart.js,可自行擴充;見 ChartDriver)。
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:chart · 分類:資料組合 · 用法與範例 → · View:cg-component::Chart.ChartView
常數(可用選項值)
TYPES:line·area·step·column·bar·scatter·pie·donut·gantt·rawCURSORS:none·cross·horizontal·vertical·segment·multiTHEMES:animated·dark·responsive·micro·kelly·moonrise·spirited·frozen·datavizEXPORT_FORMATS:png·jpg·svg·pdf·csv·json·xlsx·print·htmlRANGES:1D·1W·1M·3M·6M·1Y·YTD·allTIME_UNITS:millisecond·second·minute·hour·day·week·month·yearDURATION_UNITS:year·month·week·day·hour·minute·second
| 方法 | 回傳 | 說明 |
|---|---|---|
amchart(array $settings) | static | 【amCharts 專屬】原生設定合併:key 為 chart/xAxis/yAxis/yAxis2/cursor/legend/series.{key}, 值就是 amCharts .new(root, { … }) 的 settings。Color/Percent 用 {"type":"Color","value":"#f00"}。 等同 driverOptions('amcharts', ['merge' => …])。 |
area() | static | |
static assertColor(string $color, string $what) | string | |
axis(int $axis, ?string $title = null, int|float|null $min = null, int|float|null $max = null, ?string $format = null, bool $logarithmic = false) | static | Y1/Y2 軸:標題、範圍、數字格式(amCharts 格式字串,例如 "#,###.0")。 |
axisTooltips(bool $x = true, bool $y = true) | static | 【amCharts 專屬】游標在水平軸(x)/垂直軸(y)上的值標籤,各自獨立。 全站預設見 config('cg-components.chart.driver_options.amcharts')。 |
bar() | static | |
categoryField(string $field) | static | |
column() | static | |
cursor(string $mode) | static | none|cross|horizontal|vertical|segment(區段比對面板)|multi(多點指標+區段比對) |
cursorWhenEmpty(bool $show = true) | static | 沒有資料時是否仍顯示游標。預設 false:沒資料的圖游標只會出現 NaN 與空白指標,所以隱藏。 |
data(Traversable|Arrayable|Closure|array $rows) | static | 資料列。接受陣列、Collection/Arrayable(含 Eloquent 集合)、任何 iterable, 或 Closure(渲染時才呼叫)。每列可以是陣列或物件/Model。 |
dateField(string $field, string $unit = 'day', int $count = 1) | static | 以時間軸呈現。日期欄位的值可以是 Carbon/字串/毫秒時間戳,輸出時統一轉毫秒。 |
static definePreset(string $name, Closure $configure) | void | 註冊命名預設,之後 ->preset('dashboard') 一行套用整組設定。 |
donut() | static | |
driver(string $name) | static | 選擇繪圖驅動(預設見 config cg-components.chart.driver)。 規格裡不支援的能力會在前端安全降級;要在伺服器端就擋下請用 requireSupport()。 |
driverName() | string | |
driverOptions(string $driver, array $options) | static | 驅動專屬選項(遞迴合併)。通用規格以外的東西都放這裡,例如 driverOptions('chartjs', ['merge' => ['options' => […]]])。 |
emptyText(string $text, ?string $hint = null) | static | 沒有可畫資料時顯示的文字(預設「無資料」)。 資料來自 source() 時,第一次載入完成前不會顯示。 |
exportable(?array $formats = null, ?string $filename = null) | static | 匯出:圖片(png/jpg/svg)、PDF、資料(csv/json/xlsx)、列印、 html=單檔互動 HTML(離線打開仍可 tooltip、縮放、切換序列;需要驅動支援 export:html)。 |
static flushMacros() | — | Flush the existing macros. |
static flushPresets() | void | |
font(string $family, ?string $pdfFont = null) | static | 圖表字型,同時用於 PDF 匯出(需內嵌字型才能輸出中日韓文字)。 |
static gantt(string $name) | static | 甘特圖入口:自動建立任務階層、進度、相依連線。 |
ganttOptions(array $options) | static | |
static hasMacro($name) | — | Checks if macro is registered. |
height(string $height) | static | |
hook(string $name) | static | 宣告前端註冊的擴充 hook 名稱(registerChartHook)。只能引用名稱, 不接受任何伺服器傳來的程式碼。 |
label(string $label) | static | |
legend(bool $condition = true) | static | |
legendValues(bool $show = true) | static | 圖例跟著游標顯示該點每個序列的數值(數字格式依序列所在軸的 format)。 需要游標(cursor 不是 none);會一併開啟圖例。驅動不支援時只顯示名稱。 |
line() | static | |
static macro($name, $macro) | — | Register a custom macro. |
static make(string $name) | static | |
markBand(int|float $from, int|float $to, ?string $label = null, ?string $color = null, int $axis = 1) | static | 數值區間底色(正常範圍、目標帶)。 |
markDate(mixed $date, ?string $label = null, ?string $color = null, bool $dashed = true) | static | 時間軸上的垂直標記線(發佈日、事件)。需要 dateField()。 |
markLine(int|float $value, ?string $label = null, ?string $color = null, int $axis = 1, bool $dashed = true) | static | 水平參考線(目標值、警戒線)。橫向 bar 時是垂直線。 |
markPeriod(mixed $from, mixed $to, ?string $label = null, ?string $color = null) | static | 時間區間底色(活動期間、維護時段)。需要 dateField()。 |
static mixin($mixin, $replace = true) | — | Mix another object into the class. |
native(array $settings) | static | 目前驅動的原生設定合併(amCharts:chart/xAxis/yAxis/yAxis2/cursor/legend/series.{key}; Chart.js:直接深度合併進 config)。換驅動時這些設定不會跟著套用到別的驅動。 |
numberFormat(string $format) | static | 全圖數字格式(中立語法,例如 "#,###.##"、"#.#%"、"$#,###";各驅動自行轉譯);個別軸用 axis(format:) 覆寫。 |
palette(array $colors) | static | |
pie() | static | |
preset(string $name) | static | |
rawConfig(array $config) | static | 【amCharts 專屬】直接使用 amCharts 5 JSON config(JsonParser 格式),免學習/免遷移。 元件仍然負責資料載入、工具列、縮放同步、匯出與更新; rows 會自動寫入 config 中 ref 名稱為 "data" 的資料。 |
refresh(int $seconds) | static | 每 N 秒重新呼叫 source;分頁隱藏時暫停。 |
renderer(string $renderer) | static | 【amCharts 專屬】繪圖方式:canvas(預設;大量資料、即時更新較快)或 svg (向量、列印銳利,點擊判斷不讀像素,不受瀏覽器防指紋雜訊影響)。 全站預設見 config('cg-components.chart.driver_options.amcharts.renderer')。 |
requireSupport() | static | 嚴格模式:驅動缺任何一項能力就丟例外,而不是讓前端靜默降級。 |
resolvedDriver() | ChartDriver | |
resolvedRows() | array | |
scatter() | static | |
scrollbar(bool $x = true, bool $y = false) | static | |
series(array $series) | static | 序列。除了 ChartSeries,也接受簡寫: ->series(['revenue' => '營收', 'orders' => '訂單']) 欄位 => 顯示名稱 ->series(['revenue', 'orders']) 只給欄位(名稱同欄位) 要設定顏色、Y2、標籤等再用 ChartSeries::make()。 |
source(string $method, array $args = []) | static | 資料來源:掛載的 Linker(->linker()/->stateless())上的方法。 方法回 ok(['rows' => [...]]) 取代資料,ok(['append' => [...]]) 追加。 |
spec() | array | |
step() | static | |
style(array $style) | static | 完整樣式:fontFamily fontSize textColor gridColor background lineWidth areaOpacity columnRadius columnGap strokeColor tooltipFill。 |
syncZoom(string $group, ?string $call = null) | static | 縮放範圍同步。同一頁、同一瀏覽器的其他分頁(BroadcastChannel)皆共用 group; 給 $call 時,範圍也會經 Linker 方法存到伺服器,其他客戶端靠 refresh() 輪詢套用。 |
tapSpec(Closure $tap) | static | 對最終規格做最後修改(單一實例的擴充點)。Closure 收到規格陣列、回傳規格陣列。 |
tasks(array $tasks) | static | 每個任務:id、name、start、duration(工作日,0=里程碑)、 progress(0–100)、parent、link(後續任務 id)、color。 |
theme(string $theme) | static | |
time(array $ranges = ['1M', '3M', '6M', '1Y', 'all'], array $granularity = []) | static | 時間導覽:預設範圍按鈕與資料彙總粒度(本地運算,不打伺服器)。 |
title(string $title, ?string $subtitle = null) | static | 圖表上方的可見標題(accessible label 另用 label())。 |
type(string $type) | static | |
unless($value = null, ?callable $callback = null, ?callable $default = null) | — | Apply the callback if the given "value" is (or resolves to) falsy. |
unsupported() | array | 規格需要、但目前驅動沒有的能力(空陣列=完整支援)。 |
when($value = null, ?callable $callback = null, ?callable $default = null) | — | Apply the callback if the given "value" is (or resolves to) truthy. |
window(int $points) | static | 滾動視窗:追加資料時只保留最後 N 筆。 |
withoutZoom() | static | |
zoom(bool $x = true, bool $y = false, string $mode = 'select', bool $wheel = false) | static | 縮放:select=拖曳框選放大、pan=拖曳平移。滾輪縮放預設關閉(避免捲動頁面時 被圖表劫持),要開請傳 wheel: true。 |
zoomOutButton(bool $show = true) | static | 【amCharts 專屬】藍色圓形還原縮放按鈕。全站預設見 config('cg-components.chart.driver_options.amcharts.zoomOutButton');這裡覆寫單張圖。 |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Checkbox
類別Cg\ComponentFramework\Component\Checkbox\Checkbox
繼承:Field → Component → Node · 實作:FieldComponent、RenderableNode、Htmlable · Catalog ID:checkbox · 分類:輸入欄位 · 用法與範例 → · View:cg-component::Checkbox.CheckboxView
| 方法 | 回傳 |
|---|---|
checked(Closure|bool $condition = true) | static |
static make(string $name, Htmlable|Closure|string|null $label = null) | static |
uncheckedValue(string|int|float|bool|null $value) | static |
value(string|int|float|bool $value) | static |
繼承來的方法 (36)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
來自 Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state
ColorPicker
類別Cg\ComponentFramework\Component\ColorPicker\ColorPicker
繼承:Field → Component → Node · 實作:FieldComponent、RenderableNode、Htmlable · Catalog ID:color-picker · 分類:輸入欄位 · 用法與範例 → · View:cg-component::ColorPicker.ColorPickerView
| 方法 | 回傳 |
|---|---|
static make(string $name, Htmlable|Closure|string|null $label = null) | static |
presets(array $colors) | static |
showText(Closure|bool $condition = true) | static |
uppercase(bool $condition = true) | static |
value(Closure|string $value) | static |
繼承來的方法 (36)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
來自 Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state
Combobox
類別Cg\ComponentFramework\Component\Combobox\Combobox
繼承:Field → Component → Node · 實作:FieldComponent、RenderableNode、Htmlable · Catalog ID:combobox · 分類:輸入欄位 · 用法與範例 → · View:cg-component::Combobox.ComboboxView
| 方法 | 回傳 |
|---|---|
autocomplete(?string $autocomplete) | static |
clearable(Closure|bool $condition = true, string $label = '清除選取') | static |
emptyMessage(Closure|string $message) | static |
static make(string $name, Htmlable|Closure|string|null $label = null) | static |
options(Traversable|Closure|array $options) | static |
placeholder(Closure|string|null $placeholder) | static |
selected(Closure|string|int|float|null $value) | static |
繼承來的方法 (36)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
來自 Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state
DateInput
類別Cg\ComponentFramework\Component\DateInput\DateInput
繼承:Field → Component → Node · 實作:FieldComponent、RenderableNode、Htmlable · Catalog ID:date-input · 分類:輸入欄位 · 用法與範例 → · View:cg-component::DateInput.DateInputView
常數(可用選項值)
MODES:date·datetime-local·time·month·week
| 方法 | 回傳 |
|---|---|
autocomplete(?string $autocomplete) | static |
static make(string $name, Htmlable|Closure|string|null $label = null) | static |
max(?string $value) | static |
min(?string $value) | static |
mode(string $mode) | static |
step(string|int|float|null $step) | static |
value(Closure|string|null $value) | static |
繼承來的方法 (36)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
來自 Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state
DatePicker
類別Cg\ComponentFramework\Component\DatePicker\DatePicker
繼承:Field → Component → Node · 實作:FieldComponent、RenderableNode、Htmlable · Catalog ID:date-picker · 分類:輸入欄位 · 用法與範例 → · View:cg-component::DatePicker.DatePickerView
常數(可用選項值)
DISPLAY_FORMATS:Y-m-d·Y/m/d·d/m/Y·m/d/Y
| 方法 | 回傳 |
|---|---|
clearable(Closure|bool $condition = true) | static |
displayFormat(string $format) | static |
static make(string $name, Htmlable|Closure|string|null $label = null) | static |
max(?string $value) | static |
min(?string $value) | static |
placeholder(Closure|string|null $placeholder) | static |
value(Closure|string|null $value) | static |
weekStartsOn(int $day) | static |
繼承來的方法 (36)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
來自 Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state
Drawer
類別Cg\ComponentFramework\Component\Drawer\Drawer
繼承:Modal → Component → Node · 實作:Htmlable、RenderableNode · Catalog ID:drawer · 分類:浮動介面 · 用法與範例 → · View:cg-component::Modal.ModalView
| 方法 | 回傳 |
|---|---|
static make(string $name, Htmlable|Closure|string|null $title = null, string $side = 'right') | static |
side(string $side) | static |
variant(string $variant) | static |
繼承來的方法 (34)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
來自 Modal:autofocus body bodyId closeButton description footer getName label modalAttributes openButton static
DropdownMenu
類別Cg\ComponentFramework\Component\DropdownMenu\DropdownMenu
原生 details disclosure;選單開關不需要自訂 JavaScript。
繼承:Action → Component → Node · 實作:ActionComponent、RenderableNode、Htmlable · Catalog ID:dropdown-menu · 分類:動作 · 用法與範例 → · View:cg-component::DropdownMenu.DropdownMenuView
常數(可用選項值)
PLACEMENTS:start·endWIDTHS:sm·md·lgCOLORS:neutral·primary·success·warning·danger·infoSIZES:sm·md·lgVARIANTS:solid·outline·ghost
| 方法 | 回傳 |
|---|---|
actions(iterable $actions) | static |
static make(Htmlable|Closure|string $label, iterable $actions = []) | static |
open(bool $condition = true) | static |
placement(string $placement) | static |
push(ActionComponent $action) | static |
width(string $width) | static |
繼承來的方法 (34)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
來自 Action:closesModal color disabled icon iconOnly linkerCall opensModal size stateSet stateToggle variant
FieldSet
類別Cg\ComponentFramework\Component\FieldSet\FieldSet
繼承:Component → Node · 實作:Htmlable、RenderableNode、RequiresMultipart · Catalog ID:field-set · 分類:頁面結構 · 用法與範例 → · View:cg-component::FieldSet.FieldSetView
| 方法 | 回傳 |
|---|---|
columns(int $columns) | static |
components(iterable $components) | static |
description(Htmlable|Closure|string|null $description) | static |
disabled(Closure|bool $condition = true) | static |
hideLegend(bool $condition = true) | static |
static make(Htmlable|Closure|string $legend, iterable $components = []) | static |
push(Component $component) | static |
requiresMultipart() | bool |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
File
類別Cg\ComponentFramework\Component\File\File
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:file · 分類:內容與媒體 · 用法與範例 → · View:cg-component::File.FileView
常數(可用選項值)
TARGETS:_self·_blankVARIANTS:default·compact
| 方法 | 回傳 |
|---|---|
description(Htmlable|Closure|string|null $description) | static |
disabled(Closure|bool $condition = true) | static |
download(string|bool $filename = true) | static |
icon(Icon|string|null $icon) | static |
static make(Htmlable|Closure|string $name, Closure|string $url) | static |
mimeType(Closure|string|null $mimeType) | static |
modifiedAt(DateTimeInterface|Closure|null $modifiedAt) | static |
newTab(bool $condition = true) | static |
sizeBytes(Closure|int|null $bytes) | static |
variant(string $variant) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
FileUpload
類別Cg\ComponentFramework\Component\FileUpload\FileUpload
繼承:Field → Component → Node · 實作:Htmlable、RenderableNode、FieldComponent、RequiresMultipart · Catalog ID:file-upload · 分類:輸入欄位 · 用法與範例 → · View:cg-component::FileUpload.FileUploadView
| 方法 | 回傳 |
|---|---|
accept(array|string|null $types) | static |
capture(?string $facingMode = 'environment') | static |
imageOnly() | static |
static make(string $name, Htmlable|Closure|string|null $label = null) | static |
maxFiles(?int $count) | static |
maxSize(?int $kilobytes) | static |
multiple(Closure|bool $condition = true) | static |
requiresMultipart() | bool |
繼承來的方法 (36)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
來自 Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state
Footer
類別Cg\ComponentFramework\Component\Footer\Footer
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:footer · 分類:頁面結構 · 用法與範例 → · View:cg-component::Footer.FooterView
常數(可用選項值)
VARIANTS:default·muted·dark
| 方法 | 回傳 |
|---|---|
actions(Actions|Traversable|array $actions) | static |
bordered(bool $condition = true) | static |
columns(iterable $components) | static |
copyright(Htmlable|Closure|string|null $copyright) | static |
static make(Htmlable|Closure|string|null $copyright = null) | static |
push(Component $component) | static |
variant(string $variant) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Header
類別Cg\ComponentFramework\Component\Header\Header
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:header · 分類:頁面結構 · 用法與範例 → · View:cg-component::Header.HeaderView
常數(可用選項值)
VARIANTS:default·transparent·dark
| 方法 | 回傳 |
|---|---|
actions(Actions|Traversable|array $actions) | static |
bordered(bool $condition = true) | static |
brand(Htmlable|Closure|string|null $brand, Closure|string|null $url = null) | static |
compact(bool $condition = true) | static |
content(iterable $components) | static |
static make(Htmlable|Closure|string|null $brand = null) | static |
push(Component $component) | static |
sticky(bool $condition = true) | static |
variant(string $variant) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Heading
類別Cg\ComponentFramework\Component\Heading\Heading
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:heading · 分類:基礎呈現 · 用法與範例 → · View:cg-component::Heading.HeadingView
常數(可用選項值)
SIZES:xs·sm·md·lg·xl·2xl
| 方法 | 回傳 |
|---|---|
description(?string $description) | static |
level(int $level) | static |
static make(Htmlable|Closure|string $content) | static |
size(?string $size) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Hero
類別Cg\ComponentFramework\Component\Hero\Hero
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:hero · 分類:頁面結構 · 用法與範例 → · View:cg-component::Hero.HeroView
常數(可用選項值)
ALIGNMENTS:start·centerSIZES:sm·md·lgTONES:default·muted·primary·dark
| 方法 | 回傳 |
|---|---|
actions(Actions|Traversable|array $actions) | static |
align(string $alignment) | static |
body(mixed $content) | static |
description(Htmlable|Closure|string|null $description) | static |
eyebrow(Htmlable|Closure|string|null $eyebrow) | static |
headingLevel(int $level) | static |
static make(Htmlable|Closure|string $title) | static |
media(?Component $media) | static |
size(string $size) | static |
tone(string $tone) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Icon
類別Cg\ComponentFramework\Component\Icon\Icon
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:icon · 分類:基礎呈現 · 用法與範例 → · View:cg-component::Icon.IconView
常數(可用選項值)
SIZES:xs·sm·md·lg·xl
| 方法 | 回傳 | 說明 |
|---|---|---|
getName() | string | |
label(?string $label) | static | null 代表裝飾圖示,非 null 代表有語意的圖片。 |
static make(Closure|string $name) | static | |
size(string $size) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Image
類別Cg\ComponentFramework\Component\Image\Image
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:image · 分類:基礎呈現 · 用法與範例 → · View:cg-component::Image.ImageView
常數(可用選項值)
FITS:contain·cover·fill·none·scale-down
| 方法 | 回傳 |
|---|---|
dimensions(?int $width, ?int $height) | static |
eager(bool $condition = true) | static |
fit(string $fit) | static |
static make(Closure|string $source, Closure|string $alt = '') | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
ItemList
類別Cg\ComponentFramework\Component\ItemList\ItemList
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:item-list · 分類:資料組合 · 用法與範例 → · View:cg-component::ItemList.ItemListView
常數(可用選項值)
SPACINGS:none·sm·md·lg
| 方法 | 回傳 |
|---|---|
divided(bool $condition = true) | static |
items(iterable $items) | static |
label(?string $label) | static |
static make(iterable $items = []) | static |
ordered(bool $condition = true, int $start = 1) | static |
push(ListItem $item) | static |
spacing(string $spacing) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Label
類別Cg\ComponentFramework\Component\Label\Label
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:label · 分類:基礎呈現 · 用法與範例 → · View:cg-component::Label.LabelView
| 方法 | 回傳 |
|---|---|
for(?string $id) | static |
static make(Htmlable|Closure|string $content, ?string $for = null) | static |
required(bool $condition = true) | static |
visuallyHidden(bool $condition = true) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Link
類別Cg\ComponentFramework\Component\Link\Link
繼承:Action → Component → Node · 實作:ActionComponent、RenderableNode、Htmlable · Catalog ID:link · 分類:動作 · 用法與範例 → · View:cg-component::Link.LinkView
常數(可用選項值)
TARGETS:_self·_blank·_parent·_topCOLORS:neutral·primary·success·warning·danger·infoSIZES:sm·md·lgVARIANTS:solid·outline·ghost
| 方法 | 回傳 |
|---|---|
download(string|bool $download = true) | static |
static make(Htmlable|Closure|string $label, Closure|string $url = '#') | static |
newTab(bool $condition = true) | static |
rel(array|string $relations) | static |
target(string $target) | static |
繼承來的方法 (34)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
來自 Action:closesModal color disabled icon iconOnly linkerCall opensModal size stateSet stateToggle variant
Modal
類別Cg\ComponentFramework\Component\Modal\Modal
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:modal · 分類:浮動介面 · 用法與範例 → · View:cg-component::Modal.ModalView
| 方法 | 回傳 |
|---|---|
autofocus(?string $selector) | static |
body(mixed $body) | static |
bodyId() | string |
closeButton(bool $condition = true) | static |
description(Closure|string|null $description) | static |
footer(Actions|Traversable|array $actions) | static |
getName() | string |
label(?string $label) | static |
static make(string $name, Htmlable|Closure|string|null $title = null) | static |
modalAttributes() | HtmlString |
openButton(Htmlable|Closure|string $label) | Button |
static(bool $condition = true) | static |
variant(string $variant) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Navigation
類別Cg\ComponentFramework\Component\Navigation\Navigation
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:navigation · 分類:導覽 · 用法與範例 → · View:cg-component::Navigation.NavigationView
常數(可用選項值)
ORIENTATIONS:horizontal·vertical
| 方法 | 回傳 |
|---|---|
items(iterable $items) | static |
label(string $label) | static |
static make(iterable $items = []) | static |
orientation(string $orientation) | static |
push(NavigationItem $item) | static |
single(bool $condition = true) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Pagination
類別Cg\ComponentFramework\Component\Pagination\Pagination
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:pagination · 分類:導覽 · 用法與範例 → · View:cg-component::Pagination.PaginationView
| 方法 | 回傳 | 說明 |
|---|---|---|
hideWhenSinglePage(bool $condition = true) | static | |
label(string $label) | static | |
linkerPaginate(string $method, array $extra = []) | static | |
static make(Paginator|CursorPaginator|Closure $paginator) | static | |
onEachSide(int $pages) | static | |
pageAttributes(string|int|null $page) | HtmlString | int=頁碼;string=cursor 分頁的游標,參數名稱改為 cursor。 |
renderPagesWith(string $controller, string $target, string $method = 'components', array $params = [], array $extra = []) | static | |
safePageUrl(Paginator $paginator, int $page) | string | |
showSummary(bool $condition = true) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Popover
類別Cg\ComponentFramework\Component\Popover\Popover
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:popover · 分類:浮動介面 · 用法與範例 → · View:cg-component::Popover.PopoverView
常數(可用選項值)
PLACEMENTS:top·right·bottom·leftALIGNS:start·center·endWIDTHS:sm·md·lg
| 方法 | 回傳 |
|---|---|
content(mixed $content) | static |
dismissible(bool $condition = true, string $label = '關閉浮動內容') | static |
id(string $id) | static |
label(?string $label) | static |
static make(Component $trigger, mixed $content = null) | static |
offset(int $pixels) | static |
open(bool $condition = true) | static |
placement(string $placement, string $align = 'start') | static |
stateKey(string $key) | static |
title(Htmlable|Closure|string|null $title) | static |
width(string $width) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
ProgressBar
類別Cg\ComponentFramework\Component\ProgressBar\ProgressBar
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:progress-bar · 分類:狀態與流程 · 用法與範例 → · View:cg-component::ProgressBar.ProgressBarView
常數(可用選項值)
COLORS:primary·success·warning·danger·infoSIZES:sm·md·lg
| 方法 | 回傳 |
|---|---|
color(string $color) | static |
label(Closure|string $label) | static |
static make(Closure|string $label = '處理進度') | static |
range(int|float $min, int|float $max) | static |
showLabel(bool $condition = true) | static |
showValue(Closure|bool $condition = true) | static |
size(string $size) | static |
unit(string $suffix, string $prefix = '') | static |
value(Closure|int|float|null $value) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
ProgressIndicator
類別Cg\ComponentFramework\Component\ProgressIndicator\ProgressIndicator
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:progress-indicator · 分類:狀態與流程 · 用法與範例 → · View:cg-component::ProgressIndicator.ProgressIndicatorView
常數(可用選項值)
COLORS:primary·success·warning·danger·infoSIZES:sm·md·lg·xl
| 方法 | 回傳 |
|---|---|
color(string $color) | static |
label(Closure|string $label) | static |
static make(Closure|string $label = '處理進度') | static |
range(int|float $min, int|float $max) | static |
showValue(Closure|bool $condition = true) | static |
size(string $size) | static |
unit(string $suffix, string $prefix = '') | static |
value(Closure|int|float|null $value) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Quote
類別Cg\ComponentFramework\Component\Quote\Quote
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:quote · 分類:內容與媒體 · 用法與範例 → · View:cg-component::Quote.QuoteView
常數(可用選項值)
ALIGNMENTS:start·center·endSIZES:sm·md·lg
| 方法 | 回傳 |
|---|---|
align(string $alignment) | static |
author(Htmlable|Closure|string|null $author) | static |
static make(Htmlable|Closure|string $content) | static |
size(string $size) | static |
source(Htmlable|Closure|string|null $title, Closure|string|null $url = null) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
RadioButton
類別Cg\ComponentFramework\Component\RadioButton\RadioButton
繼承:Field → Component → Node · 實作:FieldComponent、RenderableNode、Htmlable · Catalog ID:radio-button · 分類:輸入欄位 · 用法與範例 → · View:cg-component::RadioButton.RadioButtonView
| 方法 | 回傳 |
|---|---|
checked(Closure|bool $condition = true) | static |
getId() | string |
static make(string $name, string|int|float|bool $value, Htmlable|Closure|string|null $label = null) | static |
繼承來的方法 (35)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
來自 Field:disabled error errorBag getName helperText id label linkerCall live readOnly required state
Rating
類別Cg\ComponentFramework\Component\Rating\Rating
繼承:Field → Component → Node · 實作:FieldComponent、RenderableNode、Htmlable · Catalog ID:rating · 分類:輸入欄位 · 用法與範例 → · View:cg-component::Rating.RatingView
| 方法 | 回傳 |
|---|---|
clearable(Closure|bool $condition = true, string $label = '清除評分') | static |
static make(string $name, Htmlable|Closure|string|null $label = null) | static |
max(int $max) | static |
showValue(Closure|bool $condition = true) | static |
value(Closure|int|null $value) | static |
繼承來的方法 (36)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
來自 Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state
RichTextEditor
類別Cg\ComponentFramework\Component\RichTextEditor\RichTextEditor
繼承:Field → Component → Node · 實作:FieldComponent、RenderableNode、Htmlable · Catalog ID:rich-text-editor · 分類:輸入欄位 · 用法與範例 → · View:cg-component::RichTextEditor.RichTextEditorView
常數(可用選項值)
TOOLS:bold·italic·underline·strike·heading2·heading3·bulletList·orderedList·blockquote·code·undo·redo·clearHEIGHTS:sm·md·lg
| 方法 | 回傳 |
|---|---|
height(string $height) | static |
static make(string $name, Htmlable|Closure|string|null $label = null) | static |
maxLength(?int $length) | static |
placeholder(Closure|string|null $placeholder) | static |
static sanitize(string $html) | string |
tools(array $tools) | static |
value(Closure|string|null $value) | static |
繼承來的方法 (36)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
來自 Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state
SearchInput
類別Cg\ComponentFramework\Component\SearchInput\SearchInput
繼承:TextInput → Field → Component → Node · 實作:Htmlable、RenderableNode、FieldComponent · Catalog ID:search-input · 分類:輸入欄位 · 用法與範例 → · View:cg-component::SearchInput.SearchInputView
常數(可用選項值)
TYPES:text·email·password·url·tel·search·number·date·time·datetime-local·month·week·color·range
| 方法 | 回傳 |
|---|---|
clearable(Closure|bool $condition = true, string $label = '清除搜尋內容') | static |
static make(string $name, Htmlable|Closure|string|null $label = null) | static |
submitButton(Htmlable|Closure|string|null $label = '搜尋') | static |
type(string $type) | static |
繼承來的方法 (45)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
來自 TextInput:autocomplete inputMode max maxLength min minLength placeholder step value
來自 Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state
SegmentedControl
類別Cg\ComponentFramework\Component\SegmentedControl\SegmentedControl
繼承:Field → Component → Node · 實作:FieldComponent、RenderableNode、Htmlable · Catalog ID:segmented-control · 分類:輸入欄位 · 用法與範例 → · View:cg-component::SegmentedControl.SegmentedControlView
常數(可用選項值)
SIZES:sm·md·lg
| 方法 | 回傳 |
|---|---|
block(bool $condition = true) | static |
disableOptions(iterable $values) | static |
static make(string $name, Htmlable|Closure|string|null $label = null) | static |
options(Traversable|Closure|array $options) | static |
selected(mixed $value) | static |
size(string $size) | static |
繼承來的方法 (36)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
來自 Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state
Select
類別Cg\ComponentFramework\Component\Select\Select
繼承:Field → Component → Node · 實作:FieldComponent、RenderableNode、Htmlable · Catalog ID:select · 分類:輸入欄位 · 用法與範例 → · View:cg-component::Select.SelectView
| 方法 | 回傳 |
|---|---|
static make(string $name, Htmlable|Closure|string|null $label = null) | static |
multiple(Closure|bool $condition = true) | static |
options(Traversable|Closure|array $options) | static |
placeholder(Closure|string|null $placeholder) | static |
selected(mixed $value) | static |
繼承來的方法 (36)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
來自 Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state
Separator
類別Cg\ComponentFramework\Component\Separator\Separator
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:separator · 分類:基礎呈現 · 用法與範例 → · View:cg-component::Separator.SeparatorView
常數(可用選項值)
ORIENTATIONS:horizontal·vertical
| 方法 | 回傳 |
|---|---|
static make(Closure|string|null $label = null) | static |
orientation(string $orientation) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Skeleton
類別Cg\ComponentFramework\Component\Skeleton\Skeleton
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:skeleton · 分類:狀態與流程 · 用法與範例 → · View:cg-component::Skeleton.SkeletonView
常數(可用選項值)
SHAPES:text·rectangle·circleANIMATIONS:pulse·wave·none
| 方法 | 回傳 |
|---|---|
animation(string $animation) | static |
decorative(bool $condition = true) | static |
dimensions(string|int|float $width, string|int|float|null $height = null) | static |
label(string $label) | static |
lines(int $lines) | static |
static make(string $label = '載入中') | static |
shape(string $shape) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
SkipLink
類別Cg\ComponentFramework\Component\SkipLink\SkipLink
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:skip-link · 分類:可及性 · 用法與範例 → · View:cg-component::SkipLink.SkipLinkView
常數(可用選項值)
POSITIONS:start·center·end
| 方法 | 回傳 |
|---|---|
label(Htmlable|Closure|string $label) | static |
static make(string $target, Htmlable|Closure|string $label = '跳至主要內容') | static |
position(string $position) | static |
target(string $target) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Slider
類別Cg\ComponentFramework\Component\Slider\Slider
繼承:Field → Component → Node · 實作:FieldComponent、RenderableNode、Htmlable · Catalog ID:slider · 分類:輸入欄位 · 用法與範例 → · View:cg-component::Slider.SliderView
| 方法 | 回傳 |
|---|---|
static make(string $name, Htmlable|Closure|string|null $label = null) | static |
range(int|float $min, int|float $max) | static |
showValue(Closure|bool $condition = true) | static |
step(int|float $step) | static |
unit(string $suffix, string $prefix = '') | static |
value(Closure|int|float|null $value) | static |
繼承來的方法 (36)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
來自 Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state
Sound
類別Cg\ComponentFramework\Component\Sound\Sound
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:sound · 分類:內容與媒體 · 用法與範例 → · View:cg-component::Sound.SoundView
常數(可用選項值)
PRELOADS:none·metadata·autoCROSS_ORIGINS:anonymous·use-credentials
| 方法 | 回傳 |
|---|---|
addSource(SoundSource $source) | static |
addTrack(SoundTrack $track) | static |
crossOrigin(?string $crossOrigin) | static |
loop(bool $condition = true) | static |
static make(Closure|string|null $source, Closure|string $label = '音訊') | static |
muted(bool $condition = true) | static |
preload(string $preload) | static |
showLabel(bool $condition = true) | static |
source(Closure|string $source, ?string $type = null) | static |
sources(iterable $sources) | static |
tracks(iterable $tracks) | static |
transcript(mixed $content, string $label = '顯示逐字稿', bool $open = false) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Spinner
類別Cg\ComponentFramework\Component\Spinner\Spinner
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:spinner · 分類:狀態與流程 · 用法與範例 → · View:cg-component::Spinner.SpinnerView
常數(可用選項值)
COLORS:current·primary·success·warning·danger·infoSIZES:xs·sm·md·lg·xl
| 方法 | 回傳 |
|---|---|
color(string $color) | static |
decorative(bool $condition = true) | static |
label(string $label) | static |
static make(string $label = '載入中') | static |
size(string $size) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Stack
類別Cg\ComponentFramework\Component\Stack\Stack
繼承:Component → Node · 實作:Htmlable、RenderableNode、RequiresMultipart · Catalog ID:stack · 分類:基礎呈現 · 用法與範例 → · View:cg-component::Stack.StackView
常數(可用選項值)
DIRECTIONS:row·columnGAPS:none·xs·sm·md·lg·xlALIGNS:start·center·end·stretch·baselineJUSTIFIES:start·center·end·between·around·evenly
| 方法 | 回傳 |
|---|---|
align(string $align) | static |
components(iterable $components) | static |
direction(string $direction) | static |
gap(string $gap) | static |
getComponents() | NodeCollection |
justify(string $justify) | static |
static make(iterable $components = []) | static |
push(Component $component) | static |
requiresMultipart() | bool |
wrap(bool $condition = true) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Stepper
類別Cg\ComponentFramework\Component\Stepper\Stepper
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:stepper · 分類:狀態與流程 · 用法與範例 → · View:cg-component::Stepper.StepperView
常數(可用選項值)
ORIENTATIONS:horizontal·vertical
| 方法 | 回傳 |
|---|---|
active(?string $key) | static |
label(string $label) | static |
static make(iterable $steps = []) | static |
numbered(bool $condition = true) | static |
orientation(string $orientation) | static |
push(Step $step) | static |
steps(iterable $steps) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Table
類別Cg\ComponentFramework\Component\Table\Table
資料表。
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:table · 分類:資料組合 · 用法與範例 → · View:cg-component::Table.TableView
常數(可用選項值)
FILTER_LAYOUTS:dropdown·inlineMAX_HEIGHTS:sm·md·lg·xl·screen
| 方法 | 回傳 | 說明 |
|---|---|---|
activeLeaves(TableColumnNode $node, array $shown, TableState $state) | array | |
afterResolve(Closure $callback) | static | |
caption(Htmlable|Closure|string|null $caption) | static | |
columns(iterable $columns) | static | |
compact(bool $condition = true) | static | |
config(string $name) | mixed | |
copy() | static | 深層複製:欄位、篩選器都是新的實例,修改副本不會影響原本的表格。 |
currentRequest() | Request | |
cursorPagination(bool $condition = true) | static | 游標分頁:以排序欄位的值定位,大資料表不需要 OFFSET 掃描也不計算總數。 |
defaultGroup(?string $group) | static | |
defaultSort(string $column, string $direction = 'asc') | static | |
detail(?Closure $content, string $label = '詳細資料') | static | 每列可展開的自訂內容;收合欄位(Column::collapsible())會排在它前面。 |
eagerLoadRelations(bool $condition = true) | static | Eloquent 資料源預設會 eager load 點號欄位用到的關聯。 |
emptyState(Htmlable|Closure|string $content) | static | |
filters(iterable $filters) | static | |
filtersLayout(string $layout) | static | |
foreignQuery(array $without = []) | array | 目前 request 中不屬於這張表的 query 參數。 |
getPageName() | string | |
getRecords() | array | |
getState() | TableState | |
groupBy(Group|string $group) | static | 直接依某欄分組;等同 groups([$group])->defaultGroup(...)。 |
groups(array $groups) | static | |
hoverable(bool $condition = true) | static | |
label(string $label) | static | |
linkerNavigation(?string $method = 'navigate', array $extra = []) | static | 搜尋、篩選、排序、分頁、欄位切換與欄位順序改走 Linker,不再整頁導覽。 |
static make(iterable $columns = []) | static | |
maxHeight(?string $height) | static | |
model(string $model) | static | |
modifyQueryUsing(Closure $callback) | static | 在搜尋、篩選、排序之前修改查詢。查詢資料源收到 Builder,記憶體資料源收到 Collection (回傳新的 iterable 會取代原資料)。可呼叫多次,依序執行。 |
paginate(int $perPage = 15, array $options = []) | static | 啟用分頁並定義每頁筆數。 |
pagination(Pagination|Closure|null $pagination) | static | 外部提供的 Pagination;Table 自行分頁時可傳 Closure 客製: fn (Paginator $paginator, Table $table) => Pagination::make($paginator)->renderPagesWith(...) |
paginationMode(string $mode) | static | length(COUNT 總數)、simple(LIMIT/OFFSET 不計數)、cursor(游標,不計數也不 OFFSET)。 |
paramName(string ...$segments) | string | 表格參數的 input name:paramName('filters', 'status') → filters[status] 或 orders[filters][status]。 |
perPageOptions(array $options) | static | |
static persistOrder(Builder|Relation|Builder $query, array $keys, string $column = 'sort', int $offset = 0, ?string $keyName = null) | int | 把拖曳後的順序寫回資料庫。只會更新 $query 範圍內、且在 $keys 中的紀錄, 竄改的 key 不會影響其他資料。 |
pushColumn(TableColumnNode $column) | static | |
query(Builder|Relation|Builder|Closure $query) | static | records() 的語意化別名:交給資料庫搜尋、篩選、排序與分頁。 |
queryStringIdentifier(?string $identifier) | static | 同頁有多個 Table 時,用它把 query string 分開:orders[search]、orders_page。 |
records(mixed $records) | static | 資料來源:array、Collection、LazyCollection、任何 iterable、Paginator、CursorPaginator、 Eloquent/Query Builder、Relation,或回傳上述任一者的 Closure(收到 Table)。 |
recordTitle(Closure|string|null $title) | static | |
reorderable(string $column, string $linkerMethod, array $extra = []) | static | 讓使用者拖曳列重新排序,放開時呼叫 Linker 方法,參數: {order: [rowKey, ...], offset: 本頁第一筆的位置, column: 排序欄位, ...extra}。 伺服器端可直接用 Table::persistOrder() 寫回。表格需放在該 Linker 的掛載點內。 |
reorderableColumns(bool $condition = true) | static | 讓使用者拖曳表頭調整欄位順序(ColumnGroup 內只能在群組內移動);順序寫進 URL。 |
request(?Request $request) | static | |
resolve() | TableResult | 執行查詢並回傳與渲染無關的結果。每次呼叫都會重新查詢。 |
rowKey(Closure|string|null $key) | static | |
searchPlaceholder(string $placeholder) | static | |
simplePagination(bool $condition = true) | static | 傳統 LIMIT/OFFSET,但不執行 COUNT 查詢。 |
stackOn(?string $breakpoint = 'md') | static | 容器寬度小於斷點時,每筆資料改成「標籤:值」的卡片堆疊。 使用 container query,表格放在窄側欄也會正確堆疊,不需要 JavaScript。 |
state(TableState|Closure|array|null $state) | static | 直接指定狀態而不讀 request(測試、renderBlade 片段或伺服器端重新導向時使用)。 |
stickyFooter(bool $condition = true) | static | 捲動時固定 tfoot(彙總列)。 |
stickyHeader(bool $condition = true) | static | 捲動時固定表頭。搭配 maxHeight() 讓表格在自己的容器內捲動。 |
striped(bool $condition = true) | static | |
summaryLabels(array $labels) | static | |
tableId() | string | |
transpose(bool $condition = true) | static | 轉置輸出方向:欄位變成列、紀錄變成欄(適合規格比較表)。 不支援 groups()、detail()、reorderable();collapsible 欄位會當成一般列輸出。 |
urlFor(TableState $state, bool $keepPage = false) | string | 以指定狀態產生目前頁面的 URL;保留其他 query 參數(例如同頁另一張表)。 |
wrapTableQuery(array $tableQuery) | array |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Tabs
類別Cg\ComponentFramework\Component\Tabs\Tabs
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:tabs · 分類:資料組合 · 用法與範例 → · View:cg-component::Tabs.TabsView
常數(可用選項值)
ORIENTATIONS:horizontal·verticalACTIVATIONS:automatic·manual
| 方法 | 回傳 |
|---|---|
activation(string $activation) | static |
active(?string $key) | static |
getTabs() | NodeCollection |
label(string $label) | static |
static make(iterable $tabs = []) | static |
orientation(string $orientation) | static |
push(Tab $tab) | static |
stateKey(string $key) | static |
tabs(iterable $tabs) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
TextArea
類別Cg\ComponentFramework\Component\TextArea\TextArea
繼承:Field → Component → Node · 實作:FieldComponent、RenderableNode、Htmlable · Catalog ID:text-area · 分類:輸入欄位 · 用法與範例 → · View:cg-component::TextArea.TextAreaView
| 方法 | 回傳 |
|---|---|
static make(string $name, Htmlable|Closure|string|null $label = null) | static |
maxLength(?int $length) | static |
minLength(?int $length) | static |
placeholder(Closure|string|null $placeholder) | static |
rows(int $rows) | static |
value(mixed $value) | static |
繼承來的方法 (36)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
來自 Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state
TextInput
類別Cg\ComponentFramework\Component\TextInput\TextInput
繼承:Field → Component → Node · 實作:FieldComponent、RenderableNode、Htmlable · Catalog ID:text-input · 分類:輸入欄位 · 用法與範例 → · View:cg-component::TextInput.TextInputView
常數(可用選項值)
TYPES:text·email·password·url·tel·search·number·date·time·datetime-local·month·week·color·range
| 方法 | 回傳 |
|---|---|
autocomplete(?string $autocomplete) | static |
inputMode(?string $mode) | static |
static make(string $name, Htmlable|Closure|string|null $label = null) | static |
max(string|int|float|null $value) | static |
maxLength(?int $length) | static |
min(string|int|float|null $value) | static |
minLength(?int $length) | static |
placeholder(Closure|string|null $placeholder) | static |
step(string|int|float|null $value) | static |
type(string $type) | static |
value(mixed $value) | static |
繼承來的方法 (36)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
來自 Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state
Toast
類別Cg\ComponentFramework\Component\Toast\Toast
繼承:Alert → Component → Node · 實作:Htmlable、RenderableNode · Catalog ID:toast · 分類:回饋 · 用法與範例 → · View:cg-component::Toast.ToastView
| 方法 | 回傳 |
|---|---|
delay(int $milliseconds) | static |
id(string $id) | static |
static make(Htmlable|Closure|string $message) | static |
stay(bool $closeable = true) | static |
timeout(int $milliseconds) | static |
繼承來的方法 (34)
來自 Alert:actions danger dismissible icon info message success title type visibilityState warning
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Toggle
類別Cg\ComponentFramework\Component\Toggle\Toggle
繼承:Checkbox → Field → Component → Node · 實作:Htmlable、RenderableNode、FieldComponent · Catalog ID:toggle · 分類:輸入欄位 · 用法與範例 → · View:cg-component::Toggle.ToggleView
常數(可用選項值)
COLORS:primary·success·warning·dangerSIZES:sm·md·lg
| 方法 | 回傳 |
|---|---|
color(string $color) | static |
inline(bool $condition = true) | static |
static make(string $name, Htmlable|Closure|string|null $label = null) | static |
size(string $size) | static |
繼承來的方法 (39)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
來自 Checkbox:checked uncheckedValue value
來自 Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state
Tooltip
類別Cg\ComponentFramework\Component\Tooltip\Tooltip
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:tooltip · 分類:浮動介面 · 用法與範例 → · View:cg-component::Tooltip.TooltipView
常數(可用選項值)
PLACEMENTS:top·right·bottom·left
| 方法 | 回傳 |
|---|---|
delay(int $milliseconds) | static |
id(string $id) | static |
static make(Component $trigger, Closure|string $content) | static |
offset(int $pixels) | static |
placement(string $placement) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
TreeView
類別Cg\ComponentFramework\Component\TreeView\TreeView
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:tree-view · 分類:資料組合 · 用法與範例 → · View:cg-component::TreeView.TreeViewView
常數(可用選項值)
SELECTION_MODES:none·single·multiple
| 方法 | 回傳 |
|---|---|
expanded(Closure|array|string|null $keys) | static |
label(string $label) | static |
static make(iterable $nodes = []) | static |
nodes(iterable $nodes) | static |
push(TreeNode $node) | static |
selected(Closure|array|string|null $keys) | static |
selection(string $mode) | static |
stateKeys(string $selection, string $expanded) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Video
類別Cg\ComponentFramework\Component\Video\Video
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:video · 分類:內容與媒體 · 用法與範例 → · View:cg-component::Video.VideoView
常數(可用選項值)
PRELOADS:none·metadata·autoCROSS_ORIGINS:anonymous·use-credentials
| 方法 | 回傳 |
|---|---|
addSource(VideoSource $source) | static |
addTrack(VideoTrack $track) | static |
autoplay(bool $condition = true) | static |
controls(bool $condition = true) | static |
crossOrigin(?string $crossOrigin) | static |
dimensions(?int $width, ?int $height) | static |
loop(bool $condition = true) | static |
static make(Closure|string|null $source, Closure|string $label = '影片') | static |
muted(bool $condition = true) | static |
playsInline(bool $condition = true) | static |
poster(Closure|string|null $poster) | static |
preload(string $preload) | static |
source(Closure|string $source, ?string $type = null) | static |
sources(iterable $sources) | static |
tracks(iterable $tracks) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
VisuallyHidden
類別Cg\ComponentFramework\Component\VisuallyHidden\VisuallyHidden
繼承:Component → Node · 實作:RenderableNode、Htmlable · Catalog ID:visually-hidden · 分類:可及性 · 用法與範例 → · View:cg-component::VisuallyHidden.VisuallyHiddenView
常數(可用選項值)
TAGS:span·div·p
| 方法 | 回傳 |
|---|---|
as(string $tag) | static |
focusable(bool $condition = true) | static |
static make(Htmlable|Closure|string $content) | static |
繼承來的方法 (23)
來自 Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
這一頁由 scripts/wiki-components/generate.php 從原始碼反射產生,請勿手動修改。