sprintify-ui 0.0.7 → 0.0.9
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/README.md +146 -41
- package/dist/sprintify-ui.es.js +2699 -2674
- package/dist/tailwindcss/index.js +46 -0
- package/dist/types/src/index.d.ts +32 -28
- package/package.json +3 -3
- package/src/components/BaseApp.vue +3 -2
- package/src/components/BaseAutocomplete.stories.js +0 -1
- package/src/components/BaseAutocompleteFetch.stories.js +0 -1
- package/src/components/BaseBelongsTo.stories.js +0 -1
- package/src/components/BaseDataTable.vue +4 -4
- package/src/components/BaseDatePicker.stories.js +0 -5
- package/src/components/BaseDateSelect.stories.js +41 -0
- package/src/components/BaseDateSelect.vue +1 -1
- package/src/components/BaseDescriptionList.stories.js +35 -0
- package/src/components/BaseDescriptionList.vue +3 -1
- package/src/components/BaseFileUploader.vue +11 -6
- package/src/components/BaseMediaLibrary.vue +10 -10
- package/src/components/BaseSkeleton.vue +1 -1
- package/src/components/BaseTagAutocomplete.vue +4 -4
- package/src/index.ts +2 -0
- package/src/lang/en.json +9 -8
- package/src/lang/fr.json +9 -8
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const plugin = require('tailwindcss/plugin');
|
|
2
|
+
|
|
3
|
+
module.exports = plugin(
|
|
4
|
+
function () {
|
|
5
|
+
//
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
theme: {
|
|
9
|
+
zIndex: {
|
|
10
|
+
status: '20',
|
|
11
|
+
menu: '30',
|
|
12
|
+
modal: '40',
|
|
13
|
+
notifications: '50',
|
|
14
|
+
loading: '100',
|
|
15
|
+
},
|
|
16
|
+
animation: {
|
|
17
|
+
shake: 'shake 0.8s cubic-bezier(0.455, 0.03, 0.515, 0.955) both',
|
|
18
|
+
shimmer: 'shimmer 2s infinite both',
|
|
19
|
+
},
|
|
20
|
+
keyframes: {
|
|
21
|
+
shimmer: {
|
|
22
|
+
'100%': {
|
|
23
|
+
transform: 'translateX(100%)',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
shake: {
|
|
27
|
+
'0%, 100%': {
|
|
28
|
+
transform: 'translateX(0)',
|
|
29
|
+
},
|
|
30
|
+
'10%, 30%, 50%, 70%': {
|
|
31
|
+
transform: 'translateX(-10px)',
|
|
32
|
+
},
|
|
33
|
+
'20%, 40%, 60%': {
|
|
34
|
+
transform: 'translateX(10px)',
|
|
35
|
+
},
|
|
36
|
+
'80%': {
|
|
37
|
+
transform: 'translateX(8px)',
|
|
38
|
+
},
|
|
39
|
+
'90%': {
|
|
40
|
+
transform: 'translateX(-8px)',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
}
|
|
46
|
+
);
|
|
@@ -45,13 +45,6 @@ declare const messages: {
|
|
|
45
45
|
the_file_size_must_not_exceed_x: string;
|
|
46
46
|
the_file_type_is_invalid: string;
|
|
47
47
|
type_to_start_your_search: string;
|
|
48
|
-
up_to_x: string;
|
|
49
|
-
whoops: string;
|
|
50
|
-
x_rows_selected: string;
|
|
51
|
-
year: string;
|
|
52
|
-
yes_delete: string;
|
|
53
|
-
you_can_upload_up_to_n_files: string;
|
|
54
|
-
you_cannot_select_more_than_x_items: string;
|
|
55
48
|
units: {
|
|
56
49
|
b: string;
|
|
57
50
|
gb: string;
|
|
@@ -59,6 +52,14 @@ declare const messages: {
|
|
|
59
52
|
mb: string;
|
|
60
53
|
tb: string;
|
|
61
54
|
};
|
|
55
|
+
up_to_x: string;
|
|
56
|
+
upload_failed: string;
|
|
57
|
+
whoops: string;
|
|
58
|
+
x_rows_selected: string;
|
|
59
|
+
year: string;
|
|
60
|
+
yes_delete: string;
|
|
61
|
+
you_can_upload_up_to_n_files: string;
|
|
62
|
+
you_cannot_select_more_than_x_items: string;
|
|
62
63
|
};
|
|
63
64
|
};
|
|
64
65
|
fr: {
|
|
@@ -101,13 +102,6 @@ declare const messages: {
|
|
|
101
102
|
the_file_size_must_not_exceed_x: string;
|
|
102
103
|
the_file_type_is_invalid: string;
|
|
103
104
|
type_to_start_your_search: string;
|
|
104
|
-
up_to_x: string;
|
|
105
|
-
whoops: string;
|
|
106
|
-
x_rows_selected: string;
|
|
107
|
-
year: string;
|
|
108
|
-
yes_delete: string;
|
|
109
|
-
you_can_upload_up_to_n_files: string;
|
|
110
|
-
you_cannot_select_more_than_x_items: string;
|
|
111
105
|
units: {
|
|
112
106
|
b: string;
|
|
113
107
|
gb: string;
|
|
@@ -115,6 +109,14 @@ declare const messages: {
|
|
|
115
109
|
mb: string;
|
|
116
110
|
tb: string;
|
|
117
111
|
};
|
|
112
|
+
up_to_x: string;
|
|
113
|
+
upload_failed: string;
|
|
114
|
+
whoops: string;
|
|
115
|
+
x_rows_selected: string;
|
|
116
|
+
year: string;
|
|
117
|
+
yes_delete: string;
|
|
118
|
+
you_can_upload_up_to_n_files: string;
|
|
119
|
+
you_cannot_select_more_than_x_items: string;
|
|
118
120
|
};
|
|
119
121
|
};
|
|
120
122
|
};
|
|
@@ -168,13 +170,6 @@ declare const config: {
|
|
|
168
170
|
the_file_size_must_not_exceed_x: string;
|
|
169
171
|
the_file_type_is_invalid: string;
|
|
170
172
|
type_to_start_your_search: string;
|
|
171
|
-
up_to_x: string;
|
|
172
|
-
whoops: string;
|
|
173
|
-
x_rows_selected: string;
|
|
174
|
-
year: string;
|
|
175
|
-
yes_delete: string;
|
|
176
|
-
you_can_upload_up_to_n_files: string;
|
|
177
|
-
you_cannot_select_more_than_x_items: string;
|
|
178
173
|
units: {
|
|
179
174
|
b: string;
|
|
180
175
|
gb: string;
|
|
@@ -182,6 +177,14 @@ declare const config: {
|
|
|
182
177
|
mb: string;
|
|
183
178
|
tb: string;
|
|
184
179
|
};
|
|
180
|
+
up_to_x: string;
|
|
181
|
+
upload_failed: string;
|
|
182
|
+
whoops: string;
|
|
183
|
+
x_rows_selected: string;
|
|
184
|
+
year: string;
|
|
185
|
+
yes_delete: string;
|
|
186
|
+
you_can_upload_up_to_n_files: string;
|
|
187
|
+
you_cannot_select_more_than_x_items: string;
|
|
185
188
|
};
|
|
186
189
|
};
|
|
187
190
|
fr: {
|
|
@@ -224,13 +227,6 @@ declare const config: {
|
|
|
224
227
|
the_file_size_must_not_exceed_x: string;
|
|
225
228
|
the_file_type_is_invalid: string;
|
|
226
229
|
type_to_start_your_search: string;
|
|
227
|
-
up_to_x: string;
|
|
228
|
-
whoops: string;
|
|
229
|
-
x_rows_selected: string;
|
|
230
|
-
year: string;
|
|
231
|
-
yes_delete: string;
|
|
232
|
-
you_can_upload_up_to_n_files: string;
|
|
233
|
-
you_cannot_select_more_than_x_items: string;
|
|
234
230
|
units: {
|
|
235
231
|
b: string;
|
|
236
232
|
gb: string;
|
|
@@ -238,6 +234,14 @@ declare const config: {
|
|
|
238
234
|
mb: string;
|
|
239
235
|
tb: string;
|
|
240
236
|
};
|
|
237
|
+
up_to_x: string;
|
|
238
|
+
upload_failed: string;
|
|
239
|
+
whoops: string;
|
|
240
|
+
x_rows_selected: string;
|
|
241
|
+
year: string;
|
|
242
|
+
yes_delete: string;
|
|
243
|
+
you_can_upload_up_to_n_files: string;
|
|
244
|
+
you_cannot_select_more_than_x_items: string;
|
|
241
245
|
};
|
|
242
246
|
};
|
|
243
247
|
}, {}, {}, string, true>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sprintify-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "rimraf dist && vue-tsc && vite build",
|
|
6
6
|
"docs:dev": "vitepress dev docs",
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
"@tailwindcss/line-clamp": "^0.4.2",
|
|
44
44
|
"@tailwindcss/typography": "^0.5.8",
|
|
45
45
|
"@types/luxon": "^3.1.0",
|
|
46
|
-
"@types/node": "^17.0.45",
|
|
47
46
|
"@types/object-hash": "^2.2.1",
|
|
48
47
|
"@types/pikaday": "^1.7.6",
|
|
49
48
|
"@types/qs": "^6.9.7",
|
|
@@ -95,6 +94,7 @@
|
|
|
95
94
|
".": {
|
|
96
95
|
"import": "./dist/sprintify-ui.es.js"
|
|
97
96
|
},
|
|
98
|
-
"./dist/style.css": "./dist/style.css"
|
|
97
|
+
"./dist/style.css": "./dist/style.css",
|
|
98
|
+
"./tailwindcss": "./dist/tailwindcss/index.js"
|
|
99
99
|
}
|
|
100
100
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
<div class="min-h-full">
|
|
3
3
|
<slot />
|
|
4
4
|
|
|
5
|
-
<!-- Notifications
|
|
6
|
-
<BaseAppNotifications
|
|
5
|
+
<!-- Notifications -->
|
|
6
|
+
<BaseAppNotifications />
|
|
7
7
|
|
|
8
8
|
<!-- Dialogs -->
|
|
9
9
|
<BaseAppDialogs />
|
|
@@ -12,4 +12,5 @@
|
|
|
12
12
|
|
|
13
13
|
<script lang="ts" setup>
|
|
14
14
|
import BaseAppDialogs from './BaseAppDialogs.vue';
|
|
15
|
+
import BaseAppNotifications from './BaseAppNotifications.vue';
|
|
15
16
|
</script>
|
|
@@ -167,7 +167,7 @@ import {
|
|
|
167
167
|
MenuItemInterface,
|
|
168
168
|
} from '@/types/types';
|
|
169
169
|
import { useDialogsStore } from '@/stores/dialogs';
|
|
170
|
-
|
|
170
|
+
import { useNotificationsStore } from '../stores/notifications';
|
|
171
171
|
import BaseDataIterator from './BaseDataIterator.vue';
|
|
172
172
|
import { isArray } from 'lodash';
|
|
173
173
|
|
|
@@ -183,7 +183,7 @@ const i18n = useI18n();
|
|
|
183
183
|
const http = config.http;
|
|
184
184
|
|
|
185
185
|
const dialogs = useDialogsStore();
|
|
186
|
-
|
|
186
|
+
const notifications = useNotificationsStore();
|
|
187
187
|
|
|
188
188
|
const table = ref(null) as Ref<null | InstanceType<typeof BaseTable>>;
|
|
189
189
|
|
|
@@ -401,11 +401,11 @@ const onDelete = (row: CollectionItem) => {
|
|
|
401
401
|
|
|
402
402
|
http.delete(props.deleteUrl(row)).then((response) => {
|
|
403
403
|
if (response.data && response.data.message) {
|
|
404
|
-
|
|
404
|
+
notifications.push({
|
|
405
405
|
title: i18n.t('sui.success'),
|
|
406
406
|
text: response.data.message,
|
|
407
407
|
color: 'success',
|
|
408
|
-
});
|
|
408
|
+
});
|
|
409
409
|
}
|
|
410
410
|
emit('delete', row);
|
|
411
411
|
|
|
@@ -21,33 +21,28 @@ const Template = (args) => ({
|
|
|
21
21
|
export const Demo = Template.bind({});
|
|
22
22
|
Demo.args = {
|
|
23
23
|
modelValue: '2023-01-01',
|
|
24
|
-
inputClass: 'border-slate-300',
|
|
25
24
|
};
|
|
26
25
|
|
|
27
26
|
export const YearRange = Template.bind({});
|
|
28
27
|
YearRange.args = {
|
|
29
28
|
modelValue: '1980-11-16',
|
|
30
|
-
inputClass: 'border-slate-300',
|
|
31
29
|
yearRange: [1920, 2020],
|
|
32
30
|
};
|
|
33
31
|
|
|
34
32
|
export const MinDate = Template.bind({});
|
|
35
33
|
MinDate.args = {
|
|
36
34
|
modelValue: '2022-11-16',
|
|
37
|
-
inputClass: 'border-slate-300',
|
|
38
35
|
minDate: DateTime.fromISO('2022-11-10').toJSDate(),
|
|
39
36
|
};
|
|
40
37
|
|
|
41
38
|
export const MaxDate = Template.bind({});
|
|
42
39
|
MaxDate.args = {
|
|
43
40
|
modelValue: '2022-11-16',
|
|
44
|
-
inputClass: 'border-slate-300',
|
|
45
41
|
maxDate: DateTime.fromISO('2022-11-20').toJSDate(),
|
|
46
42
|
};
|
|
47
43
|
|
|
48
44
|
export const Disabled = Template.bind({});
|
|
49
45
|
Disabled.args = {
|
|
50
46
|
modelValue: '2022-11-16',
|
|
51
|
-
inputClass: 'border-slate-300',
|
|
52
47
|
disabled: true,
|
|
53
48
|
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import BaseDateSelect from './BaseDateSelect.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Form/BaseDateSelect',
|
|
5
|
+
component: BaseDateSelect,
|
|
6
|
+
argTypes: {},
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const Template = (args) => ({
|
|
10
|
+
components: { BaseDateSelect },
|
|
11
|
+
setup() {
|
|
12
|
+
return { args };
|
|
13
|
+
},
|
|
14
|
+
template: `
|
|
15
|
+
<BaseDateSelect v-bind="args">
|
|
16
|
+
</BaseDateSelect>
|
|
17
|
+
`,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const Demo = Template.bind({});
|
|
21
|
+
Demo.args = {
|
|
22
|
+
modelValue: '2021-01-01',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const MinYear = Template.bind({});
|
|
26
|
+
MinYear.args = {
|
|
27
|
+
modelValue: '2022-11-16',
|
|
28
|
+
minYear: 1980,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const MaxYear = Template.bind({});
|
|
32
|
+
MaxYear.args = {
|
|
33
|
+
modelValue: '2002-11-16',
|
|
34
|
+
maxYear: 2010,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const Disabled = Template.bind({});
|
|
38
|
+
Disabled.args = {
|
|
39
|
+
modelValue: '2022-11-16',
|
|
40
|
+
disabled: true,
|
|
41
|
+
};
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
<button
|
|
81
81
|
type="button"
|
|
82
82
|
:disabled="disabled"
|
|
83
|
-
class="mt-1 appearance-none border-transparent bg-transparent text-sm text-slate-700 underline outline-none"
|
|
83
|
+
class="mt-1 appearance-none border-transparent bg-transparent text-sm text-slate-700 underline outline-none disabled:cursor-not-allowed disabled:opacity-50"
|
|
84
84
|
@click="clear()"
|
|
85
85
|
>
|
|
86
86
|
<span>{{ $t('sui.clear') }}</span>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import BaseBadge from './BaseBadge.vue';
|
|
2
|
+
import BaseDescriptionList from './BaseDescriptionList.vue';
|
|
3
|
+
import BaseDescriptionListItem from './BaseDescriptionListItem.vue';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Components/BaseDescriptionList',
|
|
7
|
+
component: BaseDescriptionList,
|
|
8
|
+
argTypes: {},
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const Template = (args) => ({
|
|
12
|
+
components: { BaseDescriptionList, BaseDescriptionListItem, BaseBadge },
|
|
13
|
+
setup() {
|
|
14
|
+
return { args };
|
|
15
|
+
},
|
|
16
|
+
template: `
|
|
17
|
+
<BaseDescriptionList v-bind="args">
|
|
18
|
+
<BaseDescriptionListItem>
|
|
19
|
+
<template #left>Full name</template>
|
|
20
|
+
<template #right>Full name</template>
|
|
21
|
+
</BaseDescriptionListItem>
|
|
22
|
+
<BaseDescriptionListItem>
|
|
23
|
+
<template #left>Age</template>
|
|
24
|
+
<template #right>66 years old</template>
|
|
25
|
+
</BaseDescriptionListItem>
|
|
26
|
+
<BaseDescriptionListItem>
|
|
27
|
+
<template #left>Role</template>
|
|
28
|
+
<template #right><BaseBadge color="indigo">admin</BaseBadge></template>
|
|
29
|
+
</BaseDescriptionListItem>
|
|
30
|
+
</BaseDescriptionList>
|
|
31
|
+
`,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export const Demo = Template.bind({});
|
|
35
|
+
Demo.args = {};
|
|
@@ -36,11 +36,11 @@ import { config } from '@/index';
|
|
|
36
36
|
import { PropType } from 'vue';
|
|
37
37
|
import { UploadedFile } from '@/types/UploadedFile';
|
|
38
38
|
import { toHumanList, fileSizeFormat } from '../utils';
|
|
39
|
-
|
|
39
|
+
import { useNotificationsStore } from '../stores/notifications';
|
|
40
40
|
|
|
41
41
|
const http = config.http;
|
|
42
42
|
const i18n = useI18n();
|
|
43
|
-
|
|
43
|
+
const notifications = useNotificationsStore();
|
|
44
44
|
|
|
45
45
|
const props = defineProps({
|
|
46
46
|
url: {
|
|
@@ -95,13 +95,13 @@ async function onPictureUpload(file: File) {
|
|
|
95
95
|
|
|
96
96
|
try {
|
|
97
97
|
if (file.size > props.maxSize) {
|
|
98
|
-
|
|
98
|
+
notifications.push({
|
|
99
99
|
color: 'danger',
|
|
100
100
|
title: i18n.t('sui.error'),
|
|
101
101
|
text: i18n.t('sui.the_file_size_must_not_exceed_x', {
|
|
102
102
|
x: fileSizeFormat(props.maxSize),
|
|
103
103
|
}),
|
|
104
|
-
});
|
|
104
|
+
});
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
107
|
|
|
@@ -113,7 +113,7 @@ async function onPictureUpload(file: File) {
|
|
|
113
113
|
props.acceptedExtensions.length
|
|
114
114
|
) {
|
|
115
115
|
if (!props.acceptedExtensions.includes(extension)) {
|
|
116
|
-
|
|
116
|
+
notifications.push({
|
|
117
117
|
color: 'danger',
|
|
118
118
|
title: i18n.t('sui.error'),
|
|
119
119
|
text:
|
|
@@ -123,7 +123,7 @@ async function onPictureUpload(file: File) {
|
|
|
123
123
|
' ' +
|
|
124
124
|
toHumanList(props.acceptedExtensions, i18n.t('sui.or')) +
|
|
125
125
|
'.',
|
|
126
|
-
});
|
|
126
|
+
});
|
|
127
127
|
return;
|
|
128
128
|
}
|
|
129
129
|
}
|
|
@@ -158,6 +158,11 @@ async function onPictureUpload(file: File) {
|
|
|
158
158
|
}
|
|
159
159
|
} catch (e: unknown) {
|
|
160
160
|
emit('upload:fail');
|
|
161
|
+
notifications.push({
|
|
162
|
+
color: 'danger',
|
|
163
|
+
title: i18n.t('sui.error'),
|
|
164
|
+
text: i18n.t('sui.upload_failed'),
|
|
165
|
+
});
|
|
161
166
|
} finally {
|
|
162
167
|
emit('upload:end');
|
|
163
168
|
uploading.value = false;
|
|
@@ -91,15 +91,15 @@ import { Media } from '@/types/Media';
|
|
|
91
91
|
import _, { cloneDeep, get } from 'lodash';
|
|
92
92
|
import { PropType } from 'vue';
|
|
93
93
|
import { MediaLibraryPayload } from '@/types/types';
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
import { useDialogsStore } from '../stores/dialogs';
|
|
95
|
+
import { useNotificationsStore } from '../stores/notifications';
|
|
96
96
|
import { capitalize } from 'lodash';
|
|
97
97
|
import { fileSizeFormat } from 'src/utils';
|
|
98
98
|
|
|
99
99
|
const i18n = useI18n();
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
const dialogs = useDialogsStore();
|
|
102
|
+
const notifications = useNotificationsStore();
|
|
103
103
|
|
|
104
104
|
const emit = defineEmits([
|
|
105
105
|
'update',
|
|
@@ -188,11 +188,11 @@ function onUploadSuccess(file: UploadedFile) {
|
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
if (numberOfFiles.value >= props.max && props.max > 1) {
|
|
191
|
-
|
|
191
|
+
notifications.push({
|
|
192
192
|
title: i18n.t('sui.whoops'),
|
|
193
193
|
text: i18n.t('sui.you_can_upload_up_to_n_files', { count: props.max }),
|
|
194
194
|
color: 'danger',
|
|
195
|
-
});
|
|
195
|
+
});
|
|
196
196
|
return;
|
|
197
197
|
}
|
|
198
198
|
|
|
@@ -213,25 +213,25 @@ function onUploadSuccess(file: UploadedFile) {
|
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
function promptRemoveUploadedFile(index: number, length = 1) {
|
|
216
|
-
|
|
216
|
+
dialogs.push({
|
|
217
217
|
title: i18n.t('sui.remove_file'),
|
|
218
218
|
message: i18n.t('sui.remove_file_description'),
|
|
219
219
|
color: 'warning',
|
|
220
220
|
onConfirm() {
|
|
221
221
|
removeUploadedFile(index, length);
|
|
222
222
|
},
|
|
223
|
-
});
|
|
223
|
+
});
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
function promptRemoveMedia(index: number) {
|
|
227
|
-
|
|
227
|
+
dialogs.push({
|
|
228
228
|
title: i18n.t('sui.remove_file'),
|
|
229
229
|
message: i18n.t('sui.remove_file_description'),
|
|
230
230
|
color: 'warning',
|
|
231
231
|
onConfirm() {
|
|
232
232
|
removeMedia(index);
|
|
233
233
|
},
|
|
234
|
-
});
|
|
234
|
+
});
|
|
235
235
|
}
|
|
236
236
|
|
|
237
237
|
function removeUploadedFile(index: number, length = 1) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="relative isolate overflow-hidden rounded" :class="[background]">
|
|
3
3
|
<div
|
|
4
|
-
class="absolute inset-0 -translate-x-full
|
|
4
|
+
class="animate-shimmer absolute inset-0 -translate-x-full border-t border-white/80 bg-gradient-to-r from-transparent via-white/80 to-transparent"
|
|
5
5
|
:style="{
|
|
6
6
|
animationDelay: delay,
|
|
7
7
|
}"
|
|
@@ -83,7 +83,7 @@ import { PropType, Ref, ComputedRef } from 'vue';
|
|
|
83
83
|
import { NormalizedOption, Option, OptionValue } from '@/types/types';
|
|
84
84
|
import { useInfiniteScroll } from '@vueuse/core';
|
|
85
85
|
import BaseLoadingCover from './BaseLoadingCover.vue';
|
|
86
|
-
|
|
86
|
+
import { useNotificationsStore } from '@/stores/notifications';
|
|
87
87
|
|
|
88
88
|
const props = defineProps({
|
|
89
89
|
modelValue: {
|
|
@@ -140,7 +140,7 @@ const emit = defineEmits([
|
|
|
140
140
|
]);
|
|
141
141
|
|
|
142
142
|
const i18n = useI18n();
|
|
143
|
-
|
|
143
|
+
const notifications = useNotificationsStore();
|
|
144
144
|
|
|
145
145
|
const timerId = ref(0);
|
|
146
146
|
const keywords = ref('');
|
|
@@ -308,11 +308,11 @@ const toggleOption = (option: NormalizedOption) => {
|
|
|
308
308
|
|
|
309
309
|
const addOption = (option: NormalizedOption) => {
|
|
310
310
|
if (props.max && normalizedModelValue.value.length >= props.max) {
|
|
311
|
-
|
|
311
|
+
notifications.push({
|
|
312
312
|
title: i18n.t('sui.whoops'),
|
|
313
313
|
text: i18n.t('sui.you_cannot_select_more_than_x_items', { x: props.max }),
|
|
314
314
|
color: 'warning',
|
|
315
|
-
});
|
|
315
|
+
});
|
|
316
316
|
return;
|
|
317
317
|
}
|
|
318
318
|
|
package/src/index.ts
CHANGED
package/src/lang/en.json
CHANGED
|
@@ -38,19 +38,20 @@
|
|
|
38
38
|
"the_file_size_must_not_exceed_x": "The file size must not exceed {x}",
|
|
39
39
|
"the_file_type_is_invalid": "The file type is invalid",
|
|
40
40
|
"type_to_start_your_search": "Type to start your search",
|
|
41
|
-
"up_to_x": "Up to {x}",
|
|
42
|
-
"whoops": "Whoops",
|
|
43
|
-
"x_rows_selected": "1 item selected | {count} items selected",
|
|
44
|
-
"year": "Year",
|
|
45
|
-
"yes_delete": "Yes, delete",
|
|
46
|
-
"you_can_upload_up_to_n_files": "You can upload one file at most|You can upload up to {count} files",
|
|
47
|
-
"you_cannot_select_more_than_x_items": "You can't select more than one item|You can't select more than {x} items",
|
|
48
41
|
"units": {
|
|
49
42
|
"b": "B",
|
|
50
43
|
"gb": "GB",
|
|
51
44
|
"kb": "kB",
|
|
52
45
|
"mb": "MB",
|
|
53
46
|
"tb": "TB"
|
|
54
|
-
}
|
|
47
|
+
},
|
|
48
|
+
"up_to_x": "Up to {x}",
|
|
49
|
+
"upload_failed": "Upload failed",
|
|
50
|
+
"whoops": "Whoops",
|
|
51
|
+
"x_rows_selected": "1 item selected | {count} items selected",
|
|
52
|
+
"year": "Year",
|
|
53
|
+
"yes_delete": "Yes, delete",
|
|
54
|
+
"you_can_upload_up_to_n_files": "You can upload one file at most|You can upload up to {count} files",
|
|
55
|
+
"you_cannot_select_more_than_x_items": "You can't select more than one item|You can't select more than {x} items"
|
|
55
56
|
}
|
|
56
57
|
}
|
package/src/lang/fr.json
CHANGED
|
@@ -38,19 +38,20 @@
|
|
|
38
38
|
"the_file_size_must_not_exceed_x": "La taille du fichier ne doit pas dépasser {x}",
|
|
39
39
|
"the_file_type_is_invalid": "Le type de fichier n'est pas valide",
|
|
40
40
|
"type_to_start_your_search": "Tapez pour lancer votre recherche",
|
|
41
|
-
"up_to_x": "Jusqu'à {x}",
|
|
42
|
-
"whoops": "Oups",
|
|
43
|
-
"x_rows_selected": "1 item sélectionné | \n{count} items sélectionnés",
|
|
44
|
-
"year": "An",
|
|
45
|
-
"yes_delete": "Oui, supprimer",
|
|
46
|
-
"you_can_upload_up_to_n_files": "Vous pouvez télécharger un fichier au maximum|Vous pouvez télécharger jusqu'à {count} fichiers",
|
|
47
|
-
"you_cannot_select_more_than_x_items": "Vous ne pouvez pas sélectionner plus de un élément|Vous ne pouvez pas sélectionner plus de {x} éléments",
|
|
48
41
|
"units": {
|
|
49
42
|
"b": "o",
|
|
50
43
|
"gb": "Go",
|
|
51
44
|
"kb": "Ko",
|
|
52
45
|
"mb": "Mo",
|
|
53
46
|
"tb": "To"
|
|
54
|
-
}
|
|
47
|
+
},
|
|
48
|
+
"up_to_x": "Jusqu'à {x}",
|
|
49
|
+
"upload_failed": "Le téléchargement a échoué",
|
|
50
|
+
"whoops": "Oups",
|
|
51
|
+
"x_rows_selected": "1 item sélectionné | \n{count} items sélectionnés",
|
|
52
|
+
"year": "An",
|
|
53
|
+
"yes_delete": "Oui, supprimer",
|
|
54
|
+
"you_can_upload_up_to_n_files": "Vous pouvez télécharger un fichier au maximum|Vous pouvez télécharger jusqu'à {count} fichiers",
|
|
55
|
+
"you_cannot_select_more_than_x_items": "Vous ne pouvez pas sélectionner plus de un élément|Vous ne pouvez pas sélectionner plus de {x} éléments"
|
|
55
56
|
}
|
|
56
57
|
}
|