primevue-mirror/components/lib/inplace/Inplace.d.ts

165 lines
4.1 KiB
TypeScript
Raw Normal View History

2023-03-01 13:12:23 +00:00
/**
*
* Inplace provides an easy to do editing and display at the same time where clicking the output displays the actual content.
*
* [Live Demo](https://www.primevue.org/inplace)
*
* @module inplace
*
*/
2023-05-02 08:01:27 +00:00
2023-03-01 13:12:23 +00:00
import { ButtonHTMLAttributes, HTMLAttributes, VNode } from 'vue';
2023-05-02 08:01:27 +00:00
import { ButtonPassThroughOptions } from '../button';
2022-09-06 12:03:37 +00:00
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
2023-04-24 09:40:50 +00:00
export declare type InplacePassThroughOptionType = InplacePassThroughAttributes | ((options: InplacePassThroughMethodOptions) => InplacePassThroughAttributes) | null | undefined;
/**
* Custom passthrough(pt) option method.
*/
export interface InplacePassThroughMethodOptions {
props: InplaceProps;
state: InplaceState;
}
/**
* Custom passthrough(pt) options.
* @see {@link InplaceProps.pt}
*/
export interface InplacePassThroughOptions {
/**
* Uses to pass attributes to the root's DOM element.
*/
root?: InplacePassThroughOptionType;
/**
* Uses to pass attributes to the display's DOM element.
*/
display?: InplacePassThroughOptionType;
/**
* Uses to pass attributes to the content's DOM element.
*/
content?: InplacePassThroughOptionType;
/**
* Uses to pass attributes to the close button's DOM element.
2023-05-02 08:01:27 +00:00
* @see {@link ButtonPassThroughOptions}
2023-04-24 09:40:50 +00:00
*/
2023-05-02 08:01:27 +00:00
closeButton?: ButtonPassThroughOptions;
2023-04-24 09:40:50 +00:00
}
/**
* Custom passthrough attributes for each DOM elements
*/
export interface InplacePassThroughAttributes {
[key: string]: any;
}
/**
* Defines current inline state in Inplace component.
*/
export interface InplaceState {
/**
* Current active state as a boolean.
* @defaultValue false
*/
d_active: boolean;
}
2023-03-01 13:12:23 +00:00
/**
* Defines valid properties in Inplace component.
*/
2022-09-06 12:03:37 +00:00
export interface InplaceProps {
/**
* Displays a button to switch back to display mode.
2023-03-01 13:12:23 +00:00
* @defaultValue false
2022-09-06 12:03:37 +00:00
*/
closable?: boolean | undefined;
/**
* Whether the content is displayed or not.
2023-03-01 13:12:23 +00:00
* @defaultValue false
2022-09-06 12:03:37 +00:00
*/
active?: boolean | undefined;
/**
* When present, it specifies that the element should be disabled.
2023-03-01 13:12:23 +00:00
* @defaultValue false
2022-09-06 12:03:37 +00:00
*/
disabled?: boolean | undefined;
2022-12-08 11:04:25 +00:00
/**
* Icon to display in the close button.
* @deprecated since v3.27.0. Use 'closeicon' slot.
2022-12-08 11:04:25 +00:00
*/
closeIcon?: string | undefined;
/**
* Uses to pass all properties of the HTMLDivElement to display container.
*/
displayProps?: HTMLAttributes | undefined;
/**
* Uses to pass all properties of the HTMLButtonElement to the close button.
*/
closeButtonProps?: ButtonHTMLAttributes | undefined;
2023-04-24 09:40:50 +00:00
/**
* Uses to pass attributes to DOM elements inside the component.
* @type {InplacePassThroughOptions}
*/
pt?: InplacePassThroughOptions;
2022-09-06 12:03:37 +00:00
}
2023-03-01 13:12:23 +00:00
/**
* Defines valid slots in Inplace component.
*/
2022-09-06 12:03:37 +00:00
export interface InplaceSlots {
/**
* Custom display template.
*/
2023-03-01 13:12:23 +00:00
display(): VNode[];
2022-09-06 12:03:37 +00:00
/**
* Custom content template.
*/
2023-03-01 13:12:23 +00:00
content(): VNode[];
/**
* Custom close icon template.
*/
closeicon(): VNode[];
2022-09-06 12:03:37 +00:00
}
2023-03-01 13:12:23 +00:00
/**
* Defines valid emits in Inplace component.
*/
export interface InplaceEmits {
2022-09-06 12:03:37 +00:00
/**
* Emitted when the active changes.
* @param {boolean} value - New value.
*/
2023-03-01 13:12:23 +00:00
'update:active'(value: boolean): void;
2022-09-06 12:03:37 +00:00
/**
* Callback to invoke when inplace is opened.
* @param {Event} event - Browser event.
*/
2023-03-01 13:12:23 +00:00
open(event: Event): void;
2022-09-06 12:03:37 +00:00
/**
* Callback to invoke when inplace is closed.
* @param {Event} event - Browser event.
*/
2023-03-01 13:12:23 +00:00
close(event: Event): void;
}
2022-09-06 12:03:37 +00:00
2023-03-01 13:12:23 +00:00
/**
* **PrimeVue - Inplace**
*
* _Inplace provides an easy to do editing and display at the same time where clicking the output displays the actual content._
*
* [Live Demo](https://www.primevue.org/inplace/)
* --- ---
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
*
* @group Component
*/
2022-09-14 11:26:01 +00:00
declare class Inplace extends ClassComponent<InplaceProps, InplaceSlots, InplaceEmits> {}
2022-09-06 12:03:37 +00:00
declare module '@vue/runtime-core' {
interface GlobalComponents {
2022-09-14 11:26:01 +00:00
Inplace: GlobalComponentConstructor<Inplace>;
2022-09-06 12:03:37 +00:00
}
}
export default Inplace;