@piveau/piveau-hub-ui-modules 4.0.23 → 4.0.26
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/configurations/configureModules.mjs +3 -3
- package/dist/configurations/configureModules.mjs.map +1 -1
- package/dist/data-provider-interface/components/FileUpload.vue.d.ts +11 -1
- package/dist/data-provider-interface/components/FileUpload.vue.mjs +200 -183
- package/dist/data-provider-interface/components/FileUpload.vue.mjs.map +1 -1
- package/dist/data-provider-interface/utils/general-helper.mjs +63 -62
- package/dist/data-provider-interface/utils/general-helper.mjs.map +1 -1
- package/dist/data-provider-interface/utils/translation-helper.mjs +12 -12
- package/dist/data-provider-interface/utils/translation-helper.mjs.map +1 -1
- package/dist/data-provider-interface/views/OverviewPage/Properties/SpecialProp.vue.d.ts +1 -1
- package/dist/datasetDetails/distributions/distributionActions/DistributionDropdownDownload.vue.d.ts +1 -5
- package/dist/datasetDetails/properties/DatasetDetailsProperty.vue.mjs +13 -13
- package/dist/datasetDetails/properties/DatasetDetailsProperty.vue.mjs.map +1 -1
- package/dist/datasets/DatasetDate.vue.d.ts +2 -2
- package/dist/external/@vueuse/core/index +1 -1
- package/dist/filters/dateFilters.d.ts +2 -2
- package/dist/piveau-hub-ui-modules.css +1 -1
- package/dist/utils/draftApi.d.ts +6 -6
- package/dist/utils/identifiersApi.d.ts +1 -1
- package/dist/widgets/Dropdown.vue.d.ts +1 -5
- package/dist/widgets/ResourceAccessPopup.vue.d.ts +1 -16
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { configureServices as i } from "./configureServices.mjs";
|
|
2
2
|
import { configureComponents as m } from "./configureComponents.mjs";
|
|
3
|
-
function
|
|
4
|
-
o && (i(r, o.serviceParams), m(e, o.components));
|
|
3
|
+
function f(e, r, o) {
|
|
4
|
+
r.$app = e, o && (i(r, o.serviceParams), m(e, o.components));
|
|
5
5
|
}
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
f as configureModules
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=configureModules.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configureModules.mjs","sources":["../../lib/configurations/configureModules.ts"],"sourcesContent":["import { configureServices } from \"./configureServices\";\nimport { ComponentMap, configureComponents } from \"./configureComponents\";\n\ntype ModulesConfig = {\n components: ComponentMap,\n serviceParams: {[key: string]: unknown},\n};\n\nexport function configureModules(app: any, store: any, config?: ModulesConfig) {\n if (config) {\n configureServices(store, config.serviceParams);\n configureComponents(app, config.components);\n }\n}"],"names":["configureModules","app","store","config","configureServices","configureComponents"],"mappings":";;AAQgB,SAAAA,EAAiBC,GAAUC,GAAYC,GAAwB;AAC7E,
|
|
1
|
+
{"version":3,"file":"configureModules.mjs","sources":["../../lib/configurations/configureModules.ts"],"sourcesContent":["import { configureServices } from \"./configureServices\";\nimport { ComponentMap, configureComponents } from \"./configureComponents\";\n\ntype ModulesConfig = {\n components: ComponentMap,\n serviceParams: {[key: string]: unknown},\n};\n\nexport function configureModules(app: any, store: any, config?: ModulesConfig) {\n store.$app = app;\n if (config) {\n configureServices(store, config.serviceParams);\n configureComponents(app, config.components);\n }\n}\n"],"names":["configureModules","app","store","config","configureServices","configureComponents"],"mappings":";;AAQgB,SAAAA,EAAiBC,GAAUC,GAAYC,GAAwB;AAC7E,EAAAD,EAAM,OAAOD,GACTE,MACgBC,EAAAF,GAAOC,EAAO,aAAa,GACzBE,EAAAJ,GAAKE,EAAO,UAAU;AAE9C;"}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
import { onClickOutside } from '@vueuse/core';
|
|
1
2
|
declare const _default: import('vue').DefineComponent<{
|
|
2
3
|
context: {
|
|
3
4
|
type: ObjectConstructor;
|
|
4
5
|
required: true;
|
|
5
6
|
};
|
|
6
|
-
}, {
|
|
7
|
+
}, {
|
|
8
|
+
drop: {
|
|
9
|
+
active: boolean;
|
|
10
|
+
};
|
|
11
|
+
onClickOutside: typeof onClickOutside;
|
|
12
|
+
triggerDropdown: (e: any) => void;
|
|
13
|
+
}, {
|
|
7
14
|
error: string;
|
|
8
15
|
URLValue: string;
|
|
9
16
|
uploadURL: boolean;
|
|
@@ -12,12 +19,15 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
12
19
|
isLoading: boolean;
|
|
13
20
|
success: boolean;
|
|
14
21
|
fail: boolean;
|
|
22
|
+
validExtensions: any;
|
|
15
23
|
}, {
|
|
16
24
|
getCatalogue(): unknown;
|
|
17
25
|
getData: import('vuex').Computed;
|
|
18
26
|
getUserData: import('vuex').Computed;
|
|
19
27
|
getIsEditMode: import('vuex').Computed;
|
|
20
28
|
}, {
|
|
29
|
+
toggleUploadUrl(): void;
|
|
30
|
+
toggleUploadFileSwitch(): void;
|
|
21
31
|
validateFile(event: any): void;
|
|
22
32
|
saveUrl(): Promise<void>;
|
|
23
33
|
checkIfPresent(): true | undefined;
|
|
@@ -1,37 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
1
|
+
import { mapGetters as y, mapActions as E } from "vuex";
|
|
2
|
+
import S from "axios";
|
|
3
|
+
import O from "../utils/general-helper.mjs";
|
|
4
|
+
import { getNode as V } from "@formkit/core";
|
|
5
|
+
import { reactive as A, ref as C, openBlock as d, createElementBlock as c, Fragment as L, createElementVNode as s, createTextVNode as a, createCommentVNode as u, withDirectives as _, vModelText as w, mergeProps as T, toDisplayString as U, renderList as D, pushScopeId as P, popScopeId as G } from "vue";
|
|
6
|
+
import { onClickOutside as k } from "../../external/@vueuse/core/index";
|
|
7
|
+
import { useRuntimeEnv as q } from "../../composables/useRuntimeEnv.mjs";
|
|
7
8
|
import "./FileUpload.vue2.mjs";
|
|
8
|
-
import
|
|
9
|
-
const
|
|
10
|
-
key: 0,
|
|
11
|
-
class: "w-100 p-3 position-relative"
|
|
12
|
-
}, W = /* @__PURE__ */ h(() => /* @__PURE__ */ a("label", {
|
|
13
|
-
class: "formkit-label w-100",
|
|
14
|
-
for: "aUrlLink"
|
|
15
|
-
}, "Provide an URL", -1)), z = ["data-type"], J = { class: "file-div position-relative" }, K = /* @__PURE__ */ h(() => /* @__PURE__ */ a("label", {
|
|
16
|
-
class: "formkit-label",
|
|
17
|
-
for: "aUrlFL"
|
|
18
|
-
}, "Upload a file", -1)), Q = ["accept"], X = {
|
|
19
|
-
class: "upload-feedback position-absolute d-flex",
|
|
20
|
-
style: { right: "0" }
|
|
21
|
-
}, Y = {
|
|
22
|
-
key: 0,
|
|
23
|
-
class: "lds-ring"
|
|
24
|
-
}, Z = { key: 1 }, ee = /* @__PURE__ */ h(() => /* @__PURE__ */ a("i", { class: "material-icons d-flex check-icon" }, "check_circle", -1)), te = [
|
|
25
|
-
ee
|
|
26
|
-
], le = { key: 2 }, ie = /* @__PURE__ */ h(() => /* @__PURE__ */ a("i", { class: "material-icons d-flex close-icon" }, "error", -1)), oe = [
|
|
27
|
-
ie
|
|
28
|
-
], ae = {
|
|
29
|
-
key: 0,
|
|
30
|
-
class: "dURLText my-3"
|
|
31
|
-
}, se = ["href"], ne = {
|
|
32
|
-
key: 1,
|
|
33
|
-
class: "errorSub my-3 d-flex"
|
|
34
|
-
}, re = { class: "allowedTypesWrapper" }, de = {
|
|
9
|
+
import B from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
10
|
+
const N = {
|
|
35
11
|
props: {
|
|
36
12
|
context: {
|
|
37
13
|
type: Object,
|
|
@@ -39,6 +15,7 @@ const h = (t) => (P("data-v-798d4239"), t = t(), G(), t), _ = { class: "position
|
|
|
39
15
|
}
|
|
40
16
|
},
|
|
41
17
|
data() {
|
|
18
|
+
var t;
|
|
42
19
|
return {
|
|
43
20
|
error: "",
|
|
44
21
|
URLValue: "",
|
|
@@ -47,28 +24,35 @@ const h = (t) => (P("data-v-798d4239"), t = t(), G(), t), _ = { class: "position
|
|
|
47
24
|
checkifSet: !1,
|
|
48
25
|
isLoading: !1,
|
|
49
26
|
success: !1,
|
|
50
|
-
fail: !1
|
|
27
|
+
fail: !1,
|
|
28
|
+
validExtensions: ((t = this.$env.content.dataProviderInterface.uploadFileTypes) == null ? void 0 : t.split(",")) || []
|
|
51
29
|
};
|
|
52
30
|
},
|
|
53
31
|
computed: {
|
|
54
|
-
...
|
|
32
|
+
...y("auth", [
|
|
55
33
|
"getUserData",
|
|
56
34
|
"getIsEditMode"
|
|
57
35
|
]),
|
|
58
|
-
...
|
|
36
|
+
...y("dpiStore", [
|
|
59
37
|
"getData"
|
|
60
38
|
]),
|
|
61
39
|
getCatalogue() {
|
|
62
|
-
return
|
|
40
|
+
return V("dcat:catalog").value;
|
|
63
41
|
}
|
|
64
42
|
},
|
|
65
43
|
methods: {
|
|
66
|
-
...
|
|
44
|
+
...E("dpiStore", [
|
|
67
45
|
"saveLocalstorageValues"
|
|
68
46
|
]),
|
|
47
|
+
toggleUploadUrl() {
|
|
48
|
+
this.uploadURL && (this.uploadURL = !this.uploadURL);
|
|
49
|
+
},
|
|
50
|
+
toggleUploadFileSwitch() {
|
|
51
|
+
this.uploadFileSwitch && (this.uploadFileSwitch = !this.uploadFileSwitch);
|
|
52
|
+
},
|
|
69
53
|
validateFile(t) {
|
|
70
|
-
const
|
|
71
|
-
validExtensions
|
|
54
|
+
const o = "." + t.target.files[0].name.split(".").pop().toLowerCase();
|
|
55
|
+
this.validExtensions && this.validExtensions.length ? this.validExtensions.includes(o) ? this.uploadOrReplaceFile({ file: t.target.files[0] }) : console.log("Wrong filetype") : (this.error = "", this.uploadOrReplaceFile({ file: t.target.files[0] }));
|
|
72
56
|
},
|
|
73
57
|
async saveUrl() {
|
|
74
58
|
this.URLValue.includes("http://") || this.URLValue.includes("https://") ? await this.context.node.input({ "@id": this.URLValue }) : await this.context.node.input({ "@id": "https://" + this.URLValue });
|
|
@@ -79,29 +63,29 @@ const h = (t) => (P("data-v-798d4239"), t = t(), G(), t), _ = { class: "position
|
|
|
79
63
|
},
|
|
80
64
|
// finds the parent input group of a given element.
|
|
81
65
|
findParentInputGroupOfElement(t) {
|
|
82
|
-
let
|
|
83
|
-
for (;
|
|
84
|
-
if (
|
|
85
|
-
return
|
|
86
|
-
|
|
66
|
+
let e = t;
|
|
67
|
+
for (; e; ) {
|
|
68
|
+
if (e.classList.contains("formkit-input-group-repeatable"))
|
|
69
|
+
return e;
|
|
70
|
+
e = e.parentElement;
|
|
87
71
|
}
|
|
88
72
|
return null;
|
|
89
73
|
},
|
|
90
74
|
// finds the index of the distribution access URL based on the root of this component.
|
|
91
75
|
findDistributionAccessUrlIndex() {
|
|
92
|
-
const t = this.$refs.fileupload,
|
|
93
|
-
if (!
|
|
76
|
+
const t = this.$refs.fileupload, e = this.findParentInputGroupOfElement(t);
|
|
77
|
+
if (!e)
|
|
94
78
|
return null;
|
|
95
|
-
const
|
|
96
|
-
return Array.from(
|
|
79
|
+
const n = e.parentElement.querySelectorAll(".formkit-input-group-repeatable");
|
|
80
|
+
return Array.from(n).indexOf(e);
|
|
97
81
|
},
|
|
98
82
|
async uploadOrReplaceFile({ file: t }) {
|
|
99
|
-
var
|
|
100
|
-
const
|
|
101
|
-
if (
|
|
102
|
-
const
|
|
103
|
-
if (
|
|
104
|
-
const
|
|
83
|
+
var n, i, r, l, p, f, g;
|
|
84
|
+
const e = ((r = (i = (n = this.$env) == null ? void 0 : n.content) == null ? void 0 : i.dataProviderInterface) == null ? void 0 : r.enableFileUploadReplace) || !1, o = ((l = this.$route.query) == null ? void 0 : l.edit) ?? !1;
|
|
85
|
+
if (e && o) {
|
|
86
|
+
const b = (p = this.$route.query) == null ? void 0 : p.edit, I = this.findDistributionAccessUrlIndex(), m = (f = this.getData("distributions")) == null ? void 0 : f[b], v = (g = m == null ? void 0 : m["dcat:accessURL"]) == null ? void 0 : g[I], x = v == null ? void 0 : v["@id"];
|
|
87
|
+
if (x) {
|
|
88
|
+
const R = this.$env.api.fileUploadUrl, F = O.getFileIdByAccessUrl({ accessUrl: x, fileUploadUrl: R });
|
|
105
89
|
return await this.uploadFile(t, {
|
|
106
90
|
method: "PUT",
|
|
107
91
|
url: `${this.$env.api.fileUploadUrl}data/${F}?catalog=${this.getCatalogue}`
|
|
@@ -110,28 +94,28 @@ const h = (t) => (P("data-v-798d4239"), t = t(), G(), t), _ = { class: "position
|
|
|
110
94
|
}
|
|
111
95
|
return await this.uploadFile(t);
|
|
112
96
|
},
|
|
113
|
-
async uploadFile(t,
|
|
97
|
+
async uploadFile(t, e = {}) {
|
|
114
98
|
this.isLoading = !0;
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
const
|
|
99
|
+
const o = new FormData();
|
|
100
|
+
o.append("file", t);
|
|
101
|
+
const n = this.getCatalogue, i = this.getUserData.rtpToken, r = {
|
|
118
102
|
method: "POST",
|
|
119
|
-
url: `${this.$env.api.fileUploadUrl}data?catalog=${
|
|
120
|
-
...
|
|
121
|
-
},
|
|
122
|
-
method:
|
|
123
|
-
url:
|
|
103
|
+
url: `${this.$env.api.fileUploadUrl}data?catalog=${n}`,
|
|
104
|
+
...e
|
|
105
|
+
}, l = {
|
|
106
|
+
method: r.method,
|
|
107
|
+
url: r.url,
|
|
124
108
|
headers: {
|
|
125
109
|
"Content-Type": "multipart/form-data",
|
|
126
|
-
Authorization: `Bearer ${
|
|
110
|
+
Authorization: `Bearer ${i}`
|
|
127
111
|
},
|
|
128
|
-
data:
|
|
112
|
+
data: o
|
|
129
113
|
};
|
|
130
114
|
try {
|
|
131
|
-
const
|
|
132
|
-
this.context.model = `${this.$env.api.fileUploadUrl}${
|
|
133
|
-
} catch (
|
|
134
|
-
this.isLoading = !1, this.fail = !0, console.error(
|
|
115
|
+
const p = await S.request(l), f = p.data.result.location.substring(p.data.result.location.indexOf("/") + 1);
|
|
116
|
+
this.context.model = `${this.$env.api.fileUploadUrl}${f}`, this.isLoading = !1, this.success = !0, await this.context.node.input({ "@id": `${this.$env.api.fileUploadUrl}${f}` });
|
|
117
|
+
} catch (p) {
|
|
118
|
+
this.isLoading = !1, this.fail = !0, console.error(p);
|
|
135
119
|
}
|
|
136
120
|
}
|
|
137
121
|
},
|
|
@@ -140,126 +124,159 @@ const h = (t) => (P("data-v-798d4239"), t = t(), G(), t), _ = { class: "position
|
|
|
140
124
|
if (this.context.value["@id"])
|
|
141
125
|
return this.uploadURL = !0, this.URLValue = this.context.value["@id"], !0;
|
|
142
126
|
});
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
let o = x().appContext.app.config.globalProperties.$env;
|
|
148
|
-
var n = O({
|
|
127
|
+
},
|
|
128
|
+
setup() {
|
|
129
|
+
q();
|
|
130
|
+
var t = A({
|
|
149
131
|
active: !1
|
|
150
132
|
});
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
function
|
|
154
|
-
|
|
133
|
+
const e = C(null);
|
|
134
|
+
k(e, (n) => t.active = !1);
|
|
135
|
+
function o(n) {
|
|
136
|
+
t.active = !t.active;
|
|
155
137
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
138
|
+
return {
|
|
139
|
+
drop: t,
|
|
140
|
+
onClickOutside: k,
|
|
141
|
+
triggerDropdown: o
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
}, h = (t) => (P("data-v-cc0a83a3"), t = t(), G(), t), H = { class: "position-relative w-100 p-3" }, M = {
|
|
145
|
+
key: 0,
|
|
146
|
+
ref: "fLoad",
|
|
147
|
+
class: "selectListUpload"
|
|
148
|
+
}, W = {
|
|
149
|
+
key: 0,
|
|
150
|
+
class: "w-100 p-3 position-relative"
|
|
151
|
+
}, j = /* @__PURE__ */ h(() => /* @__PURE__ */ s("label", {
|
|
152
|
+
class: "formkit-label w-100",
|
|
153
|
+
for: "aUrlLink"
|
|
154
|
+
}, "Provide an URL", -1)), z = ["data-type"], J = { class: "file-div position-relative" }, K = /* @__PURE__ */ h(() => /* @__PURE__ */ s("label", {
|
|
155
|
+
class: "formkit-label",
|
|
156
|
+
for: "aUrlFL"
|
|
157
|
+
}, "Upload a file", -1)), Q = ["accept"], X = {
|
|
158
|
+
class: "upload-feedback position-absolute d-flex",
|
|
159
|
+
style: { right: "0" }
|
|
160
|
+
}, Y = {
|
|
161
|
+
key: 0,
|
|
162
|
+
class: "lds-ring"
|
|
163
|
+
}, Z = { key: 1 }, $ = /* @__PURE__ */ h(() => /* @__PURE__ */ s("i", { class: "material-icons d-flex check-icon" }, "check_circle", -1)), ee = [
|
|
164
|
+
$
|
|
165
|
+
], te = { key: 2 }, ie = /* @__PURE__ */ h(() => /* @__PURE__ */ s("i", { class: "material-icons d-flex close-icon" }, "error", -1)), le = [
|
|
166
|
+
ie
|
|
167
|
+
], oe = {
|
|
168
|
+
key: 0,
|
|
169
|
+
class: "dURLText my-3"
|
|
170
|
+
}, se = ["href"], ae = {
|
|
171
|
+
key: 1,
|
|
172
|
+
class: "allowedTypesWrapper"
|
|
173
|
+
}, ne = {
|
|
174
|
+
key: 0,
|
|
175
|
+
class: "errorSub my-3 d-flex"
|
|
176
|
+
}, re = { class: "d-flex flex-wrap w-100" };
|
|
177
|
+
function de(t, e, o, n, i, r) {
|
|
178
|
+
return d(), c(L, null, [
|
|
179
|
+
s("div", H, [
|
|
180
|
+
s("input", {
|
|
181
|
+
type: "text",
|
|
182
|
+
class: "selectInputField formkit-inner",
|
|
183
|
+
readonly: "readonly",
|
|
184
|
+
onClick: e[0] || (e[0] = (l) => n.triggerDropdown()),
|
|
185
|
+
placeholder: "Choose between fileupload and providing a URL"
|
|
186
|
+
}),
|
|
187
|
+
a(),
|
|
188
|
+
n.drop.active ? (d(), c("ul", M, [
|
|
189
|
+
s("li", {
|
|
190
|
+
onClick: e[1] || (e[1] = (l) => {
|
|
191
|
+
n.triggerDropdown(), i.uploadFileSwitch = !0, r.toggleUploadUrl();
|
|
192
|
+
}),
|
|
193
|
+
class: "p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC"
|
|
194
|
+
}, "Upload a file"),
|
|
195
|
+
a(),
|
|
196
|
+
s("li", {
|
|
197
|
+
onClick: e[2] || (e[2] = (l) => {
|
|
198
|
+
n.triggerDropdown(), i.uploadURL = !0, r.toggleUploadFileSwitch();
|
|
199
|
+
}),
|
|
200
|
+
class: "p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC"
|
|
201
|
+
}, "Provide an URL")
|
|
202
|
+
], 512)) : u("", !0)
|
|
203
|
+
]),
|
|
204
|
+
a(),
|
|
205
|
+
i.uploadURL && !i.uploadFileSwitch ? (d(), c("div", W, [
|
|
206
|
+
j,
|
|
207
|
+
a(),
|
|
208
|
+
_(s("input", {
|
|
209
|
+
id: "aUrlLink",
|
|
210
|
+
"onUpdate:modelValue": e[3] || (e[3] = (l) => i.URLValue = l),
|
|
211
|
+
class: "selectInputField formkit-inner",
|
|
212
|
+
type: "url",
|
|
213
|
+
name: "@id",
|
|
214
|
+
onInput: e[4] || (e[4] = (...l) => r.saveUrl && r.saveUrl(...l)),
|
|
215
|
+
validation: "alpha_spaces:latin",
|
|
216
|
+
"validation-visibility": "live"
|
|
217
|
+
}, null, 544), [
|
|
218
|
+
[w, i.URLValue]
|
|
219
|
+
])
|
|
220
|
+
])) : u("", !0),
|
|
221
|
+
a(),
|
|
222
|
+
i.uploadFileSwitch ? (d(), c("div", T({
|
|
223
|
+
key: 1,
|
|
224
|
+
ref: "fileupload",
|
|
225
|
+
class: ["p-3 w-100", `formkit-input-element formkit-input-element--${o.context.type}`],
|
|
226
|
+
"data-type": o.context.type
|
|
227
|
+
}, t.$attrs), [
|
|
228
|
+
_(s("input", {
|
|
229
|
+
type: "text",
|
|
230
|
+
"onUpdate:modelValue": e[5] || (e[5] = (l) => o.context.model = l),
|
|
231
|
+
onBlur: e[6] || (e[6] = (...l) => o.context.blurHandler && o.context.blurHandler(...l)),
|
|
232
|
+
hidden: ""
|
|
233
|
+
}, null, 544), [
|
|
234
|
+
[w, o.context.model]
|
|
188
235
|
]),
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
236
|
+
a(),
|
|
237
|
+
s("div", J, [
|
|
238
|
+
K,
|
|
239
|
+
a(),
|
|
240
|
+
s("input", {
|
|
241
|
+
class: "mt-3",
|
|
242
|
+
type: "file",
|
|
243
|
+
id: "aUrlFL",
|
|
244
|
+
name: "fileUpload",
|
|
245
|
+
onChange: e[7] || (e[7] = (l) => r.validateFile(l)),
|
|
246
|
+
accept: i.validExtensions
|
|
247
|
+
}, null, 40, Q),
|
|
248
|
+
a(),
|
|
249
|
+
s("div", X, [
|
|
250
|
+
i.isLoading ? (d(), c("div", Y)) : u("", !0),
|
|
251
|
+
a(),
|
|
252
|
+
i.success ? (d(), c("div", Z, ee)) : u("", !0),
|
|
253
|
+
a(),
|
|
254
|
+
i.fail ? (d(), c("div", te, le)) : u("", !0)
|
|
204
255
|
])
|
|
205
|
-
])
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
]),
|
|
221
|
-
s(),
|
|
222
|
-
a("div", J, [
|
|
223
|
-
K,
|
|
224
|
-
s(),
|
|
225
|
-
a("input", {
|
|
226
|
-
class: "mt-3",
|
|
227
|
-
type: "file",
|
|
228
|
-
id: "aUrlFL",
|
|
229
|
-
name: "fileUpload",
|
|
230
|
-
onChange: l[7] || (l[7] = (i) => e.validateFile(i)),
|
|
231
|
-
accept: c.value
|
|
232
|
-
}, null, 40, Q),
|
|
233
|
-
s(),
|
|
234
|
-
a("div", X, [
|
|
235
|
-
e.isLoading ? (r(), d("div", Y)) : f("", !0),
|
|
236
|
-
s(),
|
|
237
|
-
e.success ? (r(), d("div", Z, te)) : f("", !0),
|
|
238
|
-
s(),
|
|
239
|
-
e.fail ? (r(), d("div", le, oe)) : f("", !0)
|
|
240
|
-
])
|
|
241
|
-
]),
|
|
242
|
-
s(),
|
|
243
|
-
e.success ? (r(), d("p", ae, [
|
|
244
|
-
s(g(e.$t("message.metadata.downloadUrl")) + ": ", 1),
|
|
245
|
-
a("a", {
|
|
246
|
-
href: t.context.model
|
|
247
|
-
}, g(t.context.model), 9, se)
|
|
248
|
-
])) : f("", !0),
|
|
249
|
-
s(),
|
|
250
|
-
e.success ? f("", !0) : (r(), d("p", ne, "Allowed types: ")),
|
|
251
|
-
s(),
|
|
252
|
-
a("div", re, [
|
|
253
|
-
(r(!0), d(L, null, T(c.value, (i, m) => (r(), d("span", {
|
|
254
|
-
key: i,
|
|
256
|
+
]),
|
|
257
|
+
a(),
|
|
258
|
+
i.success ? (d(), c("p", oe, [
|
|
259
|
+
a(U(t.$t("message.metadata.downloadUrl")) + ": ", 1),
|
|
260
|
+
s("a", {
|
|
261
|
+
href: o.context.model
|
|
262
|
+
}, U(o.context.model), 9, se)
|
|
263
|
+
])) : u("", !0),
|
|
264
|
+
a(),
|
|
265
|
+
i.validExtensions && i.validExtensions.length ? (d(), c("div", ae, [
|
|
266
|
+
i.success ? u("", !0) : (d(), c("p", ne, "Allowed types: ")),
|
|
267
|
+
a(),
|
|
268
|
+
s("div", re, [
|
|
269
|
+
(d(!0), c(L, null, D(i.validExtensions, (l) => (d(), c("span", {
|
|
270
|
+
key: l,
|
|
255
271
|
class: "mr-1 mb-1 allowedFTypes"
|
|
256
|
-
},
|
|
272
|
+
}, U(l), 1))), 128))
|
|
257
273
|
])
|
|
258
|
-
]
|
|
259
|
-
],
|
|
260
|
-
|
|
261
|
-
}
|
|
274
|
+
])) : u("", !0)
|
|
275
|
+
], 16, z)) : u("", !0)
|
|
276
|
+
], 64);
|
|
277
|
+
}
|
|
278
|
+
const xe = /* @__PURE__ */ B(N, [["render", de], ["__scopeId", "data-v-cc0a83a3"]]);
|
|
262
279
|
export {
|
|
263
|
-
|
|
280
|
+
xe as default
|
|
264
281
|
};
|
|
265
282
|
//# sourceMappingURL=FileUpload.vue.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUpload.vue.mjs","sources":["../../../lib/data-provider-interface/components/FileUpload.vue"],"sourcesContent":["<script setup>\nimport { reactive, ref, onMounted, computed } from 'vue';\nimport { onClickOutside } from '@vueuse/core'\nimport { getCurrentInstance } from \"vue\";\n\nlet instance = getCurrentInstance().appContext.app.config.globalProperties.$env\n\nvar drop = reactive({\n active: false,\n})\n\nconst fLoad = ref(null);\n\nonClickOutside(fLoad, event => drop.active = false)\nfunction triggerDropdown(e) {\n drop.active = !drop.active\n}\nconst validExtensions = computed(() => {\n let arr = instance.content.dataProviderInterface.uploadFileTypes.split(',')\n return arr\n})\n\nonMounted(async () => {\n});\n\n</script>\n\n<template>\n <div class=\"position-relative w-100 p-3 \">\n <input type=\"text\" class=\"selectInputField formkit-inner\" readonly=\"readonly\" @click=\"triggerDropdown()\"\n placeholder=\"Choose between fileupload and providing a URL\">\n <ul ref=\"fLoad\" v-if=\"drop.active\" class=\"selectListUpload\">\n <li @click=\"triggerDropdown(); uploadFileSwitch = true; if (uploadURL) { uploadURL = !uploadURL }\"\n class=\"p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC\">Upload a file</li>\n <li @click=\"triggerDropdown(); uploadURL = true; if (uploadFileSwitch) { uploadFileSwitch = !uploadFileSwitch }\"\n class=\"p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC\">Provide an URL</li>\n </ul>\n </div>\n <div class=\"w-100 p-3 position-relative\" v-if=\"uploadURL && !uploadFileSwitch\">\n <label class=\" formkit-label w-100\" for=\"aUrlLink\">Provide an URL</label>\n <input id=\"aUrlLink\" v-model=\"URLValue\" class=\"selectInputField formkit-inner\" type=\"url\" name=\"@id\"\n @input=\"saveUrl\" validation=\"alpha_spaces:latin\" validation-visibility=\"live\">\n\n </div>\n <div v-if=\"uploadFileSwitch\" ref=\"fileupload\" class=\"p-3 w-100\"\n :class=\"`formkit-input-element formkit-input-element--${context.type}`\" :data-type=\"context.type\" v-bind=\"$attrs\">\n <input type=\"text\" v-model=\"context.model\" @blur=\"context.blurHandler\" hidden />\n <div class=\"file-div position-relative\">\n <label class=\"formkit-label\" for=\"aUrlFL\">Upload a file</label>\n <input class=\"mt-3\" type=\"file\" id=\"aUrlFL\" name=\"fileUpload\" @change=\"validateFile($event)\"\n :accept=\"validExtensions\">\n <div class=\"upload-feedback position-absolute d-flex\" style=\"right: 0\">\n <div v-if=\"isLoading\" class=\"lds-ring\">\n </div>\n <div v-if=\"success\"><i class=\"material-icons d-flex check-icon\">check_circle</i></div>\n <div v-if=\"fail\"><i class=\"material-icons d-flex close-icon\">error</i></div>\n </div>\n </div>\n <p class=\"dURLText my-3\" v-if=\"success\">{{ $t('message.metadata.downloadUrl') }}: <a :href=\"context.model\">{{\n context.model }}</a></p>\n <p class=\"errorSub my-3 d-flex \" v-if=\"!success\">Allowed types: </p>\n <div class=\"allowedTypesWrapper\">\n <span v-for=\"types, index in validExtensions\" :key=\"types\" class=\"mr-1 mb-1 allowedFTypes \">{{ types\n }}</span>\n </div>\n\n\n </div>\n\n</template>\n\n<script>\n/* eslint-disable consistent-return, no-unused-vars */\nimport { mapGetters, mapActions } from 'vuex';\nimport axios from 'axios';\nimport helper from '../utils/general-helper'\nimport { getNode } from '@formkit/core'\n\nexport default {\n props: {\n context: {\n type: Object,\n required: true,\n },\n },\n\n data() {\n return {\n error: '',\n URLValue: '',\n uploadURL: false,\n uploadFileSwitch: false,\n checkifSet: false,\n isLoading: false,\n success: false,\n fail: false,\n\n };\n },\n computed: {\n\n ...mapGetters('auth', [\n 'getUserData',\n 'getIsEditMode'\n ]),\n ...mapGetters('dpiStore', [\n 'getData',\n ]),\n getCatalogue() {\n return getNode('dcat:catalog').value;\n },\n },\n methods: {\n ...mapActions('dpiStore', [\n 'saveLocalstorageValues',\n ]),\n validateFile(event) {\n\n const file = event.target.files[0];\n\n const fileExtension = '.' + file.name.split('.').pop().toLowerCase();\n if (validExtensions != undefined) {\n if (validExtensions.length != 0) {\n if (!validExtensions.includes(fileExtension)) {\n console.log('Wrong filetype');\n\n } else {\n this.uploadOrReplaceFile({ file: event.target.files[0] })\n }\n }\n } else {\n this.error = \"\"\n this.uploadOrReplaceFile({ file: event.target.files[0] })\n }\n },\n async saveUrl() {\n\n if (this.URLValue.includes('http://') || this.URLValue.includes('https://')) {\n await this.context.node.input({ '@id': this.URLValue })\n }\n else await this.context.node.input({ '@id': 'https://' + this.URLValue })\n\n },\n checkIfPresent() {\n // console.log(this.context.value['@id']);\n if (this.context.value['@id']) {\n // console.log(this.context.value['@id']);\n this.URLValue = this.context.value['@id']\n return true\n }\n else false\n },\n // finds the parent input group of a given element.\n findParentInputGroupOfElement(element) {\n // Start with the given element.\n let currentElement = element;\n\n // Traverse the DOM tree upwards.\n while (currentElement) {\n // If the current element is an input group, return it.\n if (currentElement.classList.contains('formkit-input-group-repeatable')) {\n return currentElement;\n }\n // If not, move to the parent element.\n currentElement = currentElement.parentElement;\n }\n\n // If no input group was found, return null.\n return null;\n },\n // finds the index of the distribution access URL based on the root of this component.\n findDistributionAccessUrlIndex() {\n // todo: find a more stable way to find the index of the distribution access URL.\n // this way uses the DOM tree, which is not stable.\n\n // Start at the root of this component.\n const rootElement = this.$refs.fileupload;\n\n // Find the parent input group of the root element.\n const parentInputGroup = this.findParentInputGroupOfElement(rootElement);\n if (!parentInputGroup) return null;\n\n // Get the parent element of all input groups.\n const parentOfAllInputGroups = parentInputGroup.parentElement;\n const allInputGroupsNodeList = parentOfAllInputGroups.querySelectorAll('.formkit-input-group-repeatable');\n const allInputGroupsArray = Array.from(allInputGroupsNodeList);\n\n // Find the index of the parent input group within the array of all input groups.\n const indexOfParentInputGroup = allInputGroupsArray.indexOf(parentInputGroup);\n\n return indexOfParentInputGroup;\n },\n async uploadOrReplaceFile({ file }) {\n\n const replaceEnabled = this.$env?.content?.dataProviderInterface?.enableFileUploadReplace || false;\n const wantsToReplace = this.$route.query?.edit ?? false;\n\n if (replaceEnabled && wantsToReplace) {\n const distributionIndexToReplace = this.$route.query?.edit;\n const fileIndexToReplace = this.findDistributionAccessUrlIndex();\n\n const targetDistribution = this.getData('distributions')?.[distributionIndexToReplace];\n const targetFile = targetDistribution?.['dcat:accessURL']?.[fileIndexToReplace];\n const accessUrl = targetFile?.['@id'];\n if (accessUrl) {\n const fileUploadUrl = this.$env.api.fileUploadUrl;\n\n const fileId = helper.getFileIdByAccessUrl({ accessUrl, fileUploadUrl })\n\n return await this.uploadFile(file, {\n method: 'PUT',\n url: `${this.$env.api.fileUploadUrl}data/${fileId}?catalog=${this.getCatalogue}`,\n });\n }\n\n }\n\n return await this.uploadFile(file);\n },\n async uploadFile(file, options = {}) {\n\n this.isLoading = true;\n\n const form = new FormData();\n form.append('file', file);\n\n const catalog = this.getCatalogue;\n const token = this.getUserData.rtpToken;\n\n const resolvedOptions = {\n method: 'POST',\n url: `${this.$env.api.fileUploadUrl}data?catalog=${catalog}`,\n ...options,\n };\n\n const requestOptions = {\n method: resolvedOptions.method,\n url: resolvedOptions.url,\n headers: {\n 'Content-Type': 'multipart/form-data',\n Authorization: `Bearer ${token}`,\n },\n data: form,\n };\n\n try {\n\n const result = await axios.request(requestOptions);\n const path = result.data.result.location.substring(result.data.result.location.indexOf('/') + 1);\n this.context.model = `${this.$env.api.fileUploadUrl}${path}`;\n this.isLoading = false;\n this.success = true;\n await this.context.node.input({ '@id': `${this.$env.api.fileUploadUrl}${path}` })\n // this.context.rootEmit('change');\n\n } catch (err) {\n\n this.isLoading = false;\n this.fail = true;\n console.error(err); // eslint-disable-line\n }\n },\n },\n mounted() {\n\n this.$nextTick(function () {\n\n if (this.context.value['@id']) {\n this.uploadURL = true\n this.URLValue = this.context.value['@id']\n return true\n }\n else false\n })\n }\n};\n</script>\n\n<style lang=\"scss\" scoped>\n// @import '../../../styles/bootstrap_theme';\n// @import '../../../styles/utils/css-animations';\n.dURLText {}\n\n.file-div {\n display: flex;\n align-items: center;\n}\n\n.upload-feedback {\n padding: 10px;\n}\n\n/*** MATERIAL ICONS ***/\n%modal-icon {\n font-size: 20px;\n cursor: default;\n}\n\n.check-icon {\n @extend %modal-icon;\n color: #28a745;\n}\n\n.close-icon {\n @extend %modal-icon;\n color: red;\n}\n\n.lds-ring {\n display: inline-block;\n position: relative;\n width: 30px;\n height: 30px;\n}\n\n.lds-ring div {\n box-sizing: border-box;\n display: block;\n position: absolute;\n right: 0;\n width: 30px;\n height: 30px;\n border: 8px solid lightgray;\n border-radius: 50%;\n animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;\n border-color: lightgray transparent transparent transparent;\n}\n\n.lds-ring div:nth-child(1) {\n animation-delay: -0.45s;\n}\n\n.lds-ring div:nth-child(2) {\n animation-delay: -0.3s;\n}\n\n.lds-ring div:nth-child(3) {\n animation-delay: -0.15s;\n}\n\n.error {\n color: red;\n}\n\n.errorSub {\n color: black;\n}\n\n@keyframes lds-ring {\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.allowedFTypes {\n padding: 0.5rem;\n border-radius: 5px;\n border: 1px solid lightgrey;\n}\n\n.allowedTypesWrapper {\n max-width: 100%;\n display: flex;\n flex-wrap: wrap;\n}\n</style>\n"],"names":["__default__","mapGetters","getNode","mapActions","event","fileExtension","element","currentElement","rootElement","parentInputGroup","allInputGroupsNodeList","file","replaceEnabled","_c","_b","_a","wantsToReplace","_d","distributionIndexToReplace","_e","fileIndexToReplace","targetDistribution","_f","targetFile","_g","accessUrl","fileUploadUrl","fileId","helper","options","form","catalog","token","resolvedOptions","requestOptions","result","axios","path","err","instance","getCurrentInstance","drop","reactive","fLoad","ref","onClickOutside","triggerDropdown","validExtensions","computed","onMounted"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0CA8EAA,KAAe;AAAA,EACb,OAAO;AAAA,IACL,SAAS;AAAA,MACP,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA,EACF;AAAA,EAED,OAAO;AACL,WAAO;AAAA,MACL,OAAO;AAAA,MACP,UAAU;AAAA,MACV,WAAW;AAAA,MACX,kBAAkB;AAAA,MAClB,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,SAAS;AAAA,MACT,MAAM;AAAA,IAEZ;AAAA,EACG;AAAA,EACD,UAAU;AAAA,IAER,GAAGC,EAAW,QAAQ;AAAA,MACpB;AAAA,MACA;AAAA,IACN,CAAK;AAAA,IACD,GAAGA,EAAW,YAAY;AAAA,MACxB;AAAA,IACN,CAAK;AAAA,IACD,eAAe;AACb,aAAOC,EAAQ,cAAc,EAAE;AAAA,IAChC;AAAA,EACF;AAAA,EACD,SAAS;AAAA,IACP,GAAGC,EAAW,YAAY;AAAA,MACxB;AAAA,IACN,CAAK;AAAA,IACD,aAAaC,GAAO;AAIlB,YAAMC,IAAgB,MAFTD,EAAM,OAAO,MAAM,CAAC,EAEA,KAAK,MAAM,GAAG,EAAE,MAAM;AACvD,MAAI,mBAAmB,OACjB,gBAAgB,UAAU,MACvB,gBAAgB,SAASC,CAAa,IAIzC,KAAK,oBAAoB,EAAE,MAAMD,EAAM,OAAO,MAAM,CAAC,GAAG,I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AK,KAAK,IAAI,aAAa,GAAGE,CAAI,IAC1D,KAAK,YAAY,IACjB,KAAK,UAAU,IACf,MAAM,KAAK,QAAQ,KAAK,MAAM,EAAE,OAAO,GAAG,KAAK,KAAK,IAAI,aAAa,GAAGA,CAAI,GAAE,CAAE;AAAA,MAGjF,SAAQC,GAAK;AAEZ,aAAK,YAAY,IACjB,KAAK,OAAO,IACZ,QAAQ,MAAMA,CAAG;AAAA,MAClB;AAAA,IACF;AAAA,EACF;AAAA,EACD,UAAU;AAER,SAAK,UAAU,WAAY;AAEzB,UAAI,KAAK,QAAQ,MAAM,KAAK;AAC1B,oBAAK,YAAY,IACjB,KAAK,WAAW,KAAK,QAAQ,MAAM,KAAK,GACjC;AAAA,IAGf,CAAK;AAAA,EACF;AACH;;;AA9QA,QAAIC,IAAWC,EAAkB,EAAG,WAAW,IAAI,OAAO,iBAAiB;AAE3E,QAAIC,IAAOC,EAAS;AAAA,MAClB,QAAQ;AAAA,IACV,CAAC;AAED,UAAMC,IAAQC,EAAI,IAAI;AAEtB,IAAAC,EAAeF,GAAO,CAAAvC,MAASqC,EAAK,SAAS,EAAK;AAClD,aAASK,EAAgB,GAAG;AAC1B,MAAAL,EAAK,SAAS,CAACA,EAAK;AAAA,IACtB;AACA,UAAMM,IAAkBC,EAAS,MACrBT,EAAS,QAAQ,sBAAsB,gBAAgB,MAAM,GAAG,CAE3E;AAED,WAAAU,EAAU,YAAY;AAAA,IACtB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"FileUpload.vue.mjs","sources":["../../../lib/data-provider-interface/components/FileUpload.vue"],"sourcesContent":["<template>\n <div class=\"position-relative w-100 p-3 \">\n <input type=\"text\" class=\"selectInputField formkit-inner\" readonly=\"readonly\" @click=\"triggerDropdown()\"\n placeholder=\"Choose between fileupload and providing a URL\">\n <ul ref=\"fLoad\" v-if=\"drop.active\" class=\"selectListUpload\">\n <li @click=\"triggerDropdown(); uploadFileSwitch = true; toggleUploadUrl()\"\n class=\"p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC\">Upload a file</li>\n <li @click=\"triggerDropdown(); uploadURL = true; toggleUploadFileSwitch()\"\n class=\"p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC\">Provide an URL</li>\n </ul>\n </div>\n <div class=\"w-100 p-3 position-relative\" v-if=\"uploadURL && !uploadFileSwitch\">\n <label class=\" formkit-label w-100\" for=\"aUrlLink\">Provide an URL</label>\n <input id=\"aUrlLink\" v-model=\"URLValue\" class=\"selectInputField formkit-inner\" type=\"url\" name=\"@id\"\n @input=\"saveUrl\" validation=\"alpha_spaces:latin\" validation-visibility=\"live\">\n\n </div>\n <div v-if=\"uploadFileSwitch\" ref=\"fileupload\" class=\"p-3 w-100\"\n :class=\"`formkit-input-element formkit-input-element--${context.type}`\" :data-type=\"context.type\" v-bind=\"$attrs\">\n <input type=\"text\" v-model=\"context.model\" @blur=\"context.blurHandler\" hidden />\n <div class=\"file-div position-relative\">\n <label class=\"formkit-label\" for=\"aUrlFL\">Upload a file</label>\n <input class=\"mt-3\" type=\"file\" id=\"aUrlFL\" name=\"fileUpload\" @change=\"validateFile($event)\"\n :accept=\"validExtensions\">\n <div class=\"upload-feedback position-absolute d-flex\" style=\"right: 0\">\n <div v-if=\"isLoading\" class=\"lds-ring\">\n </div>\n <div v-if=\"success\"><i class=\"material-icons d-flex check-icon\">check_circle</i></div>\n <div v-if=\"fail\"><i class=\"material-icons d-flex close-icon\">error</i></div>\n </div>\n </div>\n <p class=\"dURLText my-3\" v-if=\"success\">{{ $t('message.metadata.downloadUrl') }}: <a :href=\"context.model\">{{\n context.model }}</a></p>\n <div v-if=\"validExtensions && validExtensions.length\" class=\"allowedTypesWrapper\">\n <p class=\"errorSub my-3 d-flex \" v-if=\"!success\">Allowed types: </p>\n <div class=\"d-flex flex-wrap w-100\">\n <span v-for=\"types in validExtensions\" :key=\"types\" class=\"mr-1 mb-1 allowedFTypes \">\n {{ types }}\n </span>\n </div>\n\n </div>\n\n\n </div>\n\n</template>\n\n<script>\n/* eslint-disable consistent-return, no-unused-vars */\nimport { mapGetters, mapActions } from 'vuex';\nimport axios from 'axios';\nimport helper from '../utils/general-helper'\nimport { getNode } from '@formkit/core'\n\nimport { reactive, ref, onMounted, computed } from 'vue';\nimport { onClickOutside } from '@vueuse/core'\nimport { getCurrentInstance } from \"vue\";\nimport { useRuntimeEnv } from \"../../composables/useRuntimeEnv.ts\";\n\nexport default {\n props: {\n context: {\n type: Object,\n required: true,\n },\n },\n\n data() {\n return {\n error: '',\n URLValue: '',\n uploadURL: false,\n uploadFileSwitch: false,\n checkifSet: false,\n isLoading: false,\n success: false,\n fail: false,\n validExtensions: this.$env.content.dataProviderInterface.uploadFileTypes?.split(',') || []\n };\n },\n computed: {\n\n ...mapGetters('auth', [\n 'getUserData',\n 'getIsEditMode'\n ]),\n ...mapGetters('dpiStore', [\n 'getData',\n ]),\n getCatalogue() {\n return getNode('dcat:catalog').value;\n }\n },\n methods: {\n ...mapActions('dpiStore', [\n 'saveLocalstorageValues',\n ]),\n toggleUploadUrl() {\n if (this.uploadURL) { this.uploadURL = !this.uploadURL }\n },\n toggleUploadFileSwitch() {\n if (this.uploadFileSwitch) { this.uploadFileSwitch = !this.uploadFileSwitch }\n },\n validateFile(event) {\n const file = event.target.files[0];\n const fileExtension = '.' + file.name.split('.').pop().toLowerCase();\n if (this.validExtensions && this.validExtensions.length) {\n if (!this.validExtensions.includes(fileExtension)) {\n console.log('Wrong filetype');\n } else {\n this.uploadOrReplaceFile({ file: event.target.files[0] })\n }\n } else {\n this.error = \"\"\n this.uploadOrReplaceFile({ file: event.target.files[0] })\n }\n },\n async saveUrl() {\n\n if (this.URLValue.includes('http://') || this.URLValue.includes('https://')) {\n await this.context.node.input({ '@id': this.URLValue })\n }\n else await this.context.node.input({ '@id': 'https://' + this.URLValue })\n\n },\n checkIfPresent() {\n // console.log(this.context.value['@id']);\n if (this.context.value['@id']) {\n // console.log(this.context.value['@id']);\n this.URLValue = this.context.value['@id']\n return true\n }\n else false\n },\n // finds the parent input group of a given element.\n findParentInputGroupOfElement(element) {\n // Start with the given element.\n let currentElement = element;\n\n // Traverse the DOM tree upwards.\n while (currentElement) {\n // If the current element is an input group, return it.\n if (currentElement.classList.contains('formkit-input-group-repeatable')) {\n return currentElement;\n }\n // If not, move to the parent element.\n currentElement = currentElement.parentElement;\n }\n\n // If no input group was found, return null.\n return null;\n },\n // finds the index of the distribution access URL based on the root of this component.\n findDistributionAccessUrlIndex() {\n // todo: find a more stable way to find the index of the distribution access URL.\n // this way uses the DOM tree, which is not stable.\n\n // Start at the root of this component.\n const rootElement = this.$refs.fileupload;\n\n // Find the parent input group of the root element.\n const parentInputGroup = this.findParentInputGroupOfElement(rootElement);\n if (!parentInputGroup) return null;\n\n // Get the parent element of all input groups.\n const parentOfAllInputGroups = parentInputGroup.parentElement;\n const allInputGroupsNodeList = parentOfAllInputGroups.querySelectorAll('.formkit-input-group-repeatable');\n const allInputGroupsArray = Array.from(allInputGroupsNodeList);\n\n // Find the index of the parent input group within the array of all input groups.\n const indexOfParentInputGroup = allInputGroupsArray.indexOf(parentInputGroup);\n\n return indexOfParentInputGroup;\n },\n async uploadOrReplaceFile({ file }) {\n\n const replaceEnabled = this.$env?.content?.dataProviderInterface?.enableFileUploadReplace || false;\n const wantsToReplace = this.$route.query?.edit ?? false;\n\n if (replaceEnabled && wantsToReplace) {\n const distributionIndexToReplace = this.$route.query?.edit;\n const fileIndexToReplace = this.findDistributionAccessUrlIndex();\n\n const targetDistribution = this.getData('distributions')?.[distributionIndexToReplace];\n const targetFile = targetDistribution?.['dcat:accessURL']?.[fileIndexToReplace];\n const accessUrl = targetFile?.['@id'];\n if (accessUrl) {\n const fileUploadUrl = this.$env.api.fileUploadUrl;\n\n const fileId = helper.getFileIdByAccessUrl({ accessUrl, fileUploadUrl })\n\n return await this.uploadFile(file, {\n method: 'PUT',\n url: `${this.$env.api.fileUploadUrl}data/${fileId}?catalog=${this.getCatalogue}`,\n });\n }\n\n }\n\n return await this.uploadFile(file);\n },\n async uploadFile(file, options = {}) {\n\n this.isLoading = true;\n\n const form = new FormData();\n form.append('file', file);\n\n const catalog = this.getCatalogue;\n const token = this.getUserData.rtpToken;\n\n const resolvedOptions = {\n method: 'POST',\n url: `${this.$env.api.fileUploadUrl}data?catalog=${catalog}`,\n ...options,\n };\n\n const requestOptions = {\n method: resolvedOptions.method,\n url: resolvedOptions.url,\n headers: {\n 'Content-Type': 'multipart/form-data',\n Authorization: `Bearer ${token}`,\n },\n data: form,\n };\n\n try {\n\n const result = await axios.request(requestOptions);\n const path = result.data.result.location.substring(result.data.result.location.indexOf('/') + 1);\n this.context.model = `${this.$env.api.fileUploadUrl}${path}`;\n this.isLoading = false;\n this.success = true;\n await this.context.node.input({ '@id': `${this.$env.api.fileUploadUrl}${path}` })\n // this.context.rootEmit('change');\n\n } catch (err) {\n\n this.isLoading = false;\n this.fail = true;\n console.error(err); // eslint-disable-line\n }\n },\n },\n mounted() {\n\n this.$nextTick(function () {\n\n if (this.context.value['@id']) {\n this.uploadURL = true\n this.URLValue = this.context.value['@id']\n return true\n }\n else false\n })\n },\n setup() {\n\n // let instance = getCurrentInstance().appContext.app.config.globalProperties.$env\n const env = useRuntimeEnv();\n\n var drop = reactive({\n active: false,\n })\n\n const fLoad = ref(null);\n\n onClickOutside(fLoad, event => drop.active = false)\n function triggerDropdown(e) {\n drop.active = !drop.active\n }\n\n return {\n drop,\n onClickOutside,\n triggerDropdown,\n };\n }\n};\n</script>\n\n<style lang=\"scss\" scoped>\n// @import '../../../styles/bootstrap_theme';\n// @import '../../../styles/utils/css-animations';\n.dURLText {}\n\n.file-div {\n display: flex;\n align-items: center;\n}\n\n.upload-feedback {\n padding: 10px;\n}\n\n/*** MATERIAL ICONS ***/\n%modal-icon {\n font-size: 20px;\n cursor: default;\n}\n\n.check-icon {\n @extend %modal-icon;\n color: #28a745;\n}\n\n.close-icon {\n @extend %modal-icon;\n color: red;\n}\n\n.lds-ring {\n display: inline-block;\n position: relative;\n width: 30px;\n height: 30px;\n}\n\n.lds-ring div {\n box-sizing: border-box;\n display: block;\n position: absolute;\n right: 0;\n width: 30px;\n height: 30px;\n border: 8px solid lightgray;\n border-radius: 50%;\n animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;\n border-color: lightgray transparent transparent transparent;\n}\n\n.lds-ring div:nth-child(1) {\n animation-delay: -0.45s;\n}\n\n.lds-ring div:nth-child(2) {\n animation-delay: -0.3s;\n}\n\n.lds-ring div:nth-child(3) {\n animation-delay: -0.15s;\n}\n\n.error {\n color: red;\n}\n\n.errorSub {\n color: black;\n}\n\n@keyframes lds-ring {\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.allowedFTypes {\n padding: 0.5rem;\n border-radius: 5px;\n border: 1px solid lightgrey;\n}\n\n.allowedTypesWrapper {\n max-width: 100%;\n display: flex;\n flex-wrap: wrap;\n}\n</style>\n"],"names":["_sfc_main","_a","mapGetters","getNode","mapActions","event","fileExtension","element","currentElement","rootElement","parentInputGroup","allInputGroupsNodeList","file","replaceEnabled","_c","_b","wantsToReplace","_d","distributionIndexToReplace","_e","fileIndexToReplace","targetDistribution","_f","targetFile","_g","accessUrl","fileUploadUrl","fileId","helper","options","form","catalog","token","resolvedOptions","requestOptions","result","axios","path","err","useRuntimeEnv","drop","reactive","fLoad","ref","onClickOutside","triggerDropdown","e","_hoisted_1","_createElementVNode","_hoisted_5","_hoisted_6","_hoisted_8","_hoisted_12","_withScopeId","_hoisted_15","_hoisted_18","_hoisted_21","_openBlock","_createElementBlock","_Fragment","$setup","_createTextVNode","_hoisted_2","_cache","$event","$data","$options","_createCommentVNode","_hoisted_3","_hoisted_4","args","_mergeProps","$props","_ctx","_vModelText","_hoisted_7","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_13","_hoisted_14","_hoisted_16","_hoisted_17","_toDisplayString","_hoisted_19","_hoisted_20","_renderList","types"],"mappings":";;;;;;;;;AA4DA,MAAKA,IAAU;AAAA,EACb,OAAO;AAAA,IACL,SAAS;AAAA,MACP,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA,EACF;AAAA,EAED,OAAO;;AACL,WAAO;AAAA,MACL,OAAO;AAAA,MACP,UAAU;AAAA,MACV,WAAW;AAAA,MACX,kBAAkB;AAAA,MAClB,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,SAAS;AAAA,MACT,MAAM;AAAA,MACN,mBAAiBC,IAAA,KAAK,KAAK,QAAQ,sBAAsB,oBAAxC,gBAAAA,EAAyD,MAAM,SAAQ,CAAC;AAAA;EAE5F;AAAA,EACD,UAAU;AAAA,IAER,GAAGC,EAAW,QAAQ;AAAA,MACpB;AAAA,MACA;AAAA,IACF,CAAC;AAAA,IACD,GAAGA,EAAW,YAAY;AAAA,MACxB;AAAA,IACF,CAAC;AAAA,IACD,eAAe;AACb,aAAOC,EAAQ,cAAc,EAAE;AAAA,IACjC;AAAA,EACD;AAAA,EACD,SAAS;AAAA,IACP,GAAGC,EAAW,YAAY;AAAA,MACxB;AAAA,IACF,CAAC;AAAA,IACD,kBAAkB;AAChB,MAAI,KAAK,cAAa,KAAK,YAAY,CAAC,KAAK;AAAA,IAC9C;AAAA,IACD,yBAAyB;AACvB,MAAI,KAAK,qBAAoB,KAAK,mBAAmB,CAAC,KAAK;AAAA,IAC5D;AAAA,IACD,aAAaC,GAAO;AAElB,YAAMC,IAAgB,MADTD,EAAM,OAAO,MAAM,CAAC,EACA,KAAK,MAAM,GAAG,EAAE,MAAM;AACvD,MAAI,KAAK,mBAAmB,KAAK,gBAAgB,SAC1C,KAAK,gBAAgB,SAASC,CAAa,IAG9C,KAAK,oBAAoB,EAAE,MAAMD,EAAM,OAAO,MAAM,CAAC,GAAG,I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