From 8ac6d7993dccf7a3adea149619bf23c93e9b9cb7 Mon Sep 17 00:00:00 2001 From: tanthammar Date: Thu, 6 Aug 2020 18:06:55 +0200 Subject: [PATCH] Added text colors to config Added spa-layout to config Added default traits to stubs Fix array field icon did not show New Range slider Fix error icon text color Fix styling horizontal alignment of array icons New min, max, step, option to inputs of type number, range, date, datetime-local, month, time, week Fix background color in notification trait Fix background color of delete button in array fields New Honeypot field support New fields_updated() method in Form Component New Laravel 7 Blade component for range input sliders Fix default path for mime_type icons --- config/tall-forms.php | 23 ++++++++++++- resources/stubs/create-component.stub | 2 ++ resources/stubs/update-component.stub | 2 ++ resources/views/array-fields/input.blade.php | 5 +-- resources/views/array-fields/range.blade.php | 5 +++ .../views/components/error-icon.blade.php | 4 +-- .../views/components/field-wrapper.blade.php | 2 +- resources/views/components/input.blade.php | 7 ++-- .../views/components/notification.blade.php | 2 +- resources/views/components/range.blade.php | 33 +++++++++++++++++++ resources/views/fields/array.blade.php | 6 ++-- resources/views/fields/input.blade.php | 8 ++--- resources/views/fields/range.blade.php | 3 ++ src/BaseField.php | 29 ++++++++++++++++ src/Field.php | 13 ++++---- src/FormComponent.php | 9 ++++- src/FormServiceProvider.php | 1 + 17 files changed, 131 insertions(+), 23 deletions(-) create mode 100644 resources/views/array-fields/range.blade.php create mode 100644 resources/views/components/range.blade.php create mode 100644 resources/views/fields/range.blade.php diff --git a/config/tall-forms.php b/config/tall-forms.php index 632403c..22beff9 100644 --- a/config/tall-forms.php +++ b/config/tall-forms.php @@ -1,32 +1,53 @@ "trans('global.create').' '.trans('crud.dummymodel.title_singular')", + + //A Laravel 7 blade component to wrap your form if $spaMode = true, see documentation + 'spa-layout' => 'tall-forms::spa-layout', + + //form buttons translations 'saved' => 'global.saved', 'delete' => 'global.delete', 'save-and-stay' =>'global.save', 'save-go-back' => 'global.save_go_back', 'message-updated-success' => 'messages.updated_success', + + //notification trait popup bg colors 'positive' => 'bg-green-500', 'negative' => 'bg-red-500', 'info' => 'bg-blue-500', 'warning' => 'bg-orange-500', 'default' => 'bg-teal-500', + + //text colors + 'text-positive' => 'text-aurora-green', + 'text-negative' => 'text-aurora-red', + 'text-info' => 'text-frost-dimmed', + 'text-warning' => 'text-orange-800', + 'text-primary' => 'text-teal-800', + + //button component classes 'button-info' => 'text-white bg-frost-dimmed hover:bg-frost-blue focus:border-blue-700 focus:shadow-outline-blue active:bg-frost-dimmed', 'button-positive' => 'text-white bg-aurora-green hover:bg-green-500 focus:border-green-600 focus:shadow-outline-green active:bg-aurora-green', 'button-negative' => 'text-red-100 bg-aurora-red hover:bg-red-500 focus:border-red-600 focus:shadow-outline-red active:bg-aurora-red', 'button-warning' => 'text-orange-100 bg-aurora-orange hover:bg-orange-600 focus:border-orange-700 focus:shadow-outline-orange active:bg-orange-700', 'button-primary' => 'text-blue-100 bg-night-lighter hover:bg-night-dark focus:border-night-light focus:shadow-outline-blue active:bg-night-dark', + + //file uploads 'storage_disk' => env('FORM_STORAGE_DISK', 'public'), 'storage_path' => env('FORM_STORAGE_PATH', 'uploads'), + + //icons 'arrow-up-icon' => 'light/arrow-up', //used as @svg('light/arrow-up', 'classes') 'arrow-down-icon' => 'light/arrow-down', 'trash-icon' => 'light/trash-alt', 'plus-icon' => 'light/plus-circle', - 'file-icon' => 'light/' //used as light/{$mime_type} + 'file-icon' => 'light/' //used as @svg('light/{$mime_type}', 'classes') ]; diff --git a/resources/stubs/create-component.stub b/resources/stubs/create-component.stub index 304009c..f94c407 100644 --- a/resources/stubs/create-component.stub +++ b/resources/stubs/create-component.stub @@ -3,8 +3,10 @@ namespace App\Http\Livewire\Namespace; use App\ModelsPathDummyModel; +use Tanthammar\TallForms\ArrayField; use Tanthammar\TallForms\Field; use Tanthammar\TallForms\FormComponent; +use Tanthammar\TallForms\KeyValField; class DummyComponent extends FormComponent { diff --git a/resources/stubs/update-component.stub b/resources/stubs/update-component.stub index c22dfac..d90a10c 100644 --- a/resources/stubs/update-component.stub +++ b/resources/stubs/update-component.stub @@ -3,8 +3,10 @@ namespace App\Http\Livewire\Namespace; use App\ModelsPathDummyModel; +use Tanthammar\TallForms\ArrayField; use Tanthammar\TallForms\Field; use Tanthammar\TallForms\FormComponent; +use Tanthammar\TallForms\KeyValField; class DummyComponent extends FormComponent { diff --git a/resources/views/array-fields/input.blade.php b/resources/views/array-fields/input.blade.php index d792ce6..d39b97d 100644 --- a/resources/views/array-fields/input.blade.php +++ b/resources/views/array-fields/input.blade.php @@ -1,4 +1,5 @@ + :label="($array_field->show_label) ? $array_field->label : null" :errorMsg="$array_field->errorMsg" + :step="$array_field->step" :min="$array_field->min" :max="$array_field->max"/> diff --git a/resources/views/array-fields/range.blade.php b/resources/views/array-fields/range.blade.php new file mode 100644 index 0000000..3bde4df --- /dev/null +++ b/resources/views/array-fields/range.blade.php @@ -0,0 +1,5 @@ + diff --git a/resources/views/components/error-icon.blade.php b/resources/views/components/error-icon.blade.php index 767cc49..c954075 100644 --- a/resources/views/components/error-icon.blade.php +++ b/resources/views/components/error-icon.blade.php @@ -2,9 +2,9 @@ 'right' => 'right-0' ])
- + -
\ No newline at end of file + diff --git a/resources/views/components/field-wrapper.blade.php b/resources/views/components/field-wrapper.blade.php index aea390f..8326e01 100644 --- a/resources/views/components/field-wrapper.blade.php +++ b/resources/views/components/field-wrapper.blade.php @@ -4,7 +4,7 @@ 'label' => "", 'labelW' => 'sm:w-1/3', 'fieldW' => 'sm:w-2/3', - 'align' => 'items-center' + 'align' => 'items-baseline' ])