From b4d07f01766212f633723b95cd20f7b446b81fa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Thu, 6 Jul 2023 15:13:28 +0300 Subject: [PATCH] Refactor #3965 - Refactor on class implementation --- components/lib/calendar/BaseCalendar.vue | 1 - components/lib/calendar/Calendar.vue | 2 +- components/lib/message/BaseMessage.vue | 4 ++-- components/lib/message/Message.vue | 6 +++--- components/lib/speeddial/BaseSpeedDial.vue | 1 - components/lib/speeddial/SpeedDial.vue | 2 +- components/lib/toast/BaseToast.vue | 5 ++--- components/lib/toast/Toast.vue | 1 - components/lib/toast/ToastMessage.vue | 4 ++-- components/lib/togglebutton/BaseToggleButton.vue | 1 - components/lib/togglebutton/ToggleButton.vue | 2 +- 11 files changed, 12 insertions(+), 17 deletions(-) diff --git a/components/lib/calendar/BaseCalendar.vue b/components/lib/calendar/BaseCalendar.vue index 17354f390..910fcfd04 100644 --- a/components/lib/calendar/BaseCalendar.vue +++ b/components/lib/calendar/BaseCalendar.vue @@ -169,7 +169,6 @@ const classes = { dropdownButton: 'p-datepicker-trigger', panel: ({ instance, props, state }) => [ 'p-datepicker p-component', - props.panelClass, { 'p-datepicker-inline': props.inline, 'p-disabled': props.disabled, diff --git a/components/lib/calendar/Calendar.vue b/components/lib/calendar/Calendar.vue index 2d6624dd7..e261c13e8 100755 --- a/components/lib/calendar/Calendar.vue +++ b/components/lib/calendar/Calendar.vue @@ -53,7 +53,7 @@ v-if="inline || overlayVisible" :ref="overlayRef" :id="panelId" - :class="cx('panel')" + :class="[cx('panel'), panelClass]" :style="panelStyle" :role="inline ? null : 'dialog'" :aria-modal="inline ? null : 'true'" diff --git a/components/lib/message/BaseMessage.vue b/components/lib/message/BaseMessage.vue index 797f4584e..75ef557b3 100644 --- a/components/lib/message/BaseMessage.vue +++ b/components/lib/message/BaseMessage.vue @@ -51,10 +51,10 @@ const styles = ` const classes = { root: ({ props }) => 'p-message p-component p-message-' + props.severity, wrapper: 'p-message-wrapper', - icon: ({ props }) => ['p-message-icon', props.icon], + icon: 'p-message-icon', text: 'p-message-text', button: 'p-message-close p-link', - buttonIcon: ({ props }) => ['p-message-close-icon', props.closeIcon] + buttonIcon: 'p-message-close-icon' }; const { load: loadStyle } = useStyle(styles, { name: 'message', manual: true }); diff --git a/components/lib/message/Message.vue b/components/lib/message/Message.vue index 679d6273d..afed7cb26 100755 --- a/components/lib/message/Message.vue +++ b/components/lib/message/Message.vue @@ -3,15 +3,15 @@
- +
diff --git a/components/lib/speeddial/BaseSpeedDial.vue b/components/lib/speeddial/BaseSpeedDial.vue index 1dade5846..6b7f34525 100644 --- a/components/lib/speeddial/BaseSpeedDial.vue +++ b/components/lib/speeddial/BaseSpeedDial.vue @@ -133,7 +133,6 @@ const classes = { 'p-speeddial-rotate': props.rotateAnimation && !props.hideIcon } ], - buttonIcon: ({ instance, props }) => (instance.d_visible && !!props.hideIcon ? props.hideIcon : props.showIcon), menu: 'p-speeddial-list', menuitem: ({ instance, id }) => [ 'p-speeddial-item', diff --git a/components/lib/speeddial/SpeedDial.vue b/components/lib/speeddial/SpeedDial.vue index ee89f5051..f895ba05d 100644 --- a/components/lib/speeddial/SpeedDial.vue +++ b/components/lib/speeddial/SpeedDial.vue @@ -18,7 +18,7 @@ diff --git a/components/lib/toast/BaseToast.vue b/components/lib/toast/BaseToast.vue index f840f88ac..2ffcfbcac 100644 --- a/components/lib/toast/BaseToast.vue +++ b/components/lib/toast/BaseToast.vue @@ -108,7 +108,6 @@ const classes = { ], container: ({ props }) => [ 'p-toast-message', - props.message.styleClass, { 'p-toast-message-info': props.message.severity === 'info' || props.message.severity === undefined, 'p-toast-message-warn': props.message.severity === 'warn', @@ -116,7 +115,7 @@ const classes = { 'p-toast-message-success': props.message.severity === 'success' } ], - content: ({ props }) => `p-toast-message-content ${props.message.contentStyleClass || ''}`, + content: 'p-toast-message-content', icon: ({ props }) => [ 'p-toast-message-icon', { @@ -130,7 +129,7 @@ const classes = { summary: 'p-toast-summary', detail: 'p-toast-detail', button: 'p-toast-icon-close p-link', - buttonIcon: ({ props }) => ['p-toast-icon-close-icon', props.closeIcon] + buttonIcon: 'p-toast-icon-close-icon' }; const { load: loadStyle } = useStyle(styles, { name: 'toast', manual: true }); diff --git a/components/lib/toast/Toast.vue b/components/lib/toast/Toast.vue index 705a6ef8f..c88fc59e9 100755 --- a/components/lib/toast/Toast.vue +++ b/components/lib/toast/Toast.vue @@ -35,7 +35,6 @@ export default { extends: BaseToast, inheritAttrs: false, emits: ['close', 'life-end'], - data() { return { messages: [] diff --git a/components/lib/toast/ToastMessage.vue b/components/lib/toast/ToastMessage.vue index eac7052fe..b7d1a8bc6 100755 --- a/components/lib/toast/ToastMessage.vue +++ b/components/lib/toast/ToastMessage.vue @@ -1,6 +1,6 @@