From cceb0c3f54b4ecae60911830cc3dfc7d7f5bf5fb Mon Sep 17 00:00:00 2001 From: Luca Haid Date: Wed, 24 Jul 2024 15:04:03 +0000 Subject: [PATCH] Feature/tt table move filter reset --- .../vue/tt-components/tt-autocomplete.js | 2 ++ public/plugins/vue/tt-components/tt-table.js | 29 ++++++++++++++----- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/public/plugins/vue/tt-components/tt-autocomplete.js b/public/plugins/vue/tt-components/tt-autocomplete.js index 099b1ef2a..b214800b5 100644 --- a/public/plugins/vue/tt-components/tt-autocomplete.js +++ b/public/plugins/vue/tt-components/tt-autocomplete.js @@ -11,6 +11,7 @@ Vue.component('tt-autocomplete', { class="form-control" :class="{'form-control-sm': sm}" v-model="displayValue" + :placeholder="placeholder" @input="onInput" @focus="onFocus" @blur="onBlur" @@ -59,6 +60,7 @@ Vue.component('tt-autocomplete', { value: { type: [String, Number] }, label: { type: String, required: false }, apiUrl: String, + placeholder: { type: String, default: '' }, items: { type: Array, default: () => [] }, sm: { type: Boolean, default: true }, row: { type: Boolean, default: false }, diff --git a/public/plugins/vue/tt-components/tt-table.js b/public/plugins/vue/tt-components/tt-table.js index 7e6bfe15a..ca0423d0d 100644 --- a/public/plugins/vue/tt-components/tt-table.js +++ b/public/plugins/vue/tt-components/tt-table.js @@ -65,6 +65,7 @@ Vue.component('tt-table-pagination', {
+ @@ -124,12 +125,6 @@ Vue.component('tt-table', {
- -

{{ config.tableHeader }}

@@ -250,8 +245,23 @@ Vue.component('tt-table', {
`, props: { @@ -383,6 +393,7 @@ Vue.component('tt-table', { } }, saveSettingsToLocalStorage() { if (this.isInitialised === false) return; + if (this.disableFiltering) return; const filters = Object.entries(this.filters).reduce((acc, [key, value]) => { if (!value) { @@ -403,6 +414,8 @@ Vue.component('tt-table', { order: this.order.key ? this.order : undefined, })); }, parseSettingsFromLocalStorage() { + if (this.disableFiltering) return false; + const settings = JSON.parse(localStorage.getItem(`tt-table-${this.config.key}`) || '{}'); if (settings) { this.disableDebounce = true;