@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.
- 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/ProcessSteps/HardwareForm.vue.js +2 -2
- package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ProcessSteps/HardwareForm.vue2.js +108 -105
- 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/project-transformer/encodeProject.js +38 -38
- 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/ui/TableRowV3.vue.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { ref as p, computed as R, watch as
|
|
2
|
-
import { setResourcePublicationStatus as
|
|
3
|
-
import { useRouter as
|
|
4
|
-
import { useStore as
|
|
5
|
-
import { useRuntimeEnv as
|
|
6
|
-
import { useDpiUtils as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
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
|
|
10
|
+
import ee from "./Toast.vue.js";
|
|
11
11
|
/* empty css */
|
|
12
|
-
import
|
|
13
|
-
const
|
|
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
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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 =
|
|
63
|
+
return !!((a = U.query) != null && a.fromDraft);
|
|
63
64
|
}), f = R(() => {
|
|
64
|
-
var a,
|
|
65
|
-
return (
|
|
66
|
-
}), { toEditMode:
|
|
67
|
-
function
|
|
68
|
-
const a =
|
|
69
|
-
|
|
70
|
-
routeName:
|
|
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:
|
|
73
|
+
catalogId: e,
|
|
73
74
|
isDraft: a,
|
|
74
75
|
locale: "de",
|
|
75
76
|
additionalParams: {
|
|
76
|
-
visibility:
|
|
77
|
+
visibility: t.visibility
|
|
77
78
|
}
|
|
78
79
|
});
|
|
79
80
|
}
|
|
80
|
-
function
|
|
81
|
+
function A() {
|
|
81
82
|
v.value = !1, setTimeout(() => {
|
|
82
|
-
|
|
83
|
+
i.value = !1;
|
|
83
84
|
}, 2e3);
|
|
84
85
|
}
|
|
85
|
-
|
|
86
|
+
K(i, (a) => {
|
|
86
87
|
a && setTimeout(() => {
|
|
87
|
-
v.value || (
|
|
88
|
+
v.value || (i.value = !1);
|
|
88
89
|
}, 2e3);
|
|
89
90
|
});
|
|
90
|
-
function
|
|
91
|
-
return
|
|
91
|
+
function M() {
|
|
92
|
+
return t.draft ? [
|
|
92
93
|
{ "@value": "Ansehen", selected: !1, disabled: !1 },
|
|
93
|
-
{ "@value": "Bearbeiten", selected: !1, disabled: !
|
|
94
|
-
{ "@value": "Veröffentlichen", selected: !1, disabled: !
|
|
95
|
-
{ "@value": "Löschen", selected: !1, disabled: !
|
|
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: !
|
|
99
|
-
{ "@value": "Veröffentlichung aufheben", selected: !1, disabled: !
|
|
100
|
-
{ "@value": "Löschen", selected: !1, disabled: !
|
|
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
|
|
104
|
+
async function _(a, e) {
|
|
104
105
|
switch (a) {
|
|
105
106
|
case "goToDataset":
|
|
106
|
-
window.location.href = `/${
|
|
107
|
+
window.location.href = `/${t.type}/${t.id}`;
|
|
107
108
|
break;
|
|
108
109
|
case "publishDataset":
|
|
109
|
-
if (e.type === "project") {
|
|
110
|
-
|
|
110
|
+
if (e("start"), t.type === "project") {
|
|
111
|
+
B({
|
|
111
112
|
baseUrl: c,
|
|
112
|
-
id:
|
|
113
|
+
id: t.id,
|
|
113
114
|
type: "project",
|
|
114
|
-
catalogueId:
|
|
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
|
-
|
|
123
|
+
await I({
|
|
121
124
|
baseUrl: c,
|
|
122
|
-
id:
|
|
123
|
-
catalogueId:
|
|
125
|
+
id: t.id,
|
|
126
|
+
catalogueId: t.catalogue,
|
|
124
127
|
publicationStatus: "published",
|
|
125
128
|
authToken: f.value
|
|
126
|
-
}), console.log("Datensatz wird veröffentlicht"),
|
|
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
|
|
137
|
+
if (e("start"), t.type === "project") {
|
|
138
|
+
await L({
|
|
136
139
|
baseUrl: c,
|
|
137
|
-
id:
|
|
140
|
+
id: t.id,
|
|
138
141
|
type: "project",
|
|
139
|
-
catalogId:
|
|
142
|
+
catalogId: t.catalogue,
|
|
140
143
|
authToken: f.value
|
|
141
|
-
});
|
|
144
|
+
}), e("complete");
|
|
142
145
|
break;
|
|
143
146
|
}
|
|
144
|
-
|
|
147
|
+
await J({
|
|
145
148
|
baseUrl: c,
|
|
146
|
-
id:
|
|
147
|
-
catalogId:
|
|
149
|
+
id: t.id,
|
|
150
|
+
catalogId: t.catalogue,
|
|
148
151
|
authToken: f.value
|
|
149
|
-
}),
|
|
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
|
-
|
|
160
|
+
if (e("start"), t.type === "project") {
|
|
161
|
+
B({
|
|
159
162
|
baseUrl: c,
|
|
160
|
-
id:
|
|
163
|
+
id: t.id,
|
|
161
164
|
type: "project",
|
|
162
|
-
catalogueId:
|
|
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
|
-
|
|
173
|
+
await I({
|
|
169
174
|
baseUrl: c,
|
|
170
|
-
id:
|
|
171
|
-
catalogueId:
|
|
175
|
+
id: t.id,
|
|
176
|
+
catalogueId: t.catalogue,
|
|
172
177
|
publicationStatus: "draft",
|
|
173
178
|
authToken: f.value
|
|
174
|
-
}),
|
|
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
|
|
184
|
-
switch (typeof a == "string" ?
|
|
188
|
+
let e = "";
|
|
189
|
+
switch (typeof a == "string" ? e = a : e = a.target.innerText, e) {
|
|
185
190
|
case "Ansehen":
|
|
186
|
-
window.location.href = `/${
|
|
191
|
+
window.location.href = `/${t.type}/${t.id}`;
|
|
187
192
|
break;
|
|
188
193
|
case "Bearbeiten":
|
|
189
|
-
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
218
|
+
}, s.value = !0;
|
|
214
219
|
break;
|
|
215
220
|
}
|
|
216
221
|
}
|
|
217
|
-
let
|
|
218
|
-
function S(a,
|
|
219
|
-
|
|
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" && (
|
|
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" && (
|
|
230
|
+
a.target.className != "dpiV3_more-button dpiV3_activeState" && (h.value = !1);
|
|
226
231
|
}
|
|
227
|
-
return (a,
|
|
228
|
-
|
|
229
|
-
class:
|
|
230
|
-
dpiV3_pressedTableRow:
|
|
231
|
-
tRowInDraft:
|
|
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
|
-
|
|
235
|
-
|
|
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
|
-
|
|
239
|
-
|
|
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
|
-
|
|
243
|
-
|
|
247
|
+
n("div", ae, [
|
|
248
|
+
n("div", {
|
|
244
249
|
class: "dpiV3_tableRowContent",
|
|
245
|
-
onMousedown:
|
|
246
|
-
onMouseup:
|
|
247
|
-
onClick:
|
|
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
|
-
|
|
250
|
-
|
|
254
|
+
n("div", le, [
|
|
255
|
+
n("span", oe, H(t.text), 1)
|
|
251
256
|
]),
|
|
252
|
-
|
|
253
|
-
|
|
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
|
-
|
|
268
|
+
n("div", se, [
|
|
264
269
|
y.visibility ? (d(), b(k, {
|
|
265
270
|
key: 0,
|
|
266
271
|
label: y.visibility,
|
|
267
|
-
state:
|
|
272
|
+
state: t.draft ? "draft" : "published",
|
|
268
273
|
"has-dot-icon": !1
|
|
269
|
-
}, null, 8, ["label", "state"])) :
|
|
274
|
+
}, null, 8, ["label", "state"])) : g("", !0)
|
|
270
275
|
])
|
|
271
276
|
], 32),
|
|
272
|
-
|
|
273
|
-
D.value ?
|
|
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:
|
|
286
|
+
data: M(),
|
|
282
287
|
onClick: T
|
|
283
288
|
}, null, 8, ["not-draft", "data"]))
|
|
284
289
|
])
|
|
285
290
|
])
|
|
286
291
|
], 34),
|
|
287
|
-
|
|
292
|
+
o(s) ? (d(), b(Z, {
|
|
288
293
|
key: 0,
|
|
289
|
-
buttons:
|
|
290
|
-
"header-text":
|
|
291
|
-
text:
|
|
292
|
-
action:
|
|
293
|
-
onClose:
|
|
294
|
-
onActionHandling:
|
|
295
|
-
}, null, 8, ["buttons", "header-text", "text", "action"])) :
|
|
296
|
-
|
|
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:
|
|
299
|
-
text:
|
|
303
|
+
type: o(u).type,
|
|
304
|
+
text: o(u).text,
|
|
300
305
|
class: "dpiV3_tableToast",
|
|
301
|
-
button:
|
|
302
|
-
action:
|
|
303
|
-
onMouseenter:
|
|
304
|
-
onMouseleave:
|
|
305
|
-
}, null, 8, ["type", "text", "button", "action"])) :
|
|
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
|
-
},
|
|
313
|
+
}, ke = /* @__PURE__ */ te(re, [["__scopeId", "data-v-d1e45d7d"]]);
|
|
309
314
|
export {
|
|
310
|
-
|
|
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
|
|
4
|
+
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a44124be"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { getNode as
|
|
3
|
-
import { getValidationMessages as
|
|
4
|
-
import { PhExclamationMark as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { dpiStepperKey as
|
|
8
|
-
import
|
|
9
|
-
import { useEditModeInfo as
|
|
10
|
-
const
|
|
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
|
-
},
|
|
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(
|
|
29
|
-
const
|
|
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
|
|
32
|
+
function S(e) {
|
|
32
33
|
return e !== void 0;
|
|
33
34
|
}
|
|
34
|
-
const
|
|
35
|
-
t &&
|
|
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
|
|
39
|
-
|
|
39
|
+
function b() {
|
|
40
|
+
f.value = !0;
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
+
function v() {
|
|
42
43
|
t == null || t.goToPreviousStep();
|
|
43
44
|
}
|
|
44
|
-
async function
|
|
45
|
-
var
|
|
46
|
-
if (!
|
|
45
|
+
async function k() {
|
|
46
|
+
var T, V;
|
|
47
|
+
if (!S(t))
|
|
47
48
|
return !1;
|
|
48
|
-
t.triggerValidationCurrentStep(), await
|
|
49
|
+
t.triggerValidationCurrentStep(), await q();
|
|
49
50
|
const e = t.activeStep.value;
|
|
50
51
|
if (!e)
|
|
51
52
|
return !1;
|
|
52
|
-
const n =
|
|
53
|
-
if (!
|
|
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 =
|
|
57
|
-
return a && a.size > 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
|
-
!
|
|
61
|
+
!S(t) || !await k() || (t != null && t.isLast.value ? C("submit") : t == null || t.goToNextStep());
|
|
61
62
|
}
|
|
62
|
-
const { isEditMode:
|
|
63
|
-
async function
|
|
64
|
-
!t || !await
|
|
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
|
|
67
|
+
const M = K(() => t ? t == null ? void 0 : t.isLast.value : !0);
|
|
67
68
|
return (e, n) => (o(), r("div", {
|
|
68
|
-
class:
|
|
69
|
+
class: R([e.classList, "step-actions-container"])
|
|
69
70
|
}, [
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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(),
|
|
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:
|
|
92
|
+
onClick: D
|
|
91
93
|
}))
|
|
92
|
-
], 64)) :
|
|
94
|
+
], 64)) : E(e.$slots, "default", {
|
|
93
95
|
key: 0,
|
|
94
|
-
handleCancel:
|
|
95
|
-
handlePrevious:
|
|
96
|
+
handleCancel: b,
|
|
97
|
+
handlePrevious: v,
|
|
96
98
|
handleSubmit: d
|
|
97
99
|
}, () => [
|
|
98
|
-
s
|
|
99
|
-
style:
|
|
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:
|
|
106
|
+
onClick: b
|
|
105
107
|
}, null, 8, ["style", "button-text"]),
|
|
106
|
-
|
|
107
|
-
|
|
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:
|
|
113
|
-
handleSubmit: d
|
|
114
|
+
handlePrevious: v,
|
|
115
|
+
handleSubmit: d,
|
|
116
|
+
loading: c.loading
|
|
114
117
|
}, () => [
|
|
115
|
-
h(s
|
|
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:
|
|
124
|
+
onClick: v
|
|
122
125
|
}, null, 8, ["button-text"]), [
|
|
123
126
|
[y, !e.hidePrevious]
|
|
124
127
|
]),
|
|
125
|
-
h(s
|
|
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(),
|
|
143
|
+
u.value && i.value.length ? (o(), g(X, {
|
|
140
144
|
key: 0,
|
|
141
145
|
variant: "error"
|
|
142
146
|
}, {
|
|
143
|
-
icon:
|
|
144
|
-
|
|
147
|
+
icon: x(() => [
|
|
148
|
+
l(N(Q), {
|
|
145
149
|
size: 32,
|
|
146
150
|
color: "currentColor"
|
|
147
151
|
})
|
|
148
152
|
]),
|
|
149
|
-
title:
|
|
150
|
-
|
|
153
|
+
title: x(() => n[2] || (n[2] = [
|
|
154
|
+
p("p", { style: { margin: "0" } }, " Fehler ", -1)
|
|
151
155
|
])),
|
|
152
|
-
default:
|
|
153
|
-
e.showDetailedErrorSummary ? (o(), r("ul",
|
|
154
|
-
(o(!0), r(
|
|
155
|
-
])) :
|
|
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
|
-
})) :
|
|
159
|
-
|
|
160
|
-
modelValue:
|
|
161
|
-
"onUpdate:modelValue": n[0] || (n[0] = (a) =>
|
|
162
|
-
onCloseWithSaving: n[1] || (n[1] = (a) =>
|
|
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
|
-
|
|
172
|
+
pe as default
|
|
169
173
|
};
|