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