@piveau/dpi 0.1.0-beta.39 → 0.1.0-beta.41

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 (24) hide show
  1. package/dist/assets/dpi.css +1 -1
  2. package/dist/data-provider-interface/HappyFlowComponents/ui/ModalV3.vue.js +393 -314
  3. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/AccessServiceV3.vue.js +105 -69
  4. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/ChangeLicenseV3.vue.js +95 -57
  5. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/ChecksumV3.vue.js +83 -55
  6. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/ConformsToV3.vue.js +116 -75
  7. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/DocumentationsV3.vue.js +145 -124
  8. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/PolicyV3.vue.js +41 -41
  9. package/dist/data-provider-interface/HappyFlowComponents/ui/RapModal.vue.js +123 -108
  10. package/dist/data-provider-interface/HappyFlowComponents/ui/SectionItems/AdditionalsSubModal.vue.js +440 -258
  11. package/dist/data-provider-interface/HappyFlowComponents/ui/SectionItems/CoverageModal.vue.js +37 -32
  12. package/dist/data-provider-interface/HappyFlowComponents/ui/SectionItems/DistributionModal.vue.js +6 -6
  13. package/dist/data-provider-interface/HappyFlowComponents/ui/SectionItems/EssentialsModal.vue.js +183 -126
  14. package/dist/data-provider-interface/components/ContactPage.vue.js +95 -89
  15. package/dist/data-provider-interface/components/DistLicense.vue.js +1 -1
  16. package/dist/data-provider-interface/components/DistributionSimplePage.vue.js +401 -396
  17. package/dist/data-provider-interface/components/HVDPage.vue.js +56 -55
  18. package/dist/data-provider-interface/components/PublisherPage.vue.js +94 -89
  19. package/dist/data-provider-interface/components/TempResPage.vue.js +122 -104
  20. package/dist/data-provider-interface/components/TempResPageInModal.vue.js +249 -108
  21. package/dist/data-provider-interface/composables/useDpiSimpleLoader.js +128 -118
  22. package/dist/data-provider-interface/config/dcatapdeHappyFlow/converter.js +40 -28
  23. package/dist/data-provider-interface/views/InputPage.vue.js +375 -746
  24. package/package.json +2 -2
@@ -1,22 +1,23 @@
1
- import { ref as p, onMounted as P, createElementBlock as h, openBlock as m, normalizeClass as E, createCommentVNode as D, createBlock as W, Fragment as H, renderList as N, createElementVNode as I, createVNode as g, toDisplayString as T, unref as f, isRef as O } from "vue";
2
- import Z from "../Dropdown.vue.js";
3
- import j from "../TextAreaV3.vue.js";
4
- import L from "../ButtonV3.vue.js";
5
- import G from "../ModalSimpleV3.vue.js";
6
- import R from "../InputField.vue.js";
7
- import { useFormValues as J } from "../../../composables/useDpiFormValues.js";
1
+ import { ref as f, reactive as O, onMounted as Z, createElementBlock as V, openBlock as h, normalizeClass as I, createCommentVNode as k, createBlock as j, Fragment as G, renderList as J, createElementVNode as x, createVNode as g, unref as c, toDisplayString as R, isRef as K } from "vue";
2
+ import Q from "../Dropdown.vue.js";
3
+ import X from "../TextAreaV3.vue.js";
4
+ import $ from "../ButtonV3.vue.js";
5
+ import Y from "../ModalSimpleV3.vue.js";
6
+ import A from "../InputField.vue.js";
7
+ import { PhWarning as ee } from "@phosphor-icons/vue";
8
+ import { useFormValues as te } from "../../../composables/useDpiFormValues.js";
8
9
  /* empty css */
9
- import K from "../../../../_virtual/_plugin-vue_export-helper.js";
10
- const Q = { class: "dpiV3_LinkAndMetadata" }, X = {
10
+ import ae from "../../../../_virtual/_plugin-vue_export-helper.js";
11
+ const le = { class: "dpiV3_LinkAndMetadata" }, ie = {
11
12
  key: 0,
12
- class: "validation-error"
13
- }, Y = { class: "copy-mini-regular" }, ee = {
13
+ class: "dpiV3_errorMessage"
14
+ }, oe = { class: "copy-mini-regular" }, se = {
14
15
  key: 1,
15
16
  class: "copy-mini-regular dpiV3_text_error"
16
- }, te = {
17
+ }, de = {
17
18
  key: 0,
18
19
  class: "dpiV3_tempAddMore"
19
- }, ae = {
20
+ }, ne = {
20
21
  __name: "DocumentationsV3",
21
22
  props: {
22
23
  documentations: { type: Array, required: !0 },
@@ -26,113 +27,125 @@ const Q = { class: "dpiV3_LinkAndMetadata" }, X = {
26
27
  showDeleteButton: { type: Boolean, required: !1, default: !1 }
27
28
  },
28
29
  emits: ["update"],
29
- setup(r, { emit: S }) {
30
- const { formValues: $ } = J();
31
- let c = p({});
32
- const o = r, V = S, s = p([...o.fileTypes]), k = p(!1), C = p(null);
33
- let b = p(!1);
34
- function B(e) {
35
- return /^(https?:\/\/)?(www\.)?[-\w@:%.+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-\w()@:%+.~#?&/=]*)$/.test(e);
36
- }
37
- function x(e, l) {
38
- const t = l == null ? void 0 : l.trim();
39
- return t ? B(t) ? (e.showErrorURL = !1, e.urlErrorMessage = "", !0) : (e.showErrorURL = !0, e.urlErrorMessage = "Bitte geben Sie eine gültige URL ein", !1) : (e.showErrorURL = !1, e.urlErrorMessage = "", !0);
40
- }
41
- P(() => {
42
- o.documentations.length === 0 && V("update", [
30
+ setup(r, { expose: z, emit: E }) {
31
+ const { formValues: P } = te();
32
+ let p = f({});
33
+ const i = r, y = E, d = f([...i.fileTypes]), B = f(!1), F = f(null), o = O({});
34
+ let U = f(!1);
35
+ Z(() => {
36
+ i.documentations.length === 0 && y("update", [
43
37
  {
44
38
  id: 1,
45
39
  "dcat:accessURL": "",
46
40
  "dct:format": "",
47
41
  "dct:title": "",
48
42
  "dct:description": "",
49
- "formatUri:": "",
50
- showErrorURL: !1,
51
- urlErrorMessage: ""
43
+ "formatUri:": ""
52
44
  }
53
45
  ]);
54
46
  });
55
- const A = (e) => {
47
+ const v = (e) => {
48
+ if (!e || e.trim() === "") return !1;
49
+ const l = e.trim();
50
+ return /\.[a-zA-Z]{2,}$/.test(l);
51
+ }, w = (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
+ }, L = (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
+ w(l) ? a ? v(a) ? o[e] = null : o[e] = "Bitte geben Sie eine gültige URL ein (z.B. example.com)" : o[e] = "URL ist erforderlich" : a && !v(a) ? o[e] = "Bitte geben Sie eine gültige URL ein (z.B. example.com)" : o[e] = null;
59
+ }
60
+ }, S = () => {
61
+ let e = !1;
62
+ return i.documentations.forEach((l) => {
63
+ const t = l["dcat:accessURL"], a = typeof t == "string" ? t.trim() : "";
64
+ w(l) ? a ? v(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 && !v(a) && (o[l.id] = "Bitte geben Sie eine gültige URL ein (z.B. example.com)", e = !0);
65
+ }), e;
66
+ }, M = (e) => {
56
67
  switch (e) {
57
68
  case "delete":
58
- q();
69
+ N();
59
70
  break;
60
71
  }
61
- }, F = (e, l, t = null) => {
62
- var u, i;
63
- s.value = [...o.fileTypes];
64
- const a = typeof e == "string" ? e.trim().toUpperCase() : (i = (u = e == null ? void 0 : e.target) == null ? void 0 : u.value) == null ? void 0 : i.trim().toUpperCase();
65
- a.length > 0 ? s.value = o.fileTypes.filter(
66
- (v) => v["@value"].toUpperCase().startsWith(a)
67
- ) : s.value = [...fileTypes.value];
68
- }, M = () => {
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 (S())
81
+ return;
69
82
  const l = {
70
- id: (o.documentations.length ? Math.max(...o.documentations.map((t) => t.id)) : 0) + 1,
83
+ id: (i.documentations.length ? Math.max(...i.documentations.map((t) => t.id)) : 0) + 1,
71
84
  "dcat:accessURL": "",
72
85
  "dct:format": "",
73
86
  "dct:title": "",
74
87
  "dct:description": "",
75
- "formatUri:": "",
76
- showErrorURL: !1,
77
- urlErrorMessage: ""
88
+ "formatUri:": ""
78
89
  };
79
- V("update", [...o.documentations, l]);
80
- }, z = (e, l) => {
81
- s.value = [...o.fileTypes];
82
- const t = s.value.find(
83
- (i) => i["@value"] === e
84
- ), a = p(
85
- $.value.DistributionSimple["dcat:distribution"].find(
86
- (i) => i.id === o.distributionId
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
+ P.value.DistributionSimple["dcat:distribution"].find(
97
+ (s) => s.id === i.distributionId
87
98
  )
88
- ), u = p(
89
- a.value.documentations.find((i) => i.id === l)
99
+ ), n = f(
100
+ a.value.documentations.find((s) => s.id === l)
90
101
  );
91
- u.value === void 0 || (u.value.formatUri = t.uri), U(e, "dct:format", l);
92
- }, U = (e, l, t) => {
93
- var u, i, v;
102
+ n.value === void 0 || (n.value.formatUri = t.uri), D(e, "dct:format", l);
103
+ }, D = (e, l, t) => {
104
+ var n, s, T;
94
105
  let a = "";
95
106
  if (l === "dcat:accessURL") {
96
- const n = ((u = e == null ? void 0 : e.target) == null ? void 0 : u.value) || e, w = o.documentations.find((d) => d.id === t);
97
- x(w, n), a = o.documentations.map(
98
- (d) => d.id === t ? { ...d, [l]: n } : d
107
+ const u = 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]: u } : b
99
110
  );
100
111
  } else if (l === "dct:format") {
101
- s.value = [...o.fileTypes];
102
- const n = typeof e == "string" ? e.trim().toUpperCase() : (v = (i = e == null ? void 0 : e.target) == null ? void 0 : i.value) == null ? void 0 : v.trim().toUpperCase();
103
- n.length > 0 ? s.value = o.fileTypes.filter(
104
- (d) => d["@value"].toUpperCase().startsWith(n)
105
- ) : s.value = [...o.fileTypes];
106
- const w = s.value.find(
107
- (d) => d["@value"] === e
112
+ d.value = [...i.fileTypes];
113
+ const u = 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
+ u.length > 0 ? d.value = i.fileTypes.filter(
115
+ (m) => m["@value"].toUpperCase().startsWith(u)
116
+ ) : d.value = [...i.fileTypes];
117
+ const b = d.value.find(
118
+ (m) => m["@value"] === e
108
119
  );
109
- a = o.documentations.map(
110
- (d) => d.id === t ? { ...d, [l]: w["@value"], formatUri: w.uri } : d
120
+ a = i.documentations.map(
121
+ (m) => m.id === t ? { ...m, [l]: b["@value"], formatUri: b.uri } : m
111
122
  );
112
123
  } else
113
- a = o.documentations.map(
114
- (n) => n.id === t ? { ...n, [l]: e.target.value } : n
124
+ a = i.documentations.map(
125
+ (u) => u.id === t ? { ...u, [l]: e.target.value } : u
115
126
  );
116
- V("update", a);
117
- }, _ = (e) => {
118
- c.value = {
127
+ y("update", a), setTimeout(() => {
128
+ L(t);
129
+ }, 0);
130
+ }, H = (e) => {
131
+ p.value = {
119
132
  button: "Löschen",
120
133
  header: "Dokumentation löschen",
121
134
  text: "Sind Sie sicher, dass Sie die Dokumentation löschen wollen?",
122
135
  action: "delete",
123
136
  optionalString_1: e["dct:title"],
124
137
  optionalString_2: e["dcat:accessURL"]
125
- }, b.value = !0, C.value = e;
126
- }, q = () => {
127
- if (o.documentations.length === 1) {
128
- k.value = !0;
138
+ }, U.value = !0, F.value = e;
139
+ }, N = () => {
140
+ if (i.documentations.length === 1) {
141
+ B.value = !0;
129
142
  return;
130
143
  }
131
- const e = o.documentations.filter(
132
- (l) => l.id !== C.value.id
144
+ const e = i.documentations.filter(
145
+ (l) => l.id !== F.value.id
133
146
  );
134
- V("update", e);
135
- }, y = (e, l) => {
147
+ delete o[F.value.id], y("update", e);
148
+ }, C = (e, l) => {
136
149
  switch (e) {
137
150
  case "dct:description":
138
151
  l["dct:description"] = "";
@@ -144,17 +157,22 @@ const Q = { class: "dpiV3_LinkAndMetadata" }, X = {
144
157
  l["dct:format"] = "";
145
158
  break;
146
159
  }
160
+ setTimeout(() => {
161
+ L(l.id);
162
+ }, 0);
147
163
  };
148
- return (e, l) => (m(), h("div", {
149
- class: E(["dpiV3_documentationsWrap", { dpiV3_docAllAsCard: r.asCard }])
164
+ return z({
165
+ validateAllItems: S
166
+ }), (e, l) => (h(), V("div", {
167
+ class: I(["dpiV3_documentationsWrap", { dpiV3_docAllAsCard: r.asCard }])
150
168
  }, [
151
- (m(!0), h(H, null, N(r.documentations, (t) => (m(), h("div", {
169
+ (h(!0), V(G, null, J(r.documentations, (t) => (h(), V("div", {
152
170
  key: t.id,
153
- class: E(["dpiV3AutoCompleteWrap", { dpiV3_docAsCard: r.asCard }])
171
+ class: I(["dpiV3AutoCompleteWrap", { dpiV3_docAsCard: r.asCard }])
154
172
  }, [
155
- I("div", Q, [
156
- g(R, {
157
- onInput: (a) => U(a, "dcat:accessURL", t.id),
173
+ x("div", le, [
174
+ g(A, {
175
+ onInput: (a) => D(a, "dcat:accessURL", t.id),
158
176
  addOnText: !1,
159
177
  datePicker: !1,
160
178
  infoIcon: !1,
@@ -168,15 +186,18 @@ const Q = { class: "dpiV3_LinkAndMetadata" }, X = {
168
186
  "message.dataupload.datasets.dcat:distribution.advanced.documentation.dcat:downloadURL-label"
169
187
  ),
170
188
  showEndIcon: !1,
171
- showError: t.showErrorURL,
172
189
  modelValue: t["dcat:accessURL"],
173
190
  "onUpdate:modelValue": (a) => t["dcat:accessURL"] = a
174
- }, null, 8, ["onInput", "placeholder", "label", "showError", "modelValue", "onUpdate:modelValue"]),
175
- t.showErrorURL && t.urlErrorMessage ? (m(), h("div", X, [
176
- I("span", Y, T(t.urlErrorMessage), 1)
177
- ])) : D("", !0),
178
- g(R, {
179
- onInput: (a) => U(a, "dct:title", t.id),
191
+ }, null, 8, ["onInput", "placeholder", "label", "modelValue", "onUpdate:modelValue"]),
192
+ o[t.id] ? (h(), V("div", ie, [
193
+ g(c(ee), {
194
+ size: 16,
195
+ weight: "fill"
196
+ }),
197
+ x("span", oe, R(o[t.id]), 1)
198
+ ])) : k("", !0),
199
+ g(A, {
200
+ onInput: (a) => D(a, "dct:title", t.id),
180
201
  addOnText: !1,
181
202
  datePicker: !1,
182
203
  infoIcon: !1,
@@ -193,10 +214,10 @@ const Q = { class: "dpiV3_LinkAndMetadata" }, X = {
193
214
  modelValue: t["dct:title"],
194
215
  "onUpdate:modelValue": (a) => t["dct:title"] = a,
195
216
  defaultInput: !r.showDeleteButton,
196
- onDeleteButtonClicked: (a) => y("dct:title", t)
217
+ onDeleteButtonClicked: (a) => C("dct:title", t)
197
218
  }, null, 8, ["onInput", "placeholder", "label", "modelValue", "onUpdate:modelValue", "defaultInput", "onDeleteButtonClicked"]),
198
- g(j, {
199
- onInput: (a) => U(a, "dct:description", t.id),
219
+ g(X, {
220
+ onInput: (a) => D(a, "dct:description", t.id),
200
221
  hint: !1,
201
222
  label: e.$t(
202
223
  "message.dataupload.datasets.dcat:distribution.advanced.documentation.description"
@@ -207,11 +228,11 @@ const Q = { class: "dpiV3_LinkAndMetadata" }, X = {
207
228
  modelValue: t["dct:description"],
208
229
  "onUpdate:modelValue": (a) => t["dct:description"] = a,
209
230
  showDeleteButton: r.showDeleteButton,
210
- onDeleteClicked: (a) => y("dct:description", t)
231
+ onDeleteClicked: (a) => C("dct:description", t)
211
232
  }, null, 8, ["onInput", "label", "placeholder", "modelValue", "onUpdate:modelValue", "showDeleteButton", "onDeleteClicked"]),
212
- g(Z, {
213
- "onUpdate:modelValue": [(a) => z(a, t.id), (a) => t["dct:format"] = a],
214
- onInput: l[0] || (l[0] = (a) => F(a)),
233
+ g(Q, {
234
+ "onUpdate:modelValue": [(a) => q(a, t.id), (a) => t["dct:format"] = a],
235
+ onInput: l[0] || (l[0] = (a) => _(a)),
215
236
  dropdownWidth: "large",
216
237
  type: "inputField",
217
238
  modelValue: t["dct:format"],
@@ -232,15 +253,15 @@ const Q = { class: "dpiV3_LinkAndMetadata" }, X = {
232
253
  modelValue: t["dct:format"].uri,
233
254
  defaultInput: !r.showDeleteButton
234
255
  },
235
- data: s.value,
256
+ data: d.value,
236
257
  autocomplete: !0,
237
- onDeleteDropdownField: (a) => y("dct:format", t)
258
+ onDeleteDropdownField: (a) => C("dct:format", t)
238
259
  }, null, 8, ["onUpdate:modelValue", "modelValue", "inputFieldProps", "data", "onDeleteDropdownField"]),
239
- k.value && r.documentations.length === 1 ? (m(), h("p", ee, T(e.$t(
260
+ B.value && r.documentations.length === 1 ? (h(), V("p", se, R(e.$t(
240
261
  "message.dataupload.datasets.dcat:distribution.advanced.documentation.error-message"
241
- )), 1)) : D("", !0)
262
+ )), 1)) : k("", !0)
242
263
  ]),
243
- g(L, {
264
+ g($, {
244
265
  class: "dpiV3_tempAddMore",
245
266
  buttonText: e.$t(
246
267
  "message.dataupload.datasets.dcat:distribution.advanced.documentation.delete"
@@ -248,34 +269,34 @@ const Q = { class: "dpiV3_LinkAndMetadata" }, X = {
248
269
  size: "small",
249
270
  iconStart: "trash",
250
271
  variant: "tertiary",
251
- onClick: (a) => _(t)
272
+ onClick: (a) => H(t)
252
273
  }, null, 8, ["buttonText", "onClick"])
253
274
  ], 2))), 128)),
254
- r.asCard ? D("", !0) : (m(), h("div", te, [
255
- g(L, {
275
+ r.asCard ? k("", !0) : (h(), V("div", de, [
276
+ g($, {
256
277
  buttonText: e.$t(
257
278
  "message.dataupload.datasets.dcat:distribution.advanced.documentation.add-another"
258
279
  ),
259
280
  size: "small",
260
281
  iconStart: "plus",
261
282
  variant: "tertiary",
262
- onClick: M
283
+ onClick: W
263
284
  }, null, 8, ["buttonText"])
264
285
  ])),
265
- f(b) ? (m(), W(G, {
286
+ c(U) ? (h(), j(Y, {
266
287
  key: 1,
267
- buttons: f(c).button,
268
- headerText: f(c).header,
269
- text: f(c).text,
270
- onClose: l[1] || (l[1] = (t) => O(b) ? b.value = !1 : b = !1),
271
- action: f(c).action,
272
- onActionHandling: l[2] || (l[2] = (t) => A(t)),
273
- optionalString_1: f(c).optionalString_1,
274
- optionalString_2: f(c).optionalString_2
275
- }, null, 8, ["buttons", "headerText", "text", "action", "optionalString_1", "optionalString_2"])) : D("", !0)
288
+ buttons: c(p).button,
289
+ headerText: c(p).header,
290
+ text: c(p).text,
291
+ onClose: l[1] || (l[1] = (t) => K(U) ? U.value = !1 : U = !1),
292
+ action: c(p).action,
293
+ onActionHandling: l[2] || (l[2] = (t) => M(t)),
294
+ optionalString_1: c(p).optionalString_1,
295
+ optionalString_2: c(p).optionalString_2
296
+ }, null, 8, ["buttons", "headerText", "text", "action", "optionalString_1", "optionalString_2"])) : k("", !0)
276
297
  ], 2));
277
298
  }
278
- }, pe = /* @__PURE__ */ K(ae, [["__scopeId", "data-v-541b2d96"]]);
299
+ }, Ue = /* @__PURE__ */ ae(ne, [["__scopeId", "data-v-24c22e25"]]);
279
300
  export {
280
- pe as default
301
+ Ue as default
281
302
  };
@@ -1,12 +1,13 @@
1
- import { ref as c, onMounted as C, createElementBlock as u, openBlock as r, normalizeClass as y, createBlock as b, createCommentVNode as I, Fragment as h, renderList as k, createElementVNode as L, createVNode as U, unref as n, isRef as A } from "vue";
2
- import R from "../ModalSimpleV3.vue.js";
3
- import P from "../InputField.vue.js";
1
+ import { ref as d, onMounted as C, createElementBlock as u, openBlock as r, normalizeClass as f, createBlock as L, createCommentVNode as y, Fragment as U, renderList as h, createElementVNode as R, createVNode as k, unref as n, isRef as w } from "vue";
2
+ import A from "../ModalSimpleV3.vue.js";
3
+ import B from "../InputField.vue.js";
4
+ import { useFormValues as P } from "../../../composables/useDpiFormValues.js";
4
5
  /* empty css */
5
- import w from "../../../../_virtual/_plugin-vue_export-helper.js";
6
- const B = { class: "dpiV3_LinkAndMetadata" }, M = {
6
+ import M from "../../../../_virtual/_plugin-vue_export-helper.js";
7
+ const S = { class: "dpiV3_LinkAndMetadata" }, T = {
7
8
  key: 0,
8
9
  class: "copy-mini-regular dpiV3_text_error"
9
- }, T = {
10
+ }, D = {
10
11
  __name: "PolicyV3",
11
12
  props: {
12
13
  policyItems: { type: Array, required: !0 },
@@ -14,52 +15,51 @@ const B = { class: "dpiV3_LinkAndMetadata" }, M = {
14
15
  asCard: { type: Boolean, required: !1, default: !1 }
15
16
  },
16
17
  emits: ["update"],
17
- setup(a, { emit: V }) {
18
- let l = c({});
19
- const i = a, m = V, f = c(!1), g = c(null);
20
- let s = c(!1);
18
+ setup(a, { emit: I }) {
19
+ const { formValues: v } = P();
20
+ let l = d({});
21
+ const s = a, m = I, p = d(!1), V = d(null);
22
+ let c = d(!1);
21
23
  C(() => {
22
24
  console.log(
23
25
  "Component Mounted: policyItems received for distributionId:",
24
- i.distributionId
25
- ), i.policyItems.length === 0 && m("update", [
26
+ s.distributionId
27
+ ), s.policyItems.length === 0 && m("update", [
26
28
  {
27
29
  id: 1,
28
30
  "dcat:downloadURL": ""
29
31
  }
30
32
  ]);
31
33
  });
32
- const v = (o) => {
33
- switch (o) {
34
+ const g = (i) => {
35
+ switch (i) {
34
36
  case "delete":
35
- x();
37
+ b();
36
38
  break;
37
39
  }
38
- }, _ = (o, t, e) => {
39
- const d = i.policyItems.map(
40
- (p) => p.id === e ? { ...p, [t]: o.target.value } : p
41
- );
42
- m("update", d);
43
- }, x = () => {
44
- if (i.policyItems.length === 1) {
45
- f.value = !0;
40
+ }, _ = (i, t, e) => {
41
+ let o = d(v.value.DistributionSimple["dcat:distribution"].find((x) => x.id === e));
42
+ o.value.policyItems === void 0 && (o.value.policyItems = [{ "dcat:downloadURL": "" }]), o.value.policyItems[0]["dcat:downloadURL"] = i.target.value;
43
+ }, b = () => {
44
+ if (s.policyItems.length === 1) {
45
+ p.value = !0;
46
46
  return;
47
47
  }
48
- const o = i.policyItems.filter(
49
- (t) => t.id !== g.value.id
48
+ const i = s.policyItems.filter(
49
+ (t) => t.id !== V.value.id
50
50
  );
51
- m("update", o);
51
+ m("update", i);
52
52
  };
53
- return (o, t) => (r(), u("div", {
54
- class: y(["dpiV3_documentationsWrap", { dpiV3_docAllAsCard: a.asCard }])
53
+ return (i, t) => (r(), u("div", {
54
+ class: f(["dpiV3_documentationsWrap", { dpiV3_docAllAsCard: a.asCard }])
55
55
  }, [
56
- (r(!0), u(h, null, k(a.policyItems, (e) => (r(), u("div", {
56
+ (r(!0), u(U, null, h(a.policyItems, (e) => (r(), u("div", {
57
57
  key: e.id,
58
- class: y(["dpiV3AutoCompleteWrap", { dpiV3_docAsCard: a.asCard }])
58
+ class: f(["dpiV3AutoCompleteWrap", { dpiV3_docAsCard: a.asCard }])
59
59
  }, [
60
- L("div", B, [
61
- U(P, {
62
- onInput: (d) => _(d, "dcat:downloadURL", e.id),
60
+ R("div", S, [
61
+ k(B, {
62
+ onInput: (o) => _(o, "dcat:downloadURL", e.id),
63
63
  addOnText: !1,
64
64
  datePicker: !1,
65
65
  infoIcon: !1,
@@ -70,24 +70,24 @@ const B = { class: "dpiV3_LinkAndMetadata" }, M = {
70
70
  label: "URL",
71
71
  showEndIcon: !1,
72
72
  modelValue: e["dcat:downloadURL"],
73
- "onUpdate:modelValue": (d) => e["dcat:downloadURL"] = d
73
+ "onUpdate:modelValue": (o) => e["dcat:downloadURL"] = o
74
74
  }, null, 8, ["onInput", "modelValue", "onUpdate:modelValue"]),
75
- f.value && a.policyItems.length === 1 ? (r(), u("p", M, " Mindestens eine URL muss vorhanden sein. ")) : I("", !0)
75
+ p.value && a.policyItems.length === 1 ? (r(), u("p", T, " Mindestens eine URL muss vorhanden sein. ")) : y("", !0)
76
76
  ])
77
77
  ], 2))), 128)),
78
- n(s) ? (r(), b(R, {
78
+ n(c) ? (r(), L(A, {
79
79
  key: 0,
80
80
  buttons: n(l).button,
81
81
  headerText: n(l).header,
82
82
  text: n(l).text,
83
- onClose: t[0] || (t[0] = (e) => A(s) ? s.value = !1 : s = !1),
83
+ onClose: t[0] || (t[0] = (e) => w(c) ? c.value = !1 : c = !1),
84
84
  action: n(l).action,
85
- onActionHandling: t[1] || (t[1] = (e) => v(e)),
85
+ onActionHandling: t[1] || (t[1] = (e) => g(e)),
86
86
  optionalString_1: n(l).optionalString_1
87
- }, null, 8, ["buttons", "headerText", "text", "action", "optionalString_1"])) : I("", !0)
87
+ }, null, 8, ["buttons", "headerText", "text", "action", "optionalString_1"])) : y("", !0)
88
88
  ], 2));
89
89
  }
90
- }, z = /* @__PURE__ */ w(T, [["__scopeId", "data-v-9c3e343e"]]);
90
+ }, W = /* @__PURE__ */ M(D, [["__scopeId", "data-v-1746259d"]]);
91
91
  export {
92
- z as default
92
+ W as default
93
93
  };