Commented enter logic and added export functionality
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Resources;
|
||||
|
||||
use App\Filament\Exports\ProductionQuantityExporter;
|
||||
use App\Filament\Imports\ProductionQuantityImporter;
|
||||
use App\Filament\Resources\ProductionQuantityResource\Pages;
|
||||
use App\Filament\Resources\ProductionQuantityResource\RelationManagers;
|
||||
@@ -20,6 +21,7 @@ use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
use Filament\Forms\Components\Section;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Tables\Actions\ExportAction;
|
||||
|
||||
class ProductionQuantityResource extends Resource
|
||||
{
|
||||
@@ -245,7 +247,7 @@ class ProductionQuantityResource extends Resource
|
||||
// ->required()
|
||||
->reactive()
|
||||
->autofocus(true)
|
||||
->debounce(300)
|
||||
->debounce(1000)
|
||||
// ->submitOnEnter()
|
||||
->afterStateUpdated(function ($state, callable $get, callable $set) {
|
||||
// **Check if input is empty before processing**
|
||||
@@ -709,6 +711,11 @@ class ProductionQuantityResource extends Resource
|
||||
])
|
||||
->hint(fn ($get) => $get('validationError') ? $get('validationError') : null)
|
||||
->hintColor('danger'),
|
||||
// ->extraAttributes([
|
||||
// 'x-data' => '{ value: "" }',
|
||||
// 'x-model' => 'value',
|
||||
// 'x-on:keydown.enter.prevent' => '$wire.processQr(value)',
|
||||
// ]),
|
||||
Forms\Components\Hidden::make('item_id')
|
||||
->required(),
|
||||
Forms\Components\TextInput::make('serial_number')
|
||||
@@ -794,6 +801,8 @@ class ProductionQuantityResource extends Resource
|
||||
ImportAction::make()
|
||||
->importer(ProductionQuantityImporter::class)
|
||||
->maxRows(100000),
|
||||
ExportAction::make()
|
||||
->exporter(ProductionQuantityExporter::class),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user