adminforth 1.18.0 → 1.19.0
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.
|
@@ -241,7 +241,7 @@ async function installDependencies(ctx, cwd) {
|
|
|
241
241
|
const customDir = ctx.customDir;
|
|
242
242
|
|
|
243
243
|
await Promise.all([
|
|
244
|
-
await execa('npm', ['install'
|
|
244
|
+
await execa('npm', ['install'], { cwd }),
|
|
245
245
|
await execa('npm', ['install'], { cwd: customDir }),
|
|
246
246
|
]);
|
|
247
247
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
2
|
+
<!-- tag form used to reset the input (method .reset() in claer() function) -->
|
|
3
|
+
<form class="flex items-center justify-center w-full"
|
|
3
4
|
@dragover.prevent="dragging = true"
|
|
4
5
|
@dragleave.prevent="dragging = false"
|
|
5
6
|
@drop.prevent="dragging = false; doEmit($event.dataTransfer.files)"
|
|
@@ -43,12 +44,12 @@
|
|
|
43
44
|
:multiple="props.multiple || false"
|
|
44
45
|
/>
|
|
45
46
|
</label>
|
|
46
|
-
|
|
47
|
+
</form>
|
|
47
48
|
</template>
|
|
48
49
|
|
|
49
50
|
<script setup lang="ts">
|
|
50
51
|
import { humanifySize } from '@/utils';
|
|
51
|
-
import { ref, type Ref } from 'vue';
|
|
52
|
+
import { ref, defineExpose, type Ref } from 'vue';
|
|
52
53
|
import { IconFileSolid } from '@iconify-prerendered/vue-flowbite';
|
|
53
54
|
import { watch } from 'vue';
|
|
54
55
|
import adminforth from '@/adminforth';
|
|
@@ -125,4 +126,14 @@ function doEmit(filesIn: FileList) {
|
|
|
125
126
|
|
|
126
127
|
const dragging = ref(false);
|
|
127
128
|
|
|
129
|
+
function clear() {
|
|
130
|
+
selectedFiles.value = [];
|
|
131
|
+
emit('update:modelValue', []);
|
|
132
|
+
const form = document.getElementById(id)?.closest('form');
|
|
133
|
+
form?.reset();
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
defineExpose({
|
|
137
|
+
clear,
|
|
138
|
+
});
|
|
128
139
|
</script>
|
|
@@ -16,7 +16,9 @@ import { computed, ref, onMounted, nextTick } from 'vue';
|
|
|
16
16
|
import { IconFileCopyAltSolid } from '@iconify-prerendered/vue-flowbite';
|
|
17
17
|
import Tooltip from '@/afcl/Tooltip.vue';
|
|
18
18
|
import adminforth from '@/adminforth';
|
|
19
|
+
import { useI18n } from 'vue-i18n';
|
|
19
20
|
|
|
21
|
+
const { t } = useI18n();
|
|
20
22
|
const visualValue = computed(() => {
|
|
21
23
|
// if lenght is more then 8, show only first 4 and last 4 characters, ... in the middle
|
|
22
24
|
const val = props.record[props.column.name];
|
|
@@ -33,7 +35,7 @@ const id = ref();
|
|
|
33
35
|
function copyToCB() {
|
|
34
36
|
navigator.clipboard.writeText(props.record[props.column.name]);
|
|
35
37
|
adminforth.alert({
|
|
36
|
-
message: 'ID copied to clipboard',
|
|
38
|
+
message: t('ID copied to clipboard'),
|
|
37
39
|
variant: 'success',
|
|
38
40
|
})
|
|
39
41
|
}
|
|
@@ -16,7 +16,9 @@ import { computed, ref, onMounted, nextTick } from 'vue';
|
|
|
16
16
|
import { IconFileCopyAltSolid } from '@iconify-prerendered/vue-flowbite';
|
|
17
17
|
import Tooltip from '@/afcl/Tooltip.vue';
|
|
18
18
|
import adminforth from '@/adminforth';
|
|
19
|
+
import { useI18n } from 'vue-i18n';
|
|
19
20
|
|
|
21
|
+
const { t } = useI18n();
|
|
20
22
|
const visualValue = computed(() => {
|
|
21
23
|
// if lenght is more then 8, show only first 4 and last 4 characters, ... in the middle
|
|
22
24
|
const val = props.record[props.column.name];
|
|
@@ -33,7 +35,7 @@ const id = ref();
|
|
|
33
35
|
function copyToCB() {
|
|
34
36
|
navigator.clipboard.writeText(props.record[props.column.name]);
|
|
35
37
|
adminforth.alert({
|
|
36
|
-
message: 'ID copied to clipboard',
|
|
38
|
+
message: t('ID copied to clipboard'),
|
|
37
39
|
variant: 'success',
|
|
38
40
|
})
|
|
39
41
|
}
|
|
@@ -81,7 +81,9 @@ import { useRoute, useRouter } from 'vue-router';
|
|
|
81
81
|
import { showErrorTost } from '@/composables/useFrontendApi';
|
|
82
82
|
import ThreeDotsMenu from '@/components/ThreeDotsMenu.vue';
|
|
83
83
|
import adminforth from '@/adminforth';
|
|
84
|
+
import { useI18n } from 'vue-i18n';
|
|
84
85
|
|
|
86
|
+
const { t } = useI18n();
|
|
85
87
|
const coreStore = useCoreStore();
|
|
86
88
|
|
|
87
89
|
const isValid = ref(false);
|
|
@@ -170,7 +172,7 @@ async function saveRecord() {
|
|
|
170
172
|
showErrorTost(resp.error);
|
|
171
173
|
} else {
|
|
172
174
|
adminforth.alert({
|
|
173
|
-
message: 'Record updated successfully',
|
|
175
|
+
message: t('Record updated successfully'),
|
|
174
176
|
variant: 'success',
|
|
175
177
|
timeout: 400000
|
|
176
178
|
});
|