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

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 (29) hide show
  1. package/dist/assets/dpi.css +1 -1
  2. package/dist/data-provider-interface/HappyFlowComponents/services/dpiV3_apis.js +1 -1
  3. package/dist/data-provider-interface/HappyFlowComponents/ui/ModalV3.vue.js +393 -314
  4. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/AccessServiceV3.vue.js +105 -69
  5. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/ChangeLicenseV3.vue.js +95 -57
  6. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/ChecksumV3.vue.js +83 -55
  7. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/ConformsToV3.vue.js +116 -75
  8. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/DocumentationsV3.vue.js +145 -124
  9. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/PolicyV3.vue.js +41 -41
  10. package/dist/data-provider-interface/HappyFlowComponents/ui/RapModal.vue.js +123 -108
  11. package/dist/data-provider-interface/HappyFlowComponents/ui/SectionItems/AdditionalsSubModal.vue.js +440 -258
  12. package/dist/data-provider-interface/HappyFlowComponents/ui/SectionItems/CoverageModal.vue.js +37 -32
  13. package/dist/data-provider-interface/HappyFlowComponents/ui/SectionItems/DistributionModal.vue.js +6 -6
  14. package/dist/data-provider-interface/HappyFlowComponents/ui/SectionItems/EssentialsModal.vue.js +183 -126
  15. package/dist/data-provider-interface/components/ContactPage.vue.js +95 -89
  16. package/dist/data-provider-interface/components/DistLicense.vue.js +224 -133
  17. package/dist/data-provider-interface/components/DistributionSimplePage.vue.js +401 -396
  18. package/dist/data-provider-interface/components/HVDPage.vue.js +56 -55
  19. package/dist/data-provider-interface/components/PublisherPage.vue.js +94 -89
  20. package/dist/data-provider-interface/components/TempResPage.vue.js +122 -104
  21. package/dist/data-provider-interface/components/TempResPageInModal.vue.js +249 -108
  22. package/dist/data-provider-interface/components/VisibilityPage.vue.js +86 -0
  23. package/dist/data-provider-interface/composables/useDpiSimpleLoader.js +128 -118
  24. package/dist/data-provider-interface/config/dcatapdeHappyFlow/converter.js +40 -28
  25. package/dist/data-provider-interface/config/dcatapdeHappyFlow/input-definition.js +4 -0
  26. package/dist/data-provider-interface/config/dcatapdeHappyFlow/page-content-config.js +1 -1
  27. package/dist/data-provider-interface/views/InputPage.vue.js +421 -767
  28. package/dist/form/inputDefinitions.js +15 -10
  29. package/package.json +2 -2
@@ -1,17 +1,21 @@
1
- import { ref as m, onMounted as C, createElementBlock as c, openBlock as s, normalizeClass as S, createCommentVNode as h, createBlock as U, Fragment as k, renderList as L, createElementVNode as y, createVNode as u, unref as d, isRef as T } from "vue";
2
- import D from "../TextAreaV3.vue.js";
3
- import b from "../ButtonV3.vue.js";
4
- import R from "../ModalSimpleV3.vue.js";
5
- import I from "../InputField.vue.js";
1
+ import { ref as h, reactive as T, onMounted as z, createElementBlock as c, openBlock as r, normalizeClass as L, createCommentVNode as g, createBlock as D, Fragment as M, renderList as E, createElementVNode as S, createVNode as u, unref as d, toDisplayString as N, isRef as P } from "vue";
2
+ import q from "../TextAreaV3.vue.js";
3
+ import w from "../ButtonV3.vue.js";
4
+ import W from "../ModalSimpleV3.vue.js";
5
+ import _ from "../InputField.vue.js";
6
+ import { PhWarning as $ } from "@phosphor-icons/vue";
6
7
  /* empty css */
7
- import M from "../../../../_virtual/_plugin-vue_export-helper.js";
8
- const z = { class: "dpiV3_LinkAndMetadata" }, E = {
8
+ import H from "../../../../_virtual/_plugin-vue_export-helper.js";
9
+ const O = { class: "dpiV3_LinkAndMetadata" }, Z = {
9
10
  key: 0,
11
+ class: "dpiV3_errorMessage"
12
+ }, j = { class: "copy-mini-regular" }, G = {
13
+ key: 1,
10
14
  class: "copy-mini-regular dpiV3_text_error"
11
- }, N = {
15
+ }, J = {
12
16
  key: 0,
13
17
  class: "dpiV3_tempAddMore"
14
- }, q = {
18
+ }, K = {
15
19
  __name: "AccessServiceV3",
16
20
  props: {
17
21
  accessServices: { type: Array, required: !0 },
@@ -20,12 +24,12 @@ const z = { class: "dpiV3_LinkAndMetadata" }, E = {
20
24
  showDeleteButton: { type: Boolean, required: !1, default: !1 }
21
25
  },
22
26
  emits: ["update"],
23
- setup(a, { emit: x }) {
24
- let l = m({});
25
- const i = a, p = x, g = m(!1), V = m(null);
26
- let r = m(!1);
27
- C(() => {
28
- console.log("Component Mounted: accessServices received for distributionId:", i.distributionId), console.log("accessServices:", i.accessServices), i.accessServices.length === 0 && (console.log("No accessServices found, initializing first service."), p("update", [
27
+ setup(a, { expose: A, emit: R }) {
28
+ let s = h({});
29
+ const l = a, m = R, x = h(!1), V = h(null), o = T({});
30
+ let p = h(!1);
31
+ z(() => {
32
+ console.log("Component Mounted: accessServices received for distributionId:", l.distributionId), console.log("accessServices:", l.accessServices), l.accessServices.length === 0 && (console.log("No accessServices found, initializing first service."), m("update", [
29
33
  {
30
34
  id: 1,
31
35
  "dcat:downloadURL": "",
@@ -34,54 +38,79 @@ const z = { class: "dpiV3_LinkAndMetadata" }, E = {
34
38
  }
35
39
  ]));
36
40
  });
37
- const A = (n) => {
38
- switch (n) {
41
+ const f = (t) => {
42
+ if (!t || t.trim() === "") return !1;
43
+ const i = t.trim();
44
+ return /\.[a-zA-Z]{2,}$/.test(i);
45
+ }, B = (t) => {
46
+ const i = t["dct:title"] && t["dct:title"].trim() !== "", e = t["dct:description"] && t["dct:description"].trim() !== "";
47
+ return i || e;
48
+ }, I = (t) => {
49
+ const i = l.accessServices.find((e) => e.id === t);
50
+ if (i) {
51
+ const e = i["dcat:downloadURL"] ? i["dcat:downloadURL"].trim() : "";
52
+ B(i) ? e ? f(e) ? o[t] = null : o[t] = "Bitte geben Sie eine gültige URL ein (z.B. example.com)" : o[t] = "URL ist erforderlich" : e && !f(e) ? o[t] = "Bitte geben Sie eine gültige URL ein (z.B. example.com)" : o[t] = null;
53
+ }
54
+ }, b = () => {
55
+ let t = !1;
56
+ return l.accessServices.forEach((i) => {
57
+ const e = i["dcat:downloadURL"] ? i["dcat:downloadURL"].trim() : "";
58
+ B(i) ? e ? f(e) || (o[i.id] = "Bitte geben Sie eine gültige URL ein (z.B. example.com)", t = !0) : (o[i.id] = "URL ist erforderlich", t = !0) : e && !f(e) && (o[i.id] = "Bitte geben Sie eine gültige URL ein (z.B. example.com)", t = !0);
59
+ }), t;
60
+ }, k = (t) => {
61
+ switch (t) {
39
62
  case "delete":
40
- _();
63
+ F();
41
64
  break;
42
65
  }
43
- }, B = () => {
44
- const o = {
45
- id: (i.accessServices.length ? Math.max(...i.accessServices.map((e) => e.id)) : 0) + 1,
66
+ }, y = () => {
67
+ if (b())
68
+ return;
69
+ const i = {
70
+ id: (l.accessServices.length ? Math.max(...l.accessServices.map((e) => e.id)) : 0) + 1,
46
71
  "dcat:downloadURL": "",
47
72
  "dct:title": "",
48
73
  "dct:description": ""
49
74
  };
50
- p("update", [...i.accessServices, o]);
51
- }, f = (n, o, e) => {
52
- const t = i.accessServices.map(
53
- (v) => v.id === e ? { ...v, [o]: n.target.value } : v
75
+ m("update", [...l.accessServices, i]);
76
+ }, U = (t, i, e) => {
77
+ const n = l.accessServices.map(
78
+ (v) => v.id === e ? { ...v, [i]: t.target.value } : v
54
79
  );
55
- p("update", t);
56
- }, w = (n) => {
57
- l.value = {
80
+ m("update", n), setTimeout(() => {
81
+ I(e);
82
+ }, 0);
83
+ }, C = (t) => {
84
+ s.value = {
58
85
  button: "Löschen",
59
86
  header: "Datenservice löschen",
60
87
  text: "Sind Sie sicher, dass Sie den Service löschen wollen?",
61
88
  action: "delete",
62
- optionalString_1: n["dct:title"],
63
- optionalString_2: n["dcat:downloadURL"]
64
- }, r.value = !0, V.value = n;
65
- }, _ = () => {
66
- if (i.accessServices.length === 1) {
67
- g.value = !0;
89
+ optionalString_1: t["dct:title"],
90
+ optionalString_2: t["dcat:downloadURL"]
91
+ }, p.value = !0, V.value = t;
92
+ }, F = () => {
93
+ if (l.accessServices.length === 1) {
94
+ x.value = !0;
68
95
  return;
69
96
  }
70
- const n = i.accessServices.filter(
71
- (o) => o.id !== V.value.id
97
+ const t = l.accessServices.filter(
98
+ (i) => i.id !== V.value.id
72
99
  );
73
- p("update", n);
100
+ delete o[V.value.id], m("update", t);
74
101
  };
75
- return (n, o) => (s(), c("div", {
76
- class: S(["dpiV3_documentationsWrap", { dpiV3_docAllAsCard: a.asCard }])
102
+ return A({
103
+ validateAllItems: b
104
+ }), (t, i) => (r(), c("div", {
105
+ class: L(["dpiV3_documentationsWrap", { dpiV3_docAllAsCard: a.asCard }])
77
106
  }, [
78
- (s(!0), c(k, null, L(a.accessServices, (e) => (s(), c("div", {
107
+ (r(!0), c(M, null, E(a.accessServices, (e) => (r(), c("div", {
79
108
  key: e.id,
80
- class: S(["dpiV3AutoCompleteWrap", { dpiV3_docAsCard: a.asCard }])
109
+ class: L(["dpiV3AutoCompleteWrap", { dpiV3_docAsCard: a.asCard }])
81
110
  }, [
82
- y("div", z, [
83
- u(I, {
84
- onInput: (t) => f(t, "dcat:downloadURL", e.id),
111
+ S("div", O, [
112
+ u(_, {
113
+ onInput: (n) => U(n, "dcat:downloadURL", e.id),
85
114
  addOnText: !1,
86
115
  datePicker: !1,
87
116
  infoIcon: !1,
@@ -92,10 +121,17 @@ const z = { class: "dpiV3_LinkAndMetadata" }, E = {
92
121
  label: "URL",
93
122
  showEndIcon: !1,
94
123
  modelValue: e["dcat:downloadURL"],
95
- "onUpdate:modelValue": (t) => e["dcat:downloadURL"] = t
124
+ "onUpdate:modelValue": (n) => e["dcat:downloadURL"] = n
96
125
  }, null, 8, ["onInput", "modelValue", "onUpdate:modelValue"]),
97
- u(I, {
98
- onInput: (t) => f(t, "dct:title", e.id),
126
+ o[e.id] ? (r(), c("div", Z, [
127
+ u(d($), {
128
+ size: 16,
129
+ weight: "fill"
130
+ }),
131
+ S("span", j, N(o[e.id]), 1)
132
+ ])) : g("", !0),
133
+ u(_, {
134
+ onInput: (n) => U(n, "dct:title", e.id),
99
135
  addOnText: !1,
100
136
  datePicker: !1,
101
137
  infoIcon: !1,
@@ -106,52 +142,52 @@ const z = { class: "dpiV3_LinkAndMetadata" }, E = {
106
142
  label: "Titel (optional)",
107
143
  showEndIcon: !1,
108
144
  modelValue: e["dct:title"],
109
- "onUpdate:modelValue": (t) => e["dct:title"] = t,
145
+ "onUpdate:modelValue": (n) => e["dct:title"] = n,
110
146
  defaultInput: !a.showDeleteButton
111
147
  }, null, 8, ["onInput", "modelValue", "onUpdate:modelValue", "defaultInput"]),
112
- u(D, {
113
- onInput: (t) => f(t, "dct:description", e.id),
148
+ u(q, {
149
+ onInput: (n) => U(n, "dct:description", e.id),
114
150
  hint: !1,
115
151
  label: "Beschreibung (optional)",
116
152
  placeholder: "Bitte Beschreibung eingeben...",
117
153
  modelValue: e["dct:description"],
118
- "onUpdate:modelValue": (t) => e["dct:description"] = t,
154
+ "onUpdate:modelValue": (n) => e["dct:description"] = n,
119
155
  showDeleteButton: a.showDeleteButton
120
156
  }, null, 8, ["onInput", "modelValue", "onUpdate:modelValue", "showDeleteButton"]),
121
- g.value && a.accessServices.length === 1 ? (s(), c("p", E, " Mindestens eine URL muss vorhanden sein. ")) : h("", !0)
157
+ x.value && a.accessServices.length === 1 ? (r(), c("p", G, " Mindestens eine URL muss vorhanden sein. ")) : g("", !0)
122
158
  ]),
123
- u(b, {
159
+ u(w, {
124
160
  class: "dpiV3_tempAddMore",
125
161
  buttonText: "Löschen",
126
162
  size: "small",
127
163
  iconStart: "trash",
128
164
  variant: "tertiary",
129
- onClick: (t) => w(e)
165
+ onClick: (n) => C(e)
130
166
  }, null, 8, ["onClick"])
131
167
  ], 2))), 128)),
132
- a.asCard ? h("", !0) : (s(), c("div", N, [
133
- u(b, {
168
+ a.asCard ? g("", !0) : (r(), c("div", J, [
169
+ u(w, {
134
170
  buttonText: "Weiteren Service hinzufügen",
135
171
  size: "small",
136
172
  iconStart: "plus",
137
173
  variant: "tertiary",
138
- onClick: B
174
+ onClick: y
139
175
  })
140
176
  ])),
141
- d(r) ? (s(), U(R, {
177
+ d(p) ? (r(), D(W, {
142
178
  key: 1,
143
- buttons: d(l).button,
144
- headerText: d(l).header,
145
- text: d(l).text,
146
- onClose: o[0] || (o[0] = (e) => T(r) ? r.value = !1 : r = !1),
147
- action: d(l).action,
148
- onActionHandling: o[1] || (o[1] = (e) => A(e)),
149
- optionalString_1: d(l).optionalString_1,
150
- optionalString_2: d(l).optionalString_2
151
- }, null, 8, ["buttons", "headerText", "text", "action", "optionalString_1", "optionalString_2"])) : h("", !0)
179
+ buttons: d(s).button,
180
+ headerText: d(s).header,
181
+ text: d(s).text,
182
+ onClose: i[0] || (i[0] = (e) => P(p) ? p.value = !1 : p = !1),
183
+ action: d(s).action,
184
+ onActionHandling: i[1] || (i[1] = (e) => k(e)),
185
+ optionalString_1: d(s).optionalString_1,
186
+ optionalString_2: d(s).optionalString_2
187
+ }, null, 8, ["buttons", "headerText", "text", "action", "optionalString_1", "optionalString_2"])) : g("", !0)
152
188
  ], 2));
153
189
  }
154
- }, G = /* @__PURE__ */ M(q, [["__scopeId", "data-v-5b5b9169"]]);
190
+ }, oe = /* @__PURE__ */ H(K, [["__scopeId", "data-v-a722a31b"]]);
155
191
  export {
156
- G as default
192
+ oe as default
157
193
  };
@@ -1,10 +1,17 @@
1
- import { ref as s, onMounted as b, getCurrentInstance as x, watch as c, createElementBlock as p, openBlock as f, Fragment as z, createCommentVNode as I, createVNode as g, normalizeClass as D, unref as C } from "vue";
2
- import { getLicenses as V } from "../../services/dpiV3_apis.js";
3
- import T from "../Dropdown.vue.js";
4
- import B from "../InputField.vue.js";
1
+ import { ref as s, onMounted as k, getCurrentInstance as B, watch as w, createElementBlock as c, openBlock as p, Fragment as F, createCommentVNode as g, createVNode as f, normalizeClass as N, unref as m, createElementVNode as b, toDisplayString as z } from "vue";
2
+ import { getLicenses as _ } from "../../services/dpiV3_apis.js";
3
+ import S from "../Dropdown.vue.js";
4
+ import E from "../InputField.vue.js";
5
+ import { PhWarning as y } from "@phosphor-icons/vue";
5
6
  /* empty css */
6
- import F from "../../../../_virtual/_plugin-vue_export-helper.js";
7
- const k = { key: 0 }, y = {
7
+ import P from "../../../../_virtual/_plugin-vue_export-helper.js";
8
+ const M = { key: 0 }, U = {
9
+ key: 1,
10
+ class: "dpiV3_errorMessage"
11
+ }, H = { class: "copy-mini-regular" }, O = {
12
+ key: 2,
13
+ class: "dpiV3_errorMessage"
14
+ }, W = { class: "copy-mini-regular" }, q = {
8
15
  __name: "ChangeLicenseV3",
9
16
  props: {
10
17
  distributionId: { type: Number, required: !1 },
@@ -14,63 +21,80 @@ const k = { key: 0 }, y = {
14
21
  asCard: { type: Boolean, default: !1 }
15
22
  },
16
23
  emits: ["addChangeLicense", "deleteButtonClicked"],
17
- setup(o, { emit: m }) {
18
- let d = s([]);
19
- b(async () => {
20
- const n = x().appContext.app.config.globalProperties.$env;
24
+ setup(o, { expose: D, emit: x }) {
25
+ let h = s([]);
26
+ const d = s(null), u = s(null);
27
+ k(async () => {
28
+ const t = B().appContext.app.config.globalProperties.$env;
21
29
  try {
22
- const e = await V(n.api.baseUrl);
23
- d.value = e.map((u) => ({
24
- "@value": u.value,
25
- label: u.label
30
+ const n = await _(t.api.baseUrl);
31
+ h.value = n.map((L) => ({
32
+ "@value": L.value,
33
+ label: L.label
26
34
  }));
27
- } catch (e) {
28
- console.error("Failed to load licenses", e);
35
+ } catch (n) {
36
+ console.error("Failed to load licenses", n);
29
37
  }
30
38
  });
31
- const i = o, l = s(i.changeLicenseText);
39
+ const a = o, i = s(a.changeLicenseText);
32
40
  s([]);
33
- const a = s(i.changeLicenseDropdownText), r = m, h = (t) => {
34
- l.value = t.target.value, r(
41
+ const l = s(a.changeLicenseDropdownText), v = x, r = () => {
42
+ const e = typeof l.value == "string" ? l.value.trim() : "", t = typeof i.value == "string" ? i.value.trim() : "";
43
+ let n = !1;
44
+ return d.value = null, u.value = null, e && (e.toLowerCase().includes("cc-by") || e.toLowerCase().includes("cc by")) && (t || (u.value = "Nennung des Datenbereitstellers ist erforderlich für diese Lizenz", n = !0)), t && !e && (d.value = "Lizenz ist erforderlich wenn Nennung des Datenbereitstellers ausgefüllt ist", n = !0), n;
45
+ }, T = (e) => {
46
+ var n;
47
+ const t = typeof e == "string" ? e : ((n = e == null ? void 0 : e.target) == null ? void 0 : n.value) ?? "";
48
+ i.value = t, v(
35
49
  "addChangeLicense",
50
+ i.value,
36
51
  l.value,
37
- a.value,
38
- i.distributionId
39
- );
40
- }, v = (t) => {
41
- a.value = t, r(
52
+ a.distributionId
53
+ ), setTimeout(() => {
54
+ r();
55
+ }, 0);
56
+ }, V = (e) => {
57
+ l.value = e, v(
42
58
  "addChangeLicense",
59
+ i.value,
43
60
  l.value,
44
- a.value,
45
- i.distributionId
46
- );
61
+ a.distributionId
62
+ ), setTimeout(() => {
63
+ r();
64
+ }, 0);
47
65
  };
48
- c(
49
- () => i.changeLicenseDropdownText,
50
- (t) => {
51
- a.value = t;
66
+ w(
67
+ () => a.changeLicenseDropdownText,
68
+ (e) => {
69
+ l.value = e;
52
70
  }
53
- ), c(
54
- () => i.changeLicenseText,
55
- (t) => {
56
- l.value = t;
71
+ ), w(
72
+ () => a.changeLicenseText,
73
+ (e) => {
74
+ i.value = e;
57
75
  }
58
76
  );
59
- const L = () => {
60
- a.value = "";
61
- }, w = () => {
62
- l.value = "";
77
+ const C = () => {
78
+ l.value = "", setTimeout(() => {
79
+ r();
80
+ }, 0);
81
+ }, I = () => {
82
+ i.value = "", setTimeout(() => {
83
+ r();
84
+ }, 0);
63
85
  };
64
- return (t, n) => (f(), p(z, null, [
65
- o.asCard ? I("", !0) : (f(), p("p", k, " Die von Ihnen gewählte Lizenz bestimmt, wie andere Ihre Daten verwenden und teilen können. Je einfacher die Lizenz, desto besser. Um eine Wiederverwendung zu erleichtern, ist die Auswahl eines bereits verbreiteten Lizenzstandards zu empfehlen. ")),
66
- g(T, {
86
+ return D({
87
+ validate: r
88
+ }), (e, t) => (p(), c(F, null, [
89
+ o.asCard ? g("", !0) : (p(), c("p", M, " Die von Ihnen gewählte Lizenz bestimmt, wie andere Ihre Daten verwenden und teilen können. Je einfacher die Lizenz, desto besser. Um eine Wiederverwendung zu erleichtern, ist die Auswahl eines bereits verbreiteten Lizenzstandards zu empfehlen. ")),
90
+ f(S, {
67
91
  "onUpdate:modelValue": [
68
- n[0] || (n[0] = (e) => v(e)),
69
- n[1] || (n[1] = (e) => a.value = e)
92
+ t[0] || (t[0] = (n) => V(n)),
93
+ t[1] || (t[1] = (n) => l.value = n)
70
94
  ],
71
95
  dropdownWidth: "large",
72
96
  type: "inputField",
73
- modelValue: a.value,
97
+ modelValue: l.value,
74
98
  inputFieldProps: {
75
99
  addOnText: !1,
76
100
  initialHintText: !1,
@@ -81,17 +105,24 @@ const k = { key: 0 }, y = {
81
105
  dropdown_dpiV3: !0,
82
106
  placeholder: "Geben Sie die Lizenz ein...",
83
107
  inputFieldSize: "large",
84
- modelValue: a.value,
108
+ modelValue: l.value,
85
109
  defaultInput: !o.showDeleteButton
86
110
  },
87
- data: C(d),
88
- onDeleteDropdownField: L,
89
- class: D({ dpiV3_Space3: o.showDeleteButton })
111
+ data: m(h),
112
+ onDeleteDropdownField: C,
113
+ class: N({ dpiV3_Space3: o.showDeleteButton })
90
114
  }, null, 8, ["modelValue", "inputFieldProps", "data", "class"]),
91
- g(B, {
92
- onInput: n[2] || (n[2] = (e) => h(e)),
93
- modelValue: l.value,
94
- "onUpdate:modelValue": n[3] || (n[3] = (e) => l.value = e),
115
+ d.value ? (p(), c("div", U, [
116
+ f(m(y), {
117
+ size: 16,
118
+ weight: "fill"
119
+ }),
120
+ b("span", H, z(d.value), 1)
121
+ ])) : g("", !0),
122
+ f(E, {
123
+ onInput: t[2] || (t[2] = (n) => T(n)),
124
+ modelValue: i.value,
125
+ "onUpdate:modelValue": t[3] || (t[3] = (n) => i.value = n),
95
126
  addOnText: !1,
96
127
  datePicker: !1,
97
128
  infoIcon: !1,
@@ -102,12 +133,19 @@ const k = { key: 0 }, y = {
102
133
  label: "Nennung des Datenbereitstellers",
103
134
  showEndIcon: !1,
104
135
  defaultInput: !o.showDeleteButton,
105
- onDeleteButtonClicked: w,
136
+ onDeleteButtonClicked: I,
106
137
  supportingHintMessage: "Dieser Namensnennungstext stellt sicher, dass die Lizenzbedingungen eingehalten werden."
107
- }, null, 8, ["modelValue", "defaultInput"])
138
+ }, null, 8, ["modelValue", "defaultInput"]),
139
+ u.value ? (p(), c("div", O, [
140
+ f(m(y), {
141
+ size: 16,
142
+ weight: "fill"
143
+ }),
144
+ b("span", W, z(u.value), 1)
145
+ ])) : g("", !0)
108
146
  ], 64));
109
147
  }
110
- }, O = /* @__PURE__ */ F(y, [["__scopeId", "data-v-1896a82d"]]);
148
+ }, R = /* @__PURE__ */ P(q, [["__scopeId", "data-v-5c32864f"]]);
111
149
  export {
112
- O as default
150
+ R as default
113
151
  };
@@ -1,11 +1,18 @@
1
- import { ref as n, onMounted as I, getCurrentInstance as g, watch as p, createElementBlock as V, openBlock as w, Fragment as D, createVNode as f, normalizeClass as T } from "vue";
2
- import { useFormValues as C } from "../../../composables/useDpiFormValues.js";
3
- import { getChecksumAlgorithms as F } from "../../services/dpiV3_apis.js";
4
- import S from "../Dropdown.vue.js";
5
- import B from "../InputField.vue.js";
1
+ import { ref as n, onMounted as _, getCurrentInstance as A, watch as g, createElementBlock as f, openBlock as v, Fragment as E, createVNode as d, createCommentVNode as x, normalizeClass as z, createElementVNode as I, unref as V, toDisplayString as b } from "vue";
2
+ import { useFormValues as N } from "../../../composables/useDpiFormValues.js";
3
+ import { getChecksumAlgorithms as M } from "../../services/dpiV3_apis.js";
4
+ import O from "../Dropdown.vue.js";
5
+ import U from "../InputField.vue.js";
6
+ import { PhWarning as w } from "@phosphor-icons/vue";
6
7
  /* empty css */
7
- import y from "../../../../_virtual/_plugin-vue_export-helper.js";
8
- const P = {
8
+ import q from "../../../../_virtual/_plugin-vue_export-helper.js";
9
+ const H = {
10
+ key: 0,
11
+ class: "dpiV3_errorMessage"
12
+ }, W = { class: "copy-mini-regular" }, G = {
13
+ key: 1,
14
+ class: "dpiV3_errorMessage"
15
+ }, $ = { class: "copy-mini-regular" }, j = {
9
16
  __name: "ChecksumV3",
10
17
  props: {
11
18
  distributionId: { type: Number, required: !1 },
@@ -16,63 +23,70 @@ const P = {
16
23
  distIndex: { type: Number, required: !1 }
17
24
  },
18
25
  emits: ["addChecksum", "deleteButtonClicked"],
19
- setup(i, { emit: h }) {
20
- const s = n([]), { formValues: d } = C();
21
- I(async () => {
22
- const e = g().appContext.app.config.globalProperties.$env;
26
+ setup(r, { expose: D, emit: T }) {
27
+ const c = n([]), { formValues: m } = N(), i = n(null), u = n(null);
28
+ _(async () => {
29
+ const t = A().appContext.app.config.globalProperties.$env;
23
30
  try {
24
- const t = await F(e.api.baseUrl);
25
- s.value = t.map((r) => ({
26
- "@value": r.value,
27
- label: r.label,
31
+ const e = await M(t.api.baseUrl);
32
+ c.value = e.map((p) => ({
33
+ "@value": p.value,
34
+ label: p.label,
28
35
  selected: !1,
29
- uri: r.resource
36
+ uri: p.resource
30
37
  }));
31
- } catch (t) {
32
- console.error("Failed to load checksum algorithms:", t);
38
+ } catch (e) {
39
+ console.error("Failed to load checksum algorithms:", e);
33
40
  }
34
41
  });
35
- const o = i, a = n(o.checksumText);
42
+ const o = r, s = n(o.checksumText);
36
43
  n([]);
37
- const u = n(o.checksumDropdownText), c = h;
38
- let m = "";
39
- const k = (l) => {
40
- a.value = l.target.value, c(
44
+ const a = n(o.checksumDropdownText), h = T;
45
+ let k = "";
46
+ const y = () => {
47
+ const l = s.value && s.value.trim() !== "", t = a.value && a.value.trim() !== "";
48
+ let e = !1;
49
+ return l || t ? (l ? u.value = null : (u.value = "Prüfsumme ist erforderlich", e = !0), t ? i.value = null : (i.value = "Algorithmus ist erforderlich", e = !0)) : (u.value = null, i.value = null), !e;
50
+ }, C = () => !y(), F = (l) => {
51
+ s.value = l.target.value, h(
41
52
  "addChecksum",
53
+ s.value,
42
54
  a.value,
43
- u.value,
44
55
  o.distributionId
45
56
  );
46
- }, v = (l) => {
47
- u.value = l, m = s.value.find((e) => e["@value"] === l).uri || "", c(
57
+ }, S = (l) => {
58
+ var t;
59
+ a.value = l, k = ((t = c.value.find((e) => e["@value"] === l)) == null ? void 0 : t.uri) || "", h(
48
60
  "addChecksum",
61
+ s.value,
49
62
  a.value,
50
- u.value,
51
63
  o.distributionId,
52
- m
64
+ k
53
65
  );
54
66
  };
55
- p(
67
+ g(
56
68
  () => o.checksumDropdownText,
57
69
  (l) => {
58
- u.value = l;
70
+ a.value = l;
59
71
  }
60
- ), p(
72
+ ), g(
61
73
  () => o.checksumText,
62
74
  (l) => {
63
- a.value = l;
75
+ s.value = l;
64
76
  }
65
77
  );
66
- const x = () => {
67
- d.value.DistributionSimple["dcat:distribution"][o.distIndex].checksum.uri = "", d.value.DistributionSimple["dcat:distribution"][o.distIndex].checksum["spdx:checksum"] = "", u.value = "";
68
- }, b = () => {
69
- d.value.DistributionSimple["dcat:distribution"][o.distIndex].checksum.title = "", a.value = "";
78
+ const B = () => {
79
+ m.value.DistributionSimple["dcat:distribution"][o.distIndex].checksum.uri = "", m.value.DistributionSimple["dcat:distribution"][o.distIndex].checksum["spdx:checksum"] = "", a.value = "", i.value = null;
80
+ }, P = () => {
81
+ m.value.DistributionSimple["dcat:distribution"][o.distIndex].checksum.title = "", s.value = "", u.value = null;
70
82
  };
71
- return (l, e) => (w(), V(D, null, [
72
- f(B, {
73
- onInput: e[0] || (e[0] = (t) => k(t)),
74
- modelValue: a.value,
75
- "onUpdate:modelValue": e[1] || (e[1] = (t) => a.value = t),
83
+ return D({
84
+ validateAllItems: C
85
+ }), (l, t) => (v(), f(E, null, [
86
+ d(U, {
87
+ onInput: t[0] || (t[0] = (e) => F(e)),
88
+ modelValue: s.value,
89
+ "onUpdate:modelValue": t[1] || (t[1] = (e) => s.value = e),
76
90
  addOnText: !1,
77
91
  datePicker: !1,
78
92
  infoIcon: !1,
@@ -82,18 +96,25 @@ const P = {
82
96
  initialHintText: !1,
83
97
  label: "Prüfsumme",
84
98
  showEndIcon: !1,
85
- defaultInput: !i.showDeleteButton,
86
- onDeleteButtonClicked: b,
87
- class: T({ dpiV3_Space3: i.showDeleteButton })
99
+ defaultInput: !r.showDeleteButton,
100
+ onDeleteButtonClicked: P,
101
+ class: z({ dpiV3_Space3: r.showDeleteButton })
88
102
  }, null, 8, ["modelValue", "defaultInput", "class"]),
89
- f(S, {
103
+ u.value ? (v(), f("div", H, [
104
+ d(V(w), {
105
+ size: 16,
106
+ weight: "fill"
107
+ }),
108
+ I("span", W, b(u.value), 1)
109
+ ])) : x("", !0),
110
+ d(O, {
90
111
  "onUpdate:modelValue": [
91
- e[2] || (e[2] = (t) => v(t)),
92
- e[3] || (e[3] = (t) => u.value = t)
112
+ t[2] || (t[2] = (e) => S(e)),
113
+ t[3] || (t[3] = (e) => a.value = e)
93
114
  ],
94
115
  dropdownWidth: "large",
95
116
  type: "inputField",
96
- modelValue: u.value,
117
+ modelValue: a.value,
97
118
  inputFieldProps: {
98
119
  addOnText: !1,
99
120
  initialHintText: !1,
@@ -104,15 +125,22 @@ const P = {
104
125
  dropdown_dpiV3: !0,
105
126
  placeholder: "Geben Sie den Algorithmus ein...",
106
127
  inputFieldSize: "large",
107
- modelValue: u.value,
108
- defaultInput: !i.showDeleteButton
128
+ modelValue: a.value,
129
+ defaultInput: !r.showDeleteButton
109
130
  },
110
- data: s.value,
111
- onDeleteDropdownField: x
112
- }, null, 8, ["modelValue", "inputFieldProps", "data"])
131
+ data: c.value,
132
+ onDeleteDropdownField: B
133
+ }, null, 8, ["modelValue", "inputFieldProps", "data"]),
134
+ i.value ? (v(), f("div", G, [
135
+ d(V(w), {
136
+ size: 16,
137
+ weight: "fill"
138
+ }),
139
+ I("span", $, b(i.value), 1)
140
+ ])) : x("", !0)
113
141
  ], 64));
114
142
  }
115
- }, H = /* @__PURE__ */ y(P, [["__scopeId", "data-v-82512521"]]);
143
+ }, ee = /* @__PURE__ */ q(j, [["__scopeId", "data-v-d9583dd7"]]);
116
144
  export {
117
- H as default
145
+ ee as default
118
146
  };