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.
- package/dist/sprintify-ui.es.js +19690 -14694
- package/dist/types/src/components/BaseAddressForm.vue.d.ts +24 -3
- package/dist/types/src/components/BaseMediaGallery.vue.d.ts +64 -0
- package/dist/types/src/components/BaseMediaGalleryItem.vue.d.ts +45 -0
- package/dist/types/src/components/BaseMediaLibrary.vue.d.ts +37 -3
- package/dist/types/src/components/BaseMediaList.vue.d.ts +47 -0
- package/dist/types/src/components/BaseMediaListItem.vue.d.ts +47 -0
- package/dist/types/src/components/BaseMediaPictures.vue.d.ts +55 -0
- package/dist/types/src/components/BaseMediaPicturesItem.vue.d.ts +54 -0
- package/dist/types/src/index.d.ts +8 -0
- package/dist/types/src/types/Media.d.ts +1 -0
- package/dist/types/src/types/UploadedFile.d.ts +1 -0
- package/dist/types/src/types/index.d.ts +2 -4
- package/package.json +3 -2
- package/src/components/BaseAddressForm.vue +27 -6
- package/src/components/BaseBelongsTo.vue +4 -4
- package/src/components/BaseMediaGallery.vue +95 -0
- package/src/components/BaseMediaGalleryItem.vue +92 -0
- package/src/components/BaseMediaItem.vue +1 -1
- package/src/components/BaseMediaLibrary.stories.js +181 -19
- package/src/components/BaseMediaLibrary.vue +92 -102
- package/src/components/BaseMediaList.vue +70 -0
- package/src/components/BaseMediaListItem.vue +171 -0
- package/src/components/BaseMediaPictures.vue +66 -0
- package/src/components/BaseMediaPicturesItem.vue +93 -0
- package/src/components/BaseMediaPreview.vue +16 -4
- package/src/lang/en.json +2 -0
- package/src/lang/fr.json +2 -0
- package/src/types/Media.ts +1 -0
- package/src/types/UploadedFile.ts +1 -0
- 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="
|
|
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="
|
|
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="
|
|
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",
|
package/src/types/Media.ts
CHANGED
package/src/types/index.ts
CHANGED
|
@@ -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;
|