@piveau/dpi 0.1.0-beta.47 → 0.1.0-beta.49

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,10 +1,10 @@
1
- import { ref as f, watch as q, createElementBlock as c, openBlock as r, normalizeClass as z, createCommentVNode as k, createElementVNode as V, toDisplayString as w, Fragment as G, renderList as K, unref as i, createVNode as g, withDirectives as $, vShow as F, createBlock as A } from "vue";
1
+ import { ref as f, watch as q, createElementBlock as c, openBlock as u, normalizeClass as z, createCommentVNode as I, createElementVNode as V, toDisplayString as w, Fragment as G, renderList as K, unref as r, createVNode as g, withDirectives as $, vShow as O, createBlock as F } from "vue";
2
2
  import _ from "../HappyFlowComponents/ui/InputField.vue.js";
3
3
  import Q from "../HappyFlowComponents/ui/CheckboxV3.vue.js";
4
4
  import M from "../HappyFlowComponents/ui/ButtonV3.vue.js";
5
5
  import { PhWarning as X } from "@phosphor-icons/vue";
6
6
  import { useI18n as Y } from "vue-i18n";
7
- import { getNode as J } from "@formkit/core";
7
+ import { getNode as A } from "@formkit/core";
8
8
  import { useFormValues as Z } from "../composables/useDpiFormValues.js";
9
9
  import { useEditModeInfo as L } from "../composables/useDpiEditMode.js";
10
10
  /* empty css */
@@ -25,12 +25,12 @@ const ee = { key: 0 }, te = {
25
25
  inRap: Boolean
26
26
  },
27
27
  setup(m) {
28
- const { isEditMode: O } = L(), { formValues: n } = Z(), { t: h } = Y(), v = f([!1]), T = f([0]);
29
- let t = f(), u = f([{ startDate: !1, endDate: !1, message: "" }]);
28
+ const { isEditMode: P } = L(), { formValues: l } = Z(), { t: h } = Y(), v = f([!1]), T = f([0]);
29
+ let t = f(), i = f([{ startDate: !1, endDate: !1, message: "" }]);
30
30
  f();
31
31
  let E = f(h("message.dataupload.menu.reset"));
32
- const P = m;
33
- O.value ? (n.value.Covering["dcat:temporalResolution"] !== void 0 ? t.value = n.value.Covering["dcat:temporalResolution"]["dct:temporal"] || [] : t.value = [
32
+ const B = m;
33
+ P.value ? (l.value.Covering["dcat:temporalResolution"] !== void 0 ? t.value = l.value.Covering["dcat:temporalResolution"]["dct:temporal"] || [] : t.value = [
34
34
  {
35
35
  isValid: !0,
36
36
  type: "dct:PeriodOfTime",
@@ -45,7 +45,7 @@ const ee = { key: 0 }, te = {
45
45
  ], v.value = t == null ? void 0 : t.value.map(
46
46
  (e) => e.dataType === "dateTime"
47
47
  ), T.value = new Array(t == null ? void 0 : t.value.length).fill(0)) : (t.value = [{ id: 0, "dcat:startDate": "", "dcat:endDate": "" }], T.value = [0]);
48
- const C = f([
48
+ const R = f([
49
49
  {
50
50
  isValid: !0,
51
51
  type: "dct:PeriodOfTime",
@@ -54,13 +54,13 @@ const ee = { key: 0 }, te = {
54
54
  ]
55
55
  }
56
56
  ]);
57
- O.value || (t.value = [
57
+ P.value || (t.value = [
58
58
  {
59
59
  dataType: "date",
60
60
  "dcat:startDate": "",
61
61
  "dcat:endDate": ""
62
62
  }
63
- ], n.value.Covering["dcat:temporalResolution"] = {
63
+ ], l.value.Covering["dcat:temporalResolution"] = {
64
64
  isValid: !0,
65
65
  type: "dct:PeriodOfTime",
66
66
  "dct:temporal": [
@@ -78,42 +78,42 @@ const ee = { key: 0 }, te = {
78
78
  E.value = e;
79
79
  }
80
80
  );
81
- const U = () => {
81
+ const J = () => {
82
82
  var a;
83
83
  const e = t.value.reduce(
84
- (d, s) => Math.max(d, s.id || 0),
84
+ (d, n) => Math.max(d, n.id || 0),
85
85
  0
86
86
  );
87
- (a = n.value.Covering["dcat:temporalResolution"]) == null || a["dct:temporal"].push({ id: e + 1, dataType: "date" }), t.value.push({ id: e + 1, dataType: "date" }), E.value = h("message.dataupload.menu.delete"), B(), y(t.value.length - 1);
88
- }, B = () => {
89
- v.value.push(!1), T.value.push(0), u.value.push({ startDate: !1, endDate: !1, message: "" });
87
+ (a = l.value.Covering["dcat:temporalResolution"]) == null || a["dct:temporal"].push({ id: e + 1, dataType: "date" }), t.value.push({ id: e + 1, dataType: "date" }), E.value = h("message.dataupload.menu.delete"), U(), y(t.value.length - 1);
88
+ }, U = () => {
89
+ v.value.push(!1), T.value.push(0), i.value.push({ startDate: !1, endDate: !1, message: "" });
90
90
  }, N = (e, a) => {
91
91
  const d = e.target.checked;
92
- v.value[a] = d, v.value[a] ? n.value.Covering["dcat:temporalResolution"]["dct:temporal"][a].dataType = "dateTime" : n.value.Covering["dcat:temporalResolution"]["dct:temporal"][a].dataType = "date", y(a);
92
+ v.value[a] = d, v.value[a] ? l.value.Covering["dcat:temporalResolution"]["dct:temporal"][a].dataType = "dateTime" : l.value.Covering["dcat:temporalResolution"]["dct:temporal"][a].dataType = "date", y(a);
93
93
  }, y = (e) => {
94
- const a = n.value.Covering["dcat:temporalResolution"]["dct:temporal"][e], d = a["dcat:startDate"], s = a["dcat:endDate"], l = a.startTime, R = a.endTime, b = a.dataType === "dateTime";
95
- u.value[e] = { startDate: !1, endDate: !1, message: "" };
94
+ const a = l.value.Covering["dcat:temporalResolution"]["dct:temporal"][e], d = a["dcat:startDate"], n = a["dcat:endDate"], o = a.startTime, C = a.endTime, b = a.dataType === "dateTime";
95
+ i.value[e] = { startDate: !1, endDate: !1, message: "" };
96
96
  let p = !0;
97
- if (d || s || l || R) {
97
+ if (d || n || o || C) {
98
98
  const D = [];
99
- if (d || D.push("Aktualisierungsdatum"), s || D.push("Enddatum"), b && (l || D.push("Startzeit"), R || D.push("Endzeit")), D.length > 0)
100
- u.value[e] = {
99
+ if (d || D.push("Aktualisierungsdatum"), n || D.push("Enddatum"), b && (o || D.push("Startzeit"), C || D.push("Endzeit")), D.length > 0)
100
+ i.value[e] = {
101
101
  startDate: !d,
102
- endDate: !s,
103
- message: `Bitte füllen Sie alle Felder aus: ${D.join(", ")}`
104
- }, p = !1;
102
+ endDate: !n,
103
+ message: `Bitte geben Sie ein ${D.join(", ")} ein.`
104
+ }, p = "unset";
105
105
  else {
106
106
  const W = new Date(d);
107
- new Date(s) < W && (u.value[e] = {
107
+ new Date(n) < W && (i.value[e] = {
108
108
  startDate: !0,
109
109
  endDate: !0,
110
- message: "Enddatum muss nach dem Aktualisierungsdatum liegen"
111
- }, p = !1);
110
+ message: "Enddatum muss nach dem Aktualisierungsdatum liegen."
111
+ }, p = "unset");
112
112
  }
113
113
  }
114
- return C.value[0].isValid = p, n.value.Covering["dcat:temporalResolution"].isValid = p, p;
115
- }, I = (e, a, d, s) => {
116
- n.value.Covering["dcat:temporalResolution"] !== void 0 || (n.value.Covering["dcat:temporalResolution"] = {
114
+ return R.value[0].isValid = p, l.value.Covering["dcat:temporalResolution"].isValid = p, p;
115
+ }, k = (e, a, d, n) => {
116
+ l.value.Covering["dcat:temporalResolution"] !== void 0 || (l.value.Covering["dcat:temporalResolution"] = {
117
117
  isValid: !0,
118
118
  type: "dct:PeriodOfTime",
119
119
  "dct:temporal": [
@@ -123,55 +123,55 @@ const ee = { key: 0 }, te = {
123
123
  "dcat:endDate": ""
124
124
  }
125
125
  ]
126
- }), n.value.Covering["dcat:temporalResolution"]["dct:temporal"][a][d] = e, y(a);
127
- }, j = (e) => {
128
- t.value[e] && (t.value[e]["dcat:startDate"] = "", t.value[e]["dcat:endDate"] = "", "startTime" in t.value[e] && (t.value[e].startTime = ""), "endTime" in t.value[e] && (t.value[e].endTime = ""), C.value[0]["dct:temporal"][e] = {
126
+ }), l.value.Covering["dcat:temporalResolution"]["dct:temporal"][a][d] = e, y(a);
127
+ }, H = (e) => {
128
+ t.value[e] && (t.value[e]["dcat:startDate"] = "", t.value[e]["dcat:endDate"] = "", "startTime" in t.value[e] && (t.value[e].startTime = ""), "endTime" in t.value[e] && (t.value[e].endTime = ""), R.value[0]["dct:temporal"][e] = {
129
129
  dataType: "date",
130
130
  "dcat:startDate": "",
131
131
  "dcat:endDate": ""
132
- }, v.value[e] = !1, T.value[e]++, u.value[e] = { startDate: !1, endDate: !1, message: "" }, P.inRap ? J("Covering").value[Object.keys(J("Covering").value)[1]] = C : P.context.node.input(C), y(e));
133
- }, H = (e) => {
134
- n.value.Covering["dcat:temporalResolution"]["dct:temporal"].splice(e, 1), v.value.splice(e, 1), T.value.splice(e, 1), u.value.splice(e, 1), n.value.Covering["dcat:temporalResolution"]["dct:temporal"].length === 1 && (E.value = h("message.dataupload.menu.reset")), n.value.Covering["dcat:temporalResolution"]["dct:temporal"].forEach((a, d) => {
132
+ }, v.value[e] = !1, T.value[e]++, i.value[e] = { startDate: !1, endDate: !1, message: "" }, B.inRap ? A("Covering").value[Object.keys(A("Covering").value)[1]] = R : (console.log(R), l.value.Covering["dcat:temporalResolution"] = R.value[0]), y(e), console.log(t));
133
+ }, j = (e) => {
134
+ l.value.Covering["dcat:temporalResolution"]["dct:temporal"].splice(e, 1), t.value.splice(e, 1), v.value.splice(e, 1), T.value.splice(e, 1), i.value.splice(e, 1), l.value.Covering["dcat:temporalResolution"]["dct:temporal"].length === 1 && (E.value = h("message.dataupload.menu.reset")), l.value.Covering["dcat:temporalResolution"]["dct:temporal"].forEach((a, d) => {
135
135
  y(d);
136
136
  });
137
137
  };
138
138
  return (e, a) => {
139
139
  var d;
140
- return r(), c("div", {
140
+ return u(), c("div", {
141
141
  class: z(["dpiV3InnerComponentWrap", { inRapModal: m.inRap }])
142
142
  }, [
143
- m.inRap ? k("", !0) : (r(), c("h4", ee, w(e.$t("message.dataupload.datasets.dcat:temporalResolution.title")), 1)),
144
- m.inRap ? k("", !0) : (r(), c("div", te, w(e.$t("message.dataupload.datasets.dcat:temporalResolution.description")), 1)),
145
- m.inRap ? (r(), c("div", ae, [
143
+ m.inRap ? I("", !0) : (u(), c("h4", ee, w(e.$t("message.dataupload.datasets.dcat:temporalResolution.title")), 1)),
144
+ m.inRap ? I("", !0) : (u(), c("div", te, w(e.$t("message.dataupload.datasets.dcat:temporalResolution.description")), 1)),
145
+ m.inRap ? (u(), c("div", ae, [
146
146
  V("span", le, w(e.$t("message.metadata.temporal")) + " (optional)", 1)
147
- ])) : k("", !0),
148
- (r(!0), c(G, null, K(((d = i(n).Covering["dcat:temporalResolution"]) == null ? void 0 : d["dct:temporal"]) || e.initializedObject, (s, l) => {
149
- var R, b, p;
150
- return r(), c("div", {
151
- class: z(["dpiV3AutoCompleteWrap", { marginRap: m.inRap && l + 1 < i(t).length }])
147
+ ])) : I("", !0),
148
+ (u(!0), c(G, null, K(((d = r(l).Covering["dcat:temporalResolution"]) == null ? void 0 : d["dct:temporal"]) || r(t).value, (n, o) => {
149
+ var C, b, p;
150
+ return u(), c("div", {
151
+ class: z(["dpiV3AutoCompleteWrap", { marginRap: m.inRap && o + 1 < r(t).length }])
152
152
  }, [
153
- s != "" ? (r(), c("div", oe, [
153
+ n != "" ? (u(), c("div", oe, [
154
154
  V("div", se, [
155
155
  g(_, {
156
- onInput: (o) => I(o.target.value, l, "dcat:startDate"),
156
+ onInput: (s) => k(s.target.value, o, "dcat:startDate"),
157
157
  defaultInput: !0,
158
158
  addOnText: !1,
159
159
  eraseable: !1,
160
160
  datePicker: !0,
161
161
  infoIcon: !1,
162
162
  value: "TT/MM/JJJJ",
163
- label: "Aktualisierungsdatum",
163
+ label: "Von",
164
164
  preIcon: !1,
165
165
  inputFieldSize: "large",
166
166
  initialHintText: !1,
167
167
  showEndIcon: !1,
168
168
  inputType: "date",
169
- modelValue: s["dcat:startDate"],
170
- "onUpdate:modelValue": (o) => s["dcat:startDate"] = o,
171
- showError: (R = i(u)[l]) == null ? void 0 : R.startDate
169
+ modelValue: n["dcat:startDate"],
170
+ "onUpdate:modelValue": (s) => n["dcat:startDate"] = s,
171
+ showError: ((C = r(i)[o]) == null ? void 0 : C.startDate) && r(l).Covering["dcat:temporalResolution"].isValid === !1
172
172
  }, null, 8, ["onInput", "modelValue", "onUpdate:modelValue", "showError"]),
173
173
  $(g(_, {
174
- onInput: (o) => I(o.target.value, l, "startTime"),
174
+ onInput: (s) => k(s.target.value, o, "startTime"),
175
175
  defaultInput: !0,
176
176
  addOnText: !1,
177
177
  eraseable: !1,
@@ -184,33 +184,33 @@ const ee = { key: 0 }, te = {
184
184
  inputFieldSize: "large",
185
185
  initialHintText: !1,
186
186
  showEndIcon: !1,
187
- modelValue: s.startTime,
188
- "onUpdate:modelValue": (o) => s.startTime = o
187
+ modelValue: n.startTime,
188
+ "onUpdate:modelValue": (s) => n.startTime = s
189
189
  }, null, 8, ["onInput", "modelValue", "onUpdate:modelValue"]), [
190
- [F, S(l)]
190
+ [O, S(o)]
191
191
  ])
192
192
  ]),
193
193
  V("div", ne, [
194
194
  g(_, {
195
- onInput: (o) => I(o.target.value, l, "dcat:endDate"),
195
+ onInput: (s) => k(s.target.value, o, "dcat:endDate"),
196
196
  defaultInput: !0,
197
197
  addOnText: !1,
198
198
  eraseable: !1,
199
199
  datePicker: !0,
200
200
  infoIcon: !1,
201
201
  value: "TT/MM/JJJJ",
202
- label: "Enddatum",
202
+ label: "Bis",
203
203
  preIcon: !1,
204
204
  inputFieldSize: "large",
205
205
  initialHintText: !1,
206
206
  showEndIcon: !1,
207
207
  inputType: "date",
208
- modelValue: s["dcat:endDate"],
209
- "onUpdate:modelValue": (o) => s["dcat:endDate"] = o,
210
- showError: (b = i(u)[l]) == null ? void 0 : b.endDate
208
+ modelValue: n["dcat:endDate"],
209
+ "onUpdate:modelValue": (s) => n["dcat:endDate"] = s,
210
+ showError: ((b = r(i)[o]) == null ? void 0 : b.endDate) && r(l).Covering["dcat:temporalResolution"].isValid === !1
211
211
  }, null, 8, ["onInput", "modelValue", "onUpdate:modelValue", "showError"]),
212
212
  $(g(_, {
213
- onInput: (o) => I(o.target.value, l, "endTime"),
213
+ onInput: (s) => k(s.target.value, o, "endTime"),
214
214
  defaultInput: !0,
215
215
  addOnText: !1,
216
216
  eraseable: !1,
@@ -223,50 +223,50 @@ const ee = { key: 0 }, te = {
223
223
  inputFieldSize: "large",
224
224
  initialHintText: !1,
225
225
  showEndIcon: !1,
226
- modelValue: s.endTime,
227
- "onUpdate:modelValue": (o) => s.endTime = o
226
+ modelValue: n.endTime,
227
+ "onUpdate:modelValue": (s) => n.endTime = s
228
228
  }, null, 8, ["onInput", "modelValue", "onUpdate:modelValue"]), [
229
- [F, S(l)]
229
+ [O, S(o)]
230
230
  ])
231
231
  ])
232
- ])) : k("", !0),
233
- (p = i(u)[l]) != null && p.message ? (r(), c("div", de, [
234
- g(i(X), {
232
+ ])) : I("", !0),
233
+ (p = r(i)[o]) != null && p.message && r(l).Covering["dcat:temporalResolution"].isValid === !1 ? (u(), c("div", de, [
234
+ g(r(X), {
235
235
  size: 16,
236
236
  weight: "fill"
237
237
  }),
238
- V("span", re, w(i(u)[l].message), 1)
239
- ])) : k("", !0),
238
+ V("span", re, w(r(i)[o].message), 1)
239
+ ])) : I("", !0),
240
240
  V("div", ue, [
241
- (r(), c("div", {
242
- key: `checkbox-${l}-${T.value[l]}`
241
+ (u(), c("div", {
242
+ key: `checkbox-${o}-${T.value[o]}`
243
243
  }, [
244
244
  g(Q, {
245
245
  type: "checkbox",
246
- state: S(l) ? "checked" : "",
246
+ state: S(o) ? "checked" : "",
247
247
  text: {
248
248
  label: e.$t(
249
249
  "message.dataupload.datasets.dcat:temporalResolution.input.checkbox.label"
250
250
  )
251
251
  },
252
252
  data: [],
253
- onChange: (o) => N(o, l)
253
+ onChange: (s) => N(s, o)
254
254
  }, null, 8, ["state", "text", "onChange"])
255
255
  ])),
256
- i(t).length > 1 ? (r(), A(M, {
256
+ r(t).length > 1 ? (u(), F(M, {
257
257
  key: 0,
258
- buttonText: i(h)("message.dataupload.menu.delete"),
258
+ buttonText: r(h)("message.dataupload.menu.delete"),
259
259
  size: "small",
260
260
  iconStart: "trash",
261
261
  variant: "tertiary",
262
- onClick: (o) => H(l)
263
- }, null, 8, ["buttonText", "onClick"])) : (r(), A(M, {
262
+ onClick: (s) => j(o)
263
+ }, null, 8, ["buttonText", "onClick"])) : (u(), F(M, {
264
264
  key: 1,
265
- buttonText: i(h)("message.dataupload.menu.reset"),
265
+ buttonText: r(h)("message.dataupload.menu.reset"),
266
266
  size: "small",
267
267
  iconStart: "reset",
268
268
  variant: "tertiary",
269
- onClick: (o) => j(l)
269
+ onClick: (s) => H(o)
270
270
  }, null, 8, ["buttonText", "onClick"]))
271
271
  ])
272
272
  ], 2);
@@ -279,13 +279,13 @@ const ee = { key: 0 }, te = {
279
279
  size: "medium",
280
280
  iconStart: "plus",
281
281
  variant: "tertiary",
282
- onClick: a[0] || (a[0] = (s) => U())
282
+ onClick: a[0] || (a[0] = (n) => J())
283
283
  }, null, 8, ["buttonText"])
284
284
  ], 2)
285
285
  ], 2);
286
286
  };
287
287
  }
288
- }, ke = /* @__PURE__ */ x(ie, [["__scopeId", "data-v-5684f118"]]);
288
+ }, Ce = /* @__PURE__ */ x(ie, [["__scopeId", "data-v-d379ad05"]]);
289
289
  export {
290
- ke as default
290
+ Ce as default
291
291
  };
@@ -236,7 +236,7 @@ const ue = { key: 0 }, ce = {
236
236
  datePicker: !0,
237
237
  infoIcon: !1,
238
238
  value: "TT/MM/JJJJ",
239
- label: "Von:",
239
+ label: "Von",
240
240
  preIcon: !1,
241
241
  inputFieldSize: "large",
242
242
  initialHintText: !1,
@@ -289,7 +289,7 @@ const ue = { key: 0 }, ce = {
289
289
  datePicker: !0,
290
290
  infoIcon: !1,
291
291
  value: "TT/MM/JJJJ",
292
- label: "bis:",
292
+ label: "bis",
293
293
  preIcon: !1,
294
294
  inputFieldSize: "large",
295
295
  initialHintText: !1,
@@ -389,7 +389,7 @@ const ue = { key: 0 }, ce = {
389
389
  ], 2);
390
390
  };
391
391
  }
392
- }, Be = /* @__PURE__ */ de(be, [["__scopeId", "data-v-3bb13309"]]);
392
+ }, Be = /* @__PURE__ */ de(be, [["__scopeId", "data-v-433b3757"]]);
393
393
  export {
394
394
  Be as default
395
395
  };