From cc88a59a1a69908104574b16812537d1e20ae1d8 Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Thu, 26 Sep 2024 15:38:30 +0300 Subject: [PATCH] TreeNode pt option updates --- packages/primevue/src/tree/Tree.d.ts | 9 +++++++++ packages/primevue/src/tree/TreeNode.vue | 2 ++ 2 files changed, 11 insertions(+) diff --git a/packages/primevue/src/tree/Tree.d.ts b/packages/primevue/src/tree/Tree.d.ts index 2f3f8b75e..47cc5b0b2 100755 --- a/packages/primevue/src/tree/Tree.d.ts +++ b/packages/primevue/src/tree/Tree.d.ts @@ -205,6 +205,10 @@ export interface TreeState { * Defines current options in Tree component. */ export interface TreeContext { + /** + * Current tree node instance + */ + node: TreeNode; /** * Index of the node. */ @@ -224,6 +228,11 @@ export interface TreeContext { * @defaultValue false */ checked: boolean; + /** + * Current partial checked state of the node as a boolean. + * @defaultValue false + */ + partialChecked: boolean; /** * Current leaf state of the node as a boolean. * @defaultValue false diff --git a/packages/primevue/src/tree/TreeNode.vue b/packages/primevue/src/tree/TreeNode.vue index 392753509..43ac457cb 100755 --- a/packages/primevue/src/tree/TreeNode.vue +++ b/packages/primevue/src/tree/TreeNode.vue @@ -137,10 +137,12 @@ export default { getPTOptions(key) { return this.ptm(key, { context: { + node: this.node, index: this.index, expanded: this.expanded, selected: this.selected, checked: this.checked, + partialChecked: this.partialChecked, leaf: this.leaf } });