forked from CodeWithDennis/filament-select-tree
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathselect-tree.blade.php
More file actions
59 lines (57 loc) · 2.27 KB
/
select-tree.blade.php
File metadata and controls
59 lines (57 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
@php
use Filament\Support\Facades\FilamentView;
use Filament\Support\Facades\FilamentAsset;
$prefixLabel = $getPrefixLabel();
$suffixLabel = $getSuffixLabel();
$prefixIcon = $getPrefixIcon();
$suffixIcon = $getSuffixIcon();
$prefixActions = $getPrefixActions();
$suffixActions = $getSuffixActions();
@endphp
<x-dynamic-component :component="$getFieldWrapperView()" :field="$field">
<div
wire:key="{{ $getId() }}"
wire:ignore
x-ignore
@if (FilamentView::hasSpaMode())
ax-load="visible"
@else
ax-load
@endif
ax-load-css="{{ FilamentAsset::getStyleHref('filament-select-tree-styles', package: 'codewithdennis/filament-select-tree') }}"
ax-load-src="{{ FilamentAsset::getAlpineComponentSrc('filament-select-tree', package: 'codewithdennis/filament-select-tree') }}"
x-data="selectTree({
name: @js($getName()),
state: $wire.{{ $applyStateBindingModifiers("\$entangle('{$getStatePath()}')") }},
options: @js($getTree()),
searchable: @js($isSearchable()),
showCount: @js($getWithCount()),
placeholder: @js($getPlaceholder()),
disabledBranchNode: @js(!$getEnableBranchNode()),
disabled: @js($isDisabled()),
isSingleSelect: @js(!$getMultiple()),
isIndependentNodes: @js($getIndependent()),
showTags: @js($getMultiple()),
alwaysOpen: @js($getAlwaysOpen()),
clearable: @js($getClearable()),
emptyText: @js($getEmptyLabel()),
expandSelected: @js($getExpandSelected()),
grouped: @js($getGrouped()),
openLevel: @js($getDefaultOpenLevel()),
direction: @js($getDirection()),
rtl: @js(__('filament-panels::layout.direction') === 'rtl'),
})"
>
<x-filament::input.wrapper
:suffix="$suffixLabel"
:prefix="$prefixLabel"
:prefix-icon="$prefixIcon"
:suffix-icon="$suffixIcon"
:disabled="$isDisabled()"
:prefix-actions="$prefixActions"
:suffix-actions="$suffixActions"
>
<div x-ref="tree"></div>
</x-filament::input.wrapper>
</div>
</x-dynamic-component>