@veritree/ui 0.87.1 → 0.87.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/mixins/floating-ui-content.js +11 -0
- package/mixins/floating-ui.js +5 -0
- package/mixins/form-control.js +0 -4
- package/package.json +1 -1
- package/src/components/Form/VTInput.vue +0 -7
- package/src/components/Form/VTInputDate.vue +4 -0
- package/src/components/Form/VTInputNumber.vue +4 -0
- package/src/components/Listbox/VTListbox.vue +6 -3
- package/src/components/Listbox/VTListboxTrigger.vue +11 -5
|
@@ -43,7 +43,18 @@ export const floatingUiContentMixin = {
|
|
|
43
43
|
this.component.setActive();
|
|
44
44
|
|
|
45
45
|
setTimeout(() => {
|
|
46
|
+
if (!this.id) {
|
|
47
|
+
console.log('No id provided');
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
46
51
|
this.el = document.getElementById(this.id);
|
|
52
|
+
|
|
53
|
+
if (!this.el) {
|
|
54
|
+
console.log('Element not found', this.id);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
47
58
|
this.$emit('shown');
|
|
48
59
|
}, 100);
|
|
49
60
|
});
|
package/mixins/floating-ui.js
CHANGED
|
@@ -139,6 +139,11 @@ export const floatingUiMixin = {
|
|
|
139
139
|
const content = document.getElementById(this.componentContent.id);
|
|
140
140
|
const minWidthLimit = Number(this.floatingUiMinWidth);
|
|
141
141
|
|
|
142
|
+
if (!trigger || !content) {
|
|
143
|
+
console.error('The trigger or content element does not exist.');
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
|
|
142
147
|
if (this.top || this.left) {
|
|
143
148
|
this.positionContentToTriggerByTopAndLeft(
|
|
144
149
|
trigger,
|
package/mixins/form-control.js
CHANGED
package/package.json
CHANGED
|
@@ -118,6 +118,10 @@ export default {
|
|
|
118
118
|
},
|
|
119
119
|
|
|
120
120
|
props: {
|
|
121
|
+
id: {
|
|
122
|
+
type: String,
|
|
123
|
+
default: null,
|
|
124
|
+
},
|
|
121
125
|
/**
|
|
122
126
|
* The value of the component. Can be a string, number, object, or array.
|
|
123
127
|
* @type {string|number|object|array}
|
|
@@ -171,7 +175,6 @@ export default {
|
|
|
171
175
|
|
|
172
176
|
data() {
|
|
173
177
|
return {
|
|
174
|
-
componentId: genId(),
|
|
175
178
|
componentSearch: null,
|
|
176
179
|
search: '',
|
|
177
180
|
items: [],
|
|
@@ -195,8 +198,8 @@ export default {
|
|
|
195
198
|
},
|
|
196
199
|
|
|
197
200
|
computed: {
|
|
198
|
-
|
|
199
|
-
return `listbox-${this.
|
|
201
|
+
componentId() {
|
|
202
|
+
return `listbox-${this.id || genId()}`;
|
|
200
203
|
},
|
|
201
204
|
|
|
202
205
|
valueComputed: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<button
|
|
3
|
-
:id="
|
|
4
|
-
:data-testid="
|
|
3
|
+
:id="id"
|
|
4
|
+
:data-testid="dataTestidComputed"
|
|
5
5
|
:class="triggerClassComputed"
|
|
6
6
|
:disabled="isDisabled"
|
|
7
7
|
:aria-expanded="expanded"
|
|
@@ -47,6 +47,8 @@ export default {
|
|
|
47
47
|
|
|
48
48
|
inject: ['apiListbox'],
|
|
49
49
|
|
|
50
|
+
inheritAttrs: false,
|
|
51
|
+
|
|
50
52
|
props: {
|
|
51
53
|
dataTestid: {
|
|
52
54
|
type: String,
|
|
@@ -74,8 +76,12 @@ export default {
|
|
|
74
76
|
},
|
|
75
77
|
|
|
76
78
|
computed: {
|
|
77
|
-
|
|
78
|
-
return
|
|
79
|
+
id() {
|
|
80
|
+
return `listbox-trigger-${this.apiListbox().id}`;
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
dataTestidComputed() {
|
|
84
|
+
return this.dataTestid || `listbox-trigger-${this.apiListbox().id}`;
|
|
79
85
|
},
|
|
80
86
|
|
|
81
87
|
componentContent() {
|
|
@@ -120,7 +126,7 @@ export default {
|
|
|
120
126
|
el: this.$el,
|
|
121
127
|
cancel: this.cancel,
|
|
122
128
|
focus: this.focus,
|
|
123
|
-
id: this.
|
|
129
|
+
id: this.id,
|
|
124
130
|
};
|
|
125
131
|
|
|
126
132
|
this.apiListbox().registerTrigger(trigger);
|