From 1df8a4745a6f70b0c3aeb0364389c679b11254bd Mon Sep 17 00:00:00 2001 From: Eric Gauzens Date: Mon, 31 Jan 2022 11:19:08 -0500 Subject: [PATCH 1/2] made leaf node text interactive --- .../MultiSelect/src/MultiSelect.vue | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/components/MultiSelect/src/MultiSelect.vue b/src/components/MultiSelect/src/MultiSelect.vue index cd1553c9..76d727db 100644 --- a/src/components/MultiSelect/src/MultiSelect.vue +++ b/src/components/MultiSelect/src/MultiSelect.vue @@ -17,7 +17,7 @@ ref="cascader" > @@ -101,6 +101,31 @@ export default { this.previouslySelectedArray = [...this.selectedArray] }, methods:{ + labelClicked(node) { + if (node.isDisabled || node.hasChildren) { + return + } + const newlySelectedArray = [] + this.previouslySelectedArray = [...this.selectedArray] + if (this.selectedArray.length) { + this.selectedArray.forEach(n => { + newlySelectedArray.push(n) + }) + } + if (!node.checked) { + newlySelectedArray.unshift(node.path) + } else { + if (newlySelectedArray.length) { + const map = newlySelectedArray.map(n => n.join(',')) + const idx = map.findIndex(q => q === node.path.join(',')) + if (idx > -1) { + newlySelectedArray.splice(idx, 1) + } + } + } + this.selectedArray = newlySelectedArray + this.onSelectionChange() + }, addShowAllNode(option, isMultilevel) { const showAllNode = { value: option.value, @@ -332,6 +357,10 @@ export default { .el-cascader-node__label { padding: 0; } +.leaf-node-label { + display: inline-block; + width: 100%; +} .multilevel-select-filter { color: $lightGrey; position: absolute; From d0e575b97c0d63d3594c0aeea73ddfaf7c32574f Mon Sep 17 00:00:00 2001 From: Eric Gauzens Date: Mon, 31 Jan 2022 11:20:23 -0500 Subject: [PATCH 2/2] version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2a89ae9b..8ef5942f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nih-sparc/sparc-design-system-components", - "version": "0.23.0", + "version": "0.24.0", "private": false, "scripts": { "serve": "vue-cli-service serve",