@tekkare/auriga 0.1.182 → 0.1.184

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.1.182"
7
+ "version": "0.1.184"
8
8
  }
@@ -133,7 +133,10 @@
133
133
  ></arg-icon>
134
134
  </div>
135
135
  <!-- List -->
136
- <div v-if="!loading" class="oip_select_complex_selection_container">
136
+ <div
137
+ v-if="!loading && filterNameAdd.length > 0"
138
+ class="oip_select_complex_selection_container"
139
+ >
137
140
  <div
138
141
  class="oip_select_complex_selection_loop add"
139
142
  v-for="(element, index) of filterNameAdd"
@@ -165,17 +168,17 @@
165
168
  </div>
166
169
  </div>
167
170
  <div
168
- class="oip_empty_dropdown"
169
- v-else-if="filterNameAdd.length === 0"
171
+ v-else-if="loading"
172
+ class="oip_select_complex_selection_container"
170
173
  >
171
- <p>{{ getEmptyContentMsg }}</p>
172
- </div>
173
- <div v-else class="oip_select_complex_selection_container">
174
174
  <arg-data-loader
175
175
  :text="getLoaderText[0]"
176
176
  :sub-text="getLoaderText[1]"
177
177
  />
178
178
  </div>
179
+ <div v-else class="oip_empty_dropdown">
180
+ <p>{{ getEmptyContentMsg }}</p>
181
+ </div>
179
182
  </div>
180
183
  <div class="oip_select_complex_del_selection">
181
184
  <div class="oip_select_complex_all_title">
@@ -123,10 +123,23 @@ export default defineComponent({
123
123
  const optionIndex = ref(0);
124
124
  function selectOption(isDown) {
125
125
  if (isDown) {
126
- optionIndex.value = optionIndex.value === filterSuggestions.value.length ? 0 : optionIndex.value + 1;
126
+ optionIndex.value = optionIndex.value === filterSuggestions.value.length ? filterSuggestions.value.length : optionIndex.value + 1;
127
127
  } else {
128
128
  optionIndex.value = optionIndex.value === 0 ? filterSuggestions.value.length : optionIndex.value - 1;
129
129
  }
130
+ const suggContainer = document.querySelector(".search_suggestions");
131
+ const selectedOption = suggContainer?.querySelectorAll("p")[optionIndex.value - 1];
132
+ if (selectedOption) {
133
+ const containerHeight = suggContainer?.clientHeight;
134
+ const containerScrollTop = suggContainer?.scrollTop;
135
+ const optionTop = selectedOption?.offsetTop;
136
+ const optionHeight = selectedOption?.offsetHeight * 2;
137
+ if (optionTop < containerScrollTop) {
138
+ suggContainer.scrollTop = optionTop;
139
+ } else if (optionTop + optionHeight > containerHeight + containerScrollTop) {
140
+ suggContainer.scrollTop = optionTop + optionHeight - containerHeight;
141
+ }
142
+ }
130
143
  }
131
144
  watch(
132
145
  () => searchValue.value,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekkare/auriga",
3
- "version": "0.1.182",
3
+ "version": "0.1.184",
4
4
  "description": "Aurgia is a UI kit developped by Tekkare",
5
5
  "license": "MIT",
6
6
  "type": "module",