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.
@@ -267,8 +267,8 @@ module.exports = plugin(
267
267
  theme: {
268
268
  extend: {
269
269
  zIndex: {
270
- menu: '30',
271
- modal: '40',
270
+ menu: '40',
271
+ modal: '30',
272
272
  notifications: '50',
273
273
  dialogs: '50',
274
274
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprintify-ui",
3
- "version": "0.0.88",
3
+ "version": "0.0.90",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
6
  "build-fast": "rimraf dist && vite build",
@@ -32,7 +32,7 @@ export default {
32
32
  const Template = (args) => ({
33
33
  components: { BaseAutocomplete, ShowValue },
34
34
  setup() {
35
- const value = ref(null);
35
+ const value = ref(options[2]);
36
36
  return { args, value };
37
37
  },
38
38
  template: `
@@ -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
  });