sprintify-ui 0.0.136 → 0.0.138
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 +2519 -2513
- package/dist/types/src/components/BaseMediaLibrary.vue.d.ts +2 -2
- package/dist/types/src/components/index.d.ts +2 -1
- package/package.json +1 -1
- package/src/components/BaseMediaLibrary.stories.js +1 -1
- package/src/components/BaseMediaLibrary.vue +18 -6
- package/src/components/index.ts +2 -0
|
@@ -15,7 +15,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
15
15
|
default: undefined;
|
|
16
16
|
};
|
|
17
17
|
max: {
|
|
18
|
-
default:
|
|
18
|
+
default: undefined;
|
|
19
19
|
type: NumberConstructor;
|
|
20
20
|
};
|
|
21
21
|
maxSize: {
|
|
@@ -60,7 +60,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
60
60
|
default: undefined;
|
|
61
61
|
};
|
|
62
62
|
max: {
|
|
63
|
-
default:
|
|
63
|
+
default: undefined;
|
|
64
64
|
type: NumberConstructor;
|
|
65
65
|
};
|
|
66
66
|
maxSize: {
|
|
@@ -31,6 +31,7 @@ import BaseDialog from './BaseDialog.vue';
|
|
|
31
31
|
import BaseDisplayRelativeTime from './BaseDisplayRelativeTime.vue';
|
|
32
32
|
import BaseDropdown from './BaseDropdown.vue';
|
|
33
33
|
import BaseDropdownAutocomplete from './BaseDropdownAutocomplete.vue';
|
|
34
|
+
import BaseEmptyState from '@/svg/BaseEmptyState.vue';
|
|
34
35
|
import BaseField from './BaseField.vue';
|
|
35
36
|
import BaseFieldI18n from './BaseFieldI18n.vue';
|
|
36
37
|
import BaseFilePicker from './BaseFilePicker.vue';
|
|
@@ -81,4 +82,4 @@ import BaseLayoutStacked from './BaseLayoutStacked.vue';
|
|
|
81
82
|
import BaseLayoutStackedConfigurable from './BaseLayoutStackedConfigurable.vue';
|
|
82
83
|
import BaseLayoutSidebar from './BaseLayoutSidebar.vue';
|
|
83
84
|
import BaseLayoutSidebarConfigurable from './BaseLayoutSidebarConfigurable.vue';
|
|
84
|
-
export { BaseActionItem, BaseAlert, BaseApp, BaseAppDialogs, BaseAppNotifications, BaseAutocomplete, BaseAutocompleteFetch, BaseAvatar, BaseAvatarGroup, BaseBadge, BaseBelongsTo, BaseBoolean, BaseBreadcrumbs, BaseButton, BaseButtonGroup, BaseCard, BaseCardRow, BaseCharacterCounter, BaseClickOutside, BaseClipboard, BaseColor, BaseContainer, BaseCounter, BaseDataIterator, BaseDataTable, BaseDatePicker, BaseDateSelect, BaseDescriptionList, BaseDescriptionListItem, BaseDialog, BaseDisplayRelativeTime, BaseDropdown, BaseDropdownAutocomplete, BaseField, BaseFieldI18n, BaseFilePicker, BaseFileUploader, BaseForm, BaseHasMany, BaseIcon, BaseInput, BaseInputLabel, BaseInputPercent, BaseLoadingCover, BaseMediaItem, BaseMediaLibrary, BaseMediaPreview, BaseMenu, BaseMenuItem, BaseModalCenter, BaseModalSide, BaseNavbar, BaseNavbarItem, BaseNavbarItemContent, BasePagination, BasePanel, BasePassword, BaseProgressCircle, BaseRadioGroup, BaseReadMore, BaseRichText, BaseSelect, BaseShortcut, BaseSideNavigation, BaseSideNavigationItem, BaseSkeleton, BaseStatistic, BaseSwitch, BaseSystemAlert, BaseTabs, BaseTabItem, BaseTagAutocomplete, BaseTagAutocompleteFetch, BaseTable, BaseTableColumn, BaseTextarea, BaseTextareaAutoresize, BaseTimeline, BaseTimelineItem, BaseLayoutStacked, BaseLayoutStackedConfigurable, BaseLayoutSidebar, BaseLayoutSidebarConfigurable, };
|
|
85
|
+
export { BaseActionItem, BaseAlert, BaseApp, BaseAppDialogs, BaseAppNotifications, BaseAutocomplete, BaseAutocompleteFetch, BaseAvatar, BaseAvatarGroup, BaseBadge, BaseBelongsTo, BaseBoolean, BaseBreadcrumbs, BaseButton, BaseButtonGroup, BaseCard, BaseCardRow, BaseCharacterCounter, BaseClickOutside, BaseClipboard, BaseColor, BaseContainer, BaseCounter, BaseDataIterator, BaseDataTable, BaseDatePicker, BaseDateSelect, BaseDescriptionList, BaseDescriptionListItem, BaseDialog, BaseDisplayRelativeTime, BaseDropdown, BaseDropdownAutocomplete, BaseEmptyState, BaseField, BaseFieldI18n, BaseFilePicker, BaseFileUploader, BaseForm, BaseHasMany, BaseIcon, BaseInput, BaseInputLabel, BaseInputPercent, BaseLoadingCover, BaseMediaItem, BaseMediaLibrary, BaseMediaPreview, BaseMenu, BaseMenuItem, BaseModalCenter, BaseModalSide, BaseNavbar, BaseNavbarItem, BaseNavbarItemContent, BasePagination, BasePanel, BasePassword, BaseProgressCircle, BaseRadioGroup, BaseReadMore, BaseRichText, BaseSelect, BaseShortcut, BaseSideNavigation, BaseSideNavigationItem, BaseSkeleton, BaseStatistic, BaseSwitch, BaseSystemAlert, BaseTabs, BaseTabItem, BaseTagAutocomplete, BaseTagAutocompleteFetch, BaseTable, BaseTableColumn, BaseTextarea, BaseTextareaAutoresize, BaseTimeline, BaseTimelineItem, BaseLayoutStacked, BaseLayoutStackedConfigurable, BaseLayoutSidebar, BaseLayoutSidebarConfigurable, };
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
name="default"
|
|
19
19
|
v-bind="baseFileUploaderProps"
|
|
20
20
|
:max-size="maxSize"
|
|
21
|
-
:max="
|
|
21
|
+
:max="normalizedMax"
|
|
22
22
|
>
|
|
23
23
|
<div
|
|
24
24
|
class="rounded border border-dashed p-6 duration-150"
|
|
@@ -119,7 +119,7 @@ const props = defineProps({
|
|
|
119
119
|
default: undefined,
|
|
120
120
|
},
|
|
121
121
|
max: {
|
|
122
|
-
default:
|
|
122
|
+
default: undefined,
|
|
123
123
|
type: Number,
|
|
124
124
|
},
|
|
125
125
|
maxSize: {
|
|
@@ -170,6 +170,14 @@ const { emitUpdate, enableForm, disableForm } = useField({
|
|
|
170
170
|
errorType: 'alert',
|
|
171
171
|
});
|
|
172
172
|
|
|
173
|
+
const normalizedMax = computed(() => {
|
|
174
|
+
if (props.max == null) {
|
|
175
|
+
return 100;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return props.max;
|
|
179
|
+
});
|
|
180
|
+
|
|
173
181
|
const currentMediaInternal = ref(cloneDeep(props.currentMedia));
|
|
174
182
|
|
|
175
183
|
const normalizedModelValue = computed(() => {
|
|
@@ -203,10 +211,12 @@ function onUploadSuccess(file: UploadedFile) {
|
|
|
203
211
|
return;
|
|
204
212
|
}
|
|
205
213
|
|
|
206
|
-
if (numberOfFiles.value >=
|
|
214
|
+
if (numberOfFiles.value >= normalizedMax.value && normalizedMax.value > 1) {
|
|
207
215
|
notifications.push({
|
|
208
216
|
title: i18n.t('sui.whoops'),
|
|
209
|
-
text: i18n.t('sui.you_can_upload_up_to_n_files', {
|
|
217
|
+
text: i18n.t('sui.you_can_upload_up_to_n_files', {
|
|
218
|
+
count: normalizedMax.value,
|
|
219
|
+
}),
|
|
210
220
|
color: 'danger',
|
|
211
221
|
});
|
|
212
222
|
return;
|
|
@@ -214,7 +224,7 @@ function onUploadSuccess(file: UploadedFile) {
|
|
|
214
224
|
|
|
215
225
|
const modelValue = cloneDeep(normalizedModelValue.value);
|
|
216
226
|
|
|
217
|
-
if (
|
|
227
|
+
if (normalizedMax.value == 1) {
|
|
218
228
|
// Remove everything...
|
|
219
229
|
modelValue.to_remove.push(...currentMediaInternal.value.map((m) => m.id));
|
|
220
230
|
modelValue.to_add = [];
|
|
@@ -277,7 +287,9 @@ function sync(modelValue: MediaLibraryPayload) {
|
|
|
277
287
|
}
|
|
278
288
|
|
|
279
289
|
const maxFileText = computed(() => {
|
|
280
|
-
return i18n.t('sui.you_can_upload_up_to_n_files', {
|
|
290
|
+
return i18n.t('sui.you_can_upload_up_to_n_files', {
|
|
291
|
+
count: normalizedMax.value,
|
|
292
|
+
});
|
|
281
293
|
});
|
|
282
294
|
|
|
283
295
|
const maxFileSize = computed(() => {
|
package/src/components/index.ts
CHANGED
|
@@ -31,6 +31,7 @@ import BaseDialog from './BaseDialog.vue';
|
|
|
31
31
|
import BaseDisplayRelativeTime from './BaseDisplayRelativeTime.vue';
|
|
32
32
|
import BaseDropdown from './BaseDropdown.vue';
|
|
33
33
|
import BaseDropdownAutocomplete from './BaseDropdownAutocomplete.vue';
|
|
34
|
+
import BaseEmptyState from '@/svg/BaseEmptyState.vue';
|
|
34
35
|
import BaseField from './BaseField.vue';
|
|
35
36
|
import BaseFieldI18n from './BaseFieldI18n.vue';
|
|
36
37
|
import BaseFilePicker from './BaseFilePicker.vue';
|
|
@@ -117,6 +118,7 @@ export {
|
|
|
117
118
|
BaseDisplayRelativeTime,
|
|
118
119
|
BaseDropdown,
|
|
119
120
|
BaseDropdownAutocomplete,
|
|
121
|
+
BaseEmptyState,
|
|
120
122
|
BaseField,
|
|
121
123
|
BaseFieldI18n,
|
|
122
124
|
BaseFilePicker,
|