From e9c69cc3d77cb1fdb7001a772c4bc3032eae3a0b Mon Sep 17 00:00:00 2001 From: Yuchao Date: Wed, 10 Jul 2024 01:48:30 +1000 Subject: [PATCH] feat(VTreeview): port open-on-click prop to v3 & enhancement (#20038) fixes #20009 fixes #20095 fixes #19414 fixes #20106 --- .../src/locale/en/VTreeview.json | 2 +- .../v-treeview/misc-search-and-filter.vue | 4 +- .../v-treeview/misc-selectable-icons.vue | 108 +--- .../examples/v-treeview/prop-activatable.vue | 1 + .../src/examples/v-treeview/prop-color.vue | 1 + .../v-treeview/prop-selection-type.vue | 10 +- .../v-treeview/slot-append-and-label.vue | 79 +-- .../docs/src/pages/en/components/treeview.md | 4 +- .../src/components/VList/VListItem.sass | 2 +- .../src/components/VList/VListItem.tsx | 5 +- .../vuetify/src/composables/nested/nested.ts | 6 +- .../src/composables/nested/openStrategies.ts | 7 +- .../composables/nested/selectStrategies.ts | 10 +- .../vuetify/src/labs/VTreeview/VTreeview.tsx | 15 +- .../src/labs/VTreeview/VTreeviewChildren.tsx | 31 +- .../src/labs/VTreeview/VTreeviewItem.tsx | 109 +--- .../VTreeview/__tests__/VTreeview.spec.cy.tsx | 582 +++++++++++++++++- 17 files changed, 667 insertions(+), 309 deletions(-) diff --git a/packages/api-generator/src/locale/en/VTreeview.json b/packages/api-generator/src/locale/en/VTreeview.json index 3025b82f42b3..0d1efb4f3500 100644 --- a/packages/api-generator/src/locale/en/VTreeview.json +++ b/packages/api-generator/src/locale/en/VTreeview.json @@ -25,7 +25,7 @@ "returnObject": "When `true` will make `v-model`, `active.sync` and `open.sync` return the complete object instead of just the key.", "rounded": "Provides an alternative active style for `v-treeview` node. Only visible when `activatable` is `true` and should not be used in conjunction with the `shaped` prop.", "search": "The search model for filtering results.", - "selectable": "Will render a checkbox next to each node allowing them to be selected.", + "selectable": "Will render a checkbox next to each node allowing them to be selected. Additionally, the **[openOnClick](/api/v-treeview/#props-open-on-click)** property will be applied internally.", "selectedColor": "The color of the selection checkbox.", "selectionType": "Controls how the treeview selects nodes. There are two modes available: 'leaf' and 'independent'.", "shaped": "Provides an alternative active style for `v-treeview` node. Only visible when `activatable` is `true` and should not be used in conjunction with the `rounded` prop.", diff --git a/packages/docs/src/examples/v-treeview/misc-search-and-filter.vue b/packages/docs/src/examples/v-treeview/misc-search-and-filter.vue index 7333aefc0cfd..3e5c3e339bef 100644 --- a/packages/docs/src/examples/v-treeview/misc-search-and-filter.vue +++ b/packages/docs/src/examples/v-treeview/misc-search-and-filter.vue @@ -23,10 +23,12 @@ diff --git a/packages/docs/src/examples/v-treeview/prop-selection-type.vue b/packages/docs/src/examples/v-treeview/prop-selection-type.vue index c4d3f4379ae8..260f3abc9e34 100644 --- a/packages/docs/src/examples/v-treeview/prop-selection-type.vue +++ b/packages/docs/src/examples/v-treeview/prop-selection-type.vue @@ -2,16 +2,16 @@ @@ -29,7 +29,7 @@ v-for="node in selection" :key="node.id" > - {{ node.name }} + {{ node.title }} diff --git a/packages/docs/src/examples/v-treeview/slot-append-and-label.vue b/packages/docs/src/examples/v-treeview/slot-append-and-label.vue index e52f27851dac..bde4d84e37ad 100644 --- a/packages/docs/src/examples/v-treeview/slot-append-and-label.vue +++ b/packages/docs/src/examples/v-treeview/slot-append-and-label.vue @@ -1,15 +1,14 @@