Skip to content

Commit

Permalink
Merge pull request #6267 from WatCodeDatCode/fix-6266
Browse files Browse the repository at this point in the history
fix: extend as props to accept component objects
  • Loading branch information
tugcekucukoglu authored Aug 21, 2024
2 parents 6d61522 + 90c672f commit 1e6e9b5
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions packages/primevue/src/accordioncontent/AccordionContent.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import type { DefineComponent, DesignToken, EmitFn, GlobalComponentConstructor, PassThrough } from '@primevue/core';
import type { ComponentHooks } from '@primevue/core/basecomponent';
import type { PassThroughOptions } from 'primevue/passthrough';
import { VNode } from 'vue';
import type { Component, VNode } from 'vue';

export declare type AccordionContentPassThroughOptionType = AccordionContentPassThroughAttributes | ((options: AccordionContentPassThroughMethodOptions) => AccordionContentPassThroughAttributes | string) | string | null | undefined;

Expand Down Expand Up @@ -80,7 +80,7 @@ export interface AccordionContentProps {
* Use to change the HTML tag of root element.
* @defaultValue DIV
*/
as?: string | undefined;
as?: string | Component | undefined;
/**
* When enabled, it changes the default rendered element for the one passed as a child element.
* @defaultValue false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
extends: BaseComponent,
props: {
as: {
type: String,
type: [String, Object],
default: 'DIV'
},
asChild: {
Expand Down
4 changes: 2 additions & 2 deletions packages/primevue/src/accordionheader/AccordionHeader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import type { DefineComponent, DesignToken, EmitFn, GlobalComponentConstructor, PassThrough } from '@primevue/core';
import type { ComponentHooks } from '@primevue/core/basecomponent';
import type { PassThroughOptions } from 'primevue/passthrough';
import { VNode } from 'vue';
import type { Component, VNode } from 'vue';

export declare type AccordionHeaderPassThroughOptionType = AccordionHeaderPassThroughAttributes | ((options: AccordionHeaderPassThroughMethodOptions) => AccordionHeaderPassThroughAttributes | string) | string | null | undefined;

Expand Down Expand Up @@ -76,7 +76,7 @@ export interface AccordionHeaderProps {
* Use to change the HTML tag of root element.
* @defaultValue BUTTON
*/
as?: string | undefined;
as?: string | Component | undefined;
/**
* When enabled, it changes the default rendered element for the one passed as a child element.
* @defaultValue false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
extends: BaseComponent,
props: {
as: {
type: String,
type: [String, Object],
default: 'BUTTON'
},
asChild: {
Expand Down
4 changes: 2 additions & 2 deletions packages/primevue/src/accordionpanel/AccordionPanel.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import type { DefineComponent, DesignToken, EmitFn, GlobalComponentConstructor, PassThrough } from '@primevue/core';
import type { ComponentHooks } from '@primevue/core/basecomponent';
import type { PassThroughOptions } from 'primevue/passthrough';
import { VNode } from 'vue';
import type { Component, VNode } from 'vue';

export declare type AccordionPanelPassThroughOptionType = AccordionPanelPassThroughAttributes | ((options: AccordionPanelPassThroughMethodOptions) => AccordionPanelPassThroughAttributes | string) | string | null | undefined;

Expand Down Expand Up @@ -81,7 +81,7 @@ export interface AccordionPanelProps {
* Use to change the HTML tag of root element.
* @defaultValue DIV
*/
as?: string | undefined;
as?: string | Component | undefined;
/**
* When enabled, it changes the default rendered element for the one passed as a child element.
* @defaultValue false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default {
default: false
},
as: {
type: String,
type: [String, Object],
default: 'DIV'
},
asChild: {
Expand Down
4 changes: 2 additions & 2 deletions packages/primevue/src/button/Button.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import type { DefineComponent, DesignToken, EmitFn, GlobalComponentConstructor, HintedString, PassThrough } from '@primevue/core';
import type { ComponentHooks } from '@primevue/core/basecomponent';
import type { PassThroughOptions } from 'primevue/passthrough';
import { ButtonHTMLAttributes, VNode } from 'vue';
import type { ButtonHTMLAttributes, Component, VNode } from 'vue';

export declare type ButtonPassThroughOptionType<T = any> = ButtonPassThroughAttributes | ((options: ButtonPassThroughMethodOptions<T>) => ButtonPassThroughAttributes | string) | string | null | undefined;

Expand Down Expand Up @@ -133,7 +133,7 @@ export interface ButtonProps extends ButtonHTMLAttributes {
* Use to change the HTML tag of root element.
* @defaultValue BUTTON
*/
as?: string | undefined;
as?: string | Component | undefined;
/**
* When enabled, it changes the default rendered element for the one passed as a child element.
* @defaultValue false
Expand Down
2 changes: 1 addition & 1 deletion packages/primevue/src/step/BaseStep.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default {
default: false
},
as: {
type: String,
type: [String, Object],
default: 'DIV'
}
},
Expand Down
4 changes: 2 additions & 2 deletions packages/primevue/src/step/Step.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import type { DefineComponent, DesignToken, EmitFn, GlobalComponentConstructor, PassThrough } from '@primevue/core';
import type { ComponentHooks } from '@primevue/core/basecomponent';
import type { PassThroughOptions } from 'primevue/passthrough';
import { VNode } from 'vue';
import type { Component, VNode } from 'vue';

export declare type StepPassThroughOptionType = StepPassThroughAttributes | ((options: StepPassThroughMethodOptions) => StepPassThroughAttributes | string) | string | null | undefined;

Expand Down Expand Up @@ -93,7 +93,7 @@ export interface StepProps {
* Use to change the HTML tag of root element.
* @defaultValue BUTTON
*/
as?: string | undefined;
as?: string | Component | undefined;
/**
* When enabled, it changes the default rendered element for the one passed as a child element.
* @defaultValue false
Expand Down
2 changes: 1 addition & 1 deletion packages/primevue/src/steppanel/BaseStepPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default {
default: false
},
as: {
type: String,
type: [String, Object],
default: 'DIV'
}
},
Expand Down
4 changes: 2 additions & 2 deletions packages/primevue/src/steppanel/StepPanel.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import type { DefineComponent, DesignToken, EmitFn, GlobalComponentConstructor, PassThrough } from '@primevue/core';
import type { ComponentHooks } from '@primevue/core/basecomponent';
import type { PassThroughOptions } from 'primevue/passthrough';
import { VNode } from 'vue';
import type { Component, VNode } from 'vue';

export declare type StepPanelPassThroughOptionType = StepPanelPassThroughAttributes | ((options: StepPanelPassThroughMethodOptions) => StepPanelPassThroughAttributes | string) | string | null | undefined;

Expand Down Expand Up @@ -72,7 +72,7 @@ export interface StepPanelProps {
* Use to change the HTML tag of root element.
* @defaultValue BUTTON
*/
as?: string | undefined;
as?: string | Component | undefined;
/**
* When enabled, it changes the default rendered element for the one passed as a child element.
* @defaultValue false
Expand Down
2 changes: 1 addition & 1 deletion packages/primevue/src/tab/BaseTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default {
default: false
},
as: {
type: String,
type: [String, Object],
default: 'BUTTON'
},
asChild: {
Expand Down
4 changes: 2 additions & 2 deletions packages/primevue/src/tab/Tab.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import type { DefineComponent, DesignToken, EmitFn, GlobalComponentConstructor, PassThrough } from '@primevue/core';
import type { ComponentHooks } from '@primevue/core/basecomponent';
import type { PassThroughOptions } from 'primevue/passthrough';
import { VNode } from 'vue';
import type { Component, VNode } from 'vue';

export declare type TabPassThroughOptionType = TabPassThroughAttributes | ((options: TabPassThroughMethodOptions) => TabPassThroughAttributes | string) | string | null | undefined;

Expand Down Expand Up @@ -81,7 +81,7 @@ export interface TabProps {
* Use to change the HTML tag of root element.
* @defaultValue BUTTON
*/
as?: string | undefined;
as?: string | Component | undefined;
/**
* When enabled, it changes the default rendered element for the one passed as a child element.
* @defaultValue false
Expand Down
2 changes: 1 addition & 1 deletion packages/primevue/src/tabpanel/BaseTabPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default {
default: undefined
},
as: {
type: String,
type: [String, Object],
default: 'DIV'
},
asChild: {
Expand Down
4 changes: 2 additions & 2 deletions packages/primevue/src/tabpanel/TabPanel.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import type { DefineComponent, DesignToken, EmitFn, GlobalComponentConstructor, PassThrough } from '@primevue/core';
import type { ComponentHooks } from '@primevue/core/basecomponent';
import type { PassThroughOptions } from 'primevue/passthrough';
import { AnchorHTMLAttributes, HTMLAttributes, LiHTMLAttributes, VNode } from 'vue';
import type { AnchorHTMLAttributes, Component, HTMLAttributes, LiHTMLAttributes, VNode } from 'vue';

export declare type TabPanelPassThroughOptionType = TabPanelPassThroughAttributes | ((options: TabPanelPassThroughMethodOptions) => TabPanelPassThroughAttributes | string) | string | null | undefined;

Expand Down Expand Up @@ -96,7 +96,7 @@ export interface TabPanelProps {
* Use to change the HTML tag of root element.
* @defaultValue DIV
*/
as?: string | undefined;
as?: string | Component | undefined;
/**
* When enabled, it changes the default rendered element for the one passed as a child element.
* @defaultValue false
Expand Down

0 comments on commit 1e6e9b5

Please sign in to comment.