Refactor #3797 - Splitter updates

This commit is contained in:
Tuğçe Küçükoğlu 2023-03-27 10:13:31 +03:00
parent 094245e2d3
commit c14c2f160e
6 changed files with 115 additions and 4 deletions

View file

@ -10,6 +10,16 @@
import { VNode } from 'vue';
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
export declare type SplitterPassThroughOptionType = SplitterPassThroughAttributes | ((options: SplitterPassThroughMethodOptions) => SplitterPassThroughAttributes) | null | undefined;
/**
* Custom passthrough(pt) option method.
*/
export interface SplitterPassThroughMethodOptions {
props: SplitterProps;
state: SplitterState;
}
/**
* Custom resize start event.
* @see {@link SplitterEmits.resizestar}
@ -40,6 +50,42 @@ export interface SplitterResizeEndEvent {
sizes: number[];
}
/**
* Custom passthrough(pt) options.
* @see {@link SplitterProps.pt}
*/
export interface SplitterPassThroughOptions {
/**
* Uses to pass attributes to the root's DOM element.
*/
root?: SplitterPassThroughOptionType;
/**
* Uses to pass attributes to the gutter's DOM element.
*/
gutter?: SplitterPassThroughOptionType;
/**
* Uses to pass attributes to the gutter handler's DOM element.
*/
gutterhandler?: SplitterPassThroughOptionType;
}
/**
* Custom passthrough attributes for each DOM elements
*/
export interface SplitterPassThroughAttributes {
[key: string]: any;
}
/**
* Defines current inline state in Panel component.
*/
export interface SplitterState {
/**
* Previous size state as a number.
*/
prevSize: number;
}
/**
* Defines valid properties in Splitter component.
*/
@ -68,6 +114,11 @@ export interface SplitterProps {
* @defaultValue 1
*/
step?: number | undefined;
/**
* Uses to pass attributes to DOM elements inside the component.
* @type {SplitterPassThroughOptions}
*/
pt?: SplitterPassThroughOptions;
}
/**