sprintify-ui 0.0.204 → 0.1.2

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.
Files changed (31) hide show
  1. package/dist/sprintify-ui.es.js +19690 -14694
  2. package/dist/types/src/components/BaseAddressForm.vue.d.ts +24 -3
  3. package/dist/types/src/components/BaseMediaGallery.vue.d.ts +64 -0
  4. package/dist/types/src/components/BaseMediaGalleryItem.vue.d.ts +45 -0
  5. package/dist/types/src/components/BaseMediaLibrary.vue.d.ts +37 -3
  6. package/dist/types/src/components/BaseMediaList.vue.d.ts +47 -0
  7. package/dist/types/src/components/BaseMediaListItem.vue.d.ts +47 -0
  8. package/dist/types/src/components/BaseMediaPictures.vue.d.ts +55 -0
  9. package/dist/types/src/components/BaseMediaPicturesItem.vue.d.ts +54 -0
  10. package/dist/types/src/index.d.ts +8 -0
  11. package/dist/types/src/types/Media.d.ts +1 -0
  12. package/dist/types/src/types/UploadedFile.d.ts +1 -0
  13. package/dist/types/src/types/index.d.ts +2 -4
  14. package/package.json +3 -2
  15. package/src/components/BaseAddressForm.vue +27 -6
  16. package/src/components/BaseBelongsTo.vue +4 -4
  17. package/src/components/BaseMediaGallery.vue +95 -0
  18. package/src/components/BaseMediaGalleryItem.vue +92 -0
  19. package/src/components/BaseMediaItem.vue +1 -1
  20. package/src/components/BaseMediaLibrary.stories.js +181 -19
  21. package/src/components/BaseMediaLibrary.vue +92 -102
  22. package/src/components/BaseMediaList.vue +70 -0
  23. package/src/components/BaseMediaListItem.vue +171 -0
  24. package/src/components/BaseMediaPictures.vue +66 -0
  25. package/src/components/BaseMediaPicturesItem.vue +93 -0
  26. package/src/components/BaseMediaPreview.vue +16 -4
  27. package/src/lang/en.json +2 -0
  28. package/src/lang/fr.json +2 -0
  29. package/src/types/Media.ts +1 -0
  30. package/src/types/UploadedFile.ts +1 -0
  31. package/src/types/index.ts +2 -4
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <component
3
3
  :is="url ? 'a' : 'div'"
4
+ ref="baseMediaPreviewRef"
4
5
  :href="url"
5
6
  target="_blank"
6
7
  class="relative flex items-center justify-center overflow-hidden"
@@ -25,24 +26,29 @@
25
26
  <BaseIcon
26
27
  v-if="extension == 'pdf'"
27
28
  class="max-w-8 h-1/2 max-h-8 w-1/2 text-slate-600"
28
- icon="mdi:file-pdf-box"
29
+ icon="heroicons-solid:document-text"
29
30
  />
30
31
  <BaseIcon
31
32
  v-else-if="type == 'image'"
32
33
  class="max-w-8 h-1/2 max-h-8 w-1/2 text-slate-600"
33
- icon="mdi:camera"
34
+ icon="heroicons-solid:photograph"
34
35
  />
35
36
  <BaseIcon
36
37
  v-else-if="type == 'audio'"
37
38
  class="max-w-8 h-1/2 max-h-8 w-1/2 text-slate-600"
38
- icon="mdi:music"
39
+ icon="heroicons-solid:music-note"
39
40
  />
40
41
  <span
41
- v-else
42
+ v-else-if="elementWidth > 50"
42
43
  class="text-xs font-semibold uppercase leading-tight text-slate-600"
43
44
  >
44
45
  {{ extension }}
45
46
  </span>
47
+ <BaseIcon
48
+ v-else
49
+ class="max-w-8 h-1/2 max-h-8 w-1/2 text-slate-600"
50
+ icon="heroicons-solid:paper-clip"
51
+ />
46
52
  </div>
47
53
  </component>
48
54
  </template>
@@ -52,6 +58,7 @@ import { Media } from '@/types/Media';
52
58
  import { UploadedFile } from '@/types/UploadedFile';
53
59
  import { PropType } from 'vue';
54
60
  import { Icon as BaseIcon } from '@iconify/vue';
61
+ import { useElementSize } from '@vueuse/core';
55
62
 
56
63
  defineEmits(['delete']);
57
64
 
@@ -87,4 +94,9 @@ const url = computed(() => {
87
94
 
88
95
  return null;
89
96
  });
97
+
98
+ const baseMediaPreviewRef = ref<HTMLElement | null>(null);
99
+
100
+ const elementSize = useElementSize(baseMediaPreviewRef);
101
+ const elementWidth = computed(() => elementSize.width.value);
90
102
  </script>
package/src/lang/en.json CHANGED
@@ -26,6 +26,7 @@
26
26
  "delete_record": "Delete the record",
27
27
  "delete_record_description": "Are you sure to delete this record? This action is irreversible.",
28
28
  "deselect_all": "Deselect all",
29
+ "download": "Download",
29
30
  "drag_to_reposition": "Drag to reposition",
30
31
  "drop_or_click_to_upload": "Drop or click to upload",
31
32
  "edit": "Edit",
@@ -56,6 +57,7 @@
56
57
  "remove": "Remove",
57
58
  "remove_file": "Remove file?",
58
59
  "remove_file_description": "Are you sure you want to remove the file? This action is irreversible.",
60
+ "save": "Save",
59
61
  "search": "Search",
60
62
  "see_all_notifications": "See all notifications",
61
63
  "select_an_item": "Select an item",
package/src/lang/fr.json CHANGED
@@ -26,6 +26,7 @@
26
26
  "delete_record": "Supprimer l'item",
27
27
  "delete_record_description": "Supprimer cet item ? \nCette action est irréversible.",
28
28
  "deselect_all": "Tout déselectionner",
29
+ "download": "Télécharger",
29
30
  "drag_to_reposition": "Faites glisser pour repositionner",
30
31
  "drop_or_click_to_upload": "Déposer ou cliquer pour télécharger",
31
32
  "edit": "Modifier",
@@ -56,6 +57,7 @@
56
57
  "remove": "Retirer",
57
58
  "remove_file": "Retirer le fichier?",
58
59
  "remove_file_description": "Supprimer le fichier ? \nCette action est irréversible.",
60
+ "save": "Sauvegarder",
59
61
  "search": "Rechercher",
60
62
  "see_all_notifications": "Voir toutes les notifications",
61
63
  "select_an_item": "Sélectionner un élément",
@@ -1,5 +1,6 @@
1
1
  interface Media {
2
2
  id: string;
3
+ name: string;
3
4
  file_name: string;
4
5
  size: number;
5
6
  mime_type: string;
@@ -1,5 +1,6 @@
1
1
  interface UploadedFile {
2
2
  id: string;
3
+ name: string;
3
4
  file_name: string;
4
5
  size: number;
5
6
  mime_type: string;
@@ -4,6 +4,7 @@ import { RouteLocationRaw } from 'vue-router';
4
4
  import { UploadedFile } from './UploadedFile';
5
5
  import { Notification as AppNotification } from './Notification';
6
6
  import { CropType, ResultOptions } from 'croppie';
7
+ import { Media } from './Media';
7
8
 
8
9
  export type Locales = { [locale: string]: string };
9
10
 
@@ -40,10 +41,7 @@ export type NormalizedOption = {
40
41
  label: string;
41
42
  };
42
43
 
43
- export type MediaLibraryPayload = {
44
- to_remove: string[];
45
- to_add: UploadedFile[];
46
- };
44
+ export type MediaLibraryPayload = (Media | UploadedFile)[];
47
45
 
48
46
  export interface PaginationMetadata {
49
47
  current_page: number;