-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from noxoua/develop
Develop
- Loading branch information
Showing
14 changed files
with
282 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,19 @@ | ||
@php | ||
$isHtmlAllowed = $field->isHtmlAllowed(); | ||
@endphp | ||
|
||
@if (is_array($value)) | ||
<pre class="text-xs text-gray-500">{{ json_encode($value, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) }}</pre> | ||
<pre class="text-xs text-gray-500"> | ||
@if ($isHtmlAllowed) | ||
{!! json_encode($value, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) !!} | ||
@else | ||
{{ $value }} | ||
{{ json_encode($value, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) }} | ||
@endif | ||
</pre> | ||
@else | ||
@if ($isHtmlAllowed) | ||
{!! $value !!} | ||
@else | ||
{{ $value }} | ||
@endif | ||
@endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,60 @@ | ||
<div class="rounded-lg shadow-sm bg-gray-50 dark:bg-transparent ring-1 ring-gray-950/10 dark:ring-white/20"> | ||
<table class="w-full table-auto"> | ||
<tbody class="divide-y divide-gray-200 dark:divide-white/20"> | ||
@foreach ((array) $value as $key => $_value) | ||
<tr class="divide-x divide-gray-200 dark:divide-white/20 rtl:divide-x-reverse"> | ||
<td class="font-mono text-xs p-2"> | ||
{{ $key }} | ||
</td> | ||
@if (!empty($value)) | ||
@php | ||
$hasFields = $field->keyValue instanceof \Noxo\FilamentActivityLog\ResourceLogger\Types\KeyValueField; | ||
if ($hasFields) { | ||
$fields = $field->keyValue->getFields(); | ||
} | ||
$isHtmlAllowed = $field->isHtmlAllowed(); | ||
@endphp | ||
|
||
<td class="font-mono text-xs p-2"> | ||
{{ $_value }} | ||
</td> | ||
</tr> | ||
@endforeach | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
<div class="rounded-lg shadow-sm bg-gray-50 dark:bg-transparent ring-1 ring-gray-950/10 dark:ring-white/20"> | ||
<table class="w-full table-auto truncate"> | ||
@if ($hasFields) | ||
<tbody class="divide-y divide-gray-200 dark:divide-white/20"> | ||
@foreach ($fields as $key => $keyValueField) | ||
@php | ||
if (!array_key_exists($keyValueField->name, $value)) { | ||
continue; | ||
} | ||
$rawValue = $value[$keyValueField->name]; | ||
$dispayValue = $keyValueField->display($rawValue); | ||
@endphp | ||
|
||
<tr class="divide-x divide-gray-200 dark:divide-white/20 rtl:divide-x-reverse"> | ||
<td class="font-mono text-xs p-2 w-[1%] whitespace-nowrap"> | ||
{{ $keyValueField->getLabel() }} | ||
</td> | ||
|
||
<td class="font-mono text-xs p-2 truncate max-w-0"> | ||
@if ($isHtmlAllowed) | ||
{!! $dispayValue !!} | ||
@else | ||
{{ $dispayValue }} | ||
@endif | ||
</td> | ||
</tr> | ||
@endforeach | ||
</tbody> | ||
@else | ||
<tbody class="divide-y divide-gray-200 dark:divide-white/20"> | ||
@foreach ((array) $value as $key => $_value) | ||
<tr class="divide-x divide-gray-200 dark:divide-white/20 rtl:divide-x-reverse"> | ||
<td class="font-mono text-xs p-2 w-[1%] whitespace-nowrap"> | ||
{{ $key }} | ||
</td> | ||
|
||
<td class="font-mono text-xs p-2 truncate max-w-0"> | ||
@if ($isHtmlAllowed) | ||
{!! $_value !!} | ||
@else | ||
{{ $_value }} | ||
@endif | ||
</td> | ||
</tr> | ||
@endforeach | ||
</tbody> | ||
@endif | ||
</table> | ||
</div> | ||
@endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,40 @@ | ||
@if (!empty($value)) | ||
<x-filament-tables::table class="w-full overflow-hidden text-sm"> | ||
<x-slot:header> | ||
@foreach (array_keys($value[0]) as $key) | ||
<x-filament-tables::header-cell class="!py-2"> | ||
{{ $key }} | ||
</x-filament-tables::header-cell> | ||
@endforeach | ||
</x-slot:header> | ||
@php | ||
$fields = $field->table->getFields(); | ||
$isHtmlAllowed = $field->isHtmlAllowed(); | ||
@endphp | ||
|
||
<div class="w-full overflow-x-scroll border border-gray-200 dark:border-white/5 rounded-lg"> | ||
<x-filament-tables::table> | ||
<x-slot:header> | ||
<x-filament-tables::row> | ||
@foreach ($fields as $field) | ||
<x-filament-tables::header-cell class="!p-2"> | ||
{{ $field->getLabel() }} | ||
</x-filament-tables::header-cell> | ||
@endforeach | ||
</x-filament-tables::row> | ||
</x-slot:header> | ||
|
||
|
||
@foreach ($value as $item) | ||
<x-filament-tables::row @class(['bg-gray-100/30 dark:bg-gray-900' => $loop->even])> | ||
@foreach ($item as $_value) | ||
<x-filament-tables::cell class="px-4 py-2 align-top sm:first-of-type:ps-6 sm:last-of-type:pe-6"> | ||
{{ $_value }} | ||
</x-filament-tables::cell> | ||
@endforeach | ||
</x-filament-tables::row> | ||
@endforeach | ||
</x-filament-tables::table> | ||
@foreach ($value as $item) | ||
<x-filament-tables::row @class(['bg-gray-100/30 dark:bg-gray-900/20' => $loop->even])> | ||
@foreach ($fields as $field) | ||
<x-filament-tables::cell class="p-2 align-top"> | ||
@php | ||
$rawValue = $item[$field->name] ?? data_get($item, $field->name); | ||
$dispayValue = $field->display($rawValue); | ||
@endphp | ||
|
||
@if ($isHtmlAllowed) | ||
{!! $dispayValue !!} | ||
@else | ||
{{ $dispayValue }} | ||
@endif | ||
</x-filament-tables::cell> | ||
@endforeach | ||
</x-filament-tables::row> | ||
@endforeach | ||
</x-filament-tables::table> | ||
</div> | ||
@endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.