@veritree/ui 0.19.2-14 → 0.19.2-16

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": "@veritree/ui",
3
- "version": "0.19.2-14",
3
+ "version": "0.19.2-16",
4
4
  "description": "veritree ui library",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -59,7 +59,7 @@ export default {
59
59
  this.apiDisclosure().register('contents', content);
60
60
  },
61
61
 
62
- beforeDestroy() {
62
+ beforeUnmount() {
63
63
  this.apiDisclosure().unregister('contents', this.id);
64
64
  },
65
65
 
@@ -63,7 +63,7 @@ export default {
63
63
  this.apiDisclosure().register('details', detail);
64
64
  },
65
65
 
66
- beforeDestroy() {
66
+ beforeUnmount() {
67
67
  this.apiDisclosure().unregister('details', this.id);
68
68
  },
69
69
 
@@ -78,7 +78,7 @@ export default {
78
78
  this.apiDisclosure().register('headers', header);
79
79
  },
80
80
 
81
- beforeDestroy() {
81
+ beforeUnmount() {
82
82
  this.apiDisclosure().unregister('headers', this.id);
83
83
  },
84
84
 
@@ -50,7 +50,7 @@ export default {
50
50
  this.apiDisclosure().register('icons', icon);
51
51
  },
52
52
 
53
- beforeDestroy() {
53
+ beforeUnmount() {
54
54
  this.apiDisclosure().unregister('icons', this.id);
55
55
  },
56
56
 
@@ -73,7 +73,7 @@ export default {
73
73
  });
74
74
  },
75
75
 
76
- destroyed() {
76
+ unmounted() {
77
77
  // TODO: Create a directive or mixin for this
78
78
  document.removeEventListener('click', this.trigger.onClick());
79
79
  },
@@ -51,7 +51,7 @@ export default {
51
51
  this.addTriggerEvents();
52
52
  },
53
53
 
54
- destroyed() {
54
+ unmounted() {
55
55
  this.trigger.removeEventListener('click', this.onClick());
56
56
  },
57
57
 
@@ -47,7 +47,7 @@ export default {
47
47
  };
48
48
 
49
49
  const emit = (value) => {
50
- this.$emit('input', value);
50
+ this.$emit('update:modelValue', value);
51
51
  this.$emit('change', value);
52
52
  };
53
53
 
@@ -74,7 +74,7 @@ export default {
74
74
  },
75
75
 
76
76
  props: {
77
- value: {
77
+ modelValue: {
78
78
  type: [String, Number, Object],
79
79
  default: null,
80
80
  },
@@ -110,7 +110,7 @@ export default {
110
110
  });
111
111
  },
112
112
 
113
- destroyed() {
113
+ unmounted() {
114
114
  // T-88 Create a directive or mixin for this
115
115
  document.removeEventListener('click', this.trigger.onClick());
116
116
  },
@@ -14,8 +14,8 @@
14
14
  :tabindex="tabIndex"
15
15
  role="option"
16
16
  @click.stop="onClick"
17
- @keydown.down.prevent="focusPreviousItem"
18
- @keydown.up.prevent="focusNextItem"
17
+ @keydown.down.prevent="focusNextItem"
18
+ @keydown.up.prevent="focusPreviousItem"
19
19
  @keydown.home.prevent="focusFirstItem"
20
20
  @keydown.end.prevent="focusLastItem"
21
21
  @keydown.esc.stop="onKeyEsc"
@@ -114,6 +114,7 @@ export default {
114
114
  select: this.select,
115
115
  unselect: this.unselect,
116
116
  onClick: this.onClick,
117
+ onKeyEnter: this.onKeyEnter,
117
118
  };
118
119
 
119
120
  this.apiListbox().registerItem(item);
@@ -121,7 +122,7 @@ export default {
121
122
  this.index = this.items.length - 1;
122
123
  },
123
124
 
124
- beforeDestroy() {
125
+ beforeUnmount() {
125
126
  this.apiListbox().unregisterItem(this.id);
126
127
  },
127
128
 
@@ -1,9 +1,9 @@
1
1
  <template>
2
2
  <input
3
- v-model="search"
3
+ :value="modelValue"
4
4
  :class="{ ListboxList: headless, 'form-control mb-1': !headless }"
5
- type="text"
6
- @input="onChange"
5
+ placeholder="Search"
6
+ @input="onInput"
7
7
  @keydown.down.prevent="focusNextItem"
8
8
  @keydown.up.prevent="focusPreviousItem"
9
9
  @keydown.home.prevent="focusFirstItem"
@@ -21,6 +21,10 @@ export default {
21
21
  inject: ['apiListbox'],
22
22
 
23
23
  props: {
24
+ modelValue: {
25
+ type: [String],
26
+ default: null,
27
+ },
24
28
  headless: {
25
29
  type: Boolean,
26
30
  default: false,
@@ -29,7 +33,6 @@ export default {
29
33
 
30
34
  data() {
31
35
  return {
32
- search: '',
33
36
  index: -1,
34
37
  };
35
38
  },
@@ -64,10 +67,9 @@ export default {
64
67
  this.apiListbox().registerSearch(search);
65
68
  },
66
69
 
67
- beforeDestroy() {
68
- this.search = '';
69
- this.$emit('change', this.search.trim());
70
- },
70
+ // beforeUnmount() {
71
+ // this.$emit('change', this.search.trim());
72
+ // },
71
73
 
72
74
  methods: {
73
75
  focusNextItem() {
@@ -119,14 +121,14 @@ export default {
119
121
  if (this.item) this.item.unselect();
120
122
  },
121
123
 
122
- onChange() {
124
+ onInput(event) {
123
125
  this.index = 0;
124
126
  if (this.item) this.item.select();
125
-
126
- this.$emit('change', this.search.trim());
127
+ this.$emit('update:modelValue', event.target.value);
127
128
  },
128
129
 
129
130
  onKeyEnter() {
131
+ console.log(this.item);
130
132
  if (this.item) this.item.onClick();
131
133
  },
132
134
 
@@ -64,7 +64,7 @@ export default {
64
64
  });
65
65
  },
66
66
 
67
- destroyed() {
67
+ unmounted() {
68
68
  // T-76 Create a directive or mixin for this
69
69
  document.removeEventListener('click', this.hide());
70
70
  },
@@ -59,7 +59,7 @@ export default {
59
59
  this.apiTabs().registerTab(this);
60
60
  },
61
61
 
62
- beforeDestroy() {
62
+ beforeUnmount() {
63
63
  this.apiTabs().unregisterTab(this.index);
64
64
  },
65
65
 
@@ -33,7 +33,7 @@ export default {
33
33
  this.apiTabs().registerTabPanel(this);
34
34
  },
35
35
 
36
- beforeDestroy() {
36
+ beforeUnmount() {
37
37
  this.apiTabs().unregisterTabPanel(this.id);
38
38
  },
39
39