quasar-ui-danx 0.4.52 → 0.4.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/danx.es.js +2525 -2473
 - package/dist/danx.es.js.map +1 -1
 - package/dist/danx.umd.js +36 -36
 - package/dist/danx.umd.js.map +1 -1
 - package/dist/style.css +1 -1
 - package/package.json +1 -1
 - package/src/components/Utility/Dialogs/FullscreenCarouselDialog.vue +34 -3
 - package/src/components/Utility/Files/FilePreview.vue +11 -5
 
    
        package/package.json
    CHANGED
    
    
| 
         @@ -41,6 +41,14 @@ 
     | 
|
| 
       41 
41 
     | 
    
         
             
                          :alt="file.filename"
         
     | 
| 
       42 
42 
     | 
    
         
             
                          :src="getPreviewUrl(file)"
         
     | 
| 
       43 
43 
     | 
    
         
             
                        >
         
     | 
| 
      
 44 
     | 
    
         
            +
                        <div
         
     | 
| 
      
 45 
     | 
    
         
            +
                          v-else-if="isText(file)"
         
     | 
| 
      
 46 
     | 
    
         
            +
                          class="w-[60vw] min-w-96 bg-slate-800 rounded-lg"
         
     | 
| 
      
 47 
     | 
    
         
            +
                        >
         
     | 
| 
      
 48 
     | 
    
         
            +
                          <div class="whitespace-pre-wrap p-4">
         
     | 
| 
      
 49 
     | 
    
         
            +
                            {{ fileTexts[file.id] }}
         
     | 
| 
      
 50 
     | 
    
         
            +
                          </div>
         
     | 
| 
      
 51 
     | 
    
         
            +
                        </div>
         
     | 
| 
       44 
52 
     | 
    
         
             
                        <div v-else>
         
     | 
| 
       45 
53 
     | 
    
         
             
                          <h3 class="text-center mb-4">
         
     | 
| 
       46 
54 
     | 
    
         
             
                            No Preview Available
         
     | 
| 
         @@ -71,8 +79,9 @@ 
     | 
|
| 
       71 
79 
     | 
    
         
             
                </div>
         
     | 
| 
       72 
80 
     | 
    
         
             
              </QDialog>
         
     | 
| 
       73 
81 
     | 
    
         
             
            </template>
         
     | 
| 
       74 
     | 
    
         
            -
            <script setup>
         
     | 
| 
       75 
     | 
    
         
            -
            import {  
     | 
| 
      
 82 
     | 
    
         
            +
            <script setup lang="ts">
         
     | 
| 
      
 83 
     | 
    
         
            +
            import { QCarousel } from "quasar";
         
     | 
| 
      
 84 
     | 
    
         
            +
            import { onMounted, ref, shallowRef } from "vue";
         
     | 
| 
       76 
85 
     | 
    
         
             
            import { XIcon as CloseIcon } from "../../../svg";
         
     | 
| 
       77 
86 
     | 
    
         | 
| 
       78 
87 
     | 
    
         
             
            defineEmits(["close"]);
         
     | 
| 
         @@ -97,6 +106,10 @@ function isImage(file) { 
     | 
|
| 
       97 
106 
     | 
    
         
             
            	return file.mime?.startsWith("image");
         
     | 
| 
       98 
107 
     | 
    
         
             
            }
         
     | 
| 
       99 
108 
     | 
    
         | 
| 
      
 109 
     | 
    
         
            +
            function isText(file) {
         
     | 
| 
      
 110 
     | 
    
         
            +
            	return file.mime?.startsWith("text");
         
     | 
| 
      
 111 
     | 
    
         
            +
            }
         
     | 
| 
      
 112 
     | 
    
         
            +
             
     | 
| 
       100 
113 
     | 
    
         
             
            function getPreviewUrl(file) {
         
     | 
| 
       101 
114 
     | 
    
         
             
            	// Use the optimized URL first if available. If not, use the URL directly if its an image, otherwise use the thumb URL
         
     | 
| 
       102 
115 
     | 
    
         
             
            	return file.optimized?.url || (isImage(file) ? (file.blobUrl || file.url) : file.thumb?.url);
         
     | 
| 
         @@ -111,8 +124,26 @@ function getThumbUrl(file) { 
     | 
|
| 
       111 
124 
     | 
    
         
             
            			`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M0 0h24v24H0z" fill="none"/><path d="M8 5v14l11-7z"/></svg>`
         
     | 
| 
       112 
125 
     | 
    
         
             
            		)}`;
         
     | 
| 
       113 
126 
     | 
    
         
             
            	} else {
         
     | 
| 
       114 
     | 
    
         
            -
            		return getPreviewUrl(file);
         
     | 
| 
      
 127 
     | 
    
         
            +
            		return getPreviewUrl(file) || "https://placehold.co/40x50?text=T";
         
     | 
| 
      
 128 
     | 
    
         
            +
            	}
         
     | 
| 
      
 129 
     | 
    
         
            +
            }
         
     | 
| 
      
 130 
     | 
    
         
            +
             
     | 
| 
      
 131 
     | 
    
         
            +
            onMounted(() => {
         
     | 
| 
      
 132 
     | 
    
         
            +
            	for (let file of props.files) {
         
     | 
| 
      
 133 
     | 
    
         
            +
            		if (isText(file)) {
         
     | 
| 
      
 134 
     | 
    
         
            +
            			loadFileText(file);
         
     | 
| 
      
 135 
     | 
    
         
            +
            		}
         
     | 
| 
      
 136 
     | 
    
         
            +
            	}
         
     | 
| 
      
 137 
     | 
    
         
            +
            });
         
     | 
| 
      
 138 
     | 
    
         
            +
             
     | 
| 
      
 139 
     | 
    
         
            +
            const fileTexts = shallowRef<{ [key: string]: string }>({});
         
     | 
| 
      
 140 
     | 
    
         
            +
             
     | 
| 
      
 141 
     | 
    
         
            +
            async function loadFileText(file) {
         
     | 
| 
      
 142 
     | 
    
         
            +
            	if (fileTexts.value[file.id]) {
         
     | 
| 
      
 143 
     | 
    
         
            +
            		return fileTexts.value[file.id];
         
     | 
| 
       115 
144 
     | 
    
         
             
            	}
         
     | 
| 
      
 145 
     | 
    
         
            +
             
     | 
| 
      
 146 
     | 
    
         
            +
            	fileTexts.value[file.id] = await fetch(file.url).then((res) => res.text());
         
     | 
| 
       116 
147 
     | 
    
         
             
            }
         
     | 
| 
       117 
148 
     | 
    
         
             
            </script>
         
     | 
| 
       118 
149 
     | 
    
         
             
            <style module="cls" lang="scss">
         
     | 
| 
         @@ -69,7 +69,7 @@ 
     | 
|
| 
       69 
69 
     | 
    
         
             
                    class="absolute-bottom w-full bg-slate-800"
         
     | 
| 
       70 
70 
     | 
    
         
             
                  >
         
     | 
| 
       71 
71 
     | 
    
         
             
                    <QLinearProgress
         
     | 
| 
       72 
     | 
    
         
            -
                      :value="isUploading ? file.progress : (transcodingStatus 
     | 
| 
      
 72 
     | 
    
         
            +
                      :value="isUploading ? file.progress : ((transcodingStatus?.progress || 0) / 100)"
         
     | 
| 
       73 
73 
     | 
    
         
             
                      size="36px"
         
     | 
| 
       74 
74 
     | 
    
         
             
                      :color="isUploading ? 'green-800' : 'blue-800'"
         
     | 
| 
       75 
75 
     | 
    
         
             
                      :animation-speed="transcodingStatus?.estimate_ms || 3000"
         
     | 
| 
         @@ -77,12 +77,18 @@ 
     | 
|
| 
       77 
77 
     | 
    
         
             
                    >
         
     | 
| 
       78 
78 
     | 
    
         
             
                      <div class="absolute-full flex items-center flex-nowrap text-[.7rem] text-slate-200 justify-start px-1">
         
     | 
| 
       79 
79 
     | 
    
         
             
                        <QSpinnerPie
         
     | 
| 
       80 
     | 
    
         
            -
                          class="mr-2 text-slate-50 ml-1"
         
     | 
| 
       81 
     | 
    
         
            -
                          size="20"
         
     | 
| 
      
 80 
     | 
    
         
            +
                          class="mr-2 text-slate-50 ml-1 flex-shrink-0"
         
     | 
| 
      
 81 
     | 
    
         
            +
                          :size="btnSize === 'xs' ? 10 : 20"
         
     | 
| 
       82 
82 
     | 
    
         
             
                        />
         
     | 
| 
       83 
     | 
    
         
            -
                        <div>
         
     | 
| 
       84 
     | 
    
         
            -
                          {{ isUploading ? "Uploading..." : transcodingStatus 
     | 
| 
      
 83 
     | 
    
         
            +
                        <div class="whitespace-nowrap overflow-hidden ellipsis">
         
     | 
| 
      
 84 
     | 
    
         
            +
                          {{ isUploading ? "Uploading..." : transcodingStatus?.message }}
         
     | 
| 
       85 
85 
     | 
    
         
             
                        </div>
         
     | 
| 
      
 86 
     | 
    
         
            +
                        <QTooltip
         
     | 
| 
      
 87 
     | 
    
         
            +
                          v-if="transcodingStatus?.message"
         
     | 
| 
      
 88 
     | 
    
         
            +
                          class="text-sm"
         
     | 
| 
      
 89 
     | 
    
         
            +
                        >
         
     | 
| 
      
 90 
     | 
    
         
            +
                          {{ transcodingStatus?.message }}
         
     | 
| 
      
 91 
     | 
    
         
            +
                        </QTooltip>
         
     | 
| 
       86 
92 
     | 
    
         
             
                      </div>
         
     | 
| 
       87 
93 
     | 
    
         
             
                    </QLinearProgress>
         
     | 
| 
       88 
94 
     | 
    
         
             
                  </div>
         
     |