@d-mok/quasar-app-extension-quasar-axe 2.1.94 → 2.1.96

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d-mok/quasar-app-extension-quasar-axe",
3
- "version": "2.1.94",
3
+ "version": "2.1.96",
4
4
  "description": "A Quasar App Extension",
5
5
  "author": "d-mok <49301824+d-mok@users.noreply.github.com>",
6
6
  "license": "MIT",
@@ -18,23 +18,31 @@ import { ref } from 'vue'
18
18
 
19
19
  let modelValue = defineModel<string>({ required: true })
20
20
 
21
- const props = defineProps<{
21
+ const {
22
+ autocomplete,
23
+ immediate = false,
24
+ noFilter = false,
25
+ } = defineProps<{
22
26
  autocomplete: string[]
27
+ immediate?: boolean
28
+ noFilter?: boolean
23
29
  }>()
24
30
 
25
- // if (!modelValue.value) modelValue.value = ''
26
-
27
31
  let options = ref<string[]>([])
28
32
 
29
33
  function filterFn(val: any, update: any) {
30
34
  if (!val) val = modelValue.value
31
35
  update(() => {
32
- if (!val) {
36
+ if (noFilter) {
37
+ options.value = autocomplete
38
+ return
39
+ }
40
+ if (!immediate && !val) {
33
41
  options.value = []
34
42
  return
35
43
  }
36
44
  const needle = val.toLowerCase()
37
- options.value = props.autocomplete.filter(
45
+ options.value = autocomplete.filter(
38
46
  v => v.toLowerCase().indexOf(needle) > -1
39
47
  )
40
48
  })