@piveau/dpi 0.1.0-beta.6 → 0.1.0-beta.60

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.
Files changed (60) hide show
  1. package/dist/assets/dpi.css +1 -1
  2. package/dist/data-provider-interface/DPIMenu.vue.js +2 -2
  3. package/dist/data-provider-interface/HappyFlowComponents/ComponentLibrary.vue.js +1 -1
  4. package/dist/data-provider-interface/HappyFlowComponents/HomeTable.vue.js +58 -53
  5. package/dist/data-provider-interface/HappyFlowComponents/services/dpiV3_apis.js +78 -66
  6. package/dist/data-provider-interface/HappyFlowComponents/ui/CloseOpenButtonV3.vue.js +11 -10
  7. package/dist/data-provider-interface/HappyFlowComponents/ui/Dropdown.vue.js +101 -76
  8. package/dist/data-provider-interface/HappyFlowComponents/ui/InputField.vue.js +1 -1
  9. package/dist/data-provider-interface/HappyFlowComponents/ui/ModalSimpleV3.vue.js +7 -7
  10. package/dist/data-provider-interface/HappyFlowComponents/ui/ModalV3.vue.js +434 -360
  11. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/AccessServiceV3.vue.js +103 -71
  12. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/AvailabilityV3.vue.js +17 -22
  13. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/ChangeLicenseV3.vue.js +130 -77
  14. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/ChecksumV3.vue.js +91 -61
  15. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/ConformsToV3.vue.js +111 -74
  16. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/DocumentationsV3.vue.js +170 -99
  17. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/LanguageV3.vue.js +109 -52
  18. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/PolicyV3.vue.js +65 -86
  19. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/StatusV3.vue.js +29 -28
  20. package/dist/data-provider-interface/HappyFlowComponents/ui/RapModal.vue.js +159 -103
  21. package/dist/data-provider-interface/HappyFlowComponents/ui/SectionItems/AdditionalsSubModal.vue.js +571 -207
  22. package/dist/data-provider-interface/HappyFlowComponents/ui/SectionItems/CoverageModal.vue.js +100 -53
  23. package/dist/data-provider-interface/HappyFlowComponents/ui/SectionItems/DistributionModal.vue.js +52 -57
  24. package/dist/data-provider-interface/HappyFlowComponents/ui/SectionItems/EssentialsModal.vue.js +301 -100
  25. package/dist/data-provider-interface/HappyFlowComponents/ui/SectionItems/FindabilityChips.vue.js +46 -27
  26. package/dist/data-provider-interface/HappyFlowComponents/ui/SectionItems/HVDSwitch.vue.js +71 -38
  27. package/dist/data-provider-interface/HappyFlowComponents/ui/TableRowV3.vue.js +182 -105
  28. package/dist/data-provider-interface/HappyFlowComponents/ui/TextAreaV3.vue.js +19 -14
  29. package/dist/data-provider-interface/HappyFlowComponents/ui/TextButtonSmall.vue.js +1 -1
  30. package/dist/data-provider-interface/HappyFlowComponents/ui/Toast.vue.js +30 -29
  31. package/dist/data-provider-interface/components/ContactPage.vue.js +148 -100
  32. package/dist/data-provider-interface/components/DiscoverabilityPage.vue.js +32 -32
  33. package/dist/data-provider-interface/components/DistLicense.vue.js +198 -99
  34. package/dist/data-provider-interface/components/DistributionSimplePage.vue.js +879 -843
  35. package/dist/data-provider-interface/components/Dropup.vue.js +6 -6
  36. package/dist/data-provider-interface/components/HVDPage.vue.js +107 -85
  37. package/dist/data-provider-interface/components/InfoSlot.vue.js +5 -5
  38. package/dist/data-provider-interface/components/PolGeoUriPage.vue.js +89 -46
  39. package/dist/data-provider-interface/components/PublisherPage.vue.js +111 -81
  40. package/dist/data-provider-interface/components/ReviewAndPublishPage.vue.js +328 -265
  41. package/dist/data-provider-interface/components/TempResPage.vue.js +267 -187
  42. package/dist/data-provider-interface/components/TempResPageInModal.vue.js +395 -0
  43. package/dist/data-provider-interface/components/TitelPage.vue.js +4 -4
  44. package/dist/data-provider-interface/components/UpdateDate.vue.js +33 -29
  45. package/dist/data-provider-interface/components/dpiV3Description.vue.js +7 -6
  46. package/dist/data-provider-interface/composables/useDpiContext.js +5 -7
  47. package/dist/data-provider-interface/composables/useDpiSimpleLoader.js +397 -244
  48. package/dist/data-provider-interface/config/dcatapde/vocab-prefixes.js +1 -1
  49. package/dist/data-provider-interface/config/dcatapdeHappyFlow/converter.js +472 -95
  50. package/dist/data-provider-interface/config/dcatapdeHappyFlow/input-definition.js +104 -152
  51. package/dist/data-provider-interface/config/dcatapdeHappyFlow/page-content-config.js +10 -3
  52. package/dist/data-provider-interface/store/modules/authStore.js +11 -11
  53. package/dist/data-provider-interface/views/DraftsPage.vue.js +3 -3
  54. package/dist/data-provider-interface/views/InputPage.vue.js +381 -755
  55. package/dist/styles/_dpi.scss +1614 -0
  56. package/dist/styles/_maps.scss +24 -0
  57. package/dist/styles/_variables.scss +973 -0
  58. package/package.json +28 -19
  59. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/AccessRightsV3.vue.js +0 -41
  60. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/LicenseAttributionByText.vue.js +0 -46
@@ -1,18 +1,23 @@
1
- import { ref as p, onMounted as A, createElementBlock as m, openBlock as r, normalizeClass as I, createCommentVNode as V, createBlock as F, Fragment as L, renderList as R, createElementVNode as z, createVNode as u, toDisplayString as M, unref as i, isRef as q } from "vue";
2
- import E from "../Dropdown.vue.js";
3
- import P from "../TextAreaV3.vue.js";
4
- import y from "../ButtonV3.vue.js";
5
- import H from "../ModalSimpleV3.vue.js";
6
- import C from "../InputField.vue.js";
1
+ import { ref as f, reactive as O, onMounted as Z, createElementBlock as V, openBlock as g, normalizeClass as L, createCommentVNode as k, createBlock as j, Fragment as G, renderList as J, createElementVNode as I, createVNode as h, unref as u, toDisplayString as x, isRef as K } from "vue";
2
+ import Q from "../Dropdown.vue.js";
3
+ import X from "../TextAreaV3.vue.js";
4
+ import R from "../ButtonV3.vue.js";
5
+ import Y from "../ModalSimpleV3.vue.js";
6
+ import $ from "../InputField.vue.js";
7
+ import { PhWarning as ee } from "@phosphor-icons/vue";
8
+ import { useFormValues as te } from "../../../composables/useDpiFormValues.js";
7
9
  /* empty css */
8
- import N from "../../../../_virtual/_plugin-vue_export-helper.js";
9
- const W = { class: "dpiV3_LinkAndMetadata" }, _ = {
10
+ import ae from "../../../../_virtual/_plugin-vue_export-helper.js";
11
+ const le = { class: "dpiV3_LinkAndMetadata" }, ie = {
10
12
  key: 0,
13
+ class: "dpiV3_errorMessage"
14
+ }, oe = { class: "copy-mini-regular" }, se = {
15
+ key: 1,
11
16
  class: "copy-mini-regular dpiV3_text_error"
12
- }, O = {
17
+ }, de = {
13
18
  key: 0,
14
19
  class: "dpiV3_tempAddMore"
15
- }, j = {
20
+ }, ne = {
16
21
  __name: "DocumentationsV3",
17
22
  props: {
18
23
  documentations: { type: Array, required: !0 },
@@ -22,90 +27,148 @@ const W = { class: "dpiV3_LinkAndMetadata" }, _ = {
22
27
  showDeleteButton: { type: Boolean, required: !1, default: !1 }
23
28
  },
24
29
  emits: ["update"],
25
- setup(l, { emit: T }) {
26
- let n = p({});
27
- const o = l, f = T, h = p([...o.fileTypes]), D = p(!1), v = p(null);
28
- let c = p(!1);
29
- A(() => {
30
- o.documentations.length === 0 && f("update", [
30
+ setup(r, { expose: A, emit: z }) {
31
+ const { formValues: E } = te();
32
+ let p = f({});
33
+ const i = r, y = z, d = f([...i.fileTypes]), P = f(!1), F = f(null), o = O({});
34
+ let U = f(!1);
35
+ Z(() => {
36
+ i.documentations.length === 0 && y("update", [
31
37
  {
32
38
  id: 1,
33
- "dcat:downloadURL": "",
39
+ "dcat:accessURL": "",
34
40
  "dct:format": "",
35
41
  "dct:title": "",
36
- "dct:description": ""
42
+ "dct:description": "",
43
+ "formatUri:": ""
37
44
  }
38
45
  ]);
39
46
  });
40
- const U = (e) => {
47
+ const D = (e) => {
48
+ if (!e || e.trim() === "") return !1;
49
+ const l = e.trim();
50
+ return /\.[a-zA-Z]{2,}$/.test(l);
51
+ }, C = (e) => {
52
+ const l = e["dct:title"] && e["dct:title"].trim() !== "", t = e["dct:description"] && e["dct:description"].trim() !== "", a = e["dct:format"] && e["dct:format"].trim !== "" && (typeof e["dct:format"] == "string" ? e["dct:format"].trim() !== "" : !0);
53
+ return l || t || a;
54
+ }, S = (e) => {
55
+ const l = i.documentations.find((t) => t.id === e);
56
+ if (l) {
57
+ const t = l["dcat:accessURL"], a = typeof t == "string" ? t.trim() : "";
58
+ C(l) ? a ? D(a) ? o[e] = null : o[e] = "Bitte geben Sie eine gültige URL ein (z.B. example.com)" : o[e] = "Bitte geben Sie eine gültige URL ein." : a && !D(a) ? o[e] = "Bitte geben Sie eine gültige URL ein (z.B. example.com)" : o[e] = null;
59
+ }
60
+ }, w = () => {
61
+ let e = !1;
62
+ return i.documentations.forEach((l) => {
63
+ const t = l["dcat:accessURL"], a = typeof t == "string" ? t.trim() : "";
64
+ C(l) ? a ? D(a) || (o[l.id] = "Bitte geben Sie eine gültige URL ein (z.B. example.com)", e = !0) : (o[l.id] = "URL ist erforderlich", e = !0) : a && !D(a) && (o[l.id] = "Bitte geben Sie eine gültige URL ein (z.B. example.com)", e = !0);
65
+ }), e;
66
+ }, M = (e) => {
41
67
  switch (e) {
42
68
  case "delete":
43
- B();
69
+ N();
44
70
  break;
45
71
  }
46
- }, S = () => {
47
- const d = {
48
- id: (o.documentations.length ? Math.max(...o.documentations.map((t) => t.id)) : 0) + 1,
49
- "dcat:downloadURL": "",
72
+ }, _ = (e, l, t = null) => {
73
+ var n, s;
74
+ d.value = [...i.fileTypes];
75
+ const a = typeof e == "string" ? e.trim().toUpperCase() : (s = (n = e == null ? void 0 : e.target) == null ? void 0 : n.value) == null ? void 0 : s.trim().toUpperCase();
76
+ a.length > 0 ? d.value = i.fileTypes.filter(
77
+ (T) => T["@value"].toUpperCase().startsWith(a)
78
+ ) : d.value = [...i.fileTypes];
79
+ }, W = () => {
80
+ if (w())
81
+ return;
82
+ const l = {
83
+ id: (i.documentations.length ? Math.max(...i.documentations.map((t) => t.id)) : 0) + 1,
84
+ "dcat:accessURL": "",
50
85
  "dct:format": "",
51
86
  "dct:title": "",
52
- "dct:description": ""
87
+ "dct:description": "",
88
+ "formatUri:": ""
53
89
  };
54
- f("update", [...o.documentations, d]);
55
- }, b = (e, d, t) => {
56
- var k, w;
57
- if (d === "dct:format") {
58
- h.value = [...o.fileTypes];
59
- const s = typeof e == "string" ? e.trim().toUpperCase() : (w = (k = e == null ? void 0 : e.target) == null ? void 0 : k.value) == null ? void 0 : w.trim().toUpperCase();
60
- s.length > 0 ? h.value = o.fileTypes.filter(
61
- (x) => x["@value"].toUpperCase().startsWith(s)
62
- ) : h.value = [...o.fileTypes];
63
- }
64
- const a = o.documentations.map(
65
- (s) => s.id === t ? { ...s, [d]: e.target.value } : s
90
+ y("update", [...i.documentations, l]);
91
+ }, q = (e, l) => {
92
+ d.value = [...i.fileTypes];
93
+ const t = d.value.find(
94
+ (s) => s["@value"] === e
95
+ ), a = f(
96
+ E.value.DistributionSimple["dcat:distribution"].find(
97
+ (s) => s.id === i.distributionId
98
+ )
99
+ ), n = f(
100
+ a.value.documentations.find((s) => s.id === l)
66
101
  );
67
- f("update", a);
68
- }, $ = (e) => {
69
- n.value = {
102
+ n.value === void 0 || (n.value.formatUri = t.uri), v(e, "dct:format", l);
103
+ }, v = (e, l, t) => {
104
+ var n, s, T;
105
+ let a = "";
106
+ if (l === "dcat:accessURL") {
107
+ const c = typeof e == "string" ? e : ((n = e == null ? void 0 : e.target) == null ? void 0 : n.value) ?? "";
108
+ a = i.documentations.map(
109
+ (b) => b.id === t ? { ...b, [l]: c } : b
110
+ );
111
+ } else if (l === "dct:format") {
112
+ d.value = [...i.fileTypes];
113
+ const c = typeof e == "string" ? e.trim().toUpperCase() : (T = (s = e == null ? void 0 : e.target) == null ? void 0 : s.value) == null ? void 0 : T.trim().toUpperCase();
114
+ c.length > 0 ? d.value = i.fileTypes.filter(
115
+ (m) => m["@value"].toUpperCase().startsWith(c)
116
+ ) : d.value = [...i.fileTypes];
117
+ const b = d.value.find(
118
+ (m) => m["@value"] === e
119
+ );
120
+ a = i.documentations.map(
121
+ (m) => m.id === t ? { ...m, [l]: b["@value"], formatUri: b.uri } : m
122
+ );
123
+ } else
124
+ a = i.documentations.map(
125
+ (c) => c.id === t ? { ...c, [l]: e.target.value } : c
126
+ );
127
+ y("update", a), setTimeout(() => {
128
+ S(t);
129
+ }, 0);
130
+ }, H = (e) => {
131
+ p.value = {
70
132
  button: "Löschen",
71
133
  header: "Dokumentation löschen",
72
134
  text: "Sind Sie sicher, dass Sie die Dokumentation löschen wollen?",
73
135
  action: "delete",
74
136
  optionalString_1: e["dct:title"],
75
- optionalString_2: e["dcat:downloadURL"]
76
- }, c.value = !0, v.value = e;
77
- }, B = () => {
78
- if (o.documentations.length === 1) {
79
- D.value = !0;
80
- return;
81
- }
82
- const e = o.documentations.filter(
83
- (d) => d.id !== v.value.id
137
+ optionalString_2: e["dcat:accessURL"]
138
+ }, U.value = !0, F.value = e;
139
+ }, N = () => {
140
+ const e = i.documentations.filter(
141
+ (l) => l.id !== F.value.id
84
142
  );
85
- f("update", e);
86
- }, g = (e, d) => {
143
+ delete o[F.value.id], y("update", e);
144
+ }, B = (e, l) => {
87
145
  switch (e) {
88
146
  case "dct:description":
89
- d["dct:description"] = "";
147
+ l["dct:description"] = "";
90
148
  break;
91
149
  case "dct:title":
92
- d["dct:title"] = "";
150
+ l["dct:title"] = "";
93
151
  break;
94
152
  case "dct:format":
95
- d["dct:format"] = "";
153
+ l["dct:format"] = "";
96
154
  break;
97
155
  }
156
+ setTimeout(() => {
157
+ S(l.id);
158
+ }, 0);
98
159
  };
99
- return (e, d) => (r(), m("div", {
100
- class: I(["dpiV3_documentationsWrap", { dpiV3_docAllAsCard: l.asCard }])
160
+ return A({
161
+ validateAllItems: w
162
+ }), (e, l) => (g(), V("div", {
163
+ class: L(["dpiV3_documentationsWrap", { dpiV3_docAllAsCard: r.asCard }])
101
164
  }, [
102
- (r(!0), m(L, null, R(l.documentations, (t) => (r(), m("div", {
165
+ (g(!0), V(G, null, J(r.documentations, (t) => (g(), V("div", {
103
166
  key: t.id,
104
- class: I(["dpiV3AutoCompleteWrap", { dpiV3_docAsCard: l.asCard }])
167
+ class: L(["dpiV3AutoCompleteWrap", { dpiV3_docAsCard: r.asCard }])
105
168
  }, [
106
- z("div", W, [
107
- u(C, {
108
- onInput: (a) => b(a, "dcat:downloadURL", t.id),
169
+ I("div", le, [
170
+ h($, {
171
+ onInput: (a) => v(a, "dcat:accessURL", t.id),
109
172
  addOnText: !1,
110
173
  datePicker: !1,
111
174
  infoIcon: !1,
@@ -119,11 +182,18 @@ const W = { class: "dpiV3_LinkAndMetadata" }, _ = {
119
182
  "message.dataupload.datasets.dcat:distribution.advanced.documentation.dcat:downloadURL-label"
120
183
  ),
121
184
  showEndIcon: !1,
122
- modelValue: t["dcat:downloadURL"],
123
- "onUpdate:modelValue": (a) => t["dcat:downloadURL"] = a
185
+ modelValue: t["dcat:accessURL"],
186
+ "onUpdate:modelValue": (a) => t["dcat:accessURL"] = a
124
187
  }, null, 8, ["onInput", "placeholder", "label", "modelValue", "onUpdate:modelValue"]),
125
- u(C, {
126
- onInput: (a) => b(a, "dct:title", t.id),
188
+ o[t.id] ? (g(), V("div", ie, [
189
+ h(u(ee), {
190
+ size: 16,
191
+ weight: "fill"
192
+ }),
193
+ I("span", oe, x(o[t.id]), 1)
194
+ ])) : k("", !0),
195
+ h($, {
196
+ onInput: (a) => v(a, "dct:title", t.id),
127
197
  addOnText: !1,
128
198
  datePicker: !1,
129
199
  infoIcon: !1,
@@ -139,11 +209,11 @@ const W = { class: "dpiV3_LinkAndMetadata" }, _ = {
139
209
  showEndIcon: !1,
140
210
  modelValue: t["dct:title"],
141
211
  "onUpdate:modelValue": (a) => t["dct:title"] = a,
142
- defaultInput: !l.showDeleteButton,
143
- onDeleteButtonClicked: (a) => g("dct:title", t)
212
+ defaultInput: !r.showDeleteButton,
213
+ onDeleteButtonClicked: (a) => B("dct:title", t)
144
214
  }, null, 8, ["onInput", "placeholder", "label", "modelValue", "onUpdate:modelValue", "defaultInput", "onDeleteButtonClicked"]),
145
- u(P, {
146
- onInput: (a) => b(a, "dct:description", t.id),
215
+ h(X, {
216
+ onInput: (a) => v(a, "dct:description", t.id),
147
217
  hint: !1,
148
218
  label: e.$t(
149
219
  "message.dataupload.datasets.dcat:distribution.advanced.documentation.description"
@@ -153,21 +223,22 @@ const W = { class: "dpiV3_LinkAndMetadata" }, _ = {
153
223
  ),
154
224
  modelValue: t["dct:description"],
155
225
  "onUpdate:modelValue": (a) => t["dct:description"] = a,
156
- showDeleteButton: l.showDeleteButton,
157
- onDeleteClicked: (a) => g("dct:description", t)
226
+ showDeleteButton: r.showDeleteButton,
227
+ onDeleteClicked: (a) => B("dct:description", t)
158
228
  }, null, 8, ["onInput", "label", "placeholder", "modelValue", "onUpdate:modelValue", "showDeleteButton", "onDeleteClicked"]),
159
- u(E, {
160
- onInput: (a) => b(a, "dct:format", t.id),
229
+ h(Q, {
230
+ "onUpdate:modelValue": [(a) => q(a, t.id), (a) => t["dct:format"] = a],
231
+ onInput: l[0] || (l[0] = (a) => _(a)),
161
232
  dropdownWidth: "large",
162
233
  type: "inputField",
163
234
  modelValue: t["dct:format"],
164
- "onUpdate:modelValue": (a) => t["dct:format"] = a,
165
235
  inputFieldProps: {
166
236
  addOnText: !1,
167
237
  initialHintText: !1,
168
238
  datePicker: !1,
169
239
  infoIcon: !1,
170
- preIcon: !1,
240
+ preIcon: !0,
241
+ showEndIcon: !1,
171
242
  label: e.$t("message.dataupload.datasets.dcat:distribution.format.label") + " (optional)",
172
243
  dropdown_dpiV3: !0,
173
244
  placeholder: e.$t(
@@ -175,18 +246,18 @@ const W = { class: "dpiV3_LinkAndMetadata" }, _ = {
175
246
  ),
176
247
  inputFieldSize: "large",
177
248
  autocomplete: "true",
178
- modelValue: t["dct:format"],
179
- defaultInput: !l.showDeleteButton
249
+ modelValue: t["dct:format"].uri,
250
+ defaultInput: !r.showDeleteButton
180
251
  },
181
- data: h.value,
252
+ data: d.value,
182
253
  autocomplete: !0,
183
- onDeleteDropdownField: (a) => g("dct:format", t)
184
- }, null, 8, ["onInput", "modelValue", "onUpdate:modelValue", "inputFieldProps", "data", "onDeleteDropdownField"]),
185
- D.value && l.documentations.length === 1 ? (r(), m("p", _, M(e.$t(
254
+ onDeleteDropdownField: (a) => B("dct:format", t)
255
+ }, null, 8, ["onUpdate:modelValue", "modelValue", "inputFieldProps", "data", "onDeleteDropdownField"]),
256
+ P.value && r.documentations.length === 1 ? (g(), V("p", se, x(e.$t(
186
257
  "message.dataupload.datasets.dcat:distribution.advanced.documentation.error-message"
187
- )), 1)) : V("", !0)
258
+ )), 1)) : k("", !0)
188
259
  ]),
189
- u(y, {
260
+ h(R, {
190
261
  class: "dpiV3_tempAddMore",
191
262
  buttonText: e.$t(
192
263
  "message.dataupload.datasets.dcat:distribution.advanced.documentation.delete"
@@ -194,34 +265,34 @@ const W = { class: "dpiV3_LinkAndMetadata" }, _ = {
194
265
  size: "small",
195
266
  iconStart: "trash",
196
267
  variant: "tertiary",
197
- onClick: (a) => $(t)
268
+ onClick: (a) => H(t)
198
269
  }, null, 8, ["buttonText", "onClick"])
199
270
  ], 2))), 128)),
200
- l.asCard ? V("", !0) : (r(), m("div", O, [
201
- u(y, {
271
+ r.asCard ? k("", !0) : (g(), V("div", de, [
272
+ h(R, {
202
273
  buttonText: e.$t(
203
274
  "message.dataupload.datasets.dcat:distribution.advanced.documentation.add-another"
204
275
  ),
205
276
  size: "small",
206
277
  iconStart: "plus",
207
278
  variant: "tertiary",
208
- onClick: S
279
+ onClick: W
209
280
  }, null, 8, ["buttonText"])
210
281
  ])),
211
- i(c) ? (r(), F(H, {
282
+ u(U) ? (g(), j(Y, {
212
283
  key: 1,
213
- buttons: i(n).button,
214
- headerText: i(n).header,
215
- text: i(n).text,
216
- onClose: d[0] || (d[0] = (t) => q(c) ? c.value = !1 : c = !1),
217
- action: i(n).action,
218
- onActionHandling: d[1] || (d[1] = (t) => U(t)),
219
- optionalString_1: i(n).optionalString_1,
220
- optionalString_2: i(n).optionalString_2
221
- }, null, 8, ["buttons", "headerText", "text", "action", "optionalString_1", "optionalString_2"])) : V("", !0)
284
+ buttons: u(p).button,
285
+ headerText: u(p).header,
286
+ text: u(p).text,
287
+ onClose: l[1] || (l[1] = (t) => K(U) ? U.value = !1 : U = !1),
288
+ action: u(p).action,
289
+ onActionHandling: l[2] || (l[2] = (t) => M(t)),
290
+ optionalString_1: u(p).optionalString_1,
291
+ optionalString_2: u(p).optionalString_2
292
+ }, null, 8, ["buttons", "headerText", "text", "action", "optionalString_1", "optionalString_2"])) : k("", !0)
222
293
  ], 2));
223
294
  }
224
- }, te = /* @__PURE__ */ N(j, [["__scopeId", "data-v-d3575856"]]);
295
+ }, Ue = /* @__PURE__ */ ae(ne, [["__scopeId", "data-v-cf202935"]]);
225
296
  export {
226
- te as default
297
+ Ue as default
227
298
  };
@@ -1,70 +1,127 @@
1
- import { onMounted as b, getCurrentInstance as v, ref as p, watch as x, createBlock as I, openBlock as w, unref as g } from "vue";
2
- import { getLanguages as B } from "../../services/dpiV3_apis.js";
3
- import F from "../Dropdown.vue.js";
4
- import { useI18n as V } from "vue-i18n";
5
- const h = {
1
+ import { ref as d, getCurrentInstance as _, onMounted as P, computed as S, watch as z, createElementBlock as g, openBlock as c, Fragment as h, createCommentVNode as w, renderList as W, unref as r, normalizeClass as $, createVNode as V, createBlock as A } from "vue";
2
+ import { getLanguages as N } from "../../services/dpiV3_apis.js";
3
+ import U from "../Dropdown.vue.js";
4
+ import q from "../ButtonV3.vue.js";
5
+ import M from "../TextButtonSmall.vue.js";
6
+ import { useI18n as E } from "vue-i18n";
7
+ import { useFormValues as H } from "../../../composables/useDpiFormValues.js";
8
+ /* empty css */
9
+ const Q = {
10
+ key: 0,
11
+ class: "dpiV3_tempAddMore"
12
+ }, ee = {
6
13
  __name: "LanguageV3",
7
14
  props: {
8
15
  distributionId: { type: Number, required: !1 },
9
16
  showDeleteButton: { type: Boolean, default: !1 },
10
- languageText: { type: String, default: "" }
17
+ languageText: { type: String, default: "" },
18
+ inOverview: { type: Boolean, default: !1 }
11
19
  },
12
20
  emits: ["addLanguage", "deleteButtonClicked"],
13
- setup(i, { emit: c }) {
14
- const { t: r } = V();
15
- b(async () => {
16
- const e = v(), a = e.appContext.app.config.globalProperties.$env, t = e.appContext.app.config.globalProperties.$i18n.locale;
21
+ setup(v, { emit: C }) {
22
+ const n = v;
23
+ let l = d([{ label: "", "@value": "", uri: "" }]), u = {};
24
+ const { formValues: k } = H(), { t: f } = E(), y = () => {
25
+ l.value.push({});
26
+ }, b = _(), B = b.appContext.app.config.globalProperties.$env, I = b.appContext.app.config.globalProperties.$i18n.locale;
27
+ let p = d([]);
28
+ u = k.value.DistributionSimple["dcat:distribution"].find(
29
+ (e) => e.id === n.distributionId
30
+ ) || {}, P(async () => {
31
+ var e;
32
+ u["dct:language"].length > 0 && (l.value = u["dct:language"]), p.value = (e = u["dct:language"]) == null ? void 0 : e.map((a) => a.label);
17
33
  try {
18
- const d = await B(a.api.baseUrl, t);
19
- o.value = d.map((u) => ({
20
- "@value": u.label,
21
- label: u.label,
22
- uri: u.uri
34
+ const a = await N(B.api.baseUrl, I);
35
+ s.value = a.map((t) => ({
36
+ "@value": t.label,
37
+ label: t.label,
38
+ uri: t.uri
23
39
  }));
24
- } catch (d) {
25
- console.error("Failed to load language data", d);
40
+ } catch (a) {
41
+ console.error("Failed to load language data", a);
26
42
  }
27
43
  });
28
- const l = i, o = p([]), n = p(l.languageText), s = c, f = (e) => {
29
- console.log(o.value);
30
- let a = o.value.find((t) => t["@value"] === e).uri || "";
31
- s("addLanguage", e, l.distributionId, a);
32
- };
33
- x(
34
- () => l.languageText,
44
+ const s = d([]);
45
+ let L = d(p);
46
+ console.log("Titelliste", L);
47
+ const O = C, F = (e, a) => {
48
+ l.value.length > 1 ? (l.value[a] = {
49
+ label: e,
50
+ uri: s.value.find((t) => t["@value"] === e).uri || ""
51
+ }, u["dct:language"] = l.value) : (l.value[0] = {
52
+ "@value": e,
53
+ uri: s.value.find((t) => t["@value"] === e).uri || ""
54
+ }, u["dct:language"][0] = l.value[0], s.value.find((t) => t["@value"] === e).uri);
55
+ }, m = d(""), x = (e) => {
56
+ m.value = e, console.log(m);
57
+ }, T = S(() => s.value.filter(
58
+ (e) => {
59
+ var a, t, o, i;
60
+ return (i = (a = e["@value"]) == null ? void 0 : a.toLowerCase()) == null ? void 0 : i.trim().startsWith((o = (t = m.value) == null ? void 0 : t.toLowerCase()) == null ? void 0 : o.trim());
61
+ }
62
+ ));
63
+ z(
64
+ () => n.languageText,
35
65
  (e) => {
36
- n.value = e;
66
+ p.value = e;
37
67
  }
38
68
  );
39
- const m = () => {
40
- console.log("delete clicked"), s("deleteButtonClicked", l.distributionId);
69
+ const D = () => {
70
+ console.log("delete clicked"), O("deleteButtonClicked", n.distributionId);
41
71
  };
42
- return (e, a) => (w(), I(F, {
43
- "onUpdate:modelValue": [
44
- a[0] || (a[0] = (t) => f(t)),
45
- a[1] || (a[1] = (t) => n.value = t)
46
- ],
47
- dropdownWidth: "large",
48
- type: "inputField",
49
- modelValue: n.value,
50
- inputFieldProps: {
51
- addOnText: !1,
52
- initialHintText: !1,
53
- datePicker: !1,
54
- infoIcon: !1,
55
- preIcon: !1,
56
- label: g(r)("message.dataupload.datasets.dcat:distribution.advanced.dct:language") + " (optional)",
57
- dropdown_dpiV3: !0,
58
- placeholder: g(r)("message.dataupload.datasets.dcat:distribution.advanced.language-placeholder"),
59
- inputFieldSize: "large",
60
- modelValue: n.value,
61
- defaultInput: !i.showDeleteButton
62
- },
63
- data: o.value,
64
- onDeleteDropdownField: m
65
- }, null, 8, ["modelValue", "inputFieldProps", "data"]));
72
+ return (e, a) => (c(), g(h, null, [
73
+ (c(!0), g(h, null, W(r(l), (t, o) => (c(), g("div", {
74
+ class: $([{
75
+ repeatableOuter: !n.inOverview,
76
+ dpiV3AutoCompleteWrap: !n.inOverview
77
+ }, "langDropdown"])
78
+ }, [
79
+ V(U, {
80
+ "onUpdate:modelValue": [(i) => F(i, o), (i) => r(l)[o].label = i],
81
+ dropdownWidth: "large",
82
+ type: "inputField",
83
+ modelValue: r(l)[o].label,
84
+ inputFieldProps: {
85
+ addOnText: !1,
86
+ initialHintText: !1,
87
+ datePicker: !1,
88
+ infoIcon: !1,
89
+ preIcon: !1,
90
+ label: r(f)(
91
+ "message.dataupload.datasets.dcat:distribution.advanced.dct:language"
92
+ ) + " (optional)",
93
+ dropdown_dpiV3: !0,
94
+ placeholder: r(f)(
95
+ "message.dataupload.datasets.dcat:distribution.advanced.language-placeholder"
96
+ ),
97
+ inputFieldSize: "large",
98
+ modelValue: r(p)[o],
99
+ defaultInput: !v.showDeleteButton
100
+ },
101
+ data: T.value,
102
+ onDeleteDropdownField: D,
103
+ onInput: x
104
+ }, null, 8, ["onUpdate:modelValue", "modelValue", "inputFieldProps", "data"]),
105
+ n.inOverview ? w("", !0) : (c(), A(M, {
106
+ key: 0,
107
+ "button-text": "löschen",
108
+ class: "rightAlign",
109
+ onClick: (i) => r(l).splice(o, 1)
110
+ }, null, 8, ["onClick"]))
111
+ ], 2))), 256)),
112
+ n.inOverview ? w("", !0) : (c(), g("div", Q, [
113
+ V(q, {
114
+ buttonText: "Weitere hinzufügen",
115
+ size: "large",
116
+ iconStart: "plus",
117
+ variant: "tertiary",
118
+ class: "mt-3",
119
+ onClick: a[0] || (a[0] = (t) => y())
120
+ })
121
+ ]))
122
+ ], 64));
66
123
  }
67
124
  };
68
125
  export {
69
- h as default
126
+ ee as default
70
127
  };