|
|
|
@ -145,13 +145,6 @@ const suggestionsList = computed(() => {
|
|
|
|
|
// set default suggestion list |
|
|
|
|
const suggestion: Ref<Record<string, any>[]> = ref(suggestionsList.value) |
|
|
|
|
|
|
|
|
|
const suggestedFormulas = computed(() => { |
|
|
|
|
return suggestion.value.filter((s) => s && s.type !== 'column') |
|
|
|
|
}) |
|
|
|
|
const variableList = computed(() => { |
|
|
|
|
return suggestion.value.filter((s) => s && s.type === 'column') |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const acTree = computed(() => { |
|
|
|
|
const ref = new NcAutocompleteTree() |
|
|
|
|
for (const sug of suggestionsList.value) { |
|
|
|
@ -160,6 +153,14 @@ const acTree = computed(() => {
|
|
|
|
|
return ref |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const suggestedFormulas = computed(() => { |
|
|
|
|
return suggestion.value.filter((s) => s && s.type !== 'column') |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const variableList = computed(() => { |
|
|
|
|
return suggestion.value.filter((s) => s && s.type === 'column') |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
function isCurlyBracketBalanced() { |
|
|
|
|
// count number of opening curly brackets and closing curly brackets |
|
|
|
|
const cntCurlyBrackets = (formulaRef.value.$el.value.match(/\{|}/g) || []).reduce( |
|
|
|
@ -252,7 +253,6 @@ function suggestionListDown() {
|
|
|
|
|
function scrollToSelectedOption() { |
|
|
|
|
nextTick(() => { |
|
|
|
|
if (sugOptionsRef.value[selected.value]) { |
|
|
|
|
console.log('scrollToSelectedOption', selected.value, sugOptionsRef.value[selected.value].$el, sugListRef.value) |
|
|
|
|
try { |
|
|
|
|
sugOptionsRef.value[selected.value].$el.scrollIntoView({ |
|
|
|
|
block: 'nearest', |
|
|
|
|