@iqual/nuxt-icms 1.3.0 → 1.3.1

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.
@@ -0,0 +1,67 @@
1
+ <template>
2
+ <label for="searchterm" class="sr-only">
3
+ {{ $texts('search.search_field_label', 'Suchbegriff') }}
4
+ </label>
5
+ <div v-click-away="clickAway" class="relative flex" role="search">
6
+ <SpriteSymbol
7
+ name="magnifyingglass"
8
+ class="absolute left-4 top-1/2 size-5 -translate-y-1/2 text-primary"
9
+ />
10
+ <input
11
+ id="searchInput"
12
+ ref="input"
13
+ v-model="searchTermInternal"
14
+ type="search"
15
+ autocomplete="off"
16
+ name="searchterm"
17
+ :class="inputClass"
18
+ spellcheck="false"
19
+ role="searchbox"
20
+ aria-owns="searchterm-suggestions"
21
+ aria-label="Search input"
22
+ :placeholder="
23
+ $texts('search.search_field_placeholder', 'Suchbegriff eingeben')
24
+ "
25
+ @focus="isFocused = true"
26
+ @search="updateSearchTerm"
27
+ />
28
+ </div>
29
+ </template>
30
+
31
+ <script lang="ts" setup>
32
+ const props = withDefaults(
33
+ defineProps<{
34
+ modelValue?: string | null
35
+ inputClass?: string
36
+ }>(),
37
+ {
38
+ inputClass: 'rounded-lg bg-gray-50 py-3 pr-3 pl-12',
39
+ },
40
+ )
41
+
42
+ const searchTermInternal = ref('')
43
+ const isFocused = ref(false)
44
+ const input = ref<HTMLInputElement | null>(null)
45
+ const { $texts } = useNuxtApp()
46
+
47
+ const emit = defineEmits(['update:modelValue'])
48
+
49
+ watch(
50
+ () => props.modelValue,
51
+ function (newValue) {
52
+ searchTermInternal.value = newValue || ''
53
+ },
54
+ )
55
+
56
+ function updateSearchTerm() {
57
+ emit('update:modelValue', searchTermInternal.value)
58
+ }
59
+
60
+ function clickAway() {
61
+ isFocused.value = false
62
+ }
63
+
64
+ onMounted(() => {
65
+ searchTermInternal.value = props.modelValue || ''
66
+ })
67
+ </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iqual/nuxt-icms",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "ICMS Base",
5
5
  "type": "module",
6
6
  "private": false,