@tekkare/auriga 0.1.0 → 0.1.4
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/module.json +1 -1
- package/dist/runtime/components/argAdvancedSearchBar.vue +318 -321
- package/dist/runtime/components/argAdvancedSearchBar.vue.d.ts +89 -3
- package/dist/runtime/components/argBtn.vue +48 -39
- package/dist/runtime/components/argBtn.vue.d.ts +72 -3
- package/dist/runtime/components/argComplexSelect.vue +255 -256
- package/dist/runtime/components/argComplexSelect.vue.d.ts +175 -3
- package/dist/runtime/components/argDataLoader.vue +8 -3
- package/dist/runtime/components/argDataLoader.vue.d.ts +1 -3
- package/dist/runtime/components/argDropdownSelect.vue +145 -138
- package/dist/runtime/components/argDropdownSelect.vue.d.ts +139 -3
- package/dist/runtime/components/argFileBtn.vue +58 -56
- package/dist/runtime/components/argFileBtn.vue.d.ts +60 -3
- package/dist/runtime/components/argHeaderTabs.vue +91 -103
- package/dist/runtime/components/argHeaderTabs.vue.d.ts +29 -3
- package/dist/runtime/components/argIcon.vue +2136 -3117
- package/dist/runtime/components/argIcon.vue.d.ts +1110 -2
- package/dist/runtime/components/argMultipleChoice.vue +84 -78
- package/dist/runtime/components/argMultipleChoice.vue.d.ts +49 -3
- package/dist/runtime/components/argNoData.vue +28 -25
- package/dist/runtime/components/argNoData.vue.d.ts +26 -3
- package/dist/runtime/components/argSearchInput.vue +39 -37
- package/dist/runtime/components/argSearchInput.vue.d.ts +32 -3
- package/dist/runtime/components/argSimpleLabel.vue +13 -11
- package/dist/runtime/components/argSimpleLabel.vue.d.ts +13 -3
- package/dist/runtime/components/argStyle.vue +11 -3
- package/dist/runtime/components/argStyle.vue.d.ts +1 -3
- package/dist/runtime/components/argTable.vue +384 -395
- package/dist/runtime/components/argTable.vue.d.ts +337 -3
- package/dist/runtime/components/argTags.vue +20 -10
- package/dist/runtime/components/argTags.vue.d.ts +26 -3
- package/dist/runtime/components/argTekkareLoader.vue +5 -2
- package/dist/runtime/components/argTekkareLoader.vue.d.ts +1 -3
- package/dist/runtime/components/argTooltip.vue +11 -11
- package/dist/runtime/components/argTooltip.vue.d.ts +39 -3
- package/package.json +5 -2
|
@@ -152,348 +152,345 @@
|
|
|
152
152
|
</div>
|
|
153
153
|
</template>
|
|
154
154
|
<script>
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
},
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
155
|
+
import {
|
|
156
|
+
onMounted,
|
|
157
|
+
ref,
|
|
158
|
+
computed,
|
|
159
|
+
watch,
|
|
160
|
+
defineComponent
|
|
161
|
+
} from "vue";
|
|
162
|
+
import argIcon from "./argIcon.vue";
|
|
163
|
+
export default defineComponent({
|
|
164
|
+
name: "argAdvancedSearchBar",
|
|
165
|
+
components: { argIcon },
|
|
166
|
+
props: {
|
|
167
|
+
placeHolderValue: {
|
|
168
|
+
type: String,
|
|
169
|
+
default: "Type your search"
|
|
170
|
+
},
|
|
171
|
+
customShortcuts: {
|
|
172
|
+
type: Array,
|
|
173
|
+
default: () => []
|
|
174
|
+
}
|
|
169
175
|
},
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
const emit = defineEmits(["update:Value", "onClose"]);
|
|
201
|
-
|
|
202
|
-
let iconColor = computed(() => {
|
|
203
|
-
if (typing.value === true) {
|
|
204
|
-
return "var(--primary)";
|
|
205
|
-
} else return "var(--wild-blue-yonder)";
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
let hasShortcut = computed(() => {
|
|
209
|
-
if (selectedShortcut.value.length > 0 || hoverShortcut.value.length > 0) {
|
|
210
|
-
return true;
|
|
211
|
-
} else return false;
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
let infoHeight = computed(() => {
|
|
215
|
-
if ((showInfo.value = true)) {
|
|
216
|
-
const infoSection = document.getElementById("info");
|
|
217
|
-
const shortcutSection = document.getElementById("shortcuts");
|
|
218
|
-
if (infoSection !== null && shortcutSection !== null) {
|
|
219
|
-
if (infoSection.offsetHeight > shortcutSection.offsetHeight) {
|
|
176
|
+
emits: ["update:Value", "onClose"],
|
|
177
|
+
setup(props, { emit }) {
|
|
178
|
+
const typing = ref(false);
|
|
179
|
+
const shortcuts = ref([
|
|
180
|
+
{ keyword: "and", value: "add the word", symbol: "+" },
|
|
181
|
+
{ keyword: "or", value: "matches at least one word", symbol: "/" },
|
|
182
|
+
{ keyword: "not", value: "exclude the word", symbol: "!" }
|
|
183
|
+
]);
|
|
184
|
+
const hoverShortcut = ref("");
|
|
185
|
+
const selectedShortcut = ref("");
|
|
186
|
+
const searchedWords = ref([]);
|
|
187
|
+
const closeIndex = ref();
|
|
188
|
+
const value = ref("");
|
|
189
|
+
const selectedTag = ref();
|
|
190
|
+
const duplicate = ref("");
|
|
191
|
+
const searchBar = ref();
|
|
192
|
+
const tagsSection = ref();
|
|
193
|
+
const shortcutIndex = ref(-1);
|
|
194
|
+
const removeSelected = ref(false);
|
|
195
|
+
const hoverTag = ref();
|
|
196
|
+
const showInfo = ref();
|
|
197
|
+
const regexSearch = /^[\s\.\+\/\!]|(?:[\+\/\!\s])[\s{1,}\.{1,}\+{1,}\/{1,}\!{1,}]|[\s{1,}\.1,}\+{1,}\/{1,}\!{1,}]$|\s+[\+\/]|\s+$/g;
|
|
198
|
+
const iconColor = computed(() => {
|
|
199
|
+
if (typing.value === true) {
|
|
200
|
+
return "var(--primary)";
|
|
201
|
+
} else
|
|
202
|
+
return "var(--wild-blue-yonder)";
|
|
203
|
+
});
|
|
204
|
+
const hasShortcut = computed(() => {
|
|
205
|
+
if (selectedShortcut.value.length > 0 || hoverShortcut.value.length > 0) {
|
|
220
206
|
return true;
|
|
221
|
-
} else
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
207
|
+
} else
|
|
208
|
+
return false;
|
|
209
|
+
});
|
|
210
|
+
const infoHeight = computed(() => {
|
|
211
|
+
if (showInfo.value = true) {
|
|
212
|
+
const infoSection = document.getElementById("info");
|
|
213
|
+
const shortcutSection = document.getElementById("shortcuts");
|
|
214
|
+
if (infoSection !== null && shortcutSection !== null) {
|
|
215
|
+
if (infoSection.offsetHeight > shortcutSection.offsetHeight) {
|
|
216
|
+
return true;
|
|
217
|
+
} else
|
|
218
|
+
return false;
|
|
219
|
+
} else
|
|
220
|
+
return false;
|
|
221
|
+
} else
|
|
222
|
+
return false;
|
|
223
|
+
});
|
|
224
|
+
watch(value, (new_value) => {
|
|
225
|
+
if (new_value === "") {
|
|
226
|
+
hoverShortcut.value = "";
|
|
227
|
+
} else {
|
|
228
|
+
for (let i = 0; i < shortcuts.value.length; i++) {
|
|
229
|
+
if (new_value.startsWith(shortcuts.value[i].symbol)) {
|
|
230
|
+
selectedShortcut.value = shortcuts.value[i].symbol;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
233
|
}
|
|
234
|
+
});
|
|
235
|
+
watch(selectedShortcut, (new_shortcut) => {
|
|
236
|
+
value.value = `${new_shortcut}`;
|
|
237
|
+
});
|
|
238
|
+
watch(closeIndex, (new_index) => {
|
|
239
|
+
if (new_index > searchedWords.value.length) {
|
|
240
|
+
removeSelected.value = true;
|
|
241
|
+
} else
|
|
242
|
+
removeSelected.value = false;
|
|
243
|
+
});
|
|
244
|
+
watch(searchedWords, (newSearched) => {
|
|
245
|
+
setTimeout(() => {
|
|
246
|
+
tagsSection.value.scrollLeft += tagsSection.value.scrollWidth;
|
|
247
|
+
}, 100);
|
|
248
|
+
});
|
|
249
|
+
onMounted(() => {
|
|
250
|
+
searchBar.value = document.getElementById("search_input");
|
|
251
|
+
tagsSection.value = document.getElementById("tags");
|
|
252
|
+
if (props.customShortcuts.length > 0) {
|
|
253
|
+
for (let i = 0; i < props.customShortcuts.length; i++) {
|
|
254
|
+
shortcuts.value.push(props.customShortcuts[i]);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
function shortcutColor(shortcut) {
|
|
259
|
+
if (shortcut === selectedShortcut.value || shortcut === hoverShortcut.value) {
|
|
260
|
+
return "var(--independence)";
|
|
261
|
+
} else
|
|
262
|
+
return "var(--pure-white)";
|
|
234
263
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
function shortcutColor(shortcut: string) {
|
|
265
|
-
if (shortcut === selectedShortcut.value || shortcut === hoverShortcut.value) {
|
|
266
|
-
return "var(--independence)";
|
|
267
|
-
} else return "var(--pure-white)";
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
function shortcutSelect(dir: string) {
|
|
271
|
-
typing.value = true;
|
|
272
|
-
let index;
|
|
273
|
-
if (selectedShortcut.value.length > 0) {
|
|
274
|
-
index = shortcuts.value.findIndex(
|
|
275
|
-
(x) => x.symbol === selectedShortcut.value
|
|
276
|
-
);
|
|
277
|
-
} else {
|
|
278
|
-
index = shortcutIndex.value;
|
|
279
|
-
}
|
|
280
|
-
if (dir === "desc") {
|
|
281
|
-
if (index < shortcuts.value.length - 1) {
|
|
282
|
-
selectedShortcut.value = shortcuts.value[index + 1].symbol;
|
|
283
|
-
shortcutIndex.value += 1;
|
|
284
|
-
} else {
|
|
285
|
-
selectedShortcut.value = shortcuts.value[0].symbol;
|
|
286
|
-
shortcutIndex.value = 0;
|
|
264
|
+
function shortcutSelect(dir) {
|
|
265
|
+
typing.value = true;
|
|
266
|
+
let index;
|
|
267
|
+
if (selectedShortcut.value.length > 0) {
|
|
268
|
+
index = shortcuts.value.findIndex(
|
|
269
|
+
(x) => x.symbol === selectedShortcut.value
|
|
270
|
+
);
|
|
271
|
+
} else {
|
|
272
|
+
index = shortcutIndex.value;
|
|
273
|
+
}
|
|
274
|
+
if (dir === "desc") {
|
|
275
|
+
if (index < shortcuts.value.length - 1) {
|
|
276
|
+
selectedShortcut.value = shortcuts.value[index + 1].symbol;
|
|
277
|
+
shortcutIndex.value += 1;
|
|
278
|
+
} else {
|
|
279
|
+
selectedShortcut.value = shortcuts.value[0].symbol;
|
|
280
|
+
shortcutIndex.value = 0;
|
|
281
|
+
}
|
|
282
|
+
} else {
|
|
283
|
+
if (index > 0) {
|
|
284
|
+
selectedShortcut.value = shortcuts.value[index - 1].symbol;
|
|
285
|
+
shortcutIndex.value -= 1;
|
|
286
|
+
} else {
|
|
287
|
+
selectedShortcut.value = shortcuts.value[shortcuts.value.length - 1].symbol;
|
|
288
|
+
shortcutIndex.value = shortcuts.value.length - 1;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
searchBar.value.focus();
|
|
287
292
|
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
shortcutIndex.value = shortcuts.value.length - 1;
|
|
293
|
+
function addToSearch(search, textValue) {
|
|
294
|
+
searchedWords.value.push({ type: search, value: textValue });
|
|
295
|
+
closeIndex.value = searchedWords.value.length;
|
|
296
|
+
selectedTag.value = null;
|
|
297
|
+
emit("update:Value", searchedWords.value);
|
|
298
|
+
searchBar.value.focus();
|
|
299
|
+
resetSearch();
|
|
296
300
|
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
if (direction > 0 && index > 2 && nextTag !== null) {
|
|
332
|
-
tagsSection.value.scrollLeft += nextTag.offsetWidth;
|
|
333
|
-
} else if (
|
|
334
|
-
direction === 0 &&
|
|
335
|
-
index < searchedWords.value.length - 2 &&
|
|
336
|
-
nextTag !== null
|
|
337
|
-
) {
|
|
338
|
-
tagsSection.value.scrollLeft -= nextTag.offsetWidth;
|
|
301
|
+
function selectTag(index, direction) {
|
|
302
|
+
let nextTag;
|
|
303
|
+
if (direction === 0) {
|
|
304
|
+
nextTag = document.getElementById(`tag${index - 1}`);
|
|
305
|
+
} else {
|
|
306
|
+
nextTag = document.getElementById(`tag${index + 1}`);
|
|
307
|
+
}
|
|
308
|
+
if (direction === 1 && index === 0 && tagsSection.value.scrollLeft > 0) {
|
|
309
|
+
tagsSection.value.scrollLeft = 0;
|
|
310
|
+
}
|
|
311
|
+
if (direction === 0 && index === searchedWords.value.length - 1) {
|
|
312
|
+
tagsSection.value.scrollLeft += tagsSection.value.scrollWidth;
|
|
313
|
+
}
|
|
314
|
+
if (searchedWords.value.length > 0 && index < searchedWords.value.length && index >= 0) {
|
|
315
|
+
selectedTag.value = index;
|
|
316
|
+
closeIndex.value = index;
|
|
317
|
+
if (direction > 0 && index > 2 && nextTag !== null) {
|
|
318
|
+
tagsSection.value.scrollLeft += nextTag.offsetWidth;
|
|
319
|
+
} else if (direction === 0 && index < searchedWords.value.length - 2 && nextTag !== null) {
|
|
320
|
+
tagsSection.value.scrollLeft -= nextTag.offsetWidth;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
if (index < 0) {
|
|
324
|
+
selectedTag.value = null;
|
|
325
|
+
closeIndex.value = searchedWords.value.length + 1;
|
|
326
|
+
}
|
|
327
|
+
if (index >= searchedWords.value.length) {
|
|
328
|
+
selectedTag.value = null;
|
|
329
|
+
closeIndex.value = index;
|
|
330
|
+
}
|
|
331
|
+
if (index > searchedWords.value.length + 1) {
|
|
332
|
+
selectedTag.value = null;
|
|
333
|
+
closeIndex.value = -1;
|
|
334
|
+
}
|
|
339
335
|
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
selectedTag.value = null;
|
|
343
|
-
closeIndex.value = searchedWords.value.length + 1;
|
|
344
|
-
}
|
|
345
|
-
if (index >= searchedWords.value.length) {
|
|
346
|
-
selectedTag.value = null;
|
|
347
|
-
closeIndex.value = index;
|
|
348
|
-
}
|
|
349
|
-
if (index > searchedWords.value.length + 1) {
|
|
350
|
-
selectedTag.value = null;
|
|
351
|
-
closeIndex.value = -1;
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
function resetSearch() {
|
|
356
|
-
value.value = "";
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
function getKeyword(keyword: string) {
|
|
360
|
-
for (let i = 0; i < shortcuts.value.length; i++) {
|
|
361
|
-
if (keyword === shortcuts.value[i].symbol) {
|
|
362
|
-
return shortcuts.value[i].keyword;
|
|
336
|
+
function resetSearch() {
|
|
337
|
+
value.value = "";
|
|
363
338
|
}
|
|
364
|
-
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
function addTag() {
|
|
368
|
-
if (removeSelected.value === true) {
|
|
369
|
-
emptySearch();
|
|
370
|
-
} else if (
|
|
371
|
-
selectedTag.value !== null &&
|
|
372
|
-
selectedTag.value < searchedWords.value.length &&
|
|
373
|
-
selectedTag.value >= 0
|
|
374
|
-
) {
|
|
375
|
-
removeTag(selectedTag.value);
|
|
376
|
-
} else {
|
|
377
|
-
let search: any;
|
|
378
|
-
let searchValue = "";
|
|
379
|
-
let arrayValues: any[];
|
|
380
|
-
arrayValues = [];
|
|
381
|
-
if (value.value.length > 0) {
|
|
382
|
-
searchValue = value.value.replace(regexSearch, "");
|
|
339
|
+
function getKeyword(keyword) {
|
|
383
340
|
for (let i = 0; i < shortcuts.value.length; i++) {
|
|
384
|
-
if (
|
|
385
|
-
|
|
386
|
-
searchValue = value.value.replace(shortcuts.value[i].symbol, "");
|
|
341
|
+
if (keyword === shortcuts.value[i].symbol) {
|
|
342
|
+
return shortcuts.value[i].keyword;
|
|
387
343
|
}
|
|
388
344
|
}
|
|
389
|
-
if (selectedShortcut.value.length > 0 && search === undefined) {
|
|
390
|
-
search = getKeyword(selectedShortcut.value);
|
|
391
|
-
} else if (hoverShortcut.value.length > 0 && search === undefined) {
|
|
392
|
-
search = getKeyword(hoverShortcut.value);
|
|
393
|
-
} else if (search === undefined) {
|
|
394
|
-
search = "and";
|
|
395
|
-
}
|
|
396
|
-
if (value.value.includes(",")) {
|
|
397
|
-
arrayValues = value.value.split(",");
|
|
398
|
-
}
|
|
399
345
|
}
|
|
400
|
-
|
|
401
|
-
if (
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
addToSearch(search, searchValue);
|
|
406
|
-
selectedShortcut.value = "";
|
|
346
|
+
function addTag() {
|
|
347
|
+
if (removeSelected.value === true) {
|
|
348
|
+
emptySearch();
|
|
349
|
+
} else if (selectedTag.value !== null && selectedTag.value < searchedWords.value.length && selectedTag.value >= 0) {
|
|
350
|
+
removeTag(selectedTag.value);
|
|
407
351
|
} else {
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
352
|
+
let search;
|
|
353
|
+
let searchValue = "";
|
|
354
|
+
let arrayValues;
|
|
355
|
+
arrayValues = [];
|
|
356
|
+
if (value.value.length > 0) {
|
|
357
|
+
searchValue = value.value.replace(regexSearch, "");
|
|
358
|
+
for (let i = 0; i < shortcuts.value.length; i++) {
|
|
359
|
+
if (value.value.startsWith(shortcuts.value[i].symbol)) {
|
|
360
|
+
search = shortcuts.value[i].keyword;
|
|
361
|
+
searchValue = value.value.replace(shortcuts.value[i].symbol, "");
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
if (selectedShortcut.value.length > 0 && search === void 0) {
|
|
365
|
+
search = getKeyword(selectedShortcut.value);
|
|
366
|
+
} else if (hoverShortcut.value.length > 0 && search === void 0) {
|
|
367
|
+
search = getKeyword(hoverShortcut.value);
|
|
368
|
+
} else if (search === void 0) {
|
|
369
|
+
search = "and";
|
|
370
|
+
}
|
|
371
|
+
if (value.value.includes(",")) {
|
|
372
|
+
arrayValues = value.value.split(",");
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
if (searchValue.length > 0 && arrayValues.length === 0) {
|
|
376
|
+
if (searchedWords.value.filter((f) => f.value === searchValue).length === 0) {
|
|
377
|
+
addToSearch(search, searchValue);
|
|
419
378
|
selectedShortcut.value = "";
|
|
420
379
|
} else {
|
|
421
|
-
handleDuplicate(
|
|
380
|
+
handleDuplicate(searchValue);
|
|
381
|
+
}
|
|
382
|
+
} else if (arrayValues.length > 0) {
|
|
383
|
+
for (let i = 0; i < arrayValues.length; i++) {
|
|
384
|
+
let arraySearchValue = arrayValues[i].replace(regexSearch, "");
|
|
385
|
+
if (arraySearchValue.length > 0) {
|
|
386
|
+
if (searchedWords.value.filter(
|
|
387
|
+
(f) => f.value === arraySearchValue
|
|
388
|
+
).length === 0) {
|
|
389
|
+
addToSearch(search, arraySearchValue);
|
|
390
|
+
selectedShortcut.value = "";
|
|
391
|
+
} else {
|
|
392
|
+
handleDuplicate(arraySearchValue);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
422
395
|
}
|
|
423
396
|
}
|
|
424
397
|
}
|
|
425
398
|
}
|
|
426
|
-
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
function handleDuplicate(tag: any) {
|
|
430
|
-
duplicate.value = `${duplicate.value} ${tag}`;
|
|
431
|
-
setTimeout(() => (duplicate.value = ""), 1000);
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
function emptySearch() {
|
|
435
|
-
searchedWords.value = [];
|
|
436
|
-
removeSelected.value = false;
|
|
437
|
-
closeIndex.value = null;
|
|
438
|
-
searchBar.value.focus();
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
function selectSearch(item: any) {
|
|
442
|
-
let searchValue = value.value.replace(regexSearch, "");
|
|
443
|
-
selectedShortcut.value = item.symbol;
|
|
444
|
-
if (searchValue.length > 0) {
|
|
445
|
-
if (
|
|
446
|
-
searchedWords.value.filter((f: any) => f.value === searchValue).length ===
|
|
447
|
-
0
|
|
448
|
-
) {
|
|
449
|
-
addToSearch(getKeyword(item.symbol), searchValue);
|
|
450
|
-
} else {
|
|
451
|
-
handleDuplicate(searchValue);
|
|
399
|
+
function handleDuplicate(tag) {
|
|
400
|
+
duplicate.value = `${duplicate.value} ${tag}`;
|
|
401
|
+
setTimeout(() => duplicate.value = "", 1e3);
|
|
452
402
|
}
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
function
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
403
|
+
function emptySearch() {
|
|
404
|
+
searchedWords.value = [];
|
|
405
|
+
removeSelected.value = false;
|
|
406
|
+
closeIndex.value = null;
|
|
407
|
+
searchBar.value.focus();
|
|
408
|
+
}
|
|
409
|
+
function selectSearch(item) {
|
|
410
|
+
let searchValue = value.value.replace(regexSearch, "");
|
|
411
|
+
selectedShortcut.value = item.symbol;
|
|
412
|
+
if (searchValue.length > 0) {
|
|
413
|
+
if (searchedWords.value.filter((f) => f.value === searchValue).length === 0) {
|
|
414
|
+
addToSearch(getKeyword(item.symbol), searchValue);
|
|
415
|
+
} else {
|
|
416
|
+
handleDuplicate(searchValue);
|
|
417
|
+
}
|
|
418
|
+
} else {
|
|
419
|
+
value.value = `${item.symbol}`;
|
|
420
|
+
}
|
|
421
|
+
searchBar.value.focus();
|
|
422
|
+
}
|
|
423
|
+
function removeTag(tagIndex) {
|
|
424
|
+
searchedWords.value.splice(tagIndex, 1);
|
|
425
|
+
emit("update:Value", searchedWords.value);
|
|
426
|
+
if (tagIndex > 0 && value.value.length === 0) {
|
|
427
|
+
selectedTag.value -= 1;
|
|
428
|
+
} else {
|
|
429
|
+
selectedTag.value = searchedWords.value.length;
|
|
430
|
+
}
|
|
431
|
+
closeIndex.value = selectedTag.value;
|
|
432
|
+
searchBar.value.focus();
|
|
433
|
+
}
|
|
434
|
+
function handleDelete() {
|
|
435
|
+
if (value.value.length === 0) {
|
|
436
|
+
removeTag(searchedWords.value.length - 1);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
function changeDisplay() {
|
|
440
|
+
if (typing.value === true) {
|
|
441
|
+
close();
|
|
442
|
+
} else {
|
|
443
|
+
typing.value = true;
|
|
444
|
+
setTimeout(() => {
|
|
445
|
+
document.addEventListener("click", close);
|
|
446
|
+
}, 100);
|
|
447
|
+
}
|
|
448
|
+
searchBar.value.focus();
|
|
449
|
+
}
|
|
450
|
+
function close() {
|
|
451
|
+
if (typing.value === true) {
|
|
452
|
+
emit("onClose");
|
|
453
|
+
typing.value = false;
|
|
454
|
+
document.removeEventListener("click", close);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
return {
|
|
458
|
+
close,
|
|
459
|
+
changeDisplay,
|
|
460
|
+
handleDelete,
|
|
461
|
+
removeTag,
|
|
462
|
+
selectSearch,
|
|
463
|
+
emptySearch,
|
|
464
|
+
getKeyword,
|
|
465
|
+
handleDuplicate,
|
|
466
|
+
addTag,
|
|
467
|
+
resetSearch,
|
|
468
|
+
selectTag,
|
|
469
|
+
addToSearch,
|
|
470
|
+
shortcutColor,
|
|
471
|
+
shortcutSelect,
|
|
472
|
+
typing,
|
|
473
|
+
shortcuts,
|
|
474
|
+
hoverShortcut,
|
|
475
|
+
selectedShortcut,
|
|
476
|
+
searchedWords,
|
|
477
|
+
closeIndex,
|
|
478
|
+
value,
|
|
479
|
+
selectedTag,
|
|
480
|
+
duplicate,
|
|
481
|
+
searchBar,
|
|
482
|
+
tagsSection,
|
|
483
|
+
shortcutIndex,
|
|
484
|
+
removeSelected,
|
|
485
|
+
hoverTag,
|
|
486
|
+
showInfo,
|
|
487
|
+
regexSearch,
|
|
488
|
+
iconColor,
|
|
489
|
+
hasShortcut,
|
|
490
|
+
infoHeight
|
|
491
|
+
};
|
|
495
492
|
}
|
|
496
|
-
}
|
|
493
|
+
});
|
|
497
494
|
</script>
|
|
498
495
|
<style scoped>
|
|
499
496
|
.research_tags {
|