@piveau/dpi 0.1.0-beta.46 → 0.1.0-beta.47

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