@veritree/ui 0.39.0 → 0.39.2

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.39.0",
3
+ "version": "0.39.2",
4
4
  "description": "veritree ui library",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div
3
- v-if="visible"
3
+ v-if="isVisible"
4
4
  :class="[
5
5
  // default styles
6
6
  headless ? 'alert' : 'flex items-start gap-3 rounded border border-solid',
@@ -60,6 +60,12 @@ export default {
60
60
  prop: 'visible',
61
61
  },
62
62
 
63
+ data() {
64
+ return {
65
+ visibleLocal: true,
66
+ };
67
+ },
68
+
63
69
  props: {
64
70
  variant: {
65
71
  type: String,
@@ -79,7 +85,7 @@ export default {
79
85
  },
80
86
  visible: {
81
87
  type: Boolean,
82
- default: false,
88
+ default: null,
83
89
  },
84
90
  },
85
91
 
@@ -103,11 +109,18 @@ export default {
103
109
  isSmall() {
104
110
  return this.size === 'small';
105
111
  },
112
+
113
+ isVisible() {
114
+ return this.visible !== null ? this.visible : this.visibleLocal;
115
+ },
106
116
  },
107
117
 
108
118
  methods: {
109
119
  hide() {
110
- this.$emit('input', false);
120
+ this.visible !== null
121
+ ? this.$emit('input', false)
122
+ : (this.visibleLocal = false);
123
+
111
124
  this.$emit('dismiss');
112
125
  },
113
126
  },
@@ -16,6 +16,9 @@
16
16
  @keydown.enter.prevent="onClick"
17
17
  @keydown.tab.prevent
18
18
  >
19
+ <!-- <span v-if="multiple">
20
+ <input type="radio" v-model="options" :value="value" />
21
+ </span> -->
19
22
  <slot></slot>
20
23
  <span v-if="wasSelected" class="ml-auto">
21
24
  <IconCheckOutline class="text-secondary-200 h-5 w-5" />
@@ -50,6 +53,7 @@ export default {
50
53
  // apiInjected is used in the mixin floating-ui-item
51
54
  apiInjected: this.apiListbox,
52
55
  componentName: 'listbox-item',
56
+ options: [],
53
57
  };
54
58
  },
55
59
 
@@ -2,7 +2,9 @@
2
2
  <ul
3
3
  :id="id"
4
4
  :class="[
5
- headless ? 'listbox-list' : '-mx-3 max-h-[160px] w-auto overflow-y-auto',
5
+ headless
6
+ ? 'listbox-list'
7
+ : '-mx-3 max-h-[160px] w-auto overflow-y-auto scroll-auto',
6
8
  ]"
7
9
  >
8
10
  <slot></slot>
@@ -111,6 +111,7 @@ export default {
111
111
 
112
112
  // select new item
113
113
  if (this.items[newSelectedIndex]) {
114
+ this.index = newSelectedIndex;
114
115
  this.items[newSelectedIndex].select();
115
116
  }
116
117
  },
@@ -15,7 +15,7 @@
15
15
  :class="[
16
16
  headless
17
17
  ? `${this.component}-content`
18
- : `shadow-300 absolute z-50 grid overflow-x-hidden rounded-md ${this.classes} ${this.portalClass}`,
18
+ : `shadow-300 absolute z-50 grid overflow-hidden rounded-md ${this.classes} ${this.portalClass}`,
19
19
  ]"
20
20
  v-bind="$attrs"
21
21
  >