2022-09-06 12:03:37 +00:00
|
|
|
import { VNode } from 'vue';
|
|
|
|
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
|
|
|
|
|
|
type SplitterLayoutType = 'horizontal' | 'vertical' | undefined;
|
|
|
|
|
|
|
|
type SplitterStateStorageType = 'local' | 'session' | undefined;
|
|
|
|
|
2022-12-08 11:04:25 +00:00
|
|
|
export interface SplitterResizeStartEvent {
|
|
|
|
/**
|
|
|
|
* Browser event
|
|
|
|
*/
|
|
|
|
originalEvent: Event;
|
|
|
|
/**
|
|
|
|
* Sizes of the panels
|
|
|
|
*/
|
|
|
|
sizes: number[];
|
|
|
|
}
|
|
|
|
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface SplitterResizeEndEvent {
|
|
|
|
/**
|
|
|
|
* Browser event
|
|
|
|
*/
|
|
|
|
originalEvent: Event;
|
|
|
|
/**
|
|
|
|
* Sizes of the panels
|
|
|
|
*/
|
|
|
|
sizes: number[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface SplitterProps {
|
|
|
|
/**
|
|
|
|
* Orientation of the panels.
|
|
|
|
* @see SplitterLayoutType
|
|
|
|
* Default value is 'horizontal'.
|
|
|
|
*/
|
|
|
|
layout?: SplitterLayoutType;
|
|
|
|
/**
|
|
|
|
* Size of the divider in pixels.
|
|
|
|
* Default value is 4.
|
|
|
|
*/
|
|
|
|
gutterSize?: number | undefined;
|
|
|
|
/**
|
|
|
|
* Storage identifier of a stateful Splitter.
|
|
|
|
*/
|
|
|
|
stateKey?: string | undefined;
|
|
|
|
/**
|
|
|
|
* Defines where a stateful splitter keeps its state, valid values are 'session' for sessionStorage and 'local' for localStorage.
|
|
|
|
* @see SplitterStateStorageType
|
|
|
|
* Default value is 'session'.
|
|
|
|
*/
|
|
|
|
stateStorage?: SplitterStateStorageType;
|
2022-09-14 11:26:01 +00:00
|
|
|
/**
|
|
|
|
* Step factor to increment/decrement the size of the panels while pressing the arrow keys.
|
|
|
|
* Default value is 1.
|
|
|
|
*/
|
|
|
|
step?: number | undefined;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface SplitterSlots {
|
|
|
|
/**
|
|
|
|
* Default slot to detect SplitterPanel components.
|
|
|
|
*/
|
|
|
|
default: () => VNode[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export declare type SplitterEmits = {
|
2022-12-08 11:04:25 +00:00
|
|
|
/**
|
|
|
|
* Callback to invoke when resize starts.
|
|
|
|
* @param {SplitterResizeStartEvent} event - Custom resize start event.
|
|
|
|
*/
|
|
|
|
resizestar: (event: SplitterResizeStartEvent) => void;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Callback to invoke when resize ends.
|
|
|
|
* @param {SplitterResizeEndEvent} event - Custom resize end event.
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
resizeend: (event: SplitterResizeEndEvent) => void;
|
|
|
|
};
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2022-09-14 11:26:01 +00:00
|
|
|
declare class Splitter extends ClassComponent<SplitterProps, SplitterSlots, SplitterEmits> {}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
|
|
|
declare module '@vue/runtime-core' {
|
|
|
|
interface GlobalComponents {
|
2022-09-14 11:26:01 +00:00
|
|
|
Splitter: GlobalComponentConstructor<Splitter>;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Splitter is utilized to separate and resize panels.
|
|
|
|
*
|
|
|
|
* Helper Components:
|
|
|
|
*
|
|
|
|
* - SplitterPanel
|
|
|
|
*
|
|
|
|
* Demos:
|
|
|
|
*
|
2022-09-14 11:26:01 +00:00
|
|
|
* - [Splitter](https://www.primefaces.org/primevue/splitter)
|
2022-09-06 12:03:37 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
export default Splitter;
|