@piveau/dpi 0.1.0-beta.61 → 0.1.0-beta.63

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,17 +1,17 @@
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";
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 c, toDisplayString as R, isRef as K } from "vue";
2
2
  import Q from "../Dropdown.vue.js";
3
3
  import X from "../TextAreaV3.vue.js";
4
- import R from "../ButtonV3.vue.js";
4
+ import $ from "../ButtonV3.vue.js";
5
5
  import Y from "../ModalSimpleV3.vue.js";
6
- import $ from "../InputField.vue.js";
6
+ import x 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 */
10
10
  import ae from "../../../../_virtual/_plugin-vue_export-helper.js";
11
- const le = { class: "dpiV3_LinkAndMetadata" }, ie = {
11
+ const ie = { class: "dpiV3_LinkAndMetadata" }, le = {
12
12
  key: 0,
13
13
  class: "dpiV3_errorMessage"
14
- }, oe = { class: "copy-mini-regular" }, se = {
14
+ }, se = { class: "copy-mini-regular" }, oe = {
15
15
  key: 1,
16
16
  class: "copy-mini-regular dpiV3_text_error"
17
17
  }, de = {
@@ -27,13 +27,13 @@ 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: A, emit: z }) {
31
- const { formValues: E } = te();
30
+ setup(r, { expose: A, emit: E }) {
31
+ const { formValues: z } = te();
32
32
  let p = f({});
33
- const i = r, y = z, d = f([...i.fileTypes]), P = f(!1), F = f(null), o = O({});
33
+ const l = r, y = E, d = f([...l.fileTypes]), P = f(!1), F = f(null), s = O({});
34
34
  let U = f(!1);
35
35
  Z(() => {
36
- i.documentations.length === 0 && y("update", [
36
+ l.documentations.length === 0 && y("update", [
37
37
  {
38
38
  id: 1,
39
39
  "dcat:accessURL": "",
@@ -46,22 +46,22 @@ const le = { class: "dpiV3_LinkAndMetadata" }, ie = {
46
46
  });
47
47
  const D = (e) => {
48
48
  if (!e || e.trim() === "") return !1;
49
- const l = e.trim();
50
- return /\.[a-zA-Z]{2,}$/.test(l);
51
- }, C = (e) => {
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
- return l || t || a;
49
+ const i = e.trim();
50
+ return /\.[a-zA-Z]{2,}$/.test(i);
54
51
  }, S = (e) => {
55
- const l = i.documentations.find((t) => t.id === e);
56
- if (l) {
57
- const t = l["dcat:accessURL"], a = typeof t == "string" ? t.trim() : "";
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;
52
+ const i = 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
+ return i || t || a;
54
+ }, B = (e) => {
55
+ const i = l.documentations.find((t) => t.id === e);
56
+ if (i) {
57
+ const t = i["dcat:accessURL"], a = typeof t == "string" ? t.trim() : "";
58
+ S(i) ? a && D(a) ? s[e] = null : s[e] = "Bitte geben Sie eine gültige URL ein." : a && !D(a) ? s[e] = "Bitte geben Sie eine gültige URL ein." : s[e] = null;
59
59
  }
60
60
  }, w = () => {
61
61
  let e = !1;
62
- return i.documentations.forEach((l) => {
63
- const t = l["dcat:accessURL"], a = typeof t == "string" ? t.trim() : "";
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);
62
+ return l.documentations.forEach((i) => {
63
+ const t = i["dcat:accessURL"], a = typeof t == "string" ? t.trim() : "";
64
+ S(i) ? a && D(a) || (s[i.id] = "Bitte geben Sie eine gültige URL ein.", e = !0) : a && !D(a) && (s[i.id] = "Bitte geben Sie eine gültige URL ein.", e = !0);
65
65
  }), e;
66
66
  }, M = (e) => {
67
67
  switch (e) {
@@ -69,63 +69,63 @@ const le = { class: "dpiV3_LinkAndMetadata" }, ie = {
69
69
  N();
70
70
  break;
71
71
  }
72
- }, _ = (e, l, t = null) => {
73
- var n, s;
74
- d.value = [...i.fileTypes];
75
- const a = typeof e == "string" ? e.trim().toUpperCase() : (s = (n = e == null ? void 0 : e.target) == null ? void 0 : n.value) == null ? void 0 : s.trim().toUpperCase();
76
- a.length > 0 ? d.value = i.fileTypes.filter(
72
+ }, _ = (e, i, t = null) => {
73
+ var n, o;
74
+ d.value = [...l.fileTypes];
75
+ const a = typeof e == "string" ? e.trim().toUpperCase() : (o = (n = e == null ? void 0 : e.target) == null ? void 0 : n.value) == null ? void 0 : o.trim().toUpperCase();
76
+ a.length > 0 ? d.value = l.fileTypes.filter(
77
77
  (T) => T["@value"].toUpperCase().startsWith(a)
78
- ) : d.value = [...i.fileTypes];
78
+ ) : d.value = [...l.fileTypes];
79
79
  }, W = () => {
80
80
  if (w())
81
81
  return;
82
- const l = {
83
- id: (i.documentations.length ? Math.max(...i.documentations.map((t) => t.id)) : 0) + 1,
82
+ const i = {
83
+ id: (l.documentations.length ? Math.max(...l.documentations.map((t) => t.id)) : 0) + 1,
84
84
  "dcat:accessURL": "",
85
85
  "dct:format": "",
86
86
  "dct:title": "",
87
87
  "dct:description": "",
88
88
  "formatUri:": ""
89
89
  };
90
- y("update", [...i.documentations, l]);
91
- }, q = (e, l) => {
92
- d.value = [...i.fileTypes];
90
+ y("update", [...l.documentations, i]);
91
+ }, q = (e, i) => {
92
+ d.value = [...l.fileTypes];
93
93
  const t = d.value.find(
94
- (s) => s["@value"] === e
94
+ (o) => o["@value"] === e
95
95
  ), a = f(
96
- E.value.DistributionSimple["dcat:distribution"].find(
97
- (s) => s.id === i.distributionId
96
+ z.value.DistributionSimple["dcat:distribution"].find(
97
+ (o) => o.id === l.distributionId
98
98
  )
99
99
  ), n = f(
100
- a.value.documentations.find((s) => s.id === l)
100
+ a.value.documentations.find((o) => o.id === i)
101
101
  );
102
- n.value === void 0 || (n.value.formatUri = t.uri), v(e, "dct:format", l);
103
- }, v = (e, l, t) => {
104
- var n, s, T;
102
+ n.value === void 0 || (n.value.formatUri = t.uri), v(e, "dct:format", i);
103
+ }, v = (e, i, t) => {
104
+ var n, o, T;
105
105
  let a = "";
106
- if (l === "dcat:accessURL") {
107
- const c = typeof e == "string" ? e : ((n = e == null ? void 0 : e.target) == null ? void 0 : n.value) ?? "";
108
- a = i.documentations.map(
109
- (b) => b.id === t ? { ...b, [l]: c } : b
106
+ if (i === "dcat:accessURL") {
107
+ const u = typeof e == "string" ? e : ((n = e == null ? void 0 : e.target) == null ? void 0 : n.value) ?? "";
108
+ a = l.documentations.map(
109
+ (b) => b.id === t ? { ...b, [i]: u } : b
110
110
  );
111
- } else if (l === "dct:format") {
112
- d.value = [...i.fileTypes];
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
- ) : d.value = [...i.fileTypes];
111
+ } else if (i === "dct:format") {
112
+ d.value = [...l.fileTypes];
113
+ const u = typeof e == "string" ? e.trim().toUpperCase() : (T = (o = e == null ? void 0 : e.target) == null ? void 0 : o.value) == null ? void 0 : T.trim().toUpperCase();
114
+ u.length > 0 ? d.value = l.fileTypes.filter(
115
+ (m) => m["@value"].toUpperCase().startsWith(u)
116
+ ) : d.value = [...l.fileTypes];
117
117
  const b = d.value.find(
118
118
  (m) => m["@value"] === e
119
119
  );
120
- a = i.documentations.map(
121
- (m) => m.id === t ? { ...m, [l]: b["@value"], formatUri: b.uri } : m
120
+ a = l.documentations.map(
121
+ (m) => m.id === t ? { ...m, [i]: b["@value"], formatUri: b.uri } : m
122
122
  );
123
123
  } else
124
- a = i.documentations.map(
125
- (c) => c.id === t ? { ...c, [l]: e.target.value } : c
124
+ a = l.documentations.map(
125
+ (u) => u.id === t ? { ...u, [i]: e.target.value } : u
126
126
  );
127
127
  y("update", a), setTimeout(() => {
128
- S(t);
128
+ B(t);
129
129
  }, 0);
130
130
  }, H = (e) => {
131
131
  p.value = {
@@ -137,37 +137,37 @@ 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
- const e = i.documentations.filter(
141
- (l) => l.id !== F.value.id
140
+ const e = l.documentations.filter(
141
+ (i) => i.id !== F.value.id
142
142
  );
143
- delete o[F.value.id], y("update", e);
144
- }, B = (e, l) => {
143
+ delete s[F.value.id], y("update", e);
144
+ }, C = (e, i) => {
145
145
  switch (e) {
146
146
  case "dct:description":
147
- l["dct:description"] = "";
147
+ i["dct:description"] = "";
148
148
  break;
149
149
  case "dct:title":
150
- l["dct:title"] = "";
150
+ i["dct:title"] = "";
151
151
  break;
152
152
  case "dct:format":
153
- l["dct:format"] = "";
153
+ i["dct:format"] = "";
154
154
  break;
155
155
  }
156
156
  setTimeout(() => {
157
- S(l.id);
157
+ B(i.id);
158
158
  }, 0);
159
159
  };
160
160
  return A({
161
161
  validateAllItems: w
162
- }), (e, l) => (g(), V("div", {
162
+ }), (e, i) => (g(), V("div", {
163
163
  class: L(["dpiV3_documentationsWrap", { dpiV3_docAllAsCard: r.asCard }])
164
164
  }, [
165
165
  (g(!0), V(G, null, J(r.documentations, (t) => (g(), V("div", {
166
166
  key: t.id,
167
167
  class: L(["dpiV3AutoCompleteWrap", { dpiV3_docAsCard: r.asCard }])
168
168
  }, [
169
- I("div", le, [
170
- h($, {
169
+ I("div", ie, [
170
+ h(x, {
171
171
  onInput: (a) => v(a, "dcat:accessURL", t.id),
172
172
  addOnText: !1,
173
173
  datePicker: !1,
@@ -185,14 +185,14 @@ const le = { class: "dpiV3_LinkAndMetadata" }, ie = {
185
185
  modelValue: t["dcat:accessURL"],
186
186
  "onUpdate:modelValue": (a) => t["dcat:accessURL"] = a
187
187
  }, null, 8, ["onInput", "placeholder", "label", "modelValue", "onUpdate:modelValue"]),
188
- o[t.id] ? (g(), V("div", ie, [
189
- h(u(ee), {
188
+ s[t.id] ? (g(), V("div", le, [
189
+ h(c(ee), {
190
190
  size: 16,
191
191
  weight: "fill"
192
192
  }),
193
- I("span", oe, x(o[t.id]), 1)
193
+ I("span", se, R(s[t.id]), 1)
194
194
  ])) : k("", !0),
195
- h($, {
195
+ h(x, {
196
196
  onInput: (a) => v(a, "dct:title", t.id),
197
197
  addOnText: !1,
198
198
  datePicker: !1,
@@ -210,7 +210,7 @@ const le = { class: "dpiV3_LinkAndMetadata" }, ie = {
210
210
  modelValue: t["dct:title"],
211
211
  "onUpdate:modelValue": (a) => t["dct:title"] = a,
212
212
  defaultInput: !r.showDeleteButton,
213
- onDeleteButtonClicked: (a) => B("dct:title", t)
213
+ onDeleteButtonClicked: (a) => C("dct:title", t)
214
214
  }, null, 8, ["onInput", "placeholder", "label", "modelValue", "onUpdate:modelValue", "defaultInput", "onDeleteButtonClicked"]),
215
215
  h(X, {
216
216
  onInput: (a) => v(a, "dct:description", t.id),
@@ -224,11 +224,11 @@ const le = { class: "dpiV3_LinkAndMetadata" }, ie = {
224
224
  modelValue: t["dct:description"],
225
225
  "onUpdate:modelValue": (a) => t["dct:description"] = a,
226
226
  showDeleteButton: r.showDeleteButton,
227
- onDeleteClicked: (a) => B("dct:description", t)
227
+ onDeleteClicked: (a) => C("dct:description", t)
228
228
  }, null, 8, ["onInput", "label", "placeholder", "modelValue", "onUpdate:modelValue", "showDeleteButton", "onDeleteClicked"]),
229
229
  h(Q, {
230
230
  "onUpdate:modelValue": [(a) => q(a, t.id), (a) => t["dct:format"] = a],
231
- onInput: l[0] || (l[0] = (a) => _(a)),
231
+ onInput: i[0] || (i[0] = (a) => _(a)),
232
232
  dropdownWidth: "large",
233
233
  type: "inputField",
234
234
  modelValue: t["dct:format"],
@@ -251,13 +251,13 @@ const le = { class: "dpiV3_LinkAndMetadata" }, ie = {
251
251
  },
252
252
  data: d.value,
253
253
  autocomplete: !0,
254
- onDeleteDropdownField: (a) => B("dct:format", t)
254
+ onDeleteDropdownField: (a) => C("dct:format", t)
255
255
  }, null, 8, ["onUpdate:modelValue", "modelValue", "inputFieldProps", "data", "onDeleteDropdownField"]),
256
- P.value && r.documentations.length === 1 ? (g(), V("p", se, x(e.$t(
256
+ P.value && r.documentations.length === 1 ? (g(), V("p", oe, R(e.$t(
257
257
  "message.dataupload.datasets.dcat:distribution.advanced.documentation.error-message"
258
258
  )), 1)) : k("", !0)
259
259
  ]),
260
- h(R, {
260
+ h($, {
261
261
  class: "dpiV3_tempAddMore",
262
262
  buttonText: e.$t(
263
263
  "message.dataupload.datasets.dcat:distribution.advanced.documentation.delete"
@@ -269,7 +269,7 @@ const le = { class: "dpiV3_LinkAndMetadata" }, ie = {
269
269
  }, null, 8, ["buttonText", "onClick"])
270
270
  ], 2))), 128)),
271
271
  r.asCard ? k("", !0) : (g(), V("div", de, [
272
- h(R, {
272
+ h($, {
273
273
  buttonText: e.$t(
274
274
  "message.dataupload.datasets.dcat:distribution.advanced.documentation.add-another"
275
275
  ),
@@ -279,20 +279,20 @@ const le = { class: "dpiV3_LinkAndMetadata" }, ie = {
279
279
  onClick: W
280
280
  }, null, 8, ["buttonText"])
281
281
  ])),
282
- u(U) ? (g(), j(Y, {
282
+ c(U) ? (g(), j(Y, {
283
283
  key: 1,
284
- buttons: u(p).button,
285
- headerText: u(p).header,
286
- text: u(p).text,
287
- onClose: l[1] || (l[1] = (t) => K(U) ? U.value = !1 : U = !1),
288
- action: u(p).action,
289
- onActionHandling: l[2] || (l[2] = (t) => M(t)),
290
- optionalString_1: u(p).optionalString_1,
291
- optionalString_2: u(p).optionalString_2
284
+ buttons: c(p).button,
285
+ headerText: c(p).header,
286
+ text: c(p).text,
287
+ onClose: i[1] || (i[1] = (t) => K(U) ? U.value = !1 : U = !1),
288
+ action: c(p).action,
289
+ onActionHandling: i[2] || (i[2] = (t) => M(t)),
290
+ optionalString_1: c(p).optionalString_1,
291
+ optionalString_2: c(p).optionalString_2
292
292
  }, null, 8, ["buttons", "headerText", "text", "action", "optionalString_1", "optionalString_2"])) : k("", !0)
293
293
  ], 2));
294
294
  }
295
- }, Ue = /* @__PURE__ */ ae(ne, [["__scopeId", "data-v-cf202935"]]);
295
+ }, Ue = /* @__PURE__ */ ae(ne, [["__scopeId", "data-v-eb7428a6"]]);
296
296
  export {
297
297
  Ue as default
298
298
  };