@veritree/ui 0.72.1 → 0.73.0
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,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veritree/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.73.0",
|
|
4
4
|
"description": "veritree ui library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"repository": "https://github.com/tentree-org/veritree-ui.git",
|
|
8
8
|
"author": "cyroveritree <cyro@veritree.com>",
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"registry": "https://registry.npmjs.org"
|
|
11
|
+
},
|
|
9
12
|
"scripts": {
|
|
10
13
|
"test": "vitest",
|
|
11
14
|
"coverage": "vitest run --coverage",
|
|
@@ -34,6 +37,5 @@
|
|
|
34
37
|
"engines": {
|
|
35
38
|
"npm": ">=8.0.0",
|
|
36
39
|
"node": ">=18.0.0"
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -9,39 +9,21 @@
|
|
|
9
9
|
? 'listbox-highlight--active'
|
|
10
10
|
: null
|
|
11
11
|
: isActive
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
? '[&>*]:border-gray-700'
|
|
13
|
+
: null,
|
|
14
14
|
]"
|
|
15
15
|
>
|
|
16
16
|
<slot />
|
|
17
17
|
</div>
|
|
18
|
-
<Portal>
|
|
19
|
-
<span
|
|
20
|
-
:id="counterId"
|
|
21
|
-
v-show="isBadgeVisible"
|
|
22
|
-
:class="[
|
|
23
|
-
headless
|
|
24
|
-
? 'listbox-highlight__badge'
|
|
25
|
-
: 'absolute z-40 grid h-5 min-w-[20px] place-content-center rounded-full bg-gray-800 text-xs font-medium text-white',
|
|
26
|
-
]"
|
|
27
|
-
>
|
|
28
|
-
{{ computedValueLength }}
|
|
29
|
-
</span>
|
|
30
|
-
</Portal>
|
|
31
18
|
</div>
|
|
32
19
|
</template>
|
|
33
20
|
|
|
34
21
|
<script>
|
|
35
|
-
import { Portal } from '@linusborg/vue-simple-portal';
|
|
36
22
|
import { computePosition, offset, autoUpdate } from '@floating-ui/dom';
|
|
37
23
|
|
|
38
24
|
export default {
|
|
39
25
|
name: 'VTListboxHighlight',
|
|
40
26
|
|
|
41
|
-
components: {
|
|
42
|
-
Portal,
|
|
43
|
-
},
|
|
44
|
-
|
|
45
27
|
inject: ['apiListbox'],
|
|
46
28
|
|
|
47
29
|
props: {
|
|
@@ -153,72 +135,72 @@ export default {
|
|
|
153
135
|
: this.defaultValue !== this.computedValue;
|
|
154
136
|
},
|
|
155
137
|
|
|
156
|
-
/**
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
isBadgeVisible() {
|
|
166
|
-
|
|
167
|
-
},
|
|
138
|
+
// /**
|
|
139
|
+
// * Checks if the badge should be visible for the listbox item.
|
|
140
|
+
// *
|
|
141
|
+
// * @property
|
|
142
|
+
// * @name isBadgeVisible
|
|
143
|
+
// * @memberof VTListboxTriggerHighlight
|
|
144
|
+
// * @description Checks if the badge should be visible for the listbox item.
|
|
145
|
+
// * @returns {boolean} True if the badge should be visible, false otherwise.
|
|
146
|
+
// */
|
|
147
|
+
// isBadgeVisible() {
|
|
148
|
+
// return this.isValueAnArray && this.isActive;
|
|
149
|
+
// },
|
|
168
150
|
},
|
|
169
151
|
|
|
170
|
-
mounted() {
|
|
171
|
-
|
|
172
|
-
},
|
|
173
|
-
|
|
174
|
-
methods: {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
},
|
|
152
|
+
// mounted() {
|
|
153
|
+
// this.$nextTick(() => this.positionFloatingContent());
|
|
154
|
+
// },
|
|
155
|
+
|
|
156
|
+
// methods: {
|
|
157
|
+
// /**
|
|
158
|
+
// * Positions the floating content relative to a specified trigger element.
|
|
159
|
+
// *
|
|
160
|
+
// * @function
|
|
161
|
+
// * @name positionFloatingContent
|
|
162
|
+
// * @description Calculates and updates the position of the floating content
|
|
163
|
+
// * based on the position of the reference element.
|
|
164
|
+
// * @returns {void}
|
|
165
|
+
// */
|
|
166
|
+
// positionFloatingContent() {
|
|
167
|
+
// /**
|
|
168
|
+
// * The reference element that triggers the positioning of the floating content.
|
|
169
|
+
// * @type {HTMLElement}
|
|
170
|
+
// */
|
|
171
|
+
// const referenceElement = document.getElementById(this.highlightId);
|
|
172
|
+
|
|
173
|
+
// /**
|
|
174
|
+
// * The floating element whose position needs to be updated.
|
|
175
|
+
// * @type {HTMLElement}
|
|
176
|
+
// */
|
|
177
|
+
// const floatingElement = document.getElementById(this.counterId);
|
|
178
|
+
|
|
179
|
+
// /**
|
|
180
|
+
// * Callback function to update the position of the floating element
|
|
181
|
+
// * using the autoUpdate and computePosition utilities.
|
|
182
|
+
// * @type {Function}
|
|
183
|
+
// */
|
|
184
|
+
// const updatePositionCallback = () => {
|
|
185
|
+
// computePosition(referenceElement, floatingElement, {
|
|
186
|
+
// placement: 'top-end',
|
|
187
|
+
// middleware: [
|
|
188
|
+
// offset({
|
|
189
|
+
// alignmentAxis: -10,
|
|
190
|
+
// mainAxis: -10,
|
|
191
|
+
// }),
|
|
192
|
+
// ],
|
|
193
|
+
// }).then(({ x, y }) => {
|
|
194
|
+
// Object.assign(floatingElement.style, {
|
|
195
|
+
// left: `${x}px`,
|
|
196
|
+
// top: `${y}px`,
|
|
197
|
+
// });
|
|
198
|
+
// });
|
|
199
|
+
// };
|
|
200
|
+
|
|
201
|
+
// // Call the autoUpdate function with the specified elements and callback.
|
|
202
|
+
// autoUpdate(referenceElement, floatingElement, updatePositionCallback);
|
|
203
|
+
// },
|
|
204
|
+
// },
|
|
223
205
|
};
|
|
224
206
|
</script>
|