@foreach($rules as $index => $rule) @php $key = $parentIndex !== null ? $parentIndex . '.' . $index : $index; @endphp
@if($rule['type'] === 'rule') @include('datatables::complex-query-rule', ['parentIndex' => $key, 'rule' => $rule]) @elseif($rule['type'] === 'group')
document.querySelector('[dragging]'), dragstart: (e, key) => { e.target.setAttribute('dragging', key) e.target.classList.add('bg-opacity-20', 'bg-white') }, dragend: (e) => { e.target.removeAttribute('dragging') e.target.classList.remove('bg-opacity-20', 'bg-white') }, dragenter(e) { if (e.target.closest('[drag-target]') !== this.source().closest('[drag-target]')) { console.log(this.$refs.placeholder) this.$refs.placeholder.appendChild(this.source()) } }, drop(e) { $wire.call('moveRule', this.source().getAttribute('dragging'), this.key) }, }" drag-target x-on:dragenter.prevent="dragenter" x-on:dragleave.prevent x-on:dragover.prevent x-on:drop="drop" class="p-4 space-y-4 bg-blue-500 bg-opacity-10 rounded-lg text-gray-{{ strlen($parentIndex) > 6 ? 1 : 9 }}00 border border-blue-400" >
@if(count($rule['content']) > 1)
@endif
@include('datatables::complex-query-group', [ 'parentIndex' => $key, 'rules' => $rule['content'], 'logic' => $rule['logic'] ])
@unless($key === 0) @endunless
@endif
@endforeach