Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
afsakar committed Aug 8, 2024
1 parent e54efb3 commit 7bd3e2f
Show file tree
Hide file tree
Showing 49 changed files with 2,756 additions and 31 deletions.
1 change: 1 addition & 0 deletions .phpunit.cache/test-results
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":"pest_2.35.0","defects":[],"times":{"P\\Tests\\ExampleTest::__pest_evaluable_it_can_test":0.01,"P\\Tests\\ArchTest::__pest_evaluable_it_will_not_use_debugging_functions":0.318}}
19 changes: 14 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@
"require": {
"php": "^8.1",
"filament/filament": "^3.0",
"spatie/laravel-package-tools": "^1.15.0"
"filament/spatie-laravel-media-library-plugin": "^3.4",
"ryangjchandler/blade-tabler-icons": "^2.3",
"spatie/eloquent-sortable": "^4.0",
"spatie/laravel-package-tools": "^1.15.0",
"ysfkaya/filament-phone-input": "^2.0"
},
"require-dev": {
"laravel/pint": "^1.0",
"nunomaduro/collision": "^7.9",
"nunomaduro/larastan": "^2.0.1",
"larastan/larastan": "^2.9",
"orchestra/testbench": "^8.0",
"pestphp/pest": "^2.1",
"pestphp/pest-plugin-arch": "^2.0",
Expand All @@ -49,10 +53,15 @@
},
"scripts": {
"post-autoload-dump": "@php ./vendor/bin/testbench package:discover --ansi",
"analyse": "vendor/bin/phpstan analyse",
"phpstan": "vendor/bin/phpstan analyse --error-format=github --memory-limit=1G",
"test": "vendor/bin/pest",
"test-coverage": "vendor/bin/pest --coverage",
"format": "vendor/bin/pint"
"lint": "vendor/bin/pint -v",
"checks": [
"@lint",
"@phpstan",
"@test"
]
},
"config": {
"sort-packages": true,
Expand All @@ -73,4 +82,4 @@
},
"minimum-stability": "dev",
"prefer-stable": true
}
}
8 changes: 1 addition & 7 deletions config/form-maker.php → config/filament-form-maker.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
<?php

return [
'main_table' => 'form_maker',

'table_prefix' => 'form_maker_',

'models' => [
//
],
'user' => App\Models\User::class, // @phpstan-ignore-line

'extra_collections' => [
// App\Models\User::class => 'User List',
Expand Down
19 changes: 9 additions & 10 deletions database/migrations/create_form_maker_table.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,35 @@ return new class extends Migration
{
public function up()
{
Schema::create(config('form-maker.main_table'), function (Blueprint $table) {
Schema::create('form_builders', function (Blueprint $table) {
$table->id();
$table->string('name')->unique();
$table->string('slug')->unique();
$table->json('options')->nullable();
$table->timestamps();
});

Schema::create(config('form-maker.table_prefix') . 'sections', function (Blueprint $table) {
Schema::create('form_builder_sections', function (Blueprint $table) {
$table->id();
$table->foreignId(config('form-maker.table_prefix') . 'id')->constrained()->onDelete('cascade');
$table->json('title')->nullable();
$table->foreignId('form_builder_id')->constrained()->onDelete('cascade');
$table->string('title')->nullable();
$table->integer('columns')->default(1);
$table->json('options')->nullable();
$table->json('optional')->nullable();
$table->integer('order_column')->index()->nullable();
$table->timestamps();
});

Schema::create(config('form-maker.table_prefix') . 'fields', function (Blueprint $table) {
Schema::create('form_builder_fields', function (Blueprint $table) {
$table->id();
$table->foreignId(config('form-maker.table_prefix') . 'section_id')->constrained()->onDelete('cascade');
$table->json('name');
$table->foreignId('form_builder_section_id')->constrained()->onDelete('cascade');
$table->string('name');
$table->string('type');
$table->json('options')->nullable();
$table->integer('order_column')->index()->nullable();
$table->timestamps();
});

Schema::create(config('form-maker.table_prefix') . 'collections', function (Blueprint $table) {
Schema::create('form_builder_collections', function (Blueprint $table) {
$table->id();
$table->string('name')->unique();
$table->string('type')->default('list');
Expand All @@ -46,7 +45,7 @@ return new class extends Migration
$table->timestamps();
});

Schema::create(config('form-maker.table_prefix') . 'data', function (Blueprint $table) {
Schema::create('form_builder_data', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->json('fields');
Expand Down
270 changes: 270 additions & 0 deletions resources/css/form.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,270 @@
.choices__list.choices__list--multiple {
padding-right: 15px!important;
}

.choices__list.choices__list--multiple > .choices__item {
background: #13293e !important;
color: #fff !important;
}

.choices__list.choices__list--dropdown > div > .choices__item.choices__item--selectable.is-highlighted {
background: #13293e !important;
color: #fff !important;
}

.choices__input.choices__input--cloned {
font-size: 18px !important;
}

.choices__placeholder {
font-size: 18px !important;
padding-left: 10px!important;
}

.choices__inner {
min-height: 50px !important;
background-color: transparent !important;
display: grid;
align-items: center;
}

.choices__item.choices__item--selectable {
font-size: 18px !important;
}

.filepond--label-action {
color: rgb(203 21 23) !important;
}

.filepond--hopper.filepond--root {
border: 1px #8B8B8B !important;
background-color: transparent !important;
}

.choices__list.choices__list--multiple > .choices__item > button.choices__button {
background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI2ZmZiIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJtMi41OTIuMDQ0IDE4LjM2NCAxOC4zNjQtMi41NDggMi41NDhMLjA0NCAyLjU5MnoiLz48cGF0aCBkPSJNMCAxOC4zNjQgMTguMzY0IDBsMi41NDggMi41NDhMMi41NDggMjAuOTEyeiIvPjwvZz48L3N2Zz4=) !important;
}


@media (min-width: 640px) {
.choices__inner {
min-height: 45px !important;
}
}

@media (min-width: 1024px) {
.choices__inner {
min-height: 60px !important;
}
}


.fi-input-wrp {
background-color: transparent !important;
}
.fi-input {
display: block;
height: 60px;
line-height: 60px;
background-color: transparent;
outline: none;
font-size: 18px;
line-height: normal;
color: #000;
transition: all 350ms;
placeholder: #8B8B8B;
border-radius: 8px;
group-hover: !border-primary;
focus: !border-primary;
padding: 0 20px;
width: 100%;
}

.fi-fo-date-time-picker-display-text-input{
display: block;
height: 60px;
line-height: 60px;
background-color: transparent;
outline: none;
font-size: 18px;
line-height: normal;
color: #000;
transition: all 350ms;
placeholder: #8B8B8B;
border-radius: 8px;
group-hover: !border-primary;
focus: !border-primary;
padding: 0 20px;
width: 100%;
}

.fi-select-input {
display: block;
height: auto;
background-color: transparent;
outline: none;
font-size: 18px;
line-height: normal;
color: #000;
transition: all 350ms;
placeholder: #8B8B8B;
border-radius: 8px;
group-hover: !border-primary;
focus: !border-primary;
width: 100%;
}

.fi-fo-select {
display: block;
height: auto;
background-color: transparent;
outline: none;
font-size: 18px;
line-height: normal;
color: #000;
transition: all 350ms;
placeholder: #8B8B8B;
border-radius: 8px;
group-hover: !border-primary;
focus: !border-primary;
width: 100%;
}

.fi-fo-textarea {
display: block;
min-height: 170px;
padding: 20px;
width: 100%;
height: 60px;
background-color: transparent;
outline: none;
font-size: 18px;
line-height: normal;
color: #000;
transition: all 350ms;
placeholder: #8B8B8B;
border-radius: 8px;
group-hover: !border-primary;
focus: !border-primary;
scrollbar: scrollbar;
scrollbar-width: 5px;
scrollbar-height: 5px;
scrollbar-track: transparent;
scrollbar-thumb: primary;
scrollbar-thumb-radius: full;
}

.fi-fo-checkbox-list, .fi-fo-radio {
gap: 15px;
padding: 15px 0;
}

.fi-checkbox-input, .fi-radio-input {
width: 20px;
height: 20px;
background-color: transparent;
outline: none;
border-radius: 8px;
group-hover: !border-primary;
}

.fi-fo-field-wrp > div > div {
margin-bottom: 0;
}

.fi-fo-phone-input {
position: relative;
z-index: 1;
}

.iti--allow-dropdown .fi-input {
padding-left: 50px!important;
}

.fi-no.pointer-events-none {
pointer-events: none;
z-index: 1000;
}

.fi-fo-component-ctn {
gap: 30px;
padding: 15px 0;
}

input.choices__input.choices__input--cloned {
display: block;
height: 50px;
background-color: transparent;
outline: none;
font-size: 18px;
line-height: normal;
color: #000;
transition: all 350ms;
placeholder: #8B8B8B;
border-radius: 8px;
width: 100%;
}

.choices__list.choices__list--dropdown {
z-index: 999999 !important;
}

.choices__list.choices__list--multiple {
padding-right: 15px!important;
}

.choices__list.choices__list--multiple > .choices__item {
background: #13293e !important;
color: #fff !important;
}

.choices__list.choices__list--dropdown > div > .choices__item.choices__item--selectable.is-highlighted {
background: #13293e !important;
color: #fff !important;
}

.choices__input.choices__input--cloned {
font-size: 18px !important;
}

.choices__placeholder {
font-size: 18px !important;
padding-left: 10px!important;
}

.choices__inner {
min-height: 50px !important;
background-color: transparent !important;
display: grid;
align-items: center;
}

.choices__item.choices__item--selectable {
font-size: 18px !important;
}

.filepond--label-action {
color: rgb(203 21 23) !important;
}

.filepond--hopper.filepond--root {
border: 1px #8B8B8B !important;
background-color: transparent !important;
}

.choices__list.choices__list--multiple > .choices__item > button.choices__button {
background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI2ZmZiIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJtMi41OTIuMDQ0IDE4LjM2NCAxOC4zNjQtMi41NDggMi41NDhMLjA0NCAyLjU5MnoiLz48cGF0aCBkPSJNMCAxOC4zNjQgMTguMzY0IDBsMi41NDggMi41NDhMMi41NDggMjAuOTEyeiIvPjwvZz48L3N2Zz4=) !important;
}


@media (min-width: 640px) {
.choices__inner {
min-height: 45px !important;
}
}

@media (min-width: 1024px) {
.choices__inner {
min-height: 60px !important;
}
}
Loading

0 comments on commit 7bd3e2f

Please sign in to comment.