sprintify-ui 0.0.88 → 0.0.90
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/package.json
CHANGED
|
@@ -267,6 +267,21 @@ const normalizedOptions = hasOptions.normalizedOptions;
|
|
|
267
267
|
const normalizedModelValue =
|
|
268
268
|
hasOptions.normalizedModelValue as ComputedRef<NormalizedOption | null>;
|
|
269
269
|
|
|
270
|
+
const filteredNormalizedOptions = computed((): NormalizedOption[] => {
|
|
271
|
+
if (shouldFilter.value === false) {
|
|
272
|
+
return normalizedOptions.value;
|
|
273
|
+
}
|
|
274
|
+
return normalizedOptions.value.filter((option) => {
|
|
275
|
+
if (props.filter !== undefined) {
|
|
276
|
+
return props.filter(option);
|
|
277
|
+
}
|
|
278
|
+
if (!option.label) {
|
|
279
|
+
return false;
|
|
280
|
+
}
|
|
281
|
+
return option.label.toLowerCase().includes(keywords.value.toLowerCase());
|
|
282
|
+
});
|
|
283
|
+
});
|
|
284
|
+
|
|
270
285
|
const optionActive = computed(() => {
|
|
271
286
|
return (
|
|
272
287
|
filteredNormalizedOptions.value[
|
|
@@ -284,28 +299,20 @@ watch(
|
|
|
284
299
|
}
|
|
285
300
|
if (normalizedModelValue.value) {
|
|
286
301
|
setKeywords(normalizedModelValue.value?.label);
|
|
302
|
+
const index = filteredNormalizedOptions.value.findIndex(
|
|
303
|
+
(option) => option.value === normalizedModelValue.value?.value
|
|
304
|
+
);
|
|
305
|
+
if (index >= 0) {
|
|
306
|
+
selectionIndex.value = index;
|
|
307
|
+
}
|
|
287
308
|
} else {
|
|
309
|
+
selectionIndex.value = 0;
|
|
288
310
|
setKeywords('');
|
|
289
311
|
}
|
|
290
312
|
},
|
|
291
313
|
{ immediate: true }
|
|
292
314
|
);
|
|
293
315
|
|
|
294
|
-
const filteredNormalizedOptions = computed((): NormalizedOption[] => {
|
|
295
|
-
if (shouldFilter.value === false) {
|
|
296
|
-
return normalizedOptions.value;
|
|
297
|
-
}
|
|
298
|
-
return normalizedOptions.value.filter((option) => {
|
|
299
|
-
if (props.filter !== undefined) {
|
|
300
|
-
return props.filter(option);
|
|
301
|
-
}
|
|
302
|
-
if (!option.label) {
|
|
303
|
-
return false;
|
|
304
|
-
}
|
|
305
|
-
return option.label.toLowerCase().includes(keywords.value.toLowerCase());
|
|
306
|
-
});
|
|
307
|
-
});
|
|
308
|
-
|
|
309
316
|
onMounted(() => {
|
|
310
317
|
window.addEventListener('mousedown', onMouseDown);
|
|
311
318
|
});
|