@tekkare/auriga 0.2.33 → 0.2.35

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 CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "0.2.33"
7
+ "version": "0.2.35"
8
8
  }
@@ -299,9 +299,10 @@ export default defineComponent({
299
299
  const showChangeType = ref(null);
300
300
  const regexSearch = /^[\s\.\/\!]|[\/\!\s][\s\.]+|\s+[\/]|\s+$/g;
301
301
  const suggOpen = ref(false);
302
- const optionIndex = ref(0);
302
+ const optionIndex = ref(1);
303
303
  const iconColor = computed(() => {
304
304
  if (typing.value === true) {
305
+ f;
305
306
  return "var(--primary)";
306
307
  } else
307
308
  return "var(--medium)";
@@ -339,12 +340,12 @@ export default defineComponent({
339
340
  watch(value, (new_value) => {
340
341
  setTimeout(() => {
341
342
  emit("onTyping", value.value);
342
- }, 500);
343
+ }, 1e3);
343
344
  typing.value = false;
344
345
  if (new_value === "") {
345
346
  hoverShortcut.value = "";
346
347
  suggOpen.value = false;
347
- optionIndex.value = 0;
348
+ optionIndex.value = 1;
348
349
  document.removeEventListener("click", closeSugg);
349
350
  } else {
350
351
  suggOpen.value = true;
@@ -357,6 +358,7 @@ export default defineComponent({
357
358
  }
358
359
  }
359
360
  }
361
+ optionIndex.value = 1;
360
362
  });
361
363
  watch(
362
364
  () => typing.value,
@@ -462,20 +464,39 @@ export default defineComponent({
462
464
  const options = computed(() => ({
463
465
  fuseOptions: {
464
466
  includeScore: true,
465
- threshold: 0.5
467
+ threshold: props.fuzzyThreshold
466
468
  }
467
469
  }));
468
470
  const filterSuggestions = computed(() => {
469
471
  if (value.value.replace(/[+/!]/g, "").length > 0) {
470
- return props.suggestions.filter(
471
- (f) => useFuse(
472
+ const filteredSuggs = props.suggestions.filter(
473
+ (f2) => useFuse(
472
474
  value.value.replace(/[+/!]/g, ""),
473
475
  props.suggestions.map((a) => a.text),
474
476
  options.value
475
- ).results.value.map((a) => a.item).includes(f.text)
477
+ ).results.value.map((a) => a.item).includes(f2.text)
476
478
  ).slice(0, 50);
479
+ return [
480
+ ...[
481
+ {
482
+ text: value.value,
483
+ icon: "MagnifyingGlass",
484
+ html: `<span style="color: var(--primary)">${value.value}</span>`
485
+ }
486
+ ],
487
+ filteredSuggs
488
+ ].flat();
477
489
  } else
478
- return props.suggestions.slice(0, 50);
490
+ return [
491
+ ...[
492
+ {
493
+ text: value.value,
494
+ icon: "MagnifyingGlass",
495
+ html: `<span style="color: var(--primary)">${value.value}</span>`
496
+ }
497
+ ],
498
+ props.suggestions.slice(0, 50)
499
+ ].flat();
479
500
  });
480
501
  function selectTag(index, direction) {
481
502
  let nextTag;
@@ -534,7 +555,7 @@ export default defineComponent({
534
555
  if (optionIndex.value > 0) {
535
556
  value.value = filterSuggestions.value[optionIndex.value - 1].text;
536
557
  if (searchedWords.value.filter(
537
- (f) => f.value === filterSuggestions.value[optionIndex.value - 1].text
558
+ (f2) => f2.value === filterSuggestions.value[optionIndex.value - 1].text
538
559
  ).length > 0) {
539
560
  setTimeout(() => {
540
561
  suggOpen.value = false;
@@ -566,7 +587,7 @@ export default defineComponent({
566
587
  }
567
588
  }
568
589
  if (searchValue.length > 0 && arrayValues.length === 0) {
569
- if (searchedWords.value.filter((f) => f.value === searchValue).length === 0) {
590
+ if (searchedWords.value.filter((f2) => f2.value === searchValue).length === 0) {
570
591
  addToSearch(search, searchValue, false);
571
592
  } else {
572
593
  handleDuplicate(searchValue);
@@ -577,7 +598,7 @@ export default defineComponent({
577
598
  const arraySearchValue = arrayValues[i].replace(regexSearch, "");
578
599
  if (arraySearchValue.length > 0) {
579
600
  if (searchedWords.value.filter(
580
- (f) => f.value === arraySearchValue
601
+ (f2) => f2.value === arraySearchValue
581
602
  ).length === 0) {
582
603
  addToSearch(search, arraySearchValue, false);
583
604
  } else {
@@ -616,7 +637,7 @@ export default defineComponent({
616
637
  const searchValue = value.value.replace(regexSearch, "");
617
638
  selectedShortcut.value = item.symbol;
618
639
  if (searchValue.length > 0) {
619
- if (searchedWords.value.filter((f) => f.value === searchValue).length === 0) {
640
+ if (searchedWords.value.filter((f2) => f2.value === searchValue).length === 0) {
620
641
  addToSearch(getKeyword(item.symbol), searchValue, false);
621
642
  } else {
622
643
  handleDuplicate(searchValue);
@@ -139,7 +139,11 @@ declare const _default: import("vue").DefineComponent<{
139
139
  hasShortcut: import("vue").ComputedRef<boolean>;
140
140
  infoHeight: import("vue").ComputedRef<boolean>;
141
141
  suggOpen: import("vue").Ref<boolean>;
142
- filterSuggestions: import("vue").ComputedRef<Suggestion[]>;
142
+ filterSuggestions: import("vue").ComputedRef<(Suggestion | {
143
+ text: string;
144
+ icon: string;
145
+ html: string;
146
+ })[]>;
143
147
  selectOption: (isDown: boolean) => void;
144
148
  optionIndex: import("vue").Ref<number>;
145
149
  selectSugg: (sugg: Suggestion) => void;
@@ -0,0 +1,18 @@
1
+ <template>
2
+ <span class="custom-loader" />
3
+ </template>
4
+
5
+ <script>
6
+ import { defineComponent } from "vue";
7
+ export default defineComponent({
8
+ name: "ArgLoader",
9
+ props: {},
10
+ setup() {
11
+ return {};
12
+ }
13
+ });
14
+ </script>
15
+
16
+ <style scope>
17
+ .custom-loader{animation:rotation 1s linear infinite;border:3px solid #5dc8ff;display:inline-block;height:48px;position:relative;width:48px}.custom-loader,.custom-loader:after{border-radius:50%;box-sizing:border-box}.custom-loader:after{border:3px solid transparent;border-bottom-color:#ffaeff;content:"";height:56px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:56px}@keyframes rotation{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}
18
+ </style>
@@ -0,0 +1,8 @@
1
+ declare const _default: import("vue").DefineComponent<Readonly<import("vue").ComponentPropsOptions<{
2
+ [x: string]: unknown;
3
+ }>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, readonly string[] | Readonly<import("vue").ExtractPropTypes<Readonly<import("vue").ComponentObjectPropsOptions<{
4
+ [x: string]: unknown;
5
+ }>>>>, {
6
+ readonly [x: number]: string;
7
+ } | {}, {}>;
8
+ export default _default;
@@ -126,7 +126,7 @@ export default defineComponent({
126
126
  es: "cargando m\xE1s sugerencias"
127
127
  };
128
128
  const closeOnEnter = ref(false);
129
- const optionIndex = ref(0);
129
+ const optionIndex = ref(1);
130
130
  function selectOption(isDown) {
131
131
  if (isDown) {
132
132
  optionIndex.value = optionIndex.value === filterSuggestions.value.length ? filterSuggestions.value.length : optionIndex.value + 1;
@@ -165,13 +165,14 @@ export default defineComponent({
165
165
  suggOpen.value = false;
166
166
  document.removeEventListener("click", closeSugg);
167
167
  }
168
+ optionIndex.value = 1;
168
169
  }
169
170
  );
170
171
  watch(
171
172
  () => suggOpen.value,
172
173
  () => {
173
174
  if (!suggOpen.value) {
174
- optionIndex.value = 0;
175
+ optionIndex.value = 1;
175
176
  }
176
177
  }
177
178
  );
@@ -182,13 +183,23 @@ export default defineComponent({
182
183
  }
183
184
  }));
184
185
  const filterSuggestions = computed(() => {
185
- return props.suggestions.filter(
186
+ const filteredSuggs = props.suggestions.filter(
186
187
  (f) => useFuse(
187
- searchValue,
188
+ searchValue.value.replace(/[+/!]/g, ""),
188
189
  props.suggestions.map((a) => a.text),
189
190
  options.value
190
191
  ).results.value.map((a) => a.item).includes(f.text)
191
192
  ).slice(0, 50);
193
+ return [
194
+ ...[
195
+ {
196
+ text: searchValue.value,
197
+ icon: "MagnifyingGlass",
198
+ html: `<span style="color: var(--primary)">${searchValue.value}</span>`
199
+ }
200
+ ],
201
+ filteredSuggs
202
+ ].flat();
192
203
  });
193
204
  const selectSugg = (sugg) => {
194
205
  closeOnEnter.value = true;
@@ -53,7 +53,11 @@ declare const _default: import("vue").DefineComponent<{
53
53
  clearValue: () => void;
54
54
  suggOpen: import("vue").Ref<boolean>;
55
55
  openSugg: () => void;
56
- filterSuggestions: import("vue").ComputedRef<Suggestion[]>;
56
+ filterSuggestions: import("vue").ComputedRef<(Suggestion | {
57
+ text: string;
58
+ icon: string;
59
+ html: string;
60
+ })[]>;
57
61
  selectSugg: (sugg: Suggestion) => void;
58
62
  selectOption: (isDown: boolean) => void;
59
63
  optionIndex: import("vue").Ref<number>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekkare/auriga",
3
- "version": "0.2.33",
3
+ "version": "0.2.35",
4
4
  "description": "Aurgia is a UI kit developped by Tekkare",
5
5
  "license": "MIT",
6
6
  "type": "module",