@piveau/dpi 0.1.0-beta.59 → 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.
@@ -54,7 +54,7 @@ const T = { class: "dpiV3_LinkAndMetadata" }, F = {
54
54
  } });
55
55
  const L = (o, e, t) => {
56
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;
57
+ a.value.policyItems[0] === void 0 && (a.value.policyItems = [{ "dcat:downloadURL": "" }]), a.value.policyItems[0]["dcat:downloadURL"] = o.target.value;
58
58
  }, b = () => {
59
59
  if (s.policyItems.length === 1) {
60
60
  v.value = !0;
@@ -103,7 +103,7 @@ const T = { class: "dpiV3_LinkAndMetadata" }, F = {
103
103
  }, null, 8, ["buttons", "headerText", "text", "action", "optionalString_1"])) : p("", !0)
104
104
  ], 2));
105
105
  }
106
- }, G = /* @__PURE__ */ S(q, [["__scopeId", "data-v-389f6598"]]);
106
+ }, G = /* @__PURE__ */ S(q, [["__scopeId", "data-v-55082169"]]);
107
107
  export {
108
108
  G as default
109
109
  };
@@ -1,28 +1,28 @@
1
- import { ref as g, computed as k, resolveComponent as b, createElementBlock as f, openBlock as o, createElementVNode as m, createBlock as S, createCommentVNode as d, toDisplayString as P, createVNode as s, withCtx as V, unref as M, Fragment as Z, renderList as G } from "vue";
2
- import { useI18n as Q } from "vue-i18n";
3
- import { PhWarning as X } from "@phosphor-icons/vue";
4
- import Y from "./CrossOutButton.vue.js";
5
- import z from "./ButtonV3.vue.js";
6
- import ee from "./SectionItems/FindabilityChips.vue.js";
7
- import te from "./SectionItems/HVDSwitch.vue.js";
8
- import ae from "./SectionItems/EssentialsModal.vue.js";
9
- import ie from "./SectionItems/DistributionModal.vue.js";
10
- import oe from "./SectionItems/CoverageModal.vue.js";
11
- import ne from "./SectionItems/AdditionalsModal.vue.js";
1
+ import { ref as f, computed as k, resolveComponent as S, createElementBlock as m, openBlock as o, createElementVNode as p, createBlock as V, createCommentVNode as u, toDisplayString as R, createVNode as l, withCtx as x, unref as C, Fragment as Q, renderList as X } from "vue";
2
+ import { useI18n as Y } from "vue-i18n";
3
+ import { PhWarning as ee } from "@phosphor-icons/vue";
4
+ import te from "./CrossOutButton.vue.js";
5
+ import $ from "./ButtonV3.vue.js";
6
+ import ae from "./SectionItems/FindabilityChips.vue.js";
7
+ import ie from "./SectionItems/HVDSwitch.vue.js";
8
+ import oe from "./SectionItems/EssentialsModal.vue.js";
9
+ import ne from "./SectionItems/DistributionModal.vue.js";
10
+ import se from "./SectionItems/CoverageModal.vue.js";
11
+ import le from "./SectionItems/AdditionalsModal.vue.js";
12
12
  import "@formkit/core";
13
- import { useFormValues as se } from "../../composables/useDpiFormValues.js";
13
+ import { useFormValues as ce } from "../../composables/useDpiFormValues.js";
14
14
  /* empty css */
15
- import le from "../../../_virtual/_plugin-vue_export-helper.js";
16
- const ce = { class: "dpiV3_RapModalContainer" }, re = { class: "dpiV3_RapModalOuter" }, de = { class: "dpiV3_RapModalInner" }, ue = { class: "dpiV3_modalHead" }, ve = {
15
+ import re from "../../../_virtual/_plugin-vue_export-helper.js";
16
+ const ue = { class: "dpiV3_RapModalContainer" }, de = { class: "dpiV3_RapModalOuter" }, ve = { class: "dpiV3_RapModalInner" }, fe = { class: "dpiV3_modalHead" }, me = {
17
17
  key: 0,
18
18
  class: "headline"
19
- }, fe = { class: "dpiV3_closeButtonContainer" }, me = { class: "dpiV3_modalBody" }, pe = { key: 0 }, _e = {
19
+ }, pe = { class: "dpiV3_closeButtonContainer" }, _e = { class: "dpiV3_modalBody" }, ge = { key: 0 }, he = {
20
20
  key: 2,
21
21
  id: "essentials"
22
- }, ge = {
22
+ }, be = {
23
23
  key: 6,
24
24
  class: "dpiV3_errormsgWrapper"
25
- }, he = { class: "validation-messages" }, ye = { class: "dpiV3_actionButtonWrap" }, be = {
25
+ }, ye = { class: "validation-messages" }, Se = { class: "dpiV3_actionButtonWrap" }, Ve = {
26
26
  __name: "RapModal",
27
27
  props: {
28
28
  isVisible: {
@@ -33,10 +33,10 @@ const ce = { class: "dpiV3_RapModalContainer" }, re = { class: "dpiV3_RapModalOu
33
33
  activeSection: String
34
34
  },
35
35
  emits: ["close"],
36
- setup(u, { emit: O }) {
37
- const { t: $ } = Q(), t = u;
38
- let C = g();
39
- const { formValues: h } = se(), R = O, A = g(null), p = g(null), y = g(null), l = g(!1), L = {
36
+ setup(d, { emit: A }) {
37
+ const { t: L } = Y(), a = d;
38
+ let B = f();
39
+ const { formValues: h } = ce(), w = A, D = f(null), _ = f(null), b = f(null), n = f(!1), y = f(null), J = {
40
40
  findabilityHvd: "message.dataupload.datasets.rap.findability.title",
41
41
  essentials: "message.dataupload.datasets.rap.essentials.title",
42
42
  coverage: "message.dataupload.datasets.rap.coverage.title",
@@ -44,165 +44,170 @@ const ce = { class: "dpiV3_RapModalContainer" }, re = { class: "dpiV3_RapModalOu
44
44
  additionals: "message.metadata.additionals"
45
45
  };
46
46
  console.log(h.value);
47
- const w = k(() => {
48
- const e = L[t.activeSection];
49
- return e ? $(e) : "";
50
- }), E = k(() => {
47
+ const E = k(() => {
48
+ const e = J[a.activeSection];
49
+ return e ? L(e) : "";
50
+ }), I = k(() => {
51
51
  var i, r;
52
52
  const e = (r = (i = h.value) == null ? void 0 : i.Discoverability) == null ? void 0 : r.discoverabilityPage;
53
53
  return !e || !Array.isArray(e) ? !1 : e.filter((v) => v.id && v.label).length > 0;
54
- }), D = () => t.activeSection === "findabilityHvd" && !E.value ? (l.value = !0, !1) : (l.value = !1, !0), J = () => t.activeSection === "essentials" && p.value && !p.value.isValid ? (l.value = !0, !1) : (l.value = !1, !0), K = () => t.activeSection === "coverage" && y.value && y.value.validateAllItems() ? (l.value = !0, !1) : (l.value = !1, !0), I = () => t.activeSection === "findabilityHvd" ? D() : t.activeSection === "essentials" ? J() : t.activeSection === "coverage" ? K() : (l.value = !1, !0), F = k(() => t.activeSection === "findabilityHvd" && !E.value ? ["Bitte wählen Sie mindestens eine Kategorie aus, bevor Sie fortfahren."] : t.activeSection === "essentials" && p.value && !p.value.isValid ? p.value.getValidationErrorMessages() : t.activeSection === "coverage" && y.value && y.value.validateAllItems() ? ["Bitte füllen Sie alle erforderlichen Felder aus, wenn ein Feld ausgefüllt ist."] : []), H = () => {
55
- I() && T();
56
- }, T = () => {
57
- l.value = !1, R("close");
58
- }, c = k(() => h.value.BasicInfos), N = (e, a) => {
54
+ }), K = () => a.activeSection === "findabilityHvd" && !I.value ? (n.value = !0, !1) : (n.value = !1, !0), F = () => a.activeSection === "distributions" && (console.log(y.value && !y.value.isValid), y.value && !y.value.isValid) ? (n.value = !0, !1) : (n.value = !1, !0), j = () => a.activeSection === "essentials" && _.value && !_.value.isValid ? (n.value = !0, !1) : (n.value = !1, !0), q = () => a.activeSection === "coverage" && b.value && b.value.validateAllItems() ? (n.value = !0, !1) : (n.value = !1, !0), H = () => a.activeSection === "findabilityHvd" ? K() : a.activeSection === "essentials" ? j() : a.activeSection === "coverage" ? q() : a.activeSection === "distributions" ? (console.log("hey" + F()), F()) : (n.value = !1, !0), T = k(() => a.activeSection === "findabilityHvd" && !I.value ? ["Bitte wählen Sie mindestens eine Kategorie aus, bevor Sie fortfahren."] : a.activeSection === "essentials" && _.value && !_.value.isValid ? _.value.getValidationErrorMessages() : a.activeSection === "coverage" && b.value && b.value.validateAllItems() ? ["Bitte füllen Sie alle erforderlichen Felder aus, wenn ein Feld ausgefüllt ist."] : []), N = () => {
55
+ H() && W();
56
+ }, W = () => {
57
+ n.value = !1, w("close");
58
+ }, c = k(() => h.value.BasicInfos), z = (e, t) => {
59
59
  var i;
60
- return ((i = e == null ? void 0 : e.find((r) => r["@language"] === a)) == null ? void 0 : i["@value"]) || "";
61
- }, _ = (e, a) => {
60
+ return ((i = e == null ? void 0 : e.find((r) => r["@language"] === t)) == null ? void 0 : i["@value"]) || "";
61
+ }, g = (e, t) => {
62
62
  var i;
63
- return ((i = e == null ? void 0 : e[0]) == null ? void 0 : i[a]) || "";
64
- }, j = (e) => {
65
- var a;
66
- return ((a = e == null ? void 0 : e[0]) == null ? void 0 : a["@value"]) || "";
67
- }, n = g({
68
- title: N(c.value["dct:title"], "de"),
69
- description: N(c.value["dct:description"], "de"),
70
- modified: j(c.value["dct:modified"]),
71
- publisherName: _(c.value["dct:publisher"], "foaf:name"),
72
- publisherMail: _(c.value["dct:publisher"], "foaf:mbox"),
73
- publisherWebsite: _(c.value["dct:publisher"], "foaf:homepage"),
74
- contactPointName: _(c.value["dcat:contactPoint"], "vcard:fn"),
75
- contactPointMail: _(c.value["dcat:contactPoint"], "vcard:hasEmail"),
76
- contactPointPhone: _(c.value["dcat:contactPoint"], "vcard:hasTelephone")
77
- }), W = (e, a, i, r) => {
78
- e[a] || (e[a] = []);
79
- const v = e[a].find((B) => B["@language"] === r);
80
- v ? v["@value"] = i : e[a].push({ "@value": i, "@language": r });
81
- }, q = () => {
82
- if (!I())
83
- return;
84
- const e = JSON.parse(JSON.stringify(h.value.BasicInfos));
85
- W(e, "dct:title", n.value.title, "de"), W(e, "dct:description", n.value.description, "de"), e["dct:publisher"] = [{
86
- "foaf:name": n.value.publisherName,
87
- "foaf:mbox": n.value.publisherMail,
88
- "foaf:homepage": n.value.publisherWebsite
89
- }], e["dcat:contactPoint"] = [{
90
- "vcard:fn": n.value.contactPointName,
91
- "vcard:hasEmail": n.value.contactPointMail,
92
- "vcard:hasTelephone": n.value.contactPointPhone
93
- }], e["dct:modified"] = [{ "@value": n.value.modified }], h.value.BasicInfos = e, R("close");
63
+ return ((i = e == null ? void 0 : e[0]) == null ? void 0 : i[t]) || "";
64
+ }, U = (e) => {
65
+ var t;
66
+ return ((t = e == null ? void 0 : e[0]) == null ? void 0 : t["@value"]) || "";
67
+ }, s = f({
68
+ title: z(c.value["dct:title"], "de"),
69
+ description: z(c.value["dct:description"], "de"),
70
+ modified: U(c.value["dct:modified"]),
71
+ publisherName: g(c.value["dct:publisher"], "foaf:name"),
72
+ publisherMail: g(c.value["dct:publisher"], "foaf:mbox"),
73
+ publisherWebsite: g(c.value["dct:publisher"], "foaf:homepage"),
74
+ contactPointName: g(c.value["dcat:contactPoint"], "vcard:fn"),
75
+ contactPointMail: g(c.value["dcat:contactPoint"], "vcard:hasEmail"),
76
+ contactPointPhone: g(c.value["dcat:contactPoint"], "vcard:hasTelephone")
77
+ }), O = (e, t, i, r) => {
78
+ e[t] || (e[t] = []);
79
+ const v = e[t].find((P) => P["@language"] === r);
80
+ v ? v["@value"] = i : e[t].push({ "@value": i, "@language": r });
81
+ }, Z = () => {
82
+ if (H()) {
83
+ if (a.activeSection === "essentials") {
84
+ const e = h.value.BasicInfos || {}, t = JSON.parse(JSON.stringify(e));
85
+ O(t, "dct:title", s.value.title, "de"), O(t, "dct:description", s.value.description, "de"), t["dct:publisher"] = [{
86
+ "foaf:name": s.value.publisherName,
87
+ "foaf:mbox": s.value.publisherMail,
88
+ "foaf:homepage": s.value.publisherWebsite
89
+ }], t["dcat:contactPoint"] = [{
90
+ "vcard:fn": s.value.contactPointName,
91
+ "vcard:hasEmail": s.value.contactPointMail,
92
+ "vcard:hasTelephone": s.value.contactPointPhone
93
+ }], t["dct:modified"] = [{ "@value": s.value.modified }], h.value.BasicInfos = t;
94
+ }
95
+ w("close");
96
+ }
94
97
  };
95
- return (e, a) => {
96
- const i = b("findability"), r = b("coverage"), v = b("distributionRap"), B = b("additionals"), U = b("interaction");
97
- return o(), f("div", ce, [
98
- m("div", re, [
99
- m("div", de, [
100
- m("div", ue, [
101
- w.value ? (o(), f("div", ve, P(w.value), 1)) : d("", !0),
102
- m("div", fe, [
103
- s(Y, {
104
- onClick: H,
98
+ return (e, t) => {
99
+ const i = S("findability"), r = S("coverage"), v = S("distributionRap"), P = S("additionals"), G = S("interaction");
100
+ return o(), m("div", ue, [
101
+ p("div", de, [
102
+ p("div", ve, [
103
+ p("div", fe, [
104
+ E.value ? (o(), m("div", me, R(E.value), 1)) : u("", !0),
105
+ p("div", pe, [
106
+ l(te, {
107
+ onClick: N,
105
108
  class: "dpiV3_closeButton",
106
109
  type: "default"
107
110
  })
108
111
  ])
109
112
  ]),
110
- m("div", me, [
111
- t.activeSection === "findabilityHvd" ? (o(), f("span", pe, P(e.$t("message.metadata.categories")), 1)) : d("", !0),
112
- t.activeSection === "findabilityHvd" ? (o(), S(i, {
113
+ p("div", _e, [
114
+ a.activeSection === "findabilityHvd" ? (o(), m("span", ge, R(e.$t("message.metadata.categories")), 1)) : u("", !0),
115
+ a.activeSection === "findabilityHvd" ? (o(), V(i, {
113
116
  key: 1,
114
117
  class: "findability-container"
115
118
  }, {
116
- default: V(() => [
117
- s(ee, {
118
- context: u.context,
119
+ default: x(() => [
120
+ l(ae, {
121
+ context: d.context,
119
122
  ref_key: "findabilityChipsRef",
120
- ref: A
123
+ ref: D
121
124
  }, null, 8, ["context"]),
122
- s(te, { context: u.context }, null, 8, ["context"])
125
+ l(ie, { context: d.context }, null, 8, ["context"])
123
126
  ]),
124
127
  _: 1
125
- })) : d("", !0),
126
- t.activeSection === "essentials" ? (o(), f("div", _e, [
127
- s(ae, {
128
- context: u.context,
129
- newValues: M(C),
130
- modelValue: n.value,
131
- "onUpdate:modelValue": a[0] || (a[0] = (x) => n.value = x),
128
+ })) : u("", !0),
129
+ a.activeSection === "essentials" ? (o(), m("div", he, [
130
+ l(oe, {
131
+ context: d.context,
132
+ newValues: C(B),
133
+ modelValue: s.value,
134
+ "onUpdate:modelValue": t[0] || (t[0] = (M) => s.value = M),
132
135
  ref_key: "essentialsModalRef",
133
- ref: p
136
+ ref: _
134
137
  }, null, 8, ["context", "newValues", "modelValue"])
135
- ])) : d("", !0),
136
- t.activeSection === "coverage" ? (o(), S(r, { key: 3 }, {
137
- default: V(() => [
138
- s(oe, {
139
- context: u.context,
140
- newValues: M(C),
138
+ ])) : u("", !0),
139
+ a.activeSection === "coverage" ? (o(), V(r, { key: 3 }, {
140
+ default: x(() => [
141
+ l(se, {
142
+ context: d.context,
143
+ newValues: C(B),
141
144
  ref_key: "coverageModalRef",
142
- ref: y
145
+ ref: b
143
146
  }, null, 8, ["context", "newValues"])
144
147
  ]),
145
148
  _: 1
146
- })) : d("", !0),
147
- t.activeSection === "distributions" ? (o(), S(v, { key: 4 }, {
148
- default: V(() => [
149
- s(ie, {
150
- context: u.context,
151
- newValues: M(C)
149
+ })) : u("", !0),
150
+ a.activeSection === "distributions" ? (o(), V(v, { key: 4 }, {
151
+ default: x(() => [
152
+ l(ne, {
153
+ context: d.context,
154
+ newValues: C(B),
155
+ ref_key: "distributionModalRef",
156
+ ref: y
152
157
  }, null, 8, ["context", "newValues"])
153
158
  ]),
154
159
  _: 1
155
- })) : d("", !0),
156
- t.activeSection === "additionals" ? (o(), S(B, { key: 5 }, {
157
- default: V(() => [
158
- s(ne, {
159
- context: u.context,
160
- onCloseModal: T
160
+ })) : u("", !0),
161
+ a.activeSection === "additionals" ? (o(), V(P, { key: 5 }, {
162
+ default: x(() => [
163
+ l(le, {
164
+ context: d.context,
165
+ onCloseModal: W
161
166
  }, null, 8, ["context"])
162
167
  ]),
163
168
  _: 1
164
- })) : d("", !0),
165
- l.value && F.value.length > 0 ? (o(), f("div", ge, [
166
- s(M(X), {
169
+ })) : u("", !0),
170
+ n.value && T.value.length > 0 ? (o(), m("div", be, [
171
+ l(C(ee), {
167
172
  size: 16,
168
173
  weight: "fill"
169
174
  }),
170
- m("div", he, [
171
- (o(!0), f(Z, null, G(F.value, (x) => (o(), f("span", {
172
- key: x,
175
+ p("div", ye, [
176
+ (o(!0), m(Q, null, X(T.value, (M) => (o(), m("span", {
177
+ key: M,
173
178
  class: "copy-mini-regular"
174
- }, P(x), 1))), 128))
179
+ }, R(M), 1))), 128))
175
180
  ])
176
- ])) : d("", !0)
181
+ ])) : u("", !0)
177
182
  ])
178
183
  ]),
179
- t.activeSection != "additionals" ? (o(), S(U, {
184
+ a.activeSection != "additionals" ? (o(), V(G, {
180
185
  key: 0,
181
186
  class: "dpiV3_interactionWrap"
182
187
  }, {
183
- default: V(() => [
184
- m("div", ye, [
185
- s(z, {
186
- onClick: H,
188
+ default: x(() => [
189
+ p("div", Se, [
190
+ l($, {
191
+ onClick: N,
187
192
  buttonText: "Zurück",
188
193
  size: "large",
189
194
  iconStart: "CaretLeft",
190
195
  variant: "tertiary"
191
196
  }),
192
- s(z, {
193
- onClick: q,
197
+ l($, {
198
+ onClick: Z,
194
199
  buttonText: "Speichern",
195
200
  size: "large"
196
201
  })
197
202
  ])
198
203
  ]),
199
204
  _: 1
200
- })) : d("", !0)
205
+ })) : u("", !0)
201
206
  ])
202
207
  ]);
203
208
  };
204
209
  }
205
- }, Ne = /* @__PURE__ */ le(be, [["__scopeId", "data-v-cc6239a1"]]);
210
+ }, ze = /* @__PURE__ */ re(Ve, [["__scopeId", "data-v-7bf8e6a8"]]);
206
211
  export {
207
- Ne as default
212
+ ze as default
208
213
  };
@@ -1,42 +1,59 @@
1
- import { ref as e, getCurrentInstance as i, watch as u, onMounted as m, resolveComponent as f, createElementBlock as d, openBlock as v, createVNode as n, withCtx as _ } from "vue";
2
- import { getLicenses as b } from "../../services/dpiV3_apis.js";
3
- import g from "../../../components/DistributionSimplePage.vue.js";
1
+ import { ref as i, getCurrentInstance as d, watch as h, onMounted as v, computed as _, resolveComponent as V, createElementBlock as x, openBlock as D, createVNode as r, withCtx as M } from "vue";
2
+ import { getLicenses as y } from "../../services/dpiV3_apis.js";
3
+ import R from "../../../components/DistributionSimplePage.vue.js";
4
4
  import "@formkit/core";
5
- import { useFormValues as h } from "../../../composables/useDpiFormValues.js";
6
- const x = { class: "dpiV3_innerRapModalWrapper" }, O = {
5
+ import { useFormValues as A } from "../../../composables/useDpiFormValues.js";
6
+ const C = { class: "dpiV3_innerRapModalWrapper" }, E = {
7
7
  __name: "DistributionModal",
8
8
  props: {
9
9
  context: Object,
10
10
  newValues: Object
11
11
  },
12
- setup(c) {
13
- e(), e(""), e([]), i().appContext.app.config.globalProperties.$env;
14
- let l = e([]);
15
- const { formValues: a } = h();
16
- return e(""), e(!1), e({ 1: !1, 2: !1 }), e([
12
+ setup(m, { expose: f }) {
13
+ i(), i(""), i([]), d().appContext.app.config.globalProperties.$env;
14
+ let a = i([]);
15
+ const { formValues: o } = A();
16
+ i(""), i(!1), i({ 1: !1, 2: !1 }), i([
17
17
  { isValid: "unset", "dcterms:license": "", title: "", uri: "" }
18
- ]), e(!1), u(a.value.DistributionSimple.length, (r) => {
19
- a.value.DistributionSimple.length > 1 && console.log("halo"), console.log("halo Outer");
20
- }), m(async () => {
21
- const s = i().appContext.app.config.globalProperties.$env;
18
+ ]), i(!1), h(o.value.DistributionSimple.length, (e) => {
19
+ o.value.DistributionSimple.length > 1 && console.log("halo"), console.log("halo Outer");
20
+ }), v(async () => {
21
+ const s = d().appContext.app.config.globalProperties.$env;
22
22
  try {
23
- const t = await b(s.api.baseUrl);
24
- l.value = t.map((o) => ({
25
- "@value": o.value,
26
- label: o.label,
27
- uri: o.uri
28
- })), l.value.sort((o, p) => o["@value"].localeCompare(p["@value"]));
23
+ const t = await y(s.api.baseUrl);
24
+ a.value = t.map((n) => ({
25
+ "@value": n.value,
26
+ label: n.label,
27
+ uri: n.uri
28
+ })), a.value.sort((n, l) => n["@value"].localeCompare(l["@value"]));
29
29
  } catch (t) {
30
30
  console.error("Failed to load licenses", t);
31
31
  }
32
- }), (r, s) => {
33
- const t = f("innerRapModalItem");
34
- return v(), d("div", x, [
35
- n(t),
36
- n(t, null, {
37
- default: _(() => [
38
- n(g, {
39
- context: c.context,
32
+ });
33
+ const g = _(() => {
34
+ var s, t;
35
+ const e = (t = (s = o.value) == null ? void 0 : s.DistributionSimple) == null ? void 0 : t["dcat:distribution"];
36
+ return !e || !Array.isArray(e) || e.length === 0 ? !1 : e.every((n) => n.isValid === !0);
37
+ });
38
+ return f({
39
+ isValid: g,
40
+ getValidationErrorMessages: () => {
41
+ var t, n;
42
+ const e = (n = (t = o.value) == null ? void 0 : t.DistributionSimple) == null ? void 0 : n["dcat:distribution"], s = [];
43
+ return !e || !Array.isArray(e) || e.length === 0 ? s.push("Bitte fügen Sie mindestens eine Distribution hinzu.") : e.some((b) => {
44
+ var u, p;
45
+ const c = (p = (u = b["dcat:accessURL"]) == null ? void 0 : u[0]) == null ? void 0 : p["@value"];
46
+ return !c || c.length === 0;
47
+ }) && s.push("Alle Distributionen müssen eine Zugriffs-URL (Access URL) haben."), s;
48
+ }
49
+ }), (e, s) => {
50
+ const t = V("innerRapModalItem");
51
+ return D(), x("div", C, [
52
+ r(t),
53
+ r(t, null, {
54
+ default: M(() => [
55
+ r(R, {
56
+ context: m.context,
40
57
  inRap: !0
41
58
  }, null, 8, ["context"])
42
59
  ]),
@@ -47,5 +64,5 @@ const x = { class: "dpiV3_innerRapModalWrapper" }, O = {
47
64
  }
48
65
  };
49
66
  export {
50
- O as default
67
+ E as default
51
68
  };
@@ -1,5 +1,5 @@
1
- import { ref as o, onMounted as V, createElementBlock as y, openBlock as p, Fragment as D, createElementVNode as v, createVNode as w, createBlock as _, toDisplayString as S, getCurrentInstance as k } from "vue";
2
- import C from "../SwitchV3.vue.js";
1
+ import { ref as s, onMounted as V, createElementBlock as _, openBlock as p, Fragment as y, createElementVNode as f, createVNode as D, createBlock as w, toDisplayString as S, getCurrentInstance as C } from "vue";
2
+ import k from "../SwitchV3.vue.js";
3
3
  import F from "../Dropdown.vue.js";
4
4
  import { getHvdCategories as H } from "../../services/dpiV3_apis.js";
5
5
  import { useFormValues as x } from "../../../composables/useDpiFormValues.js";
@@ -10,73 +10,75 @@ const I = { class: "dpiV3_findabilitySwitchWrapper" }, P = { class: "dpiV3_Switc
10
10
  context: Object
11
11
  },
12
12
  setup(T) {
13
- const { formValues: t } = x(), s = o(!1), c = o(0), r = o("");
14
- o([{ isValid: !0 }]);
15
- const i = o([]), f = o([]), b = (a) => {
16
- if (s.value = a, !a) {
17
- r.value = "";
18
- const e = t.value.Discoverability;
19
- e[Object.keys(e)[1]] = [{ isValid: !1 }], i.value.forEach((l) => l.selected = !1);
13
+ const { formValues: o } = x(), r = s(!1), u = s(0), d = s("");
14
+ s([{ isValid: !0 }]);
15
+ const i = s([]), v = s([]), b = (e) => {
16
+ if (r.value = e, !e) {
17
+ d.value = "";
18
+ const l = o.value.Discoverability;
19
+ l[Object.keys(l)[1]] = [{ isValid: !1 }], i.value.forEach((a) => a.selected = !1);
20
20
  }
21
21
  }, h = async () => {
22
22
  try {
23
- const a = k().appContext.app.config.globalProperties.$env, e = await H(a.api.baseUrl);
24
- f.value = e, i.value = e.map((l) => ({
25
- label: l.pref_label.de,
26
- uri: l.resource,
27
- "@value": l.pref_label.de,
23
+ const e = C().appContext.app.config.globalProperties.$env, a = (await H(e.api.baseUrl)).sort(
24
+ (t, n) => t.pref_label.de.localeCompare(n.pref_label.de, "de")
25
+ );
26
+ v.value = a, i.value = a.map((t) => ({
27
+ label: t.pref_label.de,
28
+ uri: t.resource,
29
+ "@value": t.pref_label.de,
28
30
  selected: !1
29
31
  })), m();
30
- } catch (a) {
31
- console.error("Error in component:", a);
32
+ } catch (e) {
33
+ console.error("Error in component:", e);
32
34
  }
33
35
  }, m = () => {
34
- var e, l, u;
35
- const a = (u = (l = (e = t.value) == null ? void 0 : e.Discoverability) == null ? void 0 : l.hvdPage) == null ? void 0 : u[0];
36
- if (a && a.isValid && a.label) {
37
- s.value = !0;
38
- const d = i.value.find(
39
- (n) => n.label === a.label || n.uri === a.uri
36
+ var l, a, t;
37
+ const e = (t = (a = (l = o.value) == null ? void 0 : l.Discoverability) == null ? void 0 : a.hvdPage) == null ? void 0 : t[0];
38
+ if (e && e.isValid && e.label) {
39
+ r.value = !0;
40
+ const n = i.value.find(
41
+ (c) => c.label === e.label || c.uri === e.uri
40
42
  );
41
- d && (i.value.forEach((n) => n.selected = !1), d.selected = !0, r.value = d.label), c.value++;
43
+ n && (i.value.forEach((c) => c.selected = !1), n.selected = !0, d.value = n.label), u.value++;
42
44
  }
43
- }, g = (a) => {
44
- const e = i.value.find(
45
- (l) => l.label === a.target.innerHTML
45
+ }, g = (e) => {
46
+ const l = i.value.find(
47
+ (a) => a.label === e.target.innerHTML
46
48
  );
47
- if (e) {
48
- t.value.DistributionSimple.hvdNotation === void 0 && (t.value.DistributionSimple.hvdNotation = {}), t.value.DistributionSimple.hvdNotation = {
49
- hvdUri: e.uri
50
- }, r.value = e.label;
51
- const l = t.value.Discoverability;
52
- l[Object.keys(l)[1]] = [
49
+ if (l) {
50
+ o.value.DistributionSimple.hvdNotation === void 0 && (o.value.DistributionSimple.hvdNotation = {}), o.value.DistributionSimple.hvdNotation = {
51
+ hvdUri: l.uri
52
+ }, d.value = l.label;
53
+ const a = o.value.Discoverability;
54
+ a[Object.keys(a)[1]] = [
53
55
  {
54
56
  isValid: !0,
55
- label: e.label,
56
- uri: e.uri
57
+ label: l.label,
58
+ uri: l.uri
57
59
  }
58
60
  ];
59
61
  }
60
62
  };
61
63
  return V(() => {
62
64
  h();
63
- }), (a, e) => (p(), y(D, null, [
64
- v("div", I, [
65
- (p(), _(C, {
65
+ }), (e, l) => (p(), _(y, null, [
66
+ f("div", I, [
67
+ (p(), w(k, {
66
68
  onSwitchToggled: b,
67
69
  hasIcon: !1,
68
- defaultChecked: s.value,
70
+ defaultChecked: r.value,
69
71
  disabled: !1,
70
- key: c.value
72
+ key: u.value
71
73
  }, null, 8, ["defaultChecked"])),
72
- v("div", P, S(a.$t("message.dataupload.datasets.hvdPage.switch-label")), 1)
74
+ f("div", P, S(e.$t("message.dataupload.datasets.hvdPage.switch-label")), 1)
73
75
  ]),
74
- w(F, {
76
+ D(F, {
75
77
  dropdownWidth: "large",
76
- isDisabled: !s.value,
78
+ isDisabled: !r.value,
77
79
  type: "inputField",
78
80
  inputFieldProps: {
79
- isDisabled: !s.value,
81
+ isDisabled: !r.value,
80
82
  addOnText: !1,
81
83
  initialHintText: !1,
82
84
  datePicker: !1,
@@ -88,8 +90,8 @@ const I = { class: "dpiV3_findabilitySwitchWrapper" }, P = { class: "dpiV3_Switc
88
90
  inputFieldSize: "large"
89
91
  },
90
92
  data: i.value,
91
- modelValue: r.value,
92
- onClick: e[0] || (e[0] = (l) => g(l))
93
+ modelValue: d.value,
94
+ onClick: l[0] || (l[0] = (a) => g(a))
93
95
  }, null, 8, ["isDisabled", "inputFieldProps", "data", "modelValue"])
94
96
  ], 64));
95
97
  }