--wip-- [skip ci]

This commit is contained in:
philipp lang 2024-10-28 23:14:33 +01:00
parent 26f6925d42
commit d54b580c7c
7 changed files with 59 additions and 7 deletions

1
.deptrac.cache Normal file

File diff suppressed because one or more lines are too long

View File

@ -32,6 +32,13 @@ class Text extends Component
@endif @endif
<div class="relative flex-none flex"> <div class="relative flex-none flex">
<input <input
@error($name) x-init="tippy($el, {
content: () => '@error($name){{$message}}@enderror',
showOnCreate: true,
theme: 'danger',
placement: 'top-end',
delay: [0, 3000],
})" @enderror
id="{{$id}}" id="{{$id}}"
type="{{$type}}" type="{{$type}}"
@if ($type === 'password') autocomplete="off" @endif @if ($type === 'password') autocomplete="off" @endif

View File

@ -233,6 +233,7 @@ return [
'URL' => Illuminate\Support\Facades\URL::class, 'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class, 'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class, 'View' => Illuminate\Support\Facades\View::class,
'Vite' => Illuminate\Support\Facades\Vite::class,
'Inertia' => \Inertia\Inertia::class, 'Inertia' => \Inertia\Inertia::class,
], ],
]; ];

View File

@ -14,7 +14,7 @@ class SettingView extends Component
public $settingClass = NamiSettings::class; public $settingClass = NamiSettings::class;
#[Validate('required|string')] #[Validate('required|string|min:4')]
public string $password = ''; public string $password = '';
#[Validate('required|string')] #[Validate('required|string')]
public string $mglnr = ''; public string $mglnr = '';

View File

@ -19,3 +19,25 @@
.tippy-box[data-theme~='primary'] > .tippy-svg-arrow { .tippy-box[data-theme~='primary'] > .tippy-svg-arrow {
fill: theme('colors.primary.800'); fill: theme('colors.primary.800');
} }
.tippy-box[data-theme~='danger'] {
@apply bg-red-800 text-red-100 shadow-lg;
}
.tippy-box[data-theme~='danger'][data-placement^='top'] > .tippy-arrow:before {
border-top-color: theme('colors.red.800');
}
.tippy-box[data-theme~='danger'][data-placement^='bottom'] > .tippy-arrow:before {
border-bottom-color: theme('colors.red.800');
}
.tippy-box[data-theme~='danger'][data-placement^='left'] > .tippy-arrow:before {
border-left-color: theme('colors.red.800');
}
.tippy-box[data-theme~='danger'][data-placement^='right'] > .tippy-arrow:before {
border-right-color: theme('colors.red.800');
}
.tippy-box[data-theme~='danger'] > .tippy-backdrop {
background-color: theme('colors.red.800');
}
.tippy-box[data-placement='top-end'] > .tippy-arrow {
@apply !transform-none !left-auto right-4;
}

View File

@ -6,14 +6,34 @@ import 'tippy.js/dist/tippy.css';
import 'tippy.js/animations/shift-toward.css'; import 'tippy.js/animations/shift-toward.css';
import '../css/tooltip.css'; import '../css/tooltip.css';
import {error, success} from './toastify.js'; import {error, success} from './toastify.js';
import tippy from 'tippy.js';
Alpine.plugin( const defaultTippy = {
Tooltip.defaultProps({ theme: 'primary',
theme: 'primary', animation: 'shift-toward',
animation: 'shift-toward', };
})
); Alpine.plugin(Tooltip.defaultProps(defaultTippy));
window.addEventListener('success', (event) => success(event.detail[0])); window.addEventListener('success', (event) => success(event.detail[0]));
document.addEventListener('alpine:init', () => {
Alpine.directive('error', function (el, {value, modifiers, expression}, {Alpine, effect, cleanup, evaluateLater}) {
let getThingToLog = evaluateLater(expression);
// el._x_custom_tippy = new tippy(el, {
// ...defaultTippy,
// content: '',
// });
effect(() => {
getThingToLog((thingToLog) => {
console.log(thingToLog);
});
});
});
});
window.tippy = tippy;
Livewire.start(); Livewire.start();

View File

@ -76,6 +76,7 @@ use App\Membership\Actions\MembershipStoreAction;
use App\Membership\Actions\MembershipUpdateAction; use App\Membership\Actions\MembershipUpdateAction;
use App\Payment\SubscriptionController; use App\Payment\SubscriptionController;
Route::get('/lala', fn () => auth()->login(\App\User::first()));
Route::group(['namespace' => 'App\\Http\\Controllers'], function (): void { Route::group(['namespace' => 'App\\Http\\Controllers'], function (): void {
Auth::routes(['register' => false]); Auth::routes(['register' => false]);
}); });