@tellaro/tql 0.1.18 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/src/completionProvider.d.ts +0 -1
- package/dist/src/completionProvider.js +195 -534
- package/dist/src/complexityAnalyzer.d.ts +0 -1
- package/dist/src/complexityAnalyzer.js +33 -36
- package/dist/src/parser.d.ts +0 -1
- package/dist/src/parser.js +78 -115
- package/dist/src/schemaCache.d.ts +0 -1
- package/dist/src/schemaCache.js +34 -42
- package/dist/src/semanticPreview.d.ts +0 -1
- package/dist/src/semanticPreview.js +36 -38
- package/dist/src/tokenizer.d.ts +0 -15
- package/dist/src/tokenizer.js +47 -156
- package/dist/src/types.d.ts +14 -0
- package/dist/src/validator.d.ts +0 -1
- package/dist/src/validator.js +31 -148
- package/dist/tql.css +1 -0
- package/dist/vue/TqlAutocomplete.vue2.js +56 -59
- package/dist/vue/TqlInput.vue.js +1 -1
- package/dist/vue/TqlInput.vue2.js +333 -359
- package/dist/vue/components/TqlPreview.vue2.js +58 -62
- package/dist/vue/composables/useQueryHistory.d.ts +0 -1
- package/dist/vue/composables/useQueryHistory.js +1 -4
- package/dist/vue/useTqlInput.js +107 -117
- package/package.json +11 -5
- package/dist/style.css +0 -1
|
@@ -1,48 +1,47 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { useTqlInput as
|
|
5
|
-
import { useQueryHistory as
|
|
6
|
-
import { analyzeComplexity as
|
|
7
|
-
|
|
8
|
-
const dt = {
|
|
1
|
+
import { defineComponent as et, ref as h, toRef as _, computed as $, watch as ee, onMounted as tt, nextTick as S, onUnmounted as lt, openBlock as a, createElementBlock as n, normalizeClass as P, unref as c, Fragment as M, renderList as F, toDisplayString as w, createCommentVNode as m, withDirectives as ne, vModelText as se, createElementVNode as d, withModifiers as Q, withKeys as ke, createVNode as xe, createBlock as ot, Teleport as at } from "vue";
|
|
2
|
+
import it from "./TqlAutocomplete.vue.js";
|
|
3
|
+
import nt from "./components/TqlPreview.vue.js";
|
|
4
|
+
import { useTqlInput as st } from "./useTqlInput.js";
|
|
5
|
+
import { useQueryHistory as ut } from "./composables/useQueryHistory.js";
|
|
6
|
+
import { analyzeComplexity as rt } from "../src/complexityAnalyzer.js";
|
|
7
|
+
const ct = {
|
|
9
8
|
key: 0,
|
|
10
9
|
class: "tql-highlight-layer",
|
|
11
10
|
"aria-hidden": "true"
|
|
12
|
-
},
|
|
11
|
+
}, dt = ["placeholder", "disabled", "readonly", "rows", "aria-expanded", "aria-invalid", "aria-describedby"], vt = ["placeholder", "disabled", "readonly", "aria-expanded", "aria-invalid", "aria-describedby"], ft = { class: "tql-toolbar" }, pt = ["title"], ht = { class: "tql-complexity-label" }, mt = {
|
|
13
12
|
key: 0,
|
|
14
13
|
class: "tql-complexity-count"
|
|
15
|
-
},
|
|
14
|
+
}, yt = {
|
|
16
15
|
key: 4,
|
|
17
16
|
class: "tql-validation-status"
|
|
18
|
-
},
|
|
17
|
+
}, gt = {
|
|
19
18
|
key: 0,
|
|
20
19
|
class: "pi pi-check-circle tql-icon-valid",
|
|
21
20
|
"aria-label": "Query is valid"
|
|
22
|
-
},
|
|
21
|
+
}, wt = ["aria-label", "aria-expanded"], bt = { class: "tql-history-header" }, qt = { class: "tql-history-list" }, kt = ["onClick"], xt = ["title", "onClick"], Ct = { class: "tql-history-content" }, St = {
|
|
23
22
|
key: 0,
|
|
24
23
|
class: "tql-history-label"
|
|
25
|
-
},
|
|
24
|
+
}, Pt = { class: "tql-history-query" }, Vt = { class: "tql-history-time" }, Dt = {
|
|
26
25
|
key: 0,
|
|
27
26
|
class: "tql-history-empty"
|
|
28
|
-
},
|
|
27
|
+
}, Rt = {
|
|
29
28
|
key: 0,
|
|
30
29
|
class: "tql-error-suggestion"
|
|
31
|
-
},
|
|
30
|
+
}, Tt = {
|
|
32
31
|
key: 4,
|
|
33
32
|
class: "tql-complexity-warnings"
|
|
34
|
-
},
|
|
33
|
+
}, $t = {
|
|
35
34
|
key: 0,
|
|
36
35
|
class: "tql-complexity-suggestions"
|
|
37
|
-
},
|
|
36
|
+
}, It = {
|
|
38
37
|
key: 5,
|
|
39
38
|
class: "tql-preview-panel"
|
|
40
|
-
},
|
|
39
|
+
}, Et = { class: "tql-preview-header" }, Ht = {
|
|
41
40
|
class: "sr-only",
|
|
42
41
|
role: "status",
|
|
43
42
|
"aria-live": "polite",
|
|
44
43
|
"aria-atomic": "true"
|
|
45
|
-
},
|
|
44
|
+
}, Bt = { key: 0 }, Mt = { key: 1 }, Qt = 1500, Nt = /* @__PURE__ */ et({
|
|
46
45
|
__name: "TqlInput",
|
|
47
46
|
props: {
|
|
48
47
|
modelValue: {},
|
|
@@ -72,602 +71,577 @@ const dt = {
|
|
|
72
71
|
historyStorageKey: {}
|
|
73
72
|
},
|
|
74
73
|
emits: ["update:modelValue", "validation", "parse", "submit"],
|
|
75
|
-
setup(
|
|
76
|
-
const
|
|
77
|
-
let
|
|
78
|
-
const
|
|
79
|
-
tokens:
|
|
80
|
-
cursorPosition:
|
|
81
|
-
completionItems:
|
|
82
|
-
showAutocomplete:
|
|
83
|
-
isValid:
|
|
84
|
-
errors:
|
|
85
|
-
hasErrors:
|
|
86
|
-
validate:
|
|
87
|
-
handleInput:
|
|
88
|
-
handleCursorChange:
|
|
89
|
-
insertCompletion:
|
|
90
|
-
insertSnippet:
|
|
74
|
+
setup(i, { expose: Ce, emit: Se }) {
|
|
75
|
+
const v = i, b = Se, o = h(null), q = h(null), A = h(null), s = h(v.modelValue), k = h(!1), y = h(!1), N = h(0), L = h(!1);
|
|
76
|
+
let U = null, j = 0;
|
|
77
|
+
const V = h(!1), D = h(!1), I = h(""), te = `tql-input-${Math.random().toString(36).substring(2, 9)}`, ue = `${te}-input`, le = `${te}-autocomplete`, oe = `${te}-errors`, z = h([]), E = h(-1), Pe = _(v, "modelValue"), Ve = _(v, "fieldSchema"), De = _(v, "fieldValues"), Re = _(v, "snippets"), {
|
|
78
|
+
tokens: Te,
|
|
79
|
+
cursorPosition: K,
|
|
80
|
+
completionItems: O,
|
|
81
|
+
showAutocomplete: x,
|
|
82
|
+
isValid: W,
|
|
83
|
+
errors: R,
|
|
84
|
+
hasErrors: T,
|
|
85
|
+
validate: $e,
|
|
86
|
+
handleInput: re,
|
|
87
|
+
handleCursorChange: C,
|
|
88
|
+
insertCompletion: Ie,
|
|
89
|
+
insertSnippet: Ee,
|
|
91
90
|
triggerAutocomplete: ae,
|
|
92
91
|
hideAutocomplete: G,
|
|
93
|
-
getTokenAtCursor:
|
|
94
|
-
} =
|
|
95
|
-
modelValue:
|
|
96
|
-
fieldSchema:
|
|
97
|
-
fieldValues:
|
|
98
|
-
snippets:
|
|
99
|
-
validateOnInput:
|
|
100
|
-
debounceMs:
|
|
101
|
-
autocomplete:
|
|
102
|
-
onValidation: (e) =>
|
|
103
|
-
onParse: (e) =>
|
|
104
|
-
}),
|
|
105
|
-
storageKey:
|
|
106
|
-
...
|
|
107
|
-
}) : null, g =
|
|
92
|
+
getTokenAtCursor: He
|
|
93
|
+
} = st({
|
|
94
|
+
modelValue: Pe,
|
|
95
|
+
fieldSchema: Ve,
|
|
96
|
+
fieldValues: De,
|
|
97
|
+
snippets: Re,
|
|
98
|
+
validateOnInput: v.validateOnInput,
|
|
99
|
+
debounceMs: v.debounceMs,
|
|
100
|
+
autocomplete: v.autocomplete,
|
|
101
|
+
onValidation: (e) => b("validation", e),
|
|
102
|
+
onParse: (e) => b("parse", e)
|
|
103
|
+
}), H = v.showHistory ? ut({
|
|
104
|
+
storageKey: v.historyStorageKey || "tql-history",
|
|
105
|
+
...v.historyOptions
|
|
106
|
+
}) : null, g = $(() => !v.showComplexity || !s.value.trim() ? null : rt(s.value, v.complexityThresholds)), Be = $(() => g.value ? `tql-complexity-${g.value.score}` : ""), ce = $(() => g.value && {
|
|
108
107
|
low: "Low",
|
|
109
108
|
medium: "Medium",
|
|
110
109
|
high: "High"
|
|
111
|
-
}[g.value.score] || ""),
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
// Check for enrichment/slow mutators in tokens
|
|
115
|
-
const hasSlow = Ie.value.some(t =>
|
|
116
|
-
t.type === "mutator" && SLOW_MUTATORS.includes(t.value.toLowerCase())
|
|
117
|
-
);
|
|
118
|
-
if (hasSlow) return "slow";
|
|
119
|
-
if (ie.value) return "valid";
|
|
120
|
-
return "unknown";
|
|
121
|
-
}), ve = H(() => $ ? T.value.trim() ? $.searchHistory(T.value).slice(0, 10) : $.getRecentQueries(10) : []);
|
|
122
|
-
function Qe(e) {
|
|
123
|
-
u.value = e.query, q("update:modelValue", e.query), ce(e.query), D.value = !1, T.value = "", P(() => {
|
|
124
|
-
var t;
|
|
125
|
-
return (t = i.value) == null ? void 0 : t.focus();
|
|
126
|
-
});
|
|
110
|
+
}[g.value.score] || ""), de = $(() => H ? I.value.trim() ? H.searchHistory(I.value).slice(0, 10) : H.getRecentQueries(10) : []);
|
|
111
|
+
function Me(e) {
|
|
112
|
+
s.value = e.query, b("update:modelValue", e.query), re(e.query), V.value = !1, I.value = "", S(() => o.value?.focus());
|
|
127
113
|
}
|
|
128
|
-
function
|
|
129
|
-
t.stopPropagation(),
|
|
114
|
+
function Qe(e, t) {
|
|
115
|
+
t.stopPropagation(), H?.toggleFavorite(e.id);
|
|
130
116
|
}
|
|
131
|
-
function
|
|
132
|
-
|
|
117
|
+
function ve() {
|
|
118
|
+
H && s.value.trim() && H.addQuery(s.value);
|
|
133
119
|
}
|
|
134
|
-
function
|
|
135
|
-
|
|
120
|
+
function Ae() {
|
|
121
|
+
V.value = !V.value, V.value && (D.value = !1);
|
|
136
122
|
}
|
|
137
|
-
function
|
|
138
|
-
|
|
123
|
+
function Le() {
|
|
124
|
+
D.value = !D.value, D.value && (V.value = !1);
|
|
139
125
|
}
|
|
140
126
|
ee(
|
|
141
|
-
() =>
|
|
127
|
+
() => v.modelValue,
|
|
142
128
|
(e) => {
|
|
143
|
-
e !==
|
|
129
|
+
e !== s.value && (s.value = e);
|
|
144
130
|
}
|
|
145
131
|
), ee(
|
|
146
|
-
() =>
|
|
132
|
+
() => v.minHeight,
|
|
147
133
|
(e) => {
|
|
148
|
-
|
|
134
|
+
q.value && (e ? q.value.style.setProperty("--tql-min-height", e) : q.value.style.removeProperty("--tql-min-height"));
|
|
149
135
|
},
|
|
150
136
|
{ immediate: !0 }
|
|
151
137
|
);
|
|
152
|
-
const
|
|
153
|
-
const e =
|
|
138
|
+
const ze = $(() => y.value ? !0 : x.value && O.value.length > 0 ? !1 : !!(!k.value || L.value)), J = h({ top: 0, left: 0 }), Ke = $(() => J.value.top > 0 || J.value.left > 0), fe = h({ top: 0, left: 0, width: 0 }), B = h(null), Oe = $(() => {
|
|
139
|
+
const e = fe.value;
|
|
154
140
|
return e.top > 0 || e.left > 0 || e.width > 0;
|
|
155
141
|
});
|
|
156
142
|
function X() {
|
|
157
|
-
if (!
|
|
143
|
+
if (!q.value)
|
|
158
144
|
return;
|
|
159
|
-
const e =
|
|
145
|
+
const e = q.value.getBoundingClientRect();
|
|
160
146
|
J.value = {
|
|
161
147
|
top: e.bottom + 4,
|
|
162
148
|
left: e.left
|
|
163
|
-
},
|
|
149
|
+
}, fe.value = {
|
|
164
150
|
top: e.bottom + 4,
|
|
165
151
|
left: e.left,
|
|
166
152
|
width: e.width
|
|
167
|
-
},
|
|
153
|
+
}, B.value && (B.value.style.setProperty("--tql-msg-top", `${e.bottom + 4}px`), B.value.style.setProperty("--tql-msg-left", `${e.left}px`), B.value.style.setProperty("--tql-msg-width", `${e.width}px`));
|
|
168
154
|
}
|
|
169
|
-
function
|
|
155
|
+
function Fe(e) {
|
|
170
156
|
const t = `tql-token tql-token-${e.type}`;
|
|
171
|
-
return
|
|
157
|
+
return R.value.some((u) => e.start >= u.start && e.end <= u.end) ? `${t} tql-token-error-range` : t;
|
|
172
158
|
}
|
|
173
|
-
function
|
|
159
|
+
function pe(e) {
|
|
174
160
|
const t = e.target;
|
|
175
|
-
|
|
176
|
-
|
|
161
|
+
s.value = t.value, b("update:modelValue", t.value), re(t.value), N.value = Date.now(), L.value = !1, S(() => {
|
|
162
|
+
o.value && C(o.value.selectionStart || 0);
|
|
177
163
|
});
|
|
178
164
|
}
|
|
179
165
|
function Y() {
|
|
180
|
-
if (
|
|
181
|
-
const e =
|
|
182
|
-
e !==
|
|
166
|
+
if (o.value) {
|
|
167
|
+
const e = o.value.selectionStart || 0;
|
|
168
|
+
e !== K.value && C(e);
|
|
183
169
|
}
|
|
184
170
|
}
|
|
185
|
-
function
|
|
186
|
-
var t, l, o, v;
|
|
171
|
+
function he(e) {
|
|
187
172
|
if (e.key === "Tab" && !e.shiftKey) {
|
|
188
|
-
if (Date.now() -
|
|
173
|
+
if (Date.now() - j < 200) {
|
|
189
174
|
e.preventDefault();
|
|
190
175
|
return;
|
|
191
176
|
}
|
|
192
|
-
if (
|
|
193
|
-
e.preventDefault(),
|
|
177
|
+
if (z.value.length > 0 && E.value >= 0) {
|
|
178
|
+
e.preventDefault(), Ne();
|
|
194
179
|
return;
|
|
195
180
|
}
|
|
196
|
-
if (
|
|
197
|
-
e.preventDefault(),
|
|
181
|
+
if (me()) {
|
|
182
|
+
e.preventDefault(), We();
|
|
198
183
|
return;
|
|
199
184
|
}
|
|
200
|
-
if (
|
|
201
|
-
e.preventDefault(),
|
|
185
|
+
if (Ue()) {
|
|
186
|
+
e.preventDefault(), je();
|
|
202
187
|
return;
|
|
203
188
|
}
|
|
204
|
-
if (
|
|
205
|
-
e.preventDefault(),
|
|
189
|
+
if (x.value && O.value.length > 0) {
|
|
190
|
+
e.preventDefault(), A.value?.selectCurrent();
|
|
206
191
|
return;
|
|
207
192
|
}
|
|
208
193
|
return;
|
|
209
194
|
}
|
|
210
|
-
if (
|
|
195
|
+
if (x.value && O.value.length > 0)
|
|
211
196
|
switch (e.key) {
|
|
212
197
|
case "ArrowDown":
|
|
213
|
-
e.preventDefault(),
|
|
198
|
+
e.preventDefault(), A.value?.moveDown();
|
|
214
199
|
return;
|
|
215
200
|
case "ArrowUp":
|
|
216
|
-
e.preventDefault(),
|
|
201
|
+
e.preventDefault(), A.value?.moveUp();
|
|
217
202
|
return;
|
|
218
203
|
case "Enter":
|
|
219
|
-
if (!
|
|
204
|
+
if (!v.multiline)
|
|
220
205
|
break;
|
|
221
|
-
e.preventDefault(),
|
|
206
|
+
e.preventDefault(), A.value?.selectCurrent();
|
|
222
207
|
return;
|
|
223
208
|
case "Escape":
|
|
224
|
-
e.preventDefault(), G(),
|
|
209
|
+
e.preventDefault(), G(), ie();
|
|
225
210
|
return;
|
|
226
211
|
}
|
|
227
212
|
if (e.key === " " && e.ctrlKey) {
|
|
228
213
|
e.preventDefault(), ae();
|
|
229
214
|
return;
|
|
230
215
|
}
|
|
231
|
-
e.key === "Enter" && (
|
|
216
|
+
e.key === "Enter" && (v.multiline && e.ctrlKey || !v.multiline && !x.value) && (e.preventDefault(), ve(), b("submit", s.value));
|
|
232
217
|
}
|
|
233
|
-
function
|
|
234
|
-
if (
|
|
235
|
-
|
|
218
|
+
function Ne() {
|
|
219
|
+
if (E.value++, E.value >= z.value.length) {
|
|
220
|
+
ie();
|
|
236
221
|
return;
|
|
237
222
|
}
|
|
238
|
-
const e =
|
|
239
|
-
|
|
223
|
+
const e = z.value[E.value];
|
|
224
|
+
o.value && (o.value.setSelectionRange(e.start, e.end), o.value.focus(), C(e.start));
|
|
240
225
|
}
|
|
241
|
-
function
|
|
242
|
-
|
|
226
|
+
function ie() {
|
|
227
|
+
z.value = [], E.value = -1;
|
|
243
228
|
}
|
|
244
|
-
function
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
let
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
(p === '"' || p === "'") && w !== "\\" && (l ? p === o && (l = !1, o = null) : (l = !0, o = p));
|
|
229
|
+
function me() {
|
|
230
|
+
const e = o.value?.selectionStart ?? K.value, t = s.value;
|
|
231
|
+
let l = !1, u = null;
|
|
232
|
+
for (let r = 0; r < e; r++) {
|
|
233
|
+
const f = t[r], p = r > 0 ? t[r - 1] : "";
|
|
234
|
+
(f === '"' || f === "'") && p !== "\\" && (l ? f === u && (l = !1, u = null) : (l = !0, u = f));
|
|
251
235
|
}
|
|
252
236
|
return l;
|
|
253
237
|
}
|
|
254
|
-
function
|
|
255
|
-
|
|
256
|
-
const e = ((o = i.value) == null ? void 0 : o.selectionStart) ?? O.value, t = u.value;
|
|
238
|
+
function Ue() {
|
|
239
|
+
const e = o.value?.selectionStart ?? K.value, t = s.value;
|
|
257
240
|
if (e === 0) return !1;
|
|
258
241
|
const l = t[e - 1];
|
|
259
|
-
return l !== '"' && l !== "'" ? !1 : !
|
|
242
|
+
return l !== '"' && l !== "'" ? !1 : !me();
|
|
260
243
|
}
|
|
261
|
-
function
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
const e = ((p = i.value) == null ? void 0 : p.selectionStart) ?? O.value, t = u.value, l = t[e];
|
|
244
|
+
function je() {
|
|
245
|
+
j = Date.now();
|
|
246
|
+
const e = o.value?.selectionStart ?? K.value, t = s.value, l = t[e];
|
|
265
247
|
if (l === " " || l === `
|
|
266
248
|
` || l === " ") {
|
|
267
|
-
const
|
|
268
|
-
|
|
249
|
+
const p = e + 1;
|
|
250
|
+
o.value && (o.value.setSelectionRange(p, p), C(p));
|
|
269
251
|
return;
|
|
270
252
|
}
|
|
271
|
-
const
|
|
272
|
-
|
|
273
|
-
if (
|
|
274
|
-
const
|
|
275
|
-
|
|
253
|
+
const u = t.substring(0, e), r = t.substring(e), f = u + " " + r;
|
|
254
|
+
s.value = f, b("update:modelValue", f), S(() => {
|
|
255
|
+
if (o.value) {
|
|
256
|
+
const p = e + 1;
|
|
257
|
+
o.value.setSelectionRange(p, p), C(p);
|
|
276
258
|
}
|
|
277
259
|
});
|
|
278
260
|
}
|
|
279
|
-
function
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
i.value && (i.value.setSelectionRange(p, p), S(p));
|
|
261
|
+
function We() {
|
|
262
|
+
j = Date.now();
|
|
263
|
+
const e = o.value?.selectionStart ?? K.value, t = s.value;
|
|
264
|
+
for (let l = e; l < t.length; l++)
|
|
265
|
+
if (t[l] === '"' || t[l] === "'") {
|
|
266
|
+
const u = l + 1, r = t[u];
|
|
267
|
+
if (r && r !== " " && r !== `
|
|
268
|
+
` && r !== " ")
|
|
269
|
+
o.value && (o.value.setSelectionRange(u, u), C(u));
|
|
270
|
+
else if (!r || r === " " || r === `
|
|
271
|
+
` || r === " ")
|
|
272
|
+
if (r) {
|
|
273
|
+
const f = u + 1;
|
|
274
|
+
o.value && (o.value.setSelectionRange(f, f), C(f));
|
|
294
275
|
} else {
|
|
295
|
-
const
|
|
296
|
-
|
|
297
|
-
if (
|
|
298
|
-
const
|
|
299
|
-
|
|
276
|
+
const f = t + " ";
|
|
277
|
+
s.value = f, b("update:modelValue", f), S(() => {
|
|
278
|
+
if (o.value) {
|
|
279
|
+
const p = u + 1;
|
|
280
|
+
o.value.setSelectionRange(p, p), C(p);
|
|
300
281
|
}
|
|
301
282
|
});
|
|
302
283
|
}
|
|
303
284
|
return;
|
|
304
285
|
}
|
|
305
286
|
}
|
|
306
|
-
function
|
|
307
|
-
|
|
287
|
+
function ye() {
|
|
288
|
+
k.value = !0, L.value = !1, N.value = Date.now(), S(() => {
|
|
308
289
|
X(), ae();
|
|
309
290
|
});
|
|
310
291
|
}
|
|
311
|
-
function
|
|
312
|
-
|
|
313
|
-
if (l != null && l.closest(".tql-autocomplete-dropdown")) {
|
|
292
|
+
function ge(e) {
|
|
293
|
+
if (e.relatedTarget?.closest(".tql-autocomplete-dropdown")) {
|
|
314
294
|
setTimeout(() => {
|
|
315
|
-
|
|
295
|
+
k.value || (G(), y.value = !1);
|
|
316
296
|
}, 300);
|
|
317
297
|
return;
|
|
318
298
|
}
|
|
319
|
-
|
|
320
|
-
|
|
299
|
+
k.value = !1, setTimeout(() => {
|
|
300
|
+
k.value || (G(), y.value = !1);
|
|
321
301
|
}, 200);
|
|
322
302
|
}
|
|
323
|
-
function
|
|
324
|
-
|
|
325
|
-
const t =
|
|
326
|
-
|
|
327
|
-
|
|
303
|
+
function Ge(e) {
|
|
304
|
+
j = Date.now();
|
|
305
|
+
const t = Ie(e);
|
|
306
|
+
s.value = t.query, b("update:modelValue", t.query), t.placeholders.length > 0 ? (z.value = t.placeholders, E.value = 0) : ie(), S(() => {
|
|
307
|
+
o.value && (o.value.focus(), o.value.setSelectionRange(t.newCursorPosition, t.newCursorPosition), C(t.newCursorPosition), ae());
|
|
328
308
|
});
|
|
329
309
|
}
|
|
330
|
-
function
|
|
331
|
-
const t =
|
|
332
|
-
|
|
333
|
-
|
|
310
|
+
function Je(e) {
|
|
311
|
+
const t = Ee(e);
|
|
312
|
+
s.value = t, b("update:modelValue", t), S(() => {
|
|
313
|
+
o.value && o.value.focus();
|
|
334
314
|
});
|
|
335
315
|
}
|
|
336
|
-
function
|
|
337
|
-
|
|
338
|
-
(e = i.value) == null || e.focus();
|
|
316
|
+
function Xe() {
|
|
317
|
+
o.value?.focus();
|
|
339
318
|
}
|
|
340
|
-
function
|
|
341
|
-
|
|
342
|
-
(e = i.value) == null || e.blur();
|
|
319
|
+
function Ye() {
|
|
320
|
+
o.value?.blur();
|
|
343
321
|
}
|
|
344
|
-
function
|
|
345
|
-
|
|
346
|
-
return ((e = i.value) == null ? void 0 : e.selectionStart) || 0;
|
|
322
|
+
function we() {
|
|
323
|
+
return o.value?.selectionStart || 0;
|
|
347
324
|
}
|
|
348
|
-
function
|
|
349
|
-
|
|
325
|
+
function be(e) {
|
|
326
|
+
o.value && (o.value.setSelectionRange(e, e), C(e));
|
|
350
327
|
}
|
|
351
|
-
function
|
|
352
|
-
const t =
|
|
353
|
-
|
|
354
|
-
|
|
328
|
+
function Ze(e) {
|
|
329
|
+
const t = we(), l = s.value.substring(0, t), u = s.value.substring(t), r = l + e + u;
|
|
330
|
+
s.value = r, b("update:modelValue", r), S(() => {
|
|
331
|
+
be(t + e.length);
|
|
355
332
|
});
|
|
356
333
|
}
|
|
357
|
-
function
|
|
358
|
-
const l = Date.now() - e,
|
|
359
|
-
return p > 0 ? `${p}d ago` :
|
|
334
|
+
function _e(e) {
|
|
335
|
+
const l = Date.now() - e, u = Math.floor(l / 1e3), r = Math.floor(u / 60), f = Math.floor(r / 60), p = Math.floor(f / 24);
|
|
336
|
+
return p > 0 ? `${p}d ago` : f > 0 ? `${f}h ago` : r > 0 ? `${r}m ago` : "just now";
|
|
360
337
|
}
|
|
361
|
-
function
|
|
362
|
-
var l;
|
|
338
|
+
function qe(e) {
|
|
363
339
|
const t = e.target;
|
|
364
|
-
|
|
340
|
+
q.value?.contains(t) || (V.value = !1, D.value = !1);
|
|
365
341
|
}
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
342
|
+
Ce({
|
|
343
|
+
// Methods
|
|
344
|
+
focus: Xe,
|
|
345
|
+
blur: Ye,
|
|
346
|
+
validate: $e,
|
|
347
|
+
insertText: Ze,
|
|
348
|
+
insertSnippet: Je,
|
|
349
|
+
getTokenAtPosition: He,
|
|
350
|
+
getCursorPosition: we,
|
|
351
|
+
setCursorPosition: be,
|
|
352
|
+
// Reactive state for form validation
|
|
353
|
+
isValid: W,
|
|
354
|
+
hasErrors: T,
|
|
355
|
+
errors: R
|
|
375
356
|
});
|
|
376
357
|
function Z() {
|
|
377
|
-
(
|
|
358
|
+
(x.value || T.value) && k.value && X();
|
|
378
359
|
}
|
|
379
|
-
return
|
|
380
|
-
document.addEventListener("selectionchange", Y), document.addEventListener("click",
|
|
381
|
-
|
|
382
|
-
}, 500),
|
|
360
|
+
return tt(() => {
|
|
361
|
+
document.addEventListener("selectionchange", Y), document.addEventListener("click", qe), window.addEventListener("scroll", Z, !0), window.addEventListener("resize", Z), v.minHeight && q.value && q.value.style.setProperty("--tql-min-height", v.minHeight), U = setInterval(() => {
|
|
362
|
+
k.value && N.value > 0 && Date.now() - N.value >= Qt && !L.value && (L.value = !0);
|
|
363
|
+
}, 500), S(() => {
|
|
383
364
|
X();
|
|
384
365
|
});
|
|
385
366
|
}), ee(
|
|
386
|
-
() =>
|
|
367
|
+
() => T.value,
|
|
387
368
|
(e) => {
|
|
388
|
-
e &&
|
|
369
|
+
e && S(() => {
|
|
389
370
|
X();
|
|
390
371
|
});
|
|
391
372
|
},
|
|
392
373
|
{ immediate: !0 }
|
|
393
374
|
), ee(
|
|
394
|
-
|
|
375
|
+
B,
|
|
395
376
|
(e) => {
|
|
396
|
-
if (e &&
|
|
397
|
-
const t =
|
|
377
|
+
if (e && q.value) {
|
|
378
|
+
const t = q.value.getBoundingClientRect();
|
|
398
379
|
e.style.setProperty("--tql-msg-top", `${t.bottom + 4}px`), e.style.setProperty("--tql-msg-left", `${t.left}px`), e.style.setProperty("--tql-msg-width", `${t.width}px`);
|
|
399
380
|
}
|
|
400
381
|
}
|
|
401
|
-
),
|
|
402
|
-
document.removeEventListener("selectionchange", Y), document.removeEventListener("click",
|
|
403
|
-
}), (e, t) => (a(),
|
|
382
|
+
), lt(() => {
|
|
383
|
+
document.removeEventListener("selectionchange", Y), document.removeEventListener("click", qe), window.removeEventListener("scroll", Z, !0), window.removeEventListener("resize", Z), U && (clearInterval(U), U = null);
|
|
384
|
+
}), (e, t) => (a(), n("div", {
|
|
404
385
|
ref_key: "wrapperRef",
|
|
405
|
-
ref:
|
|
406
|
-
class:
|
|
386
|
+
ref: q,
|
|
387
|
+
class: P([
|
|
407
388
|
"tql-input-wrapper",
|
|
408
389
|
{
|
|
409
|
-
"tql-input-focused":
|
|
410
|
-
"tql-input-invalid":
|
|
411
|
-
"tql-input-
|
|
412
|
-
"tql-input-
|
|
413
|
-
"tql-input-
|
|
414
|
-
"tql-input-
|
|
415
|
-
"tql-input-
|
|
416
|
-
"tql-input-resizable": n.resizable && n.multiline,
|
|
417
|
-
"tql-input-has-min-height": !!n.minHeight
|
|
390
|
+
"tql-input-focused": k.value,
|
|
391
|
+
"tql-input-invalid": c(T) && i.showValidation,
|
|
392
|
+
"tql-input-disabled": i.disabled,
|
|
393
|
+
"tql-input-multiline": i.multiline,
|
|
394
|
+
"tql-input-autocomplete-active": c(x),
|
|
395
|
+
"tql-input-resizable": i.resizable && i.multiline,
|
|
396
|
+
"tql-input-has-min-height": !!i.minHeight
|
|
418
397
|
}
|
|
419
398
|
])
|
|
420
399
|
}, [
|
|
421
|
-
|
|
422
|
-
(a(!0),
|
|
423
|
-
key:
|
|
424
|
-
class:
|
|
425
|
-
},
|
|
400
|
+
i.syntaxHighlighting ? (a(), n("div", ct, [
|
|
401
|
+
(a(!0), n(M, null, F(c(Te), (l, u) => (a(), n("span", {
|
|
402
|
+
key: u,
|
|
403
|
+
class: P(Fe(l))
|
|
404
|
+
}, w(l.raw || l.value), 3))), 128))
|
|
426
405
|
])) : m("", !0),
|
|
427
|
-
|
|
406
|
+
i.multiline ? ne((a(), n("textarea", {
|
|
428
407
|
key: 1,
|
|
429
|
-
id:
|
|
408
|
+
id: ue,
|
|
430
409
|
ref_key: "inputRef",
|
|
431
|
-
ref:
|
|
432
|
-
"onUpdate:modelValue": t[0] || (t[0] = (l) =>
|
|
433
|
-
class:
|
|
434
|
-
placeholder:
|
|
435
|
-
disabled:
|
|
436
|
-
readonly:
|
|
437
|
-
rows:
|
|
410
|
+
ref: o,
|
|
411
|
+
"onUpdate:modelValue": t[0] || (t[0] = (l) => s.value = l),
|
|
412
|
+
class: P(["tql-input", { "tql-input-highlighted": i.syntaxHighlighting, "tql-input-resizable-textarea": i.resizable }]),
|
|
413
|
+
placeholder: i.placeholder,
|
|
414
|
+
disabled: i.disabled,
|
|
415
|
+
readonly: i.readonly,
|
|
416
|
+
rows: i.rows,
|
|
438
417
|
role: "combobox",
|
|
439
|
-
"aria-expanded":
|
|
418
|
+
"aria-expanded": c(x) && k.value,
|
|
440
419
|
"aria-controls": le,
|
|
441
|
-
"aria-invalid":
|
|
442
|
-
"aria-describedby":
|
|
420
|
+
"aria-invalid": c(T) && i.showValidation,
|
|
421
|
+
"aria-describedby": c(T) && y.value ? oe : void 0,
|
|
443
422
|
"aria-autocomplete": "list",
|
|
444
423
|
"aria-haspopup": "listbox",
|
|
445
424
|
spellcheck: "false",
|
|
446
425
|
autocomplete: "off",
|
|
447
426
|
autocapitalize: "off",
|
|
448
|
-
onInput:
|
|
449
|
-
onKeydown:
|
|
450
|
-
onFocus:
|
|
451
|
-
onBlur:
|
|
427
|
+
onInput: pe,
|
|
428
|
+
onKeydown: he,
|
|
429
|
+
onFocus: ye,
|
|
430
|
+
onBlur: ge,
|
|
452
431
|
onClick: Y
|
|
453
|
-
}, null, 42,
|
|
454
|
-
[
|
|
455
|
-
]) :
|
|
432
|
+
}, null, 42, dt)), [
|
|
433
|
+
[se, s.value]
|
|
434
|
+
]) : ne((a(), n("input", {
|
|
456
435
|
key: 2,
|
|
457
|
-
id:
|
|
436
|
+
id: ue,
|
|
458
437
|
ref_key: "inputRef",
|
|
459
|
-
ref:
|
|
460
|
-
"onUpdate:modelValue": t[1] || (t[1] = (l) =>
|
|
438
|
+
ref: o,
|
|
439
|
+
"onUpdate:modelValue": t[1] || (t[1] = (l) => s.value = l),
|
|
461
440
|
type: "text",
|
|
462
|
-
class:
|
|
463
|
-
placeholder:
|
|
464
|
-
disabled:
|
|
465
|
-
readonly:
|
|
441
|
+
class: P(["tql-input", { "tql-input-highlighted": i.syntaxHighlighting }]),
|
|
442
|
+
placeholder: i.placeholder,
|
|
443
|
+
disabled: i.disabled,
|
|
444
|
+
readonly: i.readonly,
|
|
466
445
|
role: "combobox",
|
|
467
|
-
"aria-expanded":
|
|
446
|
+
"aria-expanded": c(x) && k.value,
|
|
468
447
|
"aria-controls": le,
|
|
469
|
-
"aria-invalid":
|
|
470
|
-
"aria-describedby":
|
|
448
|
+
"aria-invalid": c(T) && i.showValidation,
|
|
449
|
+
"aria-describedby": c(T) && y.value ? oe : void 0,
|
|
471
450
|
"aria-autocomplete": "list",
|
|
472
451
|
"aria-haspopup": "listbox",
|
|
473
452
|
spellcheck: "false",
|
|
474
453
|
autocomplete: "off",
|
|
475
454
|
autocapitalize: "off",
|
|
476
|
-
onInput:
|
|
477
|
-
onKeydown:
|
|
478
|
-
onFocus:
|
|
479
|
-
onBlur:
|
|
455
|
+
onInput: pe,
|
|
456
|
+
onKeydown: he,
|
|
457
|
+
onFocus: ye,
|
|
458
|
+
onBlur: ge,
|
|
480
459
|
onClick: Y
|
|
481
|
-
}, null, 42,
|
|
482
|
-
[
|
|
460
|
+
}, null, 42, vt)), [
|
|
461
|
+
[se, s.value]
|
|
483
462
|
]),
|
|
484
|
-
|
|
485
|
-
|
|
463
|
+
d("div", ft, [
|
|
464
|
+
i.showComplexity && g.value && s.value.trim() ? (a(), n("div", {
|
|
486
465
|
key: 0,
|
|
487
|
-
class:
|
|
488
|
-
title: `${
|
|
466
|
+
class: P(["tql-complexity-badge", Be.value]),
|
|
467
|
+
title: `${ce.value} complexity - ${g.value.warnings.length} warning(s)`
|
|
489
468
|
}, [
|
|
490
|
-
|
|
491
|
-
g.value.warnings.length > 0 ? (a(),
|
|
492
|
-
], 10,
|
|
493
|
-
|
|
469
|
+
d("span", ht, w(ce.value), 1),
|
|
470
|
+
g.value.warnings.length > 0 ? (a(), n("span", mt, w(g.value.warnings.length), 1)) : m("", !0)
|
|
471
|
+
], 10, pt)) : m("", !0),
|
|
472
|
+
i.showHistory ? (a(), n("button", {
|
|
494
473
|
key: 1,
|
|
495
474
|
type: "button",
|
|
496
|
-
class:
|
|
475
|
+
class: P(["tql-toolbar-button", { "tql-toolbar-button--active": V.value }]),
|
|
497
476
|
title: "Query history",
|
|
498
|
-
onClick:
|
|
477
|
+
onClick: Q(Ae, ["stop"])
|
|
499
478
|
}, [...t[10] || (t[10] = [
|
|
500
|
-
|
|
479
|
+
d("i", { class: "pi pi-history" }, null, -1)
|
|
501
480
|
])], 2)) : m("", !0),
|
|
502
|
-
|
|
481
|
+
i.showPreview ? (a(), n("button", {
|
|
503
482
|
key: 2,
|
|
504
483
|
type: "button",
|
|
505
|
-
class:
|
|
484
|
+
class: P(["tql-toolbar-button", { "tql-toolbar-button--active": D.value }]),
|
|
506
485
|
title: "Preview query structure",
|
|
507
|
-
onClick:
|
|
486
|
+
onClick: Q(Le, ["stop"])
|
|
508
487
|
}, [...t[11] || (t[11] = [
|
|
509
|
-
|
|
488
|
+
d("i", { class: "pi pi-sitemap" }, null, -1)
|
|
510
489
|
])], 2)) : m("", !0),
|
|
511
|
-
|
|
490
|
+
i.showSnippetButton && i.snippets && i.snippets.length > 0 ? (a(), n("button", {
|
|
512
491
|
key: 3,
|
|
513
492
|
type: "button",
|
|
514
493
|
class: "tql-toolbar-button tql-snippet-button",
|
|
515
494
|
title: "Insert snippet",
|
|
516
|
-
onClick: t[2] || (t[2] =
|
|
495
|
+
onClick: t[2] || (t[2] = Q(() => {
|
|
517
496
|
}, ["stop"]))
|
|
518
497
|
}, [...t[12] || (t[12] = [
|
|
519
|
-
|
|
498
|
+
d("i", { class: "pi pi-code" }, null, -1)
|
|
520
499
|
])])) : m("", !0),
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
key:
|
|
524
|
-
class: "pi pi-clock tql-slow-indicator",
|
|
525
|
-
title: "This query uses enrichment mutators (geo, nslookup) which require post-processing and may be slower"
|
|
526
|
-
})) : m("", !0),
|
|
527
|
-
r(ie) && queryState.value !== "slow" ? (a(), s("i", { key: 1, class: "pi pi-check-circle tql-icon-valid", "aria-label": "Query is valid" })) : queryState.value === "slow" && r(ie) ? (a(), s("i", { key: 2, class: "pi pi-check-circle tql-icon-valid", "aria-label": "Query is valid (with enrichment)" })) : (a(), s("i", {
|
|
528
|
-
key: 3,
|
|
500
|
+
i.showValidation && s.value ? (a(), n("div", yt, [
|
|
501
|
+
c(W) ? (a(), n("i", gt)) : (a(), n("i", {
|
|
502
|
+
key: 1,
|
|
529
503
|
class: "pi pi-exclamation-circle tql-icon-invalid tql-icon-clickable",
|
|
530
504
|
role: "button",
|
|
531
505
|
tabindex: "0",
|
|
532
506
|
title: "Click to show/hide errors",
|
|
533
|
-
"aria-label": `Query has ${
|
|
507
|
+
"aria-label": `Query has ${c(R).length} error${c(R).length === 1 ? "" : "s"}. Click to ${y.value ? "hide" : "show"} details.`,
|
|
534
508
|
"aria-expanded": y.value,
|
|
535
509
|
onClick: t[3] || (t[3] = (l) => y.value = !y.value),
|
|
536
510
|
onKeydown: [
|
|
537
|
-
t[4] || (t[4] =
|
|
538
|
-
t[5] || (t[5] =
|
|
511
|
+
t[4] || (t[4] = ke((l) => y.value = !y.value, ["enter"])),
|
|
512
|
+
t[5] || (t[5] = ke(Q((l) => y.value = !y.value, ["prevent"]), ["space"]))
|
|
539
513
|
]
|
|
540
|
-
}, null, 40,
|
|
514
|
+
}, null, 40, wt))
|
|
541
515
|
])) : m("", !0)
|
|
542
516
|
]),
|
|
543
|
-
|
|
517
|
+
i.showHistory && V.value ? (a(), n("div", {
|
|
544
518
|
key: 3,
|
|
545
519
|
class: "tql-history-dropdown",
|
|
546
|
-
onClick: t[8] || (t[8] =
|
|
520
|
+
onClick: t[8] || (t[8] = Q(() => {
|
|
547
521
|
}, ["stop"]))
|
|
548
522
|
}, [
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
"onUpdate:modelValue": t[6] || (t[6] = (l) =>
|
|
523
|
+
d("div", bt, [
|
|
524
|
+
ne(d("input", {
|
|
525
|
+
"onUpdate:modelValue": t[6] || (t[6] = (l) => I.value = l),
|
|
552
526
|
type: "text",
|
|
553
527
|
class: "tql-history-search",
|
|
554
528
|
placeholder: "Search history...",
|
|
555
|
-
onKeydown: t[7] || (t[7] =
|
|
529
|
+
onKeydown: t[7] || (t[7] = Q(() => {
|
|
556
530
|
}, ["stop"]))
|
|
557
531
|
}, null, 544), [
|
|
558
|
-
[
|
|
532
|
+
[se, I.value]
|
|
559
533
|
])
|
|
560
534
|
]),
|
|
561
|
-
|
|
562
|
-
(a(!0),
|
|
535
|
+
d("div", qt, [
|
|
536
|
+
(a(!0), n(M, null, F(de.value, (l) => (a(), n("div", {
|
|
563
537
|
key: l.id,
|
|
564
|
-
class:
|
|
565
|
-
onClick: (
|
|
538
|
+
class: P(["tql-history-item", { "tql-history-item--favorite": l.isFavorite }]),
|
|
539
|
+
onClick: (u) => Me(l)
|
|
566
540
|
}, [
|
|
567
|
-
|
|
541
|
+
d("button", {
|
|
568
542
|
type: "button",
|
|
569
543
|
class: "tql-history-favorite",
|
|
570
544
|
title: l.isFavorite ? "Remove from favorites" : "Add to favorites",
|
|
571
|
-
onClick: (
|
|
545
|
+
onClick: (u) => Qe(l, u)
|
|
572
546
|
}, [
|
|
573
|
-
|
|
574
|
-
class:
|
|
547
|
+
d("i", {
|
|
548
|
+
class: P(l.isFavorite ? "pi pi-star-fill" : "pi pi-star")
|
|
575
549
|
}, null, 2)
|
|
576
|
-
], 8,
|
|
577
|
-
|
|
578
|
-
l.label ? (a(),
|
|
579
|
-
|
|
550
|
+
], 8, xt),
|
|
551
|
+
d("div", Ct, [
|
|
552
|
+
l.label ? (a(), n("div", St, w(l.label), 1)) : m("", !0),
|
|
553
|
+
d("div", Pt, w(l.query), 1)
|
|
580
554
|
]),
|
|
581
|
-
|
|
582
|
-
], 10,
|
|
583
|
-
|
|
555
|
+
d("div", Vt, w(_e(l.timestamp)), 1)
|
|
556
|
+
], 10, kt))), 128)),
|
|
557
|
+
de.value.length === 0 ? (a(), n("div", Dt, w(I.value ? "No matching queries" : "No query history"), 1)) : m("", !0)
|
|
584
558
|
])
|
|
585
559
|
])) : m("", !0),
|
|
586
|
-
|
|
560
|
+
xe(it, {
|
|
587
561
|
id: le,
|
|
588
562
|
ref_key: "autocompleteRef",
|
|
589
|
-
ref:
|
|
590
|
-
items:
|
|
591
|
-
visible:
|
|
563
|
+
ref: A,
|
|
564
|
+
items: c(O),
|
|
565
|
+
visible: c(x) && k.value && Ke.value,
|
|
592
566
|
position: J.value,
|
|
593
|
-
onSelect:
|
|
594
|
-
onClose:
|
|
567
|
+
onSelect: Ge,
|
|
568
|
+
onClose: c(G)
|
|
595
569
|
}, null, 8, ["items", "visible", "position", "onClose"]),
|
|
596
|
-
(a(),
|
|
597
|
-
|
|
570
|
+
(a(), ot(at, { to: "body" }, [
|
|
571
|
+
i.showValidation && !c(W) && ze.value && s.value && c(R).length > 0 && !(c(x) && c(O).length > 0) && Oe.value ? (a(), n("div", {
|
|
598
572
|
key: 0,
|
|
599
573
|
ref_key: "validationMessagesRef",
|
|
600
|
-
ref:
|
|
574
|
+
ref: B,
|
|
601
575
|
id: oe,
|
|
602
576
|
class: "tql-validation-messages-portal",
|
|
603
577
|
role: "alert",
|
|
604
578
|
"aria-live": "polite"
|
|
605
579
|
}, [
|
|
606
|
-
(a(!0),
|
|
607
|
-
key:
|
|
580
|
+
(a(!0), n(M, null, F(c(R).slice(0, 3), (l, u) => (a(), n("div", {
|
|
581
|
+
key: u,
|
|
608
582
|
class: "tql-error-message"
|
|
609
583
|
}, [
|
|
610
|
-
t[13] || (t[13] =
|
|
584
|
+
t[13] || (t[13] = d("i", {
|
|
611
585
|
class: "pi pi-exclamation-triangle",
|
|
612
586
|
"aria-hidden": "true"
|
|
613
587
|
}, null, -1)),
|
|
614
|
-
|
|
615
|
-
l.suggestion ? (a(),
|
|
588
|
+
d("span", null, w(l.message), 1),
|
|
589
|
+
l.suggestion ? (a(), n("span", Rt, w(l.suggestion), 1)) : m("", !0)
|
|
616
590
|
]))), 128))
|
|
617
591
|
], 512)) : m("", !0)
|
|
618
592
|
])),
|
|
619
|
-
|
|
620
|
-
(a(!0),
|
|
621
|
-
key:
|
|
622
|
-
class:
|
|
593
|
+
i.showComplexity && g.value && g.value.warnings.length > 0 && !c(x) ? (a(), n("div", Tt, [
|
|
594
|
+
(a(!0), n(M, null, F(g.value.warnings.slice(0, 3), (l, u) => (a(), n("div", {
|
|
595
|
+
key: u,
|
|
596
|
+
class: P(["tql-complexity-warning", `tql-complexity-warning--${l.severity}`])
|
|
623
597
|
}, [
|
|
624
|
-
t[14] || (t[14] =
|
|
598
|
+
t[14] || (t[14] = d("i", {
|
|
625
599
|
class: "pi pi-info-circle",
|
|
626
600
|
"aria-hidden": "true"
|
|
627
601
|
}, null, -1)),
|
|
628
|
-
|
|
602
|
+
d("span", null, w(l.message), 1)
|
|
629
603
|
], 2))), 128)),
|
|
630
|
-
g.value.suggestions.length > 0 ? (a(),
|
|
631
|
-
(a(!0),
|
|
632
|
-
key:
|
|
604
|
+
g.value.suggestions.length > 0 ? (a(), n("div", $t, [
|
|
605
|
+
(a(!0), n(M, null, F(g.value.suggestions.slice(0, 2), (l, u) => (a(), n("div", {
|
|
606
|
+
key: u,
|
|
633
607
|
class: "tql-complexity-suggestion"
|
|
634
608
|
}, [
|
|
635
|
-
t[15] || (t[15] =
|
|
609
|
+
t[15] || (t[15] = d("i", {
|
|
636
610
|
class: "pi pi-lightbulb",
|
|
637
611
|
"aria-hidden": "true"
|
|
638
612
|
}, null, -1)),
|
|
639
|
-
|
|
613
|
+
d("span", null, w(l), 1)
|
|
640
614
|
]))), 128))
|
|
641
615
|
])) : m("", !0)
|
|
642
616
|
])) : m("", !0),
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
t[17] || (t[17] =
|
|
646
|
-
|
|
617
|
+
i.showPreview && D.value && s.value.trim() ? (a(), n("div", It, [
|
|
618
|
+
d("div", Et, [
|
|
619
|
+
t[17] || (t[17] = d("span", null, "Query Structure", -1)),
|
|
620
|
+
d("button", {
|
|
647
621
|
type: "button",
|
|
648
622
|
class: "tql-preview-close",
|
|
649
623
|
title: "Close preview",
|
|
650
|
-
onClick: t[9] || (t[9] = (l) =>
|
|
624
|
+
onClick: t[9] || (t[9] = (l) => D.value = !1)
|
|
651
625
|
}, [...t[16] || (t[16] = [
|
|
652
|
-
|
|
626
|
+
d("i", { class: "pi pi-times" }, null, -1)
|
|
653
627
|
])])
|
|
654
628
|
]),
|
|
655
|
-
|
|
656
|
-
query:
|
|
629
|
+
xe(nt, {
|
|
630
|
+
query: s.value,
|
|
657
631
|
"show-complexity": !1,
|
|
658
632
|
"show-field-usage": !0,
|
|
659
633
|
"show-logic-tree": !0,
|
|
660
634
|
compact: ""
|
|
661
635
|
}, null, 8, ["query"])
|
|
662
636
|
])) : m("", !0),
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
637
|
+
d("div", Ht, [
|
|
638
|
+
i.showValidation && s.value ? (a(), n(M, { key: 0 }, [
|
|
639
|
+
c(W) ? (a(), n("span", Bt, "Query syntax is valid")) : (a(), n("span", Mt, "Query has " + w(c(R).length) + " validation error" + w(c(R).length === 1 ? "" : "s"), 1))
|
|
666
640
|
], 64)) : m("", !0)
|
|
667
641
|
])
|
|
668
642
|
], 2));
|
|
669
643
|
}
|
|
670
644
|
});
|
|
671
645
|
export {
|
|
672
|
-
|
|
646
|
+
Nt as default
|
|
673
647
|
};
|