@d-mok/quasar-app-extension-quasar-axe 2.0.20 → 2.0.22

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.0.20",
3
+ "version": "2.0.22",
4
4
  "description": "A Quasar App Extension",
5
5
  "author": "d-mok <49301824+d-mok@users.noreply.github.com>",
6
6
  "license": "MIT",
@@ -7,7 +7,7 @@
7
7
  </template>
8
8
 
9
9
  <script lang="ts" setup>
10
- import { computed } from '@vue/reactivity'
10
+ import { computed } from 'vue'
11
11
  import { useVModel } from '@vueuse/core'
12
12
 
13
13
  const props = withDefaults(
@@ -1,13 +1,15 @@
1
1
  <template>
2
2
  <q-select
3
- v-model="text"
4
- :use-input="text === null"
3
+ :model-value="text"
4
+ use-input
5
+ hide-selected
6
+ fill-input
7
+ hide-dropdown-icon
5
8
  input-debounce="0"
6
9
  :options="options"
7
10
  @filter="filterFn"
8
- new-value-mode="add-unique"
11
+ @input-value="setModel"
9
12
  v-bind="$attrs"
10
- clearable
11
13
  >
12
14
  </q-select>
13
15
  </template>
@@ -15,7 +17,7 @@
15
17
  <script lang="ts" setup>
16
18
  import { useVModel } from '@vueuse/core'
17
19
  import _ from 'lodash'
18
- import { ref } from 'vue'
20
+ import { ref, watch } from 'vue'
19
21
 
20
22
  const props = defineProps<{
21
23
  autocomplete: string[]
@@ -27,20 +29,23 @@ const emits = defineEmits(['update:modelValue'])
27
29
  const text = useVModel(props, 'modelValue', emits)
28
30
  if (!text.value) text.value = null
29
31
 
30
- let options = ref<string[]>(props.autocomplete)
32
+ let options = ref<string[]>([])
31
33
 
32
34
  function filterFn(val: any, update: any) {
33
- if (val === '') {
34
- update(() => {
35
- options.value = props.autocomplete
36
- })
37
- } else {
38
- update(() => {
39
- const needle = val.toLowerCase()
40
- options.value = props.autocomplete.filter(
41
- v => v.toLowerCase().indexOf(needle) > -1
42
- )
43
- })
44
- }
35
+ if (!val) val = text.value
36
+ update(() => {
37
+ if (!val) {
38
+ options.value = []
39
+ return
40
+ }
41
+ const needle = val.toLowerCase()
42
+ options.value = props.autocomplete.filter(
43
+ v => v.toLowerCase().indexOf(needle) > -1
44
+ )
45
+ })
46
+ }
47
+
48
+ function setModel(val: string) {
49
+ text.value = val
45
50
  }
46
51
  </script>