Skip to content

Develop #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions src/Components/Richtext.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
class Richtext extends LazyComponent
{
public bool $autoFocus = false;

public bool $readonly = false;

public function __construct(public string $placeholder = '', public bool $required = false, public ?QuillOptions $quillOptions = null)
Expand All @@ -34,32 +35,32 @@ public function render(): \Closure|View
return view('lazy::richtext', $this->mergeData($data, [
'textarea',
//colors
'textarea-bordered' => ! $color || $color === 'bordered' || $color !== 'no-border',
'textarea-ghost' => $color === 'ghost',
'textarea-primary' => $color === 'primary',
'textarea-bordered' => ! $color || $color === 'bordered' || $color !== 'no-border',
'textarea-ghost' => $color === 'ghost',
'textarea-primary' => $color === 'primary',
'textarea-secondary' => $color === 'secondary',
'textarea-accent' => $color === 'accent',
'textarea-info' => $color === 'info',
'textarea-success' => $color === 'success',
'textarea-warning' => $color === 'warning',
'textarea-error' => $color === 'error',
'textarea-accent' => $color === 'accent',
'textarea-info' => $color === 'info',
'textarea-success' => $color === 'success',
'textarea-warning' => $color === 'warning',
'textarea-error' => $color === 'error',
//sizes
'textarea-lg' => $size === 'lg',
'textarea-md' => $size === 'md',
'textarea-sm' => $size === 'sm',
'textarea-xs' => $size === 'xs',
'textarea-lg' => $size === 'lg',
'textarea-md' => $size === 'md',
'textarea-sm' => $size === 'sm',
'textarea-xs' => $size === 'xs',
]))->render();
};
}

public function options(): Js
{
return Js::from([
'autofocus' => $this->autoFocus,
'theme' => $this->quillOptions->theme,
'readOnly' => $this->readonly,
'autofocus' => $this->autoFocus,
'theme' => $this->quillOptions->theme,
'readOnly' => $this->readonly,
'placeholder' => $this->placeholder,
'toolbar' => $this->quillOptions->getToolbar(),
'toolbar' => $this->quillOptions->getToolbar(),
]);
}
}
2 changes: 1 addition & 1 deletion src/Components/Textarea.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function render(): \Closure|View
return view('lazy::textarea', $this->mergeData($data, [
'textarea',
//colors
'textarea-bordered' => ! $color || $color === 'bordered' || $color !== 'no-border',
'textarea-bordered' => ! $color || $color === 'bordered' || $color !== 'no-border',
'textarea-ghost' => $color === 'ghost',
'textarea-primary' => $color === 'primary',
'textarea-secondary' => $color === 'secondary',
Expand Down
2 changes: 1 addition & 1 deletion src/DTO/RichText/QuillOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static function make(): self
return new self;
}

public static function defaults(callable|null $callback = null): ?self
public static function defaults(callable $callback = null): ?self
{
if ($callback === null) {
return static::default();
Expand Down
3 changes: 2 additions & 1 deletion src/LazyUiServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
use Step2dev\LazyUI\Components\Radio;
use Step2dev\LazyUI\Components\Range;
use Step2dev\LazyUI\Components\Rating;
use Step2dev\LazyUI\Components\Richtext;
use Step2dev\LazyUI\Components\Stack;
use Step2dev\LazyUI\Components\Tab;
use Step2dev\LazyUI\Components\Tabs;
Expand All @@ -53,7 +54,6 @@
use Step2dev\LazyUI\Components\Toast;
use Step2dev\LazyUI\Components\Toggle;
use Step2dev\LazyUI\Components\Tooltip;
use Livewire\Livewire;

class LazyUiServiceProvider extends PackageServiceProvider
{
Expand Down Expand Up @@ -109,6 +109,7 @@ public function configurePackage(Package $package): void
MockupCode::class,
MockupPhone::class,
MockupWindow::class,
RichText::class,
Radial::class,
Radio::class,
Range::class,
Expand Down