@piveau/dpi 0.2.0-alpha.66 → 0.2.0-alpha.67

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,11 +1,11 @@
1
- import { ref as m, computed as P, unref as f, watch as M, createElementBlock as r, openBlock as c, createElementVNode as s, createCommentVNode as g, toDisplayString as d, createVNode as u, Fragment as C, renderList as z } from "vue";
2
- import { PhWarning as _ } from "@phosphor-icons/vue";
1
+ import { ref as v, computed as T, unref as f, watch as M, createElementBlock as r, openBlock as d, createElementVNode as s, createCommentVNode as _, toDisplayString as c, createVNode as u, Fragment as C, renderList as D } from "vue";
2
+ import { PhWarning as b } from "@phosphor-icons/vue";
3
3
  import { useEditModeInfo as x } from "../composables/useDpiEditMode.js";
4
4
  import { useFormValues as q } from "../composables/useDpiFormValues.js";
5
5
  import { useOrganizationInfo as G } from "../composables/useOrganizationInfo.js";
6
6
  import { useTwinbyUser as H } from "../composables/useTwinbyUser.js";
7
- import T from "../HappyFlowComponents/ui/InputField.vue.js";
8
- import D from "../HappyFlowComponents/ui/TextButtonSmall.vue.js";
7
+ import V from "../HappyFlowComponents/ui/InputField.vue.js";
8
+ import S from "../HappyFlowComponents/ui/TextButtonSmall.vue.js";
9
9
  /* empty css */
10
10
  import J from "../../../../../_virtual/_plugin-vue_export-helper.js";
11
11
  const Q = { class: "dpiV3InnerComponentWrap" }, X = { class: "copy-large-regular" }, Y = { class: "dpiV3AutoCompleteWrap" }, Z = { class: "CardTips_internal" }, ee = { class: "CardTips_Part" }, ae = { class: "firstRow" }, te = { class: "icon_title copy-small-semi-bold" }, se = { class: "TextButton_small" }, le = { class: "secondRow" }, oe = {
@@ -14,10 +14,10 @@ const Q = { class: "dpiV3InnerComponentWrap" }, X = { class: "copy-large-regular
14
14
  }, ie = {
15
15
  key: 2,
16
16
  class: "copy-small-regular"
17
- }, ne = { class: "CardTips_Part" }, re = { class: "firstRow" }, ce = { class: "icon_title copy-small-semi-bold" }, de = { class: "TextButton_small" }, ue = { class: "secondRow" }, pe = { class: "input-container" }, me = {
17
+ }, ne = { class: "CardTips_Part" }, re = { class: "firstRow" }, de = { class: "icon_title copy-small-semi-bold" }, ce = { class: "TextButton_small" }, ue = { class: "secondRow" }, me = { class: "input-container" }, pe = {
18
18
  key: 0,
19
19
  class: "dpiV3_errormsgWrapper"
20
- }, fe = { class: "copy-mini-regular" }, ve = { class: "input-container" }, he = {
20
+ }, ve = { class: "copy-mini-regular" }, fe = { class: "input-container" }, he = {
21
21
  key: 0,
22
22
  class: "dpiV3_errormsgWrapper"
23
23
  }, ge = { class: "copy-mini-regular" }, _e = { class: "input-container" }, be = {
@@ -31,16 +31,16 @@ const Q = { class: "dpiV3InnerComponentWrap" }, X = { class: "copy-large-regular
31
31
  props: {
32
32
  context: Object
33
33
  },
34
- setup(S) {
35
- const v = S, { formValues: W } = q(), { isEditMode: F } = x(), { organization: O, authToken: R, startFetchPermissions: A } = H();
36
- A();
37
- const { resultEnhanced: L, isLoading: N, isFetching: U } = G({
38
- id: O,
39
- authToken: R
40
- }), b = m(null), w = m(null), y = P(() => {
34
+ setup(F) {
35
+ const h = F, { formValues: O } = q(), { isEditMode: R } = x(), { organization: W, authToken: A, startFetchPermissions: L } = H();
36
+ L();
37
+ const { organizationDisplay: p, isLoading: N, isFetching: U } = G({
38
+ id: W,
39
+ authToken: A
40
+ }), w = v(null), y = v(null), k = T(() => {
41
41
  var e, t;
42
42
  try {
43
- const a = (t = (e = W.value.BasicInfos) == null ? void 0 : e["dct:publisher"]) == null ? void 0 : t[0];
43
+ const a = (t = (e = O.value.BasicInfos) == null ? void 0 : e["dct:publisher"]) == null ? void 0 : t[0];
44
44
  if (a && a["foaf:name"] && a["foaf:mbox"])
45
45
  return [
46
46
  a["foaf:name"],
@@ -54,20 +54,10 @@ const Q = { class: "dpiV3InnerComponentWrap" }, X = { class: "copy-large-regular
54
54
  "",
55
55
  ""
56
56
  ];
57
- }), V = P(() => N.value || U.value), h = P(() => {
58
- var a;
59
- const e = (a = L.value) == null ? void 0 : a.publisher;
60
- if (!e)
61
- return {};
62
- const t = {
63
- organization: e.name || ""
64
- };
65
- if (e.email && (t.email = e.email), e.homepage) {
66
- const o = e.homepage.startsWith("http") ? e.homepage : `https://${e.homepage}`;
67
- t.website = o;
68
- }
69
- return t;
70
- }), l = m({
57
+ }), B = T(() => N.value || U.value), g = T(() => {
58
+ const e = {};
59
+ return p.value.title && (e.organization = p.value.title), p.value.email && (e.email = p.value.email), p.value.homepage && (e.website = p.value.homepage), e;
60
+ }), l = v({
71
61
  1: {
72
62
  show: !1,
73
63
  message: "Bitte geben Sie einen gültigen Organisationsnamen ein."
@@ -81,8 +71,8 @@ const Q = { class: "dpiV3InnerComponentWrap" }, X = { class: "copy-large-regular
81
71
  message: "Bitte geben Sie eine gültige Telefonnummer ein."
82
72
  }
83
73
  });
84
- let n = m({ 1: !1, 2: !1, 3: !1 });
85
- const i = m([
74
+ let n = v({ 1: !1, 2: !1, 3: !1 });
75
+ const o = v([
86
76
  {
87
77
  isValid: "unset",
88
78
  "vcard:fn": "",
@@ -90,14 +80,14 @@ const Q = { class: "dpiV3InnerComponentWrap" }, X = { class: "copy-large-regular
90
80
  "vcard:hasTelephone": ""
91
81
  }
92
82
  ]);
93
- F.value || v.context.node.input(i), v.context.node.value.length === 0 && v.context.node.input(f(i));
83
+ R.value || h.context.node.input(o), h.context.node.value.length === 0 && h.context.node.input(f(o));
94
84
  function E(e) {
95
85
  return e.trim().length >= 2;
96
86
  }
97
87
  function $(e) {
98
88
  return /^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(e);
99
89
  }
100
- function B(e) {
90
+ function z(e) {
101
91
  if (!e || e.trim() === "")
102
92
  return !0;
103
93
  const t = e.replace(/[\s\-().]/g, "");
@@ -106,8 +96,8 @@ const Q = { class: "dpiV3InnerComponentWrap" }, X = { class: "copy-large-regular
106
96
  const a = t.replace(/\D/g, "");
107
97
  return a.length >= 6 && a.length <= 15;
108
98
  }
109
- function k(e, t, a) {
110
- let o = !1;
99
+ function P(e, t, a) {
100
+ let i = !1;
111
101
  if (a === 3 && e.trim() === "")
112
102
  l.value[a].show = !1, n.value[a] = !0;
113
103
  else if (e.trim() === "")
@@ -115,37 +105,37 @@ const Q = { class: "dpiV3InnerComponentWrap" }, X = { class: "copy-large-regular
115
105
  else {
116
106
  switch (t) {
117
107
  case "vcard:fn":
118
- o = E(e);
108
+ i = E(e);
119
109
  break;
120
110
  case "vcard:hasEmail":
121
- o = $(e);
111
+ i = $(e);
122
112
  break;
123
113
  case "vcard:hasTelephone":
124
- o = B(e);
114
+ i = z(e);
125
115
  break;
126
116
  default:
127
- o = e.trim() !== "";
117
+ i = e.trim() !== "";
128
118
  }
129
- l.value[a].show = !o, n.value[a] = o;
119
+ l.value[a].show = !i, n.value[a] = i;
130
120
  }
131
- n.value[1] && n.value[2] ? i.value[0].isValid = !0 : i.value[0].isValid = "unset";
121
+ n.value[1] && n.value[2] ? o.value[0].isValid = !0 : o.value[0].isValid = "unset";
132
122
  }
133
- function p(e, t, a) {
134
- i.value = i.value.map((o) => t in o ? { ...o, [t]: e } : o), v.context.node.input(i.value), a === 2 ? (b.value && clearTimeout(b.value), b.value = setTimeout(() => {
135
- k(e, t, a);
136
- }, 800)) : a === 3 ? (w.value && clearTimeout(w.value), w.value = setTimeout(() => {
137
- k(e, t, a);
138
- }, 800)) : k(e, t, a);
123
+ function m(e, t, a) {
124
+ o.value = o.value.map((i) => t in i ? { ...i, [t]: e } : i), h.context.node.input(o.value), a === 2 ? (w.value && clearTimeout(w.value), w.value = setTimeout(() => {
125
+ P(e, t, a);
126
+ }, 800)) : a === 3 ? (y.value && clearTimeout(y.value), y.value = setTimeout(() => {
127
+ P(e, t, a);
128
+ }, 800)) : P(e, t, a);
139
129
  }
140
130
  function j() {
141
- const e = h.value;
142
- e.organization && p(e.organization, "vcard:fn", 1), e.email && p(e.email, "vcard:hasEmail", 2);
131
+ const e = g.value;
132
+ e.organization && m(e.organization, "vcard:fn", 1), e.email && m(e.email, "vcard:hasEmail", 2);
143
133
  }
144
134
  function I() {
145
- p(y.value[0], "vcard:fn", 1), p(y.value[1], "vcard:hasEmail", 2);
135
+ m(k.value[0], "vcard:fn", 1), m(k.value[1], "vcard:hasEmail", 2);
146
136
  }
147
137
  function K() {
148
- const e = i.value[0];
138
+ const e = o.value[0];
149
139
  if (e["vcard:fn"].trim() === "")
150
140
  l.value[1].show = !0, n.value[1] = !1;
151
141
  else {
@@ -161,46 +151,46 @@ const Q = { class: "dpiV3InnerComponentWrap" }, X = { class: "copy-large-regular
161
151
  if (e["vcard:hasTelephone"].trim() === "")
162
152
  l.value[3].show = !1, n.value[3] = !0;
163
153
  else {
164
- const t = B(e["vcard:hasTelephone"]);
154
+ const t = z(e["vcard:hasTelephone"]);
165
155
  l.value[3].show = !t, n.value[3] = t;
166
156
  }
167
- n.value[1] && n.value[2] ? i.value[0].isValid = !0 : i.value[0].isValid = !1;
157
+ n.value[1] && n.value[2] ? o.value[0].isValid = !0 : o.value[0].isValid = !1;
168
158
  }
169
- return M(() => i.value[0].isValid, (e) => {
159
+ return M(() => o.value[0].isValid, (e) => {
170
160
  e === !1 && K();
171
- }), (e, t) => (c(), r("div", Q, [
172
- s("h4", null, d(e.$t("message.dataupload.datasets.dcat:contactPoint.title")), 1),
173
- s("div", X, d(e.$t("message.dataupload.datasets.dcat:contactPoint.description")), 1),
161
+ }), (e, t) => (d(), r("div", Q, [
162
+ s("h4", null, c(e.$t("message.dataupload.datasets.dcat:contactPoint.title")), 1),
163
+ s("div", X, c(e.$t("message.dataupload.datasets.dcat:contactPoint.description")), 1),
174
164
  s("div", Y, [
175
165
  s("div", Z, [
176
166
  s("div", ee, [
177
167
  s("div", ae, [
178
- s("div", te, d(e.$t("message.dataupload.datasets.dcat:contactPoint.account")), 1),
168
+ s("div", te, c(e.$t("message.dataupload.datasets.dcat:contactPoint.account")), 1),
179
169
  s("div", se, [
180
- u(D, {
170
+ u(S, {
181
171
  "button-text": e.$t(
182
172
  "message.dataupload.datasets.dcat:contactPoint.useAccountButton"
183
173
  ),
184
174
  "icon-start": "DeleteBlue",
185
175
  "icon-name": "copy",
186
176
  class: "dpiV3_usedetailsButton",
187
- disabled: V.value || Object.keys(h.value).length === 0,
177
+ disabled: B.value || Object.keys(g.value).length === 0,
188
178
  onClick: j
189
179
  }, null, 8, ["button-text", "disabled"])
190
180
  ])
191
181
  ]),
192
182
  s("div", le, [
193
- V.value ? (c(), r("span", oe, "Lade Kontodaten...")) : Object.keys(h.value).length > 0 ? (c(!0), r(C, { key: 1 }, z(h.value, (a, o) => (c(), r("span", {
194
- key: o,
183
+ B.value ? (d(), r("span", oe, "Lade Kontodaten...")) : Object.keys(g.value).length > 0 ? (d(!0), r(C, { key: 1 }, D(g.value, (a, i) => (d(), r("span", {
184
+ key: i,
195
185
  class: "copy-small-regular"
196
- }, d(a), 1))), 128)) : (c(), r("span", ie, "Keine Kontodaten verfügbar"))
186
+ }, c(a), 1))), 128)) : (d(), r("span", ie, "Keine Kontodaten verfügbar"))
197
187
  ])
198
188
  ]),
199
189
  s("div", ne, [
200
190
  s("div", re, [
201
- s("div", ce, d(e.$t("message.metadata.publisher")), 1),
202
- s("div", de, [
203
- u(D, {
191
+ s("div", de, c(e.$t("message.metadata.publisher")), 1),
192
+ s("div", ce, [
193
+ u(S, {
204
194
  "button-text": e.$t(
205
195
  "message.dataupload.datasets.dcat:contactPoint.usePublisherButton"
206
196
  ),
@@ -212,17 +202,17 @@ const Q = { class: "dpiV3InnerComponentWrap" }, X = { class: "copy-large-regular
212
202
  ])
213
203
  ]),
214
204
  s("div", ue, [
215
- (c(!0), r(C, null, z(y.value, (a, o) => (c(), r("span", {
216
- key: o,
205
+ (d(!0), r(C, null, D(k.value, (a, i) => (d(), r("span", {
206
+ key: i,
217
207
  class: "copy-small-regular"
218
- }, d(a), 1))), 128))
208
+ }, c(a), 1))), 128))
219
209
  ])
220
210
  ])
221
211
  ])
222
212
  ]),
223
- s("div", pe, [
224
- u(T, {
225
- "model-value": i.value[0]["vcard:fn"],
213
+ s("div", me, [
214
+ u(V, {
215
+ "model-value": o.value[0]["vcard:fn"],
226
216
  "add-on-text": !1,
227
217
  "date-picker": !1,
228
218
  "info-icon": !1,
@@ -235,19 +225,19 @@ const Q = { class: "dpiV3InnerComponentWrap" }, X = { class: "copy-large-regular
235
225
  label: e.$t("message.dataupload.datasets.dcat:contactPoint.nameInput.title"),
236
226
  "show-end-icon": !1,
237
227
  "show-error": l.value[1].show,
238
- "onUpdate:modelValue": t[0] || (t[0] = (a) => p(a, "vcard:fn", 1))
228
+ "onUpdate:modelValue": t[0] || (t[0] = (a) => m(a, "vcard:fn", 1))
239
229
  }, null, 8, ["model-value", "placeholder", "label", "show-error"]),
240
- l.value[1].show ? (c(), r("div", me, [
241
- u(f(_), {
230
+ l.value[1].show ? (d(), r("div", pe, [
231
+ u(f(b), {
242
232
  size: 16,
243
233
  weight: "fill"
244
234
  }),
245
- s("span", fe, d(l.value[1].message), 1)
246
- ])) : g("", !0)
235
+ s("span", ve, c(l.value[1].message), 1)
236
+ ])) : _("", !0)
247
237
  ]),
248
- s("div", ve, [
249
- u(T, {
250
- "model-value": i.value[0]["vcard:hasEmail"],
238
+ s("div", fe, [
239
+ u(V, {
240
+ "model-value": o.value[0]["vcard:hasEmail"],
251
241
  "add-on-text": !1,
252
242
  "date-picker": !1,
253
243
  "info-icon": !1,
@@ -260,19 +250,19 @@ const Q = { class: "dpiV3InnerComponentWrap" }, X = { class: "copy-large-regular
260
250
  label: e.$t("message.dataupload.datasets.dcat:contactPoint.mailInput.title"),
261
251
  "show-end-icon": !1,
262
252
  "show-error": l.value[2].show,
263
- "onUpdate:modelValue": t[1] || (t[1] = (a) => p(a, "vcard:hasEmail", 2))
253
+ "onUpdate:modelValue": t[1] || (t[1] = (a) => m(a, "vcard:hasEmail", 2))
264
254
  }, null, 8, ["model-value", "placeholder", "label", "show-error"]),
265
- l.value[2].show ? (c(), r("div", he, [
266
- u(f(_), {
255
+ l.value[2].show ? (d(), r("div", he, [
256
+ u(f(b), {
267
257
  size: 16,
268
258
  weight: "fill"
269
259
  }),
270
- s("span", ge, d(l.value[2].message), 1)
271
- ])) : g("", !0)
260
+ s("span", ge, c(l.value[2].message), 1)
261
+ ])) : _("", !0)
272
262
  ]),
273
263
  s("div", _e, [
274
- u(T, {
275
- "model-value": i.value[0]["vcard:hasTelephone"],
264
+ u(V, {
265
+ "model-value": o.value[0]["vcard:hasTelephone"],
276
266
  "add-on-text": !1,
277
267
  "date-picker": !1,
278
268
  "info-icon": !1,
@@ -285,27 +275,27 @@ const Q = { class: "dpiV3InnerComponentWrap" }, X = { class: "copy-large-regular
285
275
  label: e.$t("message.dataupload.datasets.dcat:contactPoint.telInput.title"),
286
276
  "show-end-icon": !1,
287
277
  "show-error": l.value[3].show,
288
- "onUpdate:modelValue": t[2] || (t[2] = (a) => p(a, "vcard:hasTelephone", 3))
278
+ "onUpdate:modelValue": t[2] || (t[2] = (a) => m(a, "vcard:hasTelephone", 3))
289
279
  }, null, 8, ["model-value", "placeholder", "label", "show-error"]),
290
- l.value[3].show ? (c(), r("div", be, [
291
- u(f(_), {
280
+ l.value[3].show ? (d(), r("div", be, [
281
+ u(f(b), {
292
282
  size: 16,
293
283
  weight: "fill"
294
284
  }),
295
- s("span", we, d(l.value[3].message), 1)
296
- ])) : g("", !0)
285
+ s("span", we, c(l.value[3].message), 1)
286
+ ])) : _("", !0)
297
287
  ]),
298
- s("div", ye, d(e.$t("message.dataupload.datasets.dcat:contactPoint.descriptionBottom")), 1),
299
- i.value.find((a) => a.isValid === !1) ? (c(), r("div", ke, [
300
- u(f(_), {
288
+ s("div", ye, c(e.$t("message.dataupload.datasets.dcat:contactPoint.descriptionBottom")), 1),
289
+ o.value.find((a) => a.isValid === !1) ? (d(), r("div", ke, [
290
+ u(f(b), {
301
291
  size: 16,
302
292
  weight: "fill"
303
293
  }),
304
294
  t[3] || (t[3] = s("span", { class: "copy-mini-regular" }, "Bitte füllen Sie alle Pflichtfelder aus, bevor Sie fortfahren.", -1))
305
- ])) : g("", !0)
295
+ ])) : _("", !0)
306
296
  ]));
307
297
  }
308
- }, Fe = /* @__PURE__ */ J(Pe, [["__scopeId", "data-v-62702ebf"]]);
298
+ }, Oe = /* @__PURE__ */ J(Pe, [["__scopeId", "data-v-91414cb1"]]);
309
299
  export {
310
- Fe as default
300
+ Oe as default
311
301
  };