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

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.
@@ -1,4 +1,4 @@
1
- import { ref as d, getCurrentInstance as _, onMounted as P, computed as S, watch as z, createElementBlock as g, openBlock as c, Fragment as w, createCommentVNode as h, renderList as W, unref as r, normalizeClass as $, createVNode as V, createBlock as A } from "vue";
1
+ import { ref as d, getCurrentInstance as _, onMounted as P, computed as S, watch as z, createElementBlock as g, openBlock as c, Fragment as h, createCommentVNode as w, renderList as W, unref as r, normalizeClass as $, createVNode as V, createBlock as A } from "vue";
2
2
  import { getLanguages as N } from "../../services/dpiV3_apis.js";
3
3
  import U from "../Dropdown.vue.js";
4
4
  import q from "../ButtonV3.vue.js";
@@ -19,68 +19,68 @@ const Q = {
19
19
  },
20
20
  emits: ["addLanguage", "deleteButtonClicked"],
21
21
  setup(v, { emit: C }) {
22
- const i = v;
22
+ const n = v;
23
23
  let l = d([{ label: "", "@value": "", uri: "" }]), u = {};
24
24
  const { formValues: k } = H(), { t: f } = E(), y = () => {
25
25
  l.value.push({});
26
26
  }, b = _(), B = b.appContext.app.config.globalProperties.$env, I = b.appContext.app.config.globalProperties.$i18n.locale;
27
27
  let p = d([]);
28
28
  u = k.value.DistributionSimple["dcat:distribution"].find(
29
- (e) => e.id === i.distributionId
29
+ (e) => e.id === n.distributionId
30
30
  ) || {}, P(async () => {
31
- var e, n, a;
32
- ((n = (e = u["dct:language"]) == null ? void 0 : e[0]) == null ? void 0 : n.label) !== "" && (l.value = u["dct:language"]), p.value = (a = u["dct:language"]) == null ? void 0 : a.map((t) => t.label);
31
+ var e;
32
+ u["dct:language"].length > 0 && (l.value = u["dct:language"]), p.value = (e = u["dct:language"]) == null ? void 0 : e.map((a) => a.label);
33
33
  try {
34
- const t = await N(B.api.baseUrl, I);
35
- s.value = t.map((o) => ({
36
- "@value": o.label,
37
- label: o.label,
38
- uri: o.uri
34
+ const a = await N(B.api.baseUrl, I);
35
+ s.value = a.map((t) => ({
36
+ "@value": t.label,
37
+ label: t.label,
38
+ uri: t.uri
39
39
  }));
40
- } catch (t) {
41
- console.error("Failed to load language data", t);
40
+ } catch (a) {
41
+ console.error("Failed to load language data", a);
42
42
  }
43
43
  });
44
44
  const s = d([]);
45
45
  let L = d(p);
46
46
  console.log("Titelliste", L);
47
- const O = C, F = (e, n) => {
48
- l.value.length > 1 ? (l.value[n] = {
47
+ const O = C, F = (e, a) => {
48
+ l.value.length > 1 ? (l.value[a] = {
49
49
  label: e,
50
- uri: s.value.find((a) => a["@value"] === e).uri || ""
50
+ uri: s.value.find((t) => t["@value"] === e).uri || ""
51
51
  }, u["dct:language"] = l.value) : (l.value[0] = {
52
52
  "@value": e,
53
- uri: s.value.find((a) => a["@value"] === e).uri || ""
54
- }, u["dct:language"][0] = l.value[0], s.value.find((a) => a["@value"] === e).uri);
53
+ uri: s.value.find((t) => t["@value"] === e).uri || ""
54
+ }, u["dct:language"][0] = l.value[0], s.value.find((t) => t["@value"] === e).uri);
55
55
  }, m = d(""), x = (e) => {
56
56
  m.value = e, console.log(m);
57
57
  }, T = S(() => s.value.filter(
58
58
  (e) => {
59
- var n, a, t, o;
60
- return (o = (n = e["@value"]) == null ? void 0 : n.toLowerCase()) == null ? void 0 : o.trim().startsWith((t = (a = m.value) == null ? void 0 : a.toLowerCase()) == null ? void 0 : t.trim());
59
+ var a, t, o, i;
60
+ return (i = (a = e["@value"]) == null ? void 0 : a.toLowerCase()) == null ? void 0 : i.trim().startsWith((o = (t = m.value) == null ? void 0 : t.toLowerCase()) == null ? void 0 : o.trim());
61
61
  }
62
62
  ));
63
63
  z(
64
- () => i.languageText,
64
+ () => n.languageText,
65
65
  (e) => {
66
66
  p.value = e;
67
67
  }
68
68
  );
69
69
  const D = () => {
70
- console.log("delete clicked"), O("deleteButtonClicked", i.distributionId);
70
+ console.log("delete clicked"), O("deleteButtonClicked", n.distributionId);
71
71
  };
72
- return (e, n) => (c(), g(w, null, [
73
- (c(!0), g(w, null, W(r(l), (a, t) => (c(), g("div", {
72
+ return (e, a) => (c(), g(h, null, [
73
+ (c(!0), g(h, null, W(r(l), (t, o) => (c(), g("div", {
74
74
  class: $([{
75
- repeatableOuter: !i.inOverview,
76
- dpiV3AutoCompleteWrap: !i.inOverview
75
+ repeatableOuter: !n.inOverview,
76
+ dpiV3AutoCompleteWrap: !n.inOverview
77
77
  }, "langDropdown"])
78
78
  }, [
79
79
  V(U, {
80
- "onUpdate:modelValue": [(o) => F(o, t), (o) => r(l)[t].label = o],
80
+ "onUpdate:modelValue": [(i) => F(i, o), (i) => r(l)[o].label = i],
81
81
  dropdownWidth: "large",
82
82
  type: "inputField",
83
- modelValue: r(l)[t].label,
83
+ modelValue: r(l)[o].label,
84
84
  inputFieldProps: {
85
85
  addOnText: !1,
86
86
  initialHintText: !1,
@@ -95,28 +95,28 @@ const Q = {
95
95
  "message.dataupload.datasets.dcat:distribution.advanced.language-placeholder"
96
96
  ),
97
97
  inputFieldSize: "large",
98
- modelValue: r(p)[t],
98
+ modelValue: r(p)[o],
99
99
  defaultInput: !v.showDeleteButton
100
100
  },
101
101
  data: T.value,
102
102
  onDeleteDropdownField: D,
103
103
  onInput: x
104
104
  }, null, 8, ["onUpdate:modelValue", "modelValue", "inputFieldProps", "data"]),
105
- i.inOverview ? h("", !0) : (c(), A(M, {
105
+ n.inOverview ? w("", !0) : (c(), A(M, {
106
106
  key: 0,
107
107
  "button-text": "löschen",
108
108
  class: "rightAlign",
109
- onClick: (o) => r(l).splice(t, 1)
109
+ onClick: (i) => r(l).splice(o, 1)
110
110
  }, null, 8, ["onClick"]))
111
111
  ], 2))), 256)),
112
- i.inOverview ? h("", !0) : (c(), g("div", Q, [
112
+ n.inOverview ? w("", !0) : (c(), g("div", Q, [
113
113
  V(q, {
114
114
  buttonText: "Weitere hinzufügen",
115
115
  size: "large",
116
116
  iconStart: "plus",
117
117
  variant: "tertiary",
118
118
  class: "mt-3",
119
- onClick: n[0] || (n[0] = (a) => y())
119
+ onClick: a[0] || (a[0] = (t) => y())
120
120
  })
121
121
  ]))
122
122
  ], 64));
@@ -1,6 +1,6 @@
1
1
  import { ref as d, onMounted as f, getCurrentInstance as v, watch as m, createBlock as S, openBlock as b } from "vue";
2
- import { getDatasetStatus as x } from "../../services/dpiV3_apis.js";
3
- import D from "../Dropdown.vue.js";
2
+ import { getDatasetStatus as g } from "../../services/dpiV3_apis.js";
3
+ import x from "../Dropdown.vue.js";
4
4
  const T = {
5
5
  __name: "StatusV3",
6
6
  props: {
@@ -9,41 +9,42 @@ const T = {
9
9
  statusText: { type: String, default: "" }
10
10
  },
11
11
  emits: ["addStatus", "deleteButtonClicked"],
12
- setup(s, { emit: i }) {
13
- const u = d([]);
12
+ setup(u, { emit: i }) {
13
+ const l = d([]);
14
14
  f(async () => {
15
15
  const t = v().appContext.app.config.globalProperties.$env;
16
16
  try {
17
- const e = await x(t.api.baseUrl);
18
- console.log(e), u.value = e.flatMap((l) => l.value === "OP_DATPRO" ? [] : l.value === "DEVELOP" ? [] : l.value === "DISCONT" ? [] : [{
19
- "@value": l.label,
20
- value: l.value,
17
+ const e = await g(t.api.baseUrl);
18
+ console.log(e), l.value = e.flatMap((o) => o.value === "OP_DATPRO" ? [] : o.value === "DEVELOP" ? [] : o.value === "DISCONT" ? [] : [{
19
+ "@value": o.label,
20
+ uri: o.resource,
21
21
  selected: !1
22
22
  }]);
23
23
  } catch (e) {
24
24
  console.error("Failed to load dataset status data:", e);
25
25
  }
26
26
  });
27
- const o = s, n = d(o.statusText), r = i, p = (a) => {
28
- r("addStatus", a, o.distributionId);
27
+ const n = u, s = d(n.statusText), r = i, p = (a) => {
28
+ const t = l.value.find((e) => e["@value"] === a);
29
+ console.log(t, l), r("addStatus", t, n.distributionId);
29
30
  };
30
31
  m(
31
- () => o.statusText,
32
+ () => n.statusText,
32
33
  (a) => {
33
- n.value = a;
34
+ s.value = a;
34
35
  }
35
36
  );
36
37
  const c = () => {
37
- r("deleteButtonClicked", o.distributionId);
38
+ r("deleteButtonClicked", n.distributionId);
38
39
  };
39
- return (a, t) => (b(), S(D, {
40
+ return (a, t) => (b(), S(x, {
40
41
  "onUpdate:modelValue": [
41
42
  t[0] || (t[0] = (e) => p(e)),
42
- t[1] || (t[1] = (e) => n.value = e)
43
+ t[1] || (t[1] = (e) => s.value = e)
43
44
  ],
44
45
  dropdownWidth: "large",
45
46
  type: "inputField",
46
- modelValue: n.value,
47
+ modelValue: s.value,
47
48
  inputFieldProps: {
48
49
  addOnText: !1,
49
50
  initialHintText: !1,
@@ -54,10 +55,10 @@ const T = {
54
55
  dropdown_dpiV3: !0,
55
56
  placeholder: "Geben Sie den Status ein...",
56
57
  inputFieldSize: "large",
57
- modelValue: n.value,
58
- defaultInput: !s.showDeleteButton
58
+ modelValue: s.value,
59
+ defaultInput: !u.showDeleteButton
59
60
  },
60
- data: u.value,
61
+ data: l.value,
61
62
  onDeleteDropdownField: c
62
63
  }, null, 8, ["modelValue", "inputFieldProps", "data"]));
63
64
  }
@@ -190,6 +190,7 @@ const Ce = {
190
190
  default: R(() => {
191
191
  var V, g, z, O, U, Q, X, D, x, _, ee, te, le, ae, ie, oe, ne;
192
192
  return [
193
+ I("details", null, T(t), 1),
193
194
  t.$formkit === "url" && e.item.name === "@id" ? (m(), d(A, {
194
195
  key: 0,
195
196
  label: t.label,