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