grantthomas-nuxt 1.0.6 → 1.0.7

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/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@grantthomas/nuxt",
3
3
  "configKey": "grantThomasNuxt",
4
- "version": "1.0.6",
4
+ "version": "1.0.7",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -236,6 +236,7 @@ const displayForChip = (item) => {
236
236
  :items="filter.options"
237
237
  :clearable="true"
238
238
  item-value="value"
239
+ :hide-details="true"
239
240
  item-title="label"
240
241
  :multiple="true"
241
242
  clear-icon="mdi-backspace"
@@ -54,6 +54,12 @@ const isImage = computed(() => {
54
54
  }
55
55
  return false;
56
56
  });
57
+ const isAudio = computed(() => {
58
+ if (props.item) {
59
+ return props.item[props.mimeKey].includes("audio");
60
+ }
61
+ return false;
62
+ });
57
63
  const url = computed(() => {
58
64
  if (props.item) {
59
65
  return uploadToUrl(props.item, isImage.value ? "thumbnail" : "original");
@@ -109,6 +115,10 @@ const containerClasses = computed(() => {
109
115
  :width="50"
110
116
  :height="50"
111
117
  class="flex-shrink-1"></video>
118
+ <div v-else-if="isAudio" class="bg-white d-flex justify-center align-center flex-column" style="height: 100px; width: 100px;">
119
+ <v-icon :icon="mimeTypeToMdiIcon(item[mimeKey])" size="40" color="success" class="mb-2"></v-icon>
120
+ <audio controls :src="url" style="width: 90px; height: 30px;" class="audio-mini"></audio>
121
+ </div>
112
122
  <div v-else class="bg-white d-flex justify-center align-center" style="height: 100px; width: 100px;">
113
123
  <v-icon :icon="mimeTypeToMdiIcon(item[mimeKey])" size="40" color="primary" class="m-auto"></v-icon>
114
124
  </div>
@@ -143,6 +153,7 @@ const containerClasses = computed(() => {
143
153
  :width="item.width ?? 100"
144
154
  :height="item.height ?? 'auto'"
145
155
  />
156
+ <audio v-else-if="isAudio" controls :src="url" style="width: 300px;" class="mb-2"></audio>
146
157
  <div style="overflow-wrap: break-word; word-wrap: break-word; word-break: break-all;"
147
158
  class="font-weight-bold text-wrap">{{ item[fileNameKey] }}
148
159
  </div>
@@ -163,16 +174,17 @@ const containerClasses = computed(() => {
163
174
  <v-avatar
164
175
  style="position: absolute; bottom: 5px; left: 5px;"
165
176
  size="20"
166
- :color="isVideo ? 'error' : (isImage ? 'info' : 'warning')">
177
+ :color="isVideo ? 'error' : (isImage ? 'info' : (isAudio ? 'success' : 'warning'))">
167
178
  <v-icon v-if="isImage" dark
168
179
  size="10">mdi-image
169
180
  </v-icon>
170
181
  <v-icon v-else-if="isVideo" dark size="15">mdi-video</v-icon>
182
+ <v-icon v-else-if="isAudio" dark size="12">mdi-music</v-icon>
171
183
  <v-icon v-else dark size="15">mdi-file</v-icon>
172
184
  </v-avatar>
173
185
  </div>
174
186
  </template>
175
187
 
176
188
  <style scoped>
177
- .cursor{cursor:pointer}
189
+ .cursor{cursor:pointer}.audio-mini{font-size:10px;max-width:90px}.audio-mini::-webkit-media-controls-panel{height:30px}
178
190
  </style>
@@ -8,7 +8,7 @@ export declare function useCrudConverters(): {
8
8
  flattenQuery: (obj: Record<string, any> | null, prefix?: string) => Record<string, any>;
9
9
  parseQuery: (query: string) => Record<string, any>;
10
10
  stringifyQuery: (params: Record<string, any>, prefix?: string, options?: StringifyOptions) => string;
11
- getFileType: (file: any) => 1 | 2 | 3 | 4 | 5 | 6 | null;
11
+ getFileType: (file: any) => 1 | 2 | 3 | 4 | 5 | 6 | 7 | null;
12
12
  mimeTypeToMdiIcon: (mimeType: string) => string;
13
13
  toBase64: (file: any) => Promise<unknown>;
14
14
  convertAddress: (item: {
@@ -41,6 +41,12 @@ export function useCrudConverters() {
41
41
  case "image/heic":
42
42
  case "image/heic-sequence":
43
43
  return "mdi-file-image";
44
+ case "audio/mpeg":
45
+ case "audio/mp3":
46
+ case "audio/wav":
47
+ case "audio/ogg":
48
+ case "audio/aac":
49
+ return "mdi-file-music";
44
50
  case "application/pdf":
45
51
  return "mdi-file-pdf";
46
52
  case "application/msword":
@@ -172,6 +178,12 @@ export function useCrudConverters() {
172
178
  return 5;
173
179
  case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
174
180
  return 6;
181
+ case "audio/mpeg":
182
+ case "audio/mp3":
183
+ case "audio/wav":
184
+ case "audio/ogg":
185
+ case "audio/aac":
186
+ return 7;
175
187
  }
176
188
  return null;
177
189
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grantthomas-nuxt",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Crud module for Nuxt 3 interacting with sibling .net project",
5
5
  "repository": "Tap-Leagues/GrantThomas.Nuxt",
6
6
  "license": "MIT",