@piveau/dpi 0.2.0-alpha.20 → 0.2.0-alpha.22

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 (23) 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/ProcessSteps/HardwareForm.vue.js +2 -2
  13. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ProcessSteps/HardwareForm.vue2.js +108 -105
  14. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ReviewStep/ReviewStep.vue.js +1 -1
  15. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ReviewStep/ReviewStep.vue2.js +111 -107
  16. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/TableRowV3.vue.js +127 -122
  17. package/dist/packages/dpi/src/data-provider-interface/components/StepActionsSection.vue.js +2 -2
  18. package/dist/packages/dpi/src/data-provider-interface/components/StepActionsSection.vue2.js +72 -68
  19. package/dist/packages/dpi/src/data-provider-interface/composables/project-transformer/encodeProject.js +38 -38
  20. package/dist/packages/dpi/src/data-provider-interface/composables/useDebouncedLoading.js +11 -0
  21. package/dist/packages/dpi/src/data-provider-interface/composables/useProjectActions.js +37 -37
  22. package/dist/packages/dpi/src/data-provider-interface/views/InputPageProject.vue.js +218 -216
  23. package/package.json +1 -1
@@ -1,16 +1,16 @@
1
- import { ref as p, computed as R, watch as A, createElementBlock as M, openBlock as d, Fragment as K, createElementVNode as o, createBlock as b, createCommentVNode as h, withKeys as m, normalizeClass as N, withModifiers as w, unref as n, toDisplayString as q, isRef as z } from "vue";
2
- import { setResourcePublicationStatus as _, setDatasetPublicationStatus as B, deleteResource as F, deleteDataset as H } from "@piveau/sdk-core/hubRepo";
3
- import { useRouter as L, useRoute as J } from "vue-router";
4
- import { useStore as O } from "vuex";
5
- import { useRuntimeEnv as W } from "../../../composables/useRuntimeEnv.js";
6
- import { useDpiUtils as G } from "../../composables/useDpiUtils.js";
7
- import Q from "./Dropdown.vue.js";
8
- import X from "./ModalSimpleV3.vue.js";
1
+ import { ref as p, computed as R, watch as K, createElementBlock as N, openBlock as d, Fragment as q, createElementVNode as n, createBlock as b, createCommentVNode as g, withKeys as m, normalizeClass as F, withModifiers as w, unref as o, toDisplayString as H, isRef as z } from "vue";
2
+ import { setResourcePublicationStatus as B, setDatasetPublicationStatus as I, deleteResource as L, deleteDataset as J } from "@piveau/sdk-core/hubRepo";
3
+ import { useRouter as O, useRoute as W } from "vue-router";
4
+ import { useStore as G } from "vuex";
5
+ import { useRuntimeEnv as Q } from "../../../composables/useRuntimeEnv.js";
6
+ import { useDpiUtils as X } from "../../composables/useDpiUtils.js";
7
+ import Y from "./Dropdown.vue.js";
8
+ import Z from "./ModalSimpleV3.vue.js";
9
9
  import k from "./StateTag.vue.js";
10
- import Y from "./Toast.vue.js";
10
+ import ee from "./Toast.vue.js";
11
11
  /* empty css */
12
- import Z from "../../../../../../_virtual/_plugin-vue_export-helper.js";
13
- const ee = { class: "dpiV3_tableRowInner" }, te = { class: "dpiV3_TableRowDescContainer" }, ae = { class: "dpiV3_dsDesc" }, le = { class: "dpiV3_TableRowStatus" }, ne = { class: "dpiV3_TableRowStatus" }, oe = { class: "dpiV3_TableRowButtonWrap" }, ie = {
12
+ import te from "../../../../../../_virtual/_plugin-vue_export-helper.js";
13
+ const ae = { class: "dpiV3_tableRowInner" }, le = { class: "dpiV3_TableRowDescContainer" }, oe = { class: "dpiV3_dsDesc" }, ne = { class: "dpiV3_TableRowStatus" }, se = { class: "dpiV3_TableRowStatus" }, ie = { class: "dpiV3_TableRowButtonWrap" }, re = {
14
14
  __name: "TableRowV3",
15
15
  props: {
16
16
  text: {
@@ -52,141 +52,146 @@ const ee = { class: "dpiV3_tableRowInner" }, te = { class: "dpiV3_TableRowDescCo
52
52
  default: !0
53
53
  }
54
54
  },
55
- setup(y) {
56
- const e = y, I = O();
57
- L();
58
- const j = J(), c = W().api.hubUrl;
59
- let i = p(!1), s = p(!1), v = p(!1), r = p({}), u = p({});
55
+ emits: ["complete", "start"],
56
+ setup(y, { emit: j }) {
57
+ const t = y, C = j, E = G();
58
+ O();
59
+ const U = W(), c = Q().api.hubUrl;
60
+ let s = p(!1), i = p(!1), v = p(!1), r = p({}), u = p({});
60
61
  const D = R(() => {
61
62
  var a;
62
- return !!((a = j.query) != null && a.fromDraft);
63
+ return !!((a = U.query) != null && a.fromDraft);
63
64
  }), f = R(() => {
64
- var a, t;
65
- return (t = (a = I.getters) == null ? void 0 : a["auth/getUserData"]) == null ? void 0 : t.authToken;
66
- }), { toEditMode: C } = G();
67
- function E() {
68
- const a = e.draft || D.value, t = e.catalogue, l = e.id || e.dataset.id || e.catalogue.id;
69
- C({
70
- routeName: e.type === "project" ? "DataProviderInterface-InputProject" : "DataProviderInterface-Input",
65
+ var a, e;
66
+ return (e = (a = E.getters) == null ? void 0 : a["auth/getUserData"]) == null ? void 0 : e.authToken;
67
+ }), { toEditMode: P } = X();
68
+ function $() {
69
+ const a = t.draft || D.value, e = t.catalogue, l = t.id || t.dataset.id || t.catalogue.id;
70
+ P({
71
+ routeName: t.type === "project" ? "DataProviderInterface-InputProject" : "DataProviderInterface-Input",
71
72
  id: l,
72
- catalogId: t,
73
+ catalogId: e,
73
74
  isDraft: a,
74
75
  locale: "de",
75
76
  additionalParams: {
76
- visibility: e.visibility
77
+ visibility: t.visibility
77
78
  }
78
79
  });
79
80
  }
80
- function U() {
81
+ function A() {
81
82
  v.value = !1, setTimeout(() => {
82
- s.value = !1;
83
+ i.value = !1;
83
84
  }, 2e3);
84
85
  }
85
- A(s, (a) => {
86
+ K(i, (a) => {
86
87
  a && setTimeout(() => {
87
- v.value || (s.value = !1);
88
+ v.value || (i.value = !1);
88
89
  }, 2e3);
89
90
  });
90
- function P() {
91
- return e.draft ? [
91
+ function M() {
92
+ return t.draft ? [
92
93
  { "@value": "Ansehen", selected: !1, disabled: !1 },
93
- { "@value": "Bearbeiten", selected: !1, disabled: !e.allowEdit },
94
- { "@value": "Veröffentlichen", selected: !1, disabled: !e.allowPublish },
95
- { "@value": "Löschen", selected: !1, disabled: !e.allowDelete }
94
+ { "@value": "Bearbeiten", selected: !1, disabled: !t.allowEdit },
95
+ { "@value": "Veröffentlichen", selected: !1, disabled: !t.allowPublish },
96
+ { "@value": "Löschen", selected: !1, disabled: !t.allowDelete }
96
97
  ] : [
97
98
  { "@value": "Ansehen", selected: !1, disabled: !1 },
98
- { "@value": "Bearbeiten", selected: !1, disabled: !e.allowEdit },
99
- { "@value": "Veröffentlichung aufheben", selected: !1, disabled: !e.allowPublish },
100
- { "@value": "Löschen", selected: !1, disabled: !e.allowDelete }
99
+ { "@value": "Bearbeiten", selected: !1, disabled: !t.allowEdit },
100
+ { "@value": "Veröffentlichung aufheben", selected: !1, disabled: !t.allowPublish },
101
+ { "@value": "Löschen", selected: !1, disabled: !t.allowDelete }
101
102
  ];
102
103
  }
103
- async function $(a) {
104
+ async function _(a, e) {
104
105
  switch (a) {
105
106
  case "goToDataset":
106
- window.location.href = `/${e.type}/${e.id}`;
107
+ window.location.href = `/${t.type}/${t.id}`;
107
108
  break;
108
109
  case "publishDataset":
109
- if (e.type === "project") {
110
- await _({
110
+ if (e("start"), t.type === "project") {
111
+ B({
111
112
  baseUrl: c,
112
- id: e.id,
113
+ id: t.id,
113
114
  type: "project",
114
- catalogueId: e.catalogue,
115
+ catalogueId: t.catalogue,
115
116
  publicationStatus: "published",
116
117
  authToken: f.value
118
+ }).then(() => {
119
+ console.log("published"), e("complete");
117
120
  });
118
121
  break;
119
122
  }
120
- B({
123
+ await I({
121
124
  baseUrl: c,
122
- id: e.id,
123
- catalogueId: e.catalogue,
125
+ id: t.id,
126
+ catalogueId: t.catalogue,
124
127
  publicationStatus: "published",
125
128
  authToken: f.value
126
- }), console.log("Datensatz wird veröffentlicht"), s.value = !0, u.value = {
129
+ }), console.log("Datensatz wird veröffentlicht"), i.value = !0, u.value = {
127
130
  type: "success",
128
131
  text: "Der Datensatz wurde veröffentlicht",
129
132
  button: "Ansehen",
130
133
  action: "goToDataset"
131
- };
134
+ }, e("complete");
132
135
  break;
133
136
  case "deleteDataset":
134
- if (e.type === "project") {
135
- await F({
137
+ if (e("start"), t.type === "project") {
138
+ await L({
136
139
  baseUrl: c,
137
- id: e.id,
140
+ id: t.id,
138
141
  type: "project",
139
- catalogId: e.catalogue,
142
+ catalogId: t.catalogue,
140
143
  authToken: f.value
141
- });
144
+ }), e("complete");
142
145
  break;
143
146
  }
144
- H({
147
+ await J({
145
148
  baseUrl: c,
146
- id: e.id,
147
- catalogId: e.catalogue,
149
+ id: t.id,
150
+ catalogId: t.catalogue,
148
151
  authToken: f.value
149
- }), s.value = !0, u.value = {
152
+ }), i.value = !0, u.value = {
150
153
  type: "success",
151
154
  text: "Der Datensatz wurde erfolgreich gelöscht",
152
155
  button: "Rückgängig machen",
153
156
  action: "revertDeletion"
154
- };
157
+ }, e("complete");
155
158
  break;
156
159
  case "setToDraft":
157
- if (e.type === "project") {
158
- await _({
160
+ if (e("start"), t.type === "project") {
161
+ B({
159
162
  baseUrl: c,
160
- id: e.id,
163
+ id: t.id,
161
164
  type: "project",
162
- catalogueId: e.catalogue,
165
+ catalogueId: t.catalogue,
163
166
  publicationStatus: "draft",
164
167
  authToken: f.value
168
+ }).then(() => {
169
+ e("complete");
165
170
  });
166
171
  break;
167
172
  }
168
- B({
173
+ await I({
169
174
  baseUrl: c,
170
- id: e.id,
171
- catalogueId: e.catalogue,
175
+ id: t.id,
176
+ catalogueId: t.catalogue,
172
177
  publicationStatus: "draft",
173
178
  authToken: f.value
174
- }), s.value = !0, u.value = {
179
+ }), i.value = !0, u.value = {
175
180
  type: "success",
176
181
  text: "Der Datensatz wurde erfolgreich zu einem Entwurf zurückgesetzt",
177
182
  button: "Rückgängig machen",
178
183
  action: "revertToDraft"
179
- };
184
+ }, e("complete");
180
185
  }
181
186
  }
182
187
  function T(a) {
183
- let t = "";
184
- switch (typeof a == "string" ? t = a : t = a.target.innerText, t) {
188
+ let e = "";
189
+ switch (typeof a == "string" ? e = a : e = a.target.innerText, e) {
185
190
  case "Ansehen":
186
- window.location.href = `/${e.type}/${e.id}`;
191
+ window.location.href = `/${t.type}/${t.id}`;
187
192
  break;
188
193
  case "Bearbeiten":
189
- E();
194
+ $();
190
195
  break;
191
196
  case "Veröffentlichen":
192
197
  r.value = {
@@ -194,7 +199,7 @@ const ee = { class: "dpiV3_tableRowInner" }, te = { class: "dpiV3_TableRowDescCo
194
199
  header: "Datensatz veröffentlichen",
195
200
  text: "Sind Sie sicher, dass Sie diesen Datensatz veröffentlichen möchten?",
196
201
  action: "publishDataset"
197
- }, i.value = !0;
202
+ }, s.value = !0;
198
203
  break;
199
204
  case "Löschen":
200
205
  r.value = {
@@ -202,7 +207,7 @@ const ee = { class: "dpiV3_tableRowInner" }, te = { class: "dpiV3_TableRowDescCo
202
207
  header: "Datensatz endgültig löschen",
203
208
  text: "Möchten Sie diesen Datensatz wirklich endgültig löschen? Diese Aktion kann nicht rückgängig gemacht werden. Alle damit verbundenen Daten werden entfernt.",
204
209
  action: "deleteDataset"
205
- }, i.value = !0;
210
+ }, s.value = !0;
206
211
  break;
207
212
  case "Veröffentlichung aufheben":
208
213
  r.value = {
@@ -210,47 +215,47 @@ const ee = { class: "dpiV3_tableRowInner" }, te = { class: "dpiV3_TableRowDescCo
210
215
  header: "Veröffentlichung aufheben",
211
216
  text: "Sind Sie sicher, dass Sie diesen Datensatz zu einem Entwurf zurücksetzen möchten?",
212
217
  action: "setToDraft"
213
- }, i.value = !0;
218
+ }, s.value = !0;
214
219
  break;
215
220
  }
216
221
  }
217
- let g = p(!1);
218
- function S(a, t) {
219
- t ? g.value = !0 : g.value = !1;
222
+ let h = p(!1);
223
+ function S(a, e) {
224
+ e ? h.value = !0 : h.value = !1;
220
225
  }
221
226
  function V(a) {
222
- a.target.className != "dpiV3_more-button dpiV3_activeState" && (g.value = !0);
227
+ a.target.className != "dpiV3_more-button dpiV3_activeState" && (h.value = !0);
223
228
  }
224
229
  function x(a) {
225
- a.target.className != "dpiV3_more-button dpiV3_activeState" && (g.value = !1);
230
+ a.target.className != "dpiV3_more-button dpiV3_activeState" && (h.value = !1);
226
231
  }
227
- return (a, t) => (d(), M(K, null, [
228
- o("button", {
229
- class: N(["dpiV3_tableRowWrapper", {
230
- dpiV3_pressedTableRow: n(g),
231
- tRowInDraft: e.fromDraft
232
+ return (a, e) => (d(), N(q, null, [
233
+ n("button", {
234
+ class: F(["dpiV3_tableRowWrapper", {
235
+ dpiV3_pressedTableRow: o(h),
236
+ tRowInDraft: t.fromDraft
232
237
  }]),
233
238
  onKeydown: [
234
- t[3] || (t[3] = m(w((l) => V(l), ["prevent"]), ["space"])),
235
- t[4] || (t[4] = m(w((l) => V(l), ["prevent"]), ["enter"]))
239
+ e[3] || (e[3] = m(w((l) => V(l), ["prevent"]), ["space"])),
240
+ e[4] || (e[4] = m(w((l) => V(l), ["prevent"]), ["enter"]))
236
241
  ],
237
242
  onKeyup: [
238
- t[5] || (t[5] = m((l) => x(l), ["space"])),
239
- t[6] || (t[6] = m((l) => x(l), ["enter"]))
243
+ e[5] || (e[5] = m((l) => x(l), ["space"])),
244
+ e[6] || (e[6] = m((l) => x(l), ["enter"]))
240
245
  ]
241
246
  }, [
242
- o("div", ee, [
243
- o("div", {
247
+ n("div", ae, [
248
+ n("div", {
244
249
  class: "dpiV3_tableRowContent",
245
- onMousedown: t[0] || (t[0] = w((l) => S(l, !0), ["prevent"])),
246
- onMouseup: t[1] || (t[1] = w((l) => S(l, !1), ["prevent"])),
247
- onClick: t[2] || (t[2] = (l) => T("Bearbeiten"))
250
+ onMousedown: e[0] || (e[0] = w((l) => S(l, !0), ["prevent"])),
251
+ onMouseup: e[1] || (e[1] = w((l) => S(l, !1), ["prevent"])),
252
+ onClick: e[2] || (e[2] = (l) => T("Bearbeiten"))
248
253
  }, [
249
- o("div", te, [
250
- o("span", ae, q(e.text), 1)
254
+ n("div", le, [
255
+ n("span", oe, H(t.text), 1)
251
256
  ]),
252
- o("div", le, [
253
- e.draft ? (d(), b(k, {
257
+ n("div", ne, [
258
+ t.draft ? (d(), b(k, {
254
259
  key: 1,
255
260
  label: "Entwurf",
256
261
  state: "draft"
@@ -260,17 +265,17 @@ const ee = { class: "dpiV3_tableRowInner" }, te = { class: "dpiV3_TableRowDescCo
260
265
  state: "published"
261
266
  }))
262
267
  ]),
263
- o("div", ne, [
268
+ n("div", se, [
264
269
  y.visibility ? (d(), b(k, {
265
270
  key: 0,
266
271
  label: y.visibility,
267
- state: e.draft ? "draft" : "published",
272
+ state: t.draft ? "draft" : "published",
268
273
  "has-dot-icon": !1
269
- }, null, 8, ["label", "state"])) : h("", !0)
274
+ }, null, 8, ["label", "state"])) : g("", !0)
270
275
  ])
271
276
  ], 32),
272
- o("div", oe, [
273
- D.value ? h("", !0) : (d(), b(Q, {
277
+ n("div", ie, [
278
+ D.value ? g("", !0) : (d(), b(Y, {
274
279
  key: 0,
275
280
  type: "moreButton",
276
281
  "not-draft": !D.value,
@@ -278,34 +283,34 @@ const ee = { class: "dpiV3_tableRowInner" }, te = { class: "dpiV3_TableRowDescCo
278
283
  text: {
279
284
  support: "This is a supporting message"
280
285
  },
281
- data: P(),
286
+ data: M(),
282
287
  onClick: T
283
288
  }, null, 8, ["not-draft", "data"]))
284
289
  ])
285
290
  ])
286
291
  ], 34),
287
- n(i) ? (d(), b(X, {
292
+ o(s) ? (d(), b(Z, {
288
293
  key: 0,
289
- buttons: n(r).button,
290
- "header-text": n(r).header,
291
- text: n(r).text,
292
- action: n(r).action,
293
- onClose: t[7] || (t[7] = (l) => z(i) ? i.value = !1 : i = !1),
294
- onActionHandling: t[8] || (t[8] = (l) => $(l))
295
- }, null, 8, ["buttons", "header-text", "text", "action"])) : h("", !0),
296
- n(s) ? (d(), b(Y, {
294
+ buttons: o(r).button,
295
+ "header-text": o(r).header,
296
+ text: o(r).text,
297
+ action: o(r).action,
298
+ onClose: e[7] || (e[7] = (l) => z(s) ? s.value = !1 : s = !1),
299
+ onActionHandling: e[8] || (e[8] = (l) => _(l, C))
300
+ }, null, 8, ["buttons", "header-text", "text", "action"])) : g("", !0),
301
+ o(i) ? (d(), b(ee, {
297
302
  key: 1,
298
- type: n(u).type,
299
- text: n(u).text,
303
+ type: o(u).type,
304
+ text: o(u).text,
300
305
  class: "dpiV3_tableToast",
301
- button: n(u).button,
302
- action: n(u).action,
303
- onMouseenter: t[9] || (t[9] = (l) => z(v) ? v.value = !0 : v = !0),
304
- onMouseleave: U
305
- }, null, 8, ["type", "text", "button", "action"])) : h("", !0)
306
+ button: o(u).button,
307
+ action: o(u).action,
308
+ onMouseenter: e[9] || (e[9] = (l) => z(v) ? v.value = !0 : v = !0),
309
+ onMouseleave: A
310
+ }, null, 8, ["type", "text", "button", "action"])) : g("", !0)
306
311
  ], 64));
307
312
  }
308
- }, ye = /* @__PURE__ */ Z(ie, [["__scopeId", "data-v-98e2acbf"]]);
313
+ }, ke = /* @__PURE__ */ te(re, [["__scopeId", "data-v-d1e45d7d"]]);
309
314
  export {
310
- ye as default
315
+ ke as default
311
316
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./StepActionsSection.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../../../_virtual/_plugin-vue_export-helper.js";
4
- const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-07a97d66"]]);
4
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a44124be"]]);
5
5
  export {
6
- c as default
6
+ a as default
7
7
  };
@@ -1,16 +1,16 @@
1
- import { defineComponent as W, inject as j, ref as v, watch as F, computed as I, createElementBlock as r, openBlock as o, normalizeClass as $, createElementVNode as m, createBlock as p, createCommentVNode as V, createVNode as s, renderSlot as w, unref as E, normalizeStyle as K, withDirectives as h, vShow as y, Fragment as N, withCtx as g, renderList as R, toDisplayString as O, nextTick as U } from "vue";
2
- import { getNode as Z, isNode as q } from "@formkit/core";
3
- import { getValidationMessages as G } from "@formkit/validation";
4
- import { PhExclamationMark as H } from "@phosphor-icons/vue";
5
- import l from "../HappyFlowComponents/ui/ButtonV3.vue.js";
6
- import J from "../HappyFlowComponents/ui/Card.vue.js";
7
- import { dpiStepperKey as Q } from "../utils/injectionKeys.js";
8
- import X from "./TheCancelConfirmationDialog.vue.js";
9
- import { useEditModeInfo as Y } from "../composables/useDpiEditMode.js";
10
- const _ = { class: "step-actions" }, ee = { class: "step-actions__prev-and-next" }, te = {
1
+ import { defineComponent as F, inject as I, ref as m, watch as $, computed as K, createElementBlock as r, openBlock as o, normalizeClass as R, createElementVNode as p, createBlock as g, createCommentVNode as w, createVNode as l, renderSlot as E, unref as N, normalizeStyle as O, withDirectives as h, vShow as y, Fragment as B, withCtx as x, renderList as U, toDisplayString as Z, nextTick as q } from "vue";
2
+ import { getNode as G, isNode as H } from "@formkit/core";
3
+ import { getValidationMessages as J } from "@formkit/validation";
4
+ import { PhExclamationMark as Q } from "@phosphor-icons/vue";
5
+ import s from "../HappyFlowComponents/ui/ButtonV3.vue.js";
6
+ import X from "../HappyFlowComponents/ui/Card.vue.js";
7
+ import { dpiStepperKey as Y } from "../utils/injectionKeys.js";
8
+ import _ from "./TheCancelConfirmationDialog.vue.js";
9
+ import { useEditModeInfo as ee } from "../composables/useDpiEditMode.js";
10
+ const te = { class: "step-actions" }, ne = { class: "step-actions__prev-and-next" }, ae = {
11
11
  key: 0,
12
12
  class: "validation-errors"
13
- }, me = /* @__PURE__ */ W({
13
+ }, pe = /* @__PURE__ */ F({
14
14
  __name: "StepActionsSection",
15
15
  props: {
16
16
  hideCancel: { type: Boolean, default: !1 },
@@ -22,54 +22,55 @@ const _ = { class: "step-actions" }, ee = { class: "step-actions__prev-and-next"
22
22
  nextText: { default: "Weiter" },
23
23
  nextVariant: { default: "primary" },
24
24
  classList: {},
25
+ loading: { type: Boolean, default: !1 },
25
26
  showDetailedErrorSummary: { type: Boolean, default: !1 }
26
27
  },
27
28
  emits: ["submit", "closeWithSaving"],
28
- setup(ne, { emit: B }) {
29
- const x = B, t = j(Q);
29
+ setup(P, { emit: z }) {
30
+ const c = P, C = z, t = I(Y);
30
31
  t || console.warn("dpiStepper is not provided. Please use StepActionsSection inside InputPage");
31
- function C(e) {
32
+ function S(e) {
32
33
  return e !== void 0;
33
34
  }
34
- const c = v(!1), u = v(!1), i = v([]);
35
- t && F(t.activeStep, () => {
35
+ const f = m(!1), u = m(!1), i = m([]);
36
+ t && $(t.activeStep, () => {
36
37
  i.value.splice(0, i.value.length), u.value = !1;
37
38
  });
38
- function S() {
39
- c.value = !0;
39
+ function b() {
40
+ f.value = !0;
40
41
  }
41
- function f() {
42
+ function v() {
42
43
  t == null || t.goToPreviousStep();
43
44
  }
44
- async function b() {
45
- var k, T;
46
- if (!C(t))
45
+ async function k() {
46
+ var T, V;
47
+ if (!S(t))
47
48
  return !1;
48
- t.triggerValidationCurrentStep(), await U();
49
+ t.triggerValidationCurrentStep(), await q();
49
50
  const e = t.activeStep.value;
50
51
  if (!e)
51
52
  return !1;
52
- const n = Z(e);
53
- if (!q(n))
53
+ const n = G(e);
54
+ if (!H(n))
54
55
  return console.error("Current step node is not a FormKitNode", n), !1;
55
56
  n.clearErrors(!0);
56
- const a = G(n), D = !!((T = (k = t.steps) == null ? void 0 : k[e]) != null && T.valid);
57
- return a && a.size > 0 || !D ? (i.value = [...a.entries()].flatMap(([oe, M]) => M.map((A) => String(A.value))), u.value = !0, !1) : (i.value.splice(0, i.value.length), u.value = !1, !0);
57
+ const a = J(n), A = !!((V = (T = t.steps) == null ? void 0 : T[e]) != null && V.valid);
58
+ return a && a.size > 0 || !A ? (i.value = [...a.entries()].flatMap(([ie, W]) => W.map((j) => String(j.value))), u.value = !0, !1) : (i.value.splice(0, i.value.length), u.value = !1, !0);
58
59
  }
59
60
  async function d() {
60
- !C(t) || !await b() || (t != null && t.isLast.value ? x("submit") : t == null || t.goToNextStep());
61
+ !S(t) || !await k() || (t != null && t.isLast.value ? C("submit") : t == null || t.goToNextStep());
61
62
  }
62
- const { isEditMode: P } = Y();
63
- async function z() {
64
- !t || !await b() || t == null || t.goToStep(Object.keys(t.steps).pop() || "");
63
+ const { isEditMode: L } = ee();
64
+ async function D() {
65
+ !t || !await k() || t == null || t.goToStep(Object.keys(t.steps).pop() || "");
65
66
  }
66
- const L = I(() => t ? t == null ? void 0 : t.isLast.value : !0);
67
+ const M = K(() => t ? t == null ? void 0 : t.isLast.value : !0);
67
68
  return (e, n) => (o(), r("div", {
68
- class: $([e.classList, "step-actions-container"])
69
+ class: R([e.classList, "step-actions-container"])
69
70
  }, [
70
- m("div", _, [
71
- E(P) ? (o(), r(N, { key: 1 }, [
72
- L.value ? h((o(), p(l, {
71
+ p("div", te, [
72
+ N(L) ? (o(), r(B, { key: 1 }, [
73
+ M.value ? h((o(), g(s, {
73
74
  key: 1,
74
75
  class: "edit-save-button",
75
76
  size: "large",
@@ -77,93 +78,96 @@ const _ = { class: "step-actions" }, ee = { class: "step-actions__prev-and-next"
77
78
  type: "button",
78
79
  "button-text": e.nextText,
79
80
  "icon-end": e.nextText === "Als Entwurf Speichern" ? null : "CaretRight",
81
+ loading: c.loading,
80
82
  onClick: d
81
- }, null, 8, ["variant", "button-text", "icon-end"])), [
83
+ }, null, 8, ["variant", "button-text", "icon-end", "loading"])), [
82
84
  [y, !e.hideNext]
83
- ]) : (o(), p(l, {
85
+ ]) : (o(), g(s, {
84
86
  key: 0,
85
87
  class: "edit-save-button",
86
88
  size: "large",
87
89
  variant: "primary",
88
90
  type: "button",
89
91
  "button-text": "Speichern",
90
- onClick: z
92
+ onClick: D
91
93
  }))
92
- ], 64)) : w(e.$slots, "default", {
94
+ ], 64)) : E(e.$slots, "default", {
93
95
  key: 0,
94
- handleCancel: S,
95
- handlePrevious: f,
96
+ handleCancel: b,
97
+ handlePrevious: v,
96
98
  handleSubmit: d
97
99
  }, () => [
98
- s(l, {
99
- style: K({ opacity: e.hideCancel ? 0 : 1 }),
100
+ l(s, {
101
+ style: O({ opacity: e.hideCancel ? 0 : 1 }),
100
102
  variant: "tertiary",
101
103
  size: "large",
102
104
  type: "button",
103
105
  "button-text": e.cancelText,
104
- onClick: S
106
+ onClick: b
105
107
  }, null, 8, ["style", "button-text"]),
106
- m("div", ee, [
107
- w(e.$slots, "prev-and-next", {
108
+ p("div", ne, [
109
+ E(e.$slots, "prev-and-next", {
108
110
  hidePrevious: e.hidePrevious,
109
111
  hideNext: e.hideNext,
110
112
  previousText: e.previousText,
111
113
  nextText: e.nextText,
112
- handlePrevious: f,
113
- handleSubmit: d
114
+ handlePrevious: v,
115
+ handleSubmit: d,
116
+ loading: c.loading
114
117
  }, () => [
115
- h(s(l, {
118
+ h(l(s, {
116
119
  variant: "secondary",
117
120
  size: "large",
118
121
  type: "button",
119
122
  "button-text": e.previousText,
120
123
  "icon-start": "CaretLeft",
121
- onClick: f
124
+ onClick: v
122
125
  }, null, 8, ["button-text"]), [
123
126
  [y, !e.hidePrevious]
124
127
  ]),
125
- h(s(l, {
128
+ h(l(s, {
126
129
  size: "large",
127
130
  variant: e.nextVariant,
128
131
  type: "button",
129
132
  "button-text": e.nextText,
130
133
  "icon-end": e.nextText === "Als Entwurf Speichern" || e.nextText === "Projektanlage starten" ? null : "CaretRight",
134
+ loading: c.loading,
131
135
  onClick: d
132
- }, null, 8, ["variant", "button-text", "icon-end"]), [
136
+ }, null, 8, ["variant", "button-text", "icon-end", "loading"]), [
133
137
  [y, !e.hideNext]
134
138
  ])
135
139
  ], !0)
136
140
  ])
137
141
  ], !0)
138
142
  ]),
139
- u.value && i.value.length ? (o(), p(J, {
143
+ u.value && i.value.length ? (o(), g(X, {
140
144
  key: 0,
141
145
  variant: "error"
142
146
  }, {
143
- icon: g(() => [
144
- s(E(H), {
147
+ icon: x(() => [
148
+ l(N(Q), {
145
149
  size: 32,
146
150
  color: "currentColor"
147
151
  })
148
152
  ]),
149
- title: g(() => n[2] || (n[2] = [
150
- m("p", null, "Fehler", -1)
153
+ title: x(() => n[2] || (n[2] = [
154
+ p("p", { style: { margin: "0" } }, " Fehler ", -1)
151
155
  ])),
152
- default: g(() => [
153
- e.showDetailedErrorSummary ? (o(), r("ul", te, [
154
- (o(!0), r(N, null, R(i.value, (a) => (o(), r("li", { key: a }, O(a), 1))), 128))
155
- ])) : V("", !0)
156
+ default: x(() => [
157
+ e.showDetailedErrorSummary ? (o(), r("ul", ae, [
158
+ (o(!0), r(B, null, U(i.value, (a) => (o(), r("li", { key: a }, Z(a), 1))), 128))
159
+ ])) : w("", !0)
156
160
  ]),
157
161
  _: 1
158
- })) : V("", !0),
159
- s(X, {
160
- modelValue: c.value,
161
- "onUpdate:modelValue": n[0] || (n[0] = (a) => c.value = a),
162
- onCloseWithSaving: n[1] || (n[1] = (a) => x("closeWithSaving"))
162
+ })) : w("", !0),
163
+ l(_, {
164
+ modelValue: f.value,
165
+ "onUpdate:modelValue": n[0] || (n[0] = (a) => f.value = a),
166
+ onCloseWithSaving: n[1] || (n[1] = (a) => C("closeWithSaving"))
163
167
  }, null, 8, ["modelValue"])
164
168
  ], 2));
165
169
  }
166
170
  });
167
171
  export {
168
- me as default
172
+ pe as default
169
173
  };