Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: extend as props to accept component objects #6267

Merged
merged 4 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion packages/primevue/src/button/BaseButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default {
default: undefined
},
as: {
type: String,
type: [String, Object],
default: 'BUTTON'
},
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
Loading