akaunting 3.0 (the last dance)
This commit is contained in:
11
resources/views/components/form/accordion/head.blade.php
Normal file
11
resources/views/components/form/accordion/head.blade.php
Normal file
@ -0,0 +1,11 @@
|
||||
<div class="border-b-2 border-gray-200 {{ ! empty($description) ? ' pb-4' : 'pb-2' }}">
|
||||
<h2 class="lg:text-lg font-medium text-black">
|
||||
{{ $title }}
|
||||
</h2>
|
||||
|
||||
@if (! empty($description))
|
||||
<span class="text-sm font-light text-black">
|
||||
{!! $description !!}
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
28
resources/views/components/form/accordion/index.blade.php
Normal file
28
resources/views/components/form/accordion/index.blade.php
Normal file
@ -0,0 +1,28 @@
|
||||
<div {{ ((! $attributes->has('override')) || ($attributes->has('override') && ! in_array('class', explode(',', $attributes->get('override'))))) ? $attributes->merge(['class' => 'mb-14']) : $attributes }}
|
||||
x-data="{ {{ $type }} : {{ ($open) ? "'open'" : "'close'" }} }"
|
||||
>
|
||||
@if (! empty($head) && $head->isNotEmpty())
|
||||
<div class="relative cursor-pointer" x-on:click="{{ $type }} !== 'open' ? {{ $type }} = 'open' : {{ $type }} = 'close'">
|
||||
{!! $head !!}
|
||||
|
||||
<x-icon filled class="absolute right-0 top-0 transition-all transform" :icon="$icon" x-bind:class="{{ $type }} === 'open' ? 'rotate-180' : ''" />
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (! empty($body) && $body->isNotEmpty())
|
||||
<div class="overflow-hidden transition-transform origin-top-left ease-linear duration-100"
|
||||
x-ref="accordion_{{ $type }}"
|
||||
x-bind:class="{{ $type }} == 'open' ? 'h-auto ' : 'scale-y-0 h-0'"
|
||||
>
|
||||
<div class="grid sm:grid-cols-7 gap-x-8 gap-y-6 my-3.5">
|
||||
{!! $body !!}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (! empty($foot) && $foot->isNotEmpty())
|
||||
<div class="relative__footer">
|
||||
{!! $foot !!}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
26
resources/views/components/form/buttons.blade.php
Normal file
26
resources/views/components/form/buttons.blade.php
Normal file
@ -0,0 +1,26 @@
|
||||
@stack('save_buttons_start')
|
||||
<div
|
||||
@class([
|
||||
'flex items-center justify-end',
|
||||
$groupClass,
|
||||
])
|
||||
>
|
||||
@if (! $withoutCancel)
|
||||
<x-link href="{{ $cancel }}" class="{{ $cancelClass }}" override="class">
|
||||
{{ $cancelText }}
|
||||
</x-link>
|
||||
@endif
|
||||
|
||||
<x-button
|
||||
type="submit"
|
||||
class="relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100"
|
||||
::disabled="form.loading"
|
||||
override="class"
|
||||
>
|
||||
<i v-if="form.loading" class="animate-submit delay-[0.28s] absolute w-2 h-2 rounded-full left-0 right-0 -top-3.5 m-auto before:absolute before:w-2 before:h-2 before:-left-3.5 before:rounded-full before:animate-submit before:delay-[0.14s] after:absolute after:w-2 after:h-2 after:-right-3.5 after:rounded-full after:animate-submit after:delay-[0.42s]"></i>
|
||||
<span :class="[{'opacity-0': form.loading}]">
|
||||
{{ trans('general.save') }}
|
||||
</span>
|
||||
</x-button>
|
||||
</div>
|
||||
@stack('save_buttons_end')
|
19
resources/views/components/form/container.blade.php
Normal file
19
resources/views/components/form/container.blade.php
Normal file
@ -0,0 +1,19 @@
|
||||
<div class="flex flex-col lg:flex-row">
|
||||
<div {{ ((! $attributes->has('override')) || ($attributes->has('override') && ! in_array('class', explode(',', $attributes->get('override'))))) ? $attributes->merge(['class' => 'relative lg:w-8/12 z-10']) : $attributes }}>
|
||||
@if (! empty($head) && $head->isNotEmpty())
|
||||
{!! $head !!}
|
||||
@endif
|
||||
|
||||
<div class="relative mt-4">
|
||||
{!! $slot !!}
|
||||
</div>
|
||||
|
||||
@if (!empty($foot) && $foot->isNotEmpty())
|
||||
{!! $foot !!}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<x-tips position="relative" />
|
||||
</div>
|
||||
|
||||
<x-tips position="fixed" />
|
4
resources/views/components/form/error.blade.php
Normal file
4
resources/views/components/form/error.blade.php
Normal file
@ -0,0 +1,4 @@
|
||||
<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>
|
24
resources/views/components/form/group/account.blade.php
Normal file
24
resources/views/components/form/group/account.blade.php
Normal 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
|
10
resources/views/components/form/group/attachment.blade.php
Normal file
10
resources/views/components/form/group/attachment.blade.php
Normal 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"
|
||||
/>
|
81
resources/views/components/form/group/category.blade.php
Normal file
81
resources/views/components/form/group/category.blade.php
Normal 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
|
72
resources/views/components/form/group/checkbox.blade.php
Normal file
72
resources/views/components/form/group/checkbox.blade.php
Normal 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')
|
75
resources/views/components/form/group/color.blade.php
Normal file
75
resources/views/components/form/group/color.blade.php
Normal 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')
|
81
resources/views/components/form/group/contact.blade.php
Normal file
81
resources/views/components/form/group/contact.blade.php
Normal 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
|
8
resources/views/components/form/group/country.blade.php
Normal file
8
resources/views/components/form/group/country.blade.php
Normal 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"
|
||||
/>
|
39
resources/views/components/form/group/currency.blade.php
Normal file
39
resources/views/components/form/group/currency.blade.php
Normal 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
|
4
resources/views/components/form/group/customer.blade.php
Normal file
4
resources/views/components/form/group/customer.blade.php
Normal file
@ -0,0 +1,4 @@
|
||||
<x-form.group.contact
|
||||
type="customer"
|
||||
{{ $attributes }}
|
||||
/>
|
107
resources/views/components/form/group/date.blade.php
Normal file
107
resources/views/components/form/group/date.blade.php
Normal 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')
|
91
resources/views/components/form/group/date_time.blade.php
Normal file
91
resources/views/components/form/group/date_time.blade.php
Normal 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')
|
47
resources/views/components/form/group/editor.blade.php
Normal file
47
resources/views/components/form/group/editor.blade.php
Normal 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')
|
60
resources/views/components/form/group/email.blade.php
Normal file
60
resources/views/components/form/group/email.blade.php
Normal 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')
|
60
resources/views/components/form/group/file.blade.php
Normal file
60
resources/views/components/form/group/file.blade.php
Normal 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')
|
173
resources/views/components/form/group/invoice_text.blade.php
Normal file
173
resources/views/components/form/group/invoice_text.blade.php
Normal 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')
|
6
resources/views/components/form/group/locale.blade.php
Normal file
6
resources/views/components/form/group/locale.blade.php
Normal file
@ -0,0 +1,6 @@
|
||||
<x-form.group.select
|
||||
name="locale"
|
||||
label="{{ trans_choice('general.languages', 1) }}"
|
||||
:options="language()->allowed()"
|
||||
:selected="$selected"
|
||||
/>
|
88
resources/views/components/form/group/money.blade.php
Normal file
88
resources/views/components/form/group/money.blade.php
Normal 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')
|
60
resources/views/components/form/group/number.blade.php
Normal file
60
resources/views/components/form/group/number.blade.php
Normal 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')
|
60
resources/views/components/form/group/password.blade.php
Normal file
60
resources/views/components/form/group/password.blade.php
Normal 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')
|
@ -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 }}
|
||||
/>
|
61
resources/views/components/form/group/radio.blade.php
Normal file
61
resources/views/components/form/group/radio.blade.php
Normal 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')
|
67
resources/views/components/form/group/recurring.blade.php
Normal file
67
resources/views/components/form/group/recurring.blade.php
Normal 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>
|
160
resources/views/components/form/group/select.blade.php
Normal file
160
resources/views/components/form/group/select.blade.php
Normal 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')
|
25
resources/views/components/form/group/switch.blade.php
Normal file
25
resources/views/components/form/group/switch.blade.php
Normal 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')
|
61
resources/views/components/form/group/text.blade.php
Normal file
61
resources/views/components/form/group/text.blade.php
Normal 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')
|
61
resources/views/components/form/group/textarea.blade.php
Normal file
61
resources/views/components/form/group/textarea.blade.php
Normal 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')
|
91
resources/views/components/form/group/time.blade.php
Normal file
91
resources/views/components/form/group/time.blade.php
Normal 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')
|
46
resources/views/components/form/group/toggle.blade.php
Normal file
46
resources/views/components/form/group/toggle.blade.php
Normal 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')
|
4
resources/views/components/form/group/vendor.blade.php
Normal file
4
resources/views/components/form/group/vendor.blade.php
Normal file
@ -0,0 +1,4 @@
|
||||
<x-form.group.contact
|
||||
type="vendor"
|
||||
{{ $attributes }}
|
||||
/>
|
5
resources/views/components/form/icon.blade.php
Normal file
5
resources/views/components/form/icon.blade.php
Normal file
@ -0,0 +1,5 @@
|
||||
<div class="input-group-prepend absolute right-2 bottom-3 text-light-gray">
|
||||
<span class="input-group-text">
|
||||
<x-icon icon="{{ $icon }}" class="w-4 h-5 text-sm"/>
|
||||
</span>
|
||||
</div>
|
26
resources/views/components/form/index.blade.php
Normal file
26
resources/views/components/form/index.blade.php
Normal file
@ -0,0 +1,26 @@
|
||||
<form
|
||||
method="POST"
|
||||
action="{{ $action }}"
|
||||
@if ($class)
|
||||
class="{{ $class }}"
|
||||
@endif
|
||||
@if ($role)
|
||||
role="form"
|
||||
@endif
|
||||
@if ($novalidate)
|
||||
novalidate="{{ $novalidate }}"
|
||||
@endif
|
||||
@if ($enctype)
|
||||
enctype="{{ $enctype }}"
|
||||
@endif
|
||||
@if ($acceptCharset)
|
||||
accept-charset="{{ $acceptCharset }}"
|
||||
@endif
|
||||
@submit.prevent="{{ $submit }}"
|
||||
@keydown="form.errors.clear($event.target.name)"
|
||||
{{ $attributes }}
|
||||
>
|
||||
@csrf
|
||||
@method($method)
|
||||
{{ $slot }}
|
||||
</form>
|
25
resources/views/components/form/input/checkbox.blade.php
Normal file
25
resources/views/components/form/input/checkbox.blade.php
Normal file
@ -0,0 +1,25 @@
|
||||
<input type="checkbox"
|
||||
name="{{ $name }}"
|
||||
class="rounded-sm text-purple border-gray-300 cursor-pointer disabled:bg-gray-200 focus:outline-none focus:ring-transparent"
|
||||
id="{{ ! empty($attributes[':id']) ? $attributes[':id'] : $id }}"
|
||||
@if ($value)
|
||||
value="{{ $value }}"
|
||||
@endif
|
||||
@if (! empty($checked) && (string) $checked != 'n/a')
|
||||
checked="checked"
|
||||
@endif
|
||||
@if ($disabled)
|
||||
disabled="disabled"
|
||||
@endif
|
||||
@if ($required)
|
||||
required="required"
|
||||
@endif
|
||||
@if ($readonly)
|
||||
readonly="readonly"
|
||||
@endif
|
||||
{{ $attributes->except(['placeholder', 'disabled', 'required', 'readonly', 'v-error', 'v-error-message', 'option', 'optionKey', 'optionValue']) }}
|
||||
/>
|
||||
|
||||
<label class="form-control-label ml-2" for="{{ ! empty($attributes[':id']) ? $attributes[':id'] : $id }}">
|
||||
{{ !empty($option) ? $option->$optionValue : $label }}
|
||||
</label>
|
77
resources/views/components/form/input/color.blade.php
Normal file
77
resources/views/components/form/input/color.blade.php
Normal file
@ -0,0 +1,77 @@
|
||||
@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
|
||||
|
||||
@if (! empty($name))
|
||||
name="{{ $name }}"
|
||||
@endif
|
||||
|
||||
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')
|
25
resources/views/components/form/input/editor.blade.php
Normal file
25
resources/views/components/form/input/editor.blade.php
Normal file
@ -0,0 +1,25 @@
|
||||
<akaunting-html-editor
|
||||
name="{{ $name }}"
|
||||
|
||||
@if (! empty($value))
|
||||
:value="`{!! $value !!}`"
|
||||
@else
|
||||
:value="''"
|
||||
@endif
|
||||
|
||||
@if (! empty($attributes['model']))
|
||||
:model="{{ $attributes['model'] }}"
|
||||
@endif
|
||||
|
||||
@if (!empty($attributes['v-model']))
|
||||
@input="{{ $attributes['v-model'] . ' = $event' }}"
|
||||
@elseif (!empty($attributes['data-field']))
|
||||
@input="{{ 'form.' . $attributes['data-field'] . '.' . $name . ' = $event' }}"
|
||||
@else
|
||||
@input="form.{{ $name }} = $event"
|
||||
@endif
|
||||
|
||||
@if (isset($attributes['disabled']))
|
||||
:disabled="{{ $attributes['disabled'] }}"
|
||||
@endif
|
||||
></akaunting-html-editor>
|
18
resources/views/components/form/input/email.blade.php
Normal file
18
resources/views/components/form/input/email.blade.php
Normal file
@ -0,0 +1,18 @@
|
||||
<input type="email"
|
||||
name="{{ $name }}"
|
||||
id="{{ $id }}"
|
||||
@if ($value)
|
||||
value="{{ $value }}"
|
||||
@endif
|
||||
placeholder="{{ $placeholder }}"
|
||||
@if ($disabled)
|
||||
disabled="disabled"
|
||||
@endif
|
||||
@if ($required)
|
||||
required="required"
|
||||
@endif
|
||||
@if ($readonly)
|
||||
readonly="readonly"
|
||||
@endif
|
||||
{{ $attributes->except(['placeholder', 'disabled', 'required', 'readonly', 'v-error', 'v-error-message']) }}
|
||||
/>
|
83
resources/views/components/form/input/file.blade.php
Normal file
83
resources/views/components/form/input/file.blade.php
Normal file
@ -0,0 +1,83 @@
|
||||
<akaunting-dropzone-file-upload
|
||||
text-drop-file="{{ trans('general.form.drop_file') }}"
|
||||
text-choose-file="{{ trans('general.form.choose_file') }}"
|
||||
|
||||
@if (! empty($attributes['dropzone-class']))
|
||||
class="{{ $attributes['dropzone-class'] }}"
|
||||
@endif
|
||||
|
||||
@if (! empty($options))
|
||||
:options={{ json_encode($options) }}
|
||||
@endif
|
||||
|
||||
@if (! empty($attributes['preview']))
|
||||
:preview={{ json_encode($attributes['preview']) }}
|
||||
@endif
|
||||
|
||||
@if (! empty($multiple))
|
||||
multiple
|
||||
@endif
|
||||
|
||||
@if (! empty($attributes['previewClasses']))
|
||||
preview-classes="{{ $attributes['previewClasses'] }}"
|
||||
@endif
|
||||
|
||||
@if (! empty($attributes['singleWidthClasses']))
|
||||
single-width-classes="{{ $attributes['singleWidthClasses'] }}"
|
||||
@endif
|
||||
|
||||
@if (! empty($attributes['url']))
|
||||
url="{{ $attributes['url'] }}"
|
||||
@endif
|
||||
|
||||
@if (! empty($value))
|
||||
@php
|
||||
$attachments = [];
|
||||
@endphp
|
||||
|
||||
@if (is_array($value))
|
||||
@foreach($value as $attachment)
|
||||
@php
|
||||
$attachments[] = [
|
||||
'id' => $attachment->id,
|
||||
'name' => $attachment->filename . '.' . $attachment->extension,
|
||||
'path' => route('uploads.get', $attachment->id),
|
||||
'type' => $attachment->mime_type,
|
||||
'size' => $attachment->size,
|
||||
'downloadPath' => route('uploads.download', $attachment->id),
|
||||
];
|
||||
@endphp
|
||||
@endforeach
|
||||
@elseif ($value instanceof \Plank\Mediable\Media)
|
||||
@php
|
||||
$attachments[] = [
|
||||
'id' => $value->id,
|
||||
'name' => $value->filename . '.' . $value->extension,
|
||||
'path' => route('uploads.get', $value->id),
|
||||
'type' => $value->mime_type,
|
||||
'size' => $value->size,
|
||||
'downloadPath' => false,
|
||||
];
|
||||
@endphp
|
||||
@else
|
||||
@php
|
||||
$attachment = \Plank\Mediable\Media::find($value);
|
||||
|
||||
if (! empty($attachment)) {
|
||||
$attachments[] = [
|
||||
'id' => $attachment->id,
|
||||
'name' => $attachment->filename . '.' . $attachment->extension,
|
||||
'path' => route('uploads.get', $attachment->id),
|
||||
'type' => $attachment->mime_type,
|
||||
'size' => $attachment->size,
|
||||
'downloadPath' => false,
|
||||
];
|
||||
}
|
||||
@endphp
|
||||
@endif
|
||||
|
||||
:attachments="{{ json_encode($attachments) }}"
|
||||
@endif
|
||||
|
||||
v-model="{{ ! empty($attributes['v-model']) ? $attributes['v-model'] : (! empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.'. $name : 'form.' . $name) }}"
|
||||
></akaunting-dropzone-file-upload>
|
16
resources/views/components/form/input/hidden.blade.php
Normal file
16
resources/views/components/form/input/hidden.blade.php
Normal file
@ -0,0 +1,16 @@
|
||||
<input type="hidden"
|
||||
name="{{ $name }}"
|
||||
id="{{ $id }}"
|
||||
value="{{ $value }}"
|
||||
placeholder="{{ $placeholder }}"
|
||||
@if ($disabled)
|
||||
disabled="disabled"
|
||||
@endif
|
||||
@if ($required)
|
||||
required="required"
|
||||
@endif
|
||||
@if ($readonly)
|
||||
readonly="readonly"
|
||||
@endif
|
||||
{{ $attributes->except(['placeholder', 'disabled', 'required', 'readonly', 'v-error', 'v-error-message']) }}
|
||||
/>
|
18
resources/views/components/form/input/input.blade.php
Normal file
18
resources/views/components/form/input/input.blade.php
Normal file
@ -0,0 +1,18 @@
|
||||
<input type="{{ $type }}"
|
||||
name="{{ $name }}"
|
||||
id="{{ $id }}"
|
||||
@if ($value)
|
||||
value="{{ $value }}"
|
||||
@endif
|
||||
placeholder="{{ $placeholder }}"
|
||||
@if ($disabled)
|
||||
disabled="disabled"
|
||||
@endif
|
||||
@if ($required)
|
||||
required="required"
|
||||
@endif
|
||||
@if ($readonly)
|
||||
readonly="readonly"
|
||||
@endif
|
||||
{{ $attributes->except(['placeholder', 'disabled', 'required', 'readonly', 'v-error', 'v-error-message']) }}
|
||||
/>
|
82
resources/views/components/form/input/money.blade.php
Normal file
82
resources/views/components/form/input/money.blade.php
Normal file
@ -0,0 +1,82 @@
|
||||
@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 ($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
|
||||
|
||||
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')
|
18
resources/views/components/form/input/number.blade.php
Normal file
18
resources/views/components/form/input/number.blade.php
Normal file
@ -0,0 +1,18 @@
|
||||
<input type="number"
|
||||
name="{{ $name }}"
|
||||
id="{{ $id }}"
|
||||
@if ($value)
|
||||
value="{{ $value }}"
|
||||
@endif
|
||||
placeholder="{{ $placeholder }}"
|
||||
@if ($disabled)
|
||||
disabled="disabled"
|
||||
@endif
|
||||
@if ($required)
|
||||
required="required"
|
||||
@endif
|
||||
@if ($readonly)
|
||||
readonly="readonly"
|
||||
@endif
|
||||
{{ $attributes->except(['placeholder', 'disabled', 'required', 'readonly', 'v-error', 'v-error-message']) }}
|
||||
/>
|
18
resources/views/components/form/input/password.blade.php
Normal file
18
resources/views/components/form/input/password.blade.php
Normal file
@ -0,0 +1,18 @@
|
||||
<input type="password"
|
||||
name="{{ $name }}"
|
||||
id="{{ $id }}"
|
||||
@if ($value)
|
||||
value="{{ $value }}"
|
||||
@endif
|
||||
placeholder="{{ $placeholder }}"
|
||||
@if ($disabled)
|
||||
disabled="disabled"
|
||||
@endif
|
||||
@if ($required)
|
||||
required="required"
|
||||
@endif
|
||||
@if ($readonly)
|
||||
readonly="readonly"
|
||||
@endif
|
||||
{{ $attributes->except(['placeholder', 'disabled', 'required', 'readonly', 'v-error', 'v-error-message']) }}
|
||||
/>
|
28
resources/views/components/form/input/radio.blade.php
Normal file
28
resources/views/components/form/input/radio.blade.php
Normal file
@ -0,0 +1,28 @@
|
||||
<label
|
||||
@click="form.{{ $name }} = '{{ $option->$optionKey }}'"
|
||||
class="border rounded-md px-2 py-2.5 flex items-center justify-center text-center text-sm font-medium sm:flex-1 cursor-pointer focus:outline-none transition-all"
|
||||
:class="[form.{{ $name }} == '{{ $option->$optionKey }}' ? 'bg-purple border-transparent text-white hover:bg-purple-700' : 'bg-white border-gray-200 text-gray-900 hover:bg-gray-50']"
|
||||
>
|
||||
<input type="radio"
|
||||
name="{{ $name }}"
|
||||
id="{{ $id . '-' . $option->$optionKey }}"
|
||||
aria-labelledby="radio-{{ $option->$optionKey }}"
|
||||
@if ($value)
|
||||
value="{{ $value }}"
|
||||
@endif
|
||||
@if ($disabled)
|
||||
disabled="disabled"
|
||||
@endif
|
||||
@if ($required)
|
||||
required="required"
|
||||
@endif
|
||||
@if ($readonly)
|
||||
readonly="readonly"
|
||||
@endif
|
||||
{{ $attributes->except(['placeholder', 'disabled', 'required', 'readonly', 'v-error', 'v-error-message', 'option', 'optionKey', 'optionValue']) }}
|
||||
/>
|
||||
|
||||
<p id="radio-{{ $option->$optionKey }}">
|
||||
{{ $option->$optionValue }}
|
||||
</p>
|
||||
</label>
|
158
resources/views/components/form/input/select.blade.php
Normal file
158
resources/views/components/form/input/select.blade.php
Normal file
@ -0,0 +1,158 @@
|
||||
@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
|
||||
|
||||
@if (! empty($label))
|
||||
title="{{ $label }}"
|
||||
@endif
|
||||
|
||||
@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
|
16
resources/views/components/form/input/text.blade.php
Normal file
16
resources/views/components/form/input/text.blade.php
Normal file
@ -0,0 +1,16 @@
|
||||
<input type="text"
|
||||
name="{{ $name }}"
|
||||
id="{{ $id }}"
|
||||
value="{{ $value }}"
|
||||
placeholder="{!! $placeholder !!}"
|
||||
@if ($disabled)
|
||||
disabled="disabled"
|
||||
@endif
|
||||
@if ($required)
|
||||
required="required"
|
||||
@endif
|
||||
@if ($readonly)
|
||||
readonly="readonly"
|
||||
@endif
|
||||
{{ $attributes->except(['placeholder', 'disabled', 'required', 'readonly', 'v-error', 'v-error-message']) }}
|
||||
/>
|
16
resources/views/components/form/input/textarea.blade.php
Normal file
16
resources/views/components/form/input/textarea.blade.php
Normal file
@ -0,0 +1,16 @@
|
||||
<textarea
|
||||
name="{{ $name }}"
|
||||
id="{{ $id }}"
|
||||
rows="{{ $rows }}"
|
||||
placeholder="{{ $placeholder }}"
|
||||
@if ($disabled)
|
||||
disabled="disabled"
|
||||
@endif
|
||||
@if ($required)
|
||||
required="required"
|
||||
@endif
|
||||
@if ($readonly)
|
||||
readonly="readonly"
|
||||
@endif
|
||||
{{ $attributes->except(['rows', 'placeholder', 'disabled', 'required', 'readonly']) }}
|
||||
>{!! $value !!}</textarea>
|
3
resources/views/components/form/label.blade.php
Normal file
3
resources/views/components/form/label.blade.php
Normal file
@ -0,0 +1,3 @@
|
||||
<label {{ $attributes }}>
|
||||
{!! $slot !!}
|
||||
</label>
|
11
resources/views/components/form/section/head.blade.php
Normal file
11
resources/views/components/form/section/head.blade.php
Normal file
@ -0,0 +1,11 @@
|
||||
<div class="border-b-2 border-gray-200 {{ !empty($description) ? ' pb-4' : 'pb-2' }}">
|
||||
<h2 class="lg:text-lg font-medium text-black">
|
||||
{{ $title }}
|
||||
</h2>
|
||||
|
||||
@if (!empty($description))
|
||||
<span class="text-sm font-light text-black">
|
||||
{!! $description !!}
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
17
resources/views/components/form/section/index.blade.php
Normal file
17
resources/views/components/form/section/index.blade.php
Normal file
@ -0,0 +1,17 @@
|
||||
<div {{ ((! $attributes->has('override')) || ($attributes->has('override') && ! in_array('class', explode(',', $attributes->get('override'))))) ? $attributes->merge(['class' => 'mb-14']) : $attributes }}>
|
||||
@if (!empty($head) && $head->isNotEmpty())
|
||||
{!! $head !!}
|
||||
@endif
|
||||
|
||||
@if (! empty($body) && $body->isNotEmpty())
|
||||
<div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5">
|
||||
{!! $body !!}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (! empty($foot) && $foot->isNotEmpty())
|
||||
<div class="relative__footer">
|
||||
{!! $foot !!}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
Reference in New Issue
Block a user