Skip to content
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
11 changes: 10 additions & 1 deletion app/Abstracts/View/Components/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ abstract class Form extends Component
/** @var string */
public $inputGroupClass = '';

/** @var string */
public $icon = '';

/** @var string */
public $trailing = '';

/** @var array */
public $custom_attributes = [];

Expand All @@ -112,7 +118,7 @@ public function __construct(
$options = [], $option = [], string $optionKey = 'id', string $optionValue = 'name', $fullOptions = [], $checked = null, $checkedKey = null, $selected = null, $selectedKey = null, $rows = '3',
$remote = false, $multiple = false, $addNew = false, $group = false,
bool $searchable = false, bool $disabled = false, bool $readonly = false, bool $required = true, bool $notRequired = false,
string $formGroupClass = '', string $inputGroupClass = '',
string $formGroupClass = '', string $inputGroupClass = '', $icon = '', $trailing = '',
$dynamicAttributes = '',
bool $hideCurrency = false
) {
Expand Down Expand Up @@ -146,6 +152,9 @@ public function __construct(
$this->formGroupClass = $this->getFromGroupClass($formGroupClass);
$this->inputGroupClass = $this->getInputGroupClass($inputGroupClass);

$this->icon = $icon;
$this->trailing = $trailing;

$this->custom_attributes = $this->getCustomAttributes();

$this->setDynamicAttributes($dynamicAttributes);
Expand Down
2 changes: 2 additions & 0 deletions resources/lang/en-GB/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@
'default' => 'Default',
'classic' => 'Classic',
'modern' => 'Modern',
'logo_size_width' => 'Logo Width',
'logo_size_height' => 'Logo Height',
'hide' => [
'item_name' => 'Hide Item Name',
'item_description' => 'Hide Item Description',
Expand Down
6 changes: 6 additions & 0 deletions resources/views/components/form/group/text.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
v-model="{{ !empty($attributes['v-model']) ? $attributes['v-model'] : (!empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.' . $name : 'form.' . $name) }}"
{{ $attributes->merge($custom_attributes) }}
/>

@if (! $attributes->has('trailing') && ! empty($trailing->contents))
{!! $trailing ?? '' !!}
@elseif (! empty($trailing))
<x-form.icon icon="{{ $trailing }}" />
@endif
</div>

@if (! $attributes->has('error') && ! empty($error->contents))
Expand Down
4 changes: 4 additions & 0 deletions resources/views/settings/invoice/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@

<x-form.group.text name="subheading" label="{{ trans('settings.invoice.subheading') }}" value="{{ setting('invoice.subheading') }}" not-required />

<x-form.group.text name="logo_size_width" label="{{ trans('settings.invoice.logo_size_width') }}" value="{{ setting('invoice.logo_size_width') }}" not-required trailing="PX" />

<x-form.group.text name="logo_size_height" label="{{ trans('settings.invoice.logo_size_height') }}" value="{{ setting('invoice.logo_size_height') }}" not-required trailing="PX" />

<x-form.group.textarea name="notes" label="{{ trans_choice('general.notes', 2) }}" :value="setting('invoice.notes')" form-group-class="sm:col-span-3" not-required />

<x-form.group.textarea name="footer" label="{{ trans('general.footer') }}" :value="setting('invoice.footer')" form-group-class="sm:col-span-3" not-required />
Expand Down