@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.
Files changed (36) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/argAdvancedSearchBar.vue +318 -321
  3. package/dist/runtime/components/argAdvancedSearchBar.vue.d.ts +89 -3
  4. package/dist/runtime/components/argBtn.vue +48 -39
  5. package/dist/runtime/components/argBtn.vue.d.ts +72 -3
  6. package/dist/runtime/components/argComplexSelect.vue +255 -256
  7. package/dist/runtime/components/argComplexSelect.vue.d.ts +175 -3
  8. package/dist/runtime/components/argDataLoader.vue +8 -3
  9. package/dist/runtime/components/argDataLoader.vue.d.ts +1 -3
  10. package/dist/runtime/components/argDropdownSelect.vue +145 -138
  11. package/dist/runtime/components/argDropdownSelect.vue.d.ts +139 -3
  12. package/dist/runtime/components/argFileBtn.vue +58 -56
  13. package/dist/runtime/components/argFileBtn.vue.d.ts +60 -3
  14. package/dist/runtime/components/argHeaderTabs.vue +91 -103
  15. package/dist/runtime/components/argHeaderTabs.vue.d.ts +29 -3
  16. package/dist/runtime/components/argIcon.vue +2136 -3117
  17. package/dist/runtime/components/argIcon.vue.d.ts +1110 -2
  18. package/dist/runtime/components/argMultipleChoice.vue +84 -78
  19. package/dist/runtime/components/argMultipleChoice.vue.d.ts +49 -3
  20. package/dist/runtime/components/argNoData.vue +28 -25
  21. package/dist/runtime/components/argNoData.vue.d.ts +26 -3
  22. package/dist/runtime/components/argSearchInput.vue +39 -37
  23. package/dist/runtime/components/argSearchInput.vue.d.ts +32 -3
  24. package/dist/runtime/components/argSimpleLabel.vue +13 -11
  25. package/dist/runtime/components/argSimpleLabel.vue.d.ts +13 -3
  26. package/dist/runtime/components/argStyle.vue +11 -3
  27. package/dist/runtime/components/argStyle.vue.d.ts +1 -3
  28. package/dist/runtime/components/argTable.vue +384 -395
  29. package/dist/runtime/components/argTable.vue.d.ts +337 -3
  30. package/dist/runtime/components/argTags.vue +20 -10
  31. package/dist/runtime/components/argTags.vue.d.ts +26 -3
  32. package/dist/runtime/components/argTekkareLoader.vue +5 -2
  33. package/dist/runtime/components/argTekkareLoader.vue.d.ts +1 -3
  34. package/dist/runtime/components/argTooltip.vue +11 -11
  35. package/dist/runtime/components/argTooltip.vue.d.ts +39 -3
  36. package/package.json +5 -2
@@ -152,348 +152,345 @@
152
152
  </div>
153
153
  </template>
154
154
  <script>
155
- export default {
156
- name: "argAdvancedSearchBar"
157
- };
158
- </script>
159
- <script setup lang="ts">
160
- import { onMounted, ref, computed, defineProps, defineEmits, watch } from "vue";
161
- const props = defineProps({
162
- placeHolderValue: {
163
- type: String,
164
- default: "Type your search",
165
- },
166
- customShortcuts: {
167
- type: Array<any>,
168
- default: () => [],
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
- var typing = ref(false);
172
- var shortcuts = ref([
173
- { keyword: "and", value: "add the word", symbol: "+" },
174
- { keyword: "or", value: "matches at least one word", symbol: "/" },
175
- { keyword: "not", value: "exclude the word", symbol: "!" },
176
- ]);
177
- var hoverShortcut = ref("");
178
- var selectedShortcut = ref("");
179
- var searchedWords = ref([]);
180
- var closeIndex = ref();
181
- var value = ref("");
182
- var selectedTag = ref();
183
- var duplicate = ref("");
184
- var searchBar = ref();
185
- var tagsSection = ref();
186
- var shortcutIndex = ref(-1);
187
- var removeSelected = ref(false);
188
- var hoverTag = ref();
189
- var showInfo = ref();
190
- const regexSearch =
191
- /^[\s\.\+\/\!]|(?:[\+\/\!\s])[\s{1,}\.{1,}\+{1,}\/{1,}\!{1,}]|[\s{1,}\.1,}\+{1,}\/{1,}\!{1,}]$|\s+[\+\/]|\s+$/g;
192
- // regex to check whitespaces / symbols in input value to avoid duplicate search
193
- // each alternative is seperated by |
194
- // 1st alternative: the word begins with a space or a symbol
195
- // 2nd alternative: the word begins with a combination of one or more spaces and symbols
196
- // 3rd alternative: the word ends with one or more spaces or symbols
197
- // 4th alternative: the word contains one or more spaces followed by symbols
198
- // 5th alternative: the word ends with one or more spaces
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 return false;
222
- } else return false;
223
- }
224
- });
225
-
226
- watch(value, (new_value: string) => {
227
- if (new_value === "") {
228
- hoverShortcut.value = "";
229
- } else {
230
- for (let i = 0; i < shortcuts.value.length; i++) {
231
- if (new_value.startsWith(shortcuts.value[i].symbol)) {
232
- selectedShortcut.value = shortcuts.value[i].symbol;
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
- watch(selectedShortcut, (new_shortcut: string) => {
239
- value.value = `${new_shortcut}`;
240
- });
241
-
242
- watch(closeIndex, (new_index: number) => {
243
- if (new_index > searchedWords.value.length) {
244
- removeSelected.value = true;
245
- } else removeSelected.value = false;
246
- });
247
-
248
- watch(searchedWords, (newSearched: []) => {
249
- setTimeout(() => {
250
- tagsSection.value.scrollLeft += tagsSection.value.scrollWidth;
251
- }, 100);
252
- });
253
-
254
- onMounted(() => {
255
- searchBar.value = document.getElementById("search_input");
256
- tagsSection.value = document.getElementById("tags");
257
- if (props.customShortcuts.length > 0) {
258
- for (let i = 0; i < props.customShortcuts.length; i++) {
259
- shortcuts.value.push(props.customShortcuts[i]);
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
- } else {
289
- if (index > 0) {
290
- selectedShortcut.value = shortcuts.value[index - 1].symbol;
291
- shortcutIndex.value -= 1;
292
- } else {
293
- selectedShortcut.value =
294
- shortcuts.value[shortcuts.value.length - 1].symbol;
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
- searchBar.value.focus();
299
- }
300
-
301
- function addToSearch(search: string, textValue: string) {
302
- searchedWords.value.push({ type: search, value: textValue });
303
- closeIndex.value = searchedWords.value.length;
304
- selectedTag.value = null;
305
- emit("update:Value", searchedWords.value);
306
- searchBar.value.focus();
307
- resetSearch();
308
- }
309
-
310
- function selectTag(index: number, direction: number) {
311
- let nextTag;
312
- if (direction === 0) {
313
- nextTag = document.getElementById(`tag${index - 1}`);
314
- } else {
315
- nextTag = document.getElementById(`tag${index + 1}`);
316
- }
317
- if (direction === 1 && index === 0 && tagsSection.value.scrollLeft > 0) {
318
- tagsSection.value.scrollLeft = 0;
319
- }
320
- if (direction === 0 && index === searchedWords.value.length - 1) {
321
- tagsSection.value.scrollLeft += tagsSection.value.scrollWidth;
322
- }
323
-
324
- if (
325
- searchedWords.value.length > 0 &&
326
- index < searchedWords.value.length &&
327
- index >= 0
328
- ) {
329
- selectedTag.value = index;
330
- closeIndex.value = index;
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
- if (index < 0) {
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 (value.value.startsWith(shortcuts.value[i].symbol)) {
385
- search = shortcuts.value[i].keyword;
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
- if (searchValue.length > 0 && arrayValues.length === 0) {
401
- if (
402
- searchedWords.value.filter((f: any) => f.value === searchValue)
403
- .length === 0
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
- handleDuplicate(searchValue);
409
- }
410
- } else if (arrayValues.length > 0) {
411
- for (let i = 0; i < arrayValues.length; i++) {
412
- let arraySearchValue = arrayValues[i].replace(regexSearch, "");
413
- if (arraySearchValue.length > 0) {
414
- if (
415
- searchedWords.value.filter((f: any) => f.value === arraySearchValue)
416
- .length === 0
417
- ) {
418
- addToSearch(search, arraySearchValue);
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(arraySearchValue);
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
- } else {
454
- value.value = `${item.symbol}`;
455
- }
456
- searchBar.value.focus();
457
- }
458
-
459
- function removeTag(tagIndex: any) {
460
- searchedWords.value.splice(tagIndex, 1);
461
- emit("update:Value", searchedWords.value);
462
- if (tagIndex > 0 && value.value.length === 0) {
463
- selectedTag.value -= 1;
464
- } else {
465
- selectedTag.value = searchedWords.value.length;
466
- }
467
-
468
- closeIndex.value = selectedTag.value;
469
- searchBar.value.focus();
470
- }
471
-
472
- function handleDelete() {
473
- if (value.value.length === 0) {
474
- removeTag(searchedWords.value.length - 1);
475
- }
476
- }
477
-
478
- function changeDisplay() {
479
- if (typing.value === true) {
480
- close();
481
- } else {
482
- typing.value = true;
483
- setTimeout(() => {
484
- document.addEventListener("click", close);
485
- }, 100);
486
- }
487
- searchBar.value.focus();
488
- }
489
-
490
- function close() {
491
- if (typing.value === true) {
492
- emit("onClose");
493
- typing.value = false;
494
- document.removeEventListener("click", close);
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 {