+
+
+
+
+
+
diff --git a/frontend/src/components/SvgPreview.vue b/frontend/src/components/SvgPreview.vue
index 7d8854d..6b87107 100644
--- a/frontend/src/components/SvgPreview.vue
+++ b/frontend/src/components/SvgPreview.vue
@@ -15,6 +15,9 @@ const previewFonts = computed(() => fontStore.previewFonts)
const inputText = computed(() => uiStore.inputText)
const fontSize = computed(() => uiStore.fontSize)
const fillColor = computed(() => uiStore.textColor)
+const isAllPreviewSelected = computed(() => {
+ return previewItems.value.length > 0 && previewItems.value.every(item => item.selected)
+})
watch(
[previewFonts, inputText, fontSize, fillColor],
@@ -81,6 +84,29 @@ function toggleSelectItem(item: PreviewItemType) {
item.selected = !item.selected
uiStore.toggleExportItem(item)
}
+
+function toggleSelectAllPreviewItems() {
+ if (previewItems.value.length === 0) {
+ return
+ }
+
+ if (isAllPreviewSelected.value) {
+ uiStore.clearExportSelection()
+ previewItems.value.forEach(item => {
+ item.selected = false
+ })
+ return
+ }
+
+ previewItems.value.forEach(item => {
+ item.selected = true
+ })
+ uiStore.selectAllExportItems(previewItems.value)
+}
+
+defineExpose({
+ toggleSelectAllPreviewItems,
+})