2023-02-28 16:44:09 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Fieldset is a grouping component with the optional content toggle feature.
|
|
|
|
*
|
|
|
|
* [Live Demo](https://www.primevue.org/fieldset/)
|
|
|
|
*
|
|
|
|
* @module fieldset
|
|
|
|
*
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
import { VNode } from 'vue';
|
|
|
|
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
|
|
|
2023-02-28 16:44:09 +00:00
|
|
|
/**
|
|
|
|
* Custom toggle event.
|
|
|
|
* @see toggle
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface FieldsetToggleEvent {
|
|
|
|
/**
|
|
|
|
* Browser event.
|
|
|
|
*/
|
|
|
|
originalEvent: Event;
|
|
|
|
/**
|
|
|
|
* Collapsed state as a boolean
|
|
|
|
*/
|
|
|
|
value: boolean;
|
|
|
|
}
|
|
|
|
|
2023-02-28 16:44:09 +00:00
|
|
|
/**
|
|
|
|
* Defines valid properties in Fieldset component.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface FieldsetProps {
|
|
|
|
/**
|
|
|
|
* Header text of the fieldset.
|
|
|
|
*/
|
|
|
|
legend?: string | undefined;
|
|
|
|
/**
|
|
|
|
* When specified, content can toggled by clicking the legend.
|
2023-02-28 16:44:09 +00:00
|
|
|
* @defaultValue false
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
toggleable?: boolean | undefined;
|
|
|
|
/**
|
|
|
|
* Defines the default visibility state of the content.
|
2023-02-28 16:44:09 +00:00
|
|
|
* @defaultValue false
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
collapsed?: boolean | undefined;
|
2022-09-14 11:26:01 +00:00
|
|
|
/**
|
|
|
|
* Uses to pass the custom value to read for the anchor inside the component.
|
2023-02-28 16:44:09 +00:00
|
|
|
* @todo
|
2022-09-14 11:26:01 +00:00
|
|
|
*/
|
2022-12-08 11:04:25 +00:00
|
|
|
toggleButtonProps?: object | undefined;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
|
2023-02-28 16:44:09 +00:00
|
|
|
/**
|
|
|
|
* Defines valid slots in Fieldset slots.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface FieldsetSlots {
|
|
|
|
/**
|
|
|
|
* Default content slot.
|
|
|
|
*/
|
|
|
|
default: () => VNode[];
|
|
|
|
/**
|
|
|
|
* Custom legend template.
|
|
|
|
*/
|
|
|
|
legend: () => VNode[];
|
|
|
|
}
|
|
|
|
|
2023-02-28 16:44:09 +00:00
|
|
|
/**
|
|
|
|
* Defines valid emits in Fildset component.
|
|
|
|
*/
|
|
|
|
export interface FieldsetEmits {
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Emitted when the collapsed changes.
|
|
|
|
* @param {boolean} value - New value.
|
|
|
|
*/
|
2023-02-28 16:44:09 +00:00
|
|
|
'update:collapsed'(value: boolean): void;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Callback to invoke when a tab gets expanded or collapsed.
|
|
|
|
* @param {FieldsetToggleEvent} event - Custom toggle event.
|
|
|
|
*/
|
2023-02-28 16:44:09 +00:00
|
|
|
toggle(event: FieldsetToggleEvent): void;
|
|
|
|
}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2023-02-28 16:44:09 +00:00
|
|
|
/**
|
|
|
|
* **PrimeVue - Fieldset**
|
|
|
|
*
|
|
|
|
* _Fieldset is a grouping component with the optional content toggle feature._
|
|
|
|
*
|
|
|
|
* [Live Demo](https://www.primevue.org/fieldset/)
|
|
|
|
* --- ---
|
|
|
|
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo.svg)
|
|
|
|
*
|
|
|
|
* @group Component
|
|
|
|
*
|
|
|
|
*/
|
2023-03-01 12:30:54 +00:00
|
|
|
declare class Fieldset extends ClassComponent<FieldsetProps, FieldsetSlots, FieldsetEmits> {}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
|
|
|
declare module '@vue/runtime-core' {
|
|
|
|
interface GlobalComponents {
|
2022-09-14 11:26:01 +00:00
|
|
|
Fieldset: GlobalComponentConstructor<Fieldset>;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Fieldset;
|