Skip to content

Commit

Permalink
Merge pull request #54 from lara-zeus/fixes
Browse files Browse the repository at this point in the history
improvements and fixes in zeus fields
  • Loading branch information
atmonshi authored Jun 11, 2023
2 parents 1f71845 + a212fe4 commit 50d3ddd
Show file tree
Hide file tree
Showing 17 changed files with 109 additions and 133 deletions.
60 changes: 30 additions & 30 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion database/seeders/BoltSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function run()
'section_id' => $section1,
'ordering' => 1,
'options' => json_encode([
'dateType' => 'text',
'dateType' => 'string',
'is_required' => true,
], JSON_THROW_ON_ERROR),
'type' => '\LaraZeus\Bolt\Fields\Classes\TextInput',
Expand Down
12 changes: 11 additions & 1 deletion resources/lang/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,15 @@
"Responses Status": "السجلات حسب الحالة",
"Fields": "الحقول",
"Responses": "السجلات",
"Fields Responses": "السجلات للحقول"
"Fields Responses": "السجلات للحقول",
"string": "نص",
"password": "كلمة مرور",
"active url": "رابط نشط",
"alpha": "احرف فقط",
"alpha dash": "احرف مع - و ـ",
"alpha num": "احرف وارقام فقط",
"ip": "رقم IP",
"ipv4": "رقم IP 4",
"ipv6": "رقم IP 6",
"mac address": "عنوان ماك"
}
8 changes: 5 additions & 3 deletions resources/views/filament/fields/file-upload.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<a target="_blank" href="{{ Storage::disk(config('zeus-bolt.uploads.disk'))->url($resp->response) }}">
{{ __('view file') }}
</a>
@if(!empty($resp->response))
<a target="_blank" href="{{ Storage::disk(config('zeus-bolt.uploads.disk'))->url($resp->response) }}">
{{ __('view file') }}
</a>
@endif
11 changes: 6 additions & 5 deletions src/Fields/Classes/CheckboxList.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@

namespace LaraZeus\Bolt\Fields\Classes;

use Filament\Forms\Components\Select;
use Filament\Forms\Components\Toggle;
use LaraZeus\Bolt\Fields\FieldsContract;

class CheckboxList extends FieldsContract
{
public string $renderClass = '\Filament\Forms\Components\CheckboxList';
public string $renderClass = \Filament\Forms\Components\CheckboxList::class;

public int $sort = 6;

Expand All @@ -20,11 +18,14 @@ public function title(): string
public static function getOptions(): array
{
return [
Select::make('options.dataSource')->required()->options(config('zeus-bolt.models.Collection')::pluck('name', 'id'))->label(__('Data Source'))->columnSpan(2),
Toggle::make('options.is_required')->label(__('Is Required')),
\Filament\Forms\Components\Select::make('options.dataSource')
->required()
->options(config('zeus-bolt.models.Collection')::pluck('name', 'id'))
->label(__('Data Source')),
\Filament\Forms\Components\TextInput::make('options.htmlId')
->default(str()->random(6))
->label(__('HTML ID')),
\Filament\Forms\Components\Toggle::make('options.is_required')->label(__('Is Required')),
];
}

Expand Down
5 changes: 2 additions & 3 deletions src/Fields/Classes/DatePicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

namespace LaraZeus\Bolt\Fields\Classes;

use Filament\Forms\Components\Toggle;
use LaraZeus\Bolt\Fields\FieldsContract;

class DatePicker extends FieldsContract
{
public string $renderClass = '\Filament\Forms\Components\DatePicker';
public string $renderClass = \Filament\Forms\Components\DatePicker::class;

public int $sort = 8;

Expand All @@ -19,7 +18,7 @@ public function title(): string
public static function getOptions(): array
{
return [
Toggle::make('options.is_required')->label(__('Is Required')),
\Filament\Forms\Components\Toggle::make('options.is_required')->label(__('Is Required')),
\Filament\Forms\Components\TextInput::make('options.htmlId')
->default(str()->random(6))
->label(__('HTML ID')),
Expand Down
5 changes: 2 additions & 3 deletions src/Fields/Classes/DateTimePicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

namespace LaraZeus\Bolt\Fields\Classes;

use Filament\Forms\Components\Toggle;
use LaraZeus\Bolt\Fields\FieldsContract;

class DateTimePicker extends FieldsContract
{
public string $renderClass = '\Filament\Forms\Components\DateTimePicker';
public string $renderClass = \Filament\Forms\Components\DateTimePicker::class;

public int $sort = 7;

Expand All @@ -19,7 +18,7 @@ public function title(): string
public static function getOptions(): array
{
return [
Toggle::make('options.is_required')->label(__('Is Required')),
\Filament\Forms\Components\Toggle::make('options.is_required')->label(__('Is Required')),
\Filament\Forms\Components\TextInput::make('options.htmlId')
->default(str()->random(6))
->label(__('HTML ID')),
Expand Down
7 changes: 3 additions & 4 deletions src/Fields/Classes/FileUpload.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

namespace LaraZeus\Bolt\Fields\Classes;

use Filament\Forms\Components\Toggle;
use LaraZeus\Bolt\Fields\FieldsContract;

class FileUpload extends FieldsContract
{
public string $renderClass = '\Filament\Forms\Components\FileUpload';
public string $renderClass = \Filament\Forms\Components\FileUpload::class;

public int $sort = 11;

Expand All @@ -19,8 +18,8 @@ public function title(): string
public static function getOptions(): array
{
return [
Toggle::make('options.is_required')->label(__('Is Required')),
Toggle::make('options.is_multiple')->label(__('Allow Multiple')),
\Filament\Forms\Components\Toggle::make('options.is_required')->label(__('Is Required')),
\Filament\Forms\Components\Toggle::make('options.is_multiple')->label(__('Allow Multiple')),
\Filament\Forms\Components\TextInput::make('options.htmlId')
->default(str()->random(6))
->label(__('HTML ID')),
Expand Down
46 changes: 0 additions & 46 deletions src/Fields/Classes/MultiSelect.php

This file was deleted.

Loading

0 comments on commit 50d3ddd

Please sign in to comment.