@piveau/dpi 0.2.0-alpha.20 → 0.2.0-alpha.21
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.
- package/dist/assets/dpi.css +1 -1
- package/dist/packages/dpi/src/data-provider-interface/DataProviderInterface.vue.js +22 -16
- package/dist/packages/dpi/src/data-provider-interface/DataProviderInterface.vue2.js +34 -32
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/HomeTable.vue.js +87 -71
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ProjectTable.vue.js +2 -2
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ProjectTable.vue2.js +88 -73
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/Autocomplete/Autocomplete.vue.js +2 -2
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/Autocomplete/Autocomplete.vue2.js +70 -55
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/Autocomplete/AutocompleteVocab.vue.js +2 -2
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/Autocomplete/AutocompleteVocab.vue2.js +50 -49
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ButtonV3.vue.js +115 -83
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ReviewStep/ReviewStep.vue.js +1 -1
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ReviewStep/ReviewStep.vue2.js +111 -107
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/TableRowV3.vue.js +127 -122
- package/dist/packages/dpi/src/data-provider-interface/components/StepActionsSection.vue.js +2 -2
- package/dist/packages/dpi/src/data-provider-interface/components/StepActionsSection.vue2.js +72 -68
- package/dist/packages/dpi/src/data-provider-interface/composables/useDebouncedLoading.js +11 -0
- package/dist/packages/dpi/src/data-provider-interface/composables/useProjectActions.js +37 -37
- package/dist/packages/dpi/src/data-provider-interface/views/InputPageProject.vue.js +218 -216
- package/package.json +1 -1
package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ProjectTable.vue2.js
CHANGED
|
@@ -1,40 +1,42 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent as x, ref as p, computed as i, watch as U, createElementBlock as n, openBlock as l, createElementVNode as s, createBlock as _, resolveDynamicComponent as R, unref as r, withCtx as q, createVNode as y, createStaticVNode as z, Fragment as A, renderList as F } from "vue";
|
|
2
|
+
import { PhCircleNotch as W } from "@phosphor-icons/vue";
|
|
3
|
+
import { whenever as $ } from "@vueuse/core";
|
|
3
4
|
import "axios";
|
|
4
5
|
import "jquery";
|
|
5
|
-
import { useRouter as
|
|
6
|
-
import { useStore as
|
|
7
|
-
import { useRuntimeEnv as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
|
|
6
|
+
import { useRouter as J } from "vue-router";
|
|
7
|
+
import { useStore as O } from "vuex";
|
|
8
|
+
import { useRuntimeEnv as K } from "../../composables/useRuntimeEnv.js";
|
|
9
|
+
import { useDebouncedLoading as G } from "../composables/useDebouncedLoading.js";
|
|
10
|
+
import { useErrorDialog as M } from "../composables/useErrorDialog.js";
|
|
11
|
+
import { useProjectSearch as Q } from "../composables/useTwinbyHome.js";
|
|
12
|
+
import { useTwinbyUser as X } from "../composables/useTwinbyUser.js";
|
|
13
|
+
import { formatDate as Y } from "../utils/formatDate.js";
|
|
14
|
+
import Z from "./ui/ButtonV3.vue.js";
|
|
15
|
+
import j from "./ui/TableRowV3.vue.js";
|
|
16
|
+
const ee = { class: "dpiV3_dpiHome V3-typography" }, ae = { class: "dpiV3_homeHeadWrap" }, te = { class: "interactionButtonsDPIHome" }, ie = { class: "dpiV3_table" }, oe = {
|
|
15
17
|
key: 0,
|
|
16
|
-
class: "
|
|
17
|
-
},
|
|
18
|
+
class: "dpiV3_loadingSkeleton"
|
|
19
|
+
}, le = {
|
|
18
20
|
key: 1,
|
|
19
21
|
class: "dpiV3_innerTable"
|
|
20
|
-
},
|
|
22
|
+
}, ye = /* @__PURE__ */ x({
|
|
21
23
|
__name: "ProjectTable",
|
|
22
|
-
setup(
|
|
23
|
-
var
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
setup(se) {
|
|
25
|
+
var b, g, k, w;
|
|
26
|
+
const c = K(), d = O();
|
|
27
|
+
J(), localStorage.getItem("dpi_duplicate"), p(""), i(() => d.getters["auth/getUserCatalogIds"]), p({
|
|
26
28
|
loading: !1,
|
|
27
29
|
message: "",
|
|
28
30
|
confirm: () => null
|
|
29
31
|
});
|
|
30
|
-
const
|
|
31
|
-
i(() =>
|
|
32
|
-
const
|
|
33
|
-
var
|
|
34
|
-
return (e = (
|
|
35
|
-
}), { useSearch:
|
|
36
|
-
Authorization: `Bearer ${
|
|
37
|
-
})), { getSearchResultsEnhanced:
|
|
32
|
+
const S = i(() => d.getters["auth/getUserData"]);
|
|
33
|
+
i(() => S.value.rtpToken);
|
|
34
|
+
const P = (a) => d.dispatch("snackbar/showSnackbar", a), V = i(() => {
|
|
35
|
+
var a, e;
|
|
36
|
+
return (e = (a = d.getters) == null ? void 0 : a["auth/getUserData"]) == null ? void 0 : e.authToken;
|
|
37
|
+
}), { useSearch: D } = Q(c.api.baseUrl), v = i(() => ({
|
|
38
|
+
Authorization: `Bearer ${V.value}`
|
|
39
|
+
})), { getSearchResultsEnhanced: E, query: f, isFetching: C } = D({
|
|
38
40
|
queryParams: {
|
|
39
41
|
limit: 100
|
|
40
42
|
},
|
|
@@ -42,23 +44,23 @@ const Q = { class: "dpiV3_dpiHome V3-typography" }, X = { class: "dpiV3_homeHead
|
|
|
42
44
|
resource: "project",
|
|
43
45
|
accessControlPermissions: "edit,publish,delete"
|
|
44
46
|
},
|
|
45
|
-
headers:
|
|
46
|
-
}),
|
|
47
|
-
|
|
48
|
-
if (!
|
|
47
|
+
headers: v
|
|
48
|
+
}), o = i(() => f.error.value), { openErrorDialog: I } = M();
|
|
49
|
+
$(o, () => {
|
|
50
|
+
if (!o.value)
|
|
49
51
|
return;
|
|
50
|
-
const
|
|
52
|
+
const a = new Error(`${JSON.stringify(o.value)}
|
|
51
53
|
|
|
52
|
-
${JSON.stringify(
|
|
53
|
-
|
|
54
|
+
${JSON.stringify(v.value)}`);
|
|
55
|
+
I(a, "Fehler beim Laden der Projekte");
|
|
54
56
|
});
|
|
55
|
-
const { allowedToCreate:
|
|
56
|
-
keycloak: ((
|
|
57
|
-
realm: ((
|
|
57
|
+
const { allowedToCreate: u } = X({
|
|
58
|
+
keycloak: ((g = (b = c.authentication) == null ? void 0 : b.keycloak) == null ? void 0 : g.url) || "https://keycloak.twin.bydata.de",
|
|
59
|
+
realm: ((w = (k = c.authentication) == null ? void 0 : k.keycloak) == null ? void 0 : w.realm) || "piveau",
|
|
58
60
|
audience: "piveau-hub-repo"
|
|
59
|
-
}),
|
|
60
|
-
var
|
|
61
|
-
return (
|
|
61
|
+
}), T = i(() => {
|
|
62
|
+
var a;
|
|
63
|
+
return (a = E.value) == null ? void 0 : a.map((e) => ({
|
|
62
64
|
id: e.id,
|
|
63
65
|
title: e.title,
|
|
64
66
|
modified: e.modified,
|
|
@@ -70,25 +72,32 @@ ${JSON.stringify(m.value)}`);
|
|
|
70
72
|
allowDelete: e.allowDelete
|
|
71
73
|
}));
|
|
72
74
|
});
|
|
73
|
-
|
|
74
|
-
console.error(
|
|
75
|
-
message:
|
|
75
|
+
U(o, () => {
|
|
76
|
+
console.error(o), P({
|
|
77
|
+
message: o.value.message,
|
|
76
78
|
color: "error"
|
|
77
79
|
});
|
|
78
80
|
});
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
const { isLoading: L } = G(C), m = p(!1);
|
|
82
|
+
async function h() {
|
|
83
|
+
await new Promise((a) => setTimeout(a, 2100)), f.refetch(), m.value = !1;
|
|
84
|
+
}
|
|
85
|
+
function H() {
|
|
86
|
+
m.value = !0, h();
|
|
87
|
+
}
|
|
88
|
+
const N = i(() => L.value || m.value);
|
|
89
|
+
return (a, e) => (l(), n("div", ee, [
|
|
90
|
+
s("div", ae, [
|
|
91
|
+
e[0] || (e[0] = s("h2", { class: "dpiV3_tableHeader" }, " Ihre Projekte ", -1)),
|
|
92
|
+
e[1] || (e[1] = s("p", null, "Hier sehen Sie alle Projekte, die Sie bearbeiten oder veröffentlichen können.", -1)),
|
|
93
|
+
s("div", te, [
|
|
94
|
+
(l(), _(R(r(u) ? "RouterLink" : "span"), {
|
|
95
|
+
disabled: !r(u),
|
|
87
96
|
to: { name: "DataProviderInterface-InputProject", query: { locale: "de", edit: !1 }, params: { property: "datasets" } }
|
|
88
97
|
}, {
|
|
89
|
-
default:
|
|
90
|
-
|
|
91
|
-
disabled: !r(
|
|
98
|
+
default: q(() => [
|
|
99
|
+
y(Z, {
|
|
100
|
+
disabled: !r(u),
|
|
92
101
|
"button-text": "Neues Projekt erstellen",
|
|
93
102
|
size: "large"
|
|
94
103
|
}, null, 8, ["disabled"])
|
|
@@ -97,25 +106,31 @@ ${JSON.stringify(m.value)}`);
|
|
|
97
106
|
}, 8, ["disabled"]))
|
|
98
107
|
])
|
|
99
108
|
]),
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
+
s("div", ie, [
|
|
110
|
+
N.value ? (l(), n("div", oe, [
|
|
111
|
+
y(r(W), {
|
|
112
|
+
size: 48,
|
|
113
|
+
weight: "bold",
|
|
114
|
+
class: "dpiV3_spinningIcon"
|
|
115
|
+
})
|
|
116
|
+
])) : (l(), n("div", le, [
|
|
117
|
+
e[2] || (e[2] = z('<div class="dpiV3_tableHeadWrap" data-v-cda1ef87><div class="dpiV3_thWrap" data-v-cda1ef87><div scope="col" data-v-cda1ef87><span data-v-cda1ef87>Name</span></div><div scope="col" class="dpiV3_statusHead" data-v-cda1ef87><span data-v-cda1ef87>Status</span></div><div scope="col" class="dpiV3_statusHead" data-v-cda1ef87><span data-v-cda1ef87>Sichtbarkeit</span></div></div><div class="dpiV3_blankCell" data-v-cda1ef87></div></div>', 1)),
|
|
118
|
+
s("div", null, [
|
|
119
|
+
(l(!0), n(A, null, F(T.value, (t, B) => (l(), _(j, {
|
|
120
|
+
id: t.id,
|
|
121
|
+
key: t.id ?? B,
|
|
109
122
|
type: "project",
|
|
110
|
-
text:
|
|
111
|
-
date:
|
|
112
|
-
dataset:
|
|
113
|
-
visibility:
|
|
114
|
-
draft:
|
|
115
|
-
catalogue:
|
|
116
|
-
"allow-edit":
|
|
117
|
-
"allow-publish":
|
|
118
|
-
"allow-delete":
|
|
123
|
+
text: t.title || "Kein Titel in englisch oder deutsch vohanden",
|
|
124
|
+
date: t.modified ? r(Y)(t.modified) : "-",
|
|
125
|
+
dataset: t,
|
|
126
|
+
visibility: t.visibility,
|
|
127
|
+
draft: t.publicationStatus === "draft",
|
|
128
|
+
catalogue: t.catalogId,
|
|
129
|
+
"allow-edit": t.allowEdit,
|
|
130
|
+
"allow-publish": t.allowPublish,
|
|
131
|
+
"allow-delete": t.allowDelete,
|
|
132
|
+
onComplete: h,
|
|
133
|
+
onStart: H
|
|
119
134
|
}, null, 8, ["id", "text", "date", "dataset", "visibility", "draft", "catalogue", "allow-edit", "allow-publish", "allow-delete"]))), 128))
|
|
120
135
|
])
|
|
121
136
|
]))
|
|
@@ -124,5 +139,5 @@ ${JSON.stringify(m.value)}`);
|
|
|
124
139
|
}
|
|
125
140
|
});
|
|
126
141
|
export {
|
|
127
|
-
|
|
142
|
+
ye as default
|
|
128
143
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Autocomplete.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-514c9e60"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
r as default
|
|
7
7
|
};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Combobox as
|
|
3
|
-
import { PhCaretUp as
|
|
1
|
+
import { defineComponent as w, mergeModels as L, useModel as k, computed as N, createElementBlock as s, openBlock as r, createVNode as i, unref as n, withCtx as d, createElementVNode as c, createBlock as m, createCommentVNode as f, renderSlot as _, createTextVNode as E, toDisplayString as b, normalizeClass as g, resolveDynamicComponent as F, Fragment as M, renderList as P } from "vue";
|
|
2
|
+
import { Combobox as S, ComboboxLabel as z, ComboboxButton as $, ComboboxInput as A, ComboboxOptions as I, ComboboxOption as O } from "@headlessui/vue";
|
|
3
|
+
import { PhCaretUp as U, PhCaretDown as K, PhCircleNotch as T } from "@phosphor-icons/vue";
|
|
4
4
|
const j = { class: "autocomplete" }, G = { class: "autocomplete__wrapper" }, H = { class: "autocomplete__input-icon" }, J = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "autocomplete__loading"
|
|
7
|
+
}, Q = {
|
|
5
8
|
key: 0,
|
|
6
9
|
class: "autocomplete__no-results"
|
|
7
|
-
},
|
|
10
|
+
}, Y = /* @__PURE__ */ w({
|
|
8
11
|
__name: "Autocomplete",
|
|
9
12
|
props: /* @__PURE__ */ L({
|
|
10
13
|
options: {},
|
|
@@ -12,6 +15,7 @@ const j = { class: "autocomplete" }, G = { class: "autocomplete__wrapper" }, H =
|
|
|
12
15
|
errorMessage: { default: "" },
|
|
13
16
|
placeholder: { default: "" },
|
|
14
17
|
name: { default: "" },
|
|
18
|
+
loading: { type: Boolean, default: !1 },
|
|
15
19
|
optionLabel: { type: Function, default: (u) => u },
|
|
16
20
|
optionValue: { type: Function, default: (u) => u },
|
|
17
21
|
optionDisabled: { type: Function, default: () => !1 }
|
|
@@ -23,110 +27,121 @@ const j = { class: "autocomplete" }, G = { class: "autocomplete__wrapper" }, H =
|
|
|
23
27
|
}),
|
|
24
28
|
emits: ["update:modelValue", "update:query"],
|
|
25
29
|
setup(u) {
|
|
26
|
-
const l = u, p =
|
|
27
|
-
function
|
|
30
|
+
const l = u, p = k(u, "modelValue"), y = k(u, "query"), v = N(() => !!l.errorMessage);
|
|
31
|
+
function B(e) {
|
|
28
32
|
e.open && e.event.stopPropagation();
|
|
29
33
|
}
|
|
30
|
-
function
|
|
34
|
+
function D(e) {
|
|
31
35
|
return typeof e == "string" ? l.optionLabel(e) : e.name || String(e.id);
|
|
32
36
|
}
|
|
33
|
-
function
|
|
37
|
+
function C(e) {
|
|
34
38
|
return typeof e == "string" ? l.optionValue(e) : String(e.id);
|
|
35
39
|
}
|
|
36
|
-
function
|
|
40
|
+
function V(e) {
|
|
37
41
|
return typeof e == "string" ? l.optionDisabled(e) : !!e.unavailable;
|
|
38
42
|
}
|
|
39
|
-
function
|
|
43
|
+
function q(e, o) {
|
|
40
44
|
if (!e || !o)
|
|
41
45
|
return !1;
|
|
42
46
|
if (e === o)
|
|
43
47
|
return !0;
|
|
44
48
|
if (typeof e == "string" && typeof o == "string")
|
|
45
49
|
return e === o;
|
|
46
|
-
const t =
|
|
50
|
+
const t = C(e), a = C(o);
|
|
47
51
|
return t === a;
|
|
48
52
|
}
|
|
49
|
-
function
|
|
53
|
+
function x(e) {
|
|
50
54
|
return !e || typeof e == "string" ? "" : e.name || "";
|
|
51
55
|
}
|
|
52
|
-
return (e, o) => (
|
|
53
|
-
|
|
56
|
+
return (e, o) => (r(), s("div", j, [
|
|
57
|
+
i(n(S), {
|
|
54
58
|
modelValue: p.value,
|
|
55
59
|
"onUpdate:modelValue": o[1] || (o[1] = (t) => p.value = t),
|
|
56
60
|
name: l.name,
|
|
57
|
-
by:
|
|
61
|
+
by: q,
|
|
58
62
|
nullable: ""
|
|
59
63
|
}, {
|
|
60
|
-
default:
|
|
64
|
+
default: d(() => [
|
|
61
65
|
c("div", G, [
|
|
62
|
-
l.label ? (
|
|
66
|
+
l.label ? (r(), m(n(z), {
|
|
63
67
|
key: 0,
|
|
64
68
|
class: "autocomplete__label",
|
|
65
69
|
as: "div"
|
|
66
70
|
}, {
|
|
67
|
-
default:
|
|
68
|
-
|
|
71
|
+
default: d(() => [
|
|
72
|
+
_(e.$slots, "label", {
|
|
69
73
|
label: l.label,
|
|
70
74
|
selected: p.value
|
|
71
75
|
}, () => [
|
|
72
|
-
|
|
76
|
+
E(b(l.label), 1)
|
|
73
77
|
], !0)
|
|
74
78
|
]),
|
|
75
79
|
_: 3
|
|
76
80
|
})) : f("", !0),
|
|
77
81
|
c("div", {
|
|
78
|
-
class:
|
|
82
|
+
class: g(["autocomplete__input-container", { "autocomplete__input-container--error": v.value }])
|
|
79
83
|
}, [
|
|
80
|
-
|
|
84
|
+
i(n($), {
|
|
81
85
|
as: "div",
|
|
82
86
|
class: "autocomplete__input-wrapper"
|
|
83
87
|
}, {
|
|
84
|
-
default:
|
|
85
|
-
|
|
88
|
+
default: d(({ open: t }) => [
|
|
89
|
+
i(n(A), {
|
|
86
90
|
class: "autocomplete__input",
|
|
87
|
-
"display-value": (a) =>
|
|
91
|
+
"display-value": (a) => x(a),
|
|
88
92
|
placeholder: l.placeholder,
|
|
89
|
-
onChange: o[0] || (o[0] = (a) =>
|
|
90
|
-
onClick: (a) =>
|
|
93
|
+
onChange: o[0] || (o[0] = (a) => y.value = a.target.value),
|
|
94
|
+
onClick: (a) => B({ event: a, open: t })
|
|
91
95
|
}, null, 8, ["display-value", "placeholder", "onClick"]),
|
|
92
96
|
c("div", H, [
|
|
93
|
-
(
|
|
97
|
+
(r(), m(F(t ? n(U) : n(K)), { size: "1.5rem" }))
|
|
94
98
|
])
|
|
95
99
|
]),
|
|
96
100
|
_: 1
|
|
97
101
|
})
|
|
98
102
|
], 2),
|
|
99
|
-
e.errorMessage ? (
|
|
103
|
+
e.errorMessage ? (r(), s("div", {
|
|
100
104
|
key: 1,
|
|
101
|
-
class:
|
|
102
|
-
},
|
|
105
|
+
class: g(["autocomplete__message", { "autocomplete__message--error": v.value }])
|
|
106
|
+
}, b(e.errorMessage), 3)) : f("", !0)
|
|
103
107
|
]),
|
|
104
|
-
|
|
108
|
+
i(n(I), {
|
|
105
109
|
class: "autocomplete__options",
|
|
106
110
|
as: "ul"
|
|
107
111
|
}, {
|
|
108
|
-
default:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
112
|
+
default: d(() => [
|
|
113
|
+
l.loading ? (r(), s("div", J, [
|
|
114
|
+
_(e.$slots, "loading", {}, () => [
|
|
115
|
+
i(n(T), {
|
|
116
|
+
size: "24px",
|
|
117
|
+
color: "#0172AD",
|
|
118
|
+
weight: "bold",
|
|
119
|
+
class: "autocomplete__loading-spinner"
|
|
120
|
+
})
|
|
121
|
+
], !0)
|
|
122
|
+
])) : (r(), s(M, { key: 1 }, [
|
|
123
|
+
(r(!0), s(M, null, P(l.options, (t) => (r(), m(n(O), {
|
|
124
|
+
key: typeof t == "string" ? t : t.id,
|
|
125
|
+
as: "template",
|
|
126
|
+
value: t,
|
|
127
|
+
disabled: V(t)
|
|
128
|
+
}, {
|
|
129
|
+
default: d(({ active: a, selected: h }) => [
|
|
130
|
+
_(e.$slots, "option", {
|
|
131
|
+
option: t,
|
|
132
|
+
active: a,
|
|
133
|
+
selected: h,
|
|
134
|
+
disabled: V(t)
|
|
135
|
+
}, () => [
|
|
136
|
+
c("li", {
|
|
137
|
+
class: g(["autocomplete__option", { "autocomplete__option--active": a, "autocomplete__option--selected": h }])
|
|
138
|
+
}, b(D(t)), 3)
|
|
139
|
+
], !0)
|
|
140
|
+
]),
|
|
141
|
+
_: 2
|
|
142
|
+
}, 1032, ["value", "disabled"]))), 128)),
|
|
143
|
+
l.options.length === 0 && y.value !== "" ? (r(), s("div", Q, " Keine Ergebnisse gefunden. ")) : f("", !0)
|
|
144
|
+
], 64))
|
|
130
145
|
]),
|
|
131
146
|
_: 3
|
|
132
147
|
})
|
|
@@ -137,5 +152,5 @@ const j = { class: "autocomplete" }, G = { class: "autocomplete__wrapper" }, H =
|
|
|
137
152
|
}
|
|
138
153
|
});
|
|
139
154
|
export {
|
|
140
|
-
|
|
155
|
+
Y as default
|
|
141
156
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./AutocompleteVocab.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ac1ed51f"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { PhSpinner as
|
|
3
|
-
import { defineHubSearch as
|
|
4
|
-
import { useDebounce as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const
|
|
1
|
+
import { defineComponent as K, mergeModels as P, computed as l, ref as M, useModel as W, watch as R, createBlock as B, openBlock as A, unref as v, createSlots as X, withCtx as D, createElementVNode as Y, createTextVNode as Z, createCommentVNode as w, toDisplayString as ee, renderSlot as re } from "vue";
|
|
2
|
+
import { PhSpinner as oe } from "@phosphor-icons/vue";
|
|
3
|
+
import { defineHubSearch as le } from "@piveau/sdk-vue";
|
|
4
|
+
import { useDebounce as p } from "@vueuse/core";
|
|
5
|
+
import te from "zod";
|
|
6
|
+
import se from "./Autocomplete.vue.js";
|
|
7
|
+
const ae = { class: "autocomplete-vocab__label" }, fe = /* @__PURE__ */ K({
|
|
8
8
|
__name: "AutocompleteVocab",
|
|
9
9
|
props: /* @__PURE__ */ P({
|
|
10
10
|
by: { default: "" },
|
|
@@ -20,30 +20,30 @@ const te = { class: "autocomplete-vocab__label" }, ve = /* @__PURE__ */ G({
|
|
|
20
20
|
isAutocompleteDisabled: { type: Boolean, default: !1 },
|
|
21
21
|
postProcessFn: {}
|
|
22
22
|
}, {
|
|
23
|
-
modelValue: { default:
|
|
23
|
+
modelValue: { default: "" },
|
|
24
24
|
modelModifiers: {}
|
|
25
25
|
}),
|
|
26
26
|
emits: /* @__PURE__ */ P(["select"], ["update:modelValue"]),
|
|
27
|
-
setup(
|
|
28
|
-
const r =
|
|
27
|
+
setup(b, { emit: I }) {
|
|
28
|
+
const r = b, U = I, u = l(() => !!r.vocabulary), m = l(() => r.by || u.value ? "vocabulary" : "resource"), _ = l(() => r.resource === "dataset" ? "dataset" : u.value ? "vocabulary" : m.value), k = l(() => r.resource === "dataset" ? "datasets" : u.value ? "vocabularies" : m.value === "resource" ? `resources/${r.resource}` : "vocabularies"), E = l(() => !r.isAutocompleteDisabled && !!(r.resource || r.vocabulary)), { useSearch: L, useResource: $ } = le({
|
|
29
29
|
baseUrl: r.baseUrl,
|
|
30
|
-
index:
|
|
31
|
-
indexDetails:
|
|
32
|
-
schema:
|
|
30
|
+
index: _.value,
|
|
31
|
+
indexDetails: k.value,
|
|
32
|
+
schema: te.any()
|
|
33
33
|
}, (e) => {
|
|
34
|
-
var d,
|
|
35
|
-
const o = (d = r.setupFn) == null ? void 0 : d.call(r, e), s = String((o == null ? void 0 : o.id) || (e == null ? void 0 : e.resource) || ""), n = String((o == null ? void 0 : o.name) || ((
|
|
34
|
+
var d, V, F;
|
|
35
|
+
const o = (d = r.setupFn) == null ? void 0 : d.call(r, e), s = String((o == null ? void 0 : o.id) || (e == null ? void 0 : e.resource) || ""), n = String((o == null ? void 0 : o.name) || ((V = e == null ? void 0 : e.pref_label) == null ? void 0 : V.de) || ((F = e == null ? void 0 : e.pref_label) == null ? void 0 : F.en) || "");
|
|
36
36
|
return {
|
|
37
37
|
...o,
|
|
38
38
|
id: s,
|
|
39
39
|
name: n
|
|
40
40
|
};
|
|
41
|
-
}),
|
|
41
|
+
}), f = M(""), C = p(f, 300), N = l(() => r.vocabulary), { getSearchResultsEnhanced: O, isFetching: x } = L({
|
|
42
42
|
queryOptions: {
|
|
43
|
-
enabled:
|
|
43
|
+
enabled: E
|
|
44
44
|
},
|
|
45
45
|
queryParams: {
|
|
46
|
-
q:
|
|
46
|
+
q: C,
|
|
47
47
|
limit: 12,
|
|
48
48
|
// ...vocabularyRef.value
|
|
49
49
|
// ? { vocabulary: vocabularyRef }
|
|
@@ -52,28 +52,28 @@ const te = { class: "autocomplete-vocab__label" }, ve = /* @__PURE__ */ G({
|
|
|
52
52
|
// resource: computed(() => props.resource || ''),
|
|
53
53
|
},
|
|
54
54
|
additionalParams: l(() => ({
|
|
55
|
-
resource:
|
|
55
|
+
resource: m.value === "resource" ? r.resource : ""
|
|
56
56
|
}))
|
|
57
|
-
}),
|
|
57
|
+
}), z = l(() => {
|
|
58
58
|
let e = O.value || [];
|
|
59
59
|
return r.postProcessFn && (e = r.postProcessFn(e)), e;
|
|
60
|
-
}), t =
|
|
60
|
+
}), t = W(b, "modelValue"), y = l(() => !(!t.value || typeof t.value == "string")), T = l(() => typeof t.value == "string");
|
|
61
61
|
function i(e) {
|
|
62
62
|
return String(e ?? "").trim();
|
|
63
63
|
}
|
|
64
64
|
const c = l(() => {
|
|
65
65
|
var e;
|
|
66
66
|
return typeof t.value == "string" ? i(t.value) : i((e = t.value) == null ? void 0 : e.id);
|
|
67
|
-
}),
|
|
68
|
-
resultEnhanced:
|
|
69
|
-
isSuccess:
|
|
70
|
-
|
|
71
|
-
} =
|
|
72
|
-
additionalParams:
|
|
67
|
+
}), g = l(() => T.value && !!c.value), j = l(() => g.value ? u.value ? `${r.vocabulary}/vocable` : c.value : ""), H = l(() => u.value ? { resource: c.value } : {}), {
|
|
68
|
+
resultEnhanced: Q,
|
|
69
|
+
isSuccess: ue,
|
|
70
|
+
isFetching: G
|
|
71
|
+
} = $(j, {
|
|
72
|
+
additionalParams: H,
|
|
73
73
|
queryOptions: {
|
|
74
|
-
enabled:
|
|
74
|
+
enabled: g
|
|
75
75
|
}
|
|
76
|
-
}),
|
|
76
|
+
}), h = p(G, 350), J = p(x, 350), a = M(), S = l({
|
|
77
77
|
get: () => {
|
|
78
78
|
var s, n;
|
|
79
79
|
const e = c.value;
|
|
@@ -94,48 +94,49 @@ const te = { class: "autocomplete-vocab__label" }, ve = /* @__PURE__ */ G({
|
|
|
94
94
|
a.value = e, t.value = i(e.id);
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
|
-
return R(
|
|
98
|
-
e && (o && o.id === e.id || (a.value = e,
|
|
97
|
+
return R(Q, (e, o) => {
|
|
98
|
+
e && (o && o.id === e.id || (a.value = e, y.value && (t.value = e), y.value || (t.value = i(e.id))));
|
|
99
99
|
}, { immediate: !0 }), R(a, (e) => {
|
|
100
100
|
e && U("select", e);
|
|
101
|
-
}, { immediate: !0 }), (e, o) => (
|
|
102
|
-
modelValue:
|
|
103
|
-
"onUpdate:modelValue": o[0] || (o[0] = (s) =>
|
|
104
|
-
query:
|
|
105
|
-
"onUpdate:query": o[1] || (o[1] = (s) =>
|
|
106
|
-
options:
|
|
101
|
+
}, { immediate: !0 }), (e, o) => (A(), B(se, {
|
|
102
|
+
modelValue: S.value,
|
|
103
|
+
"onUpdate:modelValue": o[0] || (o[0] = (s) => S.value = s),
|
|
104
|
+
query: f.value,
|
|
105
|
+
"onUpdate:query": o[1] || (o[1] = (s) => f.value = s),
|
|
106
|
+
options: z.value || [],
|
|
107
107
|
label: e.label,
|
|
108
108
|
"error-message": e.errorMessage,
|
|
109
109
|
placeholder: e.placeholder,
|
|
110
110
|
name: e.name,
|
|
111
|
-
disabled:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
111
|
+
disabled: v(h) || r.disabled,
|
|
112
|
+
loading: v(J)
|
|
113
|
+
}, X({
|
|
114
|
+
label: D(() => [
|
|
115
|
+
Y("div", ae, [
|
|
116
|
+
Z(ee(e.label) + " ", 1),
|
|
117
|
+
v(h) ? (A(), B(v(oe), {
|
|
117
118
|
key: 0,
|
|
118
119
|
class: "animate-spin"
|
|
119
|
-
})) :
|
|
120
|
+
})) : w("", !0)
|
|
120
121
|
])
|
|
121
122
|
]),
|
|
122
123
|
_: 2
|
|
123
124
|
}, [
|
|
124
125
|
e.$slots.option ? {
|
|
125
126
|
name: "option",
|
|
126
|
-
fn:
|
|
127
|
-
|
|
127
|
+
fn: D(({ option: s, active: n, selected: q, disabled: d }) => [
|
|
128
|
+
re(e.$slots, "option", {
|
|
128
129
|
option: s,
|
|
129
130
|
active: n,
|
|
130
|
-
selected:
|
|
131
|
+
selected: q,
|
|
131
132
|
disabled: d
|
|
132
133
|
}, void 0, !0)
|
|
133
134
|
]),
|
|
134
135
|
key: "0"
|
|
135
136
|
} : void 0
|
|
136
|
-
]), 1032, ["modelValue", "query", "options", "label", "error-message", "placeholder", "name", "disabled"]));
|
|
137
|
+
]), 1032, ["modelValue", "query", "options", "label", "error-message", "placeholder", "name", "disabled", "loading"]));
|
|
137
138
|
}
|
|
138
139
|
});
|
|
139
140
|
export {
|
|
140
|
-
|
|
141
|
+
fe as default
|
|
141
142
|
};
|