From dd07a0544b86e2b9003c48388700834b46f02357 Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Tue, 26 Mar 2024 13:25:08 +0300 Subject: [PATCH 1/6] Refactor #5426 - For SelectButton --- components/lib/selectbutton/SelectButton.d.ts | 15 +++++----- components/lib/selectbutton/SelectButton.vue | 29 +++++++++---------- components/lib/togglebutton/ToggleButton.d.ts | 18 +++++++----- components/lib/togglebutton/ToggleButton.vue | 8 +++-- 4 files changed, 37 insertions(+), 33 deletions(-) diff --git a/components/lib/selectbutton/SelectButton.d.ts b/components/lib/selectbutton/SelectButton.d.ts index 1fff8e668..c8634b4b9 100755 --- a/components/lib/selectbutton/SelectButton.d.ts +++ b/components/lib/selectbutton/SelectButton.d.ts @@ -10,14 +10,15 @@ import { VNode } from 'vue'; import { ComponentHooks } from '../basecomponent'; import { PassThroughOptions } from '../passthrough'; +// import { ToggleButtonPassThroughOptions } from '../togglebutton'; import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; -export declare type SelectButtonPassThroughOptionType = SelectButtonPassThroughAttributes | ((options: SelectButtonPassThroughMethodOptions) => SelectButtonPassThroughAttributes | string) | string | null | undefined; +export declare type SelectButtonPassThroughOptionType = SelectButtonPassThroughAttributes | ((options: SelectButtonPassThroughMethodOptions) => SelectButtonPassThroughAttributes | string) | string | null | undefined; /** * Custom passthrough(pt) option method. */ -export interface SelectButtonPassThroughMethodOptions { +export interface SelectButtonPassThroughMethodOptions { /** * Defines instance. */ @@ -41,7 +42,7 @@ export interface SelectButtonPassThroughMethodOptions { /** * Defines parent options. */ - parent: T; + parent: any; /** * Defines passthrough(pt) options in global config. */ @@ -52,19 +53,19 @@ export interface SelectButtonPassThroughMethodOptions { * Custom passthrough(pt) options. * @see {@link SelectButtonProps.pt} */ -export interface SelectButtonPassThroughOptions { +export interface SelectButtonPassThroughOptions { /** * Used to pass attributes to the root's DOM element. */ - root?: SelectButtonPassThroughOptionType; + root?: SelectButtonPassThroughOptionType; /** * Used to pass attributes to the button's DOM element. */ - button?: SelectButtonPassThroughOptionType; + button?: SelectButtonPassThroughOptionType; /** * Used to pass attributes to the label's DOM element. */ - label?: SelectButtonPassThroughOptionType; + label?: SelectButtonPassThroughOptionType; /** * Used to manage all lifecycle hooks. * @see {@link BaseComponent.ComponentHooks} diff --git a/components/lib/selectbutton/SelectButton.vue b/components/lib/selectbutton/SelectButton.vue index 7fb32a845..ddcbf447f 100755 --- a/components/lib/selectbutton/SelectButton.vue +++ b/components/lib/selectbutton/SelectButton.vue @@ -1,26 +1,20 @@ diff --git a/components/lib/togglebutton/ToggleButton.d.ts b/components/lib/togglebutton/ToggleButton.d.ts index 83af8dd9f..0dcb68d1d 100755 --- a/components/lib/togglebutton/ToggleButton.d.ts +++ b/components/lib/togglebutton/ToggleButton.d.ts @@ -12,12 +12,12 @@ import { ComponentHooks } from '../basecomponent'; import { PassThroughOptions } from '../passthrough'; import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; -export declare type ToggleButtonPassThroughOptionType = ToggleButtonPassThroughAttributes | ((options: ToggleButtonPassThroughMethodOptions) => ToggleButtonPassThroughAttributes | string) | string | null | undefined; +export declare type ToggleButtonPassThroughOptionType = ToggleButtonPassThroughAttributes | ((options: ToggleButtonPassThroughMethodOptions) => ToggleButtonPassThroughAttributes | string) | string | null | undefined; /** * Custom passthrough(pt) option method. */ -export interface ToggleButtonPassThroughMethodOptions { +export interface ToggleButtonPassThroughMethodOptions { /** * Defines instance. */ @@ -37,7 +37,7 @@ export interface ToggleButtonPassThroughMethodOptions { /** * Defines parent options. */ - parent: any; + parent: T; /** * Defines passthrough(pt) options in global config. */ @@ -48,19 +48,19 @@ export interface ToggleButtonPassThroughMethodOptions { * Custom passthrough(pt) options. * @see {@link ToggleButtonProps.pt} */ -export interface ToggleButtonPassThroughOptions { +export interface ToggleButtonPassThroughOptions { /** * Used to pass attributes to the root's DOM element. */ - root?: ToggleButtonPassThroughOptionType; + root?: ToggleButtonPassThroughOptionType; /** * Used to pass attributes to the icon's DOM element. */ - icon?: ToggleButtonPassThroughOptionType; + icon?: ToggleButtonPassThroughOptionType; /** * Used to pass attributes to the label's DOM element. */ - label?: ToggleButtonPassThroughOptionType; + label?: ToggleButtonPassThroughOptionType; /** * Used to manage all lifecycle hooks. * @see {@link BaseComponent.ComponentHooks} @@ -173,6 +173,10 @@ export interface ToggleButtonProps { * Defines valid slots in ToggleButton component. */ export interface ToggleButtonSlots { + /** + * Custom content such as icons, images and text can be placed inside the button via the default slot. + */ + default(): VNode[]; /** * Custom icon template. * @param {Object} scope - icon slot's params. diff --git a/components/lib/togglebutton/ToggleButton.vue b/components/lib/togglebutton/ToggleButton.vue index e7436896c..0d091f5fd 100755 --- a/components/lib/togglebutton/ToggleButton.vue +++ b/components/lib/togglebutton/ToggleButton.vue @@ -1,9 +1,11 @@ From fc947d61fa5e87ac9c3c0d75c16eb9f2e769d4fb Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Tue, 26 Mar 2024 13:26:15 +0300 Subject: [PATCH 2/6] Update rollup and nuxt alias --- nuxt-vite.config.js | 1 + rollup.config.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/nuxt-vite.config.js b/nuxt-vite.config.js index 56b71b153..b46ebfafc 100644 --- a/nuxt-vite.config.js +++ b/nuxt-vite.config.js @@ -297,6 +297,7 @@ export default { 'primevue/tree': path.resolve(__dirname, './components/lib/tree/Tree.vue'), 'primevue/badge': path.resolve(__dirname, './components/lib/badge/Badge.vue'), 'primevue/selectbutton': path.resolve(__dirname, './components/lib/selectbutton/SelectButton.vue'), + 'primevue/togglebutton': path.resolve(__dirname, './components/lib/togglebutton/ToggleButton.vue'), 'primevue/listbox': path.resolve(__dirname, './components/lib/listbox/Listbox.vue'), 'primevue/confirmationeventbus': path.resolve(__dirname, './components/lib/confirmationeventbus/ConfirmationEventBus.js'), 'primevue/toasteventbus': path.resolve(__dirname, './components/lib/toasteventbus/ToastEventBus.js'), diff --git a/rollup.config.js b/rollup.config.js index 89c5fd766..32869dd4b 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -213,6 +213,8 @@ const CORE_DEPENDENCIES = { 'primevue/menu': 'primevue.menu', 'primevue/tieredmenu': 'primevue.tieredmenu', 'primevue/badge': 'primevue.badge', + 'primevue/listbox': 'primevue.listbox', + 'primevue/togglebutton': 'primevue.togglebutton', ...CORE_PASSTHROUGH_DEPENDENCIES }; From bb51b40051a0ddc2a941e49b25fd7235ba7ab31a Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Tue, 26 Mar 2024 13:31:15 +0300 Subject: [PATCH 3/6] Add Listbox header and remove from OrderList/PickList --- components/lib/listbox/Listbox.vue | 4 +++- components/lib/orderlist/OrderList.d.ts | 4 ---- components/lib/orderlist/OrderList.vue | 4 +--- components/lib/orderlist/style/OrderListStyle.js | 1 - components/lib/picklist/PickList.d.ts | 8 -------- components/lib/picklist/PickList.vue | 8 ++------ components/lib/picklist/style/PickListStyle.js | 2 -- 7 files changed, 6 insertions(+), 25 deletions(-) diff --git a/components/lib/listbox/Listbox.vue b/components/lib/listbox/Listbox.vue index 8e4097919..0ddc11d9b 100755 --- a/components/lib/listbox/Listbox.vue +++ b/components/lib/listbox/Listbox.vue @@ -11,7 +11,9 @@ :data-p-hidden-accessible="true" :data-p-hidden-focusable="true" > - +
+ +