@@ -11,6 +18,7 @@
v-for="citation in citationList.first"
:key="citation.id"
:citation="citation"
+ ref="rowRefs"
/>
-
+
@@ -32,6 +41,7 @@
v-for="citation in citationList.last"
:key="citation.id"
:citation="citation"
+ ref="rowRefs"
class="last:border-b-0"
/>
@@ -53,6 +63,7 @@ const props = defineProps({
}
})
+const rowRefs = ref([])
const showAll = ref(false)
const citations = ref([])
const citationList = computed(() => {
@@ -68,6 +79,23 @@ const citationList = computed(() => {
}
})
+const menuOptions = computed(() => [
+ {
+ label: showAll.value
+ ? 'Show less'
+ : 'Show all',
+ action: () => showAll.value = !showAll.value
+ },
+ {
+ label: 'Expand',
+ action: () => changeRowExpandedState(true)
+ },
+ {
+ label: 'Collapse',
+ action: () => changeRowExpandedState(false)
+ }
+])
+
watch(
() => props.otuId,
async () => {
@@ -80,4 +108,9 @@ watch(
}
)
+const changeRowExpandedState = value => {
+ rowRefs.value.forEach(component => {
+ component.setExpanded(value)
+ })
+}
diff --git a/src/modules/otus/components/Panel/PanelCitation/PanelCitationRow.vue b/src/modules/otus/components/Panel/PanelCitation/PanelCitationRow.vue
index 3586589..606982f 100644
--- a/src/modules/otus/components/Panel/PanelCitation/PanelCitationRow.vue
+++ b/src/modules/otus/components/Panel/PanelCitation/PanelCitationRow.vue
@@ -23,7 +23,7 @@
/>
-
+
props.citation.pages
].filter(Boolean).join(':'))
+const setExpanded = value => {
+ isExpanded.value = value
+}
+
+defineExpose({
+ setExpanded
+})
+
\ No newline at end of file
diff --git a/src/modules/otus/views/Index.vue b/src/modules/otus/views/Index.vue
index c332511..898752d 100644
--- a/src/modules/otus/views/Index.vue
+++ b/src/modules/otus/views/Index.vue
@@ -63,7 +63,7 @@
-