-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #275 from DissNik/2.0-components
2.0 components
- Loading branch information
Showing
12 changed files
with
330 additions
and
195 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
74 changes: 74 additions & 0 deletions
74
resources/views/pages/ru/components/decoration_block.blade.php
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,74 @@ | ||
<x-page | ||
title="Декоратор Block" | ||
:sectionMenu="[ | ||
'Разделы' => [ | ||
['url' => '#make', 'label' => 'Make'], | ||
['url' => '#wihtout-heading', 'label' => 'Без заголовка'], | ||
] | ||
]" | ||
> | ||
|
||
<x-sub-title id="make">Make</x-sub-title> | ||
|
||
<x-p> | ||
Декоратор <em>Block</em> позволяет создавать стилизованные блоки. | ||
</x-p> | ||
|
||
<x-p> | ||
Создать <em>Block</em> можно воспользовавшись статическим методом <code>make()</code>. | ||
</x-p> | ||
|
||
<x-code language="php"> | ||
make(Closure|string|array $labelOrFields = '', array $fields = []) | ||
</x-code> | ||
|
||
<x-code language="php"> | ||
use MoonShine\Decorations\Block; // [tl! focus] | ||
use MoonShine\Fields\Text; | ||
|
||
//... | ||
|
||
public function components(): array | ||
{ | ||
return [ | ||
Block::make('Block title', [ // [tl! focus] | ||
Text::make('Name', 'first_name') | ||
]) // [tl! focus] | ||
]; | ||
} | ||
|
||
//... | ||
</x-code> | ||
|
||
<x-image theme="light" src="{{ asset('screenshots/block.png') }}"></x-image> | ||
<x-image theme="dark" src="{{ asset('screenshots/block_dark.png') }}"></x-image> | ||
|
||
|
||
<x-sub-title id="wihtout-heading">Без заголовка</x-sub-title> | ||
|
||
<x-p> | ||
Если у блока не нужен заголовок, то методу <code>make()</code> необходимо передать только массив. | ||
</x-p> | ||
|
||
<x-code language="php"> | ||
use MoonShine\Decorations\Block; // [tl! focus] | ||
use MoonShine\Fields\Text; | ||
|
||
//... | ||
|
||
public function components(): array | ||
{ | ||
return [ | ||
Block::make([ // [tl! focus] | ||
Text::make('Name', 'first_name') | ||
]) // [tl! focus] | ||
]; | ||
} | ||
|
||
//... | ||
</x-code> | ||
|
||
<x-image theme="light" src="{{ asset('screenshots/block_without_title.png') }}"></x-image> | ||
<x-image theme="dark" src="{{ asset('screenshots/block_without_title_dark.png') }}"></x-image> | ||
|
||
</x-page> |
74 changes: 74 additions & 0 deletions
74
resources/views/pages/ru/components/decoration_collapse.blade.php
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,74 @@ | ||
<x-page | ||
title="Декоратор Collapse" | ||
:sectionMenu="[ | ||
'Разделы' => [ | ||
['url' => '#make', 'label' => 'Make'], | ||
['url' => '#show', 'label' => 'Show'], | ||
] | ||
]" | ||
> | ||
|
||
<x-sub-title id="make">Make</x-sub-title> | ||
|
||
<x-p> | ||
Декоратор <em>Collapse</em> позволяет сворачивать содержимое блока с сохранением состояния. | ||
</x-p> | ||
|
||
<x-code language="php"> | ||
make(Closure|string|array $labelOrFields = '', array $fields = []) | ||
</x-code> | ||
|
||
<x-code language="php"> | ||
use MoonShine\Decorations\Collapse; // [tl! focus] | ||
use MoonShine\Fields\Text; | ||
|
||
//... | ||
|
||
public function components(): array | ||
{ | ||
return [ | ||
Collapse::make('Title/Slug', [ // [tl! focus] | ||
Text::make('Title'), | ||
Text::make('Slug') | ||
]) // [tl! focus] | ||
]; | ||
} | ||
|
||
//... | ||
</x-code> | ||
|
||
<x-image theme="light" src="{{ asset('screenshots/collapse.png') }}"></x-image> | ||
<x-image theme="dark" src="{{ asset('screenshots/collapse_dark.png') }}"></x-image> | ||
|
||
<x-sub-title id="show">Show</x-sub-title> | ||
|
||
<x-p> | ||
По умолчанию декоратор <em>Collapse</em> отображается в свернутом состоянии. | ||
Метод <code>show()</code> позволяет переопределить это поведение. | ||
</x-p> | ||
|
||
<x-code language="php"> | ||
show(bool $show = true) | ||
</x-code> | ||
|
||
<x-code language="php"> | ||
use MoonShine\Decorations\Collapse; | ||
use MoonShine\Fields\Text; | ||
|
||
//... | ||
|
||
public function components(): array | ||
{ | ||
return [ | ||
Collapse::make('Title/Slug', [ | ||
Text::make('Title'), | ||
Text::make('Slug') | ||
]) | ||
->show() // [tl! focus] | ||
]; | ||
} | ||
|
||
//... | ||
</x-code> | ||
|
||
</x-page> |
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
Oops, something went wrong.