@vcmap/module-selector 2.0.0-rc.2 → 2.0.1

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/index.js CHANGED
@@ -10,39 +10,90 @@ function loadCss(href) {
10
10
  elem.onerror = reject;
11
11
  document.head.appendChild(elem);
12
12
  });
13
- } await loadCss('data:text/css;base64,LnYtY2FyZFtkYXRhLXYtMWRjYTRjN2Rde2Rpc3BsYXk6ZmxleDtmbGV4LWRpcmVjdGlvbjpjb2x1bW47anVzdGlmeS1jb250ZW50OmNlbnRlcjthbGlnbi1pdGVtczpjZW50ZXI7aGVpZ2h0OjE1MHB4O3dpZHRoOjE1MHB4O2FzcGVjdC1yYXRpbzoxO3RyYW5zaXRpb246YmFja2dyb3VuZC1jb2xvciAuM3N9LmZpeGVkLWNhcmRbZGF0YS12LTFkY2E0YzdkXXtoZWlnaHQ6MTUwcHg7d2lkdGg6MTUwcHg7YXNwZWN0LXJhdGlvOjF9LnNlbGVjdGVkLWNhcmRbZGF0YS12LTFkY2E0YzdkXXtiYWNrZ3JvdW5kLWNvbG9yOnJnYih2YXIoLS12LXRoZW1lLXByaW1hcnkpKTtjb2xvcjpyZ2IodmFyKC0tdi10aGVtZS1vbi1wcmltYXJ5KSl9Cg==');import { VcsFormButton as A, WindowSlot as D, createToggleAction as O, ButtonLocation as j } from "../../../assets/ui.js";
14
- import { defineComponent as E, inject as F, computed as V, resolveComponent as c, openBlock as r, createBlock as p, withCtx as l, createVNode as a, createTextVNode as u, toDisplayString as m, createCommentVNode as S, createElementBlock as h, Fragment as B, renderList as N, normalizeClass as T, ref as b } from "../../../assets/vue.js";
15
- import { VSheet as J, VContainer as L, VRow as P, VCol as R, VCard as G, VIcon as H, VCardTitle as K } from "../../../assets/vuetify.js";
16
- import { VcsModule as U } from "../../../assets/core.js";
17
- const k = "@vcmap/module-selector", W = "2.0.0-rc.2", Z = "^6.0";
18
- async function $(e, o) {
19
- const t = await fetch(e, {
13
+ } await loadCss('data:text/css;base64,LnYtY2FyZFtkYXRhLXYtMjlhMjIwMmZde2Rpc3BsYXk6ZmxleDtmbGV4LWRpcmVjdGlvbjpjb2x1bW47anVzdGlmeS1jb250ZW50OmNlbnRlcjthbGlnbi1pdGVtczpjZW50ZXI7aGVpZ2h0OjE1MHB4O3dpZHRoOjE1MHB4O2FzcGVjdC1yYXRpbzoxO3RyYW5zaXRpb246YmFja2dyb3VuZC1jb2xvciAuM3N9LmZpeGVkLWNhcmRbZGF0YS12LTI5YTIyMDJmXXtoZWlnaHQ6MTUwcHg7d2lkdGg6MTUwcHg7YXNwZWN0LXJhdGlvOjF9LnNlbGVjdGVkLWNhcmRbZGF0YS12LTI5YTIyMDJmXXtiYWNrZ3JvdW5kLWNvbG9yOnJnYih2YXIoLS12LXRoZW1lLXByaW1hcnkpKTtjb2xvcjpyZ2IodmFyKC0tdi10aGVtZS1vbi1wcmltYXJ5KSl9LnYtYnJlYWRjcnVtYnNbZGF0YS12LWEwNWI5ZDk4XXtwYWRkaW5nOjE2cHggMCA0cHh9Cg==');import { VcsFormButton as re, VcsTextField as te, VcsLabel as se, VcsFormSection as ae, VcsCheckbox as ce, useProxiedComplexModel as ve, useModelHasProperty as ge, VcsList as Me, AbstractConfigEditor as be, WindowSlot as he, createToggleAction as we, ButtonLocation as Ve } from "../../../assets/ui.js";
14
+ import { defineComponent as J, inject as me, computed as j, resolveComponent as m, openBlock as w, createBlock as _, withCtx as l, createVNode as t, createTextVNode as S, toDisplayString as y, createCommentVNode as B, createElementBlock as R, Fragment as W, renderList as le, normalizeClass as ie, ref as N, createElementVNode as Se, reactive as _e, watch as ne, mergeProps as ye } from "../../../assets/vue.js";
15
+ import { VSheet as Ee, VContainer as Z, VRow as Q, VCol as X, VCard as fe, VIcon as Ce, VCardTitle as $e, VForm as Ie, VDivider as ke, VDialog as Ue, VBreadcrumbs as Ae, VBreadcrumbsItem as Te } from "../../../assets/vuetify.js";
16
+ import { VcsModule as Oe } from "../../../assets/core.js";
17
+ function de(e, o) {
18
+ if (e != null) {
19
+ const i = Number.parseInt(String(e), 10);
20
+ if (i != null && !Number.isNaN(i))
21
+ return i;
22
+ }
23
+ return o;
24
+ }
25
+ function Ne(e, o) {
26
+ return e == null ? !!o : typeof e == "boolean" ? e : e === 1 ? !0 : e === 0 ? !1 : typeof e == "string" && (e.toLowerCase() === "true" || e.toLowerCase() === "1") ? !0 : typeof e == "string" && (e.toLowerCase() === "false" || e.toLowerCase() === "0") ? !1 : !!o;
27
+ }
28
+ function qe(e) {
29
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
30
+ }
31
+ var Be = function e(o, i) {
32
+ if (o === i) return !0;
33
+ if (o && i && typeof o == "object" && typeof i == "object") {
34
+ if (o.constructor !== i.constructor) return !1;
35
+ var r, d, n;
36
+ if (Array.isArray(o)) {
37
+ if (r = o.length, r != i.length) return !1;
38
+ for (d = r; d-- !== 0; )
39
+ if (!e(o[d], i[d])) return !1;
40
+ return !0;
41
+ }
42
+ if (o.constructor === RegExp) return o.source === i.source && o.flags === i.flags;
43
+ if (o.valueOf !== Object.prototype.valueOf) return o.valueOf() === i.valueOf();
44
+ if (o.toString !== Object.prototype.toString) return o.toString() === i.toString();
45
+ if (n = Object.keys(o), r = n.length, r !== Object.keys(i).length) return !1;
46
+ for (d = r; d-- !== 0; )
47
+ if (!Object.prototype.hasOwnProperty.call(i, n[d])) return !1;
48
+ for (d = r; d-- !== 0; ) {
49
+ var u = n[d];
50
+ if (!e(o[u], i[u])) return !1;
51
+ }
52
+ return !0;
53
+ }
54
+ return o !== o && i !== i;
55
+ };
56
+ const oe = /* @__PURE__ */ qe(Be), P = "@vcmap/module-selector", Fe = "2.0.1", Ge = "^6.0";
57
+ async function ue(e, o) {
58
+ const i = await fetch(e, {
20
59
  method: "GET"
21
- }).then((s) => {
22
- if (s.ok)
23
- return s.json();
60
+ }).then((r) => {
61
+ if (r.ok)
62
+ return r.json();
24
63
  });
25
- if (t) {
26
- t._id = "moduleSelector_module_id";
27
- const s = new U(t);
28
- await o.addModule(s);
64
+ if (i) {
65
+ i._id = "moduleSelector_module_id";
66
+ const r = new Oe(i);
67
+ await o.addModule(r);
29
68
  }
30
69
  }
31
- async function Q(e) {
32
- const o = "moduleSelector_module_id";
33
- e.getModuleById(o) && await e.removeModule(o);
70
+ async function Le(e) {
71
+ var d, n;
72
+ const o = "moduleSelector_module_id", i = (d = e.maps.activeMap) == null ? void 0 : d.name;
73
+ e.getModuleById(o) && await e.removeModule(o), e.maps.activeMap || await e.maps.setActiveMap(i || ((n = [...e.maps][0]) == null ? void 0 : n.name));
34
74
  }
35
- const x = "moduleSelector_window_id", X = E({
75
+ const K = "moduleSelector_window_id";
76
+ async function pe(e, o, i, r, d) {
77
+ var a;
78
+ if (await Le(i), e === null && !d) {
79
+ i.windowManager.remove(K);
80
+ return;
81
+ }
82
+ const n = r[e], u = (n == null ? void 0 : n.type) === "group" ? (a = n.cards) == null ? void 0 : a[o] : null;
83
+ u != null && u.moduleUrl ? await ue(u.moduleUrl, i) : (n == null ? void 0 : n.type) === "url" && await ue(n.moduleUrl, i), i.windowManager.remove(K);
84
+ }
85
+ const Pe = J({
36
86
  name: "ModuleSelector",
87
+ methods: { startApplication: pe },
37
88
  components: {
38
- VSheet: J,
39
- VContainer: L,
40
- VRow: P,
41
- VCol: R,
42
- VCard: G,
43
- VIcon: H,
44
- VCardTitle: K,
45
- VcsFormButton: A
89
+ VSheet: Ee,
90
+ VContainer: Z,
91
+ VRow: Q,
92
+ VCol: X,
93
+ VCard: fe,
94
+ VIcon: Ce,
95
+ VCardTitle: $e,
96
+ VcsFormButton: re
46
97
  },
47
98
  props: {
48
99
  modules: {
@@ -61,86 +112,79 @@ const x = "moduleSelector_window_id", X = E({
61
112
  }
62
113
  },
63
114
  setup(e) {
64
- const o = F("vcsApp"), t = o.plugins.getByKey(k), { modules: s } = e, C = V(() => {
65
- const n = e.modules[t.selectedMainModuleIndex.value];
66
- return (n == null ? void 0 : n.type) === "group" ? n.cards : [];
67
- }), I = (n) => {
68
- t.selectedMainModuleIndex.value === n ? t.selectedMainModuleIndex.value = null : t.selectedMainModuleIndex.value = n;
69
- }, v = (n) => {
70
- t.selectedNestedModuleIndex.value === n ? t.selectedNestedModuleIndex.value = null : t.selectedNestedModuleIndex.value = n;
71
- }, g = () => {
72
- t.selectedNestedModuleIndex.value = null, t.selectedMainModuleIndex.value = null;
73
- }, M = async () => {
74
- var i;
75
- await Q(o);
76
- const n = t.selectedMainModuleIndex.value, y = t.selectedNestedModuleIndex.value;
77
- if (n === null) return;
78
- const d = s[n], w = (d == null ? void 0 : d.type) === "group" ? (i = d.cards) == null ? void 0 : i[y] : null;
79
- w != null && w.moduleUrl ? await $(w.moduleUrl, o) : (d == null ? void 0 : d.type) === "url" && await $(d.moduleUrl, o), o.windowManager.remove(x);
80
- }, _ = V(() => {
115
+ const o = me("vcsApp"), i = o.plugins.getByKey(P), { modules: r } = e, d = j(() => {
116
+ const c = e.modules[i.selectedMainModuleIndex.value];
117
+ return (c == null ? void 0 : c.type) === "group" ? c.cards : [];
118
+ }), n = (c) => {
119
+ i.selectedMainModuleIndex.value === c ? i.selectedMainModuleIndex.value = null : i.selectedMainModuleIndex.value = c;
120
+ }, u = (c) => {
121
+ i.selectedNestedModuleIndex.value === c ? i.selectedNestedModuleIndex.value = null : i.selectedNestedModuleIndex.value = c;
122
+ }, a = () => {
123
+ i.selectedNestedModuleIndex.value = null, i.selectedMainModuleIndex.value = null;
124
+ }, v = j(() => {
81
125
  if (!e.requireModuleSelection) return !1;
82
- const n = t.selectedMainModuleIndex.value, y = t.selectedNestedModuleIndex.value, d = s[n];
83
- return n == null || (d == null ? void 0 : d.type) === "group" && d.cards && y == null;
126
+ const c = i.selectedMainModuleIndex.value, f = i.selectedNestedModuleIndex.value, g = r[c];
127
+ return c == null || (g == null ? void 0 : g.type) === "group" && g.cards && f == null;
84
128
  });
85
129
  return {
86
- nestedCards: C,
87
- plugin: t,
88
- selectModule: I,
89
- selectNestedModule: v,
90
- showMainCards: g,
91
- startApplication: M,
92
- isButtonDisabled: _
130
+ nestedCards: d,
131
+ plugin: i,
132
+ selectModule: n,
133
+ selectNestedModule: u,
134
+ showMainCards: a,
135
+ isButtonDisabled: v,
136
+ app: o
93
137
  };
94
138
  }
95
139
  }), Y = (e, o) => {
96
- const t = e.__vccOpts || e;
97
- for (const [s, C] of o)
98
- t[s] = C;
99
- return t;
140
+ const i = e.__vccOpts || e;
141
+ for (const [r, d] of o)
142
+ i[r] = d;
143
+ return i;
100
144
  };
101
- function ee(e, o, t, s, C, I) {
102
- const v = c("v-icon"), g = c("v-card-title"), M = c("v-card"), _ = c("v-col"), n = c("v-row"), y = c("VcsFormButton"), d = c("v-container"), w = c("v-sheet");
103
- return r(), p(w, {
145
+ function je(e, o, i, r, d, n) {
146
+ const u = m("v-icon"), a = m("v-card-title"), v = m("v-card"), c = m("v-col"), f = m("v-row"), g = m("VcsFormButton"), $ = m("v-container"), U = m("v-sheet");
147
+ return w(), _(U, {
104
148
  class: "module-selector",
105
149
  elevation: "1"
106
150
  }, {
107
151
  default: l(() => [
108
- a(d, null, {
152
+ t($, null, {
109
153
  default: l(() => [
110
- a(n, {
154
+ t(f, {
111
155
  class: "justify-center align-center",
112
156
  "no-gutters": ""
113
157
  }, {
114
158
  default: l(() => [
115
- e.basisModule && !e.nestedCards.length ? (r(), p(_, {
159
+ e.basisModule && !e.nestedCards.length ? (w(), _(c, {
116
160
  key: 0,
117
161
  cols: "auto",
118
162
  class: "pa-2"
119
163
  }, {
120
164
  default: l(() => [
121
- a(M, {
165
+ t(v, {
122
166
  class: "pa-3 fixed-card selected-card",
123
167
  outlined: ""
124
168
  }, {
125
169
  default: l(() => [
126
- e.basisModule.icon ? (r(), p(v, {
170
+ e.basisModule.icon ? (w(), _(u, {
127
171
  key: 0,
128
172
  size: "50"
129
173
  }, {
130
174
  default: l(() => [
131
- u(
132
- m(e.basisModule.icon),
175
+ S(
176
+ y(e.basisModule.icon),
133
177
  1
134
178
  /* TEXT */
135
179
  )
136
180
  ]),
137
181
  _: 1
138
182
  /* STABLE */
139
- })) : S("v-if", !0),
140
- a(g, { class: "text-center" }, {
183
+ })) : B("v-if", !0),
184
+ t(a, { class: "text-center" }, {
141
185
  default: l(() => [
142
- u(
143
- m(e.$st(e.basisModule.title)),
186
+ S(
187
+ y(e.$st(e.basisModule.title)),
144
188
  1
145
189
  /* TEXT */
146
190
  )
@@ -155,31 +199,31 @@ function ee(e, o, t, s, C, I) {
155
199
  ]),
156
200
  _: 1
157
201
  /* STABLE */
158
- })) : S("v-if", !0),
159
- e.nestedCards.length ? (r(), h(
160
- B,
202
+ })) : B("v-if", !0),
203
+ e.nestedCards.length ? (w(), R(
204
+ W,
161
205
  { key: 2 },
162
206
  [
163
- a(_, {
207
+ t(c, {
164
208
  cols: "auto",
165
209
  class: "pa-2"
166
210
  }, {
167
211
  default: l(() => [
168
- a(M, {
212
+ t(v, {
169
213
  class: "fixed-card hover-card",
170
214
  outlined: "",
171
- onClick: o[0] || (o[0] = (i) => e.showMainCards())
215
+ onClick: o[0] || (o[0] = (V) => e.showMainCards())
172
216
  }, {
173
217
  default: l(() => [
174
- a(v, { size: "50" }, {
218
+ t(u, { size: "50" }, {
175
219
  default: l(() => [
176
- u("mdi-arrow-left")
220
+ S("mdi-arrow-left")
177
221
  ]),
178
222
  _: 1
179
223
  /* STABLE */
180
224
  }),
181
- u(
182
- " " + m(e.$st("moduleSelector.cardBack")),
225
+ S(
226
+ " " + y(e.$st("moduleSelector.cardBack")),
183
227
  1
184
228
  /* TEXT */
185
229
  )
@@ -191,36 +235,36 @@ function ee(e, o, t, s, C, I) {
191
235
  _: 1
192
236
  /* STABLE */
193
237
  }),
194
- (r(!0), h(
195
- B,
238
+ (w(!0), R(
239
+ W,
196
240
  null,
197
- N(e.nestedCards, (i, f) => (r(), p(
198
- _,
241
+ le(e.nestedCards, (V, E) => (w(), _(
242
+ c,
199
243
  {
200
- key: f,
244
+ key: E,
201
245
  cols: "auto",
202
246
  class: "pa-2"
203
247
  },
204
248
  {
205
249
  default: l(() => [
206
- a(M, {
207
- class: T(["fixed-card hover-card", {
208
- "selected-card": e.plugin.selectedNestedModuleIndex.value === f
250
+ t(v, {
251
+ class: ie(["fixed-card hover-card", {
252
+ "selected-card": e.plugin.selectedNestedModuleIndex.value === E
209
253
  }]),
210
254
  outlined: "",
211
- onClick: (z) => e.selectNestedModule(f)
255
+ onClick: (I) => e.selectNestedModule(E)
212
256
  }, {
213
257
  default: l(() => [
214
- i.icon ? (r(), p(
215
- v,
258
+ V.icon ? (w(), _(
259
+ u,
216
260
  {
217
261
  key: 0,
218
262
  size: "50"
219
263
  },
220
264
  {
221
265
  default: l(() => [
222
- u(
223
- m(i.icon),
266
+ S(
267
+ y(V.icon),
224
268
  1
225
269
  /* TEXT */
226
270
  )
@@ -230,14 +274,14 @@ function ee(e, o, t, s, C, I) {
230
274
  },
231
275
  1024
232
276
  /* DYNAMIC_SLOTS */
233
- )) : S("v-if", !0),
234
- a(
235
- g,
277
+ )) : B("v-if", !0),
278
+ t(
279
+ a,
236
280
  { class: "text-center" },
237
281
  {
238
282
  default: l(() => [
239
- u(
240
- m(e.$st(i.title)),
283
+ S(
284
+ y(e.$st(V.title)),
241
285
  1
242
286
  /* TEXT */
243
287
  )
@@ -265,36 +309,36 @@ function ee(e, o, t, s, C, I) {
265
309
  ],
266
310
  64
267
311
  /* STABLE_FRAGMENT */
268
- )) : (r(!0), h(
269
- B,
312
+ )) : (w(!0), R(
313
+ W,
270
314
  { key: 1 },
271
- N(e.modules, (i, f) => (r(), p(
272
- _,
315
+ le(e.modules, (V, E) => (w(), _(
316
+ c,
273
317
  {
274
318
  cols: "auto",
275
319
  class: "pa-2",
276
- key: f
320
+ key: E
277
321
  },
278
322
  {
279
323
  default: l(() => [
280
- a(M, {
281
- class: T(["fixed-card hover-card", {
282
- "selected-card": e.plugin.selectedMainModuleIndex.value === f
324
+ t(v, {
325
+ class: ie(["fixed-card hover-card", {
326
+ "selected-card": e.plugin.selectedMainModuleIndex.value === E
283
327
  }]),
284
328
  outlined: "",
285
- onClick: (z) => e.selectModule(f)
329
+ onClick: (I) => e.selectModule(E)
286
330
  }, {
287
331
  default: l(() => [
288
- i.icon ? (r(), p(
289
- v,
332
+ V.icon ? (w(), _(
333
+ u,
290
334
  {
291
335
  key: 0,
292
336
  size: "50"
293
337
  },
294
338
  {
295
339
  default: l(() => [
296
- u(
297
- m(i.icon),
340
+ S(
341
+ y(V.icon),
298
342
  1
299
343
  /* TEXT */
300
344
  )
@@ -304,14 +348,14 @@ function ee(e, o, t, s, C, I) {
304
348
  },
305
349
  1024
306
350
  /* DYNAMIC_SLOTS */
307
- )) : S("v-if", !0),
308
- a(
309
- g,
351
+ )) : B("v-if", !0),
352
+ t(
353
+ a,
310
354
  { class: "text-center" },
311
355
  {
312
356
  default: l(() => [
313
- u(
314
- m(e.$st(i.title)),
357
+ S(
358
+ y(e.$st(V.title)),
315
359
  1
316
360
  /* TEXT */
317
361
  )
@@ -340,24 +384,30 @@ function ee(e, o, t, s, C, I) {
340
384
  _: 1
341
385
  /* STABLE */
342
386
  }),
343
- a(n, { justify: "end" }, {
387
+ t(f, { justify: "end" }, {
344
388
  default: l(() => [
345
- a(y, {
389
+ t(g, {
346
390
  variant: "filled",
347
391
  class: "ma-5",
348
- onClick: e.startApplication,
392
+ onClick: o[1] || (o[1] = (V) => e.startApplication(
393
+ e.plugin.selectedMainModuleIndex.value,
394
+ e.plugin.selectedNestedModuleIndex.value,
395
+ e.app,
396
+ e.modules,
397
+ e.basisModule
398
+ )),
349
399
  disabled: e.isButtonDisabled
350
400
  }, {
351
401
  default: l(() => [
352
- u(
353
- m(e.$st("moduleSelector.startButton")),
402
+ S(
403
+ y(e.$st("moduleSelector.startButton")),
354
404
  1
355
405
  /* TEXT */
356
406
  )
357
407
  ]),
358
408
  _: 1
359
409
  /* STABLE */
360
- }, 8, ["onClick", "disabled"])
410
+ }, 8, ["disabled"])
361
411
  ]),
362
412
  _: 1
363
413
  /* STABLE */
@@ -371,82 +421,1173 @@ function ee(e, o, t, s, C, I) {
371
421
  /* STABLE */
372
422
  });
373
423
  }
374
- const te = /* @__PURE__ */ Y(X, [["render", ee], ["__scopeId", "data-v-1dca4c7d"]]), q = () => ({
424
+ const De = /* @__PURE__ */ Y(Pe, [["render", je], ["__scopeId", "data-v-29a2202f"]]), H = () => ({
375
425
  windowTitle: "moduleSelector.title",
426
+ isActiveOnStart: !0,
427
+ requireModuleSelection: !1,
376
428
  position: {
377
429
  left: "33%",
378
430
  right: "33%",
379
431
  top: "10%"
380
432
  },
433
+ basisModule: void 0,
381
434
  modules: []
435
+ }), ze = J({
436
+ name: "ModuleEditor",
437
+ components: {
438
+ VcsTextField: te,
439
+ VcsLabel: se,
440
+ VCol: X,
441
+ VRow: Q,
442
+ VForm: Ie,
443
+ VContainer: Z,
444
+ VcsFormButton: re,
445
+ VDivider: ke,
446
+ VCard: fe,
447
+ VcsFormSection: ae
448
+ },
449
+ props: {
450
+ modelValue: {
451
+ type: Object,
452
+ required: !0
453
+ }
454
+ },
455
+ setup(e) {
456
+ const o = N(e.modelValue), i = N(!1);
457
+ return {
458
+ localModuleOptions: o,
459
+ isFormValid: i,
460
+ validateForm: () => {
461
+ i.value = !!o.value.title;
462
+ },
463
+ requiredRule: (n) => !!n || "moduleSelector.configEditor.editorError"
464
+ };
465
+ }
466
+ }), Re = { class: "d-flex gc-2 w-100 justify-end pa-2" };
467
+ function We(e, o, i, r, d, n) {
468
+ const u = m("VcsLabel"), a = m("v-col"), v = m("VcsTextField"), c = m("v-row"), f = m("v-container"), g = m("v-form"), $ = m("v-divider"), U = m("VcsFormButton"), V = m("VcsFormSection"), E = m("v-card");
469
+ return w(), _(E, null, {
470
+ default: l(() => [
471
+ t(V, null, {
472
+ default: l(() => [
473
+ t(g, {
474
+ modelValue: e.isFormValid,
475
+ "onUpdate:modelValue": o[3] || (o[3] = (I) => e.isFormValid = I),
476
+ ref: "form"
477
+ }, {
478
+ default: l(() => [
479
+ t(f, { class: "px-2 pt-0 pb-2" }, {
480
+ default: l(() => [
481
+ t(c, { "no-gutters": "" }, {
482
+ default: l(() => [
483
+ t(a, { cols: "6" }, {
484
+ default: l(() => [
485
+ t(u, {
486
+ required: "",
487
+ "html-for": "moduleName"
488
+ }, {
489
+ default: l(() => [
490
+ S(
491
+ y(e.$st("moduleSelector.configEditor.moduleName")),
492
+ 1
493
+ /* TEXT */
494
+ )
495
+ ]),
496
+ _: 1
497
+ /* STABLE */
498
+ })
499
+ ]),
500
+ _: 1
501
+ /* STABLE */
502
+ }),
503
+ t(a, { cols: "6" }, {
504
+ default: l(() => [
505
+ t(v, {
506
+ id: "moduleName",
507
+ placeholder: "Module Name",
508
+ modelValue: e.localModuleOptions.title,
509
+ "onUpdate:modelValue": o[0] || (o[0] = (I) => e.localModuleOptions.title = I),
510
+ rules: [e.requiredRule]
511
+ }, null, 8, ["modelValue", "rules"])
512
+ ]),
513
+ _: 1
514
+ /* STABLE */
515
+ })
516
+ ]),
517
+ _: 1
518
+ /* STABLE */
519
+ }),
520
+ t(c, { "no-gutters": "" }, {
521
+ default: l(() => [
522
+ t(a, { cols: "6" }, {
523
+ default: l(() => [
524
+ t(u, {
525
+ required: "",
526
+ "html-for": "moduleIcon"
527
+ }, {
528
+ default: l(() => [
529
+ S(
530
+ y(e.$st("moduleSelector.configEditor.moduleIcon")),
531
+ 1
532
+ /* TEXT */
533
+ )
534
+ ]),
535
+ _: 1
536
+ /* STABLE */
537
+ })
538
+ ]),
539
+ _: 1
540
+ /* STABLE */
541
+ }),
542
+ t(a, { cols: "6" }, {
543
+ default: l(() => [
544
+ t(v, {
545
+ id: "moduleIcon",
546
+ placeholder: "Icon Name",
547
+ modelValue: e.localModuleOptions.icon,
548
+ "onUpdate:modelValue": o[1] || (o[1] = (I) => e.localModuleOptions.icon = I),
549
+ rules: [e.requiredRule]
550
+ }, null, 8, ["modelValue", "rules"])
551
+ ]),
552
+ _: 1
553
+ /* STABLE */
554
+ })
555
+ ]),
556
+ _: 1
557
+ /* STABLE */
558
+ }),
559
+ t(c, { "no-gutters": "" }, {
560
+ default: l(() => [
561
+ t(a, { cols: "6" }, {
562
+ default: l(() => [
563
+ t(u, {
564
+ required: "",
565
+ "html-for": "moduleUrl"
566
+ }, {
567
+ default: l(() => [
568
+ S(
569
+ y(e.$st("moduleSelector.configEditor.moduleUrl")),
570
+ 1
571
+ /* TEXT */
572
+ )
573
+ ]),
574
+ _: 1
575
+ /* STABLE */
576
+ })
577
+ ]),
578
+ _: 1
579
+ /* STABLE */
580
+ }),
581
+ t(a, { cols: "6" }, {
582
+ default: l(() => [
583
+ t(v, {
584
+ id: "moduleUrl",
585
+ placeholder: "URL",
586
+ modelValue: e.localModuleOptions.moduleUrl,
587
+ "onUpdate:modelValue": o[2] || (o[2] = (I) => e.localModuleOptions.moduleUrl = I),
588
+ rules: [e.requiredRule]
589
+ }, null, 8, ["modelValue", "rules"])
590
+ ]),
591
+ _: 1
592
+ /* STABLE */
593
+ })
594
+ ]),
595
+ _: 1
596
+ /* STABLE */
597
+ })
598
+ ]),
599
+ _: 1
600
+ /* STABLE */
601
+ })
602
+ ]),
603
+ _: 1
604
+ /* STABLE */
605
+ }, 8, ["modelValue"]),
606
+ t($),
607
+ Se("div", Re, [
608
+ t(U, {
609
+ disabled: !e.isFormValid,
610
+ onClick: o[4] || (o[4] = () => {
611
+ e.$emit("submit", e.localModuleOptions);
612
+ }),
613
+ variant: "filled"
614
+ }, {
615
+ default: l(() => [
616
+ S(
617
+ y(e.$st("components.apply")),
618
+ 1
619
+ /* TEXT */
620
+ )
621
+ ]),
622
+ _: 1
623
+ /* STABLE */
624
+ }, 8, ["disabled"]),
625
+ t(U, {
626
+ onClick: o[5] || (o[5] = (I) => e.$emit("close"))
627
+ }, {
628
+ default: l(() => [
629
+ S(
630
+ y(e.$st("components.cancel")),
631
+ 1
632
+ /* TEXT */
633
+ )
634
+ ]),
635
+ _: 1
636
+ /* STABLE */
637
+ })
638
+ ])
639
+ ]),
640
+ _: 1
641
+ /* STABLE */
642
+ })
643
+ ]),
644
+ _: 1
645
+ /* STABLE */
646
+ });
647
+ }
648
+ const He = /* @__PURE__ */ Y(ze, [["render", We]]), Ke = J({
649
+ name: "WindowPositionSettings",
650
+ components: {
651
+ VContainer: Z,
652
+ VRow: Q,
653
+ VCol: X,
654
+ VcsCheckbox: ce,
655
+ VcsTextField: te
656
+ },
657
+ props: {
658
+ modelValue: {
659
+ type: Object,
660
+ required: !0
661
+ },
662
+ positionKeys: {
663
+ type: Array,
664
+ default: () => ["height", "maxHeight", "width", "maxWidth"]
665
+ }
666
+ },
667
+ setup(e, { emit: o }) {
668
+ const i = ve(
669
+ e,
670
+ "modelValue",
671
+ o
672
+ );
673
+ return {
674
+ inputs: j(() => e.positionKeys.reduce(
675
+ (d, n) => (d[n] = {
676
+ key: n,
677
+ checkbox: ge(i, n, null),
678
+ input: j({
679
+ get() {
680
+ return i.value[n];
681
+ },
682
+ set(u) {
683
+ i.value[n] = u;
684
+ }
685
+ }),
686
+ placeholder: "auto"
687
+ }, d),
688
+ {}
689
+ ))
690
+ };
691
+ }
692
+ });
693
+ function Je(e, o, i, r, d, n) {
694
+ const u = m("VcsCheckbox"), a = m("v-col"), v = m("VcsTextField"), c = m("v-row"), f = m("v-container");
695
+ return w(), _(f, { class: "py-0 px-1" }, {
696
+ default: l(() => [
697
+ (w(!0), R(
698
+ W,
699
+ null,
700
+ le(e.inputs, ({ key: g, checkbox: $, input: U, placeholder: V }) => (w(), _(
701
+ c,
702
+ {
703
+ "no-gutters": "",
704
+ key: g
705
+ },
706
+ {
707
+ default: l(() => [
708
+ t(
709
+ a,
710
+ null,
711
+ {
712
+ default: l(() => [
713
+ t(u, {
714
+ label: `appConfigurator.editors.featureInfo.window.position.${g}`,
715
+ modelValue: $.value,
716
+ "onUpdate:modelValue": (E) => $.value = E
717
+ }, null, 8, ["label", "modelValue", "onUpdate:modelValue"])
718
+ ]),
719
+ _: 2
720
+ /* DYNAMIC */
721
+ },
722
+ 1024
723
+ /* DYNAMIC_SLOTS */
724
+ ),
725
+ t(
726
+ a,
727
+ null,
728
+ {
729
+ default: l(() => [
730
+ t(v, {
731
+ clearable: "",
732
+ disabled: !$.value,
733
+ placeholder: V,
734
+ modelValue: U.value,
735
+ "onUpdate:modelValue": (E) => U.value = E,
736
+ modelModifiers: { trim: !0 }
737
+ }, null, 8, ["disabled", "placeholder", "modelValue", "onUpdate:modelValue"])
738
+ ]),
739
+ _: 2
740
+ /* DYNAMIC */
741
+ },
742
+ 1024
743
+ /* DYNAMIC_SLOTS */
744
+ )
745
+ ]),
746
+ _: 2
747
+ /* DYNAMIC */
748
+ },
749
+ 1024
750
+ /* DYNAMIC_SLOTS */
751
+ ))),
752
+ 128
753
+ /* KEYED_FRAGMENT */
754
+ ))
755
+ ]),
756
+ _: 1
757
+ /* STABLE */
758
+ });
759
+ }
760
+ const Ze = /* @__PURE__ */ Y(Ke, [["render", Je]]), Qe = J({
761
+ name: "ModuleSelectorConfigEditor",
762
+ components: {
763
+ VcsCheckbox: ce,
764
+ VDialog: Ue,
765
+ VcsList: Me,
766
+ VcsFormSection: ae,
767
+ VRow: Q,
768
+ VcsLabel: se,
769
+ AbstractConfigEditor: be,
770
+ VcsTextField: te,
771
+ VCol: X,
772
+ VContainer: Z,
773
+ ModuleEditor: He,
774
+ VBreadcrumbs: Ae,
775
+ VBreadcrumbsItem: Te,
776
+ WindowPositionSettings: Ze
777
+ },
778
+ props: {
779
+ getConfig: {
780
+ type: Function,
781
+ required: !0
782
+ },
783
+ setConfig: {
784
+ type: Function,
785
+ required: !0
786
+ }
787
+ },
788
+ setup(e) {
789
+ var z, p, ee;
790
+ const o = me("vcsApp"), i = N(0), r = N(void 0), d = N([]), n = N(void 0), u = N(void 0), a = N(void 0);
791
+ r.value = { ...H(), ...e.getConfig() };
792
+ const v = N();
793
+ (z = r.value) != null && z.basisModule && (v.value = (p = r.value) == null ? void 0 : p.basisModule);
794
+ const c = j({
795
+ get() {
796
+ return !!v.value;
797
+ },
798
+ set(s) {
799
+ var C;
800
+ s ? v.value = ((C = r.value) == null ? void 0 : C.basisModule) || { title: "" } : v.value = null;
801
+ }
802
+ }), f = _e([]);
803
+ function g(s) {
804
+ var C;
805
+ if (s.type === "url")
806
+ return {
807
+ title: s.title,
808
+ type: s.type,
809
+ icon: s.icon,
810
+ moduleUrl: s.moduleUrl || ""
811
+ };
812
+ {
813
+ const M = ((C = s.cards) == null ? void 0 : C.map((A) => ({
814
+ title: A.title,
815
+ icon: A.icon,
816
+ moduleUrl: A.moduleUrl,
817
+ type: A.type
818
+ }))) || [];
819
+ return {
820
+ title: s.title,
821
+ type: s.type,
822
+ icon: s.icon,
823
+ ...M.length ? { cards: M } : {}
824
+ };
825
+ }
826
+ }
827
+ const $ = {
828
+ name: "moduleSelector.configEditor.addGroup",
829
+ callback() {
830
+ var M;
831
+ const s = {
832
+ type: "group",
833
+ name: "",
834
+ id: "",
835
+ title: "title",
836
+ icon: "icon",
837
+ cards: []
838
+ };
839
+ (M = d.value) == null || M.push(s), n.value = s;
840
+ const C = d.value.indexOf(s);
841
+ s.id = `${s.title}-${C}`, f.splice(1, 1), f.length > 0 && (f[0].icon = "$vcsPlus", f[0].title = "moduleSelector.configEditor.TooltipAddModule");
842
+ }
843
+ };
844
+ function U(s) {
845
+ return s.map(g);
846
+ }
847
+ function V(s, C) {
848
+ var A, F, G;
849
+ const M = {
850
+ id: `${s.title}-${C}`,
851
+ name: s.title,
852
+ title: s.title,
853
+ icon: s.icon,
854
+ type: s.type,
855
+ actions: []
856
+ };
857
+ return s.type === "url" && (M.moduleUrl = s.moduleUrl, (A = M.actions) == null || A.push({
858
+ name: "edit",
859
+ title: "moduleSelector.configEditor.TooltipEditModule",
860
+ icon: "$vcsEdit",
861
+ callback() {
862
+ if (n.value === void 0 && d.value.length > 0) {
863
+ const b = d.value.find(
864
+ (k) => k.id === M.id
865
+ );
866
+ b && (u.value = {
867
+ id: b.id,
868
+ title: b.title,
869
+ icon: b.icon,
870
+ moduleUrl: b.moduleUrl
871
+ });
872
+ } else {
873
+ const b = n.value.cards.find(
874
+ (k) => k.id === M.id
875
+ );
876
+ b && (u.value = {
877
+ id: b.id,
878
+ title: b.title,
879
+ icon: b.icon,
880
+ moduleUrl: b.moduleUrl
881
+ });
882
+ }
883
+ }
884
+ })), s.type === "group" && ((F = M.actions) == null || F.push({
885
+ name: "editGroup",
886
+ title: "moduleSelector.configEditor.TooltipEditGroup",
887
+ icon: "mdi-playlist-edit",
888
+ callback() {
889
+ if (d.value.length > 0) {
890
+ const b = d.value.find(
891
+ (k) => k.id === M.id
892
+ );
893
+ b && (n.value = b, f.splice(1, 1), f.length > 0 && (f[0].icon = "$vcsPlus", f[0].title = "moduleSelector.configEditor.TooltipAddModule"));
894
+ }
895
+ }
896
+ }), s.cards && (M.cards = s.cards.map(V))), (G = M.actions) == null || G.push({
897
+ name: "linkButton.editor.remove",
898
+ title: "moduleSelector.configEditor.TooltipDeleteMG",
899
+ icon: "$vcsTrashCan",
900
+ callback() {
901
+ var b, k, h;
902
+ n.value ? n.value.cards = (k = (b = n.value) == null ? void 0 : b.cards) == null ? void 0 : k.filter(
903
+ (T) => T.id !== M.id
904
+ ) : d.value = (h = d.value) == null ? void 0 : h.filter(
905
+ (T) => T.id !== M.id
906
+ );
907
+ }
908
+ }), M;
909
+ }
910
+ (ee = r.value) != null && ee.modules && (d.value = r.value.modules.map(V)), f.push(
911
+ {
912
+ name: "moduleSelector.configEditor.add",
913
+ callback() {
914
+ u.value = {
915
+ id: "",
916
+ title: "title",
917
+ icon: "icon",
918
+ moduleUrl: "url"
919
+ };
920
+ }
921
+ },
922
+ $
923
+ ), ne(r, (s) => {
924
+ s != null && s.modules ? a.value = s.modules.map(
925
+ (C, M) => V(C, M)
926
+ ) : a.value = [];
927
+ });
928
+ const E = () => {
929
+ e.setConfig({
930
+ ...r.value,
931
+ modules: U(d.value),
932
+ basisModule: v.value
933
+ });
934
+ }, I = () => {
935
+ var s, C, M, A, F, G, b, k, h, T;
936
+ if (n.value === void 0) {
937
+ if (u.value)
938
+ if (((s = u.value) == null ? void 0 : s.id) !== "") {
939
+ const O = d.value.find(
940
+ (q) => {
941
+ var L;
942
+ return q.id === ((L = u.value) == null ? void 0 : L.id);
943
+ }
944
+ );
945
+ O && (O.title = u.value.title, O.icon = u.value.icon, O.moduleUrl = u.value.moduleUrl);
946
+ } else {
947
+ d.value.push({
948
+ id: `${u.value.title}-${d.value.length}`,
949
+ title: u.value.title,
950
+ name: u.value.title,
951
+ icon: u.value.icon,
952
+ moduleUrl: u.value.moduleUrl,
953
+ type: "url"
954
+ });
955
+ const O = U(
956
+ d.value
957
+ );
958
+ d.value = O.map(V);
959
+ }
960
+ } else if (u.value && ((C = u.value) == null ? void 0 : C.id) !== "") {
961
+ const O = n.value.cards.find(
962
+ (L) => L.id === u.value.id
963
+ );
964
+ O && (O.title = u.value.title, O.icon = u.value.icon, O.moduleUrl = u.value.moduleUrl);
965
+ let q;
966
+ (M = n.value) != null && M.id || ((A = n.value) == null ? void 0 : A.id) !== "" ? q = n.value.id : q = `${n.value.title}-${d.value.length - 1}`, n.value = d.value.find(
967
+ (L) => L.id === q
968
+ );
969
+ } else {
970
+ n.value.cards.push({
971
+ id: `${u.value.title}-${(G = (F = n.value) == null ? void 0 : F.cards) == null ? void 0 : G.length}`,
972
+ title: u.value.title,
973
+ name: u.value.title,
974
+ icon: u.value.icon,
975
+ moduleUrl: u.value.moduleUrl,
976
+ type: "url"
977
+ });
978
+ const O = U(
979
+ d.value
980
+ );
981
+ d.value = O.map(V);
982
+ let q;
983
+ (b = n.value) != null && b.id || ((k = n.value) == null ? void 0 : k.id) !== "" ? q = n.value.id : q = `${(h = n.value) == null ? void 0 : h.title}-${d.value.length - 1}`, n.value = (T = d.value) == null ? void 0 : T.find(
984
+ (L) => L.id === q
985
+ );
986
+ }
987
+ u.value = void 0;
988
+ }, x = () => {
989
+ n.value = void 0, f.length > 0 && (delete f[0].icon, delete f[0].title), f.push($);
990
+ }, D = N([
991
+ {
992
+ title: o.vueI18n.t(
993
+ "moduleSelector.configEditor.breadcrumbs.overview"
994
+ ),
995
+ disabled: !1,
996
+ href: "#"
997
+ },
998
+ {
999
+ title: o.vueI18n.t("moduleSelector.configEditor.breadcrumbs.group"),
1000
+ disabled: !0,
1001
+ href: "#"
1002
+ }
1003
+ ]);
1004
+ return ne(n, (s) => {
1005
+ s && s.title && (D.value[1].title = `${o.vueI18n.t("moduleSelector.configEditor.breadcrumbs.group")}: ${s.title}`, s.name = s.title);
1006
+ }), {
1007
+ editingItem: u,
1008
+ localConfig: r,
1009
+ listItemArray: d,
1010
+ breadcrumbItems: D,
1011
+ currentGroup: n,
1012
+ apply: E,
1013
+ returnLevel: x,
1014
+ updateItem: I,
1015
+ level: i,
1016
+ listItems: a,
1017
+ basisModule: v,
1018
+ basisModuleExists: c,
1019
+ headerActions: f,
1020
+ move({
1021
+ item: s,
1022
+ targetIndex: C
1023
+ }) {
1024
+ var M, A, F, G, b, k;
1025
+ if (d.value && n.value === void 0) {
1026
+ let h = C;
1027
+ h = h >= 0 ? h : 0, h = h < ((M = d.value) == null ? void 0 : M.length) ? h : d.value.length - 1;
1028
+ const T = (A = d.value) == null ? void 0 : A.indexOf(s);
1029
+ T !== h && ((F = d.value) == null || F.splice(T, 1), (G = d.value) == null || G.splice(h, 0, s));
1030
+ } else if ((((k = (b = n.value) == null ? void 0 : b.cards) == null ? void 0 : k.length) ?? 0) > 1) {
1031
+ let h = C;
1032
+ h = h >= 0 ? h : 0, h = h < n.value.cards.length ? h : n.value.cards.length - 1;
1033
+ const T = n.value.cards.indexOf(s);
1034
+ T && T !== h && (n.value.cards.splice(T, 1), n.value.cards.splice(h, 0, s));
1035
+ }
1036
+ }
1037
+ };
1038
+ }
382
1039
  });
383
- function se(e) {
1040
+ function Xe(e, o, i, r, d, n) {
1041
+ const u = m("VcsLabel"), a = m("v-col"), v = m("VcsTextField"), c = m("v-row"), f = m("VcsCheckbox"), g = m("v-container"), $ = m("VcsFormSection"), U = m("WindowPositionSettings"), V = m("v-breadcrumbs-item"), E = m("v-breadcrumbs"), I = m("VcsList"), x = m("ModuleEditor"), D = m("v-dialog"), z = m("AbstractConfigEditor");
1042
+ return e.localConfig ? (w(), _(z, ye({
1043
+ key: 0,
1044
+ onSubmit: e.apply
1045
+ }, { ...e.$attrs, ...e.$props }), {
1046
+ default: l(() => [
1047
+ e.currentGroup === void 0 ? (w(), _(g, {
1048
+ key: 0,
1049
+ class: "py-0 px-0"
1050
+ }, {
1051
+ default: l(() => [
1052
+ t($, { heading: "moduleSelector.configEditor.general" }, {
1053
+ default: l(() => [
1054
+ t(g, { class: "py-0 px-1" }, {
1055
+ default: l(() => [
1056
+ t(c, { "no-gutters": "" }, {
1057
+ default: l(() => [
1058
+ t(a, { cols: "6" }, {
1059
+ default: l(() => [
1060
+ t(u, { "html-for": "moduleselector-window-title" }, {
1061
+ default: l(() => [
1062
+ S(
1063
+ y(e.$st("moduleSelector.configEditor.windowTitle")),
1064
+ 1
1065
+ /* TEXT */
1066
+ )
1067
+ ]),
1068
+ _: 1
1069
+ /* STABLE */
1070
+ })
1071
+ ]),
1072
+ _: 1
1073
+ /* STABLE */
1074
+ }),
1075
+ t(a, null, {
1076
+ default: l(() => [
1077
+ t(v, {
1078
+ id: "moduleselector-window-title",
1079
+ placeholder: e.$t("moduleSelector.title"),
1080
+ modelValue: e.localConfig.windowTitle,
1081
+ "onUpdate:modelValue": o[0] || (o[0] = (p) => e.localConfig.windowTitle = p)
1082
+ }, null, 8, ["placeholder", "modelValue"])
1083
+ ]),
1084
+ _: 1
1085
+ /* STABLE */
1086
+ })
1087
+ ]),
1088
+ _: 1
1089
+ /* STABLE */
1090
+ }),
1091
+ t(c, { "no-gutters": "" }, {
1092
+ default: l(() => [
1093
+ t(a, null, {
1094
+ default: l(() => [
1095
+ t(f, {
1096
+ modelValue: e.localConfig.isActiveOnStart,
1097
+ "onUpdate:modelValue": o[1] || (o[1] = (p) => e.localConfig.isActiveOnStart = p),
1098
+ label: "moduleSelector.configEditor.isActiveOnStart"
1099
+ }, null, 8, ["modelValue"])
1100
+ ]),
1101
+ _: 1
1102
+ /* STABLE */
1103
+ })
1104
+ ]),
1105
+ _: 1
1106
+ /* STABLE */
1107
+ }),
1108
+ t(c, { "no-gutters": "" }, {
1109
+ default: l(() => [
1110
+ t(a, null, {
1111
+ default: l(() => [
1112
+ t(f, {
1113
+ modelValue: e.localConfig.requireModuleSelection,
1114
+ "onUpdate:modelValue": o[2] || (o[2] = (p) => e.localConfig.requireModuleSelection = p),
1115
+ label: "moduleSelector.configEditor.requireModuleSelection"
1116
+ }, null, 8, ["modelValue"])
1117
+ ]),
1118
+ _: 1
1119
+ /* STABLE */
1120
+ })
1121
+ ]),
1122
+ _: 1
1123
+ /* STABLE */
1124
+ })
1125
+ ]),
1126
+ _: 1
1127
+ /* STABLE */
1128
+ })
1129
+ ]),
1130
+ _: 1
1131
+ /* STABLE */
1132
+ }),
1133
+ t($, {
1134
+ heading: "moduleSelector.configEditor.windowPosition",
1135
+ expandable: !0
1136
+ }, {
1137
+ default: l(() => [
1138
+ t(U, {
1139
+ modelValue: e.localConfig.position,
1140
+ "onUpdate:modelValue": o[3] || (o[3] = (p) => e.localConfig.position = p),
1141
+ "position-keys": [
1142
+ "top",
1143
+ "right",
1144
+ "bottom",
1145
+ "left",
1146
+ "width",
1147
+ "maxWidth",
1148
+ "height",
1149
+ "maxHeight"
1150
+ ]
1151
+ }, null, 8, ["modelValue"])
1152
+ ]),
1153
+ _: 1
1154
+ /* STABLE */
1155
+ }),
1156
+ t($, { heading: "moduleSelector.configEditor.baseModule" }, {
1157
+ default: l(() => [
1158
+ t(g, { class: "py-0 px-1" }, {
1159
+ default: l(() => [
1160
+ t(c, { "no-gutters": "" }, {
1161
+ default: l(() => [
1162
+ t(a, null, {
1163
+ default: l(() => [
1164
+ t(f, {
1165
+ id: "BaseModuleCheckbox",
1166
+ modelValue: e.basisModuleExists,
1167
+ "onUpdate:modelValue": o[4] || (o[4] = (p) => e.basisModuleExists = p),
1168
+ label: "moduleSelector.configEditor.baseModuleCheckbox"
1169
+ }, null, 8, ["modelValue"])
1170
+ ]),
1171
+ _: 1
1172
+ /* STABLE */
1173
+ })
1174
+ ]),
1175
+ _: 1
1176
+ /* STABLE */
1177
+ }),
1178
+ e.basisModuleExists ? (w(), _(c, {
1179
+ key: 0,
1180
+ "no-gutters": ""
1181
+ }, {
1182
+ default: l(() => [
1183
+ t(a, { cols: "6" }, {
1184
+ default: l(() => [
1185
+ t(u, {
1186
+ required: "",
1187
+ "html-for": "basisModuleName"
1188
+ }, {
1189
+ default: l(() => [
1190
+ S(
1191
+ y(e.$st("moduleSelector.configEditor.title")),
1192
+ 1
1193
+ /* TEXT */
1194
+ )
1195
+ ]),
1196
+ _: 1
1197
+ /* STABLE */
1198
+ })
1199
+ ]),
1200
+ _: 1
1201
+ /* STABLE */
1202
+ }),
1203
+ t(a, null, {
1204
+ default: l(() => [
1205
+ t(v, {
1206
+ id: "basisModuleName",
1207
+ placeholder: "Base Module",
1208
+ rules: [
1209
+ e.basisModuleExists && (!e.basisModule.title || e.basisModule.title === "") ? () => "moduleSelector.configEditor.error" : () => !0
1210
+ ],
1211
+ modelValue: e.basisModule.title,
1212
+ "onUpdate:modelValue": o[5] || (o[5] = (p) => e.basisModule.title = p)
1213
+ }, null, 8, ["rules", "modelValue"])
1214
+ ]),
1215
+ _: 1
1216
+ /* STABLE */
1217
+ })
1218
+ ]),
1219
+ _: 1
1220
+ /* STABLE */
1221
+ })) : B("v-if", !0),
1222
+ e.basisModuleExists ? (w(), _(c, {
1223
+ key: 1,
1224
+ "no-gutters": ""
1225
+ }, {
1226
+ default: l(() => [
1227
+ t(a, { cols: "6" }, {
1228
+ default: l(() => [
1229
+ t(u, {
1230
+ required: "",
1231
+ "html-for": "basisModuleIcon"
1232
+ }, {
1233
+ default: l(() => [
1234
+ S(
1235
+ y(e.$st("components.style.icon")),
1236
+ 1
1237
+ /* TEXT */
1238
+ )
1239
+ ]),
1240
+ _: 1
1241
+ /* STABLE */
1242
+ })
1243
+ ]),
1244
+ _: 1
1245
+ /* STABLE */
1246
+ }),
1247
+ t(a, null, {
1248
+ default: l(() => [
1249
+ t(v, {
1250
+ id: "basisModuleIcon",
1251
+ placeholder: "mdi-home-city",
1252
+ rules: [
1253
+ e.basisModuleExists && (!e.basisModule.icon || e.basisModule.icon === "") ? () => "moduleSelector.configEditor.error" : () => !0
1254
+ ],
1255
+ modelValue: e.basisModule.icon,
1256
+ "onUpdate:modelValue": o[6] || (o[6] = (p) => e.basisModule.icon = p)
1257
+ }, null, 8, ["rules", "modelValue"])
1258
+ ]),
1259
+ _: 1
1260
+ /* STABLE */
1261
+ })
1262
+ ]),
1263
+ _: 1
1264
+ /* STABLE */
1265
+ })) : B("v-if", !0)
1266
+ ]),
1267
+ _: 1
1268
+ /* STABLE */
1269
+ })
1270
+ ]),
1271
+ _: 1
1272
+ /* STABLE */
1273
+ })
1274
+ ]),
1275
+ _: 1
1276
+ /* STABLE */
1277
+ })) : (w(), _(g, {
1278
+ key: 1,
1279
+ class: "py-0 px-1"
1280
+ }, {
1281
+ default: l(() => [
1282
+ t(E, {
1283
+ items: e.breadcrumbItems,
1284
+ divider: "/"
1285
+ }, {
1286
+ item: l(({ item: p }) => [
1287
+ (w(), _(V, {
1288
+ key: p.title,
1289
+ disabled: p.disabled,
1290
+ href: p.href,
1291
+ onClick: (ee) => p.disabled ? null : e.returnLevel()
1292
+ }, {
1293
+ default: l(() => [
1294
+ S(
1295
+ y(p.title),
1296
+ 1
1297
+ /* TEXT */
1298
+ )
1299
+ ]),
1300
+ _: 2
1301
+ /* DYNAMIC */
1302
+ }, 1032, ["disabled", "href", "onClick"]))
1303
+ ]),
1304
+ _: 1
1305
+ /* STABLE */
1306
+ }, 8, ["items"]),
1307
+ t(c, { "no-gutters": "" }, {
1308
+ default: l(() => [
1309
+ t(a, { cols: "6" }, {
1310
+ default: l(() => [
1311
+ t(u, {
1312
+ required: "",
1313
+ "html-for": "groupModuleName"
1314
+ }, {
1315
+ default: l(() => [
1316
+ S(
1317
+ y(e.$st("moduleSelector.configEditor.groupName")),
1318
+ 1
1319
+ /* TEXT */
1320
+ )
1321
+ ]),
1322
+ _: 1
1323
+ /* STABLE */
1324
+ })
1325
+ ]),
1326
+ _: 1
1327
+ /* STABLE */
1328
+ }),
1329
+ t(a, null, {
1330
+ default: l(() => [
1331
+ t(v, {
1332
+ id: "groupModuleName",
1333
+ placeholder: "Module Name",
1334
+ modelValue: e.currentGroup.title,
1335
+ "onUpdate:modelValue": o[7] || (o[7] = (p) => e.currentGroup.title = p),
1336
+ rules: [(p) => !!p || "moduleSelector.configEditor.error"]
1337
+ }, null, 8, ["modelValue", "rules"])
1338
+ ]),
1339
+ _: 1
1340
+ /* STABLE */
1341
+ })
1342
+ ]),
1343
+ _: 1
1344
+ /* STABLE */
1345
+ }),
1346
+ t(c, { "no-gutters": "" }, {
1347
+ default: l(() => [
1348
+ t(a, { cols: "6" }, {
1349
+ default: l(() => [
1350
+ t(u, {
1351
+ required: "",
1352
+ "html-for": "groupModuleIcon"
1353
+ }, {
1354
+ default: l(() => [
1355
+ S(
1356
+ y(e.$st("moduleSelector.configEditor.moduleIcon")),
1357
+ 1
1358
+ /* TEXT */
1359
+ )
1360
+ ]),
1361
+ _: 1
1362
+ /* STABLE */
1363
+ })
1364
+ ]),
1365
+ _: 1
1366
+ /* STABLE */
1367
+ }),
1368
+ t(a, null, {
1369
+ default: l(() => [
1370
+ t(v, {
1371
+ id: "groupModuleIcon",
1372
+ placeholder: "Module Icon",
1373
+ modelValue: e.currentGroup.icon,
1374
+ "onUpdate:modelValue": o[8] || (o[8] = (p) => e.currentGroup.icon = p),
1375
+ rules: [
1376
+ (p) => !!p || "moduleSelector.configEditor.editorError"
1377
+ ]
1378
+ }, null, 8, ["modelValue", "rules"])
1379
+ ]),
1380
+ _: 1
1381
+ /* STABLE */
1382
+ })
1383
+ ]),
1384
+ _: 1
1385
+ /* STABLE */
1386
+ })
1387
+ ]),
1388
+ _: 1
1389
+ /* STABLE */
1390
+ })),
1391
+ t($, {
1392
+ heading: "moduleSelector.configEditor.heading",
1393
+ "start-open": !0,
1394
+ "header-actions": e.headerActions
1395
+ }, {
1396
+ default: l(() => [
1397
+ B("V-if currentItem group > cards || wenn url oder empty listItems"),
1398
+ e.currentGroup === void 0 ? (w(), _(I, {
1399
+ key: 0,
1400
+ items: e.listItemArray,
1401
+ draggable: !0,
1402
+ onItemMoved: e.move
1403
+ }, null, 8, ["items", "onItemMoved"])) : (w(), _(I, {
1404
+ key: 1,
1405
+ items: e.currentGroup.cards,
1406
+ draggable: !0,
1407
+ onItemMoved: e.move
1408
+ }, null, 8, ["items", "onItemMoved"])),
1409
+ e.editingItem ? (w(), _(D, {
1410
+ key: 2,
1411
+ "model-value": !0,
1412
+ width: "400",
1413
+ persistent: !0
1414
+ }, {
1415
+ default: l(() => [
1416
+ t(x, {
1417
+ "model-value": e.editingItem,
1418
+ onClose: o[9] || (o[9] = (p) => e.editingItem = void 0),
1419
+ onSubmit: o[10] || (o[10] = (p) => e.updateItem())
1420
+ }, null, 8, ["model-value"])
1421
+ ]),
1422
+ _: 1
1423
+ /* STABLE */
1424
+ })) : B("v-if", !0)
1425
+ ]),
1426
+ _: 1
1427
+ /* STABLE */
1428
+ }, 8, ["header-actions"])
1429
+ ]),
1430
+ _: 1
1431
+ /* STABLE */
1432
+ }, 16, ["onSubmit"])) : B("v-if", !0);
1433
+ }
1434
+ const Ye = /* @__PURE__ */ Y(Qe, [["render", Xe], ["__scopeId", "data-v-a05b9d98"]]);
1435
+ function to(e) {
1436
+ let o;
384
1437
  return {
385
1438
  get name() {
386
- return k;
1439
+ return P;
387
1440
  },
388
1441
  get version() {
389
- return W;
1442
+ return Fe;
390
1443
  },
391
1444
  get mapVersion() {
392
- return Z;
1445
+ return Ge;
393
1446
  },
394
1447
  get config() {
395
- return { ...q(), ...e };
1448
+ return { ...H(), ...e };
396
1449
  },
397
- selectedMainModuleIndex: b(void 0),
398
- selectedNestedModuleIndex: b(void 0),
399
- initialize(o) {
400
- const t = {
401
- id: x,
402
- component: te,
403
- slot: D.DETACHED,
1450
+ selectedMainModuleIndex: N(void 0),
1451
+ selectedNestedModuleIndex: N(void 0),
1452
+ async initialize(i, r) {
1453
+ var u;
1454
+ o = i;
1455
+ const d = {
1456
+ id: K,
1457
+ component: De,
1458
+ slot: he.DETACHED,
404
1459
  position: this.config.position,
405
1460
  state: {
406
- headerTitle: this.config.windowTitle
1461
+ headerTitle: this.config.windowTitle,
1462
+ infoUrlCallback: o.getHelpUrlCallback("/tools/moduleSelector.html")
407
1463
  },
408
1464
  props: {
409
1465
  modules: this.config.modules,
410
1466
  basisModule: this.config.basisModule,
411
1467
  requireModuleSelection: this.config.requireModuleSelection
412
1468
  }
413
- }, { action: s } = O(
1469
+ };
1470
+ if (r) {
1471
+ const a = de(r.smi), v = de(r.snmi), c = Ne(r.w), { modules: f } = this.config;
1472
+ if (a !== void 0 && a < (f == null ? void 0 : f.length)) {
1473
+ this.selectedMainModuleIndex.value = a;
1474
+ const g = f[a];
1475
+ v !== void 0 && (g == null ? void 0 : g.type) === "group" && v < ((u = g == null ? void 0 : g.cards) == null ? void 0 : u.length) && (this.selectedNestedModuleIndex.value = v);
1476
+ }
1477
+ c || await pe(
1478
+ this.selectedMainModuleIndex.value,
1479
+ this.selectedNestedModuleIndex.value,
1480
+ o,
1481
+ e.modules,
1482
+ e.basisModule
1483
+ );
1484
+ }
1485
+ const { action: n } = we(
414
1486
  {
415
1487
  name: "moduleSelector",
416
1488
  title: "moduleSelector.title",
417
1489
  icon: "mdi-view-grid"
418
1490
  },
419
- t,
1491
+ d,
420
1492
  o.windowManager,
421
- k
1493
+ P
422
1494
  );
423
1495
  return o.navbarManager.add(
424
1496
  {
425
- id: s.name,
426
- action: s
1497
+ id: n.name,
1498
+ action: n
427
1499
  },
428
- k,
429
- j.PROJECT
430
- ), e.isActiveOnStart && o.windowManager.add(t, k), Promise.resolve();
1500
+ P,
1501
+ Ve.PROJECT
1502
+ ), (r && r.w || !r && e.isActiveOnStart) && o.windowManager.add(d, P), Promise.resolve();
1503
+ },
1504
+ getDefaultOptions: H,
1505
+ getState() {
1506
+ var u, a;
1507
+ const i = (u = this.selectedMainModuleIndex) == null ? void 0 : u.value, r = (a = this.selectedNestedModuleIndex) == null ? void 0 : a.value, d = o.windowManager.has(K), n = this.config.isActiveOnStart;
1508
+ return i !== void 0 || r !== void 0 || d !== n ? { smi: i, snmi: r, w: d } : {};
1509
+ },
1510
+ getConfigEditors() {
1511
+ return [
1512
+ {
1513
+ component: Ye,
1514
+ title: "moduleSelector.name",
1515
+ infoUrlCallback: o.getHelpUrlCallback(
1516
+ "/components/plugins/moduleSelectorConfig.html",
1517
+ "app-configurator"
1518
+ )
1519
+ }
1520
+ ];
431
1521
  },
432
- getDefaultOptions: q,
433
1522
  toJSON() {
434
- const o = {};
435
- return e.windowTitle != null && (o.windowTitle = e.windowTitle), e.position != null && (o.position = e.position), e.modules != null && (o.modules = e.modules), o;
1523
+ const i = {}, r = H();
1524
+ return this.config.windowTitle !== r.windowTitle && (i.windowTitle = this.config.windowTitle), this.config.isActiveOnStart !== r.isActiveOnStart && (i.isActiveOnStart = this.config.isActiveOnStart), this.config.requireModuleSelection !== r.requireModuleSelection && (i.requireModuleSelection = this.config.requireModuleSelection), oe(this.config.position, r.position) || (i.position = this.config.position), oe(this.config.modules, r.modules) || (i.modules = this.config.modules), oe(this.config.basisModule, r.basisModule) || (i.basisModule = this.config.basisModule), i;
436
1525
  },
437
1526
  i18n: {
438
1527
  de: {
439
1528
  moduleSelector: {
1529
+ name: "Modul Auswahl Editor",
440
1530
  title: "Themenkartenauswahl",
441
1531
  startButton: "Anwendung starten",
442
- cardBack: "Zurück"
1532
+ cardBack: "Zurück",
1533
+ configEditor: {
1534
+ TooltipAddModule: "Modul hinzufügen",
1535
+ TooltipEditModule: "Modul bearbeiten",
1536
+ TooltipEditGroup: "Modul-Gruppe bearbeiten",
1537
+ TooltipDeleteMG: "Modul/Gruppe löschen",
1538
+ error: "Bitte tragen Sie einen Namen ein",
1539
+ editorError: "Bitte füllen Sie das Feld aus",
1540
+ breadcrumbs: { overview: "Übersicht", group: "Gruppe" },
1541
+ heading: "Themen- & Modulzuordnung",
1542
+ baseModule: "Basismodul",
1543
+ baseModuleCheckbox: "Basismodul anzeigen",
1544
+ title: "Titel",
1545
+ add: "Module hinzufügen",
1546
+ addGroup: "Module Gruppe hinzufügen",
1547
+ moduleName: "Module Name",
1548
+ moduleIcon: "Icon Name",
1549
+ moduleUrl: "Module URL",
1550
+ groupName: "Gruppen Name",
1551
+ back: "Zurück",
1552
+ general: "Allgemeine Einstellungen",
1553
+ isActiveOnStart: "Themenkartenauswahl beim Start der Karte zeigen",
1554
+ requireModuleSelection: "Modulauswahl erforderlich machen",
1555
+ windowTitle: "Fenster Titel",
1556
+ windowPosition: "Fenster Position"
1557
+ }
443
1558
  }
444
1559
  },
445
1560
  en: {
446
1561
  moduleSelector: {
1562
+ name: "Module Selector Editor",
447
1563
  title: "Theme map selection",
448
1564
  startButton: "Start application",
449
- cardBack: "Back"
1565
+ cardBack: "Back",
1566
+ configEditor: {
1567
+ TooltipAddModule: "Add module",
1568
+ TooltipEditModule: "Edit module",
1569
+ TooltipEditGroup: "Edit module group",
1570
+ TooltipDeleteMG: "Delete module/group",
1571
+ error: "Please add a name",
1572
+ editorError: "Please fill in the field",
1573
+ breadcrumbs: { overview: "Overview", group: "Group" },
1574
+ heading: "Topic & module assignment",
1575
+ baseModule: "Base module",
1576
+ baseModuleCheckbox: "Show base module",
1577
+ title: "Title",
1578
+ add: "Add module",
1579
+ addGroup: "Add module Group",
1580
+ moduleName: "Module name",
1581
+ moduleIcon: "Icon name",
1582
+ moduleUrl: "Module URL",
1583
+ groupName: "Group name",
1584
+ back: "Back",
1585
+ general: "General settings",
1586
+ isActiveOnStart: "Show theme map selection on map start",
1587
+ requireModuleSelection: "Require module selection",
1588
+ windowTitle: "Window title",
1589
+ windowPosition: "Window position"
1590
+ }
450
1591
  }
451
1592
  }
452
1593
  },
@@ -455,5 +1596,5 @@ function se(e) {
455
1596
  };
456
1597
  }
457
1598
  export {
458
- se as default
1599
+ to as default
459
1600
  };