From 77934bf36159c481e91ed35bc63e8fa363e5bee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Tue, 25 Jul 2023 12:22:30 +0300 Subject: [PATCH] Refactor #4196 - For SplitterPanel --- components/lib/splitterpanel/SplitterPanel.d.ts | 11 +++++++++++ components/lib/splitterpanel/SplitterPanel.vue | 7 +++++++ 2 files changed, 18 insertions(+) diff --git a/components/lib/splitterpanel/SplitterPanel.d.ts b/components/lib/splitterpanel/SplitterPanel.d.ts index bd3476113..0bdc308aa 100644 --- a/components/lib/splitterpanel/SplitterPanel.d.ts +++ b/components/lib/splitterpanel/SplitterPanel.d.ts @@ -19,6 +19,7 @@ export declare type SplitterPanelPassThroughOptionType = SplitterPanelPassThroug export interface SplitterPanelPassThroughMethodOptions { instance: any; props: SplitterPanelProps; + context: SplitterPanelContext; } /** @@ -44,6 +45,16 @@ export interface SplitterPanelPassThroughAttributes { [key: string]: any; } +/** + * Defines options in SplitterPanel component. + */ +export interface SplitterPanelContext { + /** + * Current nested state of the panel. + */ + nested?: boolean; +} + /** * Defines valid properties in SplitterPanel component. */ diff --git a/components/lib/splitterpanel/SplitterPanel.vue b/components/lib/splitterpanel/SplitterPanel.vue index cd8be8700..38af1a16a 100644 --- a/components/lib/splitterpanel/SplitterPanel.vue +++ b/components/lib/splitterpanel/SplitterPanel.vue @@ -15,6 +15,13 @@ export default { return this.$slots.default().some((child) => { return child.type.name === 'Splitter'; }); + }, + getPTOptions() { + return { + context: { + nested: this.isNested + } + }; } } };