Dynamically disable JS inputs

for v.3
This commit is contained in:
TheSkybreaker
2025-07-31 15:00:40 +02:00
parent 859a37ce68
commit 6da69f7cff
4 changed files with 21 additions and 1 deletions
@@ -104,6 +104,11 @@
},
})"
wire:ignore
wire:key="{{ $this->getId() }}.{{ $statePath }}.{{ $field::class }}.{{
substr(md5(serialize([
$isDisabled,
])), 0, 64)
}}"
{{
$attributes
->merge([
@@ -39,7 +39,6 @@
x-load
@endif
x-load-src="{{ \Filament\Support\Facades\FilamentAsset::getAlpineComponentSrc('key-value', 'filament/forms') }}"
wire:ignore
x-data="keyValueFormComponent({
state: $wire.{{ $applyStateBindingModifiers("\$entangle('{$statePath}')") }},
})"
@@ -48,6 +47,12 @@
->merge($getExtraAlpineAttributes(), escape: false)
->class(['divide-y divide-gray-200 dark:divide-white/10'])
}}
wire:ignore
wire:key="{{ $this->getId() }}.{{ $statePath }}.{{ $field::class }}.{{
substr(md5(serialize([
$isDisabled,
])), 0, 64)
}}"
>
<table
class="w-full table-auto divide-y divide-gray-200 dark:divide-white/5"
@@ -377,6 +377,11 @@
@endif
x-ref="trix"
wire:ignore
wire:key="{{ $this->getId() }}.{{ $statePath }}.{{ $field::class }}.{{
substr(md5(serialize([
$isDisabled,
])), 0, 64)
}}"
@if ($isGrammarlyDisabled())
data-gramm="false"
data-gramm_editor="false"
@@ -153,6 +153,11 @@
statePath: @js($statePath),
})"
wire:ignore
wire:key="{{ $this->getId() }}.{{ $statePath }}.{{ $field::class }}.{{
substr(md5(serialize([
$isDisabled,
])), 0, 64)
}}"
x-on:keydown.esc="select.dropdown.isActive && $event.stopPropagation()"
x-on:set-select-property="$event.detail.isDisabled ? select.disable() : select.enable()"
{{