@piveau/dpi 0.1.0-beta.6 → 0.1.0-beta.7

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,14 +1,15 @@
1
- import { ref as u, watch as K, createElementBlock as N, openBlock as p, Fragment as U, createElementVNode as o, createBlock as v, createCommentVNode as k, withKeys as b, normalizeClass as $, withModifiers as h, unref as s, toDisplayString as y, createVNode as H, isRef as T } from "vue";
2
- import x from "./StateTag.vue.js";
3
- import L from "./Dropdown.vue.js";
4
- import j from "./ModalSimpleV3.vue.js";
5
- import q from "./Toast.vue.js";
6
- import { useStore as F } from "vuex";
7
- import { useRouter as J } from "vue-router";
8
- import { useDpiUtils as O } from "../../composables/useDpiUtils.js";
1
+ import { ref as u, watch as $, createElementBlock as N, openBlock as c, Fragment as H, createElementVNode as o, createBlock as m, createCommentVNode as g, withKeys as v, normalizeClass as L, withModifiers as b, unref as n, toDisplayString as x, isRef as T } from "vue";
2
+ import _ from "./StateTag.vue.js";
3
+ import j from "./Dropdown.vue.js";
4
+ import q from "./ModalSimpleV3.vue.js";
5
+ import F from "./Toast.vue.js";
6
+ import { useStore as J } from "vuex";
7
+ import { useRouter as O } from "vue-router";
8
+ import { useDpiUtils as W } from "../../composables/useDpiUtils.js";
9
9
  /* empty css */
10
- import W from "../../../_virtual/_plugin-vue_export-helper.js";
11
- const G = { class: "dpiV3_tableRowInner" }, P = { class: "dpiV3_TableRowDescContainer" }, Q = { class: "dpiV3_dsDesc" }, X = { class: "dpiV3_TableRowStatus" }, Y = { class: "dpiV3_TableRowUpdated" }, Z = { class: "dpiV3_TableRowButtonWrap" }, ee = {
10
+ import G from "../../../_virtual/_plugin-vue_export-helper.js";
11
+ import { useDpiContext as S } from "../../composables/useDpiContext.js";
12
+ const P = { class: "dpiV3_tableRowInner" }, Q = { class: "dpiV3_TableRowDescContainer" }, X = { class: "dpiV3_dsDesc" }, Y = { class: "dpiV3_TableRowStatus" }, Z = { class: "dpiV3_TableRowUpdated" }, ee = { class: "dpiV3_TableRowButtonWrap" }, te = {
12
13
  __name: "TableRowV3",
13
14
  props: {
14
15
  text: {
@@ -27,30 +28,31 @@ const G = { class: "dpiV3_tableRowInner" }, P = { class: "dpiV3_TableRowDescCont
27
28
  catalogue: String,
28
29
  dataset: Object
29
30
  },
30
- setup(_) {
31
- const m = F();
32
- J();
33
- let r = u(!1), l = u(!1), c = u(!1), i = u({}), d = u({});
34
- const n = _, { toEditMode: S } = O(), z = () => {
35
- const t = n.draft, e = n.catalogue, a = n.id || n.dataset.id || n.catalogue.id;
36
- S({ id: a, catalogId: e, isDraft: t, locale: "de" });
37
- }, R = (t, e, a, A) => {
38
- console.log(n.dataset), m.dispatch("auth/putDatasetToDraft", { id: t, catalog: e, title: a, description: A });
39
- }, B = (t, e) => {
40
- m.dispatch("auth/deleteUserDraftById", { id: t, catalog: e });
41
- }, C = (t, e) => {
42
- m.dispatch("auth/publishUserDraftById", { id: t, catalog: e });
43
- }, M = () => {
44
- c.value = !1, setTimeout(() => {
31
+ setup(z) {
32
+ const h = J();
33
+ O();
34
+ let r = u(!1), l = u(!1), f = u(!1), i = u({}), d = u({}), D = u({ edit: { fromDraft: !1 } });
35
+ S() && (D = S());
36
+ const s = z, { toEditMode: R } = W(), B = () => {
37
+ const t = s.draft, e = s.catalogue, a = s.id || s.dataset.id || s.catalogue.id;
38
+ R({ id: a, catalogId: e, isDraft: t, locale: "de" });
39
+ }, C = (t, e, a, U) => {
40
+ console.log(s.dataset), h.dispatch("auth/putDatasetToDraft", { id: t, catalog: e, title: a, description: U });
41
+ }, M = (t, e) => {
42
+ h.dispatch("auth/deleteUserDraftById", { id: t, catalog: e });
43
+ }, E = (t, e) => {
44
+ h.dispatch("auth/publishUserDraftById", { id: t, catalog: e });
45
+ }, I = () => {
46
+ f.value = !1, setTimeout(() => {
45
47
  l.value = !1;
46
48
  }, 2e3);
47
49
  };
48
- K(l, (t) => {
50
+ $(l, (t) => {
49
51
  t && setTimeout(() => {
50
- c.value || (l.value = !1);
52
+ f.value || (l.value = !1);
51
53
  }, 2e3);
52
54
  });
53
- const E = () => n.draft ? [
55
+ const A = () => s.draft ? [
54
56
  { "@value": "Bearbeiten", selected: !1 },
55
57
  { "@value": "Veröffentlichen", selected: !1 },
56
58
  { "@value": "Löschen", selected: !1 }
@@ -58,10 +60,10 @@ const G = { class: "dpiV3_tableRowInner" }, P = { class: "dpiV3_TableRowDescCont
58
60
  { "@value": "Bearbeiten", selected: !1 },
59
61
  { "@value": "Veröffentlichung aufheben", selected: !1 },
60
62
  { "@value": "Löschen", selected: !1 }
61
- ], I = (t) => {
63
+ ], K = (t) => {
62
64
  switch (t) {
63
65
  case "publishDataset":
64
- C(n.id, n.catalogue), console.log("Datensatz wird veröffentlicht"), l.value = !0, d.value = {
66
+ E(s.id, s.catalogue), console.log("Datensatz wird veröffentlicht"), l.value = !0, d.value = {
65
67
  type: "success",
66
68
  text: "Der Datensatz wurde veröffentlicht",
67
69
  button: "Ansehen",
@@ -69,7 +71,7 @@ const G = { class: "dpiV3_tableRowInner" }, P = { class: "dpiV3_TableRowDescCont
69
71
  };
70
72
  break;
71
73
  case "deleteDataset":
72
- B(n.id, n.catalogue), l.value = !0, d.value = {
74
+ M(s.id, s.catalogue), l.value = !0, d.value = {
73
75
  type: "success",
74
76
  text: "Der Datensatz wurde erfolgreich gelöscht",
75
77
  button: "Rückgängig machen",
@@ -77,11 +79,11 @@ const G = { class: "dpiV3_tableRowInner" }, P = { class: "dpiV3_TableRowDescCont
77
79
  };
78
80
  break;
79
81
  case "setToDraft":
80
- R(
81
- n.dataset.id,
82
- n.dataset.catalog.id,
83
- n.dataset.title,
84
- n.dataset.description
82
+ C(
83
+ s.dataset.id,
84
+ s.dataset.catalog.id,
85
+ s.dataset.title,
86
+ s.dataset.description
85
87
  ), l.value = !0, d.value = {
86
88
  type: "success",
87
89
  text: "Der Datensatz wurde erfolgreich zu einem Entwurf zurückgesetzt",
@@ -89,11 +91,11 @@ const G = { class: "dpiV3_tableRowInner" }, P = { class: "dpiV3_TableRowDescCont
89
91
  action: "revertToDraft"
90
92
  };
91
93
  }
92
- }, g = (t) => {
94
+ }, w = (t) => {
93
95
  let e = "";
94
96
  switch (typeof t == "string" ? e = t : e = t.target.innerText, e) {
95
97
  case "Bearbeiten":
96
- z();
98
+ B();
97
99
  break;
98
100
  case "Veröffentlichen":
99
101
  i.value = {
@@ -121,87 +123,88 @@ const G = { class: "dpiV3_tableRowInner" }, P = { class: "dpiV3_TableRowDescCont
121
123
  break;
122
124
  }
123
125
  };
124
- let f = u(!1);
125
- const D = (t, e) => {
126
- e ? f.value = !0 : f.value = !1;
127
- }, w = (t) => {
128
- t.target.className != "dpiV3_more-button dpiV3_activeState" && (f.value = !0);
129
- }, V = (t) => {
130
- t.target.className != "dpiV3_more-button dpiV3_activeState" && (f.value = !1);
126
+ let p = u(!1);
127
+ const V = (t, e) => {
128
+ e ? p.value = !0 : p.value = !1;
129
+ }, k = (t) => {
130
+ t.target.className != "dpiV3_more-button dpiV3_activeState" && (p.value = !0);
131
+ }, y = (t) => {
132
+ t.target.className != "dpiV3_more-button dpiV3_activeState" && (p.value = !1);
131
133
  };
132
- return (t, e) => (p(), N(U, null, [
134
+ return (t, e) => (c(), N(H, null, [
133
135
  o("button", {
134
- class: $(["dpiV3_tableRowWrapper", {
135
- dpiV3_pressedTableRow: s(f),
136
- tRowInDraft: n.fromDraft
136
+ class: L(["dpiV3_tableRowWrapper", {
137
+ dpiV3_pressedTableRow: n(p),
138
+ tRowInDraft: s.fromDraft
137
139
  }]),
138
140
  onKeydown: [
139
- e[3] || (e[3] = b(h((a) => w(a), ["prevent"]), ["space"])),
140
- e[4] || (e[4] = b(h((a) => w(a), ["prevent"]), ["enter"]))
141
+ e[3] || (e[3] = v(b((a) => k(a), ["prevent"]), ["space"])),
142
+ e[4] || (e[4] = v(b((a) => k(a), ["prevent"]), ["enter"]))
141
143
  ],
142
144
  onKeyup: [
143
- e[5] || (e[5] = b((a) => V(a), ["space"])),
144
- e[6] || (e[6] = b((a) => V(a), ["enter"]))
145
+ e[5] || (e[5] = v((a) => y(a), ["space"])),
146
+ e[6] || (e[6] = v((a) => y(a), ["enter"]))
145
147
  ]
146
148
  }, [
147
- o("div", G, [
149
+ o("div", P, [
148
150
  o("div", {
149
151
  class: "dpiV3_tableRowContent",
150
- onMousedown: e[0] || (e[0] = h((a) => D(a, !0), ["prevent"])),
151
- onMouseup: e[1] || (e[1] = h((a) => D(a, !1), ["prevent"])),
152
- onClick: e[2] || (e[2] = (a) => g("Bearbeiten"))
152
+ onMousedown: e[0] || (e[0] = b((a) => V(a, !0), ["prevent"])),
153
+ onMouseup: e[1] || (e[1] = b((a) => V(a, !1), ["prevent"])),
154
+ onClick: e[2] || (e[2] = (a) => w("Bearbeiten"))
153
155
  }, [
154
- o("div", P, [
155
- o("span", Q, y(n.text), 1)
156
+ o("div", Q, [
157
+ o("span", X, x(s.text), 1)
156
158
  ]),
157
- o("div", X, [
158
- n.draft ? (p(), v(x, {
159
+ o("div", Y, [
160
+ s.draft ? (c(), m(_, {
159
161
  key: 1,
160
162
  label: "Entwurf",
161
163
  state: "draft"
162
- })) : (p(), v(x, {
164
+ })) : (c(), m(_, {
163
165
  key: 0,
164
166
  label: "Veröffentlicht",
165
167
  state: "published"
166
168
  })),
167
- o("span", Y, " Updated am: " + y(n.date), 1)
169
+ o("span", Z, " Updated am: " + x(s.date), 1)
168
170
  ])
169
171
  ], 32),
170
- o("div", Z, [
171
- H(L, {
172
- onClick: g,
172
+ o("div", ee, [
173
+ n(D).edit.fromDraft ? g("", !0) : (c(), m(j, {
174
+ key: 0,
175
+ onClick: w,
173
176
  type: "moreButton",
174
177
  alignment: "right",
175
178
  text: {
176
179
  support: "This is a supporting message"
177
180
  },
178
- data: E()
179
- }, null, 8, ["data"])
181
+ data: A()
182
+ }, null, 8, ["data"]))
180
183
  ])
181
184
  ])
182
185
  ], 34),
183
- s(r) ? (p(), v(j, {
186
+ n(r) ? (c(), m(q, {
184
187
  key: 0,
185
- buttons: s(i).button,
186
- headerText: s(i).header,
187
- text: s(i).text,
188
+ buttons: n(i).button,
189
+ headerText: n(i).header,
190
+ text: n(i).text,
188
191
  onClose: e[7] || (e[7] = (a) => T(r) ? r.value = !1 : r = !1),
189
- action: s(i).action,
190
- onActionHandling: e[8] || (e[8] = (a) => I(a))
191
- }, null, 8, ["buttons", "headerText", "text", "action"])) : k("", !0),
192
- s(l) ? (p(), v(q, {
192
+ action: n(i).action,
193
+ onActionHandling: e[8] || (e[8] = (a) => K(a))
194
+ }, null, 8, ["buttons", "headerText", "text", "action"])) : g("", !0),
195
+ n(l) ? (c(), m(F, {
193
196
  key: 1,
194
- type: s(d).type,
195
- text: s(d).text,
197
+ type: n(d).type,
198
+ text: n(d).text,
196
199
  class: "dpiV3_tableToast",
197
- button: s(d).button,
198
- action: s(d).action,
199
- onMouseenter: e[9] || (e[9] = (a) => T(c) ? c.value = !0 : c = !0),
200
- onMouseleave: M
201
- }, null, 8, ["type", "text", "button", "action"])) : k("", !0)
200
+ button: n(d).button,
201
+ action: n(d).action,
202
+ onMouseenter: e[9] || (e[9] = (a) => T(f) ? f.value = !0 : f = !0),
203
+ onMouseleave: I
204
+ }, null, 8, ["type", "text", "button", "action"])) : g("", !0)
202
205
  ], 64));
203
206
  }
204
- }, ce = /* @__PURE__ */ W(ee, [["__scopeId", "data-v-1bc7ccce"]]);
207
+ }, pe = /* @__PURE__ */ G(te, [["__scopeId", "data-v-6f8807e5"]]);
205
208
  export {
206
- ce as default
209
+ pe as default
207
210
  };