@tellaro/tql 0.1.6 → 0.1.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/dist/src/completionProvider.js +19 -17
- package/dist/style.css +1 -1
- package/dist/vue/TqlInput.vue.js +1 -1
- package/dist/vue/TqlInput.vue2.js +367 -322
- package/package.json +1 -1
|
@@ -274,11 +274,11 @@ function B(e, t, a) {
|
|
|
274
274
|
return v.set(o, n), n;
|
|
275
275
|
}
|
|
276
276
|
function G(e, t, a) {
|
|
277
|
-
var
|
|
277
|
+
var u;
|
|
278
278
|
const i = b(e.substring(0, t)).filter((l) => l.type !== "whitespace");
|
|
279
279
|
if (i.length === 0)
|
|
280
280
|
return { type: "start" };
|
|
281
|
-
const n = i[i.length - 1], r = i.length > 1 ? i[i.length - 2] : null,
|
|
281
|
+
const n = i[i.length - 1], r = i.length > 1 ? i[i.length - 2] : null, d = n.end === t && !((u = e[t - 1]) != null && u.match(/\s/)), s = d ? n.value : void 0;
|
|
282
282
|
if (n.type === "logicalOp")
|
|
283
283
|
return { type: "start" };
|
|
284
284
|
if (n.type === "paren" && n.value === "(")
|
|
@@ -287,9 +287,9 @@ function G(e, t, a) {
|
|
|
287
287
|
return { type: "after_arrow", partialText: s };
|
|
288
288
|
if (n.type === "doubleColon")
|
|
289
289
|
return { type: "after_double_colon", partialText: s };
|
|
290
|
-
if (n.type === "visualization" &&
|
|
290
|
+
if (n.type === "visualization" && d)
|
|
291
291
|
return { type: "after_arrow", partialText: s };
|
|
292
|
-
if (n.type === "typeHint" &&
|
|
292
|
+
if (n.type === "typeHint" && d)
|
|
293
293
|
return { type: "after_double_colon", partialText: s };
|
|
294
294
|
if (n.type === "keyword" && n.value.toLowerCase() === "stats")
|
|
295
295
|
return { type: "after_stats", partialText: s };
|
|
@@ -298,7 +298,7 @@ function G(e, t, a) {
|
|
|
298
298
|
if (n.type === "pipe")
|
|
299
299
|
return { type: "after_pipe", partialText: s };
|
|
300
300
|
if (n.type === "mutator") {
|
|
301
|
-
if (
|
|
301
|
+
if (d)
|
|
302
302
|
return { type: "after_pipe", partialText: s };
|
|
303
303
|
const l = n.value.toLowerCase(), c = h[l];
|
|
304
304
|
return {
|
|
@@ -308,9 +308,9 @@ function G(e, t, a) {
|
|
|
308
308
|
};
|
|
309
309
|
}
|
|
310
310
|
if (n.type === "aggregation")
|
|
311
|
-
return
|
|
311
|
+
return d ? { type: "after_stats", partialText: s } : { type: "after_value" };
|
|
312
312
|
if (n.type === "field") {
|
|
313
|
-
if (
|
|
313
|
+
if (d)
|
|
314
314
|
return (r == null ? void 0 : r.type) === "pipe" ? { type: "after_pipe", partialText: s } : { type: "start", partialText: s };
|
|
315
315
|
if ((r == null ? void 0 : r.type) === "pipe")
|
|
316
316
|
return { type: "after_pipe", partialText: n.value };
|
|
@@ -318,7 +318,7 @@ function G(e, t, a) {
|
|
|
318
318
|
return { type: "after_field", fieldName: n.value, fieldType: l };
|
|
319
319
|
}
|
|
320
320
|
if (n.type === "operator") {
|
|
321
|
-
if (
|
|
321
|
+
if (d) {
|
|
322
322
|
if ((r == null ? void 0 : r.type) === "field") {
|
|
323
323
|
const l = f(r.value, a);
|
|
324
324
|
return { type: "after_field", fieldName: r.value, fieldType: l, partialText: s };
|
|
@@ -331,14 +331,14 @@ function G(e, t, a) {
|
|
|
331
331
|
return { type: "after_operator", operatorName: n.value };
|
|
332
332
|
}
|
|
333
333
|
if (n.type === "string" || n.type === "number" || n.type === "boolean" || n.type === "null")
|
|
334
|
-
return { type: "after_value" };
|
|
334
|
+
return d ? { type: "at_value_end" } : { type: "after_value" };
|
|
335
335
|
if (n.type === "paren" && n.value === ")")
|
|
336
336
|
return { type: "after_value" };
|
|
337
|
-
if ((r == null ? void 0 : r.type) === "field" &&
|
|
337
|
+
if ((r == null ? void 0 : r.type) === "field" && d) {
|
|
338
338
|
const l = f(r.value, a);
|
|
339
339
|
return { type: "after_field", fieldName: r.value, fieldType: l, partialText: s };
|
|
340
340
|
}
|
|
341
|
-
if ((r == null ? void 0 : r.type) === "mutator" &&
|
|
341
|
+
if ((r == null ? void 0 : r.type) === "mutator" && d) {
|
|
342
342
|
const l = r.value.toLowerCase(), c = h[l];
|
|
343
343
|
return { type: "after_mutator", mutatorName: l, mutatorOutputType: c, partialText: s };
|
|
344
344
|
}
|
|
@@ -366,6 +366,8 @@ function te(e, t = {}) {
|
|
|
366
366
|
case "after_value":
|
|
367
367
|
n.push(...C());
|
|
368
368
|
break;
|
|
369
|
+
case "at_value_end":
|
|
370
|
+
break;
|
|
369
371
|
case "after_pipe":
|
|
370
372
|
n.push(...K(i.partialText));
|
|
371
373
|
break;
|
|
@@ -386,13 +388,13 @@ function te(e, t = {}) {
|
|
|
386
388
|
}
|
|
387
389
|
t.includeAggregations && i.type === "start" && n.push(...O(i.partialText));
|
|
388
390
|
let r = n;
|
|
389
|
-
const
|
|
391
|
+
const d = t.fuzzyMatching !== !1, s = t.minFuzzyScore ?? 0;
|
|
390
392
|
if (i.partialText) {
|
|
391
|
-
const
|
|
392
|
-
if (
|
|
393
|
+
const u = i.partialText.toLowerCase();
|
|
394
|
+
if (d) {
|
|
393
395
|
const l = [];
|
|
394
396
|
for (const c of n) {
|
|
395
|
-
const m = _(
|
|
397
|
+
const m = _(u, c.label), w = c.filterText ? _(u, c.filterText) : { matched: !1, score: 0 }, g = m.score >= w.score ? m : w;
|
|
396
398
|
g.matched && g.score >= s && l.push({
|
|
397
399
|
...c,
|
|
398
400
|
matchScore: g.score,
|
|
@@ -404,11 +406,11 @@ function te(e, t = {}) {
|
|
|
404
406
|
r = n.filter(
|
|
405
407
|
(l) => {
|
|
406
408
|
var c;
|
|
407
|
-
return l.label.toLowerCase().includes(
|
|
409
|
+
return l.label.toLowerCase().includes(u) || ((c = l.filterText) == null ? void 0 : c.toLowerCase().includes(u));
|
|
408
410
|
}
|
|
409
411
|
);
|
|
410
412
|
}
|
|
411
|
-
return r.sort((
|
|
413
|
+
return r.sort((u, l) => u.matchScore !== void 0 && l.matchScore !== void 0 && l.matchScore !== u.matchScore ? l.matchScore - u.matchScore : u.sortOrder - l.sortOrder), t.maxItems && t.maxItems > 0 && (r = r.slice(0, t.maxItems)), r;
|
|
412
414
|
}
|
|
413
415
|
function y(e, t) {
|
|
414
416
|
if (!e || e.length === 0)
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.tql-autocomplete-dropdown[data-v-3df9a4be]{position:fixed;top:var(--dropdown-top);left:var(--dropdown-left);z-index:9999;min-width:280px;max-width:450px;max-height:var(--dropdown-max-height);background:var(--surface-overlay, #fff);border:1px solid var(--surface-border, #ddd);border-radius:var(--border-radius, 6px);box-shadow:0 4px 16px #00000026;overflow:hidden;display:flex;flex-direction:column}.tql-completion-list[data-v-3df9a4be]{overflow-y:auto;max-height:calc(var(--dropdown-max-height) - 60px)}.tql-completion-item[data-v-3df9a4be]{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;cursor:pointer;transition:background-color .15s}.tql-completion-item[data-v-3df9a4be]:hover,.tql-completion-item.selected[data-v-3df9a4be]{background:var(--highlight-bg, #f0f0f0)}.tql-completion-icon[data-v-3df9a4be]{display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;border-radius:4px;font-size:.75rem}.tql-completion-icon.tql-completion-kind-field[data-v-3df9a4be]{background:var(--blue-100, #e3f2fd);color:var(--blue-600, #1e88e5)}.tql-completion-icon.tql-completion-kind-operator[data-v-3df9a4be]{background:var(--pink-100, #fce4ec);color:var(--pink-600, #d81b60)}.tql-completion-icon.tql-completion-kind-value[data-v-3df9a4be]{background:var(--green-100, #e8f5e9);color:var(--green-600, #43a047)}.tql-completion-icon.tql-completion-kind-keyword[data-v-3df9a4be]{background:var(--purple-100, #f3e5f5);color:var(--purple-600, #8e24aa)}.tql-completion-icon.tql-completion-kind-snippet[data-v-3df9a4be]{background:var(--orange-100, #fff3e0);color:var(--orange-600, #fb8c00)}.tql-completion-icon.tql-completion-kind-mutator[data-v-3df9a4be]{background:var(--cyan-100, #e0f7fa);color:var(--cyan-600, #00acc1)}.tql-completion-icon.tql-completion-kind-aggregation[data-v-3df9a4be]{background:var(--indigo-100, #e8eaf6);color:var(--indigo-600, #3949ab)}.tql-completion-icon.tql-completion-kind-logicalOp[data-v-3df9a4be]{background:var(--yellow-100, #fffde7);color:var(--yellow-700, #fbc02d)}.tql-completion-icon.tql-completion-kind-typeHint[data-v-3df9a4be]{background:var(--teal-100, #e0f2f1);color:var(--teal-600, #00897b)}.tql-completion-icon.tql-completion-kind-visualization[data-v-3df9a4be]{background:var(--red-100, #ffebee);color:var(--red-600, #e53935)}.tql-completion-content[data-v-3df9a4be]{flex:1;display:flex;flex-direction:column;min-width:0}.tql-completion-label[data-v-3df9a4be]{font-family:Courier New,monospace;font-size:.875rem;font-weight:500;color:var(--text-color, #333);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tql-completion-detail[data-v-3df9a4be]{font-size:.75rem;color:var(--text-color-secondary, #666);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tql-completion-kind-badge[data-v-3df9a4be]{font-size:.625rem;padding:.125rem .375rem;background:var(--surface-100, #f5f5f5);border-radius:3px;color:var(--text-color-secondary, #666);text-transform:uppercase;letter-spacing:.025em}.tql-completion-docs[data-v-3df9a4be]{padding:.5rem .75rem;border-top:1px solid var(--surface-border, #ddd);background:var(--surface-50, #fafafa);font-size:.75rem;color:var(--text-color-secondary, #666);max-height:60px;overflow-y:auto}.tql-preview[data-v-bae811e6]{font-family:ui-monospace,monospace;font-size:13px;line-height:1.5;padding:12px;border:1px solid var(--tql-preview-border, #e0e0e0);border-radius:6px;background:var(--tql-preview-bg, #fafafa)}.tql-preview--compact[data-v-bae811e6]{padding:8px;font-size:12px}.tql-preview--empty[data-v-bae811e6]{color:var(--tql-preview-muted, #888)}.tql-preview__empty[data-v-bae811e6]{text-align:center;padding:20px}.tql-preview__complexity[data-v-bae811e6]{display:flex;align-items:center;gap:12px;margin-bottom:12px}.tql-preview__complexity-badge[data-v-bae811e6]{padding:2px 8px;border-radius:4px;font-size:11px;font-weight:600;text-transform:uppercase}.tql-preview--low .tql-preview__complexity-badge[data-v-bae811e6]{background:var(--tql-preview-low-bg, #e8f5e9);color:var(--tql-preview-low-text, #2e7d32)}.tql-preview--medium .tql-preview__complexity-badge[data-v-bae811e6]{background:var(--tql-preview-medium-bg, #fff3e0);color:var(--tql-preview-medium-text, #e65100)}.tql-preview--high .tql-preview__complexity-badge[data-v-bae811e6]{background:var(--tql-preview-high-bg, #ffebee);color:var(--tql-preview-high-text, #c62828)}.tql-preview__field-count[data-v-bae811e6]{color:var(--tql-preview-muted, #666);font-size:12px}.tql-preview__warnings[data-v-bae811e6]{margin-bottom:12px}.tql-preview__warning[data-v-bae811e6]{display:flex;align-items:flex-start;gap:8px;padding:6px 8px;border-radius:4px;margin-bottom:4px}.tql-preview__warning--info[data-v-bae811e6]{background:var(--tql-preview-info-bg, #e3f2fd);color:var(--tql-preview-info-text, #1565c0)}.tql-preview__warning--warning[data-v-bae811e6]{background:var(--tql-preview-warning-bg, #fff3e0);color:var(--tql-preview-warning-text, #e65100)}.tql-preview__warning--error[data-v-bae811e6]{background:var(--tql-preview-error-bg, #ffebee);color:var(--tql-preview-error-text, #c62828)}.tql-preview__warning-icon[data-v-bae811e6]{font-weight:700;width:16px;text-align:center}.tql-preview__warning-text[data-v-bae811e6]{flex:1}.tql-preview__suggestions[data-v-bae811e6]{margin-bottom:12px;padding:8px;background:var(--tql-preview-suggestion-bg, #f5f5f5);border-radius:4px}.tql-preview__suggestions-header[data-v-bae811e6]{font-weight:600;margin-bottom:4px;color:var(--tql-preview-header, #333)}.tql-preview__suggestions-list[data-v-bae811e6]{margin:0;padding-left:20px}.tql-preview__suggestion[data-v-bae811e6]{color:var(--tql-preview-muted, #666);margin:2px 0}.tql-preview__tree[data-v-bae811e6]{margin-bottom:12px}.tql-preview__tree-header[data-v-bae811e6],.tql-preview__fields-header[data-v-bae811e6],.tql-preview__operators-header[data-v-bae811e6]{font-weight:600;margin-bottom:8px;color:var(--tql-preview-header, #333);font-size:12px;text-transform:uppercase;letter-spacing:.5px}.tql-preview__tree-content[data-v-bae811e6]{border:1px solid var(--tql-preview-tree-border, #e0e0e0);border-radius:4px;background:var(--tql-preview-tree-bg, #fff);padding:8px}.tql-preview__node[data-v-bae811e6]{margin:2px 0}.tql-preview__node-content[data-v-bae811e6]{display:flex;align-items:center;gap:4px;padding:2px 4px;border-radius:3px;cursor:pointer}.tql-preview__node-content[data-v-bae811e6]:hover{background:var(--tql-preview-node-hover, #f0f0f0)}.tql-preview__node-toggle[data-v-bae811e6]{width:16px;height:16px;border:none;background:var(--tql-preview-toggle-bg, #e0e0e0);border-radius:3px;cursor:pointer;font-size:12px;line-height:1;display:flex;align-items:center;justify-content:center}.tql-preview__node-toggle[data-v-bae811e6]:hover{background:var(--tql-preview-toggle-hover, #d0d0d0)}.tql-preview__node-toggle--leaf[data-v-bae811e6]{visibility:hidden}.tql-preview__node-type[data-v-bae811e6]{font-weight:600;color:var(--tql-preview-node-type, #666)}.tql-preview__node--and .tql-preview__node-type[data-v-bae811e6]{color:var(--tql-preview-and, #1976d2)}.tql-preview__node--or .tql-preview__node-type[data-v-bae811e6]{color:var(--tql-preview-or, #7b1fa2)}.tql-preview__node--not .tql-preview__node-type[data-v-bae811e6]{color:var(--tql-preview-not, #c62828)}.tql-preview__node--group .tql-preview__node-type[data-v-bae811e6]{color:var(--tql-preview-group, #666)}.tql-preview__node-label[data-v-bae811e6]{flex:1}.tql-preview__fields-list[data-v-bae811e6]{display:flex;flex-direction:column;gap:4px}.tql-preview__field[data-v-bae811e6]{display:flex;align-items:center;gap:6px;padding:4px 8px;background:var(--tql-preview-field-bg, #fff);border:1px solid var(--tql-preview-field-border, #e0e0e0);border-radius:4px;cursor:pointer}.tql-preview__field[data-v-bae811e6]:hover{background:var(--tql-preview-field-hover, #f5f5f5)}.tql-preview__field-name[data-v-bae811e6]{font-weight:600;color:var(--tql-preview-field-name, #1976d2)}.tql-preview__field-mutators[data-v-bae811e6]{color:var(--tql-preview-mutator, #7b1fa2)}.tql-preview__field-operator[data-v-bae811e6]{color:var(--tql-preview-operator, #666)}.tql-preview__field-value[data-v-bae811e6]{color:var(--tql-preview-value, #2e7d32)}.tql-preview__match-type[data-v-bae811e6]{margin-left:auto;padding:1px 4px;border-radius:3px;font-size:10px;font-weight:600;background:var(--tql-preview-match-bg, #f0f0f0)}.tql-preview__match-type--exact[data-v-bae811e6]{background:var(--tql-preview-match-exact-bg, #e8f5e9);color:var(--tql-preview-match-exact, #2e7d32)}.tql-preview__match-type--wildcard[data-v-bae811e6]{background:var(--tql-preview-match-wildcard-bg, #fff3e0);color:var(--tql-preview-match-wildcard, #e65100)}.tql-preview__match-type--regex[data-v-bae811e6]{background:var(--tql-preview-match-regex-bg, #fce4ec);color:var(--tql-preview-match-regex, #c2185b)}.tql-preview__match-type--range[data-v-bae811e6]{background:var(--tql-preview-match-range-bg, #e3f2fd);color:var(--tql-preview-match-range, #1565c0)}.tql-preview__match-type--cidr[data-v-bae811e6]{background:var(--tql-preview-match-cidr-bg, #f3e5f5);color:var(--tql-preview-match-cidr, #7b1fa2)}.tql-preview__operators-list[data-v-bae811e6]{display:flex;flex-wrap:wrap;gap:8px}.tql-preview__operator[data-v-bae811e6]{padding:2px 6px;background:var(--tql-preview-op-bg, #f0f0f0);border-radius:3px;font-size:11px}.tql-input-wrapper[data-v-ab996cb5]{position:relative;display:flex;align-items:flex-start;border:1px solid var(--surface-border, #ddd);border-radius:var(--border-radius, 6px);background:var(--surface-ground, #fff);transition:border-color .2s,box-shadow .2s}.tql-input-wrapper.tql-input-has-min-height[data-v-ab996cb5],.tql-input-wrapper.tql-input-has-min-height .tql-input[data-v-ab996cb5]{min-height:var(--tql-min-height)}.tql-input-wrapper.tql-input-focused[data-v-ab996cb5]{border-color:var(--primary-color, #3b82f6);box-shadow:0 0 0 2px var(--primary-100, rgba(59, 130, 246, .2))}.tql-input-wrapper.tql-input-invalid[data-v-ab996cb5]{border-color:var(--red-500, #ef4444)}.tql-input-wrapper.tql-input-invalid.tql-input-focused[data-v-ab996cb5]{box-shadow:0 0 0 2px var(--red-100, rgba(239, 68, 68, .2))}.tql-input-wrapper.tql-input-disabled[data-v-ab996cb5]{opacity:.6;cursor:not-allowed}.tql-highlight-layer[data-v-ab996cb5]{position:absolute;top:0;left:0;right:0;bottom:0;padding:.5rem .75rem;pointer-events:none;white-space:pre-wrap;word-wrap:break-word;font-family:Courier New,monospace;font-size:.875rem;line-height:1.5;overflow:hidden}.tql-input-multiline .tql-highlight-layer[data-v-ab996cb5]{overflow-y:auto}.tql-input[data-v-ab996cb5]{flex:1;width:100%;padding:.5rem 8rem .5rem .75rem;border:none;background:transparent;font-family:Courier New,monospace;font-size:.875rem;line-height:1.5;color:var(--text-color, #333);outline:none;resize:none}.tql-input.tql-input-highlighted[data-v-ab996cb5]{color:transparent;caret-color:var(--text-color, #333)}.tql-input[data-v-ab996cb5]::placeholder{color:var(--text-color-secondary, #666);opacity:.7}.tql-input[data-v-ab996cb5]:disabled{cursor:not-allowed}.tql-token-field[data-v-ab996cb5]{color:var(--tql-field-color, var(--blue-600, #2563eb))}.tql-token-operator[data-v-ab996cb5]{color:var(--tql-operator-color, var(--pink-600, #db2777));font-weight:500}.tql-token-logicalOp[data-v-ab996cb5]{color:var(--tql-logical-color, var(--purple-600, #9333ea));font-weight:600}.tql-token-collectionOp[data-v-ab996cb5]{color:var(--tql-collection-color, var(--indigo-600, #4f46e5));font-weight:600}.tql-token-string[data-v-ab996cb5]{color:var(--tql-string-color, var(--green-600, #16a34a))}.tql-token-number[data-v-ab996cb5]{color:var(--tql-number-color, var(--orange-600, #ea580c))}.tql-token-boolean[data-v-ab996cb5]{color:var(--tql-boolean-color, var(--cyan-600, #0891b2))}.tql-token-null[data-v-ab996cb5]{color:var(--tql-null-color, var(--gray-500, #6b7280));font-style:italic}.tql-token-mutator[data-v-ab996cb5]{color:var(--tql-mutator-color, var(--teal-600, #0d9488));font-style:italic}.tql-token-aggregation[data-v-ab996cb5]{color:var(--tql-aggregation-color, var(--indigo-600, #4f46e5))}.tql-token-keyword[data-v-ab996cb5]{color:var(--tql-keyword-color, var(--purple-500, #a855f7))}.tql-token-typeHint[data-v-ab996cb5]{color:var(--tql-typehint-color, var(--teal-500, #14b8a6))}.tql-token-visualization[data-v-ab996cb5]{color:var(--tql-viz-color, var(--red-500, #ef4444))}.tql-token-arrow[data-v-ab996cb5]{color:var(--tql-arrow-color, var(--gray-600, #4b5563));font-weight:600}.tql-token-doubleColon[data-v-ab996cb5]{color:var(--tql-colon-color, var(--gray-500, #6b7280))}.tql-token-paren[data-v-ab996cb5],.tql-token-bracket[data-v-ab996cb5]{color:var(--tql-bracket-color, var(--gray-600, #4b5563))}.tql-token-error[data-v-ab996cb5]{color:var(--tql-error-color, var(--red-600, #dc2626));text-decoration:wavy underline;text-decoration-color:var(--red-400, #f87171)}.tql-token-error-range[data-v-ab996cb5]{background-color:var(--red-50, #fef2f2)}.tql-token-unknown[data-v-ab996cb5]{color:var(--text-color-secondary, #666)}.tql-validation-icon[data-v-ab996cb5]{position:absolute;right:.5rem;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center}.tql-input-multiline .tql-validation-icon[data-v-ab996cb5]{top:.75rem;transform:none}.tql-icon-valid[data-v-ab996cb5]{color:var(--green-500, #22c55e)}.tql-icon-invalid[data-v-ab996cb5]{color:var(--red-500, #ef4444)}.tql-icon-clickable[data-v-ab996cb5]{cursor:pointer;transition:transform .2s}.tql-icon-clickable[data-v-ab996cb5]:hover{transform:scale(1.2)}.tql-icon-clickable[data-v-ab996cb5]:focus{outline:2px solid var(--primary-color, #3b82f6);outline-offset:2px;border-radius:50%}.tql-snippet-button[data-v-ab996cb5]{position:absolute;right:2rem;top:50%;transform:translateY(-50%);padding:.25rem;border:none;background:transparent;color:var(--text-color-secondary, #666);cursor:pointer;border-radius:var(--border-radius, 6px);transition:color .2s,background-color .2s}.tql-snippet-button[data-v-ab996cb5]:hover{color:var(--primary-color, #3b82f6);background:var(--surface-100, #f5f5f5)}.tql-input-multiline .tql-snippet-button[data-v-ab996cb5]{top:.75rem;transform:none}.tql-input-resizable-textarea[data-v-ab996cb5]{resize:vertical;min-height:80px}.tql-input-wrapper.tql-input-resizable[data-v-ab996cb5]{height:auto}.tql-input-wrapper.tql-input-resizable .tql-highlight-layer[data-v-ab996cb5]{height:100%}.tql-validation-messages[data-v-ab996cb5]{position:absolute;top:100%;left:0;right:0;margin-top:.25rem;background:var(--surface-overlay, #fff);border:1px solid var(--red-200, #fecaca);border-radius:var(--border-radius, 6px);padding:.5rem;z-index:10;box-shadow:0 2px 8px #0000001a}.tql-input-autocomplete-active .tql-validation-messages[data-v-ab996cb5],.tql-input-autocomplete-active .tql-complexity-warnings[data-v-ab996cb5],.tql-input-autocomplete-active .tql-history-dropdown[data-v-ab996cb5],.tql-input-autocomplete-active .tql-preview-panel[data-v-ab996cb5]{display:none!important}.tql-error-message[data-v-ab996cb5]{display:flex;align-items:flex-start;gap:.5rem;padding:.25rem 0;font-size:.75rem;color:var(--red-600, #dc2626)}.tql-error-message i[data-v-ab996cb5]{margin-top:.125rem;font-size:.75rem}.tql-error-suggestion[data-v-ab996cb5]{display:block;color:var(--text-color-secondary, #666);font-style:italic;margin-left:1.25rem}.sr-only[data-v-ab996cb5]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.tql-toolbar[data-v-ab996cb5]{position:absolute;right:.5rem;top:50%;transform:translateY(-50%);display:flex;align-items:center;gap:.25rem}.tql-input-multiline .tql-toolbar[data-v-ab996cb5]{top:.5rem;transform:none}.tql-toolbar-button[data-v-ab996cb5]{padding:.25rem;border:none;background:transparent;color:var(--text-color-secondary, #666);cursor:pointer;border-radius:var(--border-radius, 4px);transition:color .2s,background-color .2s;display:flex;align-items:center;justify-content:center}.tql-toolbar-button[data-v-ab996cb5]:hover{color:var(--primary-color, #3b82f6);background:var(--surface-100, #f5f5f5)}.tql-toolbar-button--active[data-v-ab996cb5]{color:var(--primary-color, #3b82f6);background:var(--primary-100, rgba(59, 130, 246, .1))}.tql-validation-status[data-v-ab996cb5]{display:flex;align-items:center}.tql-complexity-badge[data-v-ab996cb5]{display:flex;align-items:center;gap:.25rem;padding:.125rem .5rem;border-radius:9999px;font-size:.625rem;font-weight:600;text-transform:uppercase;letter-spacing:.025em}.tql-complexity-low[data-v-ab996cb5]{background:var(--green-100, #dcfce7);color:var(--green-700, #15803d)}.tql-complexity-medium[data-v-ab996cb5]{background:var(--yellow-100, #fef9c3);color:var(--yellow-700, #a16207)}.tql-complexity-high[data-v-ab996cb5]{background:var(--red-100, #fee2e2);color:var(--red-700, #b91c1c)}.tql-complexity-count[data-v-ab996cb5]{display:inline-flex;align-items:center;justify-content:center;min-width:1rem;height:1rem;padding:0 .25rem;border-radius:9999px;background:currentColor;color:#fff;font-size:.5rem}.tql-complexity-low .tql-complexity-count[data-v-ab996cb5]{background:var(--green-600, #16a34a)}.tql-complexity-medium .tql-complexity-count[data-v-ab996cb5]{background:var(--yellow-600, #ca8a04)}.tql-complexity-high .tql-complexity-count[data-v-ab996cb5]{background:var(--red-600, #dc2626)}.tql-complexity-warnings[data-v-ab996cb5]{position:absolute;top:100%;left:0;right:0;margin-top:.25rem;background:var(--surface-overlay, #fff);border:1px solid var(--surface-border, #e0e0e0);border-radius:var(--border-radius, 6px);padding:.5rem;z-index:9;box-shadow:0 2px 8px #0000001a}.tql-complexity-warning[data-v-ab996cb5]{display:flex;align-items:flex-start;gap:.5rem;padding:.25rem 0;font-size:.75rem}.tql-complexity-warning i[data-v-ab996cb5]{margin-top:.125rem;font-size:.75rem}.tql-complexity-warning--info[data-v-ab996cb5]{color:var(--blue-600, #2563eb)}.tql-complexity-warning--warning[data-v-ab996cb5]{color:var(--yellow-600, #ca8a04)}.tql-complexity-warning--error[data-v-ab996cb5]{color:var(--red-600, #dc2626)}.tql-complexity-suggestions[data-v-ab996cb5]{margin-top:.5rem;padding-top:.5rem;border-top:1px solid var(--surface-border, #e0e0e0)}.tql-complexity-suggestion[data-v-ab996cb5]{display:flex;align-items:flex-start;gap:.5rem;padding:.25rem 0;font-size:.75rem;color:var(--text-color-secondary, #666)}.tql-complexity-suggestion i[data-v-ab996cb5]{color:var(--yellow-500, #eab308)}.tql-history-dropdown[data-v-ab996cb5]{position:absolute;top:100%;left:0;right:0;margin-top:.25rem;background:var(--surface-overlay, #fff);border:1px solid var(--surface-border, #e0e0e0);border-radius:var(--border-radius, 6px);z-index:20;box-shadow:0 4px 12px #00000026;max-height:300px;overflow:hidden;display:flex;flex-direction:column}.tql-history-header[data-v-ab996cb5]{padding:.5rem;border-bottom:1px solid var(--surface-border, #e0e0e0)}.tql-history-search[data-v-ab996cb5]{width:100%;padding:.375rem .5rem;border:1px solid var(--surface-border, #e0e0e0);border-radius:var(--border-radius, 4px);font-size:.75rem;outline:none}.tql-history-search[data-v-ab996cb5]:focus{border-color:var(--primary-color, #3b82f6)}.tql-history-list[data-v-ab996cb5]{overflow-y:auto;flex:1}.tql-history-item[data-v-ab996cb5]{display:flex;align-items:flex-start;gap:.5rem;padding:.5rem;cursor:pointer;border-bottom:1px solid var(--surface-50, #f9fafb);transition:background-color .15s}.tql-history-item[data-v-ab996cb5]:hover{background:var(--surface-100, #f5f5f5)}.tql-history-item--favorite[data-v-ab996cb5]{background:var(--yellow-50, #fefce8)}.tql-history-item--favorite[data-v-ab996cb5]:hover{background:var(--yellow-100, #fef9c3)}.tql-history-favorite[data-v-ab996cb5]{padding:.125rem;border:none;background:transparent;color:var(--text-color-secondary, #999);cursor:pointer;flex-shrink:0}.tql-history-favorite[data-v-ab996cb5]:hover,.tql-history-item--favorite .tql-history-favorite[data-v-ab996cb5]{color:var(--yellow-500, #eab308)}.tql-history-content[data-v-ab996cb5]{flex:1;min-width:0}.tql-history-label[data-v-ab996cb5]{font-size:.6875rem;font-weight:600;color:var(--text-color, #333);margin-bottom:.125rem}.tql-history-query[data-v-ab996cb5]{font-family:Courier New,monospace;font-size:.6875rem;color:var(--text-color-secondary, #666);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tql-history-time[data-v-ab996cb5]{font-size:.625rem;color:var(--text-color-secondary, #999);flex-shrink:0}.tql-history-empty[data-v-ab996cb5]{padding:1rem;text-align:center;color:var(--text-color-secondary, #666);font-size:.75rem}.tql-preview-panel[data-v-ab996cb5]{position:absolute;top:100%;left:0;right:0;margin-top:.25rem;background:var(--surface-overlay, #fff);border:1px solid var(--surface-border, #e0e0e0);border-radius:var(--border-radius, 6px);z-index:15;box-shadow:0 4px 12px #00000026;max-height:400px;overflow:hidden;display:flex;flex-direction:column}.tql-preview-header[data-v-ab996cb5]{display:flex;align-items:center;justify-content:space-between;padding:.5rem .75rem;border-bottom:1px solid var(--surface-border, #e0e0e0);font-size:.75rem;font-weight:600;color:var(--text-color, #333)}.tql-preview-close[data-v-ab996cb5]{padding:.125rem;border:none;background:transparent;color:var(--text-color-secondary, #666);cursor:pointer;border-radius:var(--border-radius, 4px)}.tql-preview-close[data-v-ab996cb5]:hover{background:var(--surface-100, #f5f5f5);color:var(--text-color, #333)}.tql-preview-panel[data-v-ab996cb5] .tql-preview{border:none;border-radius:0;max-height:350px;overflow-y:auto}.tql-validation-messages-portal{position:fixed;top:var(--tql-msg-top, 0);left:var(--tql-msg-left, 0);width:var(--tql-msg-width, auto);z-index:9998;background:var(--surface-overlay, #fff);border:2px solid var(--red-500, #ef4444);border-radius:var(--border-radius, 6px);padding:.5rem;box-shadow:0 4px 12px #00000026}.tql-validation-messages-portal .tql-error-message{display:flex;align-items:flex-start;gap:.5rem;padding:.25rem 0;font-size:.75rem;color:var(--red-600, #dc2626)}.tql-validation-messages-portal .tql-error-message i{margin-top:.125rem;font-size:.75rem}.tql-validation-messages-portal .tql-error-suggestion{display:block;color:var(--text-color-secondary, #6b7280);font-style:italic;margin-left:1.25rem}
|
|
1
|
+
.tql-autocomplete-dropdown[data-v-3df9a4be]{position:fixed;top:var(--dropdown-top);left:var(--dropdown-left);z-index:9999;min-width:280px;max-width:450px;max-height:var(--dropdown-max-height);background:var(--surface-overlay, #fff);border:1px solid var(--surface-border, #ddd);border-radius:var(--border-radius, 6px);box-shadow:0 4px 16px #00000026;overflow:hidden;display:flex;flex-direction:column}.tql-completion-list[data-v-3df9a4be]{overflow-y:auto;max-height:calc(var(--dropdown-max-height) - 60px)}.tql-completion-item[data-v-3df9a4be]{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;cursor:pointer;transition:background-color .15s}.tql-completion-item[data-v-3df9a4be]:hover,.tql-completion-item.selected[data-v-3df9a4be]{background:var(--highlight-bg, #f0f0f0)}.tql-completion-icon[data-v-3df9a4be]{display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;border-radius:4px;font-size:.75rem}.tql-completion-icon.tql-completion-kind-field[data-v-3df9a4be]{background:var(--blue-100, #e3f2fd);color:var(--blue-600, #1e88e5)}.tql-completion-icon.tql-completion-kind-operator[data-v-3df9a4be]{background:var(--pink-100, #fce4ec);color:var(--pink-600, #d81b60)}.tql-completion-icon.tql-completion-kind-value[data-v-3df9a4be]{background:var(--green-100, #e8f5e9);color:var(--green-600, #43a047)}.tql-completion-icon.tql-completion-kind-keyword[data-v-3df9a4be]{background:var(--purple-100, #f3e5f5);color:var(--purple-600, #8e24aa)}.tql-completion-icon.tql-completion-kind-snippet[data-v-3df9a4be]{background:var(--orange-100, #fff3e0);color:var(--orange-600, #fb8c00)}.tql-completion-icon.tql-completion-kind-mutator[data-v-3df9a4be]{background:var(--cyan-100, #e0f7fa);color:var(--cyan-600, #00acc1)}.tql-completion-icon.tql-completion-kind-aggregation[data-v-3df9a4be]{background:var(--indigo-100, #e8eaf6);color:var(--indigo-600, #3949ab)}.tql-completion-icon.tql-completion-kind-logicalOp[data-v-3df9a4be]{background:var(--yellow-100, #fffde7);color:var(--yellow-700, #fbc02d)}.tql-completion-icon.tql-completion-kind-typeHint[data-v-3df9a4be]{background:var(--teal-100, #e0f2f1);color:var(--teal-600, #00897b)}.tql-completion-icon.tql-completion-kind-visualization[data-v-3df9a4be]{background:var(--red-100, #ffebee);color:var(--red-600, #e53935)}.tql-completion-content[data-v-3df9a4be]{flex:1;display:flex;flex-direction:column;min-width:0}.tql-completion-label[data-v-3df9a4be]{font-family:Courier New,monospace;font-size:.875rem;font-weight:500;color:var(--text-color, #333);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tql-completion-detail[data-v-3df9a4be]{font-size:.75rem;color:var(--text-color-secondary, #666);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tql-completion-kind-badge[data-v-3df9a4be]{font-size:.625rem;padding:.125rem .375rem;background:var(--surface-100, #f5f5f5);border-radius:3px;color:var(--text-color-secondary, #666);text-transform:uppercase;letter-spacing:.025em}.tql-completion-docs[data-v-3df9a4be]{padding:.5rem .75rem;border-top:1px solid var(--surface-border, #ddd);background:var(--surface-50, #fafafa);font-size:.75rem;color:var(--text-color-secondary, #666);max-height:60px;overflow-y:auto}.tql-preview[data-v-bae811e6]{font-family:ui-monospace,monospace;font-size:13px;line-height:1.5;padding:12px;border:1px solid var(--tql-preview-border, #e0e0e0);border-radius:6px;background:var(--tql-preview-bg, #fafafa)}.tql-preview--compact[data-v-bae811e6]{padding:8px;font-size:12px}.tql-preview--empty[data-v-bae811e6]{color:var(--tql-preview-muted, #888)}.tql-preview__empty[data-v-bae811e6]{text-align:center;padding:20px}.tql-preview__complexity[data-v-bae811e6]{display:flex;align-items:center;gap:12px;margin-bottom:12px}.tql-preview__complexity-badge[data-v-bae811e6]{padding:2px 8px;border-radius:4px;font-size:11px;font-weight:600;text-transform:uppercase}.tql-preview--low .tql-preview__complexity-badge[data-v-bae811e6]{background:var(--tql-preview-low-bg, #e8f5e9);color:var(--tql-preview-low-text, #2e7d32)}.tql-preview--medium .tql-preview__complexity-badge[data-v-bae811e6]{background:var(--tql-preview-medium-bg, #fff3e0);color:var(--tql-preview-medium-text, #e65100)}.tql-preview--high .tql-preview__complexity-badge[data-v-bae811e6]{background:var(--tql-preview-high-bg, #ffebee);color:var(--tql-preview-high-text, #c62828)}.tql-preview__field-count[data-v-bae811e6]{color:var(--tql-preview-muted, #666);font-size:12px}.tql-preview__warnings[data-v-bae811e6]{margin-bottom:12px}.tql-preview__warning[data-v-bae811e6]{display:flex;align-items:flex-start;gap:8px;padding:6px 8px;border-radius:4px;margin-bottom:4px}.tql-preview__warning--info[data-v-bae811e6]{background:var(--tql-preview-info-bg, #e3f2fd);color:var(--tql-preview-info-text, #1565c0)}.tql-preview__warning--warning[data-v-bae811e6]{background:var(--tql-preview-warning-bg, #fff3e0);color:var(--tql-preview-warning-text, #e65100)}.tql-preview__warning--error[data-v-bae811e6]{background:var(--tql-preview-error-bg, #ffebee);color:var(--tql-preview-error-text, #c62828)}.tql-preview__warning-icon[data-v-bae811e6]{font-weight:700;width:16px;text-align:center}.tql-preview__warning-text[data-v-bae811e6]{flex:1}.tql-preview__suggestions[data-v-bae811e6]{margin-bottom:12px;padding:8px;background:var(--tql-preview-suggestion-bg, #f5f5f5);border-radius:4px}.tql-preview__suggestions-header[data-v-bae811e6]{font-weight:600;margin-bottom:4px;color:var(--tql-preview-header, #333)}.tql-preview__suggestions-list[data-v-bae811e6]{margin:0;padding-left:20px}.tql-preview__suggestion[data-v-bae811e6]{color:var(--tql-preview-muted, #666);margin:2px 0}.tql-preview__tree[data-v-bae811e6]{margin-bottom:12px}.tql-preview__tree-header[data-v-bae811e6],.tql-preview__fields-header[data-v-bae811e6],.tql-preview__operators-header[data-v-bae811e6]{font-weight:600;margin-bottom:8px;color:var(--tql-preview-header, #333);font-size:12px;text-transform:uppercase;letter-spacing:.5px}.tql-preview__tree-content[data-v-bae811e6]{border:1px solid var(--tql-preview-tree-border, #e0e0e0);border-radius:4px;background:var(--tql-preview-tree-bg, #fff);padding:8px}.tql-preview__node[data-v-bae811e6]{margin:2px 0}.tql-preview__node-content[data-v-bae811e6]{display:flex;align-items:center;gap:4px;padding:2px 4px;border-radius:3px;cursor:pointer}.tql-preview__node-content[data-v-bae811e6]:hover{background:var(--tql-preview-node-hover, #f0f0f0)}.tql-preview__node-toggle[data-v-bae811e6]{width:16px;height:16px;border:none;background:var(--tql-preview-toggle-bg, #e0e0e0);border-radius:3px;cursor:pointer;font-size:12px;line-height:1;display:flex;align-items:center;justify-content:center}.tql-preview__node-toggle[data-v-bae811e6]:hover{background:var(--tql-preview-toggle-hover, #d0d0d0)}.tql-preview__node-toggle--leaf[data-v-bae811e6]{visibility:hidden}.tql-preview__node-type[data-v-bae811e6]{font-weight:600;color:var(--tql-preview-node-type, #666)}.tql-preview__node--and .tql-preview__node-type[data-v-bae811e6]{color:var(--tql-preview-and, #1976d2)}.tql-preview__node--or .tql-preview__node-type[data-v-bae811e6]{color:var(--tql-preview-or, #7b1fa2)}.tql-preview__node--not .tql-preview__node-type[data-v-bae811e6]{color:var(--tql-preview-not, #c62828)}.tql-preview__node--group .tql-preview__node-type[data-v-bae811e6]{color:var(--tql-preview-group, #666)}.tql-preview__node-label[data-v-bae811e6]{flex:1}.tql-preview__fields-list[data-v-bae811e6]{display:flex;flex-direction:column;gap:4px}.tql-preview__field[data-v-bae811e6]{display:flex;align-items:center;gap:6px;padding:4px 8px;background:var(--tql-preview-field-bg, #fff);border:1px solid var(--tql-preview-field-border, #e0e0e0);border-radius:4px;cursor:pointer}.tql-preview__field[data-v-bae811e6]:hover{background:var(--tql-preview-field-hover, #f5f5f5)}.tql-preview__field-name[data-v-bae811e6]{font-weight:600;color:var(--tql-preview-field-name, #1976d2)}.tql-preview__field-mutators[data-v-bae811e6]{color:var(--tql-preview-mutator, #7b1fa2)}.tql-preview__field-operator[data-v-bae811e6]{color:var(--tql-preview-operator, #666)}.tql-preview__field-value[data-v-bae811e6]{color:var(--tql-preview-value, #2e7d32)}.tql-preview__match-type[data-v-bae811e6]{margin-left:auto;padding:1px 4px;border-radius:3px;font-size:10px;font-weight:600;background:var(--tql-preview-match-bg, #f0f0f0)}.tql-preview__match-type--exact[data-v-bae811e6]{background:var(--tql-preview-match-exact-bg, #e8f5e9);color:var(--tql-preview-match-exact, #2e7d32)}.tql-preview__match-type--wildcard[data-v-bae811e6]{background:var(--tql-preview-match-wildcard-bg, #fff3e0);color:var(--tql-preview-match-wildcard, #e65100)}.tql-preview__match-type--regex[data-v-bae811e6]{background:var(--tql-preview-match-regex-bg, #fce4ec);color:var(--tql-preview-match-regex, #c2185b)}.tql-preview__match-type--range[data-v-bae811e6]{background:var(--tql-preview-match-range-bg, #e3f2fd);color:var(--tql-preview-match-range, #1565c0)}.tql-preview__match-type--cidr[data-v-bae811e6]{background:var(--tql-preview-match-cidr-bg, #f3e5f5);color:var(--tql-preview-match-cidr, #7b1fa2)}.tql-preview__operators-list[data-v-bae811e6]{display:flex;flex-wrap:wrap;gap:8px}.tql-preview__operator[data-v-bae811e6]{padding:2px 6px;background:var(--tql-preview-op-bg, #f0f0f0);border-radius:3px;font-size:11px}.tql-input-wrapper[data-v-b0fd503e]{position:relative;display:flex;align-items:flex-start;border:1px solid var(--surface-border, #ddd);border-radius:var(--border-radius, 6px);background:var(--surface-ground, #fff);transition:border-color .2s,box-shadow .2s}.tql-input-wrapper.tql-input-has-min-height[data-v-b0fd503e],.tql-input-wrapper.tql-input-has-min-height .tql-input[data-v-b0fd503e]{min-height:var(--tql-min-height)}.tql-input-wrapper.tql-input-focused[data-v-b0fd503e]{border-color:var(--primary-color, #3b82f6);box-shadow:0 0 0 2px var(--primary-100, rgba(59, 130, 246, .2))}.tql-input-wrapper.tql-input-invalid[data-v-b0fd503e]{border-color:var(--red-500, #ef4444)}.tql-input-wrapper.tql-input-invalid.tql-input-focused[data-v-b0fd503e]{box-shadow:0 0 0 2px var(--red-100, rgba(239, 68, 68, .2))}.tql-input-wrapper.tql-input-disabled[data-v-b0fd503e]{opacity:.6;cursor:not-allowed}.tql-highlight-layer[data-v-b0fd503e]{position:absolute;top:0;left:0;right:0;bottom:0;padding:.5rem .75rem;pointer-events:none;white-space:pre-wrap;word-wrap:break-word;font-family:Courier New,monospace;font-size:.875rem;line-height:1.5;overflow:hidden}.tql-input-multiline .tql-highlight-layer[data-v-b0fd503e]{overflow-y:auto}.tql-input[data-v-b0fd503e]{flex:1;width:100%;padding:.5rem 8rem .5rem .75rem;border:none;background:transparent;font-family:Courier New,monospace;font-size:.875rem;line-height:1.5;color:var(--text-color, #333);outline:none;resize:none}.tql-input.tql-input-highlighted[data-v-b0fd503e]{color:transparent;caret-color:var(--text-color, #333)}.tql-input[data-v-b0fd503e]::placeholder{color:var(--text-color-secondary, #666);opacity:.7}.tql-input[data-v-b0fd503e]:disabled{cursor:not-allowed}.tql-token-field[data-v-b0fd503e]{color:var(--tql-field-color, var(--blue-600, #2563eb))}.tql-token-operator[data-v-b0fd503e]{color:var(--tql-operator-color, var(--pink-600, #db2777));font-weight:500}.tql-token-logicalOp[data-v-b0fd503e]{color:var(--tql-logical-color, var(--purple-600, #9333ea));font-weight:600}.tql-token-collectionOp[data-v-b0fd503e]{color:var(--tql-collection-color, var(--indigo-600, #4f46e5));font-weight:600}.tql-token-string[data-v-b0fd503e]{color:var(--tql-string-color, var(--green-600, #16a34a))}.tql-token-number[data-v-b0fd503e]{color:var(--tql-number-color, var(--orange-600, #ea580c))}.tql-token-boolean[data-v-b0fd503e]{color:var(--tql-boolean-color, var(--cyan-600, #0891b2))}.tql-token-null[data-v-b0fd503e]{color:var(--tql-null-color, var(--gray-500, #6b7280));font-style:italic}.tql-token-mutator[data-v-b0fd503e]{color:var(--tql-mutator-color, var(--teal-600, #0d9488));font-style:italic}.tql-token-aggregation[data-v-b0fd503e]{color:var(--tql-aggregation-color, var(--indigo-600, #4f46e5))}.tql-token-keyword[data-v-b0fd503e]{color:var(--tql-keyword-color, var(--purple-500, #a855f7))}.tql-token-typeHint[data-v-b0fd503e]{color:var(--tql-typehint-color, var(--teal-500, #14b8a6))}.tql-token-visualization[data-v-b0fd503e]{color:var(--tql-viz-color, var(--red-500, #ef4444))}.tql-token-arrow[data-v-b0fd503e]{color:var(--tql-arrow-color, var(--gray-600, #4b5563));font-weight:600}.tql-token-doubleColon[data-v-b0fd503e]{color:var(--tql-colon-color, var(--gray-500, #6b7280))}.tql-token-paren[data-v-b0fd503e],.tql-token-bracket[data-v-b0fd503e]{color:var(--tql-bracket-color, var(--gray-600, #4b5563))}.tql-token-error[data-v-b0fd503e]{color:var(--tql-error-color, var(--red-600, #dc2626));text-decoration:wavy underline;text-decoration-color:var(--red-400, #f87171)}.tql-token-error-range[data-v-b0fd503e]{background-color:var(--red-50, #fef2f2)}.tql-token-unknown[data-v-b0fd503e]{color:var(--text-color-secondary, #666)}.tql-validation-icon[data-v-b0fd503e]{position:absolute;right:.5rem;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center}.tql-input-multiline .tql-validation-icon[data-v-b0fd503e]{top:.75rem;transform:none}.tql-icon-valid[data-v-b0fd503e]{color:var(--green-500, #22c55e)}.tql-icon-invalid[data-v-b0fd503e]{color:var(--red-500, #ef4444)}.tql-icon-clickable[data-v-b0fd503e]{cursor:pointer;transition:transform .2s}.tql-icon-clickable[data-v-b0fd503e]:hover{transform:scale(1.2)}.tql-icon-clickable[data-v-b0fd503e]:focus{outline:2px solid var(--primary-color, #3b82f6);outline-offset:2px;border-radius:50%}.tql-snippet-button[data-v-b0fd503e]{position:absolute;right:2rem;top:50%;transform:translateY(-50%);padding:.25rem;border:none;background:transparent;color:var(--text-color-secondary, #666);cursor:pointer;border-radius:var(--border-radius, 6px);transition:color .2s,background-color .2s}.tql-snippet-button[data-v-b0fd503e]:hover{color:var(--primary-color, #3b82f6);background:var(--surface-100, #f5f5f5)}.tql-input-multiline .tql-snippet-button[data-v-b0fd503e]{top:.75rem;transform:none}.tql-input-resizable-textarea[data-v-b0fd503e]{resize:vertical;min-height:80px}.tql-input-wrapper.tql-input-resizable[data-v-b0fd503e]{height:auto}.tql-input-wrapper.tql-input-resizable .tql-highlight-layer[data-v-b0fd503e]{height:100%}.tql-validation-messages[data-v-b0fd503e]{position:absolute;top:100%;left:0;right:0;margin-top:.25rem;background:var(--surface-overlay, #fff);border:1px solid var(--red-200, #fecaca);border-radius:var(--border-radius, 6px);padding:.5rem;z-index:10;box-shadow:0 2px 8px #0000001a}.tql-input-autocomplete-active .tql-validation-messages[data-v-b0fd503e],.tql-input-autocomplete-active .tql-complexity-warnings[data-v-b0fd503e],.tql-input-autocomplete-active .tql-history-dropdown[data-v-b0fd503e],.tql-input-autocomplete-active .tql-preview-panel[data-v-b0fd503e]{display:none!important}.tql-error-message[data-v-b0fd503e]{display:flex;align-items:flex-start;gap:.5rem;padding:.25rem 0;font-size:.75rem;color:var(--red-600, #dc2626)}.tql-error-message i[data-v-b0fd503e]{margin-top:.125rem;font-size:.75rem}.tql-error-suggestion[data-v-b0fd503e]{display:block;color:var(--text-color-secondary, #666);font-style:italic;margin-left:1.25rem}.sr-only[data-v-b0fd503e]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.tql-toolbar[data-v-b0fd503e]{position:absolute;right:.5rem;top:50%;transform:translateY(-50%);display:flex;align-items:center;gap:.25rem}.tql-input-multiline .tql-toolbar[data-v-b0fd503e]{top:.5rem;transform:none}.tql-toolbar-button[data-v-b0fd503e]{padding:.25rem;border:none;background:transparent;color:var(--text-color-secondary, #666);cursor:pointer;border-radius:var(--border-radius, 4px);transition:color .2s,background-color .2s;display:flex;align-items:center;justify-content:center}.tql-toolbar-button[data-v-b0fd503e]:hover{color:var(--primary-color, #3b82f6);background:var(--surface-100, #f5f5f5)}.tql-toolbar-button--active[data-v-b0fd503e]{color:var(--primary-color, #3b82f6);background:var(--primary-100, rgba(59, 130, 246, .1))}.tql-validation-status[data-v-b0fd503e]{display:flex;align-items:center}.tql-complexity-badge[data-v-b0fd503e]{display:flex;align-items:center;gap:.25rem;padding:.125rem .5rem;border-radius:9999px;font-size:.625rem;font-weight:600;text-transform:uppercase;letter-spacing:.025em}.tql-complexity-low[data-v-b0fd503e]{background:var(--green-100, #dcfce7);color:var(--green-700, #15803d)}.tql-complexity-medium[data-v-b0fd503e]{background:var(--yellow-100, #fef9c3);color:var(--yellow-700, #a16207)}.tql-complexity-high[data-v-b0fd503e]{background:var(--red-100, #fee2e2);color:var(--red-700, #b91c1c)}.tql-complexity-count[data-v-b0fd503e]{display:inline-flex;align-items:center;justify-content:center;min-width:1rem;height:1rem;padding:0 .25rem;border-radius:9999px;background:currentColor;color:#fff;font-size:.5rem}.tql-complexity-low .tql-complexity-count[data-v-b0fd503e]{background:var(--green-600, #16a34a)}.tql-complexity-medium .tql-complexity-count[data-v-b0fd503e]{background:var(--yellow-600, #ca8a04)}.tql-complexity-high .tql-complexity-count[data-v-b0fd503e]{background:var(--red-600, #dc2626)}.tql-complexity-warnings[data-v-b0fd503e]{position:absolute;top:100%;left:0;right:0;margin-top:.25rem;background:var(--surface-overlay, #fff);border:1px solid var(--surface-border, #e0e0e0);border-radius:var(--border-radius, 6px);padding:.5rem;z-index:9;box-shadow:0 2px 8px #0000001a}.tql-complexity-warning[data-v-b0fd503e]{display:flex;align-items:flex-start;gap:.5rem;padding:.25rem 0;font-size:.75rem}.tql-complexity-warning i[data-v-b0fd503e]{margin-top:.125rem;font-size:.75rem}.tql-complexity-warning--info[data-v-b0fd503e]{color:var(--blue-600, #2563eb)}.tql-complexity-warning--warning[data-v-b0fd503e]{color:var(--yellow-600, #ca8a04)}.tql-complexity-warning--error[data-v-b0fd503e]{color:var(--red-600, #dc2626)}.tql-complexity-suggestions[data-v-b0fd503e]{margin-top:.5rem;padding-top:.5rem;border-top:1px solid var(--surface-border, #e0e0e0)}.tql-complexity-suggestion[data-v-b0fd503e]{display:flex;align-items:flex-start;gap:.5rem;padding:.25rem 0;font-size:.75rem;color:var(--text-color-secondary, #666)}.tql-complexity-suggestion i[data-v-b0fd503e]{color:var(--yellow-500, #eab308)}.tql-history-dropdown[data-v-b0fd503e]{position:absolute;top:100%;left:0;right:0;margin-top:.25rem;background:var(--surface-overlay, #fff);border:1px solid var(--surface-border, #e0e0e0);border-radius:var(--border-radius, 6px);z-index:20;box-shadow:0 4px 12px #00000026;max-height:300px;overflow:hidden;display:flex;flex-direction:column}.tql-history-header[data-v-b0fd503e]{padding:.5rem;border-bottom:1px solid var(--surface-border, #e0e0e0)}.tql-history-search[data-v-b0fd503e]{width:100%;padding:.375rem .5rem;border:1px solid var(--surface-border, #e0e0e0);border-radius:var(--border-radius, 4px);font-size:.75rem;outline:none}.tql-history-search[data-v-b0fd503e]:focus{border-color:var(--primary-color, #3b82f6)}.tql-history-list[data-v-b0fd503e]{overflow-y:auto;flex:1}.tql-history-item[data-v-b0fd503e]{display:flex;align-items:flex-start;gap:.5rem;padding:.5rem;cursor:pointer;border-bottom:1px solid var(--surface-50, #f9fafb);transition:background-color .15s}.tql-history-item[data-v-b0fd503e]:hover{background:var(--surface-100, #f5f5f5)}.tql-history-item--favorite[data-v-b0fd503e]{background:var(--yellow-50, #fefce8)}.tql-history-item--favorite[data-v-b0fd503e]:hover{background:var(--yellow-100, #fef9c3)}.tql-history-favorite[data-v-b0fd503e]{padding:.125rem;border:none;background:transparent;color:var(--text-color-secondary, #999);cursor:pointer;flex-shrink:0}.tql-history-favorite[data-v-b0fd503e]:hover,.tql-history-item--favorite .tql-history-favorite[data-v-b0fd503e]{color:var(--yellow-500, #eab308)}.tql-history-content[data-v-b0fd503e]{flex:1;min-width:0}.tql-history-label[data-v-b0fd503e]{font-size:.6875rem;font-weight:600;color:var(--text-color, #333);margin-bottom:.125rem}.tql-history-query[data-v-b0fd503e]{font-family:Courier New,monospace;font-size:.6875rem;color:var(--text-color-secondary, #666);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tql-history-time[data-v-b0fd503e]{font-size:.625rem;color:var(--text-color-secondary, #999);flex-shrink:0}.tql-history-empty[data-v-b0fd503e]{padding:1rem;text-align:center;color:var(--text-color-secondary, #666);font-size:.75rem}.tql-preview-panel[data-v-b0fd503e]{position:absolute;top:100%;left:0;right:0;margin-top:.25rem;background:var(--surface-overlay, #fff);border:1px solid var(--surface-border, #e0e0e0);border-radius:var(--border-radius, 6px);z-index:15;box-shadow:0 4px 12px #00000026;max-height:400px;overflow:hidden;display:flex;flex-direction:column}.tql-preview-header[data-v-b0fd503e]{display:flex;align-items:center;justify-content:space-between;padding:.5rem .75rem;border-bottom:1px solid var(--surface-border, #e0e0e0);font-size:.75rem;font-weight:600;color:var(--text-color, #333)}.tql-preview-close[data-v-b0fd503e]{padding:.125rem;border:none;background:transparent;color:var(--text-color-secondary, #666);cursor:pointer;border-radius:var(--border-radius, 4px)}.tql-preview-close[data-v-b0fd503e]:hover{background:var(--surface-100, #f5f5f5);color:var(--text-color, #333)}.tql-preview-panel[data-v-b0fd503e] .tql-preview{border:none;border-radius:0;max-height:350px;overflow-y:auto}.tql-validation-messages-portal{position:fixed;top:var(--tql-msg-top, 0);left:var(--tql-msg-left, 0);width:var(--tql-msg-width, auto);z-index:9998;background:var(--surface-overlay, #fff);border:2px solid var(--red-500, #ef4444);border-radius:var(--border-radius, 6px);padding:.5rem;box-shadow:0 4px 12px #00000026}.tql-validation-messages-portal .tql-error-message{display:flex;align-items:flex-start;gap:.5rem;padding:.25rem 0;font-size:.75rem;color:var(--red-600, #dc2626)}.tql-validation-messages-portal .tql-error-message i{margin-top:.125rem;font-size:.75rem}.tql-validation-messages-portal .tql-error-suggestion{display:block;color:var(--text-color-secondary, #6b7280);font-style:italic;margin-left:1.25rem}
|
package/dist/vue/TqlInput.vue.js
CHANGED
|
@@ -2,7 +2,7 @@ import o from "./TqlInput.vue2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
5
|
+
const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b0fd503e"]]);
|
|
6
6
|
export {
|
|
7
7
|
_ as default
|
|
8
8
|
};
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { useTqlInput as
|
|
5
|
-
import { useQueryHistory as
|
|
6
|
-
import { analyzeComplexity as
|
|
7
|
-
const
|
|
1
|
+
import { defineComponent as et, ref as h, toRef as Z, computed as T, watch as _, onMounted as tt, nextTick as P, onUnmounted as lt, openBlock as o, createElementBlock as n, normalizeClass as S, unref as c, Fragment as M, renderList as N, toDisplayString as w, createCommentVNode as m, withDirectives as ae, vModelText as ne, createElementVNode as d, withModifiers as Q, withKeys as ke, createVNode as xe, createBlock as ot, Teleport as it } from "vue";
|
|
2
|
+
import at 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 = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "tql-highlight-layer",
|
|
10
10
|
"aria-hidden": "true"
|
|
11
|
-
},
|
|
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 = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "tql-complexity-count"
|
|
14
|
-
},
|
|
14
|
+
}, yt = {
|
|
15
15
|
key: 4,
|
|
16
16
|
class: "tql-validation-status"
|
|
17
|
-
},
|
|
17
|
+
}, gt = {
|
|
18
18
|
key: 0,
|
|
19
19
|
class: "pi pi-check-circle tql-icon-valid",
|
|
20
20
|
"aria-label": "Query is valid"
|
|
21
|
-
},
|
|
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" }, Pt = {
|
|
22
22
|
key: 0,
|
|
23
23
|
class: "tql-history-label"
|
|
24
|
-
},
|
|
24
|
+
}, St = { class: "tql-history-query" }, Vt = { class: "tql-history-time" }, Rt = {
|
|
25
25
|
key: 0,
|
|
26
26
|
class: "tql-history-empty"
|
|
27
|
-
},
|
|
27
|
+
}, $t = {
|
|
28
28
|
key: 0,
|
|
29
29
|
class: "tql-error-suggestion"
|
|
30
|
-
},
|
|
30
|
+
}, Dt = {
|
|
31
31
|
key: 4,
|
|
32
32
|
class: "tql-complexity-warnings"
|
|
33
|
-
},
|
|
33
|
+
}, It = {
|
|
34
34
|
key: 0,
|
|
35
35
|
class: "tql-complexity-suggestions"
|
|
36
|
-
},
|
|
36
|
+
}, Tt = {
|
|
37
37
|
key: 5,
|
|
38
38
|
class: "tql-preview-panel"
|
|
39
|
-
},
|
|
39
|
+
}, Et = { class: "tql-preview-header" }, Ht = {
|
|
40
40
|
class: "sr-only",
|
|
41
41
|
role: "status",
|
|
42
42
|
"aria-live": "polite",
|
|
43
43
|
"aria-atomic": "true"
|
|
44
|
-
},
|
|
44
|
+
}, Bt = { key: 0 }, Mt = { key: 1 }, Qt = 1500, Nt = /* @__PURE__ */ et({
|
|
45
45
|
__name: "TqlInput",
|
|
46
46
|
props: {
|
|
47
47
|
modelValue: {},
|
|
@@ -71,530 +71,575 @@ const nt = {
|
|
|
71
71
|
historyStorageKey: {}
|
|
72
72
|
},
|
|
73
73
|
emits: ["update:modelValue", "validation", "parse", "submit"],
|
|
74
|
-
setup(
|
|
75
|
-
const
|
|
76
|
-
let
|
|
77
|
-
const
|
|
78
|
-
tokens:
|
|
79
|
-
cursorPosition:
|
|
80
|
-
completionItems:
|
|
81
|
-
showAutocomplete:
|
|
82
|
-
isValid:
|
|
83
|
-
errors:
|
|
74
|
+
setup(i, { expose: Ce, emit: Pe }) {
|
|
75
|
+
const f = i, b = Pe, s = h(null), q = h(null), A = h(null), u = h(f.modelValue), k = h(!1), y = h(!1), U = h(0), L = h(!1);
|
|
76
|
+
let j = null, se = 0;
|
|
77
|
+
const V = h(!1), R = h(!1), E = h(""), ee = `tql-input-${Math.random().toString(36).substring(2, 9)}`, ue = `${ee}-input`, te = `${ee}-autocomplete`, le = `${ee}-errors`, z = h([]), H = h(-1), Se = Z(f, "modelValue"), Ve = Z(f, "fieldSchema"), Re = Z(f, "fieldValues"), $e = Z(f, "snippets"), {
|
|
78
|
+
tokens: De,
|
|
79
|
+
cursorPosition: K,
|
|
80
|
+
completionItems: O,
|
|
81
|
+
showAutocomplete: C,
|
|
82
|
+
isValid: oe,
|
|
83
|
+
errors: D,
|
|
84
84
|
hasErrors: I,
|
|
85
85
|
validate: Ie,
|
|
86
|
-
handleInput:
|
|
87
|
-
handleCursorChange:
|
|
88
|
-
insertCompletion:
|
|
89
|
-
insertSnippet:
|
|
90
|
-
triggerAutocomplete:
|
|
91
|
-
hideAutocomplete:
|
|
92
|
-
getTokenAtCursor:
|
|
93
|
-
} =
|
|
94
|
-
modelValue:
|
|
95
|
-
fieldSchema:
|
|
96
|
-
fieldValues:
|
|
97
|
-
snippets:
|
|
98
|
-
validateOnInput:
|
|
99
|
-
debounceMs:
|
|
100
|
-
autocomplete:
|
|
101
|
-
onValidation: (e) =>
|
|
102
|
-
onParse: (e) =>
|
|
103
|
-
}),
|
|
104
|
-
storageKey:
|
|
105
|
-
...
|
|
106
|
-
}) : null,
|
|
86
|
+
handleInput: re,
|
|
87
|
+
handleCursorChange: x,
|
|
88
|
+
insertCompletion: Te,
|
|
89
|
+
insertSnippet: Ee,
|
|
90
|
+
triggerAutocomplete: F,
|
|
91
|
+
hideAutocomplete: W,
|
|
92
|
+
getTokenAtCursor: He
|
|
93
|
+
} = st({
|
|
94
|
+
modelValue: Se,
|
|
95
|
+
fieldSchema: Ve,
|
|
96
|
+
fieldValues: Re,
|
|
97
|
+
snippets: $e,
|
|
98
|
+
validateOnInput: f.validateOnInput,
|
|
99
|
+
debounceMs: f.debounceMs,
|
|
100
|
+
autocomplete: f.autocomplete,
|
|
101
|
+
onValidation: (e) => b("validation", e),
|
|
102
|
+
onParse: (e) => b("parse", e)
|
|
103
|
+
}), $ = f.showHistory ? ut({
|
|
104
|
+
storageKey: f.historyStorageKey || "tql-history",
|
|
105
|
+
...f.historyOptions
|
|
106
|
+
}) : null, g = T(() => !f.showComplexity || !u.value.trim() ? null : rt(u.value, f.complexityThresholds)), Be = T(() => g.value ? `tql-complexity-${g.value.score}` : ""), ce = T(() => g.value && {
|
|
107
107
|
low: "Low",
|
|
108
108
|
medium: "Medium",
|
|
109
109
|
high: "High"
|
|
110
|
-
}[
|
|
111
|
-
function
|
|
112
|
-
|
|
110
|
+
}[g.value.score] || ""), de = T(() => $ ? E.value.trim() ? $.searchHistory(E.value).slice(0, 10) : $.getRecentQueries(10) : []);
|
|
111
|
+
function Me(e) {
|
|
112
|
+
u.value = e.query, b("update:modelValue", e.query), re(e.query), V.value = !1, E.value = "", P(() => {
|
|
113
113
|
var t;
|
|
114
|
-
return (t =
|
|
114
|
+
return (t = s.value) == null ? void 0 : t.focus();
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
t.stopPropagation(),
|
|
117
|
+
function Qe(e, t) {
|
|
118
|
+
t.stopPropagation(), $ == null || $.toggleFavorite(e.id);
|
|
119
119
|
}
|
|
120
|
-
function
|
|
121
|
-
|
|
120
|
+
function ve() {
|
|
121
|
+
$ && u.value.trim() && $.addQuery(u.value);
|
|
122
122
|
}
|
|
123
|
-
function
|
|
124
|
-
|
|
123
|
+
function Ae() {
|
|
124
|
+
V.value = !V.value, V.value && (R.value = !1);
|
|
125
125
|
}
|
|
126
126
|
function Le() {
|
|
127
|
-
|
|
127
|
+
R.value = !R.value, R.value && (V.value = !1);
|
|
128
128
|
}
|
|
129
|
-
|
|
130
|
-
() =>
|
|
129
|
+
_(
|
|
130
|
+
() => f.modelValue,
|
|
131
131
|
(e) => {
|
|
132
|
-
e !==
|
|
132
|
+
e !== u.value && (u.value = e);
|
|
133
133
|
}
|
|
134
|
-
),
|
|
135
|
-
() =>
|
|
134
|
+
), _(
|
|
135
|
+
() => f.minHeight,
|
|
136
136
|
(e) => {
|
|
137
|
-
|
|
137
|
+
q.value && (e ? q.value.style.setProperty("--tql-min-height", e) : q.value.style.removeProperty("--tql-min-height"));
|
|
138
138
|
},
|
|
139
139
|
{ immediate: !0 }
|
|
140
140
|
);
|
|
141
|
-
const ze =
|
|
142
|
-
const e =
|
|
141
|
+
const ze = T(() => y.value ? !0 : C.value && O.value.length > 0 ? !1 : !!(!k.value || L.value)), G = h({ top: 0, left: 0 }), Ke = T(() => G.value.top > 0 || G.value.left > 0), fe = h({ top: 0, left: 0, width: 0 }), B = h(null), Oe = T(() => {
|
|
142
|
+
const e = fe.value;
|
|
143
143
|
return e.top > 0 || e.left > 0 || e.width > 0;
|
|
144
144
|
});
|
|
145
|
-
function
|
|
146
|
-
if (!
|
|
145
|
+
function J() {
|
|
146
|
+
if (!q.value)
|
|
147
147
|
return;
|
|
148
|
-
const e =
|
|
149
|
-
|
|
148
|
+
const e = q.value.getBoundingClientRect();
|
|
149
|
+
G.value = {
|
|
150
150
|
top: e.bottom + 4,
|
|
151
151
|
left: e.left
|
|
152
|
-
},
|
|
152
|
+
}, fe.value = {
|
|
153
153
|
top: e.bottom + 4,
|
|
154
154
|
left: e.left,
|
|
155
155
|
width: e.width
|
|
156
|
-
},
|
|
156
|
+
}, 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`));
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function Fe(e) {
|
|
159
159
|
const t = `tql-token tql-token-${e.type}`;
|
|
160
|
-
return
|
|
160
|
+
return D.value.some((a) => e.start >= a.start && e.end <= a.end) ? `${t} tql-token-error-range` : t;
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function pe(e) {
|
|
163
163
|
const t = e.target;
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
u.value = t.value, b("update:modelValue", t.value), re(t.value), U.value = Date.now(), L.value = !1, P(() => {
|
|
165
|
+
s.value && x(s.value.selectionStart || 0);
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
|
-
function
|
|
169
|
-
if (
|
|
170
|
-
const e =
|
|
171
|
-
e !==
|
|
168
|
+
function X() {
|
|
169
|
+
if (s.value) {
|
|
170
|
+
const e = s.value.selectionStart || 0;
|
|
171
|
+
e !== K.value && x(e);
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
|
-
function
|
|
175
|
-
var t, l,
|
|
174
|
+
function he(e) {
|
|
175
|
+
var t, l, a, r, v;
|
|
176
176
|
if (e.key === "Tab" && !e.shiftKey) {
|
|
177
|
-
if (
|
|
178
|
-
e.preventDefault(),
|
|
177
|
+
if (z.value.length > 0 && H.value >= 0) {
|
|
178
|
+
e.preventDefault(), Ne();
|
|
179
179
|
return;
|
|
180
180
|
}
|
|
181
|
-
if (
|
|
182
|
-
e.preventDefault(),
|
|
181
|
+
if (me()) {
|
|
182
|
+
e.preventDefault(), We();
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
if (Ue()) {
|
|
186
|
+
e.preventDefault(), je();
|
|
183
187
|
return;
|
|
184
188
|
}
|
|
185
189
|
}
|
|
186
|
-
if (
|
|
190
|
+
if (C.value && O.value.length > 0)
|
|
187
191
|
switch (e.key) {
|
|
188
192
|
case "ArrowDown":
|
|
189
|
-
e.preventDefault(), (t =
|
|
193
|
+
e.preventDefault(), (t = A.value) == null || t.moveDown();
|
|
190
194
|
return;
|
|
191
195
|
case "ArrowUp":
|
|
192
|
-
e.preventDefault(), (l =
|
|
196
|
+
e.preventDefault(), (l = A.value) == null || l.moveUp();
|
|
193
197
|
return;
|
|
194
198
|
case "Tab":
|
|
195
|
-
e.preventDefault(),
|
|
199
|
+
if (e.preventDefault(), Date.now() - se < 100)
|
|
200
|
+
return;
|
|
201
|
+
x(((a = s.value) == null ? void 0 : a.selectionStart) || 0), O.value.length > 0 && ((r = A.value) == null || r.selectCurrent());
|
|
196
202
|
return;
|
|
197
203
|
case "Enter":
|
|
198
|
-
if (!
|
|
204
|
+
if (!f.multiline)
|
|
199
205
|
break;
|
|
200
|
-
e.preventDefault(), (
|
|
206
|
+
e.preventDefault(), (v = A.value) == null || v.selectCurrent();
|
|
201
207
|
return;
|
|
202
208
|
case "Escape":
|
|
203
|
-
e.preventDefault(),
|
|
209
|
+
e.preventDefault(), W(), ie();
|
|
204
210
|
return;
|
|
205
211
|
}
|
|
206
212
|
if (e.key === " " && e.ctrlKey) {
|
|
207
|
-
e.preventDefault(),
|
|
213
|
+
e.preventDefault(), F();
|
|
208
214
|
return;
|
|
209
215
|
}
|
|
210
|
-
e.key === "Enter" && (
|
|
216
|
+
e.key === "Enter" && (f.multiline && e.ctrlKey || !f.multiline && !C.value) && (e.preventDefault(), ve(), b("submit", u.value));
|
|
211
217
|
}
|
|
212
|
-
function
|
|
213
|
-
if (
|
|
218
|
+
function Ne() {
|
|
219
|
+
if (H.value++, H.value >= z.value.length) {
|
|
214
220
|
ie();
|
|
215
221
|
return;
|
|
216
222
|
}
|
|
217
|
-
const e =
|
|
218
|
-
|
|
223
|
+
const e = z.value[H.value];
|
|
224
|
+
s.value && (s.value.setSelectionRange(e.start, e.end), s.value.focus(), x(e.start));
|
|
219
225
|
}
|
|
220
226
|
function ie() {
|
|
221
|
-
|
|
227
|
+
z.value = [], H.value = -1;
|
|
222
228
|
}
|
|
223
|
-
function
|
|
224
|
-
const e =
|
|
225
|
-
let l = !1,
|
|
226
|
-
for (let
|
|
227
|
-
const
|
|
228
|
-
(
|
|
229
|
+
function me() {
|
|
230
|
+
const e = K.value, t = u.value;
|
|
231
|
+
let l = !1, a = null;
|
|
232
|
+
for (let r = 0; r < e; r++) {
|
|
233
|
+
const v = t[r], p = r > 0 ? t[r - 1] : "";
|
|
234
|
+
(v === '"' || v === "'") && p !== "\\" && (l ? v === a && (l = !1, a = null) : (l = !0, a = v));
|
|
229
235
|
}
|
|
230
236
|
return l;
|
|
231
237
|
}
|
|
232
|
-
function
|
|
233
|
-
const e =
|
|
238
|
+
function Ue() {
|
|
239
|
+
const e = K.value, t = u.value;
|
|
240
|
+
if (e === 0) return !1;
|
|
241
|
+
const l = t[e - 1];
|
|
242
|
+
return l !== '"' && l !== "'" ? !1 : !me();
|
|
243
|
+
}
|
|
244
|
+
function je() {
|
|
245
|
+
const e = K.value, t = u.value, l = t[e];
|
|
246
|
+
if (l === " " || l === `
|
|
247
|
+
` || l === " ") {
|
|
248
|
+
const p = e + 1;
|
|
249
|
+
s.value && (s.value.setSelectionRange(p, p), x(p), F());
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
const a = t.substring(0, e), r = t.substring(e), v = a + " " + r;
|
|
253
|
+
u.value = v, b("update:modelValue", v), P(() => {
|
|
254
|
+
if (s.value) {
|
|
255
|
+
const p = e + 1;
|
|
256
|
+
s.value.setSelectionRange(p, p), x(p), F();
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
function We() {
|
|
261
|
+
const e = K.value, t = u.value;
|
|
234
262
|
for (let l = e; l < t.length; l++)
|
|
235
263
|
if (t[l] === '"' || t[l] === "'") {
|
|
236
|
-
const
|
|
237
|
-
|
|
264
|
+
const a = l + 1, r = t[a];
|
|
265
|
+
if (r && r !== " " && r !== `
|
|
266
|
+
` && r !== " ")
|
|
267
|
+
s.value && (s.value.setSelectionRange(a, a), x(a));
|
|
268
|
+
else if (!r || r === " " || r === `
|
|
269
|
+
` || r === " ")
|
|
270
|
+
if (r) {
|
|
271
|
+
const v = a + 1;
|
|
272
|
+
s.value && (s.value.setSelectionRange(v, v), x(v));
|
|
273
|
+
} else {
|
|
274
|
+
const v = t + " ";
|
|
275
|
+
u.value = v, b("update:modelValue", v), P(() => {
|
|
276
|
+
if (s.value) {
|
|
277
|
+
const p = a + 1;
|
|
278
|
+
s.value.setSelectionRange(p, p), x(p), F();
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
}
|
|
238
282
|
return;
|
|
239
283
|
}
|
|
240
284
|
}
|
|
241
|
-
function
|
|
242
|
-
|
|
243
|
-
|
|
285
|
+
function ye() {
|
|
286
|
+
k.value = !0, L.value = !1, U.value = Date.now(), P(() => {
|
|
287
|
+
J(), F();
|
|
244
288
|
});
|
|
245
289
|
}
|
|
246
|
-
function
|
|
290
|
+
function ge(e) {
|
|
247
291
|
const l = e.relatedTarget;
|
|
248
292
|
if (l != null && l.closest(".tql-autocomplete-dropdown")) {
|
|
249
293
|
setTimeout(() => {
|
|
250
|
-
|
|
294
|
+
k.value || (W(), y.value = !1);
|
|
251
295
|
}, 300);
|
|
252
296
|
return;
|
|
253
297
|
}
|
|
254
|
-
|
|
255
|
-
|
|
298
|
+
k.value = !1, setTimeout(() => {
|
|
299
|
+
k.value || (W(), y.value = !1);
|
|
256
300
|
}, 200);
|
|
257
301
|
}
|
|
258
|
-
function
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
302
|
+
function Ge(e) {
|
|
303
|
+
se = Date.now();
|
|
304
|
+
const t = Te(e);
|
|
305
|
+
u.value = t.query, b("update:modelValue", t.query), t.placeholders.length > 0 ? (z.value = t.placeholders, H.value = 0) : ie(), P(() => {
|
|
306
|
+
s.value && (s.value.focus(), s.value.setSelectionRange(t.newCursorPosition, t.newCursorPosition), x(t.newCursorPosition));
|
|
262
307
|
});
|
|
263
308
|
}
|
|
264
|
-
function
|
|
265
|
-
const t =
|
|
266
|
-
|
|
267
|
-
|
|
309
|
+
function Je(e) {
|
|
310
|
+
const t = Ee(e);
|
|
311
|
+
u.value = t, b("update:modelValue", t), P(() => {
|
|
312
|
+
s.value && s.value.focus();
|
|
268
313
|
});
|
|
269
314
|
}
|
|
270
|
-
function
|
|
315
|
+
function Xe() {
|
|
271
316
|
var e;
|
|
272
|
-
(e =
|
|
317
|
+
(e = s.value) == null || e.focus();
|
|
273
318
|
}
|
|
274
|
-
function
|
|
319
|
+
function Ye() {
|
|
275
320
|
var e;
|
|
276
|
-
(e =
|
|
321
|
+
(e = s.value) == null || e.blur();
|
|
277
322
|
}
|
|
278
|
-
function
|
|
323
|
+
function we() {
|
|
279
324
|
var e;
|
|
280
|
-
return ((e =
|
|
325
|
+
return ((e = s.value) == null ? void 0 : e.selectionStart) || 0;
|
|
281
326
|
}
|
|
282
|
-
function
|
|
283
|
-
|
|
327
|
+
function be(e) {
|
|
328
|
+
s.value && (s.value.setSelectionRange(e, e), x(e));
|
|
284
329
|
}
|
|
285
|
-
function
|
|
286
|
-
const t =
|
|
287
|
-
|
|
288
|
-
|
|
330
|
+
function Ze(e) {
|
|
331
|
+
const t = we(), l = u.value.substring(0, t), a = u.value.substring(t), r = l + e + a;
|
|
332
|
+
u.value = r, b("update:modelValue", r), P(() => {
|
|
333
|
+
be(t + e.length);
|
|
289
334
|
});
|
|
290
335
|
}
|
|
291
|
-
function
|
|
292
|
-
const l = Date.now() - e,
|
|
293
|
-
return
|
|
336
|
+
function _e(e) {
|
|
337
|
+
const l = Date.now() - e, a = Math.floor(l / 1e3), r = Math.floor(a / 60), v = Math.floor(r / 60), p = Math.floor(v / 24);
|
|
338
|
+
return p > 0 ? `${p}d ago` : v > 0 ? `${v}h ago` : r > 0 ? `${r}m ago` : "just now";
|
|
294
339
|
}
|
|
295
|
-
function
|
|
340
|
+
function qe(e) {
|
|
296
341
|
var l;
|
|
297
342
|
const t = e.target;
|
|
298
|
-
(l =
|
|
343
|
+
(l = q.value) != null && l.contains(t) || (V.value = !1, R.value = !1);
|
|
299
344
|
}
|
|
300
|
-
|
|
301
|
-
focus:
|
|
302
|
-
blur:
|
|
345
|
+
Ce({
|
|
346
|
+
focus: Xe,
|
|
347
|
+
blur: Ye,
|
|
303
348
|
validate: Ie,
|
|
304
|
-
insertText:
|
|
305
|
-
insertSnippet:
|
|
306
|
-
getTokenAtPosition:
|
|
307
|
-
getCursorPosition:
|
|
308
|
-
setCursorPosition:
|
|
349
|
+
insertText: Ze,
|
|
350
|
+
insertSnippet: Je,
|
|
351
|
+
getTokenAtPosition: He,
|
|
352
|
+
getCursorPosition: we,
|
|
353
|
+
setCursorPosition: be
|
|
309
354
|
});
|
|
310
|
-
function
|
|
311
|
-
(
|
|
355
|
+
function Y() {
|
|
356
|
+
(C.value || I.value) && k.value && J();
|
|
312
357
|
}
|
|
313
|
-
return
|
|
314
|
-
document.addEventListener("selectionchange",
|
|
315
|
-
|
|
316
|
-
}, 500),
|
|
317
|
-
|
|
358
|
+
return tt(() => {
|
|
359
|
+
document.addEventListener("selectionchange", X), document.addEventListener("click", qe), window.addEventListener("scroll", Y, !0), window.addEventListener("resize", Y), f.minHeight && q.value && q.value.style.setProperty("--tql-min-height", f.minHeight), j = setInterval(() => {
|
|
360
|
+
k.value && U.value > 0 && Date.now() - U.value >= Qt && !L.value && (L.value = !0);
|
|
361
|
+
}, 500), P(() => {
|
|
362
|
+
J();
|
|
318
363
|
});
|
|
319
|
-
}),
|
|
364
|
+
}), _(
|
|
320
365
|
() => I.value,
|
|
321
366
|
(e) => {
|
|
322
|
-
e &&
|
|
323
|
-
|
|
367
|
+
e && P(() => {
|
|
368
|
+
J();
|
|
324
369
|
});
|
|
325
370
|
},
|
|
326
371
|
{ immediate: !0 }
|
|
327
|
-
),
|
|
328
|
-
|
|
372
|
+
), _(
|
|
373
|
+
B,
|
|
329
374
|
(e) => {
|
|
330
|
-
if (e &&
|
|
331
|
-
const t =
|
|
375
|
+
if (e && q.value) {
|
|
376
|
+
const t = q.value.getBoundingClientRect();
|
|
332
377
|
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`);
|
|
333
378
|
}
|
|
334
379
|
}
|
|
335
|
-
),
|
|
336
|
-
document.removeEventListener("selectionchange",
|
|
337
|
-
}), (e, t) => (
|
|
380
|
+
), lt(() => {
|
|
381
|
+
document.removeEventListener("selectionchange", X), document.removeEventListener("click", qe), window.removeEventListener("scroll", Y, !0), window.removeEventListener("resize", Y), j && (clearInterval(j), j = null);
|
|
382
|
+
}), (e, t) => (o(), n("div", {
|
|
338
383
|
ref_key: "wrapperRef",
|
|
339
|
-
ref:
|
|
340
|
-
class:
|
|
384
|
+
ref: q,
|
|
385
|
+
class: S([
|
|
341
386
|
"tql-input-wrapper",
|
|
342
387
|
{
|
|
343
|
-
"tql-input-focused":
|
|
344
|
-
"tql-input-invalid":
|
|
345
|
-
"tql-input-disabled":
|
|
346
|
-
"tql-input-multiline":
|
|
347
|
-
"tql-input-autocomplete-active":
|
|
348
|
-
"tql-input-resizable":
|
|
349
|
-
"tql-input-has-min-height": !!
|
|
388
|
+
"tql-input-focused": k.value,
|
|
389
|
+
"tql-input-invalid": c(I) && i.showValidation,
|
|
390
|
+
"tql-input-disabled": i.disabled,
|
|
391
|
+
"tql-input-multiline": i.multiline,
|
|
392
|
+
"tql-input-autocomplete-active": c(C),
|
|
393
|
+
"tql-input-resizable": i.resizable && i.multiline,
|
|
394
|
+
"tql-input-has-min-height": !!i.minHeight
|
|
350
395
|
}
|
|
351
396
|
])
|
|
352
397
|
}, [
|
|
353
|
-
|
|
354
|
-
(
|
|
355
|
-
key:
|
|
356
|
-
class:
|
|
357
|
-
},
|
|
358
|
-
])) :
|
|
359
|
-
|
|
398
|
+
i.syntaxHighlighting ? (o(), n("div", ct, [
|
|
399
|
+
(o(!0), n(M, null, N(c(De), (l, a) => (o(), n("span", {
|
|
400
|
+
key: a,
|
|
401
|
+
class: S(Fe(l))
|
|
402
|
+
}, w(l.raw || l.value), 3))), 128))
|
|
403
|
+
])) : m("", !0),
|
|
404
|
+
i.multiline ? ae((o(), n("textarea", {
|
|
360
405
|
key: 1,
|
|
361
|
-
id:
|
|
406
|
+
id: ue,
|
|
362
407
|
ref_key: "inputRef",
|
|
363
|
-
ref:
|
|
364
|
-
"onUpdate:modelValue": t[0] || (t[0] = (l) =>
|
|
365
|
-
class:
|
|
366
|
-
placeholder:
|
|
367
|
-
disabled:
|
|
368
|
-
readonly:
|
|
369
|
-
rows:
|
|
408
|
+
ref: s,
|
|
409
|
+
"onUpdate:modelValue": t[0] || (t[0] = (l) => u.value = l),
|
|
410
|
+
class: S(["tql-input", { "tql-input-highlighted": i.syntaxHighlighting, "tql-input-resizable-textarea": i.resizable }]),
|
|
411
|
+
placeholder: i.placeholder,
|
|
412
|
+
disabled: i.disabled,
|
|
413
|
+
readonly: i.readonly,
|
|
414
|
+
rows: i.rows,
|
|
370
415
|
role: "combobox",
|
|
371
|
-
"aria-expanded":
|
|
372
|
-
"aria-controls":
|
|
373
|
-
"aria-invalid":
|
|
374
|
-
"aria-describedby":
|
|
416
|
+
"aria-expanded": c(C) && k.value,
|
|
417
|
+
"aria-controls": te,
|
|
418
|
+
"aria-invalid": c(I) && i.showValidation,
|
|
419
|
+
"aria-describedby": c(I) && y.value ? le : void 0,
|
|
375
420
|
"aria-autocomplete": "list",
|
|
376
421
|
"aria-haspopup": "listbox",
|
|
377
422
|
spellcheck: "false",
|
|
378
423
|
autocomplete: "off",
|
|
379
424
|
autocapitalize: "off",
|
|
380
|
-
onInput:
|
|
381
|
-
onKeydown:
|
|
382
|
-
onFocus:
|
|
383
|
-
onBlur:
|
|
384
|
-
onClick:
|
|
385
|
-
}, null, 42,
|
|
386
|
-
[
|
|
387
|
-
]) :
|
|
425
|
+
onInput: pe,
|
|
426
|
+
onKeydown: he,
|
|
427
|
+
onFocus: ye,
|
|
428
|
+
onBlur: ge,
|
|
429
|
+
onClick: X
|
|
430
|
+
}, null, 42, dt)), [
|
|
431
|
+
[ne, u.value]
|
|
432
|
+
]) : ae((o(), n("input", {
|
|
388
433
|
key: 2,
|
|
389
|
-
id:
|
|
434
|
+
id: ue,
|
|
390
435
|
ref_key: "inputRef",
|
|
391
|
-
ref:
|
|
392
|
-
"onUpdate:modelValue": t[1] || (t[1] = (l) =>
|
|
436
|
+
ref: s,
|
|
437
|
+
"onUpdate:modelValue": t[1] || (t[1] = (l) => u.value = l),
|
|
393
438
|
type: "text",
|
|
394
|
-
class:
|
|
395
|
-
placeholder:
|
|
396
|
-
disabled:
|
|
397
|
-
readonly:
|
|
439
|
+
class: S(["tql-input", { "tql-input-highlighted": i.syntaxHighlighting }]),
|
|
440
|
+
placeholder: i.placeholder,
|
|
441
|
+
disabled: i.disabled,
|
|
442
|
+
readonly: i.readonly,
|
|
398
443
|
role: "combobox",
|
|
399
|
-
"aria-expanded":
|
|
400
|
-
"aria-controls":
|
|
401
|
-
"aria-invalid":
|
|
402
|
-
"aria-describedby":
|
|
444
|
+
"aria-expanded": c(C) && k.value,
|
|
445
|
+
"aria-controls": te,
|
|
446
|
+
"aria-invalid": c(I) && i.showValidation,
|
|
447
|
+
"aria-describedby": c(I) && y.value ? le : void 0,
|
|
403
448
|
"aria-autocomplete": "list",
|
|
404
449
|
"aria-haspopup": "listbox",
|
|
405
450
|
spellcheck: "false",
|
|
406
451
|
autocomplete: "off",
|
|
407
452
|
autocapitalize: "off",
|
|
408
|
-
onInput:
|
|
409
|
-
onKeydown:
|
|
410
|
-
onFocus:
|
|
411
|
-
onBlur:
|
|
412
|
-
onClick:
|
|
413
|
-
}, null, 42,
|
|
414
|
-
[
|
|
453
|
+
onInput: pe,
|
|
454
|
+
onKeydown: he,
|
|
455
|
+
onFocus: ye,
|
|
456
|
+
onBlur: ge,
|
|
457
|
+
onClick: X
|
|
458
|
+
}, null, 42, vt)), [
|
|
459
|
+
[ne, u.value]
|
|
415
460
|
]),
|
|
416
|
-
|
|
417
|
-
|
|
461
|
+
d("div", ft, [
|
|
462
|
+
i.showComplexity && g.value && u.value.trim() ? (o(), n("div", {
|
|
418
463
|
key: 0,
|
|
419
|
-
class:
|
|
420
|
-
title: `${
|
|
464
|
+
class: S(["tql-complexity-badge", Be.value]),
|
|
465
|
+
title: `${ce.value} complexity - ${g.value.warnings.length} warning(s)`
|
|
421
466
|
}, [
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
], 10,
|
|
425
|
-
|
|
467
|
+
d("span", ht, w(ce.value), 1),
|
|
468
|
+
g.value.warnings.length > 0 ? (o(), n("span", mt, w(g.value.warnings.length), 1)) : m("", !0)
|
|
469
|
+
], 10, pt)) : m("", !0),
|
|
470
|
+
i.showHistory ? (o(), n("button", {
|
|
426
471
|
key: 1,
|
|
427
472
|
type: "button",
|
|
428
|
-
class:
|
|
473
|
+
class: S(["tql-toolbar-button", { "tql-toolbar-button--active": V.value }]),
|
|
429
474
|
title: "Query history",
|
|
430
|
-
onClick:
|
|
475
|
+
onClick: Q(Ae, ["stop"])
|
|
431
476
|
}, [...t[10] || (t[10] = [
|
|
432
|
-
|
|
433
|
-
])], 2)) :
|
|
434
|
-
|
|
477
|
+
d("i", { class: "pi pi-history" }, null, -1)
|
|
478
|
+
])], 2)) : m("", !0),
|
|
479
|
+
i.showPreview ? (o(), n("button", {
|
|
435
480
|
key: 2,
|
|
436
481
|
type: "button",
|
|
437
|
-
class:
|
|
482
|
+
class: S(["tql-toolbar-button", { "tql-toolbar-button--active": R.value }]),
|
|
438
483
|
title: "Preview query structure",
|
|
439
|
-
onClick:
|
|
484
|
+
onClick: Q(Le, ["stop"])
|
|
440
485
|
}, [...t[11] || (t[11] = [
|
|
441
|
-
|
|
442
|
-
])], 2)) :
|
|
443
|
-
|
|
486
|
+
d("i", { class: "pi pi-sitemap" }, null, -1)
|
|
487
|
+
])], 2)) : m("", !0),
|
|
488
|
+
i.showSnippetButton && i.snippets && i.snippets.length > 0 ? (o(), n("button", {
|
|
444
489
|
key: 3,
|
|
445
490
|
type: "button",
|
|
446
491
|
class: "tql-toolbar-button tql-snippet-button",
|
|
447
492
|
title: "Insert snippet",
|
|
448
|
-
onClick: t[2] || (t[2] =
|
|
493
|
+
onClick: t[2] || (t[2] = Q(() => {
|
|
449
494
|
}, ["stop"]))
|
|
450
495
|
}, [...t[12] || (t[12] = [
|
|
451
|
-
|
|
452
|
-
])])) :
|
|
453
|
-
|
|
454
|
-
|
|
496
|
+
d("i", { class: "pi pi-code" }, null, -1)
|
|
497
|
+
])])) : m("", !0),
|
|
498
|
+
i.showValidation && u.value ? (o(), n("div", yt, [
|
|
499
|
+
c(oe) ? (o(), n("i", gt)) : (o(), n("i", {
|
|
455
500
|
key: 1,
|
|
456
501
|
class: "pi pi-exclamation-circle tql-icon-invalid tql-icon-clickable",
|
|
457
502
|
role: "button",
|
|
458
503
|
tabindex: "0",
|
|
459
504
|
title: "Click to show/hide errors",
|
|
460
|
-
"aria-label": `Query has ${
|
|
461
|
-
"aria-expanded":
|
|
462
|
-
onClick: t[3] || (t[3] = (l) =>
|
|
505
|
+
"aria-label": `Query has ${c(D).length} error${c(D).length === 1 ? "" : "s"}. Click to ${y.value ? "hide" : "show"} details.`,
|
|
506
|
+
"aria-expanded": y.value,
|
|
507
|
+
onClick: t[3] || (t[3] = (l) => y.value = !y.value),
|
|
463
508
|
onKeydown: [
|
|
464
|
-
t[4] || (t[4] =
|
|
465
|
-
t[5] || (t[5] =
|
|
509
|
+
t[4] || (t[4] = ke((l) => y.value = !y.value, ["enter"])),
|
|
510
|
+
t[5] || (t[5] = ke(Q((l) => y.value = !y.value, ["prevent"]), ["space"]))
|
|
466
511
|
]
|
|
467
|
-
}, null, 40,
|
|
468
|
-
])) :
|
|
512
|
+
}, null, 40, wt))
|
|
513
|
+
])) : m("", !0)
|
|
469
514
|
]),
|
|
470
|
-
|
|
515
|
+
i.showHistory && V.value ? (o(), n("div", {
|
|
471
516
|
key: 3,
|
|
472
517
|
class: "tql-history-dropdown",
|
|
473
|
-
onClick: t[8] || (t[8] =
|
|
518
|
+
onClick: t[8] || (t[8] = Q(() => {
|
|
474
519
|
}, ["stop"]))
|
|
475
520
|
}, [
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
"onUpdate:modelValue": t[6] || (t[6] = (l) =>
|
|
521
|
+
d("div", bt, [
|
|
522
|
+
ae(d("input", {
|
|
523
|
+
"onUpdate:modelValue": t[6] || (t[6] = (l) => E.value = l),
|
|
479
524
|
type: "text",
|
|
480
525
|
class: "tql-history-search",
|
|
481
526
|
placeholder: "Search history...",
|
|
482
|
-
onKeydown: t[7] || (t[7] =
|
|
527
|
+
onKeydown: t[7] || (t[7] = Q(() => {
|
|
483
528
|
}, ["stop"]))
|
|
484
529
|
}, null, 544), [
|
|
485
|
-
[
|
|
530
|
+
[ne, E.value]
|
|
486
531
|
])
|
|
487
532
|
]),
|
|
488
|
-
|
|
489
|
-
(
|
|
533
|
+
d("div", qt, [
|
|
534
|
+
(o(!0), n(M, null, N(de.value, (l) => (o(), n("div", {
|
|
490
535
|
key: l.id,
|
|
491
|
-
class:
|
|
492
|
-
onClick: (
|
|
536
|
+
class: S(["tql-history-item", { "tql-history-item--favorite": l.isFavorite }]),
|
|
537
|
+
onClick: (a) => Me(l)
|
|
493
538
|
}, [
|
|
494
|
-
|
|
539
|
+
d("button", {
|
|
495
540
|
type: "button",
|
|
496
541
|
class: "tql-history-favorite",
|
|
497
542
|
title: l.isFavorite ? "Remove from favorites" : "Add to favorites",
|
|
498
|
-
onClick: (
|
|
543
|
+
onClick: (a) => Qe(l, a)
|
|
499
544
|
}, [
|
|
500
|
-
|
|
501
|
-
class:
|
|
545
|
+
d("i", {
|
|
546
|
+
class: S(l.isFavorite ? "pi pi-star-fill" : "pi pi-star")
|
|
502
547
|
}, null, 2)
|
|
503
|
-
], 8,
|
|
504
|
-
|
|
505
|
-
l.label ? (
|
|
506
|
-
|
|
548
|
+
], 8, xt),
|
|
549
|
+
d("div", Ct, [
|
|
550
|
+
l.label ? (o(), n("div", Pt, w(l.label), 1)) : m("", !0),
|
|
551
|
+
d("div", St, w(l.query), 1)
|
|
507
552
|
]),
|
|
508
|
-
|
|
509
|
-
], 10,
|
|
510
|
-
de.value.length === 0 ? (
|
|
553
|
+
d("div", Vt, w(_e(l.timestamp)), 1)
|
|
554
|
+
], 10, kt))), 128)),
|
|
555
|
+
de.value.length === 0 ? (o(), n("div", Rt, w(E.value ? "No matching queries" : "No query history"), 1)) : m("", !0)
|
|
511
556
|
])
|
|
512
|
-
])) :
|
|
513
|
-
|
|
514
|
-
id:
|
|
557
|
+
])) : m("", !0),
|
|
558
|
+
xe(at, {
|
|
559
|
+
id: te,
|
|
515
560
|
ref_key: "autocompleteRef",
|
|
516
|
-
ref:
|
|
517
|
-
items:
|
|
518
|
-
visible:
|
|
519
|
-
position:
|
|
520
|
-
onSelect:
|
|
521
|
-
onClose:
|
|
561
|
+
ref: A,
|
|
562
|
+
items: c(O),
|
|
563
|
+
visible: c(C) && k.value && Ke.value,
|
|
564
|
+
position: G.value,
|
|
565
|
+
onSelect: Ge,
|
|
566
|
+
onClose: c(W)
|
|
522
567
|
}, null, 8, ["items", "visible", "position", "onClose"]),
|
|
523
|
-
(
|
|
524
|
-
|
|
568
|
+
(o(), ot(it, { to: "body" }, [
|
|
569
|
+
i.showValidation && !c(oe) && ze.value && u.value && c(D).length > 0 && !(c(C) && c(O).length > 0) && Oe.value ? (o(), n("div", {
|
|
525
570
|
key: 0,
|
|
526
571
|
ref_key: "validationMessagesRef",
|
|
527
|
-
ref:
|
|
528
|
-
id:
|
|
572
|
+
ref: B,
|
|
573
|
+
id: le,
|
|
529
574
|
class: "tql-validation-messages-portal",
|
|
530
575
|
role: "alert",
|
|
531
576
|
"aria-live": "polite"
|
|
532
577
|
}, [
|
|
533
|
-
(
|
|
534
|
-
key:
|
|
578
|
+
(o(!0), n(M, null, N(c(D).slice(0, 3), (l, a) => (o(), n("div", {
|
|
579
|
+
key: a,
|
|
535
580
|
class: "tql-error-message"
|
|
536
581
|
}, [
|
|
537
|
-
t[13] || (t[13] =
|
|
582
|
+
t[13] || (t[13] = d("i", {
|
|
538
583
|
class: "pi pi-exclamation-triangle",
|
|
539
584
|
"aria-hidden": "true"
|
|
540
585
|
}, null, -1)),
|
|
541
|
-
|
|
542
|
-
l.suggestion ? (
|
|
586
|
+
d("span", null, w(l.message), 1),
|
|
587
|
+
l.suggestion ? (o(), n("span", $t, w(l.suggestion), 1)) : m("", !0)
|
|
543
588
|
]))), 128))
|
|
544
|
-
], 512)) :
|
|
589
|
+
], 512)) : m("", !0)
|
|
545
590
|
])),
|
|
546
|
-
|
|
547
|
-
(
|
|
548
|
-
key:
|
|
549
|
-
class:
|
|
591
|
+
i.showComplexity && g.value && g.value.warnings.length > 0 && !c(C) ? (o(), n("div", Dt, [
|
|
592
|
+
(o(!0), n(M, null, N(g.value.warnings.slice(0, 3), (l, a) => (o(), n("div", {
|
|
593
|
+
key: a,
|
|
594
|
+
class: S(["tql-complexity-warning", `tql-complexity-warning--${l.severity}`])
|
|
550
595
|
}, [
|
|
551
|
-
t[14] || (t[14] =
|
|
596
|
+
t[14] || (t[14] = d("i", {
|
|
552
597
|
class: "pi pi-info-circle",
|
|
553
598
|
"aria-hidden": "true"
|
|
554
599
|
}, null, -1)),
|
|
555
|
-
|
|
600
|
+
d("span", null, w(l.message), 1)
|
|
556
601
|
], 2))), 128)),
|
|
557
|
-
|
|
558
|
-
(
|
|
559
|
-
key:
|
|
602
|
+
g.value.suggestions.length > 0 ? (o(), n("div", It, [
|
|
603
|
+
(o(!0), n(M, null, N(g.value.suggestions.slice(0, 2), (l, a) => (o(), n("div", {
|
|
604
|
+
key: a,
|
|
560
605
|
class: "tql-complexity-suggestion"
|
|
561
606
|
}, [
|
|
562
|
-
t[15] || (t[15] =
|
|
607
|
+
t[15] || (t[15] = d("i", {
|
|
563
608
|
class: "pi pi-lightbulb",
|
|
564
609
|
"aria-hidden": "true"
|
|
565
610
|
}, null, -1)),
|
|
566
|
-
|
|
611
|
+
d("span", null, w(l), 1)
|
|
567
612
|
]))), 128))
|
|
568
|
-
])) :
|
|
569
|
-
])) :
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
t[17] || (t[17] =
|
|
573
|
-
|
|
613
|
+
])) : m("", !0)
|
|
614
|
+
])) : m("", !0),
|
|
615
|
+
i.showPreview && R.value && u.value.trim() ? (o(), n("div", Tt, [
|
|
616
|
+
d("div", Et, [
|
|
617
|
+
t[17] || (t[17] = d("span", null, "Query Structure", -1)),
|
|
618
|
+
d("button", {
|
|
574
619
|
type: "button",
|
|
575
620
|
class: "tql-preview-close",
|
|
576
621
|
title: "Close preview",
|
|
577
|
-
onClick: t[9] || (t[9] = (l) =>
|
|
622
|
+
onClick: t[9] || (t[9] = (l) => R.value = !1)
|
|
578
623
|
}, [...t[16] || (t[16] = [
|
|
579
|
-
|
|
624
|
+
d("i", { class: "pi pi-times" }, null, -1)
|
|
580
625
|
])])
|
|
581
626
|
]),
|
|
582
|
-
|
|
583
|
-
query:
|
|
627
|
+
xe(nt, {
|
|
628
|
+
query: u.value,
|
|
584
629
|
"show-complexity": !1,
|
|
585
630
|
"show-field-usage": !0,
|
|
586
631
|
"show-logic-tree": !0,
|
|
587
632
|
compact: ""
|
|
588
633
|
}, null, 8, ["query"])
|
|
589
|
-
])) :
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
], 64)) :
|
|
634
|
+
])) : m("", !0),
|
|
635
|
+
d("div", Ht, [
|
|
636
|
+
i.showValidation && u.value ? (o(), n(M, { key: 0 }, [
|
|
637
|
+
c(oe) ? (o(), n("span", Bt, "Query syntax is valid")) : (o(), n("span", Mt, "Query has " + w(c(D).length) + " validation error" + w(c(D).length === 1 ? "" : "s"), 1))
|
|
638
|
+
], 64)) : m("", !0)
|
|
594
639
|
])
|
|
595
640
|
], 2));
|
|
596
641
|
}
|
|
597
642
|
});
|
|
598
643
|
export {
|
|
599
|
-
|
|
644
|
+
Nt as default
|
|
600
645
|
};
|