akaunting/resources/views/partials/form/select_add_new_group.blade.php

95 lines
3.4 KiB
PHP
Raw Normal View History

2019-11-16 10:21:14 +03:00
@stack($name . '_input_start')
2020-02-01 13:32:43 +03:00
2019-11-16 10:21:14 +03:00
<akaunting-select
2020-02-01 13:32:43 +03:00
class="{{ $col }}{{ isset($attributes['required']) ? ' required' : '' }}{{ isset($attributes['disabled']) ? ' disabled' : '' }}"
2020-01-20 18:16:56 +03:00
@if (!empty($attributes['v-error']))
:form-classes="[{'has-error': {{ $attributes['v-error'] }} }]"
@else
2020-03-06 18:04:23 +03:00
:form-classes="[{'has-error': form.errors.has('{{ $name }}') }]"
2020-01-20 18:16:56 +03:00
@endif
2020-02-14 14:56:58 +03:00
icon="{{ $icon }}"
title="{{ $text }}"
placeholder="{{ trans('general.form.select.field', ['field' => $text]) }}"
name="{{ $name }}"
2019-11-16 10:21:14 +03:00
:options="{{ json_encode($values) }}"
2020-02-14 14:56:58 +03:00
@if (isset($attributes['disabledOptions']))
:disabled-options="{{ json_encode($attributes['disabledOptions']) }}"
@endif
@if (isset($attributes['dynamicOptions']))
:dynamic-options="{{ $attributes['dynamicOptions'] }}"
@endif
@if (isset($selected) || old($name))
2020-02-14 14:56:58 +03:00
value="{{ old($name, $selected) }}"
@endif
@if (!empty($attributes['model']))
:model="{{ $attributes['model'] }}"
@endif
2020-01-03 14:04:00 +03:00
:add-new="{{ json_encode([
'status' => true,
2020-01-23 10:55:42 +03:00
'text' => trans('general.add_new'),
2020-01-03 14:04:00 +03:00
'path' => isset($attributes['path']) ? $attributes['path']: false,
'type' => isset($attributes['type']) ? $attributes['type'] : 'modal',
2020-03-09 11:57:06 +03:00
'field' => [
'key' => isset($attributes['field']['key']) ? $attributes['field']['key'] : 'id',
'value' => isset($attributes['field']['value']) ? $attributes['field']['value'] : 'name'
],
2020-03-06 18:04:23 +03:00
'new_text' => trans('modules.new'),
'buttons' => [
'cancel' => [
'text' => trans('general.cancel'),
'class' => 'btn-outline-secondary'
],
'confirm' => [
'text' => trans('general.save'),
'class' => 'btn-success'
]
]
2020-01-03 14:04:00 +03:00
])}}"
2020-01-20 18:16:56 +03:00
@if (!empty($attributes['v-model']))
@interface="form.errors.clear('{{ $attributes['v-model'] }}'); {{ $attributes['v-model'] . ' = $event' }}"
2020-01-20 18:16:56 +03:00
@elseif (!empty($attributes['data-field']))
@interface="form.errors.clear('{{ 'form.' . $attributes['data-field'] . '.' . $name }}'); {{ 'form.' . $attributes['data-field'] . '.' . $name . ' = $event' }}"
2020-01-20 18:16:56 +03:00
@else
2020-03-06 18:04:23 +03:00
@interface="form.{{ $name }} = $event; form.errors.clear('{{ $name }}');"
2020-01-20 18:16:56 +03:00
@endif
2019-11-16 10:21:14 +03:00
@if (!empty($attributes['change']))
@change="{{ $attributes['change'] }}($event)"
@endif
2020-01-20 18:16:56 +03:00
@if (!empty($attributes['visible-change']))
@visible-change="{{ $attributes['visible-change'] }}"
@endif
@if (isset($attributes['readonly']))
2020-03-19 22:39:52 +03:00
:readonly="{{ $attributes['readonly'] }}"
@endif
@if (isset($attributes['disabled']))
2020-03-19 22:39:52 +03:00
:disabled="{{ $attributes['disabled'] }}"
@endif
@if (isset($attributes['show']))
v-if="{{ $attributes['show'] }}"
@endif
@if (isset($attributes['v-error-message']))
2020-01-20 18:16:56 +03:00
:form-error="{{ $attributes['v-error-message'] }}"
@else
:form-error="form.errors.get('{{ $name }}')"
@endif
2020-02-14 14:56:58 +03:00
no-data-text="{{ trans('general.no_data') }}"
no-matching-data-text="{{ trans('general.no_matching_data') }}"
2019-11-16 10:21:14 +03:00
></akaunting-select>
2020-02-01 13:32:43 +03:00
2019-11-16 10:21:14 +03:00
@stack($name . '_input_end')