@piveau/dpi 0.1.0-beta.69 → 0.1.0-beta.70

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.
@@ -0,0 +1,77 @@
1
+ import { ref as c, onMounted as m, getCurrentInstance as h, watch as v, createBlock as b, openBlock as R, unref as u } from "vue";
2
+ import { getAccessRights as I } from "../../services/dpiV3_apis.js";
3
+ import V from "../Dropdown.vue.js";
4
+ import { useI18n as w } from "vue-i18n";
5
+ import { useFormValues as F } from "../../../composables/useDpiFormValues.js";
6
+ const D = {
7
+ __name: "AccessRightsV3",
8
+ props: {
9
+ distributionId: { type: Number, required: !1 },
10
+ showDeleteButton: { type: Boolean, default: !1 },
11
+ accessRightsProp: { type: String, default: "" }
12
+ },
13
+ emits: ["addAccessRights", "deleteButtonClicked"],
14
+ setup(n, { emit: p }) {
15
+ const { t: d } = w(), { formValues: y } = F(), s = c([]);
16
+ m(async () => {
17
+ const t = h().appContext.app.config.globalProperties.$env;
18
+ try {
19
+ const e = await I(t.api.baseUrl);
20
+ console.log(e), s.value = e.map((a) => ({
21
+ "@value": a.pref_label.de,
22
+ label: a.pref_label.de,
23
+ uri: a.resource
24
+ }));
25
+ } catch (e) {
26
+ console.error("Failed to load planned availability data", e);
27
+ }
28
+ });
29
+ const o = n, i = c(o.accessRightsProp), r = p, f = (l, t) => {
30
+ let e = {
31
+ uri: s.value.find((a) => a["@value"] === l).uri || "",
32
+ label: s.value.find((a) => a["@value"] === l).label || ""
33
+ };
34
+ r("addAccessRights", e, o.distributionId);
35
+ };
36
+ v(
37
+ () => o.accessRightsProp,
38
+ (l) => {
39
+ i.value = l;
40
+ }
41
+ );
42
+ const g = () => {
43
+ console.log("delete clicked"), r("deleteButtonClicked", o.distributionId);
44
+ };
45
+ return (l, t) => (R(), b(V, {
46
+ "onUpdate:modelValue": [
47
+ t[0] || (t[0] = (e) => f(e)),
48
+ t[1] || (t[1] = (e) => i.value = e)
49
+ ],
50
+ dropdownWidth: "large",
51
+ type: "inputField",
52
+ modelValue: i.value,
53
+ inputFieldProps: {
54
+ addOnText: !1,
55
+ initialHintText: !1,
56
+ datePicker: !1,
57
+ infoIcon: !1,
58
+ preIcon: !1,
59
+ label: u(d)(
60
+ "message.dataupload.datasets.dcat:distribution.advanced.dct:accessRights"
61
+ ) + " (optional)",
62
+ dropdown_dpiV3: !0,
63
+ placeholder: u(d)(
64
+ "message.dataupload.datasets.dcat:distribution.advanced.dct:accessRights"
65
+ ) + " hinzufügen",
66
+ inputFieldSize: "large",
67
+ modelValue: i.value,
68
+ defaultInput: !n.showDeleteButton
69
+ },
70
+ data: s.value,
71
+ onDeleteDropdownField: g
72
+ }, null, 8, ["modelValue", "inputFieldProps", "data"]));
73
+ }
74
+ };
75
+ export {
76
+ D as default
77
+ };
@@ -1,18 +1,18 @@
1
- import { ref as n, onMounted as P, getCurrentInstance as A, watch as x, createElementBlock as v, openBlock as h, createVNode as r, createCommentVNode as V, normalizeClass as E, createElementVNode as b, unref as I, toDisplayString as w } from "vue";
1
+ import { ref as r, onMounted as P, getCurrentInstance as E, watch as C, createElementBlock as v, openBlock as h, normalizeClass as k, createElementVNode as g, createCommentVNode as b, createVNode as d, unref as I, toDisplayString as w } from "vue";
2
2
  import { useFormValues as z } from "../../../composables/useDpiFormValues.js";
3
3
  import { getChecksumAlgorithms as M } from "../../services/dpiV3_apis.js";
4
4
  import N from "../Dropdown.vue.js";
5
- import O from "../InputField.vue.js";
6
- import { PhWarning as D } from "@phosphor-icons/vue";
5
+ import q from "../InputField.vue.js";
6
+ import { PhWarning as y } from "@phosphor-icons/vue";
7
7
  /* empty css */
8
- import U from "../../../../_virtual/_plugin-vue_export-helper.js";
9
- const q = { class: "dpiV3_LinkAndMetadata" }, H = {
8
+ import O from "../../../../_virtual/_plugin-vue_export-helper.js";
9
+ const U = {
10
10
  key: 0,
11
11
  class: "dpiV3_errorMessage"
12
- }, W = { class: "copy-mini-regular" }, G = {
13
- key: 1,
12
+ }, W = { class: "copy-mini-regular" }, H = {
13
+ key: 0,
14
14
  class: "dpiV3_errorMessage"
15
- }, L = { class: "copy-mini-regular" }, $ = {
15
+ }, G = { class: "copy-mini-regular" }, L = {
16
16
  __name: "ChecksumV3",
17
17
  props: {
18
18
  distributionId: { type: Number, required: !1 },
@@ -20,15 +20,16 @@ const q = { class: "dpiV3_LinkAndMetadata" }, H = {
20
20
  checksumText: { type: String, default: "" },
21
21
  checksumDropdownText: { type: String, default: "" },
22
22
  uri: { type: String, default: "" },
23
- distIndex: { type: Number, required: !1 }
23
+ distIndex: { type: Number, required: !1 },
24
+ asCard: { type: Boolean, required: !1, default: !1 }
24
25
  },
25
26
  emits: ["addChecksum", "deleteButtonClicked"],
26
- setup(d, { expose: T, emit: y }) {
27
- const c = n([]), { formValues: m } = z(), o = n(null), u = n(null);
27
+ setup(n, { expose: T, emit: D }) {
28
+ const c = r([]), { formValues: m } = z(), o = r(null), u = r(null);
28
29
  P(async () => {
29
- const t = A().appContext.app.config.globalProperties.$env;
30
+ const l = E().appContext.app.config.globalProperties.$env;
30
31
  try {
31
- const e = await M(t.api.baseUrl);
32
+ const e = await M(l.api.baseUrl);
32
33
  c.value = e.map((f) => ({
33
34
  "@value": f.value,
34
35
  label: f.label,
@@ -39,108 +40,114 @@ const q = { class: "dpiV3_LinkAndMetadata" }, H = {
39
40
  console.error("Failed to load checksum algorithms:", e);
40
41
  }
41
42
  });
42
- const a = d, i = n(a.checksumText);
43
- n([]);
44
- const s = n(a.checksumDropdownText), k = y;
45
- let g = "";
43
+ const s = n, i = r(s.checksumText);
44
+ r([]);
45
+ const a = r(s.checksumDropdownText), V = D;
46
+ let x = "";
46
47
  const p = () => {
47
- const l = i.value && i.value.trim() !== "", t = s.value && s.value.trim() !== "";
48
+ const t = i.value && i.value.trim() !== "", l = a.value && a.value.trim() !== "";
48
49
  let e = !1;
49
- return l || t ? (l ? u.value = null : (u.value = "Prüfsumme ist erforderlich", e = !0), t ? o.value = null : (o.value = "Algorithmus ist erforderlich", e = !0)) : (u.value = null, o.value = null), !e;
50
- }, C = () => !p(), _ = (l) => {
51
- i.value = l.target.value, k(
50
+ return t || l ? (t ? u.value = null : (u.value = "Prüfsumme ist erforderlich", e = !0), l ? o.value = null : (o.value = "Algorithmus ist erforderlich", e = !0)) : (u.value = null, o.value = null), !e;
51
+ }, F = () => !p(), S = (t) => {
52
+ i.value = t.target.value, V(
52
53
  "addChecksum",
53
54
  i.value,
54
- s.value,
55
- a.distributionId
55
+ a.value,
56
+ s.distributionId
56
57
  ), p();
57
- }, F = (l) => {
58
- var t;
59
- s.value = l, g = ((t = c.value.find((e) => e["@value"] === l)) == null ? void 0 : t.uri) || "", k(
58
+ }, A = (t) => {
59
+ var l;
60
+ a.value = t, x = ((l = c.value.find((e) => e["@value"] === t)) == null ? void 0 : l.uri) || "", V(
60
61
  "addChecksum",
61
62
  i.value,
62
- s.value,
63
- a.distributionId,
64
- g
63
+ a.value,
64
+ s.distributionId,
65
+ x
65
66
  ), p();
66
67
  };
67
- x(
68
- () => a.checksumDropdownText,
69
- (l) => {
70
- s.value = l;
68
+ C(
69
+ () => s.checksumDropdownText,
70
+ (t) => {
71
+ a.value = t;
71
72
  }
72
- ), x(
73
- () => a.checksumText,
74
- (l) => {
75
- i.value = l;
73
+ ), C(
74
+ () => s.checksumText,
75
+ (t) => {
76
+ i.value = t;
76
77
  }
77
78
  );
78
- const S = () => {
79
- m.value.DistributionSimple["dcat:distribution"][a.distIndex].checksum.uri = "", m.value.DistributionSimple["dcat:distribution"][a.distIndex].checksum["spdx:checksum"] = "", s.value = "", o.value = null;
79
+ const _ = () => {
80
+ m.value.DistributionSimple["dcat:distribution"][s.distIndex].checksum.uri = "", m.value.DistributionSimple["dcat:distribution"][s.distIndex].checksum["spdx:checksum"] = "", a.value = "", o.value = null;
80
81
  }, B = () => {
81
- m.value.DistributionSimple["dcat:distribution"][a.distIndex].checksum.title = "", i.value = "", u.value = null;
82
+ m.value.DistributionSimple["dcat:distribution"][s.distIndex].checksum.title = "", i.value = "", u.value = null;
82
83
  };
83
84
  return T({
84
- validateAllItems: C
85
- }), (l, t) => (h(), v("div", q, [
86
- r(O, {
87
- onInput: t[0] || (t[0] = (e) => _(e)),
88
- modelValue: i.value,
89
- "onUpdate:modelValue": t[1] || (t[1] = (e) => i.value = e),
90
- addOnText: !1,
91
- datePicker: !1,
92
- infoIcon: !1,
93
- placeholder: "Bitte Prüfsumme eingeben...",
94
- preIcon: !1,
95
- inputFieldSize: "large",
96
- initialHintText: !1,
97
- label: "Prüfsumme",
98
- showEndIcon: !1,
99
- defaultInput: !0,
100
- onDeleteButtonClicked: B,
101
- class: E({ dpiV3_Space3: d.showDeleteButton })
102
- }, null, 8, ["modelValue", "class"]),
103
- u.value ? (h(), v("div", H, [
104
- r(I(D), {
105
- size: 16,
106
- weight: "fill"
107
- }),
108
- b("span", W, w(u.value), 1)
109
- ])) : V("", !0),
110
- r(N, {
111
- "onUpdate:modelValue": [
112
- t[2] || (t[2] = (e) => F(e)),
113
- t[3] || (t[3] = (e) => s.value = e)
114
- ],
115
- dropdownWidth: "large",
116
- type: "inputField",
117
- modelValue: s.value,
118
- inputFieldProps: {
85
+ validateAllItems: F
86
+ }), (t, l) => (h(), v("div", {
87
+ class: k(["dpiV3_LinkAndMetadata", { dpiV3_docAllAsCard: n.asCard }])
88
+ }, [
89
+ g("div", {
90
+ class: k(["dpiV3AutoCompleteWrap", { dpiV3_docAsCard: n.asCard }])
91
+ }, [
92
+ d(q, {
93
+ onInput: l[0] || (l[0] = (e) => S(e)),
94
+ modelValue: i.value,
95
+ "onUpdate:modelValue": l[1] || (l[1] = (e) => i.value = e),
119
96
  addOnText: !1,
120
- initialHintText: !1,
121
97
  datePicker: !1,
122
98
  infoIcon: !1,
99
+ placeholder: "Bitte Prüfsumme eingeben...",
123
100
  preIcon: !1,
124
- label: "Algorithmus",
125
- dropdown_dpiV3: !0,
126
- placeholder: "Geben Sie den Algorithmus ein...",
127
101
  inputFieldSize: "large",
128
- modelValue: s.value,
129
- defaultInput: !d.showDeleteButton
130
- },
131
- data: c.value,
132
- onDeleteDropdownField: S
133
- }, null, 8, ["modelValue", "inputFieldProps", "data"]),
134
- o.value ? (h(), v("div", G, [
135
- r(I(D), {
102
+ initialHintText: !1,
103
+ label: "Prüfsumme",
104
+ showEndIcon: !1,
105
+ defaultInput: !0,
106
+ onDeleteButtonClicked: B,
107
+ class: k({ dpiV3_Space3: n.showDeleteButton })
108
+ }, null, 8, ["modelValue", "class"]),
109
+ u.value ? (h(), v("div", U, [
110
+ d(I(y), {
111
+ size: 16,
112
+ weight: "fill"
113
+ }),
114
+ g("span", W, w(u.value), 1)
115
+ ])) : b("", !0),
116
+ d(N, {
117
+ "onUpdate:modelValue": [
118
+ l[2] || (l[2] = (e) => A(e)),
119
+ l[3] || (l[3] = (e) => a.value = e)
120
+ ],
121
+ dropdownWidth: "large",
122
+ type: "inputField",
123
+ modelValue: a.value,
124
+ inputFieldProps: {
125
+ addOnText: !1,
126
+ initialHintText: !1,
127
+ datePicker: !1,
128
+ infoIcon: !1,
129
+ preIcon: !1,
130
+ label: "Algorithmus",
131
+ dropdown_dpiV3: !0,
132
+ placeholder: "Geben Sie den Algorithmus ein...",
133
+ inputFieldSize: "large",
134
+ modelValue: a.value,
135
+ defaultInput: !0
136
+ },
137
+ data: c.value,
138
+ onDeleteDropdownField: _
139
+ }, null, 8, ["modelValue", "inputFieldProps", "data"])
140
+ ], 2),
141
+ o.value ? (h(), v("div", H, [
142
+ d(I(y), {
136
143
  size: 16,
137
144
  weight: "fill"
138
145
  }),
139
- b("span", L, w(o.value), 1)
140
- ])) : V("", !0)
141
- ]));
146
+ g("span", G, w(o.value), 1)
147
+ ])) : b("", !0)
148
+ ], 2));
142
149
  }
143
- }, ee = /* @__PURE__ */ U($, [["__scopeId", "data-v-0e2b93f7"]]);
150
+ }, Z = /* @__PURE__ */ O(L, [["__scopeId", "data-v-a3888031"]]);
144
151
  export {
145
- ee as default
152
+ Z as default
146
153
  };