@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.
Files changed (20) hide show
  1. package/dist/assets/dpi.css +1 -1
  2. package/dist/packages/dpi/src/data-provider-interface/DataProviderInterface.vue.js +22 -16
  3. package/dist/packages/dpi/src/data-provider-interface/DataProviderInterface.vue2.js +34 -32
  4. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/HomeTable.vue.js +87 -71
  5. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ProjectTable.vue.js +2 -2
  6. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ProjectTable.vue2.js +88 -73
  7. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/Autocomplete/Autocomplete.vue.js +2 -2
  8. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/Autocomplete/Autocomplete.vue2.js +70 -55
  9. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/Autocomplete/AutocompleteVocab.vue.js +2 -2
  10. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/Autocomplete/AutocompleteVocab.vue2.js +50 -49
  11. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ButtonV3.vue.js +115 -83
  12. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ReviewStep/ReviewStep.vue.js +1 -1
  13. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ReviewStep/ReviewStep.vue2.js +111 -107
  14. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/TableRowV3.vue.js +127 -122
  15. package/dist/packages/dpi/src/data-provider-interface/components/StepActionsSection.vue.js +2 -2
  16. package/dist/packages/dpi/src/data-provider-interface/components/StepActionsSection.vue2.js +72 -68
  17. package/dist/packages/dpi/src/data-provider-interface/composables/useDebouncedLoading.js +11 -0
  18. package/dist/packages/dpi/src/data-provider-interface/composables/useProjectActions.js +37 -37
  19. package/dist/packages/dpi/src/data-provider-interface/views/InputPageProject.vue.js +218 -216
  20. package/package.json +1 -1
@@ -1,40 +1,42 @@
1
- import { defineComponent as H, ref as b, computed as i, watch as C, createElementBlock as n, openBlock as s, createElementVNode as o, createBlock as g, resolveDynamicComponent as N, unref as r, withCtx as x, createVNode as B, createStaticVNode as L, Fragment as U, renderList as R } from "vue";
2
- import { whenever as q, useDebounce as W } from "@vueuse/core";
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 $ } from "vue-router";
6
- import { useStore as z } from "vuex";
7
- import { useRuntimeEnv as F } from "../../composables/useRuntimeEnv.js";
8
- import { useErrorDialog as J } from "../composables/useErrorDialog.js";
9
- import { useProjectSearch as O } from "../composables/useTwinbyHome.js";
10
- import { useTwinbyUser as A } from "../composables/useTwinbyUser.js";
11
- import { formatDate as K } from "../utils/formatDate.js";
12
- import G from "./ui/ButtonV3.vue.js";
13
- import M from "./ui/TableRowV3.vue.js";
14
- const Q = { class: "dpiV3_dpiHome V3-typography" }, X = { class: "dpiV3_homeHeadWrap" }, Y = { class: "interactionButtonsDPIHome" }, Z = { class: "dpiV3_table" }, j = {
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: "loading-screen"
17
- }, ee = {
18
+ class: "dpiV3_loadingSkeleton"
19
+ }, le = {
18
20
  key: 1,
19
21
  class: "dpiV3_innerTable"
20
- }, fe = /* @__PURE__ */ H({
22
+ }, ye = /* @__PURE__ */ x({
21
23
  __name: "ProjectTable",
22
- setup(ae) {
23
- var p, v, f, h;
24
- const u = F(), d = z();
25
- $(), localStorage.getItem("dpi_duplicate"), b(""), i(() => d.getters["auth/getUserCatalogIds"]), b({
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 k = i(() => d.getters["auth/getUserData"]);
31
- i(() => k.value.rtpToken);
32
- const w = (t) => d.dispatch("snackbar/showSnackbar", t), _ = i(() => {
33
- var t, e;
34
- return (e = (t = d.getters) == null ? void 0 : t["auth/getUserData"]) == null ? void 0 : e.authToken;
35
- }), { useSearch: y } = O(u.api.baseUrl), m = i(() => ({
36
- Authorization: `Bearer ${_.value}`
37
- })), { getSearchResultsEnhanced: S, isLoading: P, query: V } = y({
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: m
46
- }), l = i(() => V.error.value), { openErrorDialog: D } = J();
47
- q(l, () => {
48
- if (!l.value)
47
+ headers: v
48
+ }), o = i(() => f.error.value), { openErrorDialog: I } = M();
49
+ $(o, () => {
50
+ if (!o.value)
49
51
  return;
50
- const t = new Error(`${JSON.stringify(l.value)}
52
+ const a = new Error(`${JSON.stringify(o.value)}
51
53
 
52
- ${JSON.stringify(m.value)}`);
53
- D(t, "Fehler beim Laden der Projekte");
54
+ ${JSON.stringify(v.value)}`);
55
+ I(a, "Fehler beim Laden der Projekte");
54
56
  });
55
- const { allowedToCreate: c } = A({
56
- keycloak: ((v = (p = u.authentication) == null ? void 0 : p.keycloak) == null ? void 0 : v.url) || "https://keycloak.twin.bydata.de",
57
- realm: ((h = (f = u.authentication) == null ? void 0 : f.keycloak) == null ? void 0 : h.realm) || "piveau",
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
- }), E = i(() => {
60
- var t;
61
- return (t = S.value) == null ? void 0 : t.map((e) => ({
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
- C(l, () => {
74
- console.error(l), w({
75
- message: l.value.message,
75
+ U(o, () => {
76
+ console.error(o), P({
77
+ message: o.value.message,
76
78
  color: "error"
77
79
  });
78
80
  });
79
- const I = W(P, 500);
80
- return (t, e) => (s(), n("div", Q, [
81
- o("div", X, [
82
- e[0] || (e[0] = o("h2", { class: "dpiV3_tableHeader" }, " Ihre Projekte ", -1)),
83
- e[1] || (e[1] = o("p", null, "Hier sehen Sie alle Projekte, die Sie bearbeiten oder veröffentlichen können.", -1)),
84
- o("div", Y, [
85
- (s(), g(N(r(c) ? "RouterLink" : "span"), {
86
- disabled: !r(c),
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: x(() => [
90
- B(G, {
91
- disabled: !r(c),
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
- o("div", Z, [
101
- r(I) ? (s(), n("div", j, e[2] || (e[2] = [
102
- o("p", null, "Lädt Daten...", -1)
103
- ]))) : (s(), n("div", ee, [
104
- e[3] || (e[3] = L('<div class="dpiV3_tableHeadWrap" data-v-1cfd553a><div class="dpiV3_thWrap" data-v-1cfd553a><div scope="col" data-v-1cfd553a><span data-v-1cfd553a>Name</span></div><div scope="col" class="dpiV3_statusHead" data-v-1cfd553a><span data-v-1cfd553a>Status</span></div><div scope="col" class="dpiV3_statusHead" data-v-1cfd553a><span data-v-1cfd553a>Sichtbarkeit</span></div></div><div class="dpiV3_blankCell" data-v-1cfd553a></div></div>', 1)),
105
- o("div", null, [
106
- (s(!0), n(U, null, R(E.value, (a, T) => (s(), g(M, {
107
- id: a.id,
108
- key: a.id ?? T,
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: a.title || "Kein Titel in englisch oder deutsch vohanden",
111
- date: a.modified ? r(K)(a.modified) : "-",
112
- dataset: a,
113
- visibility: a.visibility,
114
- draft: a.publicationStatus === "draft",
115
- catalogue: a.catalogId,
116
- "allow-edit": a.allowEdit,
117
- "allow-publish": a.allowPublish,
118
- "allow-delete": a.allowDelete
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
- fe as default
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 a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d965a582"]]);
4
+ const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-514c9e60"]]);
5
5
  export {
6
- a as default
6
+ r as default
7
7
  };
@@ -1,10 +1,13 @@
1
- import { defineComponent as D, mergeModels as L, useModel as h, computed as N, createElementBlock as i, openBlock as n, createVNode as d, unref as r, withCtx as s, createElementVNode as c, createBlock as m, createCommentVNode as f, renderSlot as k, createTextVNode as w, toDisplayString as _, normalizeClass as b, resolveDynamicComponent as F, Fragment as S, renderList as E } from "vue";
2
- import { Combobox as P, ComboboxLabel as z, ComboboxButton as I, ComboboxInput as O, ComboboxOptions as U, ComboboxOption as $ } from "@headlessui/vue";
3
- import { PhCaretUp as A, PhCaretDown as T } from "@phosphor-icons/vue";
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
- }, W = /* @__PURE__ */ D({
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 = h(u, "modelValue"), v = h(u, "query"), y = N(() => !!l.errorMessage);
27
- function M(e) {
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 q(e) {
34
+ function D(e) {
31
35
  return typeof e == "string" ? l.optionLabel(e) : e.name || String(e.id);
32
36
  }
33
- function g(e) {
37
+ function C(e) {
34
38
  return typeof e == "string" ? l.optionValue(e) : String(e.id);
35
39
  }
36
- function C(e) {
40
+ function V(e) {
37
41
  return typeof e == "string" ? l.optionDisabled(e) : !!e.unavailable;
38
42
  }
39
- function x(e, o) {
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 = g(e), a = g(o);
50
+ const t = C(e), a = C(o);
47
51
  return t === a;
48
52
  }
49
- function B(e) {
53
+ function x(e) {
50
54
  return !e || typeof e == "string" ? "" : e.name || "";
51
55
  }
52
- return (e, o) => (n(), i("div", j, [
53
- d(r(P), {
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: x,
61
+ by: q,
58
62
  nullable: ""
59
63
  }, {
60
- default: s(() => [
64
+ default: d(() => [
61
65
  c("div", G, [
62
- l.label ? (n(), m(r(z), {
66
+ l.label ? (r(), m(n(z), {
63
67
  key: 0,
64
68
  class: "autocomplete__label",
65
69
  as: "div"
66
70
  }, {
67
- default: s(() => [
68
- k(e.$slots, "label", {
71
+ default: d(() => [
72
+ _(e.$slots, "label", {
69
73
  label: l.label,
70
74
  selected: p.value
71
75
  }, () => [
72
- w(_(l.label), 1)
76
+ E(b(l.label), 1)
73
77
  ], !0)
74
78
  ]),
75
79
  _: 3
76
80
  })) : f("", !0),
77
81
  c("div", {
78
- class: b(["autocomplete__input-container", { "autocomplete__input-container--error": y.value }])
82
+ class: g(["autocomplete__input-container", { "autocomplete__input-container--error": v.value }])
79
83
  }, [
80
- d(r(I), {
84
+ i(n($), {
81
85
  as: "div",
82
86
  class: "autocomplete__input-wrapper"
83
87
  }, {
84
- default: s(({ open: t }) => [
85
- d(r(O), {
88
+ default: d(({ open: t }) => [
89
+ i(n(A), {
86
90
  class: "autocomplete__input",
87
- "display-value": (a) => B(a),
91
+ "display-value": (a) => x(a),
88
92
  placeholder: l.placeholder,
89
- onChange: o[0] || (o[0] = (a) => v.value = a.target.value),
90
- onClick: (a) => M({ event: a, open: t })
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
- (n(), m(F(t ? r(A) : r(T)), { size: "1.5rem" }))
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 ? (n(), i("div", {
103
+ e.errorMessage ? (r(), s("div", {
100
104
  key: 1,
101
- class: b(["autocomplete__message", { "autocomplete__message--error": y.value }])
102
- }, _(e.errorMessage), 3)) : f("", !0)
105
+ class: g(["autocomplete__message", { "autocomplete__message--error": v.value }])
106
+ }, b(e.errorMessage), 3)) : f("", !0)
103
107
  ]),
104
- d(r(U), {
108
+ i(n(I), {
105
109
  class: "autocomplete__options",
106
110
  as: "ul"
107
111
  }, {
108
- default: s(() => [
109
- (n(!0), i(S, null, E(l.options, (t) => (n(), m(r($), {
110
- key: typeof t == "string" ? t : t.id,
111
- as: "template",
112
- value: t,
113
- disabled: C(t)
114
- }, {
115
- default: s(({ active: a, selected: V }) => [
116
- k(e.$slots, "option", {
117
- option: t,
118
- active: a,
119
- selected: V,
120
- disabled: C(t)
121
- }, () => [
122
- c("li", {
123
- class: b(["autocomplete__option", { "autocomplete__option--active": a, "autocomplete__option--selected": V }])
124
- }, _(q(t)), 3)
125
- ], !0)
126
- ]),
127
- _: 2
128
- }, 1032, ["value", "disabled"]))), 128)),
129
- l.options.length === 0 && v.value !== "" ? (n(), i("div", J, " No results found. ")) : f("", !0)
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
- W as default
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 r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-36e5f0b6"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ac1ed51f"]]);
5
5
  export {
6
- r as default
6
+ m as default
7
7
  };
@@ -1,10 +1,10 @@
1
- import { defineComponent as G, mergeModels as P, computed as l, ref as M, useModel as J, watch as R, createBlock as B, openBlock as F, unref as f, createSlots as K, withCtx as A, createElementVNode as W, createTextVNode as X, createCommentVNode as Y, toDisplayString as Z, renderSlot as w } from "vue";
2
- import { PhSpinner as ee } from "@phosphor-icons/vue";
3
- import { defineHubSearch as re } from "@piveau/sdk-vue";
4
- import { useDebounce as D } from "@vueuse/core";
5
- import oe from "zod";
6
- import le from "./Autocomplete.vue.js";
7
- const te = { class: "autocomplete-vocab__label" }, ve = /* @__PURE__ */ G({
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(p, { emit: I }) {
28
- const r = p, U = I, u = l(() => !!r.vocabulary), v = l(() => r.by || u.value ? "vocabulary" : "resource"), k = l(() => r.resource === "dataset" ? "dataset" : u.value ? "vocabulary" : v.value), E = l(() => r.resource === "dataset" ? "datasets" : u.value ? "vocabularies" : v.value === "resource" ? `resources/${r.resource}` : "vocabularies"), _ = l(() => !r.isAutocompleteDisabled && !!(r.resource || r.vocabulary)), { useSearch: $, useResource: C } = re({
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: k.value,
31
- indexDetails: E.value,
32
- schema: oe.any()
30
+ index: _.value,
31
+ indexDetails: k.value,
32
+ schema: te.any()
33
33
  }, (e) => {
34
- var d, q, V;
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) || ((q = e == null ? void 0 : e.pref_label) == null ? void 0 : q.de) || ((V = e == null ? void 0 : e.pref_label) == null ? void 0 : V.en) || "");
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
- }), m = M(""), L = D(m, 300), N = l(() => r.vocabulary), { getSearchResultsEnhanced: O } = $({
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: L,
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: v.value === "resource" ? r.resource : ""
55
+ resource: m.value === "resource" ? r.resource : ""
56
56
  }))
57
- }), x = l(() => {
57
+ }), z = l(() => {
58
58
  let e = O.value || [];
59
59
  return r.postProcessFn && (e = r.postProcessFn(e)), e;
60
- }), t = J(p, "modelValue"), b = l(() => !(!t.value || typeof t.value == "string")), z = l(() => typeof t.value == "string");
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
- }), y = l(() => z.value && !!c.value), T = l(() => y.value ? u.value ? `${r.vocabulary}/vocable` : c.value : ""), j = l(() => u.value ? { resource: c.value } : {}), {
68
- resultEnhanced: H,
69
- isSuccess: se,
70
- isLoading: Q
71
- } = C(T, {
72
- additionalParams: j,
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: y
74
+ enabled: g
75
75
  }
76
- }), g = D(Q, 350), a = M(), h = l({
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(H, (e, o) => {
98
- e && (o && o.id === e.id || (a.value = e, b.value && (t.value = e), b.value || (t.value = i(e.id))));
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) => (F(), B(le, {
102
- modelValue: h.value,
103
- "onUpdate:modelValue": o[0] || (o[0] = (s) => h.value = s),
104
- query: m.value,
105
- "onUpdate:query": o[1] || (o[1] = (s) => m.value = s),
106
- options: x.value || [],
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: f(g) || r.disabled
112
- }, K({
113
- label: A(() => [
114
- W("div", te, [
115
- X(Z(e.label) + " ", 1),
116
- f(g) ? (F(), B(f(ee), {
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
- })) : Y("", !0)
120
+ })) : w("", !0)
120
121
  ])
121
122
  ]),
122
123
  _: 2
123
124
  }, [
124
125
  e.$slots.option ? {
125
126
  name: "option",
126
- fn: A(({ option: s, active: n, selected: S, disabled: d }) => [
127
- w(e.$slots, "option", {
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: S,
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
- ve as default
141
+ fe as default
141
142
  };