Skip to content

Commit 31a9be2

Browse files
committed
Update docs
1 parent 485b2de commit 31a9be2

File tree

8 files changed

+79
-5
lines changed

8 files changed

+79
-5
lines changed

docs/dist/3.x/forms/fields/file-upload/index.html

Lines changed: 17 additions & 2 deletions
Large diffs are not rendered by default.

docs/dist/3.x/forms/fields/repeater/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,6 +1575,20 @@ <h4 id="disabling-options-when-they-are-already-selected-in-another-item"><a cla
15751575
])
15761576
</textarea></code></pre>
15771577
<p>This method will automatically enable the <code>distinct()</code> and <code>live()</code> methods on the field.</p>
1578+
<p>In case you want to add another condition to <a href="../select#disabling-specific-options">disable options</a> with, you can chain <code>disableOptionWhen()</code> with the <code>merge: true</code> argument:</p>
1579+
<pre class="torchlight" style="background-color: #292D3E; --theme-selection-background: #00000080;" data-torchlight-processed="3449c9e5e332f1dbb81505cd739fbf3f"><code class="language-php"><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #F78C6C;">use</span><span style="color: #FFCB6B;"> </span><span style="color: #A6ACCD;">Filament</span><span style="color: #89DDFF;">\</span><span style="color: #A6ACCD;">Forms</span><span style="color: #89DDFF;">\</span><span style="color: #A6ACCD;">Components</span><span style="color: #89DDFF;">\</span><span style="color: #A6ACCD;">Repeater</span><span style="color: #89DDFF;">;</span></div><div class='line'><span style="color: #F78C6C;">use</span><span style="color: #FFCB6B;"> </span><span style="color: #A6ACCD;">Filament</span><span style="color: #89DDFF;">\</span><span style="color: #A6ACCD;">Forms</span><span style="color: #89DDFF;">\</span><span style="color: #A6ACCD;">Components</span><span style="color: #89DDFF;">\</span><span style="color: #A6ACCD;">Select</span><span style="color: #89DDFF;">;</span></div><div class='line'>&nbsp;</div><div class='line'><span style="color: #FFCB6B;">Repeater</span><span style="color: #89DDFF;">::</span><span style="color: #82AAFF;">make</span><span style="color: #89DDFF;">(</span><span style="color: #89DDFF;">&#39;</span><span style="color: #C3E88D;">members</span><span style="color: #89DDFF;">&#39;</span><span style="color: #89DDFF;">)</span></div><div class='line'><span style="color: #A6ACCD;"> </span><span style="color: #89DDFF;">-&gt;</span><span style="color: #82AAFF;">schema</span><span style="color: #89DDFF;">([</span></div><div class='line'><span style="color: #A6ACCD;"> </span><span style="color: #FFCB6B;">Select</span><span style="color: #89DDFF;">::</span><span style="color: #82AAFF;">make</span><span style="color: #89DDFF;">(</span><span style="color: #89DDFF;">&#39;</span><span style="color: #C3E88D;">role</span><span style="color: #89DDFF;">&#39;</span><span style="color: #89DDFF;">)</span></div><div class='line'><span style="color: #A6ACCD;"> </span><span style="color: #89DDFF;">-&gt;</span><span style="color: #82AAFF;">options</span><span style="color: #89DDFF;">([</span></div><div class='line'><span style="color: #89DDFF;"> </span><span style="color: #676E95;">// ...</span></div><div class='line'><span style="color: #A6ACCD;"> </span><span style="color: #89DDFF;">])</span></div><div class='line'><span style="color: #A6ACCD;"> </span><span style="color: #89DDFF;">-&gt;</span><span style="color: #82AAFF;">disableOptionsWhenSelectedInSiblingRepeaterItems</span><span style="color: #89DDFF;">()</span></div><div class='line'><span style="color: #A6ACCD;"> </span><span style="color: #89DDFF;">-&gt;</span><span style="color: #82AAFF;">disableOptionWhen</span><span style="color: #89DDFF;">(</span><span style="color: #C792EA;">fn</span><span style="color: #A6ACCD;"> </span><span style="color: #89DDFF;">(</span><span style="color: #F78C6C;">string</span><span style="color: #A6ACCD;"> </span><span style="color: #89DDFF;">$</span><span style="color: #A6ACCD;">value</span><span style="color: #89DDFF;">):</span><span style="color: #A6ACCD;"> </span><span style="color: #F78C6C;">bool</span><span style="color: #A6ACCD;"> </span><span style="color: #89DDFF;">=&gt;</span><span style="color: #A6ACCD;"> </span><span style="color: #89DDFF;">$</span><span style="color: #A6ACCD;">value </span><span style="color: #89DDFF;">===</span><span style="color: #A6ACCD;"> </span><span style="color: #89DDFF;">&#39;</span><span style="color: #C3E88D;">super_admin</span><span style="color: #89DDFF;">&#39;</span><span style="color: #89DDFF;">,</span><span style="color: #A6ACCD;"> </span><span style="color: #FFCB6B;">merge</span><span style="color: #89DDFF;">:</span><span style="color: #A6ACCD;"> </span><span style="color: #89DDFF;">true),</span></div><div class='line'><span style="color: #A6ACCD;"> </span><span style="color: #89DDFF;">])</span></div><textarea data-torchlight-original="true" style="display: none !important;">use Filament\Forms\Components\Repeater;
1580+
use Filament\Forms\Components\Select;
1581+
1582+
Repeater::make('members')
1583+
-&gt;schema([
1584+
Select::make('role')
1585+
-&gt;options([
1586+
// ...
1587+
])
1588+
-&gt;disableOptionsWhenSelectedInSiblingRepeaterItems()
1589+
-&gt;disableOptionWhen(fn (string $value): bool =&gt; $value === 'super_admin', merge: true),
1590+
])
1591+
</textarea></code></pre>
15781592
<h2 id="customizing-the-repeater-item-actions"><a class="heading-anchor" href="#customizing-the-repeater-item-actions"><span class="heading-anchor-icon" aria-hidden="true">#</span></a>Customizing the repeater item actions</h2>
15791593
<p>This field uses action objects for easy customization of buttons within it. You can customize these buttons by passing a function to an action registration method. The function has access to the <code>$action</code> object, which you can use to <a href="../../actions/trigger-button">customize it</a>. The following methods are available to customize the actions:</p>
15801594
<ul>

docs/dist/3.x/forms/fields/textarea/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,7 @@ <h2 id="making-the-field-read-only"><a class="heading-anchor" href="#making-the-
11541154
</textarea></code></pre>
11551155
<p>There are a few differences, compared to <a href="getting-started#disabling-a-field"><code>disabled()</code></a>:</p>
11561156
<ul>
1157-
<li>When using <code>readOnly()</code>, the field will still be sent to the server when the form is submitted. It can be mutated with the browser console, or via JavaScript. You can use <a href="advanced#preventing-a-field-from-being-dehydrated"><code>dehydrated(false)</code></a> to prevent this.</li>
1157+
<li>When using <code>readOnly()</code>, the field will still be sent to the server when the form is submitted. It can be mutated with the browser console, or via JavaScript. You can use <a href="../advanced#preventing-a-field-from-being-dehydrated"><code>dehydrated(false)</code></a> to prevent this.</li>
11581158
<li>There are no styling changes, such as less opacity, when using <code>readOnly()</code>.</li>
11591159
<li>The field is still focusable when using <code>readOnly()</code>.</li>
11601160
</ul>

docs/dist/3.x/support/icons/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,7 @@ <h3 id="table-builder-icon-aliases"><a class="heading-anchor" href="#table-build
11861186
<li><code>tables::filters.remove-all-button</code> - Button to remove all filters</li>
11871187
<li><code>tables::grouping.collapse-button</code> - Button to collapse a group of records</li>
11881188
<li><code>tables::header-cell.sort-asc-button</code> - Sort button of a column sorted in ascending order</li>
1189-
<li><code>tables::header-cell.sort-button&#39;</code> - Sort button of a column when it is currently not sorted</li>
1189+
<li><code>tables::header-cell.sort-button</code> - Sort button of a column when it is currently not sorted</li>
11901190
<li><code>tables::header-cell.sort-desc-button</code> - Sort button of a column sorted in descending order</li>
11911191
<li><code>tables::reorder.handle</code> - Handle to grab in order to reorder a record with drag and drop</li>
11921192
<li><code>tables::search-field</code> - Search input</li>

0 commit comments

Comments
 (0)