mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
wip
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
<x-filament-actions::actions
|
||||
:actions="$actions"
|
||||
:alignment="$alignment ?? static::getFormActionsAlignment()"
|
||||
:alignment="$alignment ?? $this->getFormActionsAlignment()"
|
||||
:full-width="$fullWidth"
|
||||
class="filament-form-actions"
|
||||
/>
|
||||
|
||||
@@ -194,8 +194,8 @@ class CreateRecord extends Page
|
||||
->context('create')
|
||||
->model($this->getModel())
|
||||
->statePath('data')
|
||||
->columns(static::$formHasInlineLabels ? 1 : 2)
|
||||
->inlineLabel(static::$formHasInlineLabels),
|
||||
->columns($this->hasInlineFormLabels() ? 1 : 2)
|
||||
->inlineLabel($this->hasInlineFormLabels()),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -274,8 +274,8 @@ class EditRecord extends Page
|
||||
->context('edit')
|
||||
->model($this->getRecord())
|
||||
->statePath('data')
|
||||
->columns(static::$formHasInlineLabels ? 1 : 2)
|
||||
->inlineLabel(static::$formHasInlineLabels),
|
||||
->columns($this->hasInlineFormLabels() ? 1 : 2)
|
||||
->inlineLabel($this->hasInlineFormLabels()),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ abstract class Page extends BasePage
|
||||
|
||||
public static string $formActionsAlignment = 'left';
|
||||
|
||||
public static bool $formHasInlineLabels = false;
|
||||
public static bool $hasInlineFormLabels = false;
|
||||
|
||||
public static function route(string $path): PageRegistration
|
||||
{
|
||||
@@ -96,8 +96,13 @@ abstract class Page extends BasePage
|
||||
static::$formActionsAlignment = 'right';
|
||||
}
|
||||
|
||||
public static function getFormActionsAlignment(): string
|
||||
public function getFormActionsAlignment(): string
|
||||
{
|
||||
return static::$formActionsAlignment;
|
||||
}
|
||||
|
||||
public function hasInlineFormLabels(): bool
|
||||
{
|
||||
return static::$hasInlineFormLabels;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,8 +161,8 @@ class ViewRecord extends Page
|
||||
->disabled()
|
||||
->model($this->getRecord())
|
||||
->statePath('data')
|
||||
->columns(static::$formHasInlineLabels ? 1 : 2)
|
||||
->inlineLabel(static::$formHasInlineLabels),
|
||||
->columns($this->hasInlineFormLabels() ? 1 : 2)
|
||||
->inlineLabel($this->hasInlineFormLabels()),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -380,7 +380,7 @@ export default function dateTimePickerFormComponent({
|
||||
},
|
||||
|
||||
togglePanelVisibility: function () {
|
||||
if (!this.isOpen()) {
|
||||
if (! this.isOpen()) {
|
||||
this.focusedDate =
|
||||
this.getSelectedDate() ??
|
||||
this.getMinDate() ??
|
||||
|
||||
@@ -45,6 +45,15 @@
|
||||
'opacity-70 dark:text-gray-300' => $isDisabled(),
|
||||
]) }}
|
||||
>
|
||||
<div class="grid grid-cols-7 gap-1">
|
||||
<template x-for="(day, index) in dayLabels" x-bind:key="index">
|
||||
<div
|
||||
x-text="day"
|
||||
class="text-xs font-medium text-center text-gray-800 dark:text-gray-200"
|
||||
></div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<input
|
||||
readonly
|
||||
placeholder="{{ $getPlaceholder() }}"
|
||||
@@ -85,6 +94,7 @@
|
||||
x-model="focusedMonth"
|
||||
class="grow px-1 py-0 text-lg font-medium text-gray-800 border-0 cursor-pointer focus:ring-0 focus:outline-none dark:bg-gray-700 dark:text-gray-200"
|
||||
dusk="filament.forms.{{ $getStatePath() }}.focusedMonth"
|
||||
wire:ignore
|
||||
>
|
||||
<template x-for="(month, index) in months">
|
||||
<option x-bind:value="index" x-text="month"></option>
|
||||
@@ -100,8 +110,8 @@
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-7 gap-1">
|
||||
<template x-for="(day, index) in dayLabels" :key="index">
|
||||
<div class="grid grid-cols-7 gap-1" wire:ignore>
|
||||
<template x-for="(day, index) in dayLabels" x-bind:key="index">
|
||||
<div
|
||||
x-text="day"
|
||||
class="text-xs font-medium text-center text-gray-800 dark:text-gray-200"
|
||||
|
||||
@@ -148,7 +148,7 @@ class SettingsPage extends Page
|
||||
$this->makeForm()
|
||||
->statePath('data')
|
||||
->columns(2)
|
||||
->inlineLabel(static::$formHasInlineLabels),
|
||||
->inlineLabel($this->hasInlineFormLabels()),
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user