mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
No more tabs on profile form. New generic card component (simple for now).
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"/js/filament.js": "/js/filament.js?id=575bb8a26dd76080eafa",
|
||||
"/css/filament.css": "/css/filament.css?id=ecd162b1ad9d5ed8507f"
|
||||
"/css/filament.css": "/css/filament.css?id=666434e331878aafa0a8"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<div {{ $attributes->merge(['class' => 'bg-white shadow-sm rounded p-4 md:p-6']) }}>
|
||||
{{ $slot }}
|
||||
</div>
|
||||
@@ -3,13 +3,15 @@
|
||||
'tab',
|
||||
])
|
||||
|
||||
<div
|
||||
<x-filament::card
|
||||
x-data="{ tab: '{{ $tab }}' }"
|
||||
x-cloak
|
||||
{{ $attributes->merge(['class' => 'bg-white shadow-sm rounded overflow-hidden']) }}
|
||||
class="overflow-hidden"
|
||||
>
|
||||
<div class="bg-gray-100 border-b border-gray-200 flex" class="tablist" role="tablist" aria-label="{{ $label }}">
|
||||
{{ $tablist }}
|
||||
<div class="-m-4 md:-m-6">
|
||||
<div class="bg-gray-100 border-b border-gray-200 flex" class="tablist" role="tablist" aria-label="{{ $label }}">
|
||||
{{ $tablist }}
|
||||
</div>
|
||||
{{ $slot }}
|
||||
</div>
|
||||
{{ $slot }}
|
||||
</div>
|
||||
</x-filament::card>
|
||||
@@ -1,11 +1,13 @@
|
||||
<x-filament::form class="space-y-6">
|
||||
<x-filament::fields :fields="$this->fields()" />
|
||||
<x-filament::form>
|
||||
<x-filament::card class="space-y-6">
|
||||
<x-filament::fields :fields="$this->fields()" />
|
||||
|
||||
<x-filament::button
|
||||
type="submit"
|
||||
class="btn-primary"
|
||||
wire:loading.attr="disabled"
|
||||
>
|
||||
{{ __('filament::profile.update') }}
|
||||
</x-filament::button>
|
||||
<x-filament::button
|
||||
type="submit"
|
||||
class="btn-primary"
|
||||
wire:loading.attr="disabled"
|
||||
>
|
||||
{{ __('filament::profile.update') }}
|
||||
</x-filament::button>
|
||||
</x-filament::card>
|
||||
</x-filament::form>
|
||||
@@ -82,49 +82,46 @@ class Profile extends Component
|
||||
public function fields()
|
||||
{
|
||||
return [
|
||||
Tabs::make('filament::profile.title')
|
||||
->tab('filament::profile.tabs.account', [
|
||||
Layout::make('grid grid-cols-1 lg:grid-cols-2 gap-6')
|
||||
->fields([
|
||||
Text::make('user.name')
|
||||
->label('Name')
|
||||
->extraAttributes([
|
||||
'required' => 'true',
|
||||
]),
|
||||
Text::make('user.email')
|
||||
->type('email')
|
||||
->label('filament::fields.labels.email')
|
||||
->modelDirective('wire:model.lazy')
|
||||
->extraAttributes([
|
||||
'required' => 'true',
|
||||
'autocomplete' => 'email',
|
||||
]),
|
||||
]),
|
||||
Avatar::make('avatar')
|
||||
->label('filament::profile.labels.userPhoto')
|
||||
->avatar($this->avatar)
|
||||
->user($this->user)
|
||||
->deleteMethod('deleteAvatar'),
|
||||
Fieldset::make('filament::profile.labels.updatePassword')
|
||||
->fields([
|
||||
Text::make('password')
|
||||
->type('password')
|
||||
->label('filament::fields.labels.password')
|
||||
->extraAttributes([
|
||||
'autocomplete' => 'new-password',
|
||||
])
|
||||
->hint(__('filament::fields.hints.optional'))
|
||||
->help(__('filament::profile.help.passwordKeep')),
|
||||
Text::make('password_confirmation')
|
||||
->type('password')
|
||||
->label('filament::fields.labels.newPassword')
|
||||
->extraAttributes([
|
||||
'autocomplete' => 'new-password',
|
||||
])
|
||||
->hint(__('filament::fields.hints.optional')),
|
||||
Layout::make('grid grid-cols-1 lg:grid-cols-2 gap-6')
|
||||
->fields([
|
||||
Text::make('user.name')
|
||||
->label('Name')
|
||||
->extraAttributes([
|
||||
'required' => 'true',
|
||||
]),
|
||||
Text::make('user.email')
|
||||
->type('email')
|
||||
->label('filament::fields.labels.email')
|
||||
->modelDirective('wire:model.lazy')
|
||||
->extraAttributes([
|
||||
'required' => 'true',
|
||||
'autocomplete' => 'email',
|
||||
]),
|
||||
]),
|
||||
Avatar::make('avatar')
|
||||
->label('filament::profile.labels.userPhoto')
|
||||
->avatar($this->avatar)
|
||||
->user($this->user)
|
||||
->deleteMethod('deleteAvatar'),
|
||||
Fieldset::make('filament::profile.labels.updatePassword')
|
||||
->fields([
|
||||
Text::make('password')
|
||||
->type('password')
|
||||
->label('filament::fields.labels.password')
|
||||
->extraAttributes([
|
||||
'autocomplete' => 'new-password',
|
||||
])
|
||||
->class('grid grid-cols-1 lg:grid-cols-2 gap-6'),
|
||||
]),
|
||||
->hint(__('filament::fields.hints.optional'))
|
||||
->help(__('filament::profile.help.passwordKeep')),
|
||||
Text::make('password_confirmation')
|
||||
->type('password')
|
||||
->label('filament::fields.labels.newPassword')
|
||||
->extraAttributes([
|
||||
'autocomplete' => 'new-password',
|
||||
])
|
||||
->hint(__('filament::fields.hints.optional')),
|
||||
])
|
||||
->class('grid grid-cols-1 lg:grid-cols-2 gap-6'),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user