From 43cbffe56a108a3345a9b199fe8cd69d15dc2dc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Tue, 11 Oct 2022 09:20:37 +0300 Subject: [PATCH] typo --- .../assets/js/components/AkauntingSelect.vue | 32 ++++++++++--------- .../js/components/AkauntingSelectRemote.vue | 30 +++++++++-------- .../components/form/group/select.blade.php | 8 ++--- 3 files changed, 37 insertions(+), 33 deletions(-) diff --git a/resources/assets/js/components/AkauntingSelect.vue b/resources/assets/js/components/AkauntingSelect.vue index 2fa5c21a0..41321fac4 100644 --- a/resources/assets/js/components/AkauntingSelect.vue +++ b/resources/assets/js/components/AkauntingSelect.vue @@ -300,7 +300,7 @@ export default { description: "Selectbox input search placeholder text" }, - dynamicOptionsValueCheck: { + forceDynamicOptionValue: { type: [Boolean, String], default: false, }, @@ -871,25 +871,27 @@ export default { }, dynamicOptionsValue(options) { - if (this.dynamicOptionsValueCheck) { + if (! this.forceDynamicOptionValue) { if (this.multiple) { - let selected = this.selected; this.selected = []; - - selected.forEach(function (select, index) { - if (this.sorted_options.find((option) => option.key == select)) { - this.selected.push(select); - } - }, this); } else { - if (!options.find((option) => option == this.selected)) { - this.selected = null; - } + this.selected = null; } + + return; + } + + if (this.multiple) { + let selected = this.selected; + this.selected = []; + + selected.forEach(function (select, index) { + if (this.sorted_options.find((option) => option.key == select)) { + this.selected.push(select); + } + }, this); } else { - if (this.multiple) { - this.selected = []; - } else { + if (! options.find((option) => option == this.selected)) { this.selected = null; } } diff --git a/resources/assets/js/components/AkauntingSelectRemote.vue b/resources/assets/js/components/AkauntingSelectRemote.vue index c2c5f23d5..f7a73337d 100644 --- a/resources/assets/js/components/AkauntingSelectRemote.vue +++ b/resources/assets/js/components/AkauntingSelectRemote.vue @@ -1090,25 +1090,27 @@ export default { }, dynamicOptionsValue(options) { - if (this.dynamicOptionsValueCheck) { + if (! this.forceDynamicOptionValue) { if (this.multiple) { - let selected = this.selected; this.selected = []; - - selected.forEach(function (select, index) { - if (this.sorted_options.find((option) => option.key == select)) { - this.selected.push(select); - } - }, this); } else { - if (!options.find((option) => option == this.selected)) { - this.selected = null; - } + this.selected = null; } + + return; + } + + if (this.multiple) { + let selected = this.selected; + this.selected = []; + + selected.forEach(function (select, index) { + if (this.sorted_options.find((option) => option.key == select)) { + this.selected.push(select); + } + }, this); } else { - if (this.multiple) { - this.selected = []; - } else { + if (! options.find((option) => option == this.selected)) { this.selected = null; } } diff --git a/resources/views/components/form/group/select.blade.php b/resources/views/components/form/group/select.blade.php index 52460a915..f77ae8b03 100644 --- a/resources/views/components/form/group/select.blade.php +++ b/resources/views/components/form/group/select.blade.php @@ -65,10 +65,10 @@ search-text="{{ $searchText }}" @endif - @if (! empty($attributes['dynamic-options-value-check'])) - dynamic-options-value-check - @elseif (! empty($dynamicOptionsValueCheck)) - dynamic-options-value-check + @if (! empty($attributes['force-dynamic-option-value'])) + force-dynamic-option-value + @elseif (! empty($forceDynamicOptionValue)) + force-dynamic-option-value @endif @if (empty($multiple))