@eturnity/eturnity_reusable_components 1.2.76 → 1.2.77

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": "@eturnity/eturnity_reusable_components",
3
- "version": "1.2.76",
3
+ "version": "1.2.77",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -8,6 +8,7 @@
8
8
  :disabled="disabled"
9
9
  :isDisabled="disabled"
10
10
  :inputWidth="inputWidth"
11
+ :hasFocus="hasFocus"
11
12
  />
12
13
  <img
13
14
  class="search-icn"
@@ -87,12 +88,26 @@ export default {
87
88
  inputWidth: {
88
89
  required: false,
89
90
  default: null
91
+ },
92
+ hasFocus: {
93
+ required: false,
94
+ default: false
90
95
  }
91
96
  },
92
97
  methods: {
93
98
  onChangeHandler(event) {
94
99
  this.$emit('on-change', event)
95
100
  }
101
+ },
102
+ watch: {
103
+ hasFocus(newVal) {
104
+ if (newVal) {
105
+ this.$nextTick(() => {
106
+ this.$refs.inputElement.$el.focus();
107
+ });
108
+ }
109
+ }
96
110
  }
111
+
97
112
  }
98
113
  </script>
@@ -134,19 +134,17 @@
134
134
  :tabindex="0"
135
135
  @keyup.enter.native="onItemClick(item)"
136
136
  >
137
- <template v-for="(option, idx) in optionsDisplay">
137
+ <template v-for="(option, idx) in optionsDisplay" :key="idx">
138
138
  <span v-if="option !== 'template'" :key="idx">
139
139
  {{ !!item[option] ? item[option] : '-' }}
140
140
  </span>
141
141
  <template-button
142
142
  @click.stop="onTemplateClick(item)"
143
143
  v-else-if="option === 'template' && item.has_template"
144
- :key="idx"
145
144
  >{{ $gettext('Use template...') }}</template-button
146
145
  >
147
146
  <no-template
148
147
  v-else-if="option === 'template' && !item.has_template"
149
- :key="idx"
150
148
  >
151
149
  {{ $gettext('No main component template') }}
152
150
  </no-template>