@adminforth/import-export 1.4.0 → 1.4.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/.woodpecker/release.yml +0 -2
- package/build.log +2 -2
- package/custom/ExportCsv.vue +9 -1
- package/custom/ImportCsv.vue +12 -4
- package/dist/custom/ExportCsv.vue +9 -1
- package/dist/custom/ImportCsv.vue +12 -4
- package/package.json +4 -1
package/.woodpecker/release.yml
CHANGED
package/build.log
CHANGED
|
@@ -10,5 +10,5 @@ custom/package-lock.json
|
|
|
10
10
|
custom/package.json
|
|
11
11
|
custom/tsconfig.json
|
|
12
12
|
|
|
13
|
-
sent 16,
|
|
14
|
-
total size is 16,
|
|
13
|
+
sent 16,789 bytes received 115 bytes 33,808.00 bytes/sec
|
|
14
|
+
total size is 16,369 speedup is 0.97
|
package/custom/ExportCsv.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div class="cursor-pointer flex gap-2 items-center">
|
|
3
3
|
{{$t("Export")}} {{ meta.select === 'all' ? $t('All'): $t('Filtered') }} {{$t('to CSV')}}
|
|
4
4
|
|
|
5
5
|
<svg v-if="inProgress"
|
|
@@ -19,6 +19,10 @@ const filtersStore = useFiltersStore();
|
|
|
19
19
|
const coreStore = useCoreStore();
|
|
20
20
|
const inProgress = ref(false);
|
|
21
21
|
|
|
22
|
+
defineExpose({
|
|
23
|
+
click,
|
|
24
|
+
});
|
|
25
|
+
|
|
22
26
|
const props = defineProps({
|
|
23
27
|
meta: Object,
|
|
24
28
|
record: Object,
|
|
@@ -77,4 +81,8 @@ async function exportCsv() {
|
|
|
77
81
|
adminforth.list.closeThreeDotsDropdown();
|
|
78
82
|
}
|
|
79
83
|
}
|
|
84
|
+
|
|
85
|
+
function click() {
|
|
86
|
+
exportCsv();
|
|
87
|
+
}
|
|
80
88
|
</script>
|
package/custom/ImportCsv.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
3
|
:class="[
|
|
4
4
|
'cursor-pointer flex gap-2 items-center',
|
|
5
5
|
checkProgress ? 'opacity-50 pointer-events-none' : ''
|
|
@@ -53,7 +53,11 @@ import Papa from 'papaparse';
|
|
|
53
53
|
import { Dialog } from '@/afcl';
|
|
54
54
|
import { useI18n } from 'vue-i18n';
|
|
55
55
|
|
|
56
|
+
|
|
56
57
|
const { t } = useI18n();
|
|
58
|
+
defineExpose({
|
|
59
|
+
click,
|
|
60
|
+
});
|
|
57
61
|
|
|
58
62
|
const importProgress: Ref<boolean> = ref(false);
|
|
59
63
|
const checkProgress: Ref<boolean> = ref(false);
|
|
@@ -70,9 +74,9 @@ const computedButtons = computed(() => {
|
|
|
70
74
|
const buttons = [
|
|
71
75
|
{ label: t('⚠️ Import All — Replace & Overwrite'), onclick: (dialog) => { confirmImport(dialog) }, visible: importStats.value.existingCount > 0 && importStats.value.newCount > 0 },
|
|
72
76
|
{ label: t('⚠️ Replace Existing Records'), onclick: (dialog) => { confirmImport(dialog) }, visible: importStats.value.existingCount > 0 && importStats.value.newCount === 0 },
|
|
73
|
-
{ label: t('
|
|
74
|
-
{ label: t('
|
|
75
|
-
{ label: t('
|
|
77
|
+
{ label: t('Import New Only'), onclick: (dialog) => { confirmImportNewOnly(dialog) }, visible: importStats.value.existingCount > 0 && importStats.value.newCount > 0 },
|
|
78
|
+
{ label: t('Import Records'), onclick: (dialog) => { confirmImportNewOnly(dialog) }, visible: importStats.value.existingCount === 0 && importStats.value.newCount > 0 },
|
|
79
|
+
{ label: t('Cancel'), onclick: (dialog) => dialog.hide() }
|
|
76
80
|
];
|
|
77
81
|
|
|
78
82
|
return buttons.filter(button => button.visible !== false);
|
|
@@ -216,4 +220,8 @@ function handleImportClick() {
|
|
|
216
220
|
importCsv();
|
|
217
221
|
}
|
|
218
222
|
}
|
|
223
|
+
|
|
224
|
+
function click() {
|
|
225
|
+
importCsv();
|
|
226
|
+
}
|
|
219
227
|
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div class="cursor-pointer flex gap-2 items-center">
|
|
3
3
|
{{$t("Export")}} {{ meta.select === 'all' ? $t('All'): $t('Filtered') }} {{$t('to CSV')}}
|
|
4
4
|
|
|
5
5
|
<svg v-if="inProgress"
|
|
@@ -19,6 +19,10 @@ const filtersStore = useFiltersStore();
|
|
|
19
19
|
const coreStore = useCoreStore();
|
|
20
20
|
const inProgress = ref(false);
|
|
21
21
|
|
|
22
|
+
defineExpose({
|
|
23
|
+
click,
|
|
24
|
+
});
|
|
25
|
+
|
|
22
26
|
const props = defineProps({
|
|
23
27
|
meta: Object,
|
|
24
28
|
record: Object,
|
|
@@ -77,4 +81,8 @@ async function exportCsv() {
|
|
|
77
81
|
adminforth.list.closeThreeDotsDropdown();
|
|
78
82
|
}
|
|
79
83
|
}
|
|
84
|
+
|
|
85
|
+
function click() {
|
|
86
|
+
exportCsv();
|
|
87
|
+
}
|
|
80
88
|
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
3
|
:class="[
|
|
4
4
|
'cursor-pointer flex gap-2 items-center',
|
|
5
5
|
checkProgress ? 'opacity-50 pointer-events-none' : ''
|
|
@@ -53,7 +53,11 @@ import Papa from 'papaparse';
|
|
|
53
53
|
import { Dialog } from '@/afcl';
|
|
54
54
|
import { useI18n } from 'vue-i18n';
|
|
55
55
|
|
|
56
|
+
|
|
56
57
|
const { t } = useI18n();
|
|
58
|
+
defineExpose({
|
|
59
|
+
click,
|
|
60
|
+
});
|
|
57
61
|
|
|
58
62
|
const importProgress: Ref<boolean> = ref(false);
|
|
59
63
|
const checkProgress: Ref<boolean> = ref(false);
|
|
@@ -70,9 +74,9 @@ const computedButtons = computed(() => {
|
|
|
70
74
|
const buttons = [
|
|
71
75
|
{ label: t('⚠️ Import All — Replace & Overwrite'), onclick: (dialog) => { confirmImport(dialog) }, visible: importStats.value.existingCount > 0 && importStats.value.newCount > 0 },
|
|
72
76
|
{ label: t('⚠️ Replace Existing Records'), onclick: (dialog) => { confirmImport(dialog) }, visible: importStats.value.existingCount > 0 && importStats.value.newCount === 0 },
|
|
73
|
-
{ label: t('
|
|
74
|
-
{ label: t('
|
|
75
|
-
{ label: t('
|
|
77
|
+
{ label: t('Import New Only'), onclick: (dialog) => { confirmImportNewOnly(dialog) }, visible: importStats.value.existingCount > 0 && importStats.value.newCount > 0 },
|
|
78
|
+
{ label: t('Import Records'), onclick: (dialog) => { confirmImportNewOnly(dialog) }, visible: importStats.value.existingCount === 0 && importStats.value.newCount > 0 },
|
|
79
|
+
{ label: t('Cancel'), onclick: (dialog) => dialog.hide() }
|
|
76
80
|
];
|
|
77
81
|
|
|
78
82
|
return buttons.filter(button => button.visible !== false);
|
|
@@ -216,4 +220,8 @@ function handleImportClick() {
|
|
|
216
220
|
importCsv();
|
|
217
221
|
}
|
|
218
222
|
}
|
|
223
|
+
|
|
224
|
+
function click() {
|
|
225
|
+
importCsv();
|
|
226
|
+
}
|
|
219
227
|
</script>
|
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adminforth/import-export",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
7
10
|
"homepage": "https://adminforth.dev/docs/tutorial/Plugins/import-export/",
|
|
8
11
|
"scripts": {
|
|
9
12
|
"build": "tsc && rsync -av --exclude 'node_modules' custom dist/",
|