goodteditor-ui 1.0.27 → 1.0.28

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": "goodteditor-ui",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "main": "index.js",
5
5
  "homepage": "https://goodt-ui.netlify.app/",
6
6
  "scripts": {
@@ -80,6 +80,17 @@
80
80
  </template>
81
81
  </ui-datalist>
82
82
  </ui-popover>
83
+ <!--
84
+ @slot Custom clear btn slot
85
+ @binding {Function} clear function that clears the value
86
+ -->
87
+ <slot
88
+ name="clear-btn"
89
+ v-if="useClearBtn && value.length > 0"
90
+ v-bind="{ clear: clearValue }"
91
+ >
92
+ <i class="mdi mdi-close cursor-pointer" @click="clearValue"></i>
93
+ </slot>
83
94
  </div>
84
95
  </template>
85
96
  <style lang="less" scoped>
@@ -165,6 +176,13 @@ export default {
165
176
  type: Boolean,
166
177
  default: true,
167
178
  },
179
+ /**
180
+ * Clear data btn
181
+ */
182
+ useClearBtn: {
183
+ type: Boolean,
184
+ default: false,
185
+ },
168
186
  },
169
187
  data() {
170
188
  return {
@@ -205,6 +223,13 @@ export default {
205
223
  },
206
224
  },
207
225
  methods: {
226
+ clearValue() {
227
+ this.$emit('input', '');
228
+ this.caretIndex = 0;
229
+ this.delimitedValuePrev = null;
230
+ this.filterTID = null;
231
+ this.suggestedOptions = [];
232
+ },
208
233
  defaultFilter(val, options) {
209
234
  return new Promise(resolve => {
210
235
  let arr = options.filter(opt => opt.toLowerCase().indexOf(val.toLowerCase()) === 0);