qmap-forms 1.0.6 → 1.0.8
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/index.es.js +515 -308
- package/package.json +1 -1
- package/qmap.browser.js +1 -1
- package/qmap.umd.js +1 -1
package/index.es.js
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
import { Fragment as e, Teleport as t, computed as n, createApp as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createSlots as c, createTextVNode as l, createVNode as u, defineAsyncComponent as d, defineComponent as f, h as p, inject as m, nextTick as h, normalizeClass as g, normalizeStyle as _, onBeforeMount as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveComponent as D, resolveDynamicComponent as O, toDisplayString as k, unref as A, vModelCheckbox as
|
|
2
|
-
import { DateTime as
|
|
3
|
-
import { BehaviorSubject as
|
|
1
|
+
import { Fragment as e, Teleport as t, computed as n, createApp as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createSlots as c, createTextVNode as l, createVNode as u, defineAsyncComponent as d, defineComponent as f, h as p, inject as m, nextTick as h, normalizeClass as g, normalizeStyle as _, onBeforeMount as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveComponent as D, resolveDynamicComponent as O, toDisplayString as k, unref as A, vModelCheckbox as ee, vModelRadio as j, vModelSelect as M, vModelText as N, vShow as P, watch as F, withCtx as I, withDirectives as L, withKeys as R, withModifiers as z } from "vue";
|
|
2
|
+
import { DateTime as B } from "luxon";
|
|
3
|
+
import { BehaviorSubject as V, Subject as H } from "rxjs";
|
|
4
4
|
import "leaflet-editable";
|
|
5
|
-
import "leaflet";
|
|
5
|
+
import te from "leaflet-path-drag";
|
|
6
|
+
import { Circle as U, Control as W, DomEvent as G, DomUtil as ne, FeatureGroup as K, LatLngBounds as re, Map as ie, Rectangle as ae, TileLayer as q, featureGroup as oe, geoJSON as se } from "leaflet";
|
|
6
7
|
//#region \0rolldown/runtime.js
|
|
7
|
-
var
|
|
8
|
+
var J = Object.defineProperty, ce = (e, t) => {
|
|
9
|
+
let n = {};
|
|
10
|
+
for (var r in e) J(n, r, {
|
|
11
|
+
get: e[r],
|
|
12
|
+
enumerable: !0
|
|
13
|
+
});
|
|
14
|
+
return t || J(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
15
|
+
}, le = /* @__PURE__ */ f({
|
|
8
16
|
__name: "BtnTooltip",
|
|
9
17
|
props: { label: {} },
|
|
10
18
|
setup(n) {
|
|
@@ -48,7 +56,7 @@ var ee = /* @__PURE__ */ f({
|
|
|
48
56
|
onMouseover: f,
|
|
49
57
|
class: "qmap-button",
|
|
50
58
|
onMouseleave: p,
|
|
51
|
-
onKeydown:
|
|
59
|
+
onKeydown: R(p, ["esc"]),
|
|
52
60
|
style: {
|
|
53
61
|
border: "none",
|
|
54
62
|
background: "none"
|
|
@@ -64,47 +72,47 @@ var ee = /* @__PURE__ */ f({
|
|
|
64
72
|
tabindex: "-1"
|
|
65
73
|
}, k(n.label), 5)) : a("", !0)]))], 64));
|
|
66
74
|
}
|
|
67
|
-
}),
|
|
75
|
+
}), ue = /* @__PURE__ */ f({
|
|
68
76
|
__name: "subtitle-button",
|
|
69
77
|
props: { qMap: {} },
|
|
70
78
|
setup(e) {
|
|
71
|
-
return (t, n) => e.qMap.subtitle ? (S(), i(
|
|
79
|
+
return (t, n) => e.qMap.subtitle ? (S(), i(le, {
|
|
72
80
|
key: 0,
|
|
73
81
|
label: e.qMap.subtitle
|
|
74
82
|
}, {
|
|
75
|
-
default:
|
|
83
|
+
default: I(() => [...n[0] ||= [s("i", { class: "fa fa-question-circle" }, null, -1)]]),
|
|
76
84
|
_: 1
|
|
77
85
|
}, 8, ["label"])) : a("", !0);
|
|
78
86
|
}
|
|
79
|
-
}),
|
|
87
|
+
}), de = { class: "block" }, Y = /* @__PURE__ */ f({
|
|
80
88
|
__name: "title-block",
|
|
81
89
|
props: { qMap: {} },
|
|
82
90
|
setup(e) {
|
|
83
|
-
return (t, n) => (S(), o("span",
|
|
91
|
+
return (t, n) => (S(), o("span", de, [
|
|
84
92
|
l(k(e.qMap.title || (e.qMap.id !== "#" && e.qMap.type !== "col" && e.qMap.type !== "group" ? e.qMap.id : "")) + " ", 1),
|
|
85
93
|
E(t.$slots, "default"),
|
|
86
|
-
u(
|
|
94
|
+
u(ue, { "q-map": e.qMap }, null, 8, ["q-map"])
|
|
87
95
|
]));
|
|
88
96
|
}
|
|
89
|
-
}),
|
|
97
|
+
}), fe = { class: "my-2 flex flex-row items-center justify-between" }, pe = {
|
|
90
98
|
key: 0,
|
|
91
99
|
class: "qmap_array--unset"
|
|
92
|
-
},
|
|
100
|
+
}, me = {
|
|
93
101
|
key: 1,
|
|
94
102
|
class: "qmap_array--set"
|
|
95
|
-
},
|
|
103
|
+
}, he = {
|
|
96
104
|
key: 0,
|
|
97
105
|
class: "qmap-card min-w-0 p-6 text-center qmap-empty"
|
|
98
|
-
},
|
|
106
|
+
}, ge = {
|
|
99
107
|
key: 1,
|
|
100
108
|
class: ""
|
|
101
|
-
},
|
|
109
|
+
}, _e = {
|
|
102
110
|
key: 0,
|
|
103
111
|
class: "qmap-card min-w-0 p-3"
|
|
104
|
-
},
|
|
112
|
+
}, ve = { class: "flex flex-col" }, ye = { class: "flex items-center gap-3 py-2 qmap-list-row" }, be = { class: "flex-1 min-w-0" }, xe = ["onClick"], Se = {
|
|
105
113
|
key: 1,
|
|
106
114
|
class: "mt-2 flex flex-col gap-2"
|
|
107
|
-
},
|
|
115
|
+
}, Ce = { class: "qmap-card min-w-0 p-3 flex flex-row items-center gap-2" }, we = { class: "flex-1 min-w-0 flex flex-col gap-2 qmap_sub_group mt-2" }, Te = ["onClick"], Ee = /* @__PURE__ */ f({
|
|
108
116
|
__name: "qArray",
|
|
109
117
|
props: {
|
|
110
118
|
qMap: {},
|
|
@@ -122,7 +130,7 @@ var ee = /* @__PURE__ */ f({
|
|
|
122
130
|
v(() => {
|
|
123
131
|
let e = r.model[r.qMap.id];
|
|
124
132
|
e && r.qMap.item ? l.value = e.slice().map((e) => ({ "#": e })) : e ? l.value = e : !e && r.qMap.required && (l.value = []);
|
|
125
|
-
}),
|
|
133
|
+
}), F(l, (e) => {
|
|
126
134
|
p(e);
|
|
127
135
|
});
|
|
128
136
|
function d() {
|
|
@@ -142,19 +150,19 @@ var ee = /* @__PURE__ */ f({
|
|
|
142
150
|
var t = l.value.slice();
|
|
143
151
|
t.splice(e, 1), l.value = t;
|
|
144
152
|
}
|
|
145
|
-
return (n, r) => (S(), o("div", null, [s("div",
|
|
153
|
+
return (n, r) => (S(), o("div", null, [s("div", fe, [u(Y, { "q-map": t.qMap }, null, 8, ["q-map"]), l.value ? (S(), o("div", me, [s("button", {
|
|
146
154
|
type: "button",
|
|
147
155
|
class: "inline-flex items-center justify-center gap-2 min-h-9 px-3.5 py-2 qmap-button",
|
|
148
156
|
"aria-label": "Add item",
|
|
149
157
|
onClick: r[1] ||= (e) => d()
|
|
150
|
-
}, "+")])) : (S(), o("div",
|
|
158
|
+
}, "+")])) : (S(), o("div", pe, [s("button", {
|
|
151
159
|
type: "button",
|
|
152
160
|
class: "inline-flex items-center justify-center gap-2 min-h-9 px-3.5 py-2 qmap-button",
|
|
153
161
|
"aria-label": "Add item",
|
|
154
162
|
onClick: r[0] ||= (e) => {
|
|
155
163
|
l.value = [], d();
|
|
156
164
|
}
|
|
157
|
-
}, "+")]))]), !l.value || !l.value.length ? (S(), o("div",
|
|
165
|
+
}, "+")]))]), !l.value || !l.value.length ? (S(), o("div", he, [...r[2] ||= [s("i", null, "Not set", -1)]])) : (S(), o("div", ge, [t.qMap.item ? (S(), o("div", _e, [s("div", ve, [(S(!0), o(e, null, T(l.value, (e, n) => (S(), o("div", ye, [s("div", be, [u(Q, {
|
|
158
166
|
qMap: t.qMap.item,
|
|
159
167
|
modelValue: l.value[n],
|
|
160
168
|
"onUpdate:modelValue": [(e) => l.value[n] = e, (e) => f(n, e)],
|
|
@@ -173,7 +181,7 @@ var ee = /* @__PURE__ */ f({
|
|
|
173
181
|
class: "inline-flex items-center justify-center min-w-8 min-h-8 p-1 qmap-icon-button qmap-danger",
|
|
174
182
|
"aria-label": "Remove item",
|
|
175
183
|
onClick: (e) => m(n)
|
|
176
|
-
}, [...r[3] ||= [s("i", { class: "fa fa-trash" }, null, -1)]], 8,
|
|
184
|
+
}, [...r[3] ||= [s("i", { class: "fa fa-trash" }, null, -1)]], 8, xe)]))), 256))])])) : t.qMap.items ? (S(), o("div", Se, [(S(!0), o(e, null, T(l.value, (n, a) => (S(), o("div", Ce, [s("div", we, [(S(!0), o(e, null, T(t.qMap.items, (e) => (S(), i(Q, {
|
|
177
185
|
qMap: e,
|
|
178
186
|
modelValue: l.value[a],
|
|
179
187
|
"onUpdate:modelValue": [(e) => l.value[a] = e, (e) => f(a, e)],
|
|
@@ -194,13 +202,13 @@ var ee = /* @__PURE__ */ f({
|
|
|
194
202
|
class: "inline-flex items-center justify-center min-w-8 min-h-8 p-1 qmap-icon-button qmap-danger",
|
|
195
203
|
"aria-label": "Remove item",
|
|
196
204
|
onClick: (e) => m(a)
|
|
197
|
-
}, [...r[4] ||= [s("i", { class: "fa fa-times" }, null, -1)]], 8,
|
|
205
|
+
}, [...r[4] ||= [s("i", { class: "fa fa-times" }, null, -1)]], 8, Te)]))), 256))])) : a("", !0)]))]));
|
|
198
206
|
}
|
|
199
|
-
}),
|
|
207
|
+
}), De = { class: "flex items-center gap-1" }, Oe = [
|
|
200
208
|
"aria-checked",
|
|
201
209
|
"aria-label",
|
|
202
210
|
"disabled"
|
|
203
|
-
],
|
|
211
|
+
], ke = /*@__PURE__*/ f({
|
|
204
212
|
__name: "ToggleSwitch",
|
|
205
213
|
props: {
|
|
206
214
|
modelValue: { type: Boolean },
|
|
@@ -224,44 +232,44 @@ var ee = /* @__PURE__ */ f({
|
|
|
224
232
|
a.value === !1 && "slider-unchecked",
|
|
225
233
|
a.value === void 0 && "slider-indeterminate"
|
|
226
234
|
].filter(Boolean).join(" "));
|
|
227
|
-
return (t, n) => (S(), o("span",
|
|
235
|
+
return (t, n) => (S(), o("span", De, [s("button", {
|
|
228
236
|
type: "button",
|
|
229
237
|
class: g(["toggle-root", l.value]),
|
|
230
238
|
onClick: c,
|
|
231
239
|
"aria-checked": String(a.value),
|
|
232
240
|
"aria-label": e.ariaLabel,
|
|
233
241
|
disabled: e.disabled
|
|
234
|
-
}, [s("span", { class: g(["toggle-slider", u.value]) }, null, 2)], 10,
|
|
242
|
+
}, [s("span", { class: g(["toggle-slider", u.value]) }, null, 2)], 10, Oe), E(t.$slots, "default", {}, void 0, !0)]));
|
|
235
243
|
}
|
|
236
|
-
}),
|
|
244
|
+
}), Ae = (e, t) => {
|
|
237
245
|
let n = e.__vccOpts || e;
|
|
238
246
|
for (let [e, r] of t) n[e] = r;
|
|
239
247
|
return n;
|
|
240
|
-
},
|
|
248
|
+
}, je = /*#__PURE__*/ Ae(ke, [["__scopeId", "data-v-edf9fc7d"]]), Me = {
|
|
241
249
|
key: 0,
|
|
242
250
|
class: "inline-flex items-center gap-2"
|
|
243
|
-
},
|
|
251
|
+
}, Ne = ["for"], Pe = {
|
|
244
252
|
key: 0,
|
|
245
253
|
class: "qmap-required"
|
|
246
|
-
},
|
|
254
|
+
}, Fe = {
|
|
247
255
|
key: 1,
|
|
248
256
|
class: "qmap-required"
|
|
249
|
-
},
|
|
257
|
+
}, Ie = {
|
|
250
258
|
key: 2,
|
|
251
259
|
class: "qmap-button-field sm:flex items-center"
|
|
252
|
-
},
|
|
260
|
+
}, Le = { class: "sm:w-1/2 md:w-1/4 lg:w-1/5" }, Re = {
|
|
253
261
|
key: 0,
|
|
254
262
|
class: "qmap-required"
|
|
255
|
-
},
|
|
263
|
+
}, ze = {
|
|
256
264
|
class: "btn-group sm:w-1/2 md:w-2/4 lg:w-1/4 flex",
|
|
257
265
|
role: "group"
|
|
258
|
-
},
|
|
266
|
+
}, Be = ["aria-pressed", "disabled"], Ve = ["aria-pressed", "disabled"], He = ["for"], Ue = ["id", "disabled"], We = {
|
|
259
267
|
key: 0,
|
|
260
268
|
class: "qmap-required"
|
|
261
|
-
},
|
|
269
|
+
}, Ge = {
|
|
262
270
|
key: 1,
|
|
263
271
|
class: "qmap-required"
|
|
264
|
-
},
|
|
272
|
+
}, Ke = /* @__PURE__ */ f({
|
|
265
273
|
__name: "qBool",
|
|
266
274
|
props: {
|
|
267
275
|
qMap: {},
|
|
@@ -276,7 +284,7 @@ var ee = /* @__PURE__ */ f({
|
|
|
276
284
|
emits: ["qmap_change", "qmap_subquestions"],
|
|
277
285
|
setup(e, { emit: t }) {
|
|
278
286
|
let n = e, r = t, c = w(n.model[n.qMap.id]);
|
|
279
|
-
|
|
287
|
+
F(c, (e) => r("qmap_subquestions", e === !0 ? n.qMap.onPos : e === !1 ? n.qMap.onNeg : void 0)), F(() => n.model, (e) => c.value = e[n.qMap.id]), v(() => r("qmap_subquestions", c.value === !0 ? n.qMap.onPos : c.value === !1 ? n.qMap.onNeg : void 0));
|
|
280
288
|
function l(e) {
|
|
281
289
|
n.model[n.qMap.id] = e, r("qmap_change", {
|
|
282
290
|
qMap: n.qMap,
|
|
@@ -286,58 +294,58 @@ var ee = /* @__PURE__ */ f({
|
|
|
286
294
|
function d(e) {
|
|
287
295
|
c.value = e, l(e);
|
|
288
296
|
}
|
|
289
|
-
return (t, n) => e.lite && e.readOnly ? (S(), o("span",
|
|
297
|
+
return (t, n) => e.lite && e.readOnly ? (S(), o("span", Me, k(c.value ? "✓" : "□"), 1)) : e.qMap.style === "switch" ? (S(), o("label", {
|
|
290
298
|
key: 1,
|
|
291
299
|
class: "inline-flex items-center gap-2 min-h-8 qmap-check-row",
|
|
292
300
|
for: e.qMap.id
|
|
293
|
-
}, [u(
|
|
301
|
+
}, [u(je, {
|
|
294
302
|
modelValue: c.value,
|
|
295
303
|
"onUpdate:modelValue": [n[0] ||= (e) => c.value = e, d],
|
|
296
304
|
disabled: e.readOnly
|
|
297
|
-
}, null, 8, ["modelValue", "disabled"]), e.lite ? e.qMap.required ? (S(), o("span",
|
|
305
|
+
}, null, 8, ["modelValue", "disabled"]), e.lite ? e.qMap.required ? (S(), o("span", Fe, [...n[6] ||= [s("i", { class: "fa fa-asterisk" }, null, -1)]])) : a("", !0) : (S(), i(Y, {
|
|
298
306
|
key: 0,
|
|
299
307
|
"q-map": e.qMap
|
|
300
308
|
}, {
|
|
301
|
-
default:
|
|
309
|
+
default: I(() => [e.qMap.required ? (S(), o("span", Pe, [...n[5] ||= [s("i", { class: "fa fa-asterisk" }, null, -1)]])) : a("", !0)]),
|
|
302
310
|
_: 1
|
|
303
|
-
}, 8, ["q-map"]))], 8,
|
|
304
|
-
default:
|
|
311
|
+
}, 8, ["q-map"]))], 8, Ne)) : e.qMap.style === "button" ? (S(), o("div", Ie, [s("div", Le, [u(Y, { "q-map": e.qMap }, {
|
|
312
|
+
default: I(() => [e.qMap.required ? (S(), o("span", Re, [...n[7] ||= [s("i", { class: "fa fa-asterisk" }, null, -1)]])) : a("", !0)]),
|
|
305
313
|
_: 1
|
|
306
|
-
}, 8, ["q-map"])]), s("div",
|
|
314
|
+
}, 8, ["q-map"])]), s("div", ze, [s("button", {
|
|
307
315
|
type: "button",
|
|
308
316
|
"aria-pressed": c.value === !0,
|
|
309
317
|
class: g(["gap-2 flex-1 min-h-9 px-3.5 py-2 qmap-button", { "qmap-button-selected": c.value === !0 }]),
|
|
310
318
|
disabled: e.readOnly,
|
|
311
319
|
onClick: n[1] ||= (e) => d(!0)
|
|
312
|
-
}, k(e.qMap.pos || "Yes"), 11,
|
|
320
|
+
}, k(e.qMap.pos || "Yes"), 11, Be), s("button", {
|
|
313
321
|
type: "button",
|
|
314
322
|
"aria-pressed": c.value === !1,
|
|
315
323
|
class: g(["gap-2 flex-1 min-h-9 px-3.5 py-2 qmap-button", { "qmap-button-selected": c.value === !1 }]),
|
|
316
324
|
disabled: e.readOnly,
|
|
317
325
|
onClick: n[2] ||= (e) => d(!1)
|
|
318
|
-
}, k(e.qMap.neg || "No"), 11,
|
|
326
|
+
}, k(e.qMap.neg || "No"), 11, Ve)])])) : (S(), o("label", {
|
|
319
327
|
key: 3,
|
|
320
328
|
class: "inline-flex items-center gap-2 min-h-8 my-2 qmap-check-row",
|
|
321
329
|
for: e.qMap.id
|
|
322
|
-
}, [
|
|
330
|
+
}, [L(s("input", {
|
|
323
331
|
id: e.qMap.id,
|
|
324
332
|
"onUpdate:modelValue": n[3] ||= (e) => c.value = e,
|
|
325
333
|
type: "checkbox",
|
|
326
334
|
class: "qmap-checkbox",
|
|
327
335
|
disabled: e.readOnly,
|
|
328
336
|
onChange: n[4] ||= (e) => l(c.value)
|
|
329
|
-
}, null, 40,
|
|
337
|
+
}, null, 40, Ue), [[ee, c.value]]), e.lite ? e.qMap.required && !c.value ? (S(), o("span", Ge, [...n[9] ||= [s("i", { class: "fa fa-asterisk" }, null, -1)]])) : a("", !0) : (S(), i(Y, {
|
|
330
338
|
key: 0,
|
|
331
339
|
"q-map": e.qMap
|
|
332
340
|
}, {
|
|
333
|
-
default:
|
|
341
|
+
default: I(() => [e.qMap.required && !c.value ? (S(), o("span", We, [...n[8] ||= [s("i", { class: "fa fa-asterisk" }, null, -1)]])) : a("", !0)]),
|
|
334
342
|
_: 1
|
|
335
|
-
}, 8, ["q-map"]))], 8,
|
|
343
|
+
}, 8, ["q-map"]))], 8, He));
|
|
336
344
|
}
|
|
337
|
-
}),
|
|
345
|
+
}), qe = {
|
|
338
346
|
key: 0,
|
|
339
347
|
class: "inline-flex shrink-0 items-center gap-1 qmap-control-prepend"
|
|
340
|
-
},
|
|
348
|
+
}, Je = {
|
|
341
349
|
key: 1,
|
|
342
350
|
class: "inline-flex shrink-0 items-center gap-1 qmap-control-append"
|
|
343
351
|
}, X = /* @__PURE__ */ f({
|
|
@@ -353,39 +361,39 @@ var ee = /* @__PURE__ */ f({
|
|
|
353
361
|
"qmap-control-invalid": e.invalid,
|
|
354
362
|
"qmap-control-disabled": e.disabled
|
|
355
363
|
}]) }, [
|
|
356
|
-
t.$slots.prepend ? (S(), o("div",
|
|
364
|
+
t.$slots.prepend ? (S(), o("div", qe, [E(t.$slots, "prepend")])) : a("", !0),
|
|
357
365
|
E(t.$slots, "default"),
|
|
358
|
-
t.$slots.append ? (S(), o("div",
|
|
366
|
+
t.$slots.append ? (S(), o("div", Je, [E(t.$slots, "append")])) : a("", !0)
|
|
359
367
|
], 2));
|
|
360
368
|
}
|
|
361
|
-
}),
|
|
369
|
+
}), Ye = {
|
|
362
370
|
key: 0,
|
|
363
371
|
class: "inline-flex items-center gap-2"
|
|
364
|
-
},
|
|
372
|
+
}, Xe = { class: "qmap-field flex flex-col gap-1.5 min-w-0 text-sm" }, Ze = [
|
|
365
373
|
"aria-expanded",
|
|
366
374
|
"aria-label",
|
|
367
375
|
"disabled",
|
|
368
376
|
"onKeydown"
|
|
369
|
-
],
|
|
377
|
+
], Qe = {
|
|
370
378
|
key: 0,
|
|
371
379
|
class: "qmap-required",
|
|
372
380
|
"aria-hidden": "true"
|
|
373
|
-
},
|
|
381
|
+
}, $e = {
|
|
374
382
|
key: 1,
|
|
375
383
|
class: "absolute z-50 top-full left-0 mt-1 w-9/10 overflow-hidden qmap-select-dropdown"
|
|
376
|
-
},
|
|
384
|
+
}, et = { class: "flex items-center gap-2 px-3 py-2 qmap-select-search-wrap" }, tt = ["aria-multiselectable"], nt = [
|
|
377
385
|
"aria-selected",
|
|
378
386
|
"onMouseenter",
|
|
379
387
|
"onKeydown",
|
|
380
388
|
"onClick"
|
|
381
|
-
],
|
|
389
|
+
], rt = {
|
|
382
390
|
key: 0,
|
|
383
391
|
class: "inline-flex w-4 justify-center",
|
|
384
392
|
"aria-hidden": "true"
|
|
385
|
-
},
|
|
393
|
+
}, it = { class: "flex-1 min-w-0" }, at = {
|
|
386
394
|
key: 0,
|
|
387
395
|
class: "m-0 p-3 text-center qmap-select-empty"
|
|
388
|
-
},
|
|
396
|
+
}, ot = /* @__PURE__ */ f({
|
|
389
397
|
__name: "SimpleChoice",
|
|
390
398
|
props: {
|
|
391
399
|
modelValue: {},
|
|
@@ -397,138 +405,138 @@ var ee = /* @__PURE__ */ f({
|
|
|
397
405
|
},
|
|
398
406
|
emits: ["update:model-value"],
|
|
399
407
|
setup(t, { emit: r }) {
|
|
400
|
-
let d = t, f = r, p = w(), m = w(), v = [], x = w(!1), C = w(""), D = w(0), O = w([]), A = w(d.multi ? [] : void 0),
|
|
408
|
+
let d = t, f = r, p = w(), m = w(), v = [], x = w(!1), C = w(""), D = w(0), O = w([]), A = w(d.multi ? [] : void 0), ee = `qmap-select-${Math.random().toString(36).slice(2)}`, j = {
|
|
401
409
|
title: "Not set",
|
|
402
410
|
value: null,
|
|
403
411
|
icon: "fa fa-ban",
|
|
404
412
|
colour: "#71717a"
|
|
405
|
-
},
|
|
413
|
+
}, M = n(() => {
|
|
406
414
|
let e = C.value.trim().toLocaleLowerCase();
|
|
407
|
-
return e ? O.value.filter((t) =>
|
|
408
|
-
}),
|
|
409
|
-
|
|
415
|
+
return e ? O.value.filter((t) => H(t).toLocaleLowerCase().includes(e)) : O.value;
|
|
416
|
+
}), P = n(() => d.multi ? M.value : [j, ...M.value]), B = n(() => d.multi ? d.qMap.icon : A.value?.icon), V = n(() => d.multi ? (A.value || []).map((e) => H(e)).join(", ") || "Select…" : A.value?.value == null ? "Not set" : H(A.value));
|
|
417
|
+
F(() => d.qMap.values, te, {
|
|
410
418
|
immediate: !0,
|
|
411
419
|
deep: !0
|
|
412
|
-
}),
|
|
413
|
-
A.value =
|
|
414
|
-
}, { immediate: !0 }),
|
|
415
|
-
A.value =
|
|
416
|
-
}),
|
|
417
|
-
D.value = Math.min(D.value, Math.max(0,
|
|
418
|
-
}),
|
|
420
|
+
}), F(() => d.modelValue, (e) => {
|
|
421
|
+
A.value = U(e);
|
|
422
|
+
}, { immediate: !0 }), F(() => d.multi, () => {
|
|
423
|
+
A.value = U(d.modelValue), G();
|
|
424
|
+
}), F(M, (e) => {
|
|
425
|
+
D.value = Math.min(D.value, Math.max(0, P.value.length - 1));
|
|
426
|
+
}), F(C, () => {
|
|
419
427
|
D.value = 0;
|
|
420
428
|
});
|
|
421
|
-
function
|
|
429
|
+
function H(e) {
|
|
422
430
|
return String(e.title ?? e.value ?? "Not set");
|
|
423
431
|
}
|
|
424
|
-
function
|
|
432
|
+
function te() {
|
|
425
433
|
O.value = (d.qMap.values || []).map((e) => ({
|
|
426
434
|
...e,
|
|
427
435
|
title: e.title || String(e.value ?? "Not set")
|
|
428
|
-
})), A.value =
|
|
436
|
+
})), A.value = U(d.modelValue);
|
|
429
437
|
}
|
|
430
|
-
function
|
|
431
|
-
return d.multi ? Array.isArray(e) ? O.value.filter((t) => e.some((e) => Object.is(e, t.value))) : [] : O.value.find((t) => Object.is(t.value, e)) ||
|
|
438
|
+
function U(e) {
|
|
439
|
+
return d.multi ? Array.isArray(e) ? O.value.filter((t) => e.some((e) => Object.is(e, t.value))) : [] : O.value.find((t) => Object.is(t.value, e)) || j;
|
|
432
440
|
}
|
|
433
|
-
function
|
|
441
|
+
function W(e) {
|
|
434
442
|
return d.multi ? (A.value || []).some((t) => Object.is(t.value, e.value)) : e.value == null ? A.value?.value == null : Object.is(A.value?.value, e.value);
|
|
435
443
|
}
|
|
436
|
-
function
|
|
444
|
+
function G() {
|
|
437
445
|
f("update:model-value", d.multi ? (A.value || []).map((e) => e.value) : A.value?.value);
|
|
438
446
|
}
|
|
439
|
-
function
|
|
447
|
+
function ne() {
|
|
440
448
|
d.readOnly || x.value || (x.value = !0, C.value = "", D.value = 0, h(() => m.value?.focus()));
|
|
441
449
|
}
|
|
442
|
-
function
|
|
450
|
+
function K() {
|
|
443
451
|
x.value = !1, C.value = "";
|
|
444
452
|
}
|
|
445
|
-
function
|
|
453
|
+
function re(e) {
|
|
446
454
|
if (d.multi) {
|
|
447
455
|
let t = A.value || [];
|
|
448
|
-
A.value =
|
|
456
|
+
A.value = W(e) ? t.filter((t) => !Object.is(t.value, e.value)) : [...t, e], G();
|
|
449
457
|
return;
|
|
450
458
|
}
|
|
451
|
-
A.value = e,
|
|
459
|
+
A.value = e, G(), K();
|
|
452
460
|
}
|
|
453
|
-
function
|
|
461
|
+
function ie() {
|
|
454
462
|
A.value = d.multi ? [] : {
|
|
455
463
|
title: "Not set",
|
|
456
464
|
value: null
|
|
457
|
-
},
|
|
465
|
+
}, G(), d.multi || K();
|
|
458
466
|
}
|
|
459
|
-
function
|
|
467
|
+
function ae(e, t) {
|
|
460
468
|
t instanceof HTMLButtonElement && (v[e] = t);
|
|
461
469
|
}
|
|
462
|
-
function
|
|
463
|
-
|
|
470
|
+
function q(e) {
|
|
471
|
+
P.value.length && (D.value = (e + P.value.length) % P.value.length, h(() => v[D.value]?.focus()));
|
|
464
472
|
}
|
|
465
|
-
function
|
|
466
|
-
e.key === "ArrowDown" ? (e.preventDefault(),
|
|
473
|
+
function oe(e) {
|
|
474
|
+
e.key === "ArrowDown" ? (e.preventDefault(), q(D.value)) : e.key === "Escape" ? (e.preventDefault(), K()) : e.key === "Enter" && P.value[D.value] && (e.preventDefault(), re(P.value[D.value]));
|
|
467
475
|
}
|
|
468
|
-
function
|
|
469
|
-
e.key === "ArrowDown" ? (e.preventDefault(),
|
|
476
|
+
function se(e, t) {
|
|
477
|
+
e.key === "ArrowDown" ? (e.preventDefault(), q(t + 1)) : e.key === "ArrowUp" ? (e.preventDefault(), q(t - 1)) : e.key === "Escape" ? (e.preventDefault(), K()) : e.key === "Tab" && !e.shiftKey && t === P.value.length - 1 && K();
|
|
470
478
|
}
|
|
471
|
-
function
|
|
472
|
-
p.value && !p.value.contains(e.target) &&
|
|
479
|
+
function J(e) {
|
|
480
|
+
p.value && !p.value.contains(e.target) && K();
|
|
473
481
|
}
|
|
474
|
-
return b(() => document.addEventListener("pointerdown",
|
|
482
|
+
return b(() => document.addEventListener("pointerdown", J)), y(() => document.removeEventListener("pointerdown", J)), (n, r) => t.lite && t.readOnly ? (S(), o("div", Ye, [A.value?.icon ? (S(), o("i", {
|
|
475
483
|
key: 0,
|
|
476
484
|
class: g(A.value.icon),
|
|
477
485
|
style: _({ color: A.value.colour }),
|
|
478
486
|
"aria-hidden": "true"
|
|
479
|
-
}, null, 6)) : a("", !0), l(" " + k(
|
|
487
|
+
}, null, 6)) : a("", !0), l(" " + k(V.value), 1)])) : (S(), o("div", {
|
|
480
488
|
key: 1,
|
|
481
489
|
ref_key: "root",
|
|
482
490
|
ref: p,
|
|
483
491
|
class: "flex flex-col relative w-full gap-1 min-w-0 min-h-10"
|
|
484
492
|
}, [
|
|
485
|
-
t.lite ? a("", !0) : (S(), i(
|
|
493
|
+
t.lite ? a("", !0) : (S(), i(Y, {
|
|
486
494
|
key: 0,
|
|
487
495
|
"q-map": t.qMap
|
|
488
496
|
}, null, 8, ["q-map"])),
|
|
489
|
-
s("label",
|
|
490
|
-
append:
|
|
491
|
-
t.required && (!A.value || A.value?.value == null) ? (S(), o("span",
|
|
497
|
+
s("label", Xe, [u(X, { disabled: t.readOnly }, c({
|
|
498
|
+
append: I(() => [
|
|
499
|
+
t.required && (!A.value || A.value?.value == null) ? (S(), o("span", Qe, [...r[2] ||= [s("i", { class: "fa fa-asterisk" }, null, -1)]])) : a("", !0),
|
|
492
500
|
(t.multi ? A.value?.length : A.value?.value != null) && !t.readOnly ? (S(), o("button", {
|
|
493
501
|
key: 1,
|
|
494
502
|
type: "button",
|
|
495
503
|
class: "inline-flex items-center justify-center min-w-8 min-h-8 p-1 qmap-icon-button qmap-select-clear",
|
|
496
504
|
"aria-label": "Clear selection",
|
|
497
|
-
onClick:
|
|
505
|
+
onClick: z(ie, ["stop"])
|
|
498
506
|
}, [...r[3] ||= [s("i", { class: "fa fa-times" }, null, -1)]])) : a("", !0),
|
|
499
507
|
s("i", {
|
|
500
508
|
class: g(["fa fa-chevron-down qmap-select-chevron", { "qmap-select-chevron-open": x.value }]),
|
|
501
509
|
"aria-hidden": "true"
|
|
502
510
|
}, null, 2)
|
|
503
511
|
]),
|
|
504
|
-
default:
|
|
512
|
+
default: I(() => [s("button", {
|
|
505
513
|
type: "button",
|
|
506
514
|
class: "qmap-input qmap-select-trigger flex flex-1 min-w-0 min-h-0 items-center justify-start px-0 py-2 text-left",
|
|
507
515
|
role: "combobox",
|
|
508
516
|
"aria-expanded": x.value,
|
|
509
|
-
"aria-controls":
|
|
517
|
+
"aria-controls": ee,
|
|
510
518
|
"aria-label": t.qMap.title || t.qMap.id,
|
|
511
519
|
disabled: t.readOnly,
|
|
512
|
-
onClick: r[0] ||= (e) => x.value ?
|
|
513
|
-
onKeydown: [z(
|
|
520
|
+
onClick: r[0] ||= (e) => x.value ? K() : ne(),
|
|
521
|
+
onKeydown: [R(z(ne, ["prevent"]), ["down"]), R(z(K, ["prevent"]), ["esc"])]
|
|
514
522
|
}, [s("span", { class: g(["flex flex-1 min-w-0 items-center flex-wrap gap-1 overflow-hidden", { "qmap-select-placeholder": !d.multi && A.value?.value == null }]) }, [t.multi && A.value?.length ? (S(!0), o(e, { key: 0 }, T(A.value, (e) => (S(), o("span", {
|
|
515
523
|
key: String(e.value),
|
|
516
524
|
class: "inline-flex max-w-full items-center qmap-select-chip"
|
|
517
|
-
}, k(
|
|
525
|
+
}, k(H(e)), 1))), 128)) : (S(), o(e, { key: 1 }, [l(k(V.value), 1)], 64))], 2)], 40, Ze)]),
|
|
518
526
|
_: 2
|
|
519
|
-
}, [
|
|
527
|
+
}, [B.value || t.qMap.icon ? {
|
|
520
528
|
name: "prepend",
|
|
521
|
-
fn:
|
|
522
|
-
class: g(
|
|
529
|
+
fn: I(() => [E(n.$slots, "default"), s("i", {
|
|
530
|
+
class: g(B.value),
|
|
523
531
|
style: _({ color: A.value?.colour }),
|
|
524
532
|
"aria-hidden": "true"
|
|
525
533
|
}, null, 6)]),
|
|
526
534
|
key: "0"
|
|
527
535
|
} : void 0]), 1032, ["disabled"])]),
|
|
528
|
-
x.value ? (S(), o("div",
|
|
536
|
+
x.value ? (S(), o("div", $e, [s("div", et, [r[4] ||= s("i", {
|
|
529
537
|
class: "fa fa-search qmap-select-search-icon",
|
|
530
538
|
"aria-hidden": "true"
|
|
531
|
-
}, null, -1),
|
|
539
|
+
}, null, -1), L(s("input", {
|
|
532
540
|
ref_key: "searchInput",
|
|
533
541
|
ref: m,
|
|
534
542
|
"onUpdate:modelValue": r[1] ||= (e) => C.value = e,
|
|
@@ -537,73 +545,73 @@ var ee = /* @__PURE__ */ f({
|
|
|
537
545
|
placeholder: "Search…",
|
|
538
546
|
autocomplete: "off",
|
|
539
547
|
"aria-label": "Search options",
|
|
540
|
-
onKeydown:
|
|
541
|
-
}, null, 544), [[
|
|
542
|
-
id:
|
|
548
|
+
onKeydown: oe
|
|
549
|
+
}, null, 544), [[N, C.value]])]), s("div", {
|
|
550
|
+
id: ee,
|
|
543
551
|
class: "max-h-64 overflow-auto p-1",
|
|
544
552
|
role: "listbox",
|
|
545
553
|
"aria-multiselectable": t.multi || void 0
|
|
546
|
-
}, [(S(!0), o(e, null, T(
|
|
554
|
+
}, [(S(!0), o(e, null, T(P.value, (e, r) => (S(), o("button", {
|
|
547
555
|
key: `${r}-${String(e.value)}`,
|
|
548
556
|
ref_for: !0,
|
|
549
|
-
ref: (e) =>
|
|
557
|
+
ref: (e) => ae(r, e),
|
|
550
558
|
type: "button",
|
|
551
559
|
role: "option",
|
|
552
560
|
class: g(["flex w-full min-h-9 items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm qmap-select-option", {
|
|
553
561
|
"qmap-select-option-active": D.value === r,
|
|
554
|
-
"qmap-select-option-selected":
|
|
562
|
+
"qmap-select-option-selected": W(e)
|
|
555
563
|
}]),
|
|
556
|
-
"aria-selected":
|
|
564
|
+
"aria-selected": W(e),
|
|
557
565
|
onMouseenter: (e) => D.value = r,
|
|
558
|
-
onKeydown: (e) =>
|
|
559
|
-
onClick: (t) =>
|
|
566
|
+
onKeydown: (e) => se(e, r),
|
|
567
|
+
onClick: (t) => re(e)
|
|
560
568
|
}, [E(n.$slots, "option", {
|
|
561
569
|
option: e,
|
|
562
|
-
selected:
|
|
570
|
+
selected: W(e),
|
|
563
571
|
active: D.value === r
|
|
564
572
|
}, () => [
|
|
565
|
-
t.multi ? (S(), o("span",
|
|
573
|
+
t.multi ? (S(), o("span", rt, k(W(e) ? "✓" : ""), 1)) : a("", !0),
|
|
566
574
|
e.icon ? (S(), o("i", {
|
|
567
575
|
key: 1,
|
|
568
576
|
class: g([e.icon, "w-4 text-center"]),
|
|
569
577
|
style: _({ color: e.colour }),
|
|
570
578
|
"aria-hidden": "true"
|
|
571
579
|
}, null, 6)) : a("", !0),
|
|
572
|
-
s("span",
|
|
573
|
-
])], 42,
|
|
580
|
+
s("span", it, k(H(e)), 1)
|
|
581
|
+
])], 42, nt))), 128)), P.value.length ? a("", !0) : (S(), o("p", at, "No options found."))], 8, tt)])) : a("", !0)
|
|
574
582
|
], 512));
|
|
575
583
|
}
|
|
576
|
-
}),
|
|
584
|
+
}), st = {
|
|
577
585
|
key: 0,
|
|
578
586
|
class: "block"
|
|
579
|
-
},
|
|
587
|
+
}, ct = /* @__PURE__ */ f({
|
|
580
588
|
__name: "icon-block",
|
|
581
589
|
props: { qMap: {} },
|
|
582
590
|
setup(e) {
|
|
583
591
|
let t = e, r = n(() => [t.qMap.icon || "", t.qMap.colour || ""].reduce((e, t) => e + " " + t));
|
|
584
|
-
return (t, n) => e.qMap.icon ? (S(), o("span",
|
|
592
|
+
return (t, n) => e.qMap.icon ? (S(), o("span", st, [s("i", { class: g(r.value) }, null, 2)])) : a("", !0);
|
|
585
593
|
}
|
|
586
|
-
}),
|
|
594
|
+
}), lt = { key: 0 }, ut = { class: "inline-flex items-center gap-2" }, dt = [
|
|
587
595
|
"name",
|
|
588
596
|
"value",
|
|
589
597
|
"disabled",
|
|
590
598
|
"onChange"
|
|
591
|
-
],
|
|
599
|
+
], ft = { class: "mt-1 inline-flex items-center gap-1" }, pt = { key: 1 }, mt = { class: "inline-flex items-center gap-2 min-h-8 qmap-check-row" }, ht = [
|
|
592
600
|
"name",
|
|
593
601
|
"value",
|
|
594
602
|
"disabled",
|
|
595
603
|
"onChange"
|
|
596
|
-
],
|
|
604
|
+
], gt = { class: "mt-1" }, _t = {
|
|
597
605
|
key: 2,
|
|
598
606
|
class: "sm:flex items-center"
|
|
599
|
-
},
|
|
607
|
+
}, vt = { class: "sm:w-1/2 md:w-1/4" }, yt = {
|
|
600
608
|
class: "btn-group sm:w-1/2 md:w-3/4 flex",
|
|
601
609
|
role: "group"
|
|
602
|
-
},
|
|
610
|
+
}, bt = [
|
|
603
611
|
"aria-pressed",
|
|
604
612
|
"disabled",
|
|
605
613
|
"onClick"
|
|
606
|
-
],
|
|
614
|
+
], xt = /* @__PURE__ */ f({
|
|
607
615
|
__name: "qChoice",
|
|
608
616
|
props: {
|
|
609
617
|
qMap: {},
|
|
@@ -618,7 +626,7 @@ var ee = /* @__PURE__ */ f({
|
|
|
618
626
|
emits: ["qmap_change", "qmap_subquestions"],
|
|
619
627
|
setup(t, { emit: n }) {
|
|
620
628
|
let r = t, c = n, d = w();
|
|
621
|
-
|
|
629
|
+
F(() => r.model, (e) => d.value = r.model[r.qMap.id]), v(() => {
|
|
622
630
|
d.value = r.model[r.qMap.id], f(d.value);
|
|
623
631
|
});
|
|
624
632
|
function f(e) {
|
|
@@ -631,32 +639,32 @@ var ee = /* @__PURE__ */ f({
|
|
|
631
639
|
value: e
|
|
632
640
|
}), f(e);
|
|
633
641
|
}
|
|
634
|
-
return (n, r) => t.qMap.style == "radio" ? (S(), o("div",
|
|
642
|
+
return (n, r) => t.qMap.style == "radio" ? (S(), o("div", lt, [u(Y, { "q-map": t.qMap }, null, 8, ["q-map"]), s("div", ut, [(S(!0), o(e, null, T(t.qMap.values, (e) => (S(), o("div", {
|
|
635
643
|
key: String(e.value),
|
|
636
644
|
class: "inline-flex items-center gap-0 min-h-8 qmap-check-row"
|
|
637
|
-
}, [
|
|
645
|
+
}, [L(s("input", {
|
|
638
646
|
"onUpdate:modelValue": r[0] ||= (e) => d.value = e,
|
|
639
647
|
type: "radio",
|
|
640
648
|
name: t.qMap.id,
|
|
641
649
|
value: e.value,
|
|
642
650
|
disabled: t.readOnly,
|
|
643
651
|
onChange: (t) => p(e.value)
|
|
644
|
-
}, null, 40,
|
|
652
|
+
}, null, 40, dt), [[j, d.value]]), s("div", ft, [e.icon ? (S(), o("i", {
|
|
645
653
|
key: 0,
|
|
646
654
|
class: g(e.icon),
|
|
647
655
|
"aria-hidden": "true"
|
|
648
|
-
}, null, 2)) : a("", !0), l(k(e.title || e.value), 1)])]))), 128))])])) : t.qMap.style == "v-radio" ? (S(), o("div",
|
|
656
|
+
}, null, 2)) : a("", !0), l(k(e.title || e.value), 1)])]))), 128))])])) : t.qMap.style == "v-radio" ? (S(), o("div", pt, [u(Y, { "q-map": t.qMap }, null, 8, ["q-map"]), (S(!0), o(e, null, T(t.qMap.values, (e) => (S(), o("div", null, [s("label", mt, [L(s("input", {
|
|
649
657
|
"onUpdate:modelValue": r[1] ||= (e) => d.value = e,
|
|
650
658
|
type: "radio",
|
|
651
659
|
name: t.qMap.id,
|
|
652
660
|
value: e.value,
|
|
653
661
|
disabled: t.readOnly,
|
|
654
662
|
onChange: (t) => p(e.value)
|
|
655
|
-
}, null, 40,
|
|
663
|
+
}, null, 40, ht), [[j, d.value]]), s("div", gt, [e.icon ? (S(), o("i", {
|
|
656
664
|
key: 0,
|
|
657
665
|
class: g(e.icon),
|
|
658
666
|
"aria-hidden": "true"
|
|
659
|
-
}, null, 2)) : a("", !0), l(k(e.title || e.value), 1)])])]))), 256))])) : t.qMap.style == "buttons" ? (S(), o("div",
|
|
667
|
+
}, null, 2)) : a("", !0), l(k(e.title || e.value), 1)])])]))), 256))])) : t.qMap.style == "buttons" ? (S(), o("div", _t, [s("div", vt, [u(Y, { "q-map": t.qMap }, null, 8, ["q-map"])]), s("div", yt, [(S(!0), o(e, null, T(t.qMap.values, (e) => (S(), o("button", {
|
|
660
668
|
key: String(e.value),
|
|
661
669
|
type: "button",
|
|
662
670
|
class: g(["flex-1 inline-flex items-center justify-center gap-2 min-h-9 px-3.5 py-2 qmap-button", { "qmap-button-selected": d.value === e.value }]),
|
|
@@ -669,7 +677,7 @@ var ee = /* @__PURE__ */ f({
|
|
|
669
677
|
key: 0,
|
|
670
678
|
class: g(e.icon),
|
|
671
679
|
"aria-hidden": "true"
|
|
672
|
-
}, null, 2)) : a("", !0), l(k(e.title || e.value), 1)], 10,
|
|
680
|
+
}, null, 2)) : a("", !0), l(k(e.title || e.value), 1)], 10, bt))), 128))])])) : (S(), i(ot, {
|
|
673
681
|
key: 3,
|
|
674
682
|
modelValue: d.value,
|
|
675
683
|
"onUpdate:modelValue": [r[2] ||= (e) => d.value = e, p],
|
|
@@ -678,7 +686,7 @@ var ee = /* @__PURE__ */ f({
|
|
|
678
686
|
lite: t.lite,
|
|
679
687
|
required: t.qMap.required
|
|
680
688
|
}, {
|
|
681
|
-
default:
|
|
689
|
+
default: I(() => [u(ct, { qMap: t.qMap }, null, 8, ["qMap"])]),
|
|
682
690
|
_: 1
|
|
683
691
|
}, 8, [
|
|
684
692
|
"modelValue",
|
|
@@ -688,14 +696,14 @@ var ee = /* @__PURE__ */ f({
|
|
|
688
696
|
"required"
|
|
689
697
|
]));
|
|
690
698
|
}
|
|
691
|
-
}),
|
|
699
|
+
}), St = {
|
|
692
700
|
key: 0,
|
|
693
701
|
class: "inline-flex items-center gap-2"
|
|
694
|
-
},
|
|
702
|
+
}, Ct = ["for"], wt = ["value", "disabled"], Tt = [
|
|
695
703
|
"id",
|
|
696
704
|
"value",
|
|
697
705
|
"readonly"
|
|
698
|
-
],
|
|
706
|
+
], Et = /* @__PURE__ */ f({
|
|
699
707
|
__name: "qColour",
|
|
700
708
|
props: {
|
|
701
709
|
qMap: {},
|
|
@@ -716,47 +724,47 @@ var ee = /* @__PURE__ */ f({
|
|
|
716
724
|
value: e
|
|
717
725
|
});
|
|
718
726
|
}
|
|
719
|
-
return (t, n) => e.lite && e.readOnly ? (S(), o("div",
|
|
727
|
+
return (t, n) => e.lite && e.readOnly ? (S(), o("div", St, [s("span", {
|
|
720
728
|
class: "inline-block w-4 h-4 rounded-full qmap-colour-swatch",
|
|
721
729
|
style: _({ backgroundColor: a.value })
|
|
722
730
|
}, null, 4), l(k(a.value), 1)])) : (S(), o("label", {
|
|
723
731
|
key: 1,
|
|
724
732
|
class: "qmap-field flex flex-col gap-1.5 text-sm",
|
|
725
733
|
for: e.qMap.id
|
|
726
|
-
}, [u(
|
|
734
|
+
}, [u(Y, { "q-map": e.qMap }, null, 8, ["q-map"]), u(X, {
|
|
727
735
|
disabled: e.readOnly,
|
|
728
736
|
class: ""
|
|
729
737
|
}, c({
|
|
730
|
-
append:
|
|
738
|
+
append: I(() => [s("input", {
|
|
731
739
|
value: a.value || "#000000",
|
|
732
740
|
type: "color",
|
|
733
741
|
class: "shrink-0 w-7 h-7 p-0.5 qmap-color-picker border-none",
|
|
734
742
|
"aria-label": "Choose color",
|
|
735
743
|
disabled: e.readOnly,
|
|
736
744
|
onInput: n[0] ||= (e) => d(e.target.value)
|
|
737
|
-
}, null, 40,
|
|
738
|
-
default:
|
|
745
|
+
}, null, 40, wt)]),
|
|
746
|
+
default: I(() => [s("input", {
|
|
739
747
|
id: e.qMap.id,
|
|
740
748
|
value: a.value,
|
|
741
749
|
type: "text",
|
|
742
750
|
class: "qmap-input flex-1 px-0 py-2",
|
|
743
751
|
readonly: e.readOnly,
|
|
744
752
|
onChange: n[1] ||= (e) => d(e.target.value)
|
|
745
|
-
}, null, 40,
|
|
753
|
+
}, null, 40, Tt)]),
|
|
746
754
|
_: 2
|
|
747
755
|
}, [e.qMap.icon ? {
|
|
748
756
|
name: "prepend",
|
|
749
|
-
fn:
|
|
757
|
+
fn: I(() => [u(ct, { qMap: e.qMap }, null, 8, ["qMap"])]),
|
|
750
758
|
key: "0"
|
|
751
|
-
} : void 0]), 1032, ["disabled"])], 8,
|
|
759
|
+
} : void 0]), 1032, ["disabled"])], 8, Ct));
|
|
752
760
|
}
|
|
753
|
-
}),
|
|
761
|
+
}), Dt = {
|
|
754
762
|
key: 0,
|
|
755
763
|
class: "calendar-modal"
|
|
756
|
-
},
|
|
764
|
+
}, Ot = { class: "calendar-dialog flex flex-col gap-2" }, kt = { class: "flex justify-between mb-2" }, At = { class: "flex" }, jt = { class: "grid grid-cols-7" }, Mt = ["onClick"], Nt = {
|
|
757
765
|
key: 0,
|
|
758
766
|
class: "calendar-time"
|
|
759
|
-
},
|
|
767
|
+
}, Pt = ["value"], Ft = ["value"], It = /* @__PURE__ */ f({
|
|
760
768
|
__name: "CalendarPicker",
|
|
761
769
|
props: {
|
|
762
770
|
modelValue: {},
|
|
@@ -774,27 +782,27 @@ var ee = /* @__PURE__ */ f({
|
|
|
774
782
|
"Thu",
|
|
775
783
|
"Fri",
|
|
776
784
|
"Sat"
|
|
777
|
-
], C = n(() => h.value), D = n(() => _.value), O = n(() => new Date(C.value, D.value).toLocaleString("default", { month: "long" })),
|
|
778
|
-
function
|
|
785
|
+
], C = n(() => h.value), D = n(() => _.value), O = n(() => new Date(C.value, D.value).toLocaleString("default", { month: "long" })), ee = n(() => new Date(C.value, D.value + 1, 0).getDate()), j = n(() => Array(new Date(C.value, D.value, 1).getDay()).fill(0));
|
|
786
|
+
function N(e) {
|
|
779
787
|
return console.log(D.value + " " + m.getMonth()), e === v.value && D.value === m.getMonth() && C.value === m.getFullYear();
|
|
780
788
|
}
|
|
781
|
-
function
|
|
789
|
+
function P(e) {
|
|
782
790
|
v.value = e, m = new Date(h.value, _.value, v.value, d.withTime ? y.value : 0, d.withTime ? b.value : 0, 0, 0);
|
|
783
791
|
}
|
|
784
|
-
function
|
|
792
|
+
function I() {
|
|
785
793
|
_.value === 0 ? (_.value = 11, --h.value) : --_.value;
|
|
786
794
|
}
|
|
787
|
-
function
|
|
795
|
+
function R() {
|
|
788
796
|
_.value === 11 ? (_.value = 0, h.value += 1) : _.value += 1;
|
|
789
797
|
}
|
|
790
|
-
function
|
|
798
|
+
function z() {
|
|
791
799
|
let e = new Date(h.value, _.value, v.value, d.withTime ? y.value : 0, d.withTime ? b.value : 0, 0, 0);
|
|
792
800
|
f("update:modelValue", e.getTime()), p.value = !1;
|
|
793
801
|
}
|
|
794
|
-
function
|
|
802
|
+
function B() {
|
|
795
803
|
p.value = !1;
|
|
796
804
|
}
|
|
797
|
-
return
|
|
805
|
+
return F(() => d.modelValue, (e) => {
|
|
798
806
|
if (e) {
|
|
799
807
|
let t = new Date(e);
|
|
800
808
|
h.value = t.getFullYear(), _.value = t.getMonth(), v.value = t.getDate(), y.value = t.getHours(), b.value = t.getMinutes();
|
|
@@ -810,76 +818,76 @@ var ee = /* @__PURE__ */ f({
|
|
|
810
818
|
background: "none"
|
|
811
819
|
},
|
|
812
820
|
class: "qmap-button"
|
|
813
|
-
}, [E(n.$slots, "default")]), (S(), i(t, { to: "body" }, [p.value ? (S(), o("div",
|
|
814
|
-
s("div",
|
|
821
|
+
}, [E(n.$slots, "default")]), (S(), i(t, { to: "body" }, [p.value ? (S(), o("div", Dt, [s("div", Ot, [
|
|
822
|
+
s("div", kt, [
|
|
815
823
|
s("button", {
|
|
816
|
-
onClick:
|
|
824
|
+
onClick: I,
|
|
817
825
|
class: "border-none bg-inherit qmap-button"
|
|
818
826
|
}, [...c[3] ||= [s("i", { class: "fa fa-arrow-left" }, null, -1)]]),
|
|
819
827
|
s("span", null, k(O.value) + " " + k(C.value), 1),
|
|
820
828
|
s("button", {
|
|
821
|
-
onClick:
|
|
829
|
+
onClick: R,
|
|
822
830
|
class: "border-none bg-inherit qmap-button"
|
|
823
831
|
}, [...c[4] ||= [s("i", { class: "fa fa-arrow-right" }, null, -1)]])
|
|
824
832
|
]),
|
|
825
|
-
s("div",
|
|
833
|
+
s("div", At, [(S(), o(e, null, T(x, (e) => s("div", {
|
|
826
834
|
key: e,
|
|
827
835
|
class: "w-1/7 text-center"
|
|
828
836
|
}, k(e), 1)), 64))]),
|
|
829
|
-
s("div",
|
|
837
|
+
s("div", jt, [(S(!0), o(e, null, T(j.value, (e) => (S(), o("span", {
|
|
830
838
|
key: "blank-" + e,
|
|
831
839
|
class: ""
|
|
832
|
-
}, "\xA0"))), 128)), (S(!0), o(e, null, T(
|
|
840
|
+
}, "\xA0"))), 128)), (S(!0), o(e, null, T(ee.value, (e) => (S(), o("button", {
|
|
833
841
|
key: "day-" + e,
|
|
834
842
|
class: g(["p-2 border-none", {
|
|
835
|
-
"bg-zinc-900 text-zinc-100 dark:bg-zinc-100 dark:text-zinc-900":
|
|
836
|
-
"bg-zinc-100 text-zinc-900 dark:bg-zinc-900 dark:text-zinc-100": !
|
|
843
|
+
"bg-zinc-900 text-zinc-100 dark:bg-zinc-100 dark:text-zinc-900": N(e),
|
|
844
|
+
"bg-zinc-100 text-zinc-900 dark:bg-zinc-900 dark:text-zinc-100": !N(e)
|
|
837
845
|
}]),
|
|
838
|
-
onClick: (t) =>
|
|
839
|
-
}, k(e), 11,
|
|
840
|
-
r.withTime ? (S(), o("div",
|
|
841
|
-
|
|
846
|
+
onClick: (t) => P(e)
|
|
847
|
+
}, k(e), 11, Mt))), 128))]),
|
|
848
|
+
r.withTime ? (S(), o("div", Nt, [
|
|
849
|
+
L(s("select", {
|
|
842
850
|
"onUpdate:modelValue": c[1] ||= (e) => y.value = e,
|
|
843
851
|
class: "qmap-input px-2 py-1"
|
|
844
852
|
}, [(S(!0), o(e, null, T(A(l), (e) => (S(), o("option", {
|
|
845
853
|
key: e,
|
|
846
854
|
value: e
|
|
847
|
-
}, k(String(e).padStart(2, "0")), 9,
|
|
855
|
+
}, k(String(e).padStart(2, "0")), 9, Pt))), 128))], 512), [[M, y.value]]),
|
|
848
856
|
c[5] ||= s("span", null, ":", -1),
|
|
849
|
-
|
|
857
|
+
L(s("select", {
|
|
850
858
|
"onUpdate:modelValue": c[2] ||= (e) => b.value = e,
|
|
851
859
|
class: "qmap-input px-2 py-1"
|
|
852
860
|
}, [(S(!0), o(e, null, T(A(u), (e) => (S(), o("option", {
|
|
853
861
|
key: e,
|
|
854
862
|
value: e
|
|
855
|
-
}, k(String(e).padStart(2, "0")), 9,
|
|
863
|
+
}, k(String(e).padStart(2, "0")), 9, Ft))), 128))], 512), [[M, b.value]])
|
|
856
864
|
])) : a("", !0),
|
|
857
865
|
s("div", { class: "flex justify-between" }, [s("button", {
|
|
858
|
-
onClick:
|
|
866
|
+
onClick: z,
|
|
859
867
|
class: "qmap-button p-2"
|
|
860
868
|
}, "Ok"), s("button", {
|
|
861
|
-
onClick:
|
|
869
|
+
onClick: B,
|
|
862
870
|
class: "qmap-button"
|
|
863
871
|
}, "Cancel")])
|
|
864
872
|
]), s("div", {
|
|
865
873
|
class: "calendar-backdrop",
|
|
866
|
-
onClick:
|
|
874
|
+
onClick: B
|
|
867
875
|
})])) : a("", !0)]))], 64));
|
|
868
876
|
}
|
|
869
|
-
}),
|
|
877
|
+
}), Lt = [
|
|
870
878
|
"placeholder",
|
|
871
879
|
"readonly",
|
|
872
880
|
"aria-invalid",
|
|
873
881
|
"onKeydown"
|
|
874
|
-
],
|
|
882
|
+
], Rt = {
|
|
875
883
|
key: 0,
|
|
876
884
|
class: "date-error",
|
|
877
885
|
role: "status"
|
|
878
|
-
},
|
|
886
|
+
}, zt = {
|
|
879
887
|
key: 3,
|
|
880
888
|
class: "date-required",
|
|
881
889
|
"aria-hidden": "true"
|
|
882
|
-
},
|
|
890
|
+
}, Bt = /*#__PURE__*/ Ae(/* @__PURE__ */ f({
|
|
883
891
|
__name: "SimpleDate",
|
|
884
892
|
props: {
|
|
885
893
|
title: {},
|
|
@@ -905,16 +913,16 @@ var ee = /* @__PURE__ */ f({
|
|
|
905
913
|
_.value = "", v.value = !1;
|
|
906
914
|
return;
|
|
907
915
|
}
|
|
908
|
-
let t = e instanceof Date ?
|
|
916
|
+
let t = e instanceof Date ? B.fromJSDate(e) : B.fromMillis(e);
|
|
909
917
|
_.value = t.setZone(r.timezone || "local").toFormat(m), v.value = !1, y.value = t.toMillis(), l("update:model-value", t.toMillis());
|
|
910
918
|
}
|
|
911
|
-
|
|
919
|
+
F(() => r.modelValue, b, { immediate: !0 });
|
|
912
920
|
function x() {
|
|
913
921
|
if (!_.value) {
|
|
914
922
|
v.value = !1;
|
|
915
923
|
return;
|
|
916
924
|
}
|
|
917
|
-
let e =
|
|
925
|
+
let e = B.fromFormat(_.value, m, { zone: r.timezone || "local" });
|
|
918
926
|
v.value = !e.isValid, e.isValid && (b(e.toMillis()), l("update:model-value", e.toMillis()));
|
|
919
927
|
}
|
|
920
928
|
function C() {
|
|
@@ -925,15 +933,15 @@ var ee = /* @__PURE__ */ f({
|
|
|
925
933
|
invalid: v.value,
|
|
926
934
|
disabled: e.readOnly
|
|
927
935
|
}, c({
|
|
928
|
-
append:
|
|
929
|
-
v.value ? (S(), o("span",
|
|
930
|
-
!e.readOnly && !e.lite ? (S(), i(
|
|
936
|
+
append: I(() => [
|
|
937
|
+
v.value ? (S(), o("span", Rt, "Invalid date")) : a("", !0),
|
|
938
|
+
!e.readOnly && !e.lite ? (S(), i(It, {
|
|
931
939
|
key: 1,
|
|
932
940
|
withTime: !e.dateOnly,
|
|
933
941
|
modelValue: y.value,
|
|
934
942
|
"onUpdate:modelValue": [n[1] ||= (e) => y.value = e, b]
|
|
935
943
|
}, {
|
|
936
|
-
default:
|
|
944
|
+
default: I(() => [...n[2] ||= [s("i", { class: "fa fa-calendar" }, null, -1)]]),
|
|
937
945
|
_: 1
|
|
938
946
|
}, 8, ["withTime", "modelValue"])) : a("", !0),
|
|
939
947
|
e.clearable && _.value && !e.readOnly ? (S(), o("button", {
|
|
@@ -943,9 +951,9 @@ var ee = /* @__PURE__ */ f({
|
|
|
943
951
|
"aria-label": "Clear date",
|
|
944
952
|
onClick: C
|
|
945
953
|
}, [...n[3] ||= [s("i", { class: "fa fa-times" }, null, -1)]])) : a("", !0),
|
|
946
|
-
e.required ? (S(), o("span",
|
|
954
|
+
e.required ? (S(), o("span", zt, [...n[4] ||= [s("i", { class: "fa fa-asterisk" }, null, -1)]])) : a("", !0)
|
|
947
955
|
]),
|
|
948
|
-
default:
|
|
956
|
+
default: I(() => [L(s("input", {
|
|
949
957
|
id: d,
|
|
950
958
|
"onUpdate:modelValue": n[0] ||= (e) => _.value = e,
|
|
951
959
|
type: "text",
|
|
@@ -954,19 +962,19 @@ var ee = /* @__PURE__ */ f({
|
|
|
954
962
|
"aria-invalid": v.value,
|
|
955
963
|
class: "min-w-0 flex-1 border-0 bg-transparent outline-none qmap-input",
|
|
956
964
|
onBlur: x,
|
|
957
|
-
onKeydown: z(
|
|
958
|
-
}, null, 40,
|
|
965
|
+
onKeydown: R(z(x, ["prevent"]), ["enter"])
|
|
966
|
+
}, null, 40, Lt), [[N, _.value]])]),
|
|
959
967
|
_: 2
|
|
960
968
|
}, [e.icon ? {
|
|
961
969
|
name: "prepend",
|
|
962
|
-
fn:
|
|
970
|
+
fn: I(() => [s("i", {
|
|
963
971
|
class: g(e.icon),
|
|
964
972
|
"aria-hidden": "true"
|
|
965
973
|
}, null, 2)]),
|
|
966
974
|
key: "0"
|
|
967
975
|
} : void 0]), 1032, ["invalid", "disabled"]), E(t.$slots, "default", {}, void 0, !0)], 2));
|
|
968
976
|
}
|
|
969
|
-
}), [["__scopeId", "data-v-c327521a"]]),
|
|
977
|
+
}), [["__scopeId", "data-v-c327521a"]]), Vt = /* @__PURE__ */ f({
|
|
970
978
|
__name: "qDate",
|
|
971
979
|
props: {
|
|
972
980
|
qMap: {},
|
|
@@ -987,10 +995,10 @@ var ee = /* @__PURE__ */ f({
|
|
|
987
995
|
value: e
|
|
988
996
|
});
|
|
989
997
|
}
|
|
990
|
-
return (n, r) => (S(), o(e, null, [t.lite ? a("", !0) : (S(), i(
|
|
998
|
+
return (n, r) => (S(), o(e, null, [t.lite ? a("", !0) : (S(), i(Y, {
|
|
991
999
|
key: 0,
|
|
992
1000
|
"q-map": t.qMap
|
|
993
|
-
}, null, 8, ["q-map"])), u(
|
|
1001
|
+
}, null, 8, ["q-map"])), u(Bt, {
|
|
994
1002
|
modelValue: l.value,
|
|
995
1003
|
"onUpdate:modelValue": [r[0] ||= (e) => l.value = e, d],
|
|
996
1004
|
icon: t.qMap.icon,
|
|
@@ -1002,7 +1010,7 @@ var ee = /* @__PURE__ */ f({
|
|
|
1002
1010
|
dateOnly: t.qMap.type == "date",
|
|
1003
1011
|
required: t.qMap.required && !l.value
|
|
1004
1012
|
}, {
|
|
1005
|
-
default:
|
|
1013
|
+
default: I(() => [u(ue, { "q-map": t.qMap }, null, 8, ["q-map"])]),
|
|
1006
1014
|
_: 1
|
|
1007
1015
|
}, 8, [
|
|
1008
1016
|
"modelValue",
|
|
@@ -1015,13 +1023,13 @@ var ee = /* @__PURE__ */ f({
|
|
|
1015
1023
|
"required"
|
|
1016
1024
|
])], 64));
|
|
1017
1025
|
}
|
|
1018
|
-
}),
|
|
1026
|
+
}), Ht = ["aria-orientation"], Ut = ["aria-selected", "onClick"], Wt = ["name"], Gt = {
|
|
1019
1027
|
key: 0,
|
|
1020
1028
|
class: "flex flex-1 flex-col min-w-0 relative"
|
|
1021
|
-
},
|
|
1029
|
+
}, Kt = {
|
|
1022
1030
|
key: 1,
|
|
1023
1031
|
class: "flex flex-1 flex-col min-w-0 relative"
|
|
1024
|
-
},
|
|
1032
|
+
}, qt = { class: "group-scroll flex-1 min-h-0 overflow-auto" }, Jt = { class: "flex flex-col gap-2" }, Yt = /* @__PURE__ */ f({
|
|
1025
1033
|
__name: "qGroup",
|
|
1026
1034
|
props: {
|
|
1027
1035
|
qMap: {},
|
|
@@ -1044,7 +1052,7 @@ var ee = /* @__PURE__ */ f({
|
|
|
1044
1052
|
}),
|
|
1045
1053
|
style: _(t.qMap.ui?.flex ? void 0 : { height: (t.qMap.ui?.height || 400) + "px" })
|
|
1046
1054
|
}, [
|
|
1047
|
-
u(
|
|
1055
|
+
u(Y, { "q-map": t.qMap }, null, 8, ["q-map"]),
|
|
1048
1056
|
s("div", {
|
|
1049
1057
|
class: g(["flex flex-wrap gap-1 p-1 group-tabs", { "flex-col group-tabs-vertical pr-2": p.value }]),
|
|
1050
1058
|
role: "tablist",
|
|
@@ -1060,16 +1068,16 @@ var ee = /* @__PURE__ */ f({
|
|
|
1060
1068
|
key: 0,
|
|
1061
1069
|
class: g(e.icon),
|
|
1062
1070
|
"aria-hidden": "true"
|
|
1063
|
-
}, null, 2)) : a("", !0), l(k(e.name), 1)], 10,
|
|
1071
|
+
}, null, 2)) : a("", !0), l(k(e.name), 1)], 10, Ut))), 128))], 10, Ht),
|
|
1064
1072
|
s("div", { class: g(["group-panels flex flex-1 flex-col min-w-0 min-h-0", {
|
|
1065
1073
|
"ml-2": p.value,
|
|
1066
1074
|
"mt-2": !p.value
|
|
1067
|
-
}]) }, [(S(!0), o(e, null, T(t.qMap.groups, (n) =>
|
|
1075
|
+
}]) }, [(S(!0), o(e, null, T(t.qMap.groups, (n) => L((S(), o("section", {
|
|
1068
1076
|
name: n.name,
|
|
1069
1077
|
key: n.name,
|
|
1070
1078
|
class: "flex flex-1 flex-col min-w-0 min-h-0",
|
|
1071
1079
|
role: "tabpanel"
|
|
1072
|
-
}, [n.items?.length == 1 && n.items[0]?.type == "geo_map" ? (S(), o("div",
|
|
1080
|
+
}, [n.items?.length == 1 && n.items[0]?.type == "geo_map" ? (S(), o("div", Gt, [(S(!0), o(e, null, T(n.items, (e) => (S(), i(Q, {
|
|
1073
1081
|
key: e.id,
|
|
1074
1082
|
qMap: e,
|
|
1075
1083
|
modelValue: m.value,
|
|
@@ -1088,7 +1096,7 @@ var ee = /* @__PURE__ */ f({
|
|
|
1088
1096
|
"validator",
|
|
1089
1097
|
"provider",
|
|
1090
1098
|
"readOnly"
|
|
1091
|
-
]))), 128))])) : (S(), o("div",
|
|
1099
|
+
]))), 128))])) : (S(), o("div", Kt, [s("div", qt, [s("div", Jt, [(S(!0), o(e, null, T(n.items, (e) => (S(), i(Q, {
|
|
1092
1100
|
key: e.id,
|
|
1093
1101
|
qMap: e,
|
|
1094
1102
|
modelValue: m.value,
|
|
@@ -1107,25 +1115,25 @@ var ee = /* @__PURE__ */ f({
|
|
|
1107
1115
|
"validator",
|
|
1108
1116
|
"provider",
|
|
1109
1117
|
"readOnly"
|
|
1110
|
-
]))), 128))])])]))], 8,
|
|
1118
|
+
]))), 128))])])]))], 8, Wt)), [[P, d.value === n.name]])), 128))], 2)
|
|
1111
1119
|
], 6));
|
|
1112
1120
|
}
|
|
1113
|
-
}),
|
|
1121
|
+
}), Xt = {
|
|
1114
1122
|
key: 0,
|
|
1115
1123
|
class: "inline-flex items-center gap-2"
|
|
1116
|
-
},
|
|
1124
|
+
}, Zt = {
|
|
1117
1125
|
key: 1,
|
|
1118
1126
|
class: "flex flex-col gap-1"
|
|
1119
|
-
},
|
|
1127
|
+
}, Qt = [
|
|
1120
1128
|
"id",
|
|
1121
1129
|
"value",
|
|
1122
1130
|
"readonly"
|
|
1123
|
-
],
|
|
1131
|
+
], $t = [
|
|
1124
1132
|
"id",
|
|
1125
1133
|
"value",
|
|
1126
1134
|
"readonly",
|
|
1127
1135
|
"type"
|
|
1128
|
-
],
|
|
1136
|
+
], en = {
|
|
1129
1137
|
key: 0,
|
|
1130
1138
|
class: "qmap-required",
|
|
1131
1139
|
"aria-hidden": "true"
|
|
@@ -1153,18 +1161,18 @@ var ee = /* @__PURE__ */ f({
|
|
|
1153
1161
|
value: e
|
|
1154
1162
|
});
|
|
1155
1163
|
}
|
|
1156
|
-
return (t, n) => e.lite && e.readOnly ? (S(), o("div",
|
|
1164
|
+
return (t, n) => e.lite && e.readOnly ? (S(), o("div", Xt, k(d.value), 1)) : (S(), o("div", Zt, [!e.lite && e.qMap.id !== "#" ? (S(), i(Y, {
|
|
1157
1165
|
key: 0,
|
|
1158
1166
|
"q-map": e.qMap
|
|
1159
1167
|
}, null, 8, ["q-map"])) : a("", !0), u(X, { multiline: e.qMap.style === "longtext" || e.lite && e.qMap.style === "textarea" }, c({
|
|
1160
|
-
append:
|
|
1168
|
+
append: I(() => [e.qMap.required && !d.value ? (S(), o("span", en, [...n[3] ||= [s("i", { class: "fa fa-asterisk" }, null, -1)]])) : a("", !0), !e.qMap.required && d.value && !e.readOnly ? (S(), o("button", {
|
|
1161
1169
|
key: 1,
|
|
1162
1170
|
type: "button",
|
|
1163
1171
|
class: "inline-flex items-center justify-center min-w-8 min-h-8 p-1 qmap-icon-button",
|
|
1164
1172
|
"aria-label": "Clear",
|
|
1165
1173
|
onClick: n[2] ||= (e) => p(void 0)
|
|
1166
1174
|
}, [...n[4] ||= [s("i", { class: "fa fa-times" }, null, -1)]])) : a("", !0)]),
|
|
1167
|
-
default:
|
|
1175
|
+
default: I(() => [e.qMap.type !== "number" && (e.qMap.style === "longtext" || e.lite && e.qMap.style === "textarea") ? (S(), o("textarea", {
|
|
1168
1176
|
key: 0,
|
|
1169
1177
|
id: e.qMap.id,
|
|
1170
1178
|
value: d.value,
|
|
@@ -1173,7 +1181,7 @@ var ee = /* @__PURE__ */ f({
|
|
|
1173
1181
|
class: "qmap-input min-w-0 flex-1 px-0 py-2 min-h-24 resize-y",
|
|
1174
1182
|
onInput: f,
|
|
1175
1183
|
onChange: n[0] ||= (e) => p(e.target.value)
|
|
1176
|
-
}, null, 40,
|
|
1184
|
+
}, null, 40, Qt)) : (S(), o("input", {
|
|
1177
1185
|
key: 1,
|
|
1178
1186
|
id: e.qMap.id,
|
|
1179
1187
|
value: d.value,
|
|
@@ -1182,30 +1190,30 @@ var ee = /* @__PURE__ */ f({
|
|
|
1182
1190
|
class: "qmap-input min-w-0 flex-1 px-0 py-2",
|
|
1183
1191
|
onInput: f,
|
|
1184
1192
|
onChange: n[1] ||= (e) => p(e.target.value)
|
|
1185
|
-
}, null, 40,
|
|
1193
|
+
}, null, 40, $t))]),
|
|
1186
1194
|
_: 2
|
|
1187
1195
|
}, [e.qMap.icon ? {
|
|
1188
1196
|
name: "prepend",
|
|
1189
|
-
fn:
|
|
1197
|
+
fn: I(() => [u(ct, { qMap: e.qMap }, null, 8, ["qMap"])]),
|
|
1190
1198
|
key: "0"
|
|
1191
1199
|
} : void 0]), 1032, ["multiline"])]));
|
|
1192
1200
|
}
|
|
1193
|
-
}),
|
|
1201
|
+
}), tn = { key: 0 }, nn = {
|
|
1194
1202
|
key: 0,
|
|
1195
1203
|
class: "flex flex-row items-center"
|
|
1196
|
-
},
|
|
1204
|
+
}, rn = ["for"], an = ["id", "readonly"], on = {
|
|
1197
1205
|
key: 0,
|
|
1198
1206
|
class: "qmap-required"
|
|
1199
|
-
},
|
|
1207
|
+
}, sn = {
|
|
1200
1208
|
key: 1,
|
|
1201
1209
|
class: "text-right text-negative"
|
|
1202
|
-
},
|
|
1210
|
+
}, cn = { key: 1 }, ln = { class: "qmap-card flex min-w-0 gap-3 p-3 bg-zinc-50 dark:bg-zinc-900" }, un = { class: "flex-1 min-w-0" }, dn = { key: 0 }, fn = {
|
|
1203
1211
|
key: 1,
|
|
1204
1212
|
class: "flex flex-col gap-2"
|
|
1205
|
-
},
|
|
1213
|
+
}, pn = {
|
|
1206
1214
|
key: 0,
|
|
1207
1215
|
class: "flex flex-col justify-center"
|
|
1208
|
-
},
|
|
1216
|
+
}, mn = /* @__PURE__ */ f({
|
|
1209
1217
|
__name: "qObject",
|
|
1210
1218
|
props: {
|
|
1211
1219
|
qMap: {},
|
|
@@ -1243,10 +1251,10 @@ var ee = /* @__PURE__ */ f({
|
|
|
1243
1251
|
value: void 0
|
|
1244
1252
|
});
|
|
1245
1253
|
}
|
|
1246
|
-
return (n, r) => t.qMap.items ? (S(), o("div",
|
|
1254
|
+
return (n, r) => t.qMap.items ? (S(), o("div", cn, [!t.lite && t.qMap.id !== "#" ? (S(), i(Y, {
|
|
1247
1255
|
key: 0,
|
|
1248
1256
|
"q-map": t.qMap
|
|
1249
|
-
}, null, 8, ["q-map"])) : a("", !0), s("div",
|
|
1257
|
+
}, null, 8, ["q-map"])) : a("", !0), s("div", ln, [s("div", un, [f.value ? (S(), o("div", fn, [(S(!0), o(e, null, T(t.qMap.items, (e) => (S(), i(Q, {
|
|
1250
1258
|
qMap: e,
|
|
1251
1259
|
modelValue: f.value,
|
|
1252
1260
|
"onUpdate:modelValue": [r[4] ||= (e) => f.value = e, h],
|
|
@@ -1261,11 +1269,11 @@ var ee = /* @__PURE__ */ f({
|
|
|
1261
1269
|
"provider",
|
|
1262
1270
|
"lite",
|
|
1263
1271
|
"readOnly"
|
|
1264
|
-
]))), 256))])) : (S(), o("div",
|
|
1272
|
+
]))), 256))])) : (S(), o("div", dn, [s("button", {
|
|
1265
1273
|
type: "button",
|
|
1266
1274
|
class: "inline-flex items-center justify-center gap-2 min-h-9 px-3.5 py-2 qmap-button",
|
|
1267
1275
|
onClick: r[3] ||= (e) => f.value = {}
|
|
1268
|
-
}, "Not set")]))]), !t.qMap.required && f.value != null ? (S(), o("div",
|
|
1276
|
+
}, "Not set")]))]), !t.qMap.required && f.value != null ? (S(), o("div", pn, [s("button", {
|
|
1269
1277
|
type: "button",
|
|
1270
1278
|
class: "inline-flex items-center justify-center min-w-8 min-h-8 p-1 qmap-icon-button qmap-danger",
|
|
1271
1279
|
"aria-label": "Remove object",
|
|
@@ -1275,23 +1283,23 @@ var ee = /* @__PURE__ */ f({
|
|
|
1275
1283
|
}, [...r[7] ||= [s("i", {
|
|
1276
1284
|
class: "fa fa-trash",
|
|
1277
1285
|
"aria-hidden": "true"
|
|
1278
|
-
}, null, -1)]])])) : a("", !0)])])) : (S(), o("div",
|
|
1279
|
-
t.lite && t.readOnly ? (S(), o("div",
|
|
1286
|
+
}, null, -1)]])])) : a("", !0)])])) : (S(), o("div", tn, [
|
|
1287
|
+
t.lite && t.readOnly ? (S(), o("div", nn, k(d.value), 1)) : a("", !0),
|
|
1280
1288
|
s("label", {
|
|
1281
1289
|
class: "qmap-field flex flex-col gap-1.5 min-w-0 text-sm",
|
|
1282
1290
|
for: t.qMap.id
|
|
1283
|
-
}, [!t.lite && t.qMap.id !== "#" ? (S(), i(
|
|
1291
|
+
}, [!t.lite && t.qMap.id !== "#" ? (S(), i(Y, {
|
|
1284
1292
|
key: 0,
|
|
1285
1293
|
"q-map": t.qMap
|
|
1286
1294
|
}, null, 8, ["q-map"])) : a("", !0), u(X, {
|
|
1287
1295
|
disabled: t.readOnly,
|
|
1288
1296
|
multiline: ""
|
|
1289
1297
|
}, c({
|
|
1290
|
-
append:
|
|
1298
|
+
append: I(() => [t.qMap.required && (!t.lite || !d.value) ? (S(), o("span", on, [...r[6] ||= [s("i", { class: "fa fa-asterisk" }, null, -1)]])) : a("", !0), t.qMap.subtitle ? (S(), i(ue, {
|
|
1291
1299
|
key: 1,
|
|
1292
1300
|
"q-map": t.qMap
|
|
1293
1301
|
}, null, 8, ["q-map"])) : a("", !0)]),
|
|
1294
|
-
default:
|
|
1302
|
+
default: I(() => [L(s("textarea", {
|
|
1295
1303
|
id: t.qMap.id,
|
|
1296
1304
|
"onUpdate:modelValue": r[0] ||= (e) => d.value = e,
|
|
1297
1305
|
class: "qmap-input min-w-0 flex-1 px-0 py-2 min-h-24 resize-y",
|
|
@@ -1299,23 +1307,23 @@ var ee = /* @__PURE__ */ f({
|
|
|
1299
1307
|
rows: "5",
|
|
1300
1308
|
onBlur: r[1] ||= (e) => m(d.value),
|
|
1301
1309
|
onInput: r[2] ||= (e) => m(d.value)
|
|
1302
|
-
}, null, 40,
|
|
1310
|
+
}, null, 40, an), [[N, d.value]])]),
|
|
1303
1311
|
_: 2
|
|
1304
1312
|
}, [t.qMap.icon ? {
|
|
1305
1313
|
name: "prepend",
|
|
1306
|
-
fn:
|
|
1314
|
+
fn: I(() => [s("i", {
|
|
1307
1315
|
class: g(t.qMap.icon),
|
|
1308
1316
|
"aria-hidden": "true"
|
|
1309
1317
|
}, null, 2)]),
|
|
1310
1318
|
key: "0"
|
|
1311
|
-
} : void 0]), 1032, ["disabled"])], 8,
|
|
1312
|
-
p.value ? (S(), o("div",
|
|
1319
|
+
} : void 0]), 1032, ["disabled"])], 8, rn),
|
|
1320
|
+
p.value ? (S(), o("div", sn, k(p.value), 1)) : a("", !0)
|
|
1313
1321
|
]));
|
|
1314
1322
|
}
|
|
1315
|
-
}),
|
|
1323
|
+
}), hn = { class: "text-lg" }, gn = {
|
|
1316
1324
|
key: 0,
|
|
1317
1325
|
class: "text-md"
|
|
1318
|
-
},
|
|
1326
|
+
}, _n = /* @__PURE__ */ f({
|
|
1319
1327
|
__name: "qCaption",
|
|
1320
1328
|
props: {
|
|
1321
1329
|
qMap: {},
|
|
@@ -1329,9 +1337,9 @@ var ee = /* @__PURE__ */ f({
|
|
|
1329
1337
|
},
|
|
1330
1338
|
emits: ["qmap_change", "qmap_subquestions"],
|
|
1331
1339
|
setup(t, { emit: n }) {
|
|
1332
|
-
return (n, r) => (S(), o(e, null, [s("div",
|
|
1340
|
+
return (n, r) => (S(), o(e, null, [s("div", hn, k(t.qMap.title), 1), t.qMap.subtitle ? (S(), o("div", gn, k(t.qMap.subtitle), 1)) : a("", !0)], 64));
|
|
1333
1341
|
}
|
|
1334
|
-
}),
|
|
1342
|
+
}), vn = /* @__PURE__ */ f({
|
|
1335
1343
|
__name: "qGeoMap",
|
|
1336
1344
|
props: {
|
|
1337
1345
|
qMap: {},
|
|
@@ -1345,8 +1353,8 @@ var ee = /* @__PURE__ */ f({
|
|
|
1345
1353
|
},
|
|
1346
1354
|
emits: ["qmap_change", "qmap_subquestions"],
|
|
1347
1355
|
setup(e, { emit: t }) {
|
|
1348
|
-
let r = d(() => Promise.resolve().then(() =>
|
|
1349
|
-
|
|
1356
|
+
let r = d(() => Promise.resolve().then(() => Kn)), i = e, a = t, s = w(), c = n(() => i.qMap.style == "full-screen");
|
|
1357
|
+
F(() => i.model, (e) => s.value = i.model[i.qMap.id]), v(() => {
|
|
1350
1358
|
s.value = i.model[i.qMap.id] ? JSON.parse(i.model[i.qMap.id]) : void 0, l(s.value);
|
|
1351
1359
|
});
|
|
1352
1360
|
function l(e) {
|
|
@@ -1384,10 +1392,10 @@ var ee = /* @__PURE__ */ f({
|
|
|
1384
1392
|
"toolbar"
|
|
1385
1393
|
])], 6));
|
|
1386
1394
|
}
|
|
1387
|
-
}),
|
|
1395
|
+
}), yn = { class: "mb-4" }, bn = { class: "my-2 flex flex-row items-center justify-between" }, xn = { class: "qmap-table" }, Sn = ["onUpdate:modelValue"], Cn = ["onUpdate:modelValue"], wn = ["onClick"], Tn = { key: 0 }, En = {
|
|
1388
1396
|
colspan: "2",
|
|
1389
1397
|
class: "text-center"
|
|
1390
|
-
},
|
|
1398
|
+
}, Dn = /* @__PURE__ */ f({
|
|
1391
1399
|
__name: "qSimpleMap",
|
|
1392
1400
|
props: {
|
|
1393
1401
|
qMap: {},
|
|
@@ -1402,7 +1410,7 @@ var ee = /* @__PURE__ */ f({
|
|
|
1402
1410
|
emits: ["qmap_change", "qmap_subquestions"],
|
|
1403
1411
|
setup(t, { emit: n }) {
|
|
1404
1412
|
let r = t, i = n, c = w([]);
|
|
1405
|
-
|
|
1413
|
+
F(() => r.model, (e) => l(r.model[r.qMap.id])), v(() => {
|
|
1406
1414
|
l(r.model[r.qMap.id] || void 0);
|
|
1407
1415
|
});
|
|
1408
1416
|
function l(e) {
|
|
@@ -1427,41 +1435,41 @@ var ee = /* @__PURE__ */ f({
|
|
|
1427
1435
|
function p(e) {
|
|
1428
1436
|
c.value = c.value.filter((t) => t != e), d();
|
|
1429
1437
|
}
|
|
1430
|
-
return (n, r) => (S(), o("div",
|
|
1438
|
+
return (n, r) => (S(), o("div", yn, [s("div", bn, [u(Y, { "q-map": t.qMap }, null, 8, ["q-map"]), s("div", null, [s("button", {
|
|
1431
1439
|
type: "button",
|
|
1432
1440
|
class: "inline-flex items-center justify-center gap-2 min-h-9 px-3.5 py-2 qmap-button",
|
|
1433
1441
|
"aria-label": "Add row",
|
|
1434
1442
|
onClick: r[0] ||= (e) => f()
|
|
1435
|
-
}, "+")])]), s("table",
|
|
1436
|
-
default:
|
|
1443
|
+
}, "+")])]), s("table", xn, [r[4] ||= s("thead", null, [s("tr", null, [s("th", null, "Name"), s("th", null, "Value")])], -1), s("tbody", null, [(S(!0), o(e, null, T(c.value, (e, t) => (S(), o("tr", null, [s("td", null, [u(X, null, {
|
|
1444
|
+
default: I(() => [L(s("input", {
|
|
1437
1445
|
"onUpdate:modelValue": (e) => c.value[t].key = e,
|
|
1438
1446
|
class: "qmap-input min-w-0 flex-1 px-0 py-2",
|
|
1439
1447
|
onInput: d
|
|
1440
|
-
}, null, 40,
|
|
1448
|
+
}, null, 40, Sn), [[N, c.value[t].key]])]),
|
|
1441
1449
|
_: 2
|
|
1442
1450
|
}, 1024)]), s("td", null, [u(X, null, {
|
|
1443
|
-
append:
|
|
1451
|
+
append: I(() => [s("button", {
|
|
1444
1452
|
type: "button",
|
|
1445
1453
|
class: "inline-flex items-center justify-center min-w-8 min-h-8 p-1 qmap-icon-button qmap-danger",
|
|
1446
1454
|
"aria-label": "Remove row",
|
|
1447
1455
|
onClick: (t) => p(e)
|
|
1448
|
-
}, [...r[2] ||= [s("i", { class: "fa fa-trash" }, null, -1)]], 8,
|
|
1449
|
-
default:
|
|
1456
|
+
}, [...r[2] ||= [s("i", { class: "fa fa-trash" }, null, -1)]], 8, wn)]),
|
|
1457
|
+
default: I(() => [L(s("input", {
|
|
1450
1458
|
"onUpdate:modelValue": (e) => c.value[t].val = e,
|
|
1451
1459
|
class: "qmap-input min-w-0 flex-1 px-0 py-2",
|
|
1452
1460
|
onInput: d
|
|
1453
|
-
}, null, 40,
|
|
1461
|
+
}, null, 40, Cn), [[N, c.value[t].val]])]),
|
|
1454
1462
|
_: 2
|
|
1455
|
-
}, 1024)])]))), 256)), c.value.length ? a("", !0) : (S(), o("tr",
|
|
1463
|
+
}, 1024)])]))), 256)), c.value.length ? a("", !0) : (S(), o("tr", Tn, [s("td", En, [r[3] ||= s("div", null, "No values ", -1), s("button", {
|
|
1456
1464
|
type: "button",
|
|
1457
1465
|
class: "inline-flex items-center justify-center gap-2 min-h-9 px-3.5 py-2 qmap-button",
|
|
1458
1466
|
onClick: r[1] ||= (e) => f()
|
|
1459
1467
|
}, "Add Row")])]))])])]));
|
|
1460
1468
|
}
|
|
1461
|
-
}),
|
|
1469
|
+
}), On = { class: "flex flex-col flex-1 min-w-0" }, kn = { key: 16 }, An = { key: 17 }, jn = { key: 18 }, Mn = {
|
|
1462
1470
|
key: 0,
|
|
1463
1471
|
class: "qmap-separator my-4"
|
|
1464
|
-
},
|
|
1472
|
+
}, Nn = {
|
|
1465
1473
|
key: 1,
|
|
1466
1474
|
class: "qmap_nested flex flex-col gap-2"
|
|
1467
1475
|
}, Q = /* @__PURE__ */ f({
|
|
@@ -1490,7 +1498,7 @@ var ee = /* @__PURE__ */ f({
|
|
|
1490
1498
|
return (n, r) => {
|
|
1491
1499
|
let c = D("Question", !0);
|
|
1492
1500
|
return S(), o(e, null, [
|
|
1493
|
-
s("div",
|
|
1501
|
+
s("div", On, [p.value ? (S(), i(O(t.provider?.questionTypes[f.value]), {
|
|
1494
1502
|
key: 0,
|
|
1495
1503
|
qMap: t.qMap,
|
|
1496
1504
|
modelValue: t.modelValue,
|
|
@@ -1525,7 +1533,7 @@ var ee = /* @__PURE__ */ f({
|
|
|
1525
1533
|
"validator",
|
|
1526
1534
|
"lite",
|
|
1527
1535
|
"readOnly"
|
|
1528
|
-
])) : f.value == "object" ? (S(), i(
|
|
1536
|
+
])) : f.value == "object" ? (S(), i(mn, {
|
|
1529
1537
|
key: 2,
|
|
1530
1538
|
qMap: t.qMap,
|
|
1531
1539
|
model: t.modelValue,
|
|
@@ -1560,7 +1568,7 @@ var ee = /* @__PURE__ */ f({
|
|
|
1560
1568
|
"validator",
|
|
1561
1569
|
"lite",
|
|
1562
1570
|
"readOnly"
|
|
1563
|
-
])) : f.value == "colour" ? (S(), i(
|
|
1571
|
+
])) : f.value == "colour" ? (S(), i(Et, {
|
|
1564
1572
|
key: 4,
|
|
1565
1573
|
qMap: t.qMap,
|
|
1566
1574
|
model: t.modelValue,
|
|
@@ -1576,7 +1584,7 @@ var ee = /* @__PURE__ */ f({
|
|
|
1576
1584
|
"validator",
|
|
1577
1585
|
"lite",
|
|
1578
1586
|
"readOnly"
|
|
1579
|
-
])) : f.value == "date" ? (S(), i(
|
|
1587
|
+
])) : f.value == "date" ? (S(), i(Vt, {
|
|
1580
1588
|
key: 5,
|
|
1581
1589
|
qMap: t.qMap,
|
|
1582
1590
|
model: t.modelValue,
|
|
@@ -1593,7 +1601,7 @@ var ee = /* @__PURE__ */ f({
|
|
|
1593
1601
|
"validator",
|
|
1594
1602
|
"lite",
|
|
1595
1603
|
"readOnly"
|
|
1596
|
-
])) : f.value == "datetime" ? (S(), i(
|
|
1604
|
+
])) : f.value == "datetime" ? (S(), i(Vt, {
|
|
1597
1605
|
key: 6,
|
|
1598
1606
|
qMap: t.qMap,
|
|
1599
1607
|
model: t.modelValue,
|
|
@@ -1644,7 +1652,7 @@ var ee = /* @__PURE__ */ f({
|
|
|
1644
1652
|
"lite",
|
|
1645
1653
|
"readOnly",
|
|
1646
1654
|
"extras"
|
|
1647
|
-
])) : f.value == "boolean" ? (S(), i(
|
|
1655
|
+
])) : f.value == "boolean" ? (S(), i(Ke, {
|
|
1648
1656
|
key: 9,
|
|
1649
1657
|
qMap: t.qMap,
|
|
1650
1658
|
model: t.modelValue,
|
|
@@ -1661,7 +1669,7 @@ var ee = /* @__PURE__ */ f({
|
|
|
1661
1669
|
"validator",
|
|
1662
1670
|
"lite",
|
|
1663
1671
|
"readOnly"
|
|
1664
|
-
])) : f.value == "caption" ? (S(), i(
|
|
1672
|
+
])) : f.value == "caption" ? (S(), i(_n, {
|
|
1665
1673
|
key: 10,
|
|
1666
1674
|
qMap: t.qMap,
|
|
1667
1675
|
model: t.modelValue,
|
|
@@ -1670,7 +1678,7 @@ var ee = /* @__PURE__ */ f({
|
|
|
1670
1678
|
"qMap",
|
|
1671
1679
|
"model",
|
|
1672
1680
|
"lite"
|
|
1673
|
-
])) : f.value == "choice" ? (S(), i(
|
|
1681
|
+
])) : f.value == "choice" ? (S(), i(xt, {
|
|
1674
1682
|
key: 11,
|
|
1675
1683
|
qMap: t.qMap,
|
|
1676
1684
|
model: t.modelValue,
|
|
@@ -1689,7 +1697,7 @@ var ee = /* @__PURE__ */ f({
|
|
|
1689
1697
|
"lite",
|
|
1690
1698
|
"readOnly",
|
|
1691
1699
|
"provider"
|
|
1692
|
-
])) : f.value == "map" ? (S(), i(
|
|
1700
|
+
])) : f.value == "map" ? (S(), i(Dn, {
|
|
1693
1701
|
key: 12,
|
|
1694
1702
|
qMap: t.qMap,
|
|
1695
1703
|
model: t.modelValue,
|
|
@@ -1708,7 +1716,7 @@ var ee = /* @__PURE__ */ f({
|
|
|
1708
1716
|
"lite",
|
|
1709
1717
|
"readOnly",
|
|
1710
1718
|
"provider"
|
|
1711
|
-
])) : f.value == "geo_map" ? (S(), i(
|
|
1719
|
+
])) : f.value == "geo_map" ? (S(), i(vn, {
|
|
1712
1720
|
key: 13,
|
|
1713
1721
|
qMap: t.qMap,
|
|
1714
1722
|
model: t.modelValue,
|
|
@@ -1727,7 +1735,7 @@ var ee = /* @__PURE__ */ f({
|
|
|
1727
1735
|
"lite",
|
|
1728
1736
|
"readOnly",
|
|
1729
1737
|
"provider"
|
|
1730
|
-
])) : f.value == "array" ? (S(), i(
|
|
1738
|
+
])) : f.value == "array" ? (S(), i(Ee, {
|
|
1731
1739
|
key: 14,
|
|
1732
1740
|
qMap: t.qMap,
|
|
1733
1741
|
model: t.modelValue,
|
|
@@ -1745,7 +1753,7 @@ var ee = /* @__PURE__ */ f({
|
|
|
1745
1753
|
"lite",
|
|
1746
1754
|
"provider",
|
|
1747
1755
|
"readOnly"
|
|
1748
|
-
])) : f.value == "group" ? (S(), i(
|
|
1756
|
+
])) : f.value == "group" ? (S(), i(Yt, {
|
|
1749
1757
|
key: 15,
|
|
1750
1758
|
qMap: t.qMap,
|
|
1751
1759
|
model: t.modelValue,
|
|
@@ -1763,7 +1771,7 @@ var ee = /* @__PURE__ */ f({
|
|
|
1763
1771
|
"lite",
|
|
1764
1772
|
"provider",
|
|
1765
1773
|
"readOnly"
|
|
1766
|
-
])) : f.value == "col" ? (S(), o("div",
|
|
1774
|
+
])) : f.value == "col" ? (S(), o("div", kn, [u(Y, { "q-map": t.qMap }, null, 8, ["q-map"]), s("div", { class: g(["flex gap-2", {
|
|
1767
1775
|
"flex-row": t.qMap.style != "column",
|
|
1768
1776
|
"flex-col": t.qMap.style == "column"
|
|
1769
1777
|
}]) }, [(S(!0), o(e, null, T(t.qMap.items, (e) => (S(), o("div", { class: g(["flex flex-1 flex-col min-w-0", { "gap-2": t.qMap.style != "column" }]) }, [u(c, {
|
|
@@ -1784,9 +1792,9 @@ var ee = /* @__PURE__ */ f({
|
|
|
1784
1792
|
"validator",
|
|
1785
1793
|
"lite",
|
|
1786
1794
|
"readOnly"
|
|
1787
|
-
])], 2))), 256))], 2)])) : f.value == "hidden" ? (S(), o("div",
|
|
1788
|
-
y.value.length && t.qMap.ui?.separator ? (S(), o("hr",
|
|
1789
|
-
y.value.length ? (S(), o("div",
|
|
1795
|
+
])], 2))), 256))], 2)])) : f.value == "hidden" ? (S(), o("div", An)) : (S(), o("div", jn, "Unsupported " + k(t.qMap?.id) + " : " + k(f.value), 1))]),
|
|
1796
|
+
y.value.length && t.qMap.ui?.separator ? (S(), o("hr", Mn)) : a("", !0),
|
|
1797
|
+
y.value.length ? (S(), o("div", Nn, [(S(!0), o(e, null, T(y.value, (e) => (S(), i(c, {
|
|
1790
1798
|
qMap: e,
|
|
1791
1799
|
modelValue: t.modelValue,
|
|
1792
1800
|
extras: t.extras,
|
|
@@ -1808,10 +1816,10 @@ var ee = /* @__PURE__ */ f({
|
|
|
1808
1816
|
], 64);
|
|
1809
1817
|
};
|
|
1810
1818
|
}
|
|
1811
|
-
}),
|
|
1812
|
-
function
|
|
1819
|
+
}), Pn = ["col", "group"];
|
|
1820
|
+
function Fn(e, t) {
|
|
1813
1821
|
var n = [];
|
|
1814
|
-
if (
|
|
1822
|
+
if (Pn.indexOf(e.type) != -1 && (e.items || e.groups) ? e.items ? n = n.concat(e.items) : e.groups && (n = n.concat(e.groups.map((e) => e.items).reduce((e, t) => e.concat(t)).map((e) => Fn(e, t)).reduce((e, t) => e.concat(t)))) : n.push(e), e.onValue && (!t || t[e.id] != null && t[e.id] != "") && (n = n.concat($(e.onValue, t))), e.type == "boolean" && (!t || t[e.id] == 1) && e.onPos && (n = n.concat($(e.onPos, t))), e.type == "boolean" && (!t || t[e.id] == 0) && e.onNeg && (n = n.concat($(e.onNeg, t))), e.values) {
|
|
1815
1823
|
let r = e.values.find((n) => n.value == (!t || t[e.id]));
|
|
1816
1824
|
r?.onSelect && (n = n.concat($(r.onSelect, t)));
|
|
1817
1825
|
}
|
|
@@ -1821,21 +1829,21 @@ function $(e, t) {
|
|
|
1821
1829
|
var n = [];
|
|
1822
1830
|
return e.forEach((e) => {
|
|
1823
1831
|
if (e.type != "caption") {
|
|
1824
|
-
let r =
|
|
1832
|
+
let r = Fn(e, t);
|
|
1825
1833
|
n = n.concat(r);
|
|
1826
1834
|
}
|
|
1827
1835
|
}), n;
|
|
1828
1836
|
}
|
|
1829
1837
|
//#endregion
|
|
1830
1838
|
//#region src/services/question-validator.ts
|
|
1831
|
-
var
|
|
1832
|
-
invalidFields = new
|
|
1833
|
-
isValid = new
|
|
1839
|
+
var In = class {
|
|
1840
|
+
invalidFields = new V([]);
|
|
1841
|
+
isValid = new V(!0);
|
|
1834
1842
|
qMaps = [];
|
|
1835
1843
|
requiredQMaps = [];
|
|
1836
1844
|
children = [];
|
|
1837
1845
|
baseQMaps;
|
|
1838
|
-
changeEvents = new
|
|
1846
|
+
changeEvents = new H();
|
|
1839
1847
|
model;
|
|
1840
1848
|
activeQMAPS = /* @__PURE__ */ new Map();
|
|
1841
1849
|
constructor(e, t) {
|
|
@@ -1865,10 +1873,10 @@ var Sn = class {
|
|
|
1865
1873
|
get currentQMaps() {
|
|
1866
1874
|
return this.qMaps;
|
|
1867
1875
|
}
|
|
1868
|
-
},
|
|
1876
|
+
}, Ln = {
|
|
1869
1877
|
key: 0,
|
|
1870
1878
|
class: "flex-1 min-w-0 overflow-auto"
|
|
1871
|
-
},
|
|
1879
|
+
}, Rn = { class: "flex flex-col gap-2 p-2" }, zn = { class: "flex justify-end gap-2" }, Bn = ["disabled"], Vn = /* @__PURE__ */ f({
|
|
1872
1880
|
__name: "Form",
|
|
1873
1881
|
props: {
|
|
1874
1882
|
questions: {},
|
|
@@ -1888,7 +1896,7 @@ var Sn = class {
|
|
|
1888
1896
|
"update:model-value"
|
|
1889
1897
|
],
|
|
1890
1898
|
setup(t, { emit: r }) {
|
|
1891
|
-
let c = t, l = r, u = { ...c.modelValue }, d = c.validator || new
|
|
1899
|
+
let c = t, l = r, u = { ...c.modelValue }, d = c.validator || new In(c.questions, c.modelValue), f = w(!0), p = n(() => !(c.showSubmit || c.showCancel || c.showReset)), m = n({
|
|
1892
1900
|
get: () => c.modelValue,
|
|
1893
1901
|
set: (e) => l("update:model-value", e)
|
|
1894
1902
|
});
|
|
@@ -1918,7 +1926,7 @@ var Sn = class {
|
|
|
1918
1926
|
"flex flex-col gap-2 p-2": !t.scrollPane
|
|
1919
1927
|
})
|
|
1920
1928
|
}, [
|
|
1921
|
-
t.scrollPane ? (S(), o("div",
|
|
1929
|
+
t.scrollPane ? (S(), o("div", Ln, [s("div", Rn, [(S(!0), o(e, null, T(t.questions, (e, n) => (S(), i(Q, {
|
|
1922
1930
|
key: n,
|
|
1923
1931
|
qMap: e,
|
|
1924
1932
|
validator: A(d),
|
|
@@ -1946,14 +1954,14 @@ var Sn = class {
|
|
|
1946
1954
|
"modelValue"
|
|
1947
1955
|
]))), 128)),
|
|
1948
1956
|
r[6] ||= s("hr", { class: "qmap-separator my-2" }, null, -1),
|
|
1949
|
-
s("div",
|
|
1957
|
+
s("div", zn, [
|
|
1950
1958
|
t.showSubmit ? (S(), o("button", {
|
|
1951
1959
|
key: 0,
|
|
1952
1960
|
type: "button",
|
|
1953
1961
|
class: "inline-flex items-center justify-center gap-2 min-h-9 px-3.5 py-2 qmap-button",
|
|
1954
1962
|
onClick: r[3] ||= (e) => l("submit", m.value),
|
|
1955
1963
|
disabled: !f.value
|
|
1956
|
-
}, "Submit", 8,
|
|
1964
|
+
}, "Submit", 8, Bn)) : a("", !0),
|
|
1957
1965
|
t.showReset ? (S(), o("button", {
|
|
1958
1966
|
key: 1,
|
|
1959
1967
|
type: "button",
|
|
@@ -1971,20 +1979,214 @@ var Sn = class {
|
|
|
1971
1979
|
])
|
|
1972
1980
|
], 2));
|
|
1973
1981
|
}
|
|
1974
|
-
})
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1982
|
+
}), Hn = { class: "flex flex-row items-center justify-between p-2" }, Un = { class: "absolute top-0 right-0 m-4 z-50 qmap-editor-title" }, Wn = ["title"], Gn = /*@__PURE__*/ f({
|
|
1983
|
+
__name: "SimpleGeomEditor",
|
|
1984
|
+
props: {
|
|
1985
|
+
modelValue: {},
|
|
1986
|
+
class: {},
|
|
1987
|
+
readOnly: { type: Boolean },
|
|
1988
|
+
defaultColour: {},
|
|
1989
|
+
qMap: {},
|
|
1990
|
+
toolbar: {},
|
|
1991
|
+
centre: {},
|
|
1992
|
+
keys: {}
|
|
1993
|
+
},
|
|
1994
|
+
emits: ["update:model-value"],
|
|
1995
|
+
setup(e, { emit: t }) {
|
|
1996
|
+
let n = e, r = t, c = w(), u = w(0), d = w(), f = w(), p = w(!1), m = w(!1);
|
|
1997
|
+
w(0);
|
|
1998
|
+
let h, _;
|
|
1999
|
+
F(d, (e, t) => {
|
|
2000
|
+
_.setStyle({
|
|
2001
|
+
fillColor: void 0,
|
|
2002
|
+
weight: 4
|
|
2003
|
+
}), e && (f.value = e.options.color || n.defaultColour, e.setStyle && e.setStyle({
|
|
2004
|
+
fillColor: "#6a1b9a",
|
|
2005
|
+
weight: 4
|
|
2006
|
+
}), e.enableEdit?.(h), e.dragging?.enable()), t && (t.disableEdit?.(h), t.dragging?.disable());
|
|
2007
|
+
}), F(m, (e) => {
|
|
2008
|
+
!e && E && E.removeFrom(h);
|
|
2009
|
+
}), b(() => {
|
|
2010
|
+
if (v(), n.modelValue && !n.readOnly) C(n.modelValue), h.flyToBounds(_.getBounds(), { animate: !1 });
|
|
2011
|
+
else if (n.modelValue) {
|
|
2012
|
+
let e = se(n.modelValue);
|
|
2013
|
+
h.addLayer(e), h.flyToBounds(e.getBounds());
|
|
2014
|
+
}
|
|
2015
|
+
u.value = _.getLayers().length;
|
|
2016
|
+
}), x(() => {
|
|
2017
|
+
h && h.remove();
|
|
2018
|
+
});
|
|
2019
|
+
function v() {
|
|
2020
|
+
h && h.remove();
|
|
2021
|
+
let e = new q("https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v12/tiles/{z}/{x}/{y}?access_token=" + n.keys.mapbox, {
|
|
2022
|
+
maxZoom: 18,
|
|
2023
|
+
noWrap: !0
|
|
2024
|
+
}).setZIndex(0);
|
|
2025
|
+
if (n.readOnly) h = new ie(c.value).setView(n.centre ? [n.centre.lng, n.centre.lat] : [-25, 135], n.centre ? n.centre.zoom : 5);
|
|
2026
|
+
else {
|
|
2027
|
+
h = new ie(c.value, { editable: !0 }).setView(n.centre ? [n.centre.lng, n.centre.lat] : [-25, 135], n.centre ? n.centre.zoom : 5), h.on("click", (e) => {
|
|
2028
|
+
let t = e.originalEvent.target, n = t.closest(".leaflet-overlay-pane"), r = t.closest(".leaflet-control");
|
|
2029
|
+
!n && !r && !p.value && (d.value = void 0);
|
|
2030
|
+
});
|
|
2031
|
+
let e = W.extend({
|
|
2032
|
+
options: {
|
|
2033
|
+
position: "topleft",
|
|
2034
|
+
callback: null,
|
|
2035
|
+
kind: "",
|
|
2036
|
+
html: ""
|
|
2037
|
+
},
|
|
2038
|
+
onAdd: function(e) {
|
|
2039
|
+
var t = ne.create("div", "leaflet-control leaflet-bar qmap-leaflet-button"), n = ne.create("a", "", t);
|
|
2040
|
+
let r = this.options;
|
|
2041
|
+
return n.href = "#", n.title = "Create a new " + r.kind, n.innerHTML = this.options.html, G.on(n, "click", G.stop).on(n, "click", function() {
|
|
2042
|
+
r.callback.call(e.editTools);
|
|
2043
|
+
}, this), t;
|
|
2044
|
+
}
|
|
2045
|
+
}), t = e.extend({ options: {
|
|
2046
|
+
position: "topleft",
|
|
2047
|
+
callback: h.editTools.startPolyline,
|
|
2048
|
+
kind: "line",
|
|
2049
|
+
html: "<i class=\"fa fa-pencil\"/>"
|
|
2050
|
+
} }), r = e.extend({ options: {
|
|
2051
|
+
position: "topleft",
|
|
2052
|
+
callback: h.editTools.startPolygon,
|
|
2053
|
+
kind: "polygon",
|
|
2054
|
+
html: "<i class=\"fa fa-draw-polygon\"/>"
|
|
2055
|
+
} }), i = e.extend({ options: {
|
|
2056
|
+
position: "topleft",
|
|
2057
|
+
callback: h.editTools.startMarker,
|
|
2058
|
+
kind: "marker",
|
|
2059
|
+
html: "<i class=\"fa fa-map-pin\"/>"
|
|
2060
|
+
} }), a = e.extend({ options: {
|
|
2061
|
+
position: "topleft",
|
|
2062
|
+
callback: h.editTools.startRectangle,
|
|
2063
|
+
kind: "rectangle",
|
|
2064
|
+
html: "<i class=\"fa fa-square\"/>"
|
|
2065
|
+
} }), o = e.extend({ options: {
|
|
2066
|
+
position: "topleft",
|
|
2067
|
+
callback: h.editTools.startCircle,
|
|
2068
|
+
kind: "rectangle",
|
|
2069
|
+
html: "<i class=\"fa fa-circle\"/>"
|
|
2070
|
+
} });
|
|
2071
|
+
n.readOnly || (h.addControl(new i()), h.addControl(new t()), h.addControl(new r()), h.addControl(new a()), h.addControl(new o())), h.on("editable:edited", (e) => {
|
|
2072
|
+
let t = e.layer;
|
|
2073
|
+
_.hasLayer(t) || T(t), y();
|
|
2074
|
+
});
|
|
2075
|
+
}
|
|
2076
|
+
if (localStorage.lastMapPos) {
|
|
2077
|
+
let e = JSON.parse(localStorage.lastMapPos);
|
|
2078
|
+
if (e?.ne && e.sw) {
|
|
2079
|
+
let t = new re(e.ne, e.sw);
|
|
2080
|
+
h.flyToBounds(t, { animate: !1 });
|
|
2081
|
+
} else h.setView([-26, 132], 5);
|
|
2082
|
+
} else h.setView([-26, 132], 5);
|
|
2083
|
+
h.addLayer(e), h.on("moveend", (e) => {
|
|
2084
|
+
let t = e.target.getBounds();
|
|
2085
|
+
localStorage.lastMapPos = JSON.stringify({
|
|
2086
|
+
ne: t.getNorthEast(),
|
|
2087
|
+
sw: t.getSouthWest()
|
|
2088
|
+
});
|
|
2089
|
+
}), _ = oe().addTo(h);
|
|
2090
|
+
}
|
|
2091
|
+
function y() {
|
|
2092
|
+
let e = _.getLayers().map((e) => {
|
|
2093
|
+
function t(t) {
|
|
2094
|
+
return Object.keys(e.options).filter((e) => [
|
|
2095
|
+
"color",
|
|
2096
|
+
"fill",
|
|
2097
|
+
"fillColor",
|
|
2098
|
+
"fillOpacity",
|
|
2099
|
+
"stroke",
|
|
2100
|
+
"weight",
|
|
2101
|
+
"title"
|
|
2102
|
+
].indexOf(e) != -1).forEach((n) => t.properties[n] = e.options[n]), t;
|
|
2103
|
+
}
|
|
2104
|
+
if (e instanceof U) {
|
|
2105
|
+
let n = e.toGeoJSON();
|
|
2106
|
+
return n.properties = {
|
|
2107
|
+
type: "circle",
|
|
2108
|
+
radius: e.getRadius()
|
|
2109
|
+
}, t(n);
|
|
2110
|
+
}
|
|
2111
|
+
if (e instanceof ae) {
|
|
2112
|
+
let n = e.toGeoJSON();
|
|
2113
|
+
return n.properties = { type: "rectangle" }, t(n);
|
|
2114
|
+
}
|
|
2115
|
+
return t(e.toGeoJSON());
|
|
2116
|
+
});
|
|
2117
|
+
r("update:model-value", {
|
|
2118
|
+
features: e,
|
|
2119
|
+
type: "FeatureCollection"
|
|
2120
|
+
}), u.value = _.getLayers().length;
|
|
2121
|
+
}
|
|
2122
|
+
function C(e) {
|
|
2123
|
+
var t;
|
|
2124
|
+
return se(e, { onEachFeature: (e, n) => {
|
|
2125
|
+
let r;
|
|
2126
|
+
if (r = e.properties?.type == "circle" && e.properties?.radius ? new U(new K([n]).getBounds().getCenter(), e.properties.radius) : e.properties?.type == "rectangle" ? new ae(new K([n]).getBounds()) : n, e.properties) {
|
|
2127
|
+
let t = {};
|
|
2128
|
+
Object.keys(e.properties).filter((e) => [
|
|
2129
|
+
"color",
|
|
2130
|
+
"fill",
|
|
2131
|
+
"fillOpacity",
|
|
2132
|
+
"stroke",
|
|
2133
|
+
"weight",
|
|
2134
|
+
"title"
|
|
2135
|
+
].indexOf(e) != -1).forEach((n) => t[n] = e.properties[n]), r.setStyle && r.setStyle(t);
|
|
2136
|
+
}
|
|
2137
|
+
e.properties?.title && r.bindTooltip(e.properties.title, {
|
|
2138
|
+
permanent: !0,
|
|
2139
|
+
direction: "center",
|
|
2140
|
+
className: "qmap-tooltip",
|
|
2141
|
+
opacity: 1
|
|
2142
|
+
}), T(r), t = r;
|
|
2143
|
+
} }), t;
|
|
2144
|
+
}
|
|
2145
|
+
function T(e) {
|
|
2146
|
+
_.addLayer(e), te.makeDraggable(e), e.on("click", (t) => {
|
|
2147
|
+
d.value = e;
|
|
2148
|
+
});
|
|
2149
|
+
}
|
|
2150
|
+
var E;
|
|
2151
|
+
return (t, r) => (S(), o("div", {
|
|
2152
|
+
ref_key: "mapDiv",
|
|
2153
|
+
ref: c,
|
|
2154
|
+
class: g(n.class)
|
|
2155
|
+
}, [d.value ? (S(), o("div", {
|
|
2156
|
+
key: 0,
|
|
2157
|
+
class: "absolute bottom-0 left-0 m-4 flex flex-col gap-1 qmap-editor-card",
|
|
2158
|
+
style: { "z-index": "999" },
|
|
2159
|
+
onClick: r[1] ||= z(() => {}, ["stop"])
|
|
2160
|
+
}, [s("div", Hn, [r[2] ||= l(" Selected Item ", -1), s("button", {
|
|
2161
|
+
type: "button",
|
|
2162
|
+
class: "inline-flex items-center justify-center min-w-8 min-h-8 p-1 qmap-icon-button",
|
|
2163
|
+
"aria-label": "Close",
|
|
2164
|
+
onClick: r[0] ||= (e) => d.value = void 0
|
|
2165
|
+
}, "×")]), r[3] ||= s("hr", { class: "qmap-separator my-2" }, null, -1)])) : a("", !0), s("div", Un, [e.qMap ? (S(), i(Y, {
|
|
2166
|
+
key: 0,
|
|
2167
|
+
"q-map": e.qMap
|
|
2168
|
+
}, {
|
|
2169
|
+
default: I(() => [e.qMap.required ? (S(), o("span", {
|
|
2170
|
+
key: 0,
|
|
2171
|
+
class: "qmap-required",
|
|
2172
|
+
title: u.value ? "Required to have value" : "A value is required"
|
|
2173
|
+
}, [...r[4] ||= [s("i", { class: "fa fa-asterisk" }, null, -1)]], 8, Wn)) : a("", !0)]),
|
|
2174
|
+
_: 1
|
|
2175
|
+
}, 8, ["q-map"])) : a("", !0)])], 2));
|
|
2176
|
+
}
|
|
2177
|
+
}), Kn = /* @__PURE__ */ ce({ default: () => qn }), qn = Gn, Jn = Symbol("QMAP");
|
|
2178
|
+
function Yn(e) {
|
|
2179
|
+
C(Jn, e);
|
|
1978
2180
|
}
|
|
1979
|
-
function
|
|
1980
|
-
let e = m(
|
|
2181
|
+
function Xn() {
|
|
2182
|
+
let e = m(Jn, null);
|
|
1981
2183
|
if (!e) throw Error("useMyService must be called under a provider (comp1)");
|
|
1982
2184
|
return e;
|
|
1983
2185
|
}
|
|
1984
2186
|
//#endregion
|
|
1985
2187
|
//#region src/lib.ts
|
|
1986
|
-
function
|
|
1987
|
-
let a = w(n), o = new
|
|
2188
|
+
function Zn(e, t, n, i) {
|
|
2189
|
+
let a = w(n), o = new V(a.value), s = new H(), c = p(Vn, {
|
|
1988
2190
|
questions: t,
|
|
1989
2191
|
modelValue: a.value,
|
|
1990
2192
|
"onUpdate:model-value": (e) => {
|
|
@@ -2005,6 +2207,11 @@ function An(e, t, n, i) {
|
|
|
2005
2207
|
events: s
|
|
2006
2208
|
};
|
|
2007
2209
|
}
|
|
2210
|
+
var Qn = {
|
|
2211
|
+
Question: Q,
|
|
2212
|
+
Form: Vn,
|
|
2213
|
+
QuestionValidator: In,
|
|
2214
|
+
mount: Zn
|
|
2215
|
+
};
|
|
2008
2216
|
//#endregion
|
|
2009
|
-
export {
|
|
2010
|
-
var jn, Mn, Nn, Pn;
|
|
2217
|
+
export { It as CalendarPicker, Vn as Form, Jn as MyScopeKey, Q as Question, In as QuestionValidator, ot as SimpleChoice, Bt as SimpleDate, qn as SimpleGeomEditor, Y as TitleBlock, je as ToggleSwitch, Qn as default, Fn as flattenNode, $ as flattenQMAPs, Zn as mount, Yn as provideBadQMAPS, Xn as useBadQMAPS };
|