Skip to content

Commit

Permalink
Select and date vue component fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Feb 14, 2020
1 parent 259a771 commit aa97e6a
Show file tree
Hide file tree
Showing 15 changed files with 161 additions and 79 deletions.
13 changes: 10 additions & 3 deletions resources/assets/js/components/AkauntingSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -419,13 +419,17 @@ export default {
description: "Selectbox attribute name"
},
value: {
type: String,
type: [String, Number],
default: null,
description: "Selectbox selected value"
},
options: null,
model: null,
model: {
type: [String, Number],
default: null,
description: "Selectbox selected model"
},
icon: {
type: String,
Expand Down Expand Up @@ -605,7 +609,10 @@ export default {
this.selectOptions = options;
},
value: function (value) {
this.real_model = value;
this.real_model = value.toString();
},
model: function (value) {
this.real_model = value.toString();
}
},
}
Expand Down
18 changes: 13 additions & 5 deletions resources/views/partials/form/date_group.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,19 @@ class="{{ $col }}{{ isset($attributes['required']) ? ' required' : '' }}"
:form-classes="[{'has-error': form.errors.get('{{ $name }}') }]"
@endif

:icon="'fa fa-{{ $icon }}'"
:title="'{{ $text }}'"
:placeholder="'{{ trans('general.form.select.field', ['field' => $text]) }}'"
:name="'{{ $name }}'"
:value="'{{ old($name, $value) }}'"
icon="fa fa-{{ $icon }}"
title="{{ $text }}"
placeholder="{{ trans('general.form.select.field', ['field' => $text]) }}"
name="{{ $name }}"

@if(old($name, $value))
value="{{ old($name, $value) }}"
@endif

@if (!empty($attributes['model']))
:model="{{ $attributes['model'] }}"
@endif

:config="{
allowInput: true,
@if (!empty($attributes['show-date-format']))
Expand Down
18 changes: 13 additions & 5 deletions resources/views/partials/form/date_time_group.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,19 @@ class="{{ $col }}{{ isset($attributes['required']) ? ' required' : '' }}"
:form-classes="[{'has-error': form.errors.get('{{ $name }}') }]"
@endif

:icon="'fa fa-{{ $icon }}'"
:title="'{{ $text }}'"
:placeholder="'{{ trans('general.form.select.field', ['field' => $text]) }}'"
:name="'{{ $name }}'"
:value="'{{ old($name, $value) }}'"
icon="fa fa-{{ $icon }}"
title="{{ $text }}"
placeholder="{{ trans('general.form.select.field', ['field' => $text]) }}"
name="{{ $name }}"

@if(old($name, $value))
value="{{ old($name, $value) }}"
@endif

@if (!empty($attributes['model']))
:model="{{ $attributes['model'] }}"
@endif

:config="{
allowInput: true,
@if (!empty($attributes['show-date-format']))
Expand Down
2 changes: 1 addition & 1 deletion resources/views/partials/form/enabled_group.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<label class="custom-toggle">
<input type="checkbox"
name="status[{{ $id }}]"
v-on:input="onStatus({{ $id }}, $event)"
@input="onStatus({{ $id }}, $event)"
{{ ($value) ? 'checked' :'' }}>

<span class="custom-toggle-slider rounded-circle status-green"
Expand Down
6 changes: 3 additions & 3 deletions resources/views/partials/form/money_group.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
@endif

:error="{{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }}"
:name="'{{ $name }}'"
:title="'{{ $text }}'"
name="{{ $name }}"
title="{{ $text }}"
:group_class="'{{ $group_class }}'"
:icon="'{{ $icon }}'"
icon="{{ $icon }}"
:currency="{{ json_encode($attributes['currency']) }}"
:value="{{ $value }}"

Expand Down
24 changes: 16 additions & 8 deletions resources/views/partials/form/multi_select_add_new_group.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,22 @@ class="{{ $col }}{{ isset($attributes['required']) ? ' required' : '' }}{{ isset
:form-classes="[{'has-error': form.errors.get('{{ $name }}') }]"
@endif

:icon="'{{ $icon }}'"
:title="'{{ $text }}'"
:placeholder="'{{ trans('general.form.select.field', ['field' => $text]) }}'"
:name="'{{ $name }}'"
icon="{{ $icon }}"
title="{{ $text }}"
placeholder="{{ trans('general.form.select.field', ['field' => $text]) }}"
name="{{ $name }}"
:options="{{ json_encode($values) }}"
:value="{{ json_encode(old($name, $selected)) }}"

:multiple="true"
@if(old($name, $selected))
value="{{ json_encode(old($name, $selected)) }}"
@endif

@if (!empty($attributes['model']))
:model="{{ $attributes['model'] }}"
@endif

multiple="true"

:add-new="{{ json_encode([
'status' => true,
'text' => trans('general.add_new'),
Expand Down Expand Up @@ -67,8 +75,8 @@ class="{{ $col }}{{ isset($attributes['required']) ? ' required' : '' }}{{ isset
:form-error="form.errors.get('{{ $name }}')"
@endif

:no-data-text="'{{ trans('general.no_data') }}'"
:no-matching-data-text="'{{ trans('general.no_matching_data') }}'"
no-data-text="{{ trans('general.no_data') }}"
no-matching-data-text="{{ trans('general.no_matching_data') }}"
></akaunting-select>

@stack($name . '_input_end')
21 changes: 14 additions & 7 deletions resources/views/partials/form/multi_select_group.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,19 @@ class="{{ $col }}{{ isset($attributes['required']) ? ' required' : '' }}{{ isset
:form-classes="[{'has-error': form.errors.get('{{ $name }}') }]"
@endif

:icon="'{{ $icon }}'"
:title="'{{ $text }}'"
:placeholder="'{{ trans('general.form.select.field', ['field' => $text]) }}'"
:name="'{{ $name }}'"
icon="{{ $icon }}"
title="{{ $text }}"
placeholder="{{ trans('general.form.select.field', ['field' => $text]) }}"
name="{{ $name }}"
:options="{{ json_encode($values) }}"
:value="{{ json_encode(old($name, $selected)) }}"

@if(old($name, $selected))
value="{{ json_encode(old($name, $selected)) }}"
@endif

@if (!empty($attributes['model']))
:model="{{ $attributes['model'] }}"
@endif

:multiple="true"

Expand Down Expand Up @@ -48,8 +55,8 @@ class="{{ $col }}{{ isset($attributes['required']) ? ' required' : '' }}{{ isset
:form-error="form.errors.get('{{ $name }}')"
@endif

:no-data-text="'{{ trans('general.no_data') }}'"
:no-matching-data-text="'{{ trans('general.no_matching_data') }}'"
no-data-text="{{ trans('general.no_data') }}"
no-matching-data-text="{{ trans('general.no_matching_data') }}"
></akaunting-select>

@stack($name . '_input_end')
4 changes: 2 additions & 2 deletions resources/views/partials/form/recurring.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

<akaunting-recurring
:form-classes="[{'has-error': form.errors.get('recurring_frequency')}]"
:title="'{{ trans('recurring.recurring') }}'"
:placeholder="'{{ trans('general.form.select.field', ['field' => trans('recurring.recurring')]) }}'"
title="{{ trans('recurring.recurring') }}"
placeholder="{{ trans('general.form.select.field', ['field' => trans('recurring.recurring')]) }}"

:frequency-options="{{ json_encode($recurring_frequencies) }}"
:frequency-value="'{{ $frequency }}'"
Expand Down
21 changes: 14 additions & 7 deletions resources/views/partials/form/select_add_new_group.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,19 @@ class="{{ $col }}{{ isset($attributes['required']) ? ' required' : '' }}{{ isset
:form-classes="[{'has-error': form.errors.get('{{ $name }}') }]"
@endif

:icon="'{{ $icon }}'"
:title="'{{ $text }}'"
:placeholder="'{{ trans('general.form.select.field', ['field' => $text]) }}'"
:name="'{{ $name }}'"
icon="{{ $icon }}"
title="{{ $text }}"
placeholder="{{ trans('general.form.select.field', ['field' => $text]) }}"
name="{{ $name }}"
:options="{{ json_encode($values) }}"
:value="'{{ old($name, $selected) }}'"

@if(old($name, $selected))
value="{{ old($name, $selected) }}"
@endif

@if (!empty($attributes['model']))
:model="{{ $attributes['model'] }}"
@endif

:add-new="{{ json_encode([
'status' => true,
Expand Down Expand Up @@ -62,8 +69,8 @@ class="{{ $col }}{{ isset($attributes['required']) ? ' required' : '' }}{{ isset
:form-error="form.errors.get('{{ $name }}')"
@endif

:no-data-text="'{{ trans('general.no_data') }}'"
:no-matching-data-text="'{{ trans('general.no_matching_data') }}'"
no-data-text="{{ trans('general.no_data') }}"
no-matching-data-text="{{ trans('general.no_matching_data') }}"
></akaunting-select>

@stack($name . '_input_end')
21 changes: 14 additions & 7 deletions resources/views/partials/form/select_group.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,19 @@ class="{{ $col }}{{ isset($attributes['required']) ? ' required' : '' }}{{ isset
:form-classes="[{'has-error': form.errors.get('{{ $name }}') }]"
@endif

:icon="'{{ $icon }}'"
:title="'{{ $text }}'"
:placeholder="'{{ trans('general.form.select.field', ['field' => $text]) }}'"
:name="'{{ $name }}'"
icon="{{ $icon }}"
title="{{ $text }}"
placeholder="{{ trans('general.form.select.field', ['field' => $text]) }}"
name="{{ $name }}"
:options="{{ json_encode($values) }}"
:value="'{{ old($name, $selected) }}'"

@if(old($name, $selected))
value="{{ old($name, $selected) }}"
@endif

@if (!empty($attributes['model']))
:model="{{ $attributes['model'] }}"
@endif

@if (!empty($attributes['v-model']))
@interface="{{ $attributes['v-model'] . ' = $event' }}"
Expand Down Expand Up @@ -42,8 +49,8 @@ class="{{ $col }}{{ isset($attributes['required']) ? ' required' : '' }}{{ isset
:form-error="form.errors.get('{{ $name }}')"
@endif

:no-data-text="'{{ trans('general.no_data') }}'"
:no-matching-data-text="'{{ trans('general.no_matching_data') }}'"
no-data-text="{{ trans('general.no_data') }}"
no-matching-data-text="{{ trans('general.no_matching_data') }}"
></akaunting-select>

@stack($name . '_input_end')
22 changes: 15 additions & 7 deletions resources/views/partials/form/select_group_add_new_group.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,19 @@ class="{{ $col }}{{ isset($attributes['required']) ? ' required' : '' }}{{ isset
:form-classes="[{'has-error': form.errors.get('{{ $name }}') }]"
@endif

:icon="'{{ $icon }}'"
:title="'{{ $text }}'"
:placeholder="'{{ trans('general.form.select.field', ['field' => $text]) }}'"
:name="'{{ $name }}'"
icon="{{ $icon }}"
title="{{ $text }}"
placeholder="{{ trans('general.form.select.field', ['field' => $text]) }}"
name="{{ $name }}"
:options="{{ json_encode($values) }}"
:value="'{{ old($name, $selected) }}'"

@if(old($name, $selected))
value="{{ old($name, $selected) }}"
@endif

@if (!empty($attributes['model']))
:model="{{ $attributes['model'] }}"
@endif

:add-new="{{ json_encode([
'status' => true,
Expand All @@ -35,6 +42,7 @@ class="{{ $col }}{{ isset($attributes['required']) ? ' required' : '' }}{{ isset
]
]
])}}"

:group="true"

@if (!empty($attributes['v-model']))
Expand Down Expand Up @@ -63,8 +71,8 @@ class="{{ $col }}{{ isset($attributes['required']) ? ' required' : '' }}{{ isset
:form-error="form.errors.get('{{ $name }}')"
@endif

:no-data-text="'{{ trans('general.no_data') }}'"
:no-matching-data-text="'{{ trans('general.no_matching_data') }}'"
no-data-text="{{ trans('general.no_data') }}"
no-matching-data-text="{{ trans('general.no_matching_data') }}"
></akaunting-select>

@stack($name . '_input_end')
21 changes: 14 additions & 7 deletions resources/views/partials/form/select_group_group.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,19 @@ class="{{ $col }}{{ isset($attributes['required']) ? ' required' : '' }}{{ isset
:form-classes="[{'has-error': form.errors.get('{{ $name }}') }]"
@endif

:icon="'{{ $icon }}'"
:title="'{{ $text }}'"
:placeholder="'{{ trans('general.form.select.field', ['field' => $text]) }}'"
:name="'{{ $name }}'"
icon="{{ $icon }}"
title="{{ $text }}"
placeholder="{{ trans('general.form.select.field', ['field' => $text]) }}"
name="{{ $name }}"
:options="{{ json_encode($values) }}"
:value="'{{ old($name, $selected) }}'"

@if(old($name, $selected))
value="{{ old($name, $selected) }}"
@endif

@if (!empty($attributes['model']))
:model="{{ $attributes['model'] }}"
@endif

:group="true"

Expand Down Expand Up @@ -44,8 +51,8 @@ class="{{ $col }}{{ isset($attributes['required']) ? ' required' : '' }}{{ isset
:form-error="form.errors.get('{{ $name }}')"
@endif

:no-data-text="'{{ trans('general.no_data') }}'"
:no-matching-data-text="'{{ trans('general.no_matching_data') }}'"
no-data-text="{{ trans('general.no_data') }}"
no-matching-data-text="{{ trans('general.no_matching_data') }}"
></akaunting-select>

@stack($name . '_input_end')
29 changes: 18 additions & 11 deletions resources/views/partials/form/select_remote_group.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,19 @@ class="{{ $col }}{{ isset($attributes['required']) ? ' required' : '' }}{{ isset
:form-classes="[{'has-error': form.errors.get('{{ $name }}') }]"
@endif

:icon="'{{ $icon }}'"
:title="'{{ $text }}'"
:placeholder="'{{ trans('general.form.select.field', ['field' => $text]) }}'"
:name="'{{ $name }}'"
icon="{{ $icon }}"
title="{{ $text }}"
placeholder="{{ trans('general.form.select.field', ['field' => $text]) }}"
name="{{ $name }}"
:options="{{ json_encode($values) }}"
:value="'{{ old($name, $selected) }}'"

@if(old($name, $selected))
value="{{ old($name, $selected) }}"
@endif

@if (!empty($attributes['model']))
:model="{{ $attributes['model'] }}"
@endif

@if (!empty($attributes['v-model']))
@interface="{{ $attributes['v-model'] . ' = $event' }}"
Expand Down Expand Up @@ -42,13 +49,13 @@ class="{{ $col }}{{ isset($attributes['required']) ? ' required' : '' }}{{ isset
:form-error="form.errors.get('{{ $name }}')"
@endif

:remote-action="'{{ $attributes['remote_action'] }}'"
:remote-type="'{{ $attributes['remote_type'] }}'"
:currency-code="{{ $attributes['currecny_code'] }}"
remote-action="{{ $attributes['remote_action'] }}"
remote-type="'{{ $attributes['remote_type'] }}"
currency-code="{{ $attributes['currecny_code'] }}"

:loading-text="'{{ trans('general.loading') }}'"
:no-data-text="'{{ trans('general.no_data') }}'"
:no-matching-data-text="'{{ trans('general.no_matching_data') }}'"
loading-text="{{ trans('general.loading') }}"
no-data-text="{{ trans('general.no_data') }}"
no-matching-data-text="{{ trans('general.no_matching_data') }}"
></akaunting-select-remote>

@stack($name . '_input_end')
2 changes: 1 addition & 1 deletion resources/views/partials/form/text_editor_group.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class="form-group {{ $col }}{{ isset($attributes['required']) ? ' required' : ''
@endif

<html-editor
:name="'{{ $name }}'"
name="{{ $name }}"

@if (!empty($attributes['v-model']))
:value="{{ $attributes['v-model'] . ' = ' . $value }}"
Expand Down

0 comments on commit aa97e6a

Please sign in to comment.