@piveau/dpi 0.2.0-alpha.73 → 0.2.0-alpha.74

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 z, watch as h, createElementBlock as g, openBlock as c, Fragment as w, createCommentVNode as V, renderList as W, unref as r, normalizeClass as $, createVNode as k, createBlock as A } from "vue";
1
+ import { ref as d, getCurrentInstance as _, onMounted as $, computed as P, watch as h, createElementBlock as g, openBlock as c, Fragment as w, createCommentVNode as V, renderList as z, unref as i, normalizeClass as W, createVNode as k, 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";
@@ -18,53 +18,53 @@ const Q = {
18
18
  inOverview: { type: Boolean, default: !1 }
19
19
  },
20
20
  emits: ["addLanguage", "deleteButtonClicked"],
21
- setup(v, { emit: y }) {
22
- const u = v;
23
- let t = d([{ label: "", "@value": "", uri: "" }]), o = {};
24
- const { formValues: C } = H(), { t: f } = E(), B = () => {
25
- t.value.push({});
21
+ setup(f, { emit: y }) {
22
+ const u = f;
23
+ let l = d([{ label: "", "@value": "", uri: "" }]), o = {};
24
+ const { formValues: C } = H(), { t: m } = E(), B = () => {
25
+ l.value.push({});
26
26
  }, b = _(), L = b.appContext.app.config.globalProperties.$env, I = b.appContext.app.config.globalProperties.$i18n.locale;
27
27
  let p = d([]);
28
28
  o = C.value.DistributionSimple["dcat:distribution"].find(
29
29
  (e) => e.id === u.distributionId
30
- ) || {}, P(async () => {
30
+ ) || {}, $(async () => {
31
31
  var e;
32
- o["dct:language"].length > 0 && (t.value = o["dct:language"]), p.value = (e = o["dct:language"]) == null ? void 0 : e.map((l) => l.label);
32
+ o["dct:language"].length > 0 && (l.value = o["dct:language"]), p.value = (e = o["dct:language"]) == null ? void 0 : e.map((a) => (a == null ? void 0 : a["@value"]) || (a == null ? void 0 : a.label) || "");
33
33
  try {
34
- const l = await N(L.api.baseUrl, I);
35
- s.value = l.map((a) => ({
36
- "@value": a.label,
37
- label: a.label,
38
- uri: a.uri
34
+ const a = await N(L.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 (l) {
41
- console.error("Failed to load language data", l);
40
+ } catch (a) {
41
+ console.error("Failed to load language data", a);
42
42
  }
43
43
  });
44
44
  const s = d([]);
45
45
  let O = d(p);
46
46
  console.log("Titelliste", O);
47
- const F = y, T = (e, l) => {
48
- t.value.length > 1 ? (t.value[l] = {
47
+ const F = y, T = (e, a) => {
48
+ l.value.length > 1 ? (l.value[a] = {
49
49
  "@value": e,
50
50
  label: e,
51
- uri: s.value.find((a) => a["@value"] === e).uri || ""
52
- }, console.log(o["dct:language"], t.value), o["dct:language"] = t.value, console.log(o["dct:language"], t.value)) : (t.value[0] = {
51
+ uri: s.value.find((t) => t["@value"] === e).uri || ""
52
+ }, console.log(o["dct:language"], l.value), o["dct:language"] = l.value, console.log(o["dct:language"], l.value)) : (l.value[0] = {
53
53
  "@value": e,
54
- uri: s.value.find((a) => a["@value"] === e).uri || ""
55
- }, o["dct:language"][0] = t.value[0], s.value.find((a) => a["@value"] === e).uri);
56
- }, m = d(""), x = (e) => {
57
- m.value = e, console.log(m);
58
- }, D = z(() => s.value.filter(
54
+ uri: s.value.find((t) => t["@value"] === e).uri || ""
55
+ }, o["dct:language"][0] = l.value[0], s.value.find((t) => t["@value"] === e).uri);
56
+ }, v = d(""), x = (e) => {
57
+ v.value = e, console.log(v);
58
+ }, D = P(() => s.value.filter(
59
59
  (e) => {
60
- var l, a, n, i;
61
- return (i = (l = e["@value"]) == null ? void 0 : l.toLowerCase()) == null ? void 0 : i.trim().startsWith((n = (a = m.value) == null ? void 0 : a.toLowerCase()) == null ? void 0 : n.trim());
60
+ var a, t, n, r;
61
+ return (r = (a = e["@value"]) == null ? void 0 : a.toLowerCase()) == null ? void 0 : r.trim().startsWith((n = (t = v.value) == null ? void 0 : t.toLowerCase()) == null ? void 0 : n.trim());
62
62
  }
63
63
  ));
64
64
  h(
65
65
  () => o["dct:language"],
66
66
  (e) => {
67
- t.value = o["dct:language"];
67
+ l.value = o["dct:language"];
68
68
  },
69
69
  { deep: !0 }
70
70
  ), h(
@@ -76,35 +76,35 @@ const Q = {
76
76
  const S = () => {
77
77
  console.log("delete clicked"), F("deleteButtonClicked", u.distributionId);
78
78
  };
79
- return (e, l) => (c(), g(w, null, [
80
- (c(!0), g(w, null, W(r(t), (a, n) => (c(), g("div", {
81
- class: $([{
79
+ return (e, a) => (c(), g(w, null, [
80
+ (c(!0), g(w, null, z(i(l), (t, n) => (c(), g("div", {
81
+ class: W([{
82
82
  repeatableOuter: !u.inOverview,
83
83
  dpiV3AutoCompleteWrap: !u.inOverview
84
84
  }, "langDropdown"]),
85
- key: n
85
+ key: `${n}@${t.uri}`
86
86
  }, [
87
87
  k(U, {
88
- "onUpdate:modelValue": [(i) => T(i, n), (i) => r(t)[n].label = i],
88
+ "onUpdate:modelValue": [(r) => T(r, n), (r) => i(l)[n].label = r],
89
89
  dropdownWidth: "large",
90
90
  type: "inputField",
91
- modelValue: r(t)[n].label,
91
+ modelValue: i(l)[n].label,
92
92
  inputFieldProps: {
93
93
  addOnText: !1,
94
94
  initialHintText: !1,
95
95
  datePicker: !1,
96
96
  infoIcon: !1,
97
97
  preIcon: !1,
98
- label: r(f)(
98
+ label: i(m)(
99
99
  "message.dataupload.datasets.dcat:distribution.advanced.dct:language"
100
100
  ) + " (optional)",
101
101
  dropdown_dpiV3: !0,
102
- placeholder: r(f)(
102
+ placeholder: i(m)(
103
103
  "message.dataupload.datasets.dcat:distribution.advanced.language-placeholder"
104
104
  ),
105
105
  inputFieldSize: "large",
106
- modelValue: r(p)[n],
107
- defaultInput: !v.showDeleteButton
106
+ modelValue: i(p)[n],
107
+ defaultInput: !f.showDeleteButton
108
108
  },
109
109
  data: D.value,
110
110
  onDeleteDropdownField: S,
@@ -115,7 +115,7 @@ const Q = {
115
115
  "button-text": "Löschen",
116
116
  class: "rightAlign",
117
117
  iconStart: "trash",
118
- onClick: (i) => r(t).splice(n, 1)
118
+ onClick: (r) => i(l).splice(n, 1)
119
119
  }, null, 8, ["onClick"]))
120
120
  ], 2))), 128)),
121
121
  u.inOverview ? V("", !0) : (c(), g("div", Q, [
@@ -125,7 +125,7 @@ const Q = {
125
125
  iconStart: "plus",
126
126
  variant: "tertiary",
127
127
  class: "mt-3",
128
- onClick: l[0] || (l[0] = (a) => B())
128
+ onClick: a[0] || (a[0] = (t) => B())
129
129
  })
130
130
  ]))
131
131
  ], 64));