From 133f9e2e5a5c93e4b5347c4919b6999c5eaf9c99 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Wed, 10 May 2023 12:49:54 +0100 Subject: [PATCH] Refactor on default pt option --- .../lib/basecomponent/BaseComponent.vue | 24 ++- components/lib/config/PrimeVue.d.ts | 165 +++++++++--------- components/lib/ts-helpers.d.ts | 4 +- 3 files changed, 105 insertions(+), 88 deletions(-) diff --git a/components/lib/basecomponent/BaseComponent.vue b/components/lib/basecomponent/BaseComponent.vue index 9e6852891..639711ae0 100644 --- a/components/lib/basecomponent/BaseComponent.vue +++ b/components/lib/basecomponent/BaseComponent.vue @@ -1,5 +1,6 @@ diff --git a/components/lib/config/PrimeVue.d.ts b/components/lib/config/PrimeVue.d.ts index ad029aa56..b96be7d79 100644 --- a/components/lib/config/PrimeVue.d.ts +++ b/components/lib/config/PrimeVue.d.ts @@ -78,6 +78,7 @@ import { ToastPassThroughOptions } from '../toast'; import { ToolbarPassThroughOptions } from '../toolbar'; import { TreePassThroughOptions } from '../tree'; import { TreeSelectPassThroughOptions } from '../treeselect'; +import { DefaultPTOptions } from '../ts-helpers'; import { VirtualScrollerPassThroughOptions } from '../virtualscroller'; interface PrimeVueConfiguration { @@ -97,88 +98,88 @@ interface PrimeVueZIndexOptions { } interface PrimeVuePTOptions { - accordion?: AccordionPassThroughOptions; - accordiontab?: AccordionTabPassThroughOptions; - autocomplete?: AutoCompletePassThroughOptions; - avatar?: AvatarPassThroughOptions; - badge?: BadgePassThroughOptions; - blockui?: BlockUIPassThroughOptions; - breadcrumb?: BreadcrumbPassThroughOptions; - button?: ButtonPassThroughOptions; - calendar?: CalendarPassThroughOptions; - card?: CardPassThroughOptions; - carousel?: CarouselPassThroughOptions; - cascadeselect?: CascadeSelectPassThroughOptions; - chart?: ChartPassThroughOptions; - checkbox?: CheckboxPassThroughOptions; - chip?: ChipPassThroughOptions; - chips?: ChipsPassThroughOptions; - colorpicker?: ColorPickerPassThroughOptions; - columngroup?: ColumnGroupPassThroughOptions; - confirmdialog?: ConfirmDialogPassThroughOptions; - confirmpopup?: ConfirmPopupPassThroughOptions; - contextmenu?: ContextMenuPassThroughOptions; - datatable?: DataTablePassThroughOptions; - dataview?: DataViewPassThroughOptions; - dataviewlayoutoptions?: DataViewLayoutOptionsPassThroughOptions; - deferredcontent?: DeferredContentPassThroughOptions; - divider?: DividerPassThroughOptions; - dialog?: DialogPassThroughOptions; - dock?: DockPassThroughOptions; - dropdown?: DropdownPassThroughOptions; - dynamicdialog?: DialogPassThroughOptions; - editor?: EditorPassThroughOptions; - fieldset?: FieldsetPassThroughOptions; - fileupload?: FileUploadPassThroughOptions; - galleria?: GalleriaPassThroughOptions; - image?: ImagePassThroughOptions; - inlinemessage?: InlineMessagePassThroughOptions; - inplace?: InplacePassThroughOptions; - inputmask?: InputMaskPassThroughOptions; - inputnumber?: InputNumberPassThroughOptions; - inputswitch?: InputSwitchPassThroughOptions; - inputtext?: InputTextPassThroughOptions; - knob?: KnobPassThroughOptions; - listbox?: ListboxPassThroughOptions; - megamenu?: MegaMenuPassThroughOptions; - menu?: MenuPassThroughOptions; - menubar?: MenubarPassThroughOptions; - message?: MessagePassThroughOptions; - multiselect?: MultiSelectPassThroughOptions; - orderlist?: OrderListPassThroughOptions; - organizationchart?: OrganizationChartPassThroughOptions; - overlaypanel?: OverlayPanelPassThroughOptions; - paginator?: PaginatorPassThroughOptions; - panel?: PanelPassThroughOptions; - panelmenu?: PanelMenuPassThroughOptions; - password?: PasswordPassThroughOptions; - picklist?: PickListPassThroughOptions; - progressbar?: ProgressBarPassThroughOptions; - progressspinner?: ProgressSpinnerPassThroughOptions; - radiobutton?: RadioButtonPassThroughOptions; - row?: RowPassThroughOptions; - scrollpanel?: ScrollPanelPassThroughOptions; - scrolltop?: ScrollTopPassThroughOptions; - sidebar?: SidebarPassThroughOptions; - skeleton?: SkeletonPassThroughOptions; - speeddial?: SpeedDialPassThroughOptions; - selectbutton?: SelectButtonPassThroughOptions; - splitbutton?: SplitButtonPassThroughOptions; - splitter?: SplitterPassThroughOptions; - steps?: PanelMenuPassThroughOptions; - tabmenu?: TabMenuPassThroughOptions; - tabpanel?: TabPanelPassThroughOptions; - tabview?: TabViewPassThroughOptions; - tag?: TagPassThroughOptions; - terminal?: TerminalPassThroughOptions; - textarea?: TextareaPassThroughOptions; - tieredmenu?: TieredMenuPassThroughOptions; - timeline?: TimelinePassThroughOptions; - toast?: ToastPassThroughOptions; - toolbar?: ToolbarPassThroughOptions; - tree?: TreePassThroughOptions; - treeselect?: TreeSelectPassThroughOptions; - virtualscroller?: VirtualScrollerPassThroughOptions; + accordion?: DefaultPTOptions; + accordiontab?: DefaultPTOptions; + autocomplete?: DefaultPTOptions; + avatar?: DefaultPTOptions; + badge?: DefaultPTOptions; + blockui?: DefaultPTOptions; + breadcrumb?: DefaultPTOptions; + button?: DefaultPTOptions; + calendar?: DefaultPTOptions; + card?: DefaultPTOptions; + carousel?: DefaultPTOptions; + cascadeselect?: DefaultPTOptions; + chart?: DefaultPTOptions; + checkbox?: DefaultPTOptions; + chip?: DefaultPTOptions; + chips?: DefaultPTOptions; + colorpicker?: DefaultPTOptions; + columngroup?: DefaultPTOptions; + confirmdialog?: DefaultPTOptions; + confirmpopup?: DefaultPTOptions; + contextmenu?: DefaultPTOptions; + datatable?: DefaultPTOptions; + dataview?: DefaultPTOptions; + dataviewlayoutoptions?: DefaultPTOptions; + deferredcontent?: DefaultPTOptions; + divider?: DefaultPTOptions; + dialog?: DefaultPTOptions; + dock?: DefaultPTOptions; + dropdown?: DefaultPTOptions; + dynamicdialog?: DefaultPTOptions; + editor?: DefaultPTOptions; + fieldset?: DefaultPTOptions; + fileupload?: DefaultPTOptions; + galleria?: DefaultPTOptions; + image?: DefaultPTOptions; + inlinemessage?: DefaultPTOptions; + inplace?: DefaultPTOptions; + inputmask?: DefaultPTOptions; + inputnumber?: DefaultPTOptions; + inputswitch?: DefaultPTOptions; + inputtext?: DefaultPTOptions; + knob?: DefaultPTOptions; + listbox?: DefaultPTOptions; + megamenu?: DefaultPTOptions; + menu?: DefaultPTOptions; + menubar?: DefaultPTOptions; + message?: DefaultPTOptions; + multiselect?: DefaultPTOptions; + orderlist?: DefaultPTOptions; + organizationchart?: DefaultPTOptions; + overlaypanel?: DefaultPTOptions; + paginator?: DefaultPTOptions; + panel?: DefaultPTOptions; + panelmenu?: DefaultPTOptions; + password?: DefaultPTOptions; + picklist?: DefaultPTOptions; + progressbar?: DefaultPTOptions; + progressspinner?: DefaultPTOptions; + radiobutton?: DefaultPTOptions; + row?: DefaultPTOptions; + scrollpanel?: DefaultPTOptions; + scrolltop?: DefaultPTOptions; + sidebar?: DefaultPTOptions; + skeleton?: DefaultPTOptions; + speeddial?: DefaultPTOptions; + selectbutton?: DefaultPTOptions; + splitbutton?: DefaultPTOptions; + splitter?: DefaultPTOptions; + steps?: DefaultPTOptions; + tabmenu?: DefaultPTOptions; + tabpanel?: DefaultPTOptions; + tabview?: DefaultPTOptions; + tag?: DefaultPTOptions; + terminal?: DefaultPTOptions; + textarea?: DefaultPTOptions; + tieredmenu?: DefaultPTOptions; + timeline?: DefaultPTOptions; + toast?: DefaultPTOptions; + toolbar?: DefaultPTOptions; + tree?: DefaultPTOptions; + treeselect?: DefaultPTOptions; + virtualscroller?: DefaultPTOptions; } interface PrimeVueLocaleAriaOptions { diff --git a/components/lib/ts-helpers.d.ts b/components/lib/ts-helpers.d.ts index 4c407beed..a2e9f13b9 100644 --- a/components/lib/ts-helpers.d.ts +++ b/components/lib/ts-helpers.d.ts @@ -1,4 +1,4 @@ -import { AllowedComponentProps, ComponentCustomProps, ObjectEmitsOptions, VNodeProps } from 'vue'; +import { AllowedComponentProps, ComponentCustomProps, ObjectEmitsOptions, VNode, VNodeProps } from 'vue'; declare type PublicProps = VNodeProps & AllowedComponentProps & ComponentCustomProps; @@ -32,3 +32,5 @@ export declare type Booleanish = boolean | 'true' | 'false'; export declare type Numberish = number | string; export declare type Nullable = T | null | undefined; + +export declare type DefaultPTOptions = T | ((instance?: VNode) => T | undefined) | undefined;