Update input component and toast position

This commit is contained in:
Andras Bacsai 2024-03-22 13:09:02 +01:00
parent 66fe124dd1
commit 2f50f64ecf
4 changed files with 6 additions and 4 deletions

View File

@ -29,7 +29,9 @@ public function render(): View|Closure|string
{
if (is_null($this->id)) $this->id = new Cuid2(7);
if (is_null($this->name)) $this->name = $this->id;
if ($this->type === 'password') {
$this->defaultClass = $this->defaultClass . " pr-[2.8rem]";
}
// $this->label = Str::title($this->label);
return view('components.forms.input');
}

View File

@ -84,7 +84,7 @@ input {
}
.input {
@apply block w-full py-1.5 pr-[2.8rem] rounded border-0 text-sm ring-inset ring-1 dark:bg-coolgray-100 dark:text-white text-black focus:ring-2 dark:focus:ring-coolgray-300 dark:ring-coolgray-300 dark:read-only:text-neutral-500 dark:read-only:ring-0 dark:read-only:bg-coolgray-100/40 dark:placeholder:text-neutral-700;
@apply block w-full py-1.5 rounded border-0 text-sm ring-inset ring-1 dark:bg-coolgray-100 dark:text-white text-black focus:ring-2 dark:focus:ring-coolgray-300 dark:ring-coolgray-300 dark:read-only:text-neutral-500 dark:read-only:ring-0 dark:read-only:bg-coolgray-100/40 dark:placeholder:text-neutral-700;
}
option {

View File

@ -13,7 +13,7 @@
}" x-init="window.toast = function(message, options = {}) {
let description = '';
let type = 'default';
let position = 'bottom-right';
let position = 'top-center';
let html = '';
if (typeof options.description != 'undefined') description = options.description;
if (typeof options.type != 'undefined') type = options.type;

View File

@ -2,7 +2,7 @@
<x-server.navbar :server="$server" :parameters="$parameters" />
@if ($server->isFunctional())
<div x-data="{ activeTab: window.location.hash ? window.location.hash.substring(1) : 'managed' }" class="flex h-full">
<div class="flex flex-col gap-4 xl:w-32">
<div class="flex flex-col gap-4">
<a :class="activeTab === 'managed' && 'text-white'"
@click.prevent="activeTab = 'managed'; window.location.hash = 'managed'" href="#">Managed</a>
<a :class="activeTab === 'unmanaged' && 'text-white'"