akaunting 3.0 (the last dance)

This commit is contained in:
Burak Civan
2022-06-01 10:15:55 +03:00
parent cead09f6d4
commit d9c0764572
3812 changed files with 126831 additions and 102949 deletions

View File

@ -0,0 +1,24 @@
@if (! $attributes->has('withoutAddNew'))
<x-form.group.select
add-new
:path="$path"
name="{{ $name }}"
label="{{ trans_choice('general.accounts', 1) }}"
:options="$accounts"
:selected="$selected"
change="onChangeAccount"
form-group-class="{{ $formGroupClass }}"
{{ $attributes }}
/>
@else
<x-form.group.select
name="{{ $name }}"
label="{{ trans_choice('general.accounts', 1) }}"
:options="$accounts"
:selected="$selected"
change="onChangeAccount"
form-group-class="{{ $formGroupClass }}"
{{ $attributes }}
/>
@endif

View File

@ -0,0 +1,10 @@
<x-form.group.file
name="attachment"
label="{{ trans('general.attachment') }}"
singleWidthClasses
not-required
dropzone-class="w-100"
multiple="multiple"
:options="['acceptedFiles' => $file_types]"
form-group-class="sm:col-span-6"
/>

View File

@ -0,0 +1,81 @@
@if ((! $attributes->has('withoutRemote')) && (! $attributes->has('withoutAddNew')))
<x-form.group.select
remote
remote_action="{{ $remoteAction }}"
add-new
path="{{ $path }}"
name="{{ $name }}"
label="{{ trans_choice('general.categories', 1) }}"
:options="$categories"
:selected="$selected"
sort-options="false"
:multiple="$multiple"
:group="$group"
form-group-class="{{ $formGroupClass }}"
:required="$required"
:readonly="$readonly"
:disabled="$disabled"
{{ $attributes }}
/>
@elseif (($attributes->has('withoutRemote')) && (! $attributes->has('withoutAddNew')))
<x-form.group.select
add-new
path="{{ $path }}"
name="{{ $name }}"
label="{{ trans_choice('general.categories', 1) }}"
:options="$categories"
:selected="$selected"
sort-options="false"
:multiple="$multiple"
:group="$group"
form-group-class="{{ $formGroupClass }}"
:required="$required"
:readonly="$readonly"
:disabled="$disabled"
{{ $attributes }}
/>
@elseif ((! $attributes->has('withoutRemote')) && ($attributes->has('withoutAddNew')))
<x-form.group.select
remote
remote_action="{{ $remoteAction }}"
name="{{ $name }}"
label="{{ trans_choice('general.categories', 1) }}"
:options="$categories"
:selected="$selected"
sort-options="false"
:multiple="$multiple"
:group="$group"
form-group-class="{{ $formGroupClass }}"
:required="$required"
:readonly="$readonly"
:disabled="$disabled"
{{ $attributes }}
/>
@else
<x-form.group.select
name="{{ $name }}"
label="{{ trans_choice('general.categories', 1) }}"
:options="$categories"
:selected="$selected"
sort-options="false"
:multiple="$multiple"
:group="$group"
form-group-class="{{ $formGroupClass }}"
:required="$required"
:readonly="$readonly"
:disabled="$disabled"
{{ $attributes }}
/>
@endif

View File

@ -0,0 +1,72 @@
@stack($name . '_input_start')
<div
@class([
'form-group relative',
$formGroupClass,
'required' => $required,
'readonly' => $readonly,
'disabled' => $disabled,
])
@if (isset($attributes['v-show']))
v-if="{{ $attributes['v-show'] }}"
@endif
@if (isset($attributes['v-disabled']))
:class="[
{'disabled' : {{ $attributes['v-disabled'] }}},
{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }}}
]"
@else
:class="[
{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }}}
]"
@endif
>
@if (! $attributes->has('label') && ! empty($label->contents))
{!! $label ?? '' !!}
@elseif (! empty($label))
<x-form.label for="{{ $name }}" class="form-control-label">{!! $label !!}</x-form.label>
@endif
<div @class([
'flex items-center justify-center grid sm:grid-cols-6',
$inputGroupClass,
])
>
@php
$option_id = $attributes[':id'];
@endphp
@foreach($options as $option)
@php
if (! empty($attributes[':id'])) {
$attributes[':id'] = str_replace(':item_id', $option->$optionKey, $option_id);
}
@endphp
<div class="{{ ! empty($attributes['checkbox-class']) ? $attributes['checkbox-class'] : 'sm:col-span-3' }}">
<div class="custom-control custom-checkbox">
<x-form.input.checkbox
name="{{ $name }}"
label="{{ $option->$optionValue }}"
id="{{ 'checkbox-' . $name . '-' . $option->$optionKey }}"
:checked="(is_array($checked) && count($checked)) ? (in_array($option->$optionKey, $checked) ? true : 'n/a') : $checked"
value="{{ $option->$optionKey }}"
data-type="{{ (is_array($checked)) ? 'multiple' : 'single' }}"
v-model="{{ !empty($attributes['v-model']) ? $attributes['v-model'] : (!empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.' . $name : 'form.' . $name) }}"
:option="$option"
optionKey="{{ $optionKey }}"
optionValue="{{ $optionValue }}"
{{ $attributes->merge($custom_attributes) }}
/>
</div>
</div>
@endforeach
</div>
@if (! $attributes->has('error') && ! empty($error->contents))
{!! $error ?? '' !!}
@else
<x-form.error name="{{ $name }}" {{ $attributes }} />
@endif
</div>
@stack($name . '_input_end')

View File

@ -0,0 +1,75 @@
@stack($name . '_input_start')
<akaunting-color
@class([
'form-group relative',
$formGroupClass,
'required' => $required,
'readonly' => $readonly,
'disabled' => $disabled,
])
id="form-select-{{ $name }}"
@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
@if (! $attributes->has('icon') && ! empty($icon->contents))
{!! $icon ?? '' !!}
@elseif (! empty($icon))
<x-form.icon icon="{{ $icon }}" />
@endif
title="{{ $label }}"
@if (isset($attributes['placeholder']))
placeholder="{{ $attributes['placeholder'] }}"
@else
placeholder="{{ trans('general.form.select.field', ['field' => $label]) }}"
@endif
name="{{ $name }}"
value="{{ $value }}"
@if (! empty($attributes['model']))
:model="{{ $attributes['model'] }}"
@endif
@if (! empty($attributes['small']))
small="{{ $attributes['small'] }}"
@endif
@if (! empty($attributes['v-model']))
@interface="form.errors.clear('{{ $attributes['v-model'] }}'); {{ $attributes['v-model'] . ' = $event' }}"
@elseif (! empty($attributes['data-field']))
@interface="form.errors.clear('{{ 'form.' . $attributes['data-field'] . '.' . $name }}'); {{ 'form.' . $attributes['data-field'] . '.' . $name . ' = $event' }}"
@else
@interface="form.errors.clear('{{ $name }}'); form.{{ $name }} = $event;"
@endif
@if (! empty($attributes['change']))
@change="{{ $attributes['change'] }}($event)"
@endif
@if (isset($attributes['readonly']))
:readonly="{{ $attributes['readonly'] }}"
@endif
@if (isset($attributes['disabled']))
:disabled="{{ $attributes['disabled'] }}"
@endif
@if (isset($attributes['v-error-message']))
:form-error="{{ $attributes['v-error-message'] }}"
@else
:form-error="form.errors.get('{{ $name }}')"
@endif
></akaunting-color>
@stack($name . '_input_end')

View File

@ -0,0 +1,81 @@
@if ((! $attributes->has('withoutRemote')) && (! $attributes->has('withoutAddNew')))
<x-form.group.select
remote
remote_action="{{ $remoteAction }}"
add-new
path="{{ $path }}"
add-new
name="{{ $name }}"
label="{{ $label }}"
:options="$contacts"
:selected="$selected"
:multiple="$multiple"
:group="$group"
form-group-class="{{ $formGroupClass }}"
:required="$required"
:readonly="$readonly"
:disabled="$disabled"
{{ $attributes }}
/>
@elseif (($attributes->has('withoutRemote')) && (! $attributes->has('withoutAddNew')))
<x-form.group.select
add-new
path="{{ $path }}"
add-new
name="{{ $name }}"
label="{{ $label }}"
:options="$contacts"
:selected="$selected"
:multiple="$multiple"
:group="$group"
form-group-class="{{ $formGroupClass }}"
:required="$required"
:readonly="$readonly"
:disabled="$disabled"
{{ $attributes }}
/>
@elseif ((!$attributes->has('withoutRemote')) && ($attributes->has('withoutAddNew')))
<x-form.group.select
remote
remote_action="{{ $remoteAction }}"
add-new
name="{{ $name }}"
label="{{ $label }}"
:options="$contacts"
:selected="$selected"
:multiple="$multiple"
:group="$group"
form-group-class="{{ $formGroupClass }}"
:required="$required"
:readonly="$readonly"
:disabled="$disabled"
{{ $attributes }}
/>
@else
<x-form.group.select
add-new
name="{{ $name }}"
label="{{ $label }}"
:options="$contacts"
:selected="$selected"
:multiple="$multiple"
:group="$group"
form-group-class="{{ $formGroupClass }}"
:required="$required"
:readonly="$readonly"
:disabled="$disabled"
{{ $attributes }}
/>
@endif

View File

@ -0,0 +1,8 @@
<x-form.group.select
name="country"
label="{{ trans_choice('general.countries', 1) }}"
:options="trans('countries')"
:selected="setting('company.country')"
not-required
model="form.country"
/>

View File

@ -0,0 +1,39 @@
@if (! $attributes->has('withoutAddNew'))
<x-form.group.select
add-new
:path="$path"
:field="$field"
name="{{ $name }}"
label="{{ trans_choice('general.currencies', 1) }}"
:options="$currencies"
:selected="$selected"
change="onChangeCurrency"
:multiple="$multiple"
:group="$group"
form-group-class="{{ $formGroupClass }}"
:required="$required"
:readonly="$readonly"
:disabled="$disabled"
{{ $attributes }}
/>
@else
<x-form.group.select
name="{{ $name }}"
label="{{ trans_choice('general.currencies', 1) }}"
:options="$currencies"
:selected="$selected"
change="onChangeCurrency"
:multiple="$multiple"
:group="$group"
form-group-class="{{ $formGroupClass }}"
:required="$required"
:readonly="$readonly"
:disabled="$disabled"
{{ $attributes }}
/>
@endif

View File

@ -0,0 +1,4 @@
<x-form.group.contact
type="customer"
{{ $attributes }}
/>

View File

@ -0,0 +1,107 @@
@stack($name . '_input_start')
<akaunting-date
@class([
'form-group relative',
$formGroupClass,
'required' => $required,
'readonly' => $readonly,
'disabled' => $disabled,
])
@if (isset($attributes['v-show']))
v-if="{{ $attributes['v-show'] }}"
@endif
@if ($required)
:required="{{ $required ? 'true' : 'false' }}"
@endif
@if ($readonly)
:readonly="{{ $readonly }}"
@endif
@if ($disabled)
:disabled="{{ $disabled }}"
@endif
@if (!empty($attributes['v-error']))
:form-classes="[{'has-error': {{ $attributes['v-error'] }} }]"
@else
:form-classes="[{'has-error': form.errors.get('{{ $name }}') }]"
@endif
@if (! empty($group_class))
group_class="{{ $group_class }}"
@endif
@if (! empty($icon))
icon="{{ $icon }}"
@endif
title="{{ $label }}"
placeholder="{{ $placeholder }}"
name="{{ $name }}"
@if (isset($value) || old($name))
value="{{ old($name, $value) }}"
@endif
@if (!empty($attributes['model']))
:model="{{ $attributes['model'] }}"
@endif
:date-config="{
wrap: true, // set wrap to true only when using 'input-group'
allowInput: false,
@if (!empty($attributes['show-date-format']))
altInput: true,
altFormat: '{{ $attributes['show-date-format'] }}',
@endif
@if (!empty($attributes['date-format']))
dateFormat: '{{ $attributes['date-format'] }}',
@endif
@if (!empty($attributes['min-date']))
minDate: {{ $attributes['min-date'] }},
@endif
@if (!empty($attributes['max-date']))
maxDate: {{ $attributes['max-date'] }},
@endif
}"
locale="{{ language()->getShortCode() }}"
@if (isset($attributes['period']))
period="{{ $attributes['period'] }}"
@endif
@if (!empty($attributes['v-model']))
@interface="form.errors.clear('{{ $attributes['v-model'] }}'); {{ $attributes['v-model'] . ' = $event' }}"
@elseif (!empty($attributes['data-field']))
@interface="form.errors.clear('{{ 'form.' . $attributes['data-field'] . '.' . $name }}'); {{ 'form.' . $attributes['data-field'] . '.' . $name . ' = $event' }}"
@else
@interface="form.errors.clear('{{ $name }}'); form.{{ $name }} = $event"
@endif
@if (!empty($attributes['hidden_year']))
hidden-year
@endif
@if (!empty($attributes['min-date-dynamic']))
:data-value-min="{{ $attributes['min-date-dynamic'] }}"
@endif
@if (!empty($attributes['change']))
@change="{{ $attributes['change'] }}"
@endif
@if (isset($attributes['v-error-message']))
:form-error="{{ $attributes['v-error-message'] }}"
@else
:form-error="form.errors.get('{{ $name }}')"
@endif
></akaunting-date>
@stack($name . '_input_end')

View File

@ -0,0 +1,91 @@
@stack($name . '_input_start')
<akaunting-date
@class([
'form-group relative',
$formGroupClass,
'required' => $required,
'readonly' => $readonly,
'disabled' => $disabled,
])
@if (isset($attributes['v-show']))
v-if="{{ $attributes['v-show'] }}"
@endif
@if ($readonly)
:readonly="{{ $readonly }}"
@endif
@if ($disabled)
:disabled="{{ $disabled }}"
@endif
@if (!empty($attributes['v-error']))
:form-classes="[{'has-error': {{ $attributes['v-error'] }} }]"
@else
:form-classes="[{'has-error': form.errors.get('{{ $name }}') }]"
@endif
@if (! empty($icon))
icon="{{ $icon }}"
@endif
title="{{ $label }}"
placeholder="{{ $placeholder }}"
name="{{ $name }}"
@if (isset($value) || old($name))
value="{{ old($name, $value) }}"
@endif
@if (!empty($attributes['model']))
:model="{{ $attributes['model'] }}"
@endif
:date-config="{
allowInput: true,
@if (!empty($attributes['show-date-format']))
altInput: true,
altFormat: '{{ $attributes['show-date-format'] }}',
@endif
@if (!empty($attributes['date-format']))
dateFormat: '{{ $attributes['date-format'] }}',
@endif
wrap: true,
enableTime: true,
@if (!empty($attributes['seconds']))
enableSeconds: true,
@endif
@if (!empty($attributes['min-date']))
minDate: {{ $attributes['min-date'] }},
@endif
@if (!empty($attributes['max-date']))
maxDate: {{ $attributes['max-date'] }},
@endif
}"
locale="{{ language()->getShortCode() }}"
@if (!empty($attributes['v-model']))
@interface="form.errors.clear('{{ $attributes['v-model'] }}'); {{ $attributes['v-model'] . ' = $event' }}"
@elseif (!empty($attributes['data-field']))
@interface="form.errors.clear('{{ 'form.' . $attributes['data-field'] . '.' . $name }}'); {{ 'form.' . $attributes['data-field'] . '.' . $name . ' = $event' }}"
@else
@interface="form.errors.clear('{{ $name }}'); form.{{ $name }} = $event"
@endif
@if (!empty($attributes['change']))
@change="{{ $attributes['change'] }}"
@endif
@if (isset($attributes['v-error-message']))
:form-error="{{ $attributes['v-error-message'] }}"
@else
:form-error="form.errors.get('{{ $name }}')"
@endif
></akaunting-date>
@stack($name . '_input_end')

View File

@ -0,0 +1,47 @@
@stack($name . '_input_start')
<div
@class([
'form-group relative',
$formGroupClass,
'required' => $required,
'readonly' => $readonly,
'disabled' => $disabled,
])
@if (isset($attributes['v-show']))
v-if="{{ $attributes['v-show'] }}"
@endif
@if (isset($attributes['v-disabled']) || isset($attributes['v-bind:disabled']))
:class="[
{'disabled' : {{ (isset($attributes['v-disabled'])) ? $attributes['v-disabled'] : $attributes['v-bind:disabled'] }}},
{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }}}
]"
@else
:class="[
{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }}}
]"
@endif
>
@if (! $attributes->has('label') && ! empty($label->contents))
{!! $label ?? '' !!}
@elseif (! empty($label))
<x-form.label for="{{ $name }}" class="form-control-label">{!! $label !!}</x-form.label>
@endif
<x-form.input.editor
name="{{ $name }}"
id="{{ $id }}"
value="{{ $value }}"
placeholder="{{ $placeholder }}"
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('error') && ! empty($error->contents))
{!! $error ?? '' !!}
@else
<x-form.error name="{{ $name }}" {{ $attributes }} />
@endif
</div>
@stack($name . '_input_end')

View File

@ -0,0 +1,60 @@
@stack($name . '_input_start')
<div
@class([
'form-group relative',
$formGroupClass,
'required' => $required,
'readonly' => $readonly,
'disabled' => $disabled,
])
@if (isset($attributes['v-show']))
v-if="{{ $attributes['v-show'] }}"
@endif
@if (isset($attributes['v-disabled']))
:class="[
{'disabled' : {{ $attributes['v-disabled'] }}},
{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }}}
]"
@else
:class="[
{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }}}
]"
@endif
>
@if (! $attributes->has('label') && ! empty($label->contents))
{!! $label ?? '' !!}
@elseif (! empty($label))
<x-form.label for="{{ $name }}" class="form-control-label">{!! $label !!}</x-form.label>
@endif
<div @class([
'input-group input-group-merge',
$inputGroupClass,
])
>
@if (! $attributes->has('icon') && ! empty($icon->contents))
{!! $icon ?? '' !!}
@elseif (! empty($icon))
<x-form.icon icon="{{ $icon }}" />
@endif
<x-form.input.email
name="{{ $name }}"
id="{{ $id }}"
class="form-element"
value="{{ $value }}"
placeholder="{{ $placeholder }}"
v-model="{{ !empty($attributes['v-model']) ? $attributes['v-model'] : (!empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.' . $name : 'form.' . $name) }}"
{{ $attributes->merge($custom_attributes) }}
/>
</div>
@if (! $attributes->has('error') && ! empty($error->contents))
{!! $error ?? '' !!}
@else
<x-form.error name="{{ $name }}" {{ $attributes }} />
@endif
</div>
@stack($name . '_input_end')

View File

@ -0,0 +1,60 @@
@stack($name . '_input_start')
<div
@class([
'form-group relative',
$formGroupClass,
'required' => $required,
'readonly' => $readonly,
'disabled' => $disabled,
])
@if (isset($attributes['v-show']))
v-if="{{ $attributes['v-show'] }}"
@endif
@if (isset($attributes['v-disabled']) || isset($attributes['v-bind:disabled']))
:class="[
{'disabled' : {{ (isset($attributes['v-disabled'])) ? $attributes['v-disabled'] : $attributes['v-bind:disabled'] }}},
{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }}}
]"
@else
:class="[
{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }}}
]"
@endif
>
@if (! $attributes->has('label') && ! empty($label->contents))
{!! $label ?? '' !!}
@elseif (! empty($label))
<x-form.label for="{{ $name }}" class="form-control-label">{!! $label !!}</x-form.label>
@endif
<div @class([
'input-group input-group-merge',
$inputGroupClass,
])
>
@if (! $attributes->has('icon') && ! empty($icon->contents))
{!! $icon ?? '' !!}
@elseif (! empty($icon))
<x-form.icon icon="{{ $icon }}" />
@endif
<x-form.input.file
name="{{ $name }}"
id="{{ $id }}"
:value="$value"
v-model="{{ !empty($attributes['v-model']) ? $attributes['v-model'] : (!empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.' . $name : 'form.' . $name) }}"
:multiple="$multiple"
:options="$options"
{{ $attributes->merge($custom_attributes) }}
/>
</div>
@if (! $attributes->has('error') && ! empty($error->contents))
{!! $error ?? '' !!}
@else
<x-form.error name="{{ $name }}" {{ $attributes }} />
@endif
</div>
@stack($name . '_input_end')

View File

@ -0,0 +1,173 @@
@stack($name . '_input_start')
<div
@class([
'grid grid-cols-6 gap-8',
$formGroupClass,
'required' => $required,
'readonly' => $readonly,
'disabled' => $disabled,
])
@if (isset($attributes['v-show']))
v-if="{{ $attributes['v-show'] }}"
@endif
:class="[
{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }} }
]"
>
<akaunting-select
@class([
'form-group relative',
$formGroupClass,
'required' => $required,
'readonly' => $readonly,
'disabled' => $disabled,
])
id="form-invoice-{{ $name }}"
@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.has('{{ $name }}') }]"
@endif
@if (! $attributes->has('icon') && ! empty($icon->contents))
{!! $icon ?? '' !!}
@elseif (! empty($icon))
<x-form.icon icon="{{ $icon }}" />
@endif
title="{{ $label }}"
@if (isset($attributes['placeholder']))
placeholder="{{ $attributes['placeholder'] }}"
@else
placeholder="{{ trans('general.form.select.field', ['field' => $label]) }}"
@endif
name="{{ $name }}"
: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($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
@if (! empty($attributes['model']))
:model="{{ $attributes['model'] }}"
@endif
@if (! empty($addNew))
:add-new="{{ json_encode([
'status' => true,
'text' => trans('general.add_new'),
'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'),
'class' => 'disabled:bg-green-100'
]
]
])}}"
@endif
@if (! empty($group))
group
@endif
@if (! empty($attributes['v-model']))
@interface="form.errors.clear('{{ $attributes['v-model'] }}'); {{ $attributes['v-model'] . ' = $event' }}"
@elseif (! empty($attributes['data-field']))
@interface="form.errors.clear('{{ 'form.' . $attributes['data-field'] . '.' . $name }}'); {{ 'form.' . $attributes['data-field'] . '.' . $name . ' = $event' }}"
@else
@interface="form.errors.clear('{{ $name }}'); form.{{ $name }} = $event;"
@endif
@if (! empty($attributes['change']))
@change="{{ $attributes['change'] }}($event)"
@endif
@if (! empty($attributes['visible-change']))
@visible-change="{{ $attributes['visible-change'] }}"
@endif
@if (isset($attributes['readonly']))
:readonly="{{ $attributes['readonly'] }}"
@endif
@if (isset($attributes['clearable']))
:clearable="{{ $attributes['clearable'] }}"
@else
clearable
@endif
@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
@if (! empty($remote))
remote-action="{{ $attributes['remote_action'] }}"
@if (! empty($attributes['currecny_code']))
currency-code="{{ $attributes['currecny_code'] }}"
@endif
@endif
loading-text="{{ trans('general.loading') }}"
no-data-text="{{ trans('general.no_data') }}"
no-matching-data-text="{{ trans('general.no_matching_data') }}"
:sort-options="false"
></akaunting-select>
@foreach ($options as $option)
@if ($option->id == 'custom')
<div class="col-span-3 mt-5">
<x-form.group.text name="{{ $attributes['input-name'] }}" value="{{ $attributes['input-value'] }}" v-show="{{ $attributes['input-name'] }}" />
</div>
@endif
@endforeach
</div>
@stack($name . '_input_end')

View File

@ -0,0 +1,6 @@
<x-form.group.select
name="locale"
label="{{ trans_choice('general.languages', 1) }}"
:options="language()->allowed()"
:selected="$selected"
/>

View File

@ -0,0 +1,88 @@
@stack($name . '_input_start')
<akaunting-money
@if (! empty($attributes['v-error']))
:form-classes="[{'has-error': {{ $attributes['v-error'] }} }]"
@else
:form-classes="[{'has-error': form.errors.has('{{ $name }}') }]"
@endif
col="{{ $formGroupClass }}"
@if (! empty($attributes['money-class']))
money-class="{{ $attributes['money-class'] }}"
@endif
@if ($required)
:required="{{ ($required) ? 'true' : 'false' }}"
@endif
@if ($readonly)
:readonly="{{ $readonly }}"
@endif
@if (isset($attributes['v-disabled']))
:disabled="{{ $attributes['v-disabled'] }}"
@endif
@if ($disabled)
:disabled="{{ $disabled }}"
@endif
@if (isset($attributes['v-show']))
v-if="{{ $attributes['v-show'] }}"
@endif
@if (isset($attributes['masked']))
:masked="{{ ($attributes['masked']) ? 'true' : 'false' }}"
@endif
{{-- :error="{{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }}" --}}
name="{{ $name }}"
title="{{ $label }}"
:group_class="'{{ $formGroupClass }}'"
@if (! empty($icon))
icon="{{ $icon }}"
@endif
:currency="{{ json_encode($attributes['currency']) }}"
:value="{{ $value }}"
@if (!empty($attributes['dynamic-currency']))
:dynamic-currency="{{ $attributes['dynamic-currency'] }}"
@else
:dynamic-currency="currency"
@endif
@if (!empty($attributes['v-model']))
v-model="{{ $attributes['v-model'] }}"
@endif
@if (!empty($attributes['change']))
@change="{{ $attributes['change'] }}($event)"
@endif
@if (!empty($attributes['input']))
@input="{{ $attributes['input'] }}"
@endif
@if (!empty($attributes['v-model']))
@interface="form.errors.clear('{{ $attributes['v-model'] }}'); {{ $attributes['v-model'] . ' = $event' }}"
@elseif (!empty($attributes['data-field']))
@interface="form.errors.clear('{{ 'form.' . $attributes['data-field'] . '.' . $name }}'); {{ 'form.' . $attributes['data-field'] . '.' . $name . ' = $event' }}"
@else
@interface="form.errors.clear('{{ $name }}'); form.{{ $name }} = $event"
@endif
@if (isset($attributes['v-error-message']))
:error="{{ $attributes['v-error-message'] }}"
@else
:error="form.errors.get('{{ $name }}')"
@endif
@if (isset($attributes['row-input']))
:row-input="{{ $attributes['row-input'] }}"
@endif
></akaunting-money>
@stack($name . '_input_end')

View File

@ -0,0 +1,60 @@
@stack($name . '_input_start')
<div
@class([
'form-group relative',
$formGroupClass,
'required' => $required,
'readonly' => $readonly,
'disabled' => $disabled,
])
@if (isset($attributes['v-show']))
v-if="{{ $attributes['v-show'] }}"
@endif
@if (isset($attributes['v-disabled']))
:class="[
{'disabled' : {{ $attributes['v-disabled'] }}},
{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }}}
]"
@else
:class="[
{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }}}
]"
@endif
>
@if (! $attributes->has('label') && ! empty($label->contents))
{!! $label ?? '' !!}
@elseif (! empty($label))
<x-form.label for="{{ $name }}" class="form-control-label">{!! $label !!}</x-form.label>
@endif
<div @class([
'input-group input-group-merge',
$inputGroupClass,
])
>
@if (! $attributes->has('icon') && ! empty($icon->contents))
{!! $icon ?? '' !!}
@elseif (! empty($icon))
<x-form.icon icon="{{ $icon }}" />
@endif
<x-form.input.number
name="{{ $name }}"
id="{{ $id }}"
class="form-element"
value="{{ $value }}"
placeholder="{{ $placeholder }}"
v-model="{{ !empty($attributes['v-model']) ? $attributes['v-model'] : (!empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.' . $name : 'form.' . $name) }}"
{{ $attributes->merge($custom_attributes) }}
/>
</div>
@if (! $attributes->has('error') && ! empty($error->contents))
{!! $error ?? '' !!}
@else
<x-form.error name="{{ $name }}" {{ $attributes }} />
@endif
</div>
@stack($name . '_input_end')

View File

@ -0,0 +1,60 @@
@stack($name . '_input_start')
<div
@class([
'form-group relative',
$formGroupClass,
'required' => $required,
'readonly' => $readonly,
'disabled' => $disabled,
])
@if (isset($attributes['v-show']))
v-if="{{ $attributes['v-show'] }}"
@endif
@if (isset($attributes['v-disabled']))
:class="[
{'disabled' : {{ $attributes['v-disabled'] }}},
{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }}}
]"
@else
:class="[
{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }}}
]"
@endif
>
@if (! $attributes->has('label') && ! empty($label->contents))
{!! $label ?? '' !!}
@elseif (! empty($label))
<x-form.label for="{{ $name }}" class="form-control-label">{!! $label !!}</x-form.label>
@endif
<div @class([
'input-group input-group-merge',
$inputGroupClass,
])
>
@if (! $attributes->has('icon') && ! empty($icon->contents))
{!! $icon ?? '' !!}
@elseif (! empty($icon))
<x-form.icon icon="{{ $icon }}" />
@endif
<x-form.input.password
name="{{ $name }}"
id="{{ $id }}"
class="form-element"
value="{{ $value }}"
placeholder="{{ $placeholder }}"
v-model="{{ !empty($attributes['v-model']) ? $attributes['v-model'] : (!empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.' . $name : 'form.' . $name) }}"
{{ $attributes->merge($custom_attributes) }}
/>
</div>
@if (! $attributes->has('error') && ! empty($error->contents))
{!! $error ?? '' !!}
@else
<x-form.error name="{{ $name }}" {{ $attributes }} />
@endif
</div>
@stack($name . '_input_end')

View File

@ -0,0 +1,12 @@
<x-form.group.select
name="payment_method"
label="{{ trans_choice('general.payment_methods', 1) }}"
:options="$payment_methods"
:selected="$selected"
form-group-class="{{ $formGroupClass }}"
:required="$required"
:readonly="$readonly"
{{ $attributes }}
/>

View File

@ -0,0 +1,61 @@
@stack($name . '_input_start')
<div
@class([
'form-group relative',
$formGroupClass,
'required' => $required,
'readonly' => $readonly,
'disabled' => $disabled,
])
@if (isset($attributes['v-show']))
v-if="{{ $attributes['v-show'] }}"
@endif
@if (isset($attributes['v-disabled']) || isset($attributes['v-bind:disabled']))
:class="[
{'disabled' : {{ (isset($attributes['v-disabled'])) ? $attributes['v-disabled'] : $attributes['v-bind:disabled'] }}},
{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }}}
]"
@else
:class="[
{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }}}
]"
@endif
>
@if (! $attributes->has('label') && ! empty($label->contents))
{!! $label ?? '' !!}
@elseif (! empty($label))
<x-form.label for="{{ $name }}" class="form-control-label">{!! $label !!}</x-form.label>
@endif
<div @class([
'mt-2',
'grid grid-cols-2 gap-3 sm:grid-cols-4',
$inputGroupClass,
])
>
@foreach($options as $option)
<x-form.input.radio
name="{{ $name }}"
id="{{ $id }}"
class="sr-only"
value="{{ $value }}"
:checked="($checked && ($option->$optionKey == $checked)) ? true : false"
:option="$option"
optionKey="{{ $optionKey }}"
optionValue="{{ $optionValue }}"
{{ $attributes->merge($custom_attributes) }}
/>
@endforeach
<input type="hidden" name="{{ $name }}" value="{{ $checked }}" />
</div>
@if (! $attributes->has('error') && ! empty($error->contents))
{!! $error ?? '' !!}
@else
<x-form.error name="{{ $name }}" {{ $attributes }} />
@endif
</div>
@stack($name . '_input_end')

View File

@ -0,0 +1,67 @@
<akaunting-recurring
start-text="{{ trans('recurring.limit_date', ['type' => \Str::replace('-recurring', '', $type)]) }}"
:date-range-text="{{ json_encode(trans('general.date_range')) }}"
middleText="{{ trans('recurring.limit_middle') }}"
endText="{{ Str::plural($type) }}"
:frequencies="{{ json_encode($frequencies) }}"
frequency-text="{{ trans('recurring.frequency_type', ['type' => \Str::replace('-recurring', '', $type)]) }}"
frequency-every-text="{{ trans('recurring.every') }}"
frequency-value="{{ $frequency }}"
:frequency-error="form.errors.get('recurring_frequency')"
@if ($attributes->has('@frequency'))
@frequency="form.recurring_frequency = $event; {{ $attributes['@frequency'] }}"
@else
@frequency="form.recurring_frequency = $event"
@endif
:custom-frequencies="{{ json_encode($customFrequencies) }}"
custom-frequency-value="{{ $customFrequency }}"
:custom-frequency-error="form.errors.get('recurring_custom_frequency')"
@if ($attributes->has('@interval'))
@interval="form.recurring_interval = $event; {{ $attributes['@interval'] }}"
@else
@interval="form.recurring_interval = $event"
@endif
@if ($attributes->has('@custom_frequency'))
@custom_frequency="form.recurring_custom_frequency = $event; {{ $attributes['@custom_frequency'] }}"
@else
@custom_frequency="form.recurring_custom_frequency = $event"
@endif
started-value="{{ $startedValue }}"
@if ($attributes->has('@started'))
@started="form.recurring_started_at = $event; {{ $attributes['@started'] }}"
@else
@started="form.recurring_started_at = $event"
@endif
:limits="{{ json_encode($limits) }}"
limit-value="{{ $limit }}"
:limit-error="form.errors.get('recurring_limit')"
@if ($attributes->has('@limit'))
@limit="form.recurring_limit = $event; {{ $attributes['@limit'] }}"
@else
@limit="form.recurring_limit = $event"
@endif
limit-count-value="{{ $limitCount }}"
@if ($attributes->has('@limit_count'))
@limit_count="form.recurring_limit_count = $event; {{ $attributes['@limit_count'] }}"
@else
@limit_count="form.recurring_limit_count = $event"
@endif
limit-date-value="{{ $limitDateValue }}"
@if ($attributes->has('@limit_date'))
@limit_date="form.recurring_limit_date = $event; {{ $attributes['@limit_date'] }}"
@else
@limit_date="form.recurring_limit_date = $event"
@endif
date-format="{{ company_date_format() }}"
{{ $attributes }}
>
</akaunting-recurring>

View File

@ -0,0 +1,160 @@
@stack($name . '_input_start')
@if (! empty($remote))
<akaunting-select-remote
@else
<akaunting-select
@endif
@class([
'form-group relative',
$formGroupClass,
'required' => $required,
'readonly' => $readonly,
'disabled' => $disabled,
])
id="form-select-{{ $name }}"
@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
@if (! $attributes->has('icon') && ! empty($icon->contents))
{!! $icon ?? '' !!}
@elseif (! empty($icon))
<x-form.icon icon="{{ $icon }}" />
@endif
title="{{ $label }}"
@if (isset($attributes['placeholder']))
placeholder="{{ $attributes['placeholder'] }}"
@else
placeholder="{{ trans('general.form.select.field', ['field' => $label]) }}"
@endif
name="{{ $name }}"
: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($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
@if (! empty($attributes['model']))
:model="{{ $attributes['model'] }}"
@endif
@if (! empty($addNew))
:add-new="{{ json_encode([
'status' => true,
'text' => trans('general.add_new'),
'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'),
'class' => 'disabled:bg-green-100'
]
]
])}}"
@endif
@if (! empty($group))
group
@endif
@if (! empty($attributes['v-model']))
@interface="form.errors.clear('{{ $attributes['v-model'] }}'); {{ $attributes['v-model'] . ' = $event' }}"
@elseif (! empty($attributes['data-field']))
@interface="form.errors.clear('{{ 'form.' . $attributes['data-field'] . '.' . $name }}'); {{ 'form.' . $attributes['data-field'] . '.' . $name . ' = $event' }}"
@else
@interface="form.errors.clear('{{ $name }}'); form.{{ $name }} = $event;"
@endif
@if (! empty($attributes['change']))
@change="{{ $attributes['change'] }}($event)"
@endif
@if (! empty($attributes['visible-change']))
@visible-change="{{ $attributes['visible-change'] }}"
@endif
@if (isset($attributes['readonly']))
:readonly="{{ $attributes['readonly'] }}"
@endif
@if (isset($attributes['clearable']))
:clearable="{{ $attributes['clearable'] }}"
@else
clearable
@endif
@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
@if (! empty($remote))
remote-action="{{ $attributes['remote_action'] }}"
@if (! empty($attributes['currecny_code']))
currency-code="{{ $attributes['currecny_code'] }}"
@endif
@endif
loading-text="{{ trans('general.loading') }}"
no-data-text="{{ trans('general.no_data') }}"
no-matching-data-text="{{ trans('general.no_matching_data') }}"
@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')

View File

@ -0,0 +1,25 @@
@stack($name . '_input_start')
<akaunting-switch
name="{{ $name }}"
value="{{ (int) $value }}"
@if (! empty($attributes['model']))
:model="{{ $attributes['model'] }}"
@endif
@if (! empty($attributes['v-model']))
@interface="form.errors.clear('{{ $attributes['v-model'] }}'); {{ $attributes['v-model'] . ' = $event' }}"
@elseif (!empty($attributes['data-field']))
@interface="form.errors.clear('{{ 'form.' . $attributes['data-field'] . '.' . enabled }}'); {{ 'form.' . $attributes['data-field'] . '.' . enabled . ' = $event' }}"
@else
@interface="form.errors.clear('enabled'); form.enabled = $event"
@endif
@if (!empty($attributes['change']))
@change="{{ $attributes['change'] }}($event)"
@endif
>
</akaunting-switch>
@stack($name . '_input_end')

View File

@ -0,0 +1,61 @@
@stack($name . '_input_start')
<div
@class([
'form-group relative',
$formGroupClass,
'required' => $required,
'readonly' => $readonly,
'disabled' => $disabled,
])
@if (isset($attributes['v-show']))
v-if="{{ $attributes['v-show'] }}"
@endif
@if (isset($attributes['v-disabled']) || isset($attributes['v-bind:disabled']))
:class="[
{'disabled' : {{ (isset($attributes['v-disabled'])) ? $attributes['v-disabled'] : $attributes['v-bind:disabled'] }}},
{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }}}
]"
@else
:class="[
{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }}}
]"
@endif
>
@if (! $attributes->has('label') && ! empty($label->contents))
{!! $label ?? '' !!}
@elseif (! empty($label))
<x-form.label for="{{ $name }}" class="form-control-label">{!! $label !!}</x-form.label>
@endif
<div @class([
'input-group input-group-merge',
$inputGroupClass,
])
>
@if (! $attributes->has('icon') && ! empty($icon->contents))
{!! $icon ?? '' !!}
@elseif (! empty($icon))
<x-form.icon icon="{{ $icon }}" />
@endif
<x-form.input.text
name="{{ $name }}"
id="{{ $id }}"
class="form-element"
value="{{ $value }}"
placeholder="{!! $placeholder !!}"
disabled="{{ $disabled }}"
v-model="{{ !empty($attributes['v-model']) ? $attributes['v-model'] : (!empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.' . $name : 'form.' . $name) }}"
{{ $attributes->merge($custom_attributes) }}
/>
</div>
@if (! $attributes->has('error') && ! empty($error->contents))
{!! $error ?? '' !!}
@else
<x-form.error name="{{ $name }}" {{ $attributes }} />
@endif
</div>
@stack($name . '_input_end')

View File

@ -0,0 +1,61 @@
@stack($name . '_input_start')
<div
@class([
'form-group relative',
$formGroupClass,
'required' => $required,
'readonly' => $readonly,
'disabled' => $disabled,
])
@if (isset($attributes['v-show']))
v-if="{{ $attributes['v-show'] }}"
@endif
@if (isset($attributes['v-disabled']) || isset($attributes['v-bind:disabled']))
:class="[
{'disabled' : {{ (isset($attributes['v-disabled'])) ? $attributes['v-disabled'] : $attributes['v-bind:disabled'] }}},
{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }}}
]"
@else
:class="[
{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }}}
]"
@endif
>
@if (! $attributes->has('label') && ! empty($label->contents))
{!! $label ?? '' !!}
@elseif (! empty($label))
<x-form.label for="{{ $name }}" class="form-control-label">{!! $label !!}</x-form.label>
@endif
@php
$vue_key = '@input';
$vue_value = !empty($attributes['v-model']) ? $attributes['v-model'] . ' = $event.target.value' : (!empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.'. $name . ' = $event.target.value' : 'form.' . $name . ' = $event.target.value');
if (!empty($attributes['enable-v-model'])) {
$vue_key = 'v-model';
$vue_value = !empty($attributes['v-model']) ? $attributes['v-model'] : (!empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.'. $name : 'form.' . $name);
}
$custom_attributes = array_merge([$vue_key => $vue_value], $custom_attributes);
$rows = !empty($rows) ? $rows : 3;
@endphp
<x-form.input.textarea
name="{{ $name }}"
id="{{ $id }}"
class="form-element"
value="{!! $value !!}"
placeholder="{{ $placeholder }}"
rows="{{ $rows }}"
{{ $attributes->merge($custom_attributes) }}
/>
@if (! $attributes->has('error') && ! empty($error->contents))
{!! $error ?? '' !!}
@else
<x-form.error name="{{ $name }}" {{ $attributes }} />
@endif
</div>
@stack($name . '_input_end')

View File

@ -0,0 +1,91 @@
@stack($name . '_input_start')
<akaunting-date
@class([
'form-group relative',
$formGroupClass,
'required' => $required,
'readonly' => $readonly,
'disabled' => $disabled,
])
@if (isset($attributes['v-show']))
v-if="{{ $attributes['v-show'] }}"
@endif
@if ($required)
:required="{{ $required ? 'true' : 'false' }}"
@endif
@if ($readonly)
:readonly="{{ $readonly }}"
@endif
@if ($disabled)
:disabled="{{ $disabled }}"
@endif
@if (! empty($attributes['v-error']))
:form-classes="[{'has-error': {{ $attributes['v-error'] }} }]"
@else
:form-classes="[{'has-error': form.errors.get('{{ $name }}') }]"
@endif
@if (! empty($icon))
icon="{{ $icon }}"
@endif
title="{{ $label }}"
placeholder="{{ $placeholder }}"
name="{{ $name }}"
@if (isset($value) || old($name))
value="{{ old($name, $value) }}"
@endif
@if (! empty($attributes['model']))
:model="{{ $attributes['model'] }}"
@endif
@if (! empty($attributes['value']))
:value="{{ $attributes['value'] }}"
@endif
:date-config="{
allowInput: true,
wrap: true,
enableTime: true,
@if (! empty($attributes['seconds']))
enableSeconds: true,
@endif
@if (! empty($attributes['time_24hr']))
wrap: false,
time_24hr: true,
@else
wrap: true,
@endif
noCalendar: true
}"
@if (! empty($attributes['v-model']))
@interface="form.errors.clear('{{ $attributes['v-model'] }}'); {{ $attributes['v-model'] . ' = $event' }}"
@elseif (! empty($attributes['data-field']))
@interface="form.errors.clear('{{ 'form.' . $attributes['data-field'] . '.' . $name }}'); {{ 'form.' . $attributes['data-field'] . '.' . $name . ' = $event' }}"
@else
@interface="form.errors.clear('{{ $name }}'); form.{{ $name }} = $event"
@endif
@if (! empty($attributes['change']))
@change="{{ $attributes['change'] }}"
@endif
@if(isset($attributes['v-error-message']))
:form-error="{{ $attributes['v-error-message'] }}"
@else
:form-error="form.errors.get('{{ $name }}')"
@endif
></akaunting-date>
@stack($name . '_input_end')

View File

@ -0,0 +1,46 @@
@stack($name . '_input_start')
<div
class="form-group sm:col-span-3 {{ isset($attributes['required']) ? ' required' : '' }}{{ isset($attributes['readonly']) ? ' readonly' : '' }}{{ isset($attributes['disabled']) ? ' disabled' : '' }}"
:class="[{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }} }]"
@if (isset($attributes['show']))
v-if="{{ $attributes['show'] }}"
@endif
>
<x-form.label for="{{ $name }}" class="form-control-label">{!! $label !!}</x-form.label>
<div class="flex items-center mt-1">
@if (empty($attributes['disabled']))
<label class="relative w-10 rounded-tl-lg rounded-bl-lg py-2 px-1 text-sm text-center transition-all cursor-pointer" @click="form.{{ $name }}=1" v-bind:class="[form.{{ $name }} == 1 ? ['bg-green-500','text-white'] : 'bg-black-100']">
{{ empty($enable) ? trans('general.yes') : $enable }}
<input type="radio" name="{{ $name }}" id="{{ $name }}-1" class="absolute left-0 opacity-0">
</label>
@else
<label class="relative w-10 rounded-tl-lg rounded-bl-lg py-2 px-1 text-sm text-center transition-all cursor-not-allowed{{ ($value) ? ' bg-green-500 text-white opacity-20 disabled' : ' disabled' }}">
{{ empty($enable) ? trans('general.yes') : $enable }}
<input type="radio" name="{{ $name }}" id="{{ $name }}-1" class="absolute left-0 opacity-0" disabled>
</label>
@endif
@if (empty($attributes['disabled']))
<label class="relative w-10 rounded-tr-lg rounded-br-lg py-2 px-1 text-sm text-center transition-all cursor-pointer" @click="form.{{ $name }}=0" v-bind:class="[form.{{ $name }} == 0 ? ['bg-red-500','text-white'] : 'bg-black-100']">
{{ empty($disable) ? trans('general.no') : $disable }}
<input type="radio" name="{{ $name }}" id="{{ $name }}-0" class="absolute left-0 opacity-0">
</label>
@else
<label class="relative w-10 rounded-tr-lg rounded-br-lg py-2 px-1 text-sm text-center transition-all cursor-not-allowed{{ ($value) ? ' disabled' : 'bg-red-500 text-white opacity-20 disabled disabled' }}">
{{ empty($disable) ? trans('general.no') : $disable }}
<input type="radio" name="{{ $name }}" id="{{ $name }}-0" class="absolute left-0 opacity-0" disabled>
</label>
@endif
</div>
<input type="hidden" name="{{ $name }}" value="{{ ($value) ? 1 : 0 }}" />
<div class="text-red text-sm mt-1 block"
v-if="{{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.has("' . $name . '")' }}"
v-html="{{ isset($attributes['v-error-message']) ? $attributes['v-error-message'] : 'form.errors.get("' . $name . '")' }}">
</div>
</div>
@stack($name . '_input_end')

View File

@ -0,0 +1,4 @@
<x-form.group.contact
type="vendor"
{{ $attributes }}
/>