@weconstudio/nuxt 0.0.0-stage → 1.72.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.
- package/LICENSE +1 -0
- package/README.md +115 -2
- package/dist/module.d.mts +7 -0
- package/dist/module.json +12 -0
- package/dist/module.mjs +250 -0
- package/dist/runtime/components/We/Autocomplete.d.vue.ts +13 -0
- package/dist/runtime/components/We/Autocomplete.vue +91 -0
- package/dist/runtime/components/We/Autocomplete.vue.d.ts +13 -0
- package/dist/runtime/components/We/BoldText.d.vue.ts +17 -0
- package/dist/runtime/components/We/BoldText.vue +29 -0
- package/dist/runtime/components/We/BoldText.vue.d.ts +17 -0
- package/dist/runtime/components/We/ColorPicker.d.vue.ts +11 -0
- package/dist/runtime/components/We/ColorPicker.vue +199 -0
- package/dist/runtime/components/We/ColorPicker.vue.d.ts +11 -0
- package/dist/runtime/components/We/ConfirmDialog.d.vue.ts +104 -0
- package/dist/runtime/components/We/ConfirmDialog.vue +143 -0
- package/dist/runtime/components/We/ConfirmDialog.vue.d.ts +104 -0
- package/dist/runtime/components/We/Datatable.d.vue.ts +40 -0
- package/dist/runtime/components/We/Datatable.vue +87 -0
- package/dist/runtime/components/We/Datatable.vue.d.ts +40 -0
- package/dist/runtime/components/We/DatatableInternal.d.vue.ts +194 -0
- package/dist/runtime/components/We/DatatableInternal.vue +638 -0
- package/dist/runtime/components/We/DatatableInternal.vue.d.ts +194 -0
- package/dist/runtime/components/We/DatePicker.d.vue.ts +51 -0
- package/dist/runtime/components/We/DatePicker.vue +901 -0
- package/dist/runtime/components/We/DatePicker.vue.d.ts +51 -0
- package/dist/runtime/components/We/Dt/Actions.d.vue.ts +51 -0
- package/dist/runtime/components/We/Dt/Actions.vue +106 -0
- package/dist/runtime/components/We/Dt/Actions.vue.d.ts +51 -0
- package/dist/runtime/components/We/Dt/BooleanFormatter.d.vue.ts +8 -0
- package/dist/runtime/components/We/Dt/BooleanFormatter.vue +26 -0
- package/dist/runtime/components/We/Dt/BooleanFormatter.vue.d.ts +8 -0
- package/dist/runtime/components/We/Dt/CardFilterContainer.d.vue.ts +17 -0
- package/dist/runtime/components/We/Dt/CardFilterContainer.vue +60 -0
- package/dist/runtime/components/We/Dt/CardFilterContainer.vue.d.ts +17 -0
- package/dist/runtime/components/We/Dt/CheckboxFilter.d.vue.ts +16 -0
- package/dist/runtime/components/We/Dt/CheckboxFilter.vue +47 -0
- package/dist/runtime/components/We/Dt/CheckboxFilter.vue.d.ts +16 -0
- package/dist/runtime/components/We/Dt/ChipGroupSelect.d.vue.ts +7 -0
- package/dist/runtime/components/We/Dt/ChipGroupSelect.vue +35 -0
- package/dist/runtime/components/We/Dt/ChipGroupSelect.vue.d.ts +7 -0
- package/dist/runtime/components/We/Dt/ClusterFilter.d.vue.ts +18 -0
- package/dist/runtime/components/We/Dt/ClusterFilter.vue +68 -0
- package/dist/runtime/components/We/Dt/ClusterFilter.vue.d.ts +18 -0
- package/dist/runtime/components/We/Dt/DatasetFormatter.d.vue.ts +19 -0
- package/dist/runtime/components/We/Dt/DatasetFormatter.vue +65 -0
- package/dist/runtime/components/We/Dt/DatasetFormatter.vue.d.ts +19 -0
- package/dist/runtime/components/We/Dt/DaterangeFilter.d.vue.ts +28 -0
- package/dist/runtime/components/We/Dt/DaterangeFilter.vue +140 -0
- package/dist/runtime/components/We/Dt/DaterangeFilter.vue.d.ts +28 -0
- package/dist/runtime/components/We/Dt/Filter.d.vue.ts +7 -0
- package/dist/runtime/components/We/Dt/Filter.vue +234 -0
- package/dist/runtime/components/We/Dt/Filter.vue.d.ts +7 -0
- package/dist/runtime/components/We/Dt/Filters.d.vue.ts +6 -0
- package/dist/runtime/components/We/Dt/Filters.vue +24 -0
- package/dist/runtime/components/We/Dt/Filters.vue.d.ts +6 -0
- package/dist/runtime/components/We/Dt/LuxonFormatter.d.vue.ts +12 -0
- package/dist/runtime/components/We/Dt/LuxonFormatter.vue +23 -0
- package/dist/runtime/components/We/Dt/LuxonFormatter.vue.d.ts +12 -0
- package/dist/runtime/components/We/Dt/SelectFilter.d.vue.ts +60 -0
- package/dist/runtime/components/We/Dt/SelectFilter.vue +333 -0
- package/dist/runtime/components/We/Dt/SelectFilter.vue.d.ts +60 -0
- package/dist/runtime/components/We/Dt/SelectResourceFilter.d.vue.ts +43 -0
- package/dist/runtime/components/We/Dt/SelectResourceFilter.vue +127 -0
- package/dist/runtime/components/We/Dt/SelectResourceFilter.vue.d.ts +43 -0
- package/dist/runtime/components/We/Dt/dt.types.d.ts +8 -0
- package/dist/runtime/components/We/EndpointSwitcher.d.vue.ts +12 -0
- package/dist/runtime/components/We/EndpointSwitcher.vue +256 -0
- package/dist/runtime/components/We/EndpointSwitcher.vue.d.ts +12 -0
- package/dist/runtime/components/We/Import.d.vue.ts +118 -0
- package/dist/runtime/components/We/Import.vue +730 -0
- package/dist/runtime/components/We/Import.vue.d.ts +118 -0
- package/dist/runtime/components/We/ImportDefaultValues.d.vue.ts +3666 -0
- package/dist/runtime/components/We/ImportDefaultValues.vue +115 -0
- package/dist/runtime/components/We/ImportDefaultValues.vue.d.ts +3666 -0
- package/dist/runtime/components/We/ImportMatchColumns.d.vue.ts +66 -0
- package/dist/runtime/components/We/ImportMatchColumns.vue +172 -0
- package/dist/runtime/components/We/ImportMatchColumns.vue.d.ts +66 -0
- package/dist/runtime/components/We/ImportPreviewResults.d.vue.ts +38 -0
- package/dist/runtime/components/We/ImportPreviewResults.vue +165 -0
- package/dist/runtime/components/We/ImportPreviewResults.vue.d.ts +38 -0
- package/dist/runtime/components/We/ImportSelectStart.d.vue.ts +47 -0
- package/dist/runtime/components/We/ImportSelectStart.vue +106 -0
- package/dist/runtime/components/We/ImportSelectStart.vue.d.ts +47 -0
- package/dist/runtime/components/We/Notification.d.vue.ts +7 -0
- package/dist/runtime/components/We/Notification.vue +49 -0
- package/dist/runtime/components/We/Notification.vue.d.ts +7 -0
- package/dist/runtime/components/We/S3Dropzone.d.vue.ts +17 -0
- package/dist/runtime/components/We/S3Dropzone.vue +527 -0
- package/dist/runtime/components/We/S3Dropzone.vue.d.ts +17 -0
- package/dist/runtime/components/We/Select.d.vue.ts +39 -0
- package/dist/runtime/components/We/Select.vue +354 -0
- package/dist/runtime/components/We/Select.vue.d.ts +39 -0
- package/dist/runtime/components/We/TipTap.d.vue.ts +26 -0
- package/dist/runtime/components/We/TipTap.vue +362 -0
- package/dist/runtime/components/We/TipTap.vue.d.ts +26 -0
- package/dist/runtime/components/We/datatable.props.d.ts +57 -0
- package/dist/runtime/components/We/datatable.props.js +60 -0
- package/dist/runtime/composables/datatable/useAutoFillHeight.d.ts +31 -0
- package/dist/runtime/composables/datatable/useAutoFillHeight.js +57 -0
- package/dist/runtime/composables/datatable/useDataTable.d.ts +33 -0
- package/dist/runtime/composables/datatable/useDataTable.js +161 -0
- package/dist/runtime/composables/datatable/useDatatableColumns.d.ts +12 -0
- package/dist/runtime/composables/datatable/useDatatableColumns.js +96 -0
- package/dist/runtime/composables/useApi.d.ts +56 -0
- package/dist/runtime/composables/useApi.js +230 -0
- package/dist/runtime/composables/useApiFetch.d.ts +2 -0
- package/dist/runtime/composables/useApiFetch.js +9 -0
- package/dist/runtime/composables/useApiUrl.d.ts +10 -0
- package/dist/runtime/composables/useApiUrl.js +37 -0
- package/dist/runtime/composables/useAuth.d.ts +9 -0
- package/dist/runtime/composables/useAuth.js +22 -0
- package/dist/runtime/composables/useBus.d.ts +8 -0
- package/dist/runtime/composables/useBus.js +18 -0
- package/dist/runtime/composables/useDateRangePresets.d.ts +21 -0
- package/dist/runtime/composables/useDateRangePresets.js +90 -0
- package/dist/runtime/composables/useForm.d.ts +29 -0
- package/dist/runtime/composables/useForm.js +74 -0
- package/dist/runtime/composables/useFormLock.d.ts +11 -0
- package/dist/runtime/composables/useFormLock.js +8 -0
- package/dist/runtime/composables/useFormWrapper.d.ts +16 -0
- package/dist/runtime/composables/useFormWrapper.js +36 -0
- package/dist/runtime/composables/useImportJob.d.ts +55 -0
- package/dist/runtime/composables/useImportJob.js +94 -0
- package/dist/runtime/composables/useLux.d.ts +1 -0
- package/dist/runtime/composables/useLux.js +8 -0
- package/dist/runtime/composables/useNotify.d.ts +12 -0
- package/dist/runtime/composables/useNotify.js +24 -0
- package/dist/runtime/composables/usePaginatedFetch.d.ts +24 -0
- package/dist/runtime/composables/usePaginatedFetch.js +154 -0
- package/dist/runtime/composables/useServerErrors.d.ts +16 -0
- package/dist/runtime/composables/useServerErrors.js +60 -0
- package/dist/runtime/composables/useValidators.d.ts +18 -0
- package/dist/runtime/composables/useValidators.js +56 -0
- package/dist/runtime/generator/code/dt.d.ts +8 -0
- package/dist/runtime/generator/code/dt.js +97 -0
- package/dist/runtime/generator/code/edit.d.ts +4 -0
- package/dist/runtime/generator/code/edit.js +41 -0
- package/dist/runtime/generator/code/form.d.ts +6 -0
- package/dist/runtime/generator/code/form.js +229 -0
- package/dist/runtime/generator/code/i18n.d.ts +5 -0
- package/dist/runtime/generator/code/i18n.js +43 -0
- package/dist/runtime/generator/code/index.d.ts +11 -0
- package/dist/runtime/generator/code/index.js +90 -0
- package/dist/runtime/generator/components/CodeSnippet.d.vue.ts +14 -0
- package/dist/runtime/generator/components/CodeSnippet.vue +49 -0
- package/dist/runtime/generator/components/CodeSnippet.vue.d.ts +14 -0
- package/dist/runtime/generator/components/Configuration.d.vue.ts +16 -0
- package/dist/runtime/generator/components/Configuration.vue +154 -0
- package/dist/runtime/generator/components/Configuration.vue.d.ts +16 -0
- package/dist/runtime/generator/components/GeneratorPage.d.vue.ts +50 -0
- package/dist/runtime/generator/components/GeneratorPage.vue +226 -0
- package/dist/runtime/generator/components/GeneratorPage.vue.d.ts +50 -0
- package/dist/runtime/generator/fs.d.ts +16 -0
- package/dist/runtime/generator/fs.js +79 -0
- package/dist/runtime/generator/index.d.vue.ts +52 -0
- package/dist/runtime/generator/index.vue +17 -0
- package/dist/runtime/generator/index.vue.d.ts +52 -0
- package/dist/runtime/internals/api.d.ts +3 -0
- package/dist/runtime/internals/api.js +16 -0
- package/dist/runtime/internals/bus.d.ts +1 -0
- package/dist/runtime/internals/bus.js +2 -0
- package/dist/runtime/internals/dt.d.ts +24 -0
- package/dist/runtime/internals/dt.js +57 -0
- package/dist/runtime/lang/en.json +211 -0
- package/dist/runtime/lang/it.json +211 -0
- package/dist/runtime/mixins/formValidator.d.ts +38 -0
- package/dist/runtime/mixins/formValidator.js +118 -0
- package/dist/runtime/plugins/api-legacy.d.ts +76 -0
- package/dist/runtime/plugins/api-legacy.js +11 -0
- package/dist/runtime/plugins/auth-legacy.d.ts +22 -0
- package/dist/runtime/plugins/auth-legacy.js +14 -0
- package/dist/runtime/plugins/bus-legacy.d.ts +6 -0
- package/dist/runtime/plugins/bus-legacy.js +9 -0
- package/dist/runtime/plugins/notify-legacy.d.ts +25 -0
- package/dist/runtime/plugins/notify-legacy.js +35 -0
- package/dist/runtime/plugins/portal.d.ts +2 -0
- package/dist/runtime/plugins/portal.js +5 -0
- package/dist/runtime/plugins/update-sanctum-app-config.d.ts +2 -0
- package/dist/runtime/plugins/update-sanctum-app-config.js +44 -0
- package/dist/runtime/plugins/vuetify-nuxt-icon.d.ts +4 -0
- package/dist/runtime/plugins/vuetify-nuxt-icon.js +30 -0
- package/dist/runtime/types/app-config.d.ts +24 -0
- package/dist/runtime/types/app-config.js +1 -0
- package/dist/runtime/types/icons.d.ts +82 -0
- package/dist/runtime/types/icons.js +84 -0
- package/dist/runtime/types/index.d.ts +2 -0
- package/dist/runtime/types/index.js +2 -0
- package/dist/runtime/types/module-options.d.ts +29 -0
- package/dist/runtime/types/module-options.js +0 -0
- package/dist/runtime/types/runtime-hooks.d.ts +17 -0
- package/dist/runtime/types/runtime-hooks.js +1 -0
- package/dist/runtime/utils/color.d.ts +10 -0
- package/dist/runtime/utils/color.js +38 -0
- package/dist/runtime/utils/file.d.ts +17 -0
- package/dist/runtime/utils/file.js +108 -0
- package/dist/runtime/utils/format.d.ts +1 -0
- package/dist/runtime/utils/format.js +14 -0
- package/dist/runtime/utils/make-enum.d.ts +15 -0
- package/dist/runtime/utils/make-enum.js +27 -0
- package/dist/runtime/utils/mergeDefaults.d.ts +1 -0
- package/dist/runtime/utils/mergeDefaults.js +18 -0
- package/dist/runtime/utils/object-to-formdata.d.ts +10 -0
- package/dist/runtime/utils/object-to-formdata.js +82 -0
- package/dist/runtime/utils/uuid.d.ts +1 -0
- package/dist/runtime/utils/uuid.js +9 -0
- package/dist/types.d.mts +9 -0
- package/package.json +92 -4
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
headers: {
|
|
3
|
+
type: ArrayConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
items: {
|
|
7
|
+
type: ArrayConstructor;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
columns: {
|
|
11
|
+
type: ArrayConstructor;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
value: {
|
|
15
|
+
type: ObjectConstructor;
|
|
16
|
+
default: () => {};
|
|
17
|
+
};
|
|
18
|
+
firstRow: {
|
|
19
|
+
type: NumberConstructor;
|
|
20
|
+
required: false;
|
|
21
|
+
};
|
|
22
|
+
}>, {}, {
|
|
23
|
+
matches: Record<string, any>;
|
|
24
|
+
}, {
|
|
25
|
+
visibleColumns(): unknown[];
|
|
26
|
+
isDoneWithRequired(): boolean;
|
|
27
|
+
}, {
|
|
28
|
+
startAutoMatch(): void;
|
|
29
|
+
itemRowBackground({ item }: {
|
|
30
|
+
item: any;
|
|
31
|
+
}): "" | {
|
|
32
|
+
class: string;
|
|
33
|
+
} | {
|
|
34
|
+
class?: undefined;
|
|
35
|
+
};
|
|
36
|
+
normalizeString(s: any): any;
|
|
37
|
+
autoMatch(possibleHeaders: any): void;
|
|
38
|
+
matchDone(): void;
|
|
39
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("match" | "back")[], "match" | "back", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
40
|
+
headers: {
|
|
41
|
+
type: ArrayConstructor;
|
|
42
|
+
required: true;
|
|
43
|
+
};
|
|
44
|
+
items: {
|
|
45
|
+
type: ArrayConstructor;
|
|
46
|
+
required: true;
|
|
47
|
+
};
|
|
48
|
+
columns: {
|
|
49
|
+
type: ArrayConstructor;
|
|
50
|
+
required: true;
|
|
51
|
+
};
|
|
52
|
+
value: {
|
|
53
|
+
type: ObjectConstructor;
|
|
54
|
+
default: () => {};
|
|
55
|
+
};
|
|
56
|
+
firstRow: {
|
|
57
|
+
type: NumberConstructor;
|
|
58
|
+
required: false;
|
|
59
|
+
};
|
|
60
|
+
}>> & Readonly<{
|
|
61
|
+
onMatch?: ((...args: any[]) => any) | undefined;
|
|
62
|
+
onBack?: ((...args: any[]) => any) | undefined;
|
|
63
|
+
}>, {
|
|
64
|
+
value: Record<string, any>;
|
|
65
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
66
|
+
export default _default;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export default {
|
|
3
|
+
props: {
|
|
4
|
+
headers: {
|
|
5
|
+
type: Array,
|
|
6
|
+
required: true
|
|
7
|
+
},
|
|
8
|
+
items: {
|
|
9
|
+
type: Array,
|
|
10
|
+
required: true
|
|
11
|
+
},
|
|
12
|
+
columns: {
|
|
13
|
+
type: Array,
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
value: {
|
|
17
|
+
type: Object,
|
|
18
|
+
default: () => ({})
|
|
19
|
+
},
|
|
20
|
+
firstRow: {
|
|
21
|
+
type: Number,
|
|
22
|
+
required: false
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
emits: ["match", "back"],
|
|
26
|
+
data: (vm) => ({
|
|
27
|
+
matches: vm.value
|
|
28
|
+
}),
|
|
29
|
+
computed: {
|
|
30
|
+
visibleColumns() {
|
|
31
|
+
return this.columns.filter((c) => !c.hidden);
|
|
32
|
+
},
|
|
33
|
+
isDoneWithRequired() {
|
|
34
|
+
const ids = Object.values(this.matches).map((m) => m.id).filter((id) => id);
|
|
35
|
+
return this.visibleColumns.filter((c) => c.required && !ids.includes(c.id)).length === 0;
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
watch: {
|
|
39
|
+
firstRow: {
|
|
40
|
+
immediate: true,
|
|
41
|
+
handler() {
|
|
42
|
+
this.startAutoMatch();
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
headers: {
|
|
46
|
+
immediate: true,
|
|
47
|
+
handler(val) {
|
|
48
|
+
this.matches = val.reduce(
|
|
49
|
+
(acc, col) => ({
|
|
50
|
+
...acc,
|
|
51
|
+
[col.value]: { id: null }
|
|
52
|
+
}),
|
|
53
|
+
{}
|
|
54
|
+
);
|
|
55
|
+
this.startAutoMatch();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
methods: {
|
|
60
|
+
startAutoMatch() {
|
|
61
|
+
const headerRow = this.firstRow - 1;
|
|
62
|
+
if (typeof headerRow === "number" && headerRow >= 0) {
|
|
63
|
+
const row = this.items.find((item) => item.rowNumber === headerRow);
|
|
64
|
+
if (row) {
|
|
65
|
+
this.autoMatch(row);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
itemRowBackground({ item }) {
|
|
70
|
+
if (!this.firstRow) {
|
|
71
|
+
return "";
|
|
72
|
+
}
|
|
73
|
+
return item.rowNumber < this.firstRow ? { class: "bg-exclude" } : {};
|
|
74
|
+
},
|
|
75
|
+
normalizeString(s) {
|
|
76
|
+
if (typeof s === "string") {
|
|
77
|
+
return s.toLowerCase().replace(/[^\w!?]/g, "");
|
|
78
|
+
}
|
|
79
|
+
return s;
|
|
80
|
+
},
|
|
81
|
+
autoMatch(possibleHeaders) {
|
|
82
|
+
const columns = this.visibleColumns.map((c) => {
|
|
83
|
+
const text = this.normalizeString(c.text);
|
|
84
|
+
return { ...c, text };
|
|
85
|
+
});
|
|
86
|
+
Object.entries(possibleHeaders).forEach(([key, value]) => {
|
|
87
|
+
const text = this.normalizeString(value);
|
|
88
|
+
const column = columns.find((c) => c.text === text);
|
|
89
|
+
if (column && this.matches[key]) {
|
|
90
|
+
this.matches[key].id = column.id;
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
},
|
|
94
|
+
matchDone() {
|
|
95
|
+
this.$emit("match", this.matches);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
</script>
|
|
100
|
+
|
|
101
|
+
<template>
|
|
102
|
+
<v-row class="ma-2">
|
|
103
|
+
<v-col cols="12">
|
|
104
|
+
<v-data-table
|
|
105
|
+
|
|
106
|
+
disable-sort
|
|
107
|
+
:headers="headers"
|
|
108
|
+
:items="items"
|
|
109
|
+
hide-default-footer
|
|
110
|
+
:row-props="itemRowBackground"
|
|
111
|
+
class="dt-preview dt-import-match-column"
|
|
112
|
+
>
|
|
113
|
+
<template
|
|
114
|
+
v-for="h in headers"
|
|
115
|
+
#[`header.${h.value}`]
|
|
116
|
+
>
|
|
117
|
+
<v-select
|
|
118
|
+
v-if="matches[h.value]"
|
|
119
|
+
:key="h.value"
|
|
120
|
+
v-model="matches[h.value].id"
|
|
121
|
+
clearable
|
|
122
|
+
variant="filled"
|
|
123
|
+
:placeholder="$t('weImport.steps.3.placeholder')"
|
|
124
|
+
hide-details
|
|
125
|
+
class="my-2"
|
|
126
|
+
density="compact"
|
|
127
|
+
item-title="text"
|
|
128
|
+
item-value="id"
|
|
129
|
+
:items="visibleColumns"
|
|
130
|
+
/>
|
|
131
|
+
</template>
|
|
132
|
+
|
|
133
|
+
<template #[`item.selector`]="{ item }">
|
|
134
|
+
{{ item.rowNumber }}
|
|
135
|
+
</template>
|
|
136
|
+
</v-data-table>
|
|
137
|
+
</v-col>
|
|
138
|
+
|
|
139
|
+
<v-col
|
|
140
|
+
cols="12"
|
|
141
|
+
class="d-flex"
|
|
142
|
+
>
|
|
143
|
+
<v-btn
|
|
144
|
+
size="large"
|
|
145
|
+
variant="outlined"
|
|
146
|
+
@click="$emit('back')"
|
|
147
|
+
>
|
|
148
|
+
<v-icon start>
|
|
149
|
+
$prev
|
|
150
|
+
</v-icon>{{ $t('weImport.buttons.back') }}
|
|
151
|
+
</v-btn>
|
|
152
|
+
<v-btn
|
|
153
|
+
:disabled="!isDoneWithRequired"
|
|
154
|
+
class="ml-auto"
|
|
155
|
+
size="large"
|
|
156
|
+
color="primary"
|
|
157
|
+
@click="matchDone"
|
|
158
|
+
>
|
|
159
|
+
{{ $t('weImport.buttons.next') }}
|
|
160
|
+
<v-icon end>
|
|
161
|
+
$next
|
|
162
|
+
</v-icon>
|
|
163
|
+
</v-btn>
|
|
164
|
+
</v-col>
|
|
165
|
+
</v-row>
|
|
166
|
+
</template>
|
|
167
|
+
|
|
168
|
+
<style>
|
|
169
|
+
.dt-import-match-column .v-data-table__th {
|
|
170
|
+
min-width: 200px !important;
|
|
171
|
+
}
|
|
172
|
+
</style>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
headers: {
|
|
3
|
+
type: ArrayConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
items: {
|
|
7
|
+
type: ArrayConstructor;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
columns: {
|
|
11
|
+
type: ArrayConstructor;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
value: {
|
|
15
|
+
type: ObjectConstructor;
|
|
16
|
+
default: () => {};
|
|
17
|
+
};
|
|
18
|
+
firstRow: {
|
|
19
|
+
type: NumberConstructor;
|
|
20
|
+
required: false;
|
|
21
|
+
};
|
|
22
|
+
}>, {}, {
|
|
23
|
+
matches: Record<string, any>;
|
|
24
|
+
}, {
|
|
25
|
+
visibleColumns(): unknown[];
|
|
26
|
+
isDoneWithRequired(): boolean;
|
|
27
|
+
}, {
|
|
28
|
+
startAutoMatch(): void;
|
|
29
|
+
itemRowBackground({ item }: {
|
|
30
|
+
item: any;
|
|
31
|
+
}): "" | {
|
|
32
|
+
class: string;
|
|
33
|
+
} | {
|
|
34
|
+
class?: undefined;
|
|
35
|
+
};
|
|
36
|
+
normalizeString(s: any): any;
|
|
37
|
+
autoMatch(possibleHeaders: any): void;
|
|
38
|
+
matchDone(): void;
|
|
39
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("match" | "back")[], "match" | "back", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
40
|
+
headers: {
|
|
41
|
+
type: ArrayConstructor;
|
|
42
|
+
required: true;
|
|
43
|
+
};
|
|
44
|
+
items: {
|
|
45
|
+
type: ArrayConstructor;
|
|
46
|
+
required: true;
|
|
47
|
+
};
|
|
48
|
+
columns: {
|
|
49
|
+
type: ArrayConstructor;
|
|
50
|
+
required: true;
|
|
51
|
+
};
|
|
52
|
+
value: {
|
|
53
|
+
type: ObjectConstructor;
|
|
54
|
+
default: () => {};
|
|
55
|
+
};
|
|
56
|
+
firstRow: {
|
|
57
|
+
type: NumberConstructor;
|
|
58
|
+
required: false;
|
|
59
|
+
};
|
|
60
|
+
}>> & Readonly<{
|
|
61
|
+
onMatch?: ((...args: any[]) => any) | undefined;
|
|
62
|
+
onBack?: ((...args: any[]) => any) | undefined;
|
|
63
|
+
}>, {
|
|
64
|
+
value: Record<string, any>;
|
|
65
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
66
|
+
export default _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
headers: {
|
|
3
|
+
type: ArrayConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
items: {
|
|
7
|
+
type: ArrayConstructor;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
}>, {}, {
|
|
11
|
+
ignoreErrors: boolean;
|
|
12
|
+
showOnlyErrors: boolean;
|
|
13
|
+
}, {
|
|
14
|
+
canImport(): boolean;
|
|
15
|
+
shownItems(): unknown[];
|
|
16
|
+
errorItems(): unknown[];
|
|
17
|
+
previewHeaders(): unknown[];
|
|
18
|
+
itemsPerPageOptions(): {
|
|
19
|
+
value: number;
|
|
20
|
+
text: string;
|
|
21
|
+
title: string;
|
|
22
|
+
}[];
|
|
23
|
+
}, {
|
|
24
|
+
importItems(): void;
|
|
25
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("back" | "import")[], "back" | "import", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
26
|
+
headers: {
|
|
27
|
+
type: ArrayConstructor;
|
|
28
|
+
required: true;
|
|
29
|
+
};
|
|
30
|
+
items: {
|
|
31
|
+
type: ArrayConstructor;
|
|
32
|
+
required: true;
|
|
33
|
+
};
|
|
34
|
+
}>> & Readonly<{
|
|
35
|
+
onImport?: ((...args: any[]) => any) | undefined;
|
|
36
|
+
onBack?: ((...args: any[]) => any) | undefined;
|
|
37
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
38
|
+
export default _default;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export default {
|
|
3
|
+
props: {
|
|
4
|
+
headers: {
|
|
5
|
+
type: Array,
|
|
6
|
+
required: true
|
|
7
|
+
},
|
|
8
|
+
items: {
|
|
9
|
+
type: Array,
|
|
10
|
+
required: true
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
emits: ["import", "back"],
|
|
14
|
+
data: (_) => ({
|
|
15
|
+
ignoreErrors: false,
|
|
16
|
+
showOnlyErrors: false
|
|
17
|
+
}),
|
|
18
|
+
computed: {
|
|
19
|
+
canImport() {
|
|
20
|
+
return this.ignoreErrors || this.errorItems.length === 0;
|
|
21
|
+
},
|
|
22
|
+
shownItems() {
|
|
23
|
+
return this.showOnlyErrors ? this.errorItems : this.items;
|
|
24
|
+
},
|
|
25
|
+
errorItems() {
|
|
26
|
+
return this.items.filter((item) => item._error);
|
|
27
|
+
},
|
|
28
|
+
previewHeaders() {
|
|
29
|
+
return [{ value: "row_number", divider: true }, ...this.headers];
|
|
30
|
+
},
|
|
31
|
+
itemsPerPageOptions() {
|
|
32
|
+
const items = [10, 25, 50, 100, 500];
|
|
33
|
+
return items.map((i) => ({ value: i, text: String(i), title: String(i) }));
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
methods: {
|
|
37
|
+
importItems() {
|
|
38
|
+
this.$emit("import", { skip_errors: this.ignoreErrors });
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<template>
|
|
45
|
+
<v-row class="mx-2">
|
|
46
|
+
<v-col cols="12">
|
|
47
|
+
<!-- h2 class="subtitle-1">
|
|
48
|
+
Ecco una preview dei risultati
|
|
49
|
+
</h2 -->
|
|
50
|
+
<p class="mb-0">
|
|
51
|
+
<i18n-t keypath="weImport.steps.5.previewResults.processedRows">
|
|
52
|
+
<template #count>
|
|
53
|
+
<b>{{ items.length }}</b>
|
|
54
|
+
</template>
|
|
55
|
+
</i18n-t>
|
|
56
|
+
<i18n-t
|
|
57
|
+
v-if="errorItems.length"
|
|
58
|
+
keypath="weImport.steps.5.previewResults.containError"
|
|
59
|
+
>
|
|
60
|
+
<template #count>
|
|
61
|
+
<b class="text-error">{{ errorItems.length }}</b>
|
|
62
|
+
</template>
|
|
63
|
+
</i18n-t>
|
|
64
|
+
|
|
65
|
+
<br>
|
|
66
|
+
<v-switch
|
|
67
|
+
v-model="showOnlyErrors"
|
|
68
|
+
hide-details
|
|
69
|
+
:label="$t('weImport.steps.5.switch.showOnlyErrors')"
|
|
70
|
+
/>
|
|
71
|
+
|
|
72
|
+
<v-switch
|
|
73
|
+
v-model="ignoreErrors"
|
|
74
|
+
:label="$t('weImport.steps.5.switch.ignoreErrors')"
|
|
75
|
+
/>
|
|
76
|
+
</p>
|
|
77
|
+
</v-col>
|
|
78
|
+
<v-col cols="12">
|
|
79
|
+
<v-data-table
|
|
80
|
+
disable-sort
|
|
81
|
+
density="compact"
|
|
82
|
+
:headers="previewHeaders"
|
|
83
|
+
:items-per-page-options="itemsPerPageOptions"
|
|
84
|
+
:items="shownItems"
|
|
85
|
+
class="dt-preview"
|
|
86
|
+
>
|
|
87
|
+
<template #[`item.row_number`]="{ item }">
|
|
88
|
+
{{ item.row_number }}
|
|
89
|
+
<v-tooltip
|
|
90
|
+
v-if="item._error"
|
|
91
|
+
location="top"
|
|
92
|
+
color="error"
|
|
93
|
+
>
|
|
94
|
+
<template #activator="{ props }">
|
|
95
|
+
<v-icon
|
|
96
|
+
|
|
97
|
+
class="ml-2"
|
|
98
|
+
color="error"
|
|
99
|
+
v-bind="props"
|
|
100
|
+
>
|
|
101
|
+
$warning
|
|
102
|
+
</v-icon>
|
|
103
|
+
</template>
|
|
104
|
+
<span>{{ item._error.join("\n") }}</span>
|
|
105
|
+
</v-tooltip>
|
|
106
|
+
</template>
|
|
107
|
+
|
|
108
|
+
<template
|
|
109
|
+
v-for="h in headers"
|
|
110
|
+
#[`item.${h.value}`]="{ item }"
|
|
111
|
+
>
|
|
112
|
+
<div
|
|
113
|
+
v-if="item[h.value]"
|
|
114
|
+
:key="h.value"
|
|
115
|
+
class="d-flex align-center"
|
|
116
|
+
>
|
|
117
|
+
{{ item[h.value].value }}
|
|
118
|
+
|
|
119
|
+
<v-tooltip
|
|
120
|
+
v-if="item[h.value].errors"
|
|
121
|
+
location="top"
|
|
122
|
+
color="error"
|
|
123
|
+
>
|
|
124
|
+
<template #activator="{ props }">
|
|
125
|
+
<v-icon
|
|
126
|
+
|
|
127
|
+
class="ml-2"
|
|
128
|
+
color="error"
|
|
129
|
+
v-bind="props"
|
|
130
|
+
>
|
|
131
|
+
$warning
|
|
132
|
+
</v-icon>
|
|
133
|
+
</template>
|
|
134
|
+
<span>{{ item[h.value].errors.join("\n") }}</span>
|
|
135
|
+
</v-tooltip>
|
|
136
|
+
</div>
|
|
137
|
+
</template>
|
|
138
|
+
</v-data-table>
|
|
139
|
+
</v-col>
|
|
140
|
+
|
|
141
|
+
<v-col
|
|
142
|
+
cols="12"
|
|
143
|
+
class="d-flex"
|
|
144
|
+
>
|
|
145
|
+
<v-btn
|
|
146
|
+
size="large"
|
|
147
|
+
variant="outlined"
|
|
148
|
+
@click="$emit('back')"
|
|
149
|
+
>
|
|
150
|
+
<v-icon start>
|
|
151
|
+
$prev
|
|
152
|
+
</v-icon>{{ $t('weImport.buttons.back') }}
|
|
153
|
+
</v-btn>
|
|
154
|
+
<v-btn
|
|
155
|
+
:disabled="!canImport"
|
|
156
|
+
size="large"
|
|
157
|
+
class="ml-auto"
|
|
158
|
+
color="primary"
|
|
159
|
+
@click="importItems"
|
|
160
|
+
>
|
|
161
|
+
{{ $t('weImport.buttons.import') }}
|
|
162
|
+
</v-btn>
|
|
163
|
+
</v-col>
|
|
164
|
+
</v-row>
|
|
165
|
+
</template>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
headers: {
|
|
3
|
+
type: ArrayConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
items: {
|
|
7
|
+
type: ArrayConstructor;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
}>, {}, {
|
|
11
|
+
ignoreErrors: boolean;
|
|
12
|
+
showOnlyErrors: boolean;
|
|
13
|
+
}, {
|
|
14
|
+
canImport(): boolean;
|
|
15
|
+
shownItems(): unknown[];
|
|
16
|
+
errorItems(): unknown[];
|
|
17
|
+
previewHeaders(): unknown[];
|
|
18
|
+
itemsPerPageOptions(): {
|
|
19
|
+
value: number;
|
|
20
|
+
text: string;
|
|
21
|
+
title: string;
|
|
22
|
+
}[];
|
|
23
|
+
}, {
|
|
24
|
+
importItems(): void;
|
|
25
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("back" | "import")[], "back" | "import", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
26
|
+
headers: {
|
|
27
|
+
type: ArrayConstructor;
|
|
28
|
+
required: true;
|
|
29
|
+
};
|
|
30
|
+
items: {
|
|
31
|
+
type: ArrayConstructor;
|
|
32
|
+
required: true;
|
|
33
|
+
};
|
|
34
|
+
}>> & Readonly<{
|
|
35
|
+
onImport?: ((...args: any[]) => any) | undefined;
|
|
36
|
+
onBack?: ((...args: any[]) => any) | undefined;
|
|
37
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
38
|
+
export default _default;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
headers: {
|
|
3
|
+
type: ArrayConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
items: {
|
|
7
|
+
type: ArrayConstructor;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
value: {
|
|
11
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
12
|
+
default: null;
|
|
13
|
+
};
|
|
14
|
+
}>, {}, {
|
|
15
|
+
currentRow: string | number;
|
|
16
|
+
}, {
|
|
17
|
+
previewHeaders(): unknown[];
|
|
18
|
+
}, {
|
|
19
|
+
itemRowBackground({ item }: {
|
|
20
|
+
item: any;
|
|
21
|
+
}): {
|
|
22
|
+
class?: undefined;
|
|
23
|
+
} | {
|
|
24
|
+
class: string[];
|
|
25
|
+
};
|
|
26
|
+
rowSelected(): void;
|
|
27
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("input" | "update:modelValue" | "back")[], "input" | "update:modelValue" | "back", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
28
|
+
headers: {
|
|
29
|
+
type: ArrayConstructor;
|
|
30
|
+
required: true;
|
|
31
|
+
};
|
|
32
|
+
items: {
|
|
33
|
+
type: ArrayConstructor;
|
|
34
|
+
required: true;
|
|
35
|
+
};
|
|
36
|
+
value: {
|
|
37
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
38
|
+
default: null;
|
|
39
|
+
};
|
|
40
|
+
}>> & Readonly<{
|
|
41
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
42
|
+
onInput?: ((...args: any[]) => any) | undefined;
|
|
43
|
+
onBack?: ((...args: any[]) => any) | undefined;
|
|
44
|
+
}>, {
|
|
45
|
+
value: string | number;
|
|
46
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
47
|
+
export default _default;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export default {
|
|
3
|
+
props: {
|
|
4
|
+
headers: {
|
|
5
|
+
type: Array,
|
|
6
|
+
required: true
|
|
7
|
+
},
|
|
8
|
+
items: {
|
|
9
|
+
type: Array,
|
|
10
|
+
required: true
|
|
11
|
+
},
|
|
12
|
+
value: {
|
|
13
|
+
type: [Number, String],
|
|
14
|
+
default: null
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
emits: ["update:modelValue", "input", "back"],
|
|
18
|
+
data: (vm) => ({
|
|
19
|
+
currentRow: vm.value
|
|
20
|
+
}),
|
|
21
|
+
computed: {
|
|
22
|
+
previewHeaders() {
|
|
23
|
+
return [
|
|
24
|
+
{ value: "selector", width: 100 },
|
|
25
|
+
...this.headers
|
|
26
|
+
];
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
methods: {
|
|
30
|
+
itemRowBackground({ item }) {
|
|
31
|
+
if (!this.currentRow) {
|
|
32
|
+
return {};
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
class: item.rowNumber < this.currentRow ? ["bg-exclude"] : []
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
rowSelected() {
|
|
39
|
+
this.$emit("update:modelValue", this.currentRow);
|
|
40
|
+
this.$emit("input");
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<template>
|
|
47
|
+
<v-row class="ma-2">
|
|
48
|
+
<v-col cols="12">
|
|
49
|
+
<v-data-table
|
|
50
|
+
density="compact"
|
|
51
|
+
disable-sort
|
|
52
|
+
:headers="previewHeaders"
|
|
53
|
+
:items="items"
|
|
54
|
+
:row-props="itemRowBackground"
|
|
55
|
+
hide-default-footer
|
|
56
|
+
class="dt-preview"
|
|
57
|
+
>
|
|
58
|
+
<template #[`item.selector`]="{ item }">
|
|
59
|
+
<v-btn
|
|
60
|
+
class="my-1"
|
|
61
|
+
variant="outlined"
|
|
62
|
+
block
|
|
63
|
+
:color="currentRow === item.rowNumber ? 'primary' : null"
|
|
64
|
+
@click="currentRow = item.rowNumber"
|
|
65
|
+
>
|
|
66
|
+
<v-icon>$arrowRightBold</v-icon>
|
|
67
|
+
</v-btn>
|
|
68
|
+
</template>
|
|
69
|
+
</v-data-table>
|
|
70
|
+
</v-col>
|
|
71
|
+
|
|
72
|
+
<v-col
|
|
73
|
+
cols="12"
|
|
74
|
+
class="d-flex"
|
|
75
|
+
>
|
|
76
|
+
<v-btn
|
|
77
|
+
size="large"
|
|
78
|
+
variant="outlined"
|
|
79
|
+
@click="$emit('back')"
|
|
80
|
+
>
|
|
81
|
+
<v-icon start>
|
|
82
|
+
$prev
|
|
83
|
+
</v-icon>{{ $t('weImport.buttons.back') }}
|
|
84
|
+
</v-btn>
|
|
85
|
+
|
|
86
|
+
<v-btn
|
|
87
|
+
class="ml-auto"
|
|
88
|
+
color="primary"
|
|
89
|
+
size="large"
|
|
90
|
+
:disabled="!currentRow"
|
|
91
|
+
@click="rowSelected"
|
|
92
|
+
>
|
|
93
|
+
{{ $t('weImport.buttons.next') }}<v-icon end>
|
|
94
|
+
$next
|
|
95
|
+
</v-icon>
|
|
96
|
+
</v-btn>
|
|
97
|
+
</v-col>
|
|
98
|
+
</v-row>
|
|
99
|
+
</template>
|
|
100
|
+
|
|
101
|
+
<style>
|
|
102
|
+
.dt-preview .bg-exclude {
|
|
103
|
+
opacity: 0.4;
|
|
104
|
+
text-decoration: line-through !important;
|
|
105
|
+
}
|
|
106
|
+
</style>
|