From 225f006aa0d470022bcab12906f4c32d1e422e99 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Thu, 25 Jul 2024 19:23:55 +0200 Subject: [PATCH] Refactor Vue components for file preview --- .../Views/Files/FileDefaultPreview.vue | 56 ++++ .../Views/Files/FileFocusButton.vue | 36 --- .../Views/Files/FileImagePreview.vue | 147 ++++++++++ .../components/Views/Files/FilePreview.vue | 250 +----------------- .../Views/Files/FilePreviewDetails.vue | 68 +++++ .../Views/Files/FilePreviewThumb.vue | 61 +++++ panel/src/components/Views/Files/FileView.vue | 2 +- panel/src/components/Views/Files/index.js | 14 +- 8 files changed, 356 insertions(+), 278 deletions(-) create mode 100644 panel/src/components/Views/Files/FileDefaultPreview.vue delete mode 100644 panel/src/components/Views/Files/FileFocusButton.vue create mode 100644 panel/src/components/Views/Files/FileImagePreview.vue create mode 100644 panel/src/components/Views/Files/FilePreviewDetails.vue create mode 100644 panel/src/components/Views/Files/FilePreviewThumb.vue diff --git a/panel/src/components/Views/Files/FileDefaultPreview.vue b/panel/src/components/Views/Files/FileDefaultPreview.vue new file mode 100644 index 0000000000..d12f0177a2 --- /dev/null +++ b/panel/src/components/Views/Files/FileDefaultPreview.vue @@ -0,0 +1,56 @@ + + + + + diff --git a/panel/src/components/Views/Files/FileFocusButton.vue b/panel/src/components/Views/Files/FileFocusButton.vue deleted file mode 100644 index 1d459a2c07..0000000000 --- a/panel/src/components/Views/Files/FileFocusButton.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - diff --git a/panel/src/components/Views/Files/FileImagePreview.vue b/panel/src/components/Views/Files/FileImagePreview.vue new file mode 100644 index 0000000000..b168982a12 --- /dev/null +++ b/panel/src/components/Views/Files/FileImagePreview.vue @@ -0,0 +1,147 @@ + + + + + diff --git a/panel/src/components/Views/Files/FilePreview.vue b/panel/src/components/Views/Files/FilePreview.vue index 1c8ea6203a..18d01a13d7 100644 --- a/panel/src/components/Views/Files/FilePreview.vue +++ b/panel/src/components/Views/Files/FilePreview.vue @@ -1,134 +1,24 @@ + + diff --git a/panel/src/components/Views/Files/FilePreviewThumb.vue b/panel/src/components/Views/Files/FilePreviewThumb.vue new file mode 100644 index 0000000000..ed1d453b53 --- /dev/null +++ b/panel/src/components/Views/Files/FilePreviewThumb.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/panel/src/components/Views/Files/FileView.vue b/panel/src/components/Views/Files/FileView.vue index 0c5280d6f5..504bed2857 100644 --- a/panel/src/components/Views/Files/FileView.vue +++ b/panel/src/components/Views/Files/FileView.vue @@ -23,7 +23,7 @@ - + diff --git a/panel/src/components/Views/Files/index.js b/panel/src/components/Views/Files/index.js index 4455c8f31b..88b62050fa 100644 --- a/panel/src/components/Views/Files/index.js +++ b/panel/src/components/Views/Files/index.js @@ -1,11 +1,21 @@ import FileView from "./FileView.vue"; -import FileFocusButton from "./FileFocusButton.vue"; + import FilePreview from "./FilePreview.vue"; +import FilePreviewDetails from "./FilePreviewDetails.vue"; +import FilePreviewThumb from "./FilePreviewThumb.vue"; + +import FileDefaultPreview from "./FileDefaultPreview.vue"; +import FileImagePreview from "./FileImagePreview.vue"; export default { install(app) { app.component("k-file-view", FileView); + app.component("k-file-preview", FilePreview); - app.component("k-file-focus-button", FileFocusButton); + app.component("k-file-preview-details", FilePreviewDetails); + app.component("k-file-preview-thumb", FilePreviewThumb); + + app.component("k-file-default-preview", FileDefaultPreview); + app.component("k-file-image-preview", FileImagePreview); } };