Skip to content

Commit

Permalink
cs
Browse files Browse the repository at this point in the history
  • Loading branch information
danharrin committed May 8, 2024
1 parent d747dd6 commit 1a8e95e
Show file tree
Hide file tree
Showing 12 changed files with 93 additions and 46 deletions.
36 changes: 18 additions & 18 deletions dist/components/markdown-editor.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions dist/index.css

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions resources/js/components/markdown-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export default function markdownEditorFormComponent({
maxHeight,
minHeight,
placeholder,
setUpUsing,
state,
translations,
toolbarButtons,
Expand Down Expand Up @@ -210,6 +211,10 @@ export default function markdownEditorFormComponent({

Alpine.raw(this.editor).value(this.state ?? '')
})

if (setUpUsing) {
setUpUsing(this)
}
},

destroy: function () {
Expand Down
25 changes: 25 additions & 0 deletions resources/lang/ja/components.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,31 @@
'placeholder' => '新規タグ',
],

'text_input' => [

'actions' => [

'hide_password' => [
'label' => 'パスワードを非表示',
],

'show_password' => [
'label' => 'パスワードを表示',
],

],

],

'toggle_buttons' => [

'boolean' => [
'true' => 'はい',
'false' => 'いいえ',
],

],

'wizard' => [

'actions' => [
Expand Down
2 changes: 1 addition & 1 deletion resources/lang/no/components.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@

'max_items_message' => 'Bare :count kan velges.',

'no_search_results_message' => 'No alternativer matcher ditt søk.',
'no_search_results_message' => 'Ingen alternativer matcher ditt søk.',

'placeholder' => 'Velg et alternativ',

Expand Down
28 changes: 14 additions & 14 deletions resources/lang/th/components.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],

'add' => [
'label' => 'เพิ่มไปยัง :label',
'label' => 'เพิ่มไปยัง:label',
],

'add_between' => [
Expand All @@ -27,11 +27,11 @@
],

'move_down' => [
'label' => 'ย้ายลง',
'label' => 'เลื่อนลง',
],

'move_up' => [
'label' => 'ย้ายขึ้น',
'label' => 'เลื่อนขึ้น',
],

'collapse' => [
Expand Down Expand Up @@ -154,12 +154,12 @@
],

'rotation' => [
'label' => 'Rotation',
'label' => 'หมุน',
'unit' => 'องศา',
],

'width' => [
'label' => 'Width',
'label' => 'กว้าง',
'unit' => 'พิก',
],

Expand Down Expand Up @@ -242,10 +242,10 @@
'italic' => 'ตัวเอียง',
'link' => 'ลิงก์',
'ordered_list' => 'รายการลําดับเลข',
'redo' => 'กลับคืนสู่ปัจจุบัน',
'redo' => 'ทำอีกครั้ง',
'strike' => 'ขีดฆ่า',
'table' => 'ตาราง',
'undo' => 'ย้อนกลับ',
'undo' => 'ยกเลิกทำ',
],

],
Expand All @@ -264,7 +264,7 @@
'actions' => [

'add' => [
'label' => 'เพิ่มไปยัง :label',
'label' => 'เพิ่มไปยัง:label',
],
'add_between' => [
'label' => 'แทรกระหว่าง',
Expand All @@ -279,10 +279,10 @@
'label' => 'ย้าย',
],
'move_down' => [
'label' => 'ย้ายลง',
'label' => 'เลื่อนลง',
],
'move_up' => [
'label' => 'ย้ายขึ้น',
'label' => 'เลื่อนขึ้น',
],
'collapse' => [
'label' => 'ยุบ',
Expand Down Expand Up @@ -314,7 +314,7 @@

'label' => 'URL',

'placeholder' => 'ป้อน URL',
'placeholder' => 'ระบุ URL',

],

Expand Down Expand Up @@ -348,7 +348,7 @@

'modal' => [

'heading' => 'Create',
'heading' => 'สร้าง',

'actions' => [

Expand All @@ -357,7 +357,7 @@
],

'create_another' => [
'label' => 'สร้างและสร้างอีก',
'label' => 'บันทึกและสร้างอีกรายการ',
],

],
Expand Down Expand Up @@ -397,7 +397,7 @@

'no_search_results_message' => 'ไม่มีตัวเลือกที่ตรงกับการค้นหา',

'placeholder' => 'เลือกตัวเลือก',
'placeholder' => 'เลือก',

'searching_message' => 'กำลังค้นหา...',

Expand Down
4 changes: 2 additions & 2 deletions resources/views/components/builder.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class="space-y-4"
class="fi-fo-builder-item rounded-xl bg-white shadow-sm ring-1 ring-gray-950/5 dark:bg-white/5 dark:ring-white/10"
x-bind:class="{ 'fi-collapsed overflow-hidden': isCollapsed }"
>
@if ($isReorderableWithDragAndDrop || $isReorderableWithButtons || $hasBlockLabels || $isCloneable || $isDeletable || $isCollapsible || count($visibleExtraItemActions))
@if ($isReorderableWithDragAndDrop || $isReorderableWithButtons || $hasBlockLabels || $isCloneable || $isDeletable || $isCollapsible || $visibleExtraItemActions)
<div
@if ($isCollapsible)
x-on:click.stop="isCollapsed = !isCollapsed"
Expand Down Expand Up @@ -141,7 +141,7 @@ class="fi-fo-builder-item rounded-xl bg-white shadow-sm ring-1 ring-gray-950/5 d
</h4>
@endif

@if ($isCloneable || $isDeletable || $isCollapsible || count($visibleExtraItemActions))
@if ($isCloneable || $isDeletable || $isCollapsible || $visibleExtraItemActions)
<ul
class="ms-auto flex items-center gap-x-3"
>
Expand Down
4 changes: 2 additions & 2 deletions resources/views/components/repeater/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class="items-start gap-4"
$extraItemActions,
fn (Action $action): bool => $action(['item' => $uuid])->isVisible(),
);
$itemHasToolbar = $isReorderableWithDragAndDrop || $isReorderableWithButtons || filled($itemLabel) || $isCloneable || $isDeletable || $isCollapsible || count($visibleExtraItemActions);
$itemHasToolbar = $isReorderableWithDragAndDrop || $isReorderableWithButtons || filled($itemLabel) || $isCloneable || $isDeletable || $isCollapsible || $visibleExtraItemActions;
@endphp

<li
Expand Down Expand Up @@ -144,7 +144,7 @@ class="flex items-center justify-center"
</h4>
@endif

@if ($isCloneable || $isDeletable || $isCollapsible || count($visibleExtraItemActions))
@if ($isCloneable || $isDeletable || $isCollapsible || $visibleExtraItemActions)
<ul
class="ms-auto flex items-center gap-x-3"
>
Expand Down
18 changes: 17 additions & 1 deletion resources/views/components/repeater/simple.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@php
use Filament\Forms\Components\Actions\Action;
$containers = $getChildComponentContainers();
$addAction = $getAction($getAddActionName());
Expand All @@ -7,6 +9,7 @@
$moveDownAction = $getAction($getMoveDownActionName());
$moveUpAction = $getAction($getMoveUpActionName());
$reorderAction = $getAction($getReorderActionName());
$extraItemActions = $getExtraItemActions();
$isAddable = $isAddable();
$isCloneable = $isCloneable();
Expand Down Expand Up @@ -41,6 +44,13 @@
class="gap-4"
>
@foreach ($containers as $uuid => $item)
@php
$visibleExtraItemActions = array_filter(
$extraItemActions,
fn (Action $action): bool => $action(['item' => $uuid])->isVisible(),
);
@endphp

<li
wire:key="{{ $this->getId() }}.{{ $item->getStatePath() }}.{{ $field::class }}.item"
x-sortable-item="{{ $uuid }}"
Expand All @@ -50,7 +60,7 @@ class="fi-fo-repeater-item simple flex justify-start gap-x-3"
{{ $item }}
</div>

@if ($isReorderableWithDragAndDrop || $isReorderableWithButtons || $isCloneable || $isDeletable)
@if ($isReorderableWithDragAndDrop || $isReorderableWithButtons || $isCloneable || $isDeletable || $visibleExtraItemActions)
<ul class="flex items-center gap-x-1">
@if ($isReorderableWithDragAndDrop)
<li x-sortable-handle>
Expand All @@ -72,6 +82,12 @@ class="flex items-center justify-center"
</li>
@endif

@foreach ($visibleExtraItemActions as $extraItemAction)
<li>
{{ $extraItemAction(['item' => $uuid]) }}
</li>
@endforeach

@if ($isCloneable)
<li>
{{ $cloneAction(['item' => $uuid]) }}
Expand Down
2 changes: 1 addition & 1 deletion src/Components/BaseFileUpload.php
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ public function isMultiple(): bool
return (bool) $this->evaluate($this->isMultiple);
}

public function getUploadedFileNameForStorageUsing(Closure $callback): static
public function getUploadedFileNameForStorageUsing(?Closure $callback): static
{
$this->getUploadedFileNameForStorageUsing = $callback;

Expand Down
4 changes: 2 additions & 2 deletions src/Components/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public function createOptionForm(array | Closure | null $schema): static
return $this;
}

public function createOptionUsing(Closure $callback): static
public function createOptionUsing(?Closure $callback): static
{
$this->createOptionUsing = $callback;

Expand Down Expand Up @@ -391,7 +391,7 @@ public function editOptionForm(array | Closure | null $schema): static
return $this;
}

public function updateOptionUsing(Closure $callback): static
public function updateOptionUsing(?Closure $callback): static
{
$this->updateOptionUsing = $callback;

Expand Down
6 changes: 3 additions & 3 deletions src/Components/Wizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Wizard extends Component

protected string | Htmlable | null $cancelAction = null;

protected bool | Closure $skippable = false;
protected bool | Closure $isSkippable = false;

protected string | Closure | null $stepQueryStringKey = null;

Expand Down Expand Up @@ -193,7 +193,7 @@ public function submitAction(string | Htmlable | null $action): static

public function skippable(bool | Closure $condition = true): static
{
$this->skippable = $condition;
$this->isSkippable = $condition;

return $this;
}
Expand Down Expand Up @@ -239,7 +239,7 @@ public function getStepQueryStringKey(): ?string

public function isSkippable(): bool
{
return (bool) $this->evaluate($this->skippable);
return (bool) $this->evaluate($this->isSkippable);
}

public function isStepPersistedInQueryString(): bool
Expand Down

0 comments on commit 1a8e95e

Please sign in to comment.