Skip to content

Commit c0dce6e

Browse files
authored
refactor: allow dropdown component without button (#570)
1 parent ca27d6d commit c0dce6e

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

resources/views/dropdown.blade.php

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
'onClose' => null,
1818
'disabled' => false,
1919
'withPlacement' => false,
20+
'withoutButton' => false,
2021
])
2122

2223
<div
@@ -56,21 +57,23 @@
5657
@if($wrapperClass) class="{{ $wrapperClass }}" @endif
5758
@if($dusk) dusk="{{ $dusk }}" @endif
5859
>
59-
<div>
60-
<button
61-
type="button"
62-
:class="{ '{{ $buttonClassExpanded }}' : {{ $dropdownProperty }}, '{{ $buttonClassClosed }}' : !{{ $dropdownProperty }} }"
63-
class="flex items-center focus:outline-none dropdown-button transition-default {{ $buttonClass }}"
64-
@if($disabled) disabled @else @click="{{ $dropdownProperty }} = !{{ $dropdownProperty }}" @endif
65-
@if($buttonTooltip) data-tippy-content="{{ $buttonTooltip }}" @endif
66-
>
67-
@if($button ?? false)
68-
{{ $button }}
69-
@else
70-
<x-ark-icon name="ellipsis-vertical" />
71-
@endif
72-
</button>
73-
</div>
60+
@unless($withoutButton)
61+
<div>
62+
<button
63+
type="button"
64+
:class="{ '{{ $buttonClassExpanded }}' : {{ $dropdownProperty }}, '{{ $buttonClassClosed }}' : !{{ $dropdownProperty }} }"
65+
class="flex items-center focus:outline-none dropdown-button transition-default {{ $buttonClass }}"
66+
@if($disabled) disabled @else @click="{{ $dropdownProperty }} = !{{ $dropdownProperty }}" @endif
67+
@if($buttonTooltip) data-tippy-content="{{ $buttonTooltip }}" @endif
68+
>
69+
@if($button ?? false)
70+
{{ $button }}
71+
@else
72+
<x-ark-icon name="ellipsis-vertical" />
73+
@endif
74+
</button>
75+
</div>
76+
@endunless
7477

7578
<div
7679
x-show="{{ $dropdownProperty }}"

0 commit comments

Comments
 (0)