@dataloop-ai/components 0.17.110 → 0.17.112

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": "@dataloop-ai/components",
3
- "version": "0.17.110",
3
+ "version": "0.17.112",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -11,6 +11,7 @@
11
11
  @mouseleave="handleVisibleDragIcon(false)"
12
12
  >
13
13
  <dl-icon
14
+ v-if="draggable"
14
15
  :style="iconStyles"
15
16
  class="dl-widget__drag-icon"
16
17
  icon="icon-dl-drag"
@@ -52,6 +53,12 @@ export default defineComponent({
52
53
  components: {
53
54
  DlIcon
54
55
  },
56
+ props: {
57
+ draggable: {
58
+ type: Boolean,
59
+ default: true
60
+ }
61
+ },
55
62
  data() {
56
63
  return {
57
64
  uuid: `dl-widget-${v4()}`,
@@ -193,6 +200,9 @@ export default defineComponent({
193
200
  }
194
201
  },
195
202
  handleVisibleDragIcon(val: boolean) {
203
+ if (!this.draggable) {
204
+ return
205
+ }
196
206
  if (!document.querySelector('.drag-clone').innerHTML.toString()) {
197
207
  this.visibleDragIcon = val
198
208
  }
@@ -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 === 1)
279
+ resolve(entry.intersectionRatio >= intersectionRatio)
272
280
  o.disconnect()
273
281
  })
274
282
  o.observe(domElement)