@dataloop-ai/components 0.17.110 → 0.17.111
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
|
@@ -131,6 +131,13 @@ export default defineComponent({
|
|
|
131
131
|
default: 'left',
|
|
132
132
|
validator: (v: string) =>
|
|
133
133
|
['left', 'right', 'justify', 'center'].includes(v)
|
|
134
|
+
},
|
|
135
|
+
/**
|
|
136
|
+
* the % of the parent element that triggers the tooltips visibility
|
|
137
|
+
*/
|
|
138
|
+
triggerPercentage: {
|
|
139
|
+
type: Number,
|
|
140
|
+
default: 1
|
|
134
141
|
}
|
|
135
142
|
},
|
|
136
143
|
setup(props, { emit, attrs }) {
|
|
@@ -266,9 +273,10 @@ export default defineComponent({
|
|
|
266
273
|
}
|
|
267
274
|
|
|
268
275
|
function CheckAnchorElVisiblity(domElement: any) {
|
|
276
|
+
const intersectionRatio = props.triggerPercentage ?? 1
|
|
269
277
|
return new Promise((resolve) => {
|
|
270
278
|
const o = new IntersectionObserver(([entry]) => {
|
|
271
|
-
resolve(entry.intersectionRatio
|
|
279
|
+
resolve(entry.intersectionRatio >= intersectionRatio)
|
|
272
280
|
o.disconnect()
|
|
273
281
|
})
|
|
274
282
|
o.observe(domElement)
|