From 288ef38c8a296bcc1b030716ece6e7266536c525 Mon Sep 17 00:00:00 2001 From: Nicolas Richel Date: Mon, 18 Nov 2024 10:06:03 +0100 Subject: [PATCH] PATCH: fix(tree): allow node.id to be a string (#372) --- src/BIMDataComponents/BIMDataTree/BIMDataTree.vue | 2 +- src/BIMDataComponents/BIMDataTree/Node.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BIMDataComponents/BIMDataTree/BIMDataTree.vue b/src/BIMDataComponents/BIMDataTree/BIMDataTree.vue index fe81a5d7..4c235290 100644 --- a/src/BIMDataComponents/BIMDataTree/BIMDataTree.vue +++ b/src/BIMDataComponents/BIMDataTree/BIMDataTree.vue @@ -62,7 +62,7 @@ export default { const ids = new Set(); for (const node of value) { - if (!Number.isFinite(node?.id)) return false; + if (!Number.isFinite(node?.id) && typeof node?.id !== "string") return false; if (node.children && !Array.isArray(node.children)) return false; ids.add(node.id); } diff --git a/src/BIMDataComponents/BIMDataTree/Node.vue b/src/BIMDataComponents/BIMDataTree/Node.vue index 35d5a16f..667a0a9b 100644 --- a/src/BIMDataComponents/BIMDataTree/Node.vue +++ b/src/BIMDataComponents/BIMDataTree/Node.vue @@ -60,7 +60,7 @@ NodeChildren = { node: { type: Object, required: true, - validator: node => Number.isFinite(node?.id), + validator: node => (Number.isFinite(node?.id) || typeof node?.id === "string"), }, depth: { type: Number,