From 404771e05d1092ed2873b658638b43af2478be31 Mon Sep 17 00:00:00 2001 From: Mehdi Rande Date: Thu, 12 Sep 2024 16:50:28 +0200 Subject: [PATCH] Proposal #5463: Add a resetState method to splitter to manually reset state. --- packages/primevue/src/splitter/Splitter.d.ts | 9 +++- packages/primevue/src/splitter/Splitter.vue | 56 +++++++++++--------- 2 files changed, 39 insertions(+), 26 deletions(-) diff --git a/packages/primevue/src/splitter/Splitter.d.ts b/packages/primevue/src/splitter/Splitter.d.ts index 7573ff5e8..dcb939915 100644 --- a/packages/primevue/src/splitter/Splitter.d.ts +++ b/packages/primevue/src/splitter/Splitter.d.ts @@ -226,6 +226,13 @@ export interface SplitterEmitsOptions { export declare type SplitterEmits = EmitFn; +export interface SplitterMethods { + /** + * This method resizes all panels by either using the stored state in the case of a stateful Splitter, the size property of each SplitterPanel, or by resetting them to their default values. + */ + resetState(): void; +} + /** * **PrimeVue - Splitter** * @@ -238,7 +245,7 @@ export declare type SplitterEmits = EmitFn; * @group Component * */ -declare const Splitter: DefineComponent; +declare const Splitter: DefineComponent; declare module 'vue' { export interface GlobalComponents { diff --git a/packages/primevue/src/splitter/Splitter.vue b/packages/primevue/src/splitter/Splitter.vue index 33648b806..c97103c88 100644 --- a/packages/primevue/src/splitter/Splitter.vue +++ b/packages/primevue/src/splitter/Splitter.vue @@ -22,9 +22,9 @@