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,33 @@
import { VNode } from 'vue';
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
export declare type SplitterPanelPassThroughOptionType = SplitterPanelPassThroughAttributes | ((options: SplitterPanelPassThroughMethodOptions) => SplitterPanelPassThroughAttributes) | null | undefined;
/**
* Custom passthrough(pt) option method.
*/
export interface SplitterPanelPassThroughMethodOptions {
props: SplitterPanelProps;
}
/**
* Custom passthrough(pt) options.
* @see {@link PanelProps.pt}
*/
export interface SplitterPanelPassThroughOptions {
/**
* Uses to pass attributes to the root's DOM element.
*/
root?: SplitterPanelPassThroughOptionType;
}
/**
* Custom passthrough attributes for each DOM elements
*/
export interface SplitterPanelPassThroughAttributes {
[key: string]: any;
}
/**
* Defines valid properties in SplitterPanel component.
*/
@ -22,6 +49,11 @@ export interface SplitterPanelProps {
* Minimum size of the element relative to 100%.
*/
minSize?: number | undefined;
/**
* Uses to pass attributes to DOM elements inside the component.
* @type {SplitterPanelPassThroughOptions}
*/
pt?: SplitterPanelPassThroughOptions;
}
/**

View file

@ -1,12 +1,15 @@
<template>
<div ref="container" :class="containerClass">
<div ref="container" :class="containerClass" v-bind="ptm('root')">
<slot></slot>
</div>
</template>
<script>
import ComponentBase from 'primevue/base';
export default {
name: 'SplitterPanel',
extends: ComponentBase,
props: {
size: {
type: Number,