187 lines
5.9 KiB
PHP
Raw Normal View History

@stack($name . '_input_start')
2022-06-01 10:15:55 +03:00
@if (! empty($remote))
<akaunting-select-remote
2022-06-01 10:15:55 +03:00
@else
<akaunting-select
@endif
@class([
2022-06-29 12:49:23 +03:00
'relative',
2022-06-01 10:15:55 +03:00
$formGroupClass,
'required' => $required,
'readonly' => $readonly,
'disabled' => $disabled,
])
id="form-select-{{ $name }}"
2022-06-01 10:15:55 +03:00
@if (isset($attributes['v-show']))
v-if="{{ $attributes['v-show'] }}"
@endif
@if (! empty($attributes['v-error']))
:form-classes="[{'has-error': {{ $attributes['v-error'] }} }]"
@else
:form-classes="[{'has-error': form.errors.get('{{ $name }}') }]"
@endif
2022-06-01 10:15:55 +03:00
@if (! $attributes->has('icon') && ! empty($icon->contents))
{!! $icon ?? '' !!}
@elseif (! empty($icon))
<x-form.icon icon="{{ $icon }}" />
@endif
2022-06-03 09:12:58 +03:00
title="{!! $label !!}"
2022-06-01 10:15:55 +03:00
2022-06-10 18:59:17 +03:00
placeholder="{{ $placeholder }}"
2022-06-01 10:15:55 +03:00
name="{{ $name }}"
2022-06-01 10:15:55 +03:00
:options="{{ json_encode($options) }}"
@if (isset($attributes['disabledOptions']))
:disabled-options="{{ json_encode($attributes['disabledOptions']) }}"
@endif
@if (isset($attributes['dynamicOptions']))
:dynamic-options="{{ $attributes['dynamicOptions'] }}"
@endif
@if (! empty($attributes['searchable']))
searchable
@elseif (! empty($searchable))
searchable
@endif
@if (isset($attributes['fullOptions']) || isset($attributes['full-options']))
:full-options="{{ json_encode(! empty($attributes['fullOptions']) ? $attributes['fullOptions'] : $attributes['full-options']) }}"
@else
:full-options="{{ json_encode($fullOptions) }}"
@endif
@if (isset($attributes['searchText']) || isset($attributes['search-text']))
search-text="{{ ! empty($attributes['searchText']) ? $attributes['searchText'] : $attributes['search-text'] }}"
@else
search-text="{{ $searchText }}"
@endif
2022-06-01 10:15:55 +03:00
@if (empty($multiple))
@if (isset($selected) || old($name))
value="{{ old($name, $selected) }}"
@endif
@else
@if (isset($selected) || old($name))
:value="{{ json_encode(old($name, $selected)) }}"
@endif
multiple
@if (! empty($attributes['collapse']))
collapse
@endif
@endif
2022-06-01 10:15:55 +03:00
@if (! empty($attributes['model']))
:model="{{ $attributes['model'] }}"
@endif
2022-06-01 10:15:55 +03:00
@if (! empty($addNew))
:add-new="{{ json_encode([
'status' => true,
'text' => isset($attributes['add-new-text']) ? $attributes['add-new-text'] : trans('general.title.new', ['type' => $label ?? '']),
'path' => isset($attributes['path']) ? $attributes['path']: false,
'type' => isset($attributes['type']) ? $attributes['type'] : 'modal',
'field' => [
'key' => isset($attributes['field']['key']) ? $attributes['field']['key'] : 'id',
'value' => isset($attributes['field']['value']) ? $attributes['field']['value'] : 'name'
],
'new_text' => trans('modules.new'),
'buttons' => [
'cancel' => [
'text' => trans('general.cancel'),
'class' => 'btn-outline-secondary'
],
'confirm' => [
'text' => trans('general.save'),
2022-06-01 10:15:55 +03:00
'class' => 'disabled:bg-green-100'
]
]
])}}"
2022-06-01 10:15:55 +03:00
@endif
2022-06-01 10:15:55 +03:00
@if (! empty($group))
group
@endif
2022-06-01 10:15:55 +03:00
@if (! empty($attributes['v-model']))
@interface="form.errors.clear('{{ $attributes['v-model'] }}'); {{ $attributes['v-model'] . ' = $event' }}"
2022-06-01 10:15:55 +03:00
@elseif (! empty($attributes['data-field']))
@interface="form.errors.clear('{{ 'form.' . $attributes['data-field'] . '.' . $name }}'); {{ 'form.' . $attributes['data-field'] . '.' . $name . ' = $event' }}"
@else
2022-06-01 10:15:55 +03:00
@interface="form.errors.clear('{{ $name }}'); form.{{ $name }} = $event;"
@endif
2022-06-01 10:15:55 +03:00
@if (! empty($attributes['change']))
@change="{{ $attributes['change'] }}($event)"
@endif
@if (! empty($attributes['focus']))
@focus="{{ $attributes['focus'] }}"
@endif
2022-06-01 10:15:55 +03:00
@if (! empty($attributes['visible-change']))
@visible-change="{{ $attributes['visible-change'] }}"
@endif
2022-06-01 10:15:55 +03:00
@if (isset($attributes['readonly']))
:readonly="{{ $attributes['readonly'] }}"
@endif
2021-08-19 10:19:35 +03:00
@if (isset($attributes['clearable']))
:clearable="{{ $attributes['clearable'] }}"
@else
clearable
@endif
@if (isset($attributes['no-arrow']))
:no-arrow="{{ $attributes['no-arrow'] }}"
@endif
2022-06-16 16:00:38 +03:00
@if (!$required)
:not-required={{ $required ? 'false' : 'true' }}
@endif
2022-06-01 10:15:55 +03:00
@if (isset($attributes['v-disabled']))
:disabled="{{ $attributes['v-disabled'] }}"
@endif
@if (isset($attributes['v-error-message']))
:form-error="{{ $attributes['v-error-message'] }}"
@else
:form-error="form.errors.get('{{ $name }}')"
@endif
2022-06-01 10:15:55 +03:00
@if (! empty($remote))
remote-action="{{ $attributes['remote_action'] }}"
2022-06-01 10:15:55 +03:00
@if (! empty($attributes['currecny_code']))
currency-code="{{ $attributes['currecny_code'] }}"
@endif
2022-06-01 10:15:55 +03:00
@endif
loading-text="{{ trans('general.loading') }}"
no-data-text="{{ trans('general.no_data') }}"
no-matching-data-text="{{ trans('general.no_matching_data') }}"
2022-06-01 10:15:55 +03:00
@if (isset($attributes['sort-options']))
:sort-options="{{ $attributes['sort-options'] }}"
@endif
>
@if (! empty($remote))
</akaunting-select-remote>
@else
</akaunting-select>
@endif
@stack($name . '_input_end')