@afeefa/vue-app 0.0.270 → 0.0.272

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.
@@ -1 +1 @@
1
- 0.0.270
1
+ 0.0.272
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.270",
3
+ "version": "0.0.272",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -12,21 +12,24 @@
12
12
  @beforeOpen="calculateSelectorSize"
13
13
  >
14
14
  <template #activator="{open}">
15
- <a-text-field
16
- ref="input"
17
- :value="inputModel"
18
- :title="inputModel"
19
- readonly
20
- :label="label"
21
- :rules="validationRules"
22
- placeholder="Mausklick oder Space/↓-Taste zum Auswählen"
23
- :clearable="clearable && !!selectedItems.length"
24
- appendIcon="$dropdown"
25
- @keydown.space.prevent="open"
26
- @keydown.down.prevent="open"
27
- @keydown.enter.prevent="open"
28
- @clear="clear"
29
- />
15
+ <slot name="activator">
16
+ <a-text-field
17
+ ref="input"
18
+ :value="inputModel"
19
+ :title="inputModel"
20
+ readonly
21
+ :label="label"
22
+ :rules="validationRules"
23
+ placeholder="Mausklick oder Space/↓-Taste zum Auswählen"
24
+ :clearable="clearable && !!selectedItems.length"
25
+ appendIcon="$dropdown"
26
+ hide-details="!!$attrs.hideDetails"
27
+ @keydown.space.prevent="open"
28
+ @keydown.down.prevent="open"
29
+ @keydown.enter.prevent="open"
30
+ @clear="clear"
31
+ />
32
+ </slot>
30
33
  </template>
31
34
 
32
35
  <template #filters="{onSearchInputKey}">
@@ -109,9 +112,12 @@ export default class FormFieldSearchSelect extends Mixins(FormFieldMixin) {
109
112
  }
110
113
 
111
114
  calculateSelectorSize () {
112
- const input = this.$refs.input.$el
113
- const inputWidth = input.offsetWidth
114
- this.$refs.select.setWidth(`calc(${inputWidth}px + 1rem)`)
115
+ // input not available if custom activator is in use
116
+ const input = this.$refs.input?.$el
117
+ if (input) {
118
+ const inputWidth = input.offsetWidth
119
+ this.$refs.select.setWidth(`calc(${inputWidth}px + 1rem)`)
120
+ }
115
121
  }
116
122
 
117
123
  get selectedItems () {
@@ -131,7 +137,8 @@ export default class FormFieldSearchSelect extends Mixins(FormFieldMixin) {
131
137
  }
132
138
 
133
139
  focusInput () {
134
- this.$refs.input.setFocus(true)
140
+ // input not available if custom activator is in use
141
+ this.$refs.input?.setFocus(true)
135
142
  }
136
143
 
137
144
  clear () {