-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
151 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
|
||
namespace dimonka2\flatform\Form; | ||
|
||
class ElementMapping | ||
{ | ||
public const bindings = [ | ||
// inputs | ||
'text' => Inputs\Text::class, | ||
'password' => Inputs\Password::class, | ||
'number' => Inputs\Number::class, | ||
'textarea' => Inputs\Textarea::class, | ||
'summernote' => Inputs\Summernote::class, | ||
'select' => Inputs\Select::class, | ||
'select2' => Inputs\Select2::class, | ||
'bselect' => Inputs\BootstrapSelect::class, | ||
'file' => Inputs\File::class, | ||
'checkbox' => Inputs\Checkbox::class, | ||
'radio' => Inputs\Radio::class, | ||
'date' => Inputs\Date::class, | ||
'hidden' => Inputs\Hidden::class, | ||
|
||
// components | ||
'tabs' => Components\Tabs::class, | ||
'widget' => Components\Widget::class, | ||
'dropdown' => Components\Dropdown::class, | ||
'dd-item' => Components\DropdownItem::class, | ||
'datatable' => Components\Datatable::class, | ||
'breadcrumbs' => Components\Breadcrumbs::class, | ||
'progress' => Components\Progress::class, | ||
'alert' => Components\Alert::class, | ||
|
||
// links and buttons | ||
'a' => Link::class, | ||
'submit' => Components\Button::class, | ||
'button' => Components\Button::class, | ||
|
||
'form' => Form::class, | ||
'img' => Elements\Image::class, | ||
'col' => Elements\Column::class, | ||
'label' => Elements\Label::class, | ||
|
||
'div' => ElementContainer::class, | ||
'span' => ElementContainer::class, | ||
'i' => ElementContainer::class, | ||
'b' => ElementContainer::class, | ||
'u' => ElementContainer::class, | ||
'ul' => ElementContainer::class, | ||
'li' => ElementContainer::class, | ||
'_text' => Element::class, | ||
'_template' => Element::class, | ||
'option' => Element::class, | ||
|
||
// blade directives | ||
'include' => BladeDirective::class, | ||
'stack' => BladeDirective::class, | ||
'yield' => BladeDirective::class, | ||
'extends' => BladeDirective::class, | ||
'section' => BladeDirective::class, | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
namespace dimonka2\flatform\Form\Elements; | ||
|
||
use dimonka2\flatform\Form\ElementContainer; | ||
use dimonka2\flatform\Form\Contracts\IContext; | ||
|
||
// Bootstrap column | ||
|
||
class Column extends ElementContainer | ||
{ | ||
protected $col; | ||
protected $md; | ||
protected $lg; | ||
protected $xl; | ||
protected $xs; | ||
|
||
protected function read(array $element) | ||
{ | ||
$this->readSettings($element, ['col', 'md', 'lg', 'xl', 'xs']); | ||
parent::read($element); | ||
if($this->col ) $this->addClass('col-' . $this->col); | ||
if($this->md ) $this->addClass('col-md-' . $this->md); | ||
if($this->lg ) $this->addClass('col-lg-' . $this->lg); | ||
if($this->xl ) $this->addClass('col-xl-' . $this->xl); | ||
if($this->xs ) $this->addClass('col-xs-' . $this->xs); | ||
|
||
if (!$this->col && !$this->md && !$this->lg && !$this->xl && !$this->xs) { | ||
$this->addClass(config('flatform.form.col', 'col-6')); | ||
} | ||
} | ||
|
||
public function getTag() | ||
{ | ||
return 'div'; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace dimonka2\flatform\Form\Elements; | ||
|
||
use dimonka2\flatform\Form\Element; | ||
use dimonka2\flatform\Form\Contracts\IContext; | ||
|
||
class Image extends Element | ||
{ | ||
protected $src; | ||
protected function read(array $element) | ||
{ | ||
$this->readSettings($element, ['src']); | ||
parent::read($element); | ||
} | ||
|
||
public function getOptions(array $keys) | ||
{ | ||
$options = parent::getOptions($keys); | ||
if($this->src) $options['src'] = $this->src; | ||
return $options; | ||
} | ||
} |
File renamed without changes.