From 714d3395493ff3d9b8764f6c93af637beefb959e Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Wed, 12 May 2021 12:13:50 +0300 Subject: [PATCH] Fixed #1248 - InputStyle and Ripple config do not work on components that are attached to body --- src/App.vue | 2 +- src/AppInputStyleSwitch.vue | 4 +-- src/components/autocomplete/AutoComplete.vue | 6 +++- src/components/calendar/Calendar.vue | 21 ++++++------ .../cascadeselect/CascadeSelect.vue | 5 ++- src/components/colorpicker/ColorPicker.vue | 6 +++- src/components/config/PrimeVue.d.ts | 1 + src/components/config/PrimeVue.js | 1 + src/components/confirmpopup/ConfirmPopup.vue | 8 ++++- src/components/contextmenu/ContextMenu.vue | 10 +++++- src/components/datatable/ColumnFilter.vue | 17 ++++++---- src/components/dialog/Dialog.vue | 4 ++- src/components/dropdown/Dropdown.vue | 5 ++- src/components/galleria/Galleria.vue | 5 ++- src/components/menu/Menu.vue | 4 ++- src/components/multiselect/MultiSelect.vue | 33 +++++++++---------- src/components/overlaypanel/OverlayPanel.vue | 8 ++++- src/components/password/Password.vue | 5 ++- src/components/sidebar/Sidebar.vue | 4 ++- src/components/tieredmenu/TieredMenu.vue | 4 ++- src/components/toast/Toast.vue | 5 ++- src/components/treeselect/TreeSelect.vue | 5 ++- src/main.js | 2 +- src/views/setup/Setup.vue | 15 +++++++++ 24 files changed, 125 insertions(+), 55 deletions(-) diff --git a/src/App.vue b/src/App.vue index 89a17d8ec..cc5ca25d2 100755 --- a/src/App.vue +++ b/src/App.vue @@ -157,7 +157,7 @@ export default { containerClass() { return [{ 'layout-news-active': this.newsActive, - 'p-input-filled': this.$appState.inputStyle === 'filled', + 'p-input-filled': this.$primevue.config.inputStyle === 'filled', 'p-ripple-disabled': this.$primevue.config.ripple === false }]; } diff --git a/src/AppInputStyleSwitch.vue b/src/AppInputStyleSwitch.vue index 9d9025f56..a632a9c4d 100644 --- a/src/AppInputStyleSwitch.vue +++ b/src/AppInputStyleSwitch.vue @@ -18,12 +18,12 @@ export default { methods: { onChange(value) { - this.$appState.inputStyle = value; + this.$primevue.config.inputStyle = value; } }, computed: { value() { - return this.$appState.inputStyle; + return this.$primevue.config.inputStyle; } } }; diff --git a/src/components/autocomplete/AutoComplete.vue b/src/components/autocomplete/AutoComplete.vue index 31a358208..39f7ce5fe 100755 --- a/src/components/autocomplete/AutoComplete.vue +++ b/src/components/autocomplete/AutoComplete.vue @@ -543,7 +543,11 @@ export default { }]; }, panelStyleClass() { - return ['p-autocomplete-panel p-component', this.panelClass]; + return [ + 'p-autocomplete-panel p-component', this.panelClass, { + 'p-input-filled': this.$primevue.config.inputStyle === 'filled', + 'p-ripple-disabled': this.$primevue.config.ripple === false + }]; }, inputValue() { if (this.modelValue) { diff --git a/src/components/calendar/Calendar.vue b/src/components/calendar/Calendar.vue index 699e4e23a..f91d317f2 100755 --- a/src/components/calendar/Calendar.vue +++ b/src/components/calendar/Calendar.vue @@ -2011,17 +2011,16 @@ export default { ]; }, panelStyleClass() { - return [ - 'p-datepicker p-component', this.panelClass, - { - 'p-datepicker-inline': this.inline, - 'p-disabled': this.$attrs.disabled, - 'p-datepicker-timeonly': this.timeOnly, - 'p-datepicker-multiple-month': this.numberOfMonths > 1, - 'p-datepicker-monthpicker': (this.view === 'month'), - 'p-datepicker-touch-ui': this.touchUI - } - ]; + return ['p-datepicker p-component', this.panelClass, { + 'p-datepicker-inline': this.inline, + 'p-disabled': this.$attrs.disabled, + 'p-datepicker-timeonly': this.timeOnly, + 'p-datepicker-multiple-month': this.numberOfMonths > 1, + 'p-datepicker-monthpicker': (this.view === 'month'), + 'p-datepicker-touch-ui': this.touchUI, + 'p-input-filled': this.$primevue.config.inputStyle === 'filled', + 'p-ripple-disabled': this.$primevue.config.ripple === false + }]; }, months() { let months = []; diff --git a/src/components/cascadeselect/CascadeSelect.vue b/src/components/cascadeselect/CascadeSelect.vue index 6d5ab8dcb..a16c89221 100644 --- a/src/components/cascadeselect/CascadeSelect.vue +++ b/src/components/cascadeselect/CascadeSelect.vue @@ -308,7 +308,10 @@ export default { return this.placeholder||'p-emptylabel'; }, panelStyleClass() { - return ['p-cascadeselect-panel p-component', this.panelClass]; + return ['p-cascadeselect-panel p-component', this.panelClass, { + 'p-input-filled': this.$primevue.config.inputStyle === 'filled', + 'p-ripple-disabled': this.$primevue.config.ripple === false + }]; }, appendDisabled() { return this.appendTo === 'self'; diff --git a/src/components/colorpicker/ColorPicker.vue b/src/components/colorpicker/ColorPicker.vue index 32b5927e2..b2a1bb490 100755 --- a/src/components/colorpicker/ColorPicker.vue +++ b/src/components/colorpicker/ColorPicker.vue @@ -570,7 +570,11 @@ export default { return ['p-colorpicker-preview p-inputtext', {'p-disabled': this.disabled}]; }, pickerClass() { - return ['p-colorpicker-panel', this.panelClass, {'p-colorpicker-overlay-panel': !this.inline, 'p-disabled': this.disabled}]; + return ['p-colorpicker-panel', this.panelClass, { + 'p-colorpicker-overlay-panel': !this.inline, 'p-disabled': this.disabled, + 'p-input-filled': this.$primevue.config.inputStyle === 'filled', + 'p-ripple-disabled': this.$primevue.config.ripple === false + }]; }, appendDisabled() { return this.appendTo === 'self' || this.inline; diff --git a/src/components/config/PrimeVue.d.ts b/src/components/config/PrimeVue.d.ts index e433d3fe4..94eb4cdc2 100644 --- a/src/components/config/PrimeVue.d.ts +++ b/src/components/config/PrimeVue.d.ts @@ -2,6 +2,7 @@ import Vue, { Plugin } from 'vue'; interface PrimeVueConfiguration { ripple?: boolean; + inputStyle?: string; locale?: PrimeVueLocaleOptions; } diff --git a/src/components/config/PrimeVue.js b/src/components/config/PrimeVue.js index fcd81b934..d5f750a81 100644 --- a/src/components/config/PrimeVue.js +++ b/src/components/config/PrimeVue.js @@ -3,6 +3,7 @@ import {FilterMatchMode} from 'primevue/api'; const defaultOptions = { ripple: false, + inputStyle: 'outlined', locale: { startsWith: 'Starts with', contains: 'Contains', diff --git a/src/components/confirmpopup/ConfirmPopup.vue b/src/components/confirmpopup/ConfirmPopup.vue index 4cc380c38..60afff97b 100644 --- a/src/components/confirmpopup/ConfirmPopup.vue +++ b/src/components/confirmpopup/ConfirmPopup.vue @@ -1,7 +1,7 @@