@dataloop-ai/components 0.17.111 → 0.17.113

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.111",
3
+ "version": "0.17.113",
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
  }
@@ -101,8 +101,8 @@ export function getAnchorProps(el: HTMLElement, offset: number[]) {
101
101
  bottom,
102
102
  width,
103
103
  height,
104
- middle: left + (right - left) / 2,
105
- center: top + (bottom - top) / 2
104
+ middle: left + (right - left) / 2 + offset[0] ?? 0,
105
+ center: top + (bottom - top) / 2 + offset[1] ?? 0
106
106
  }
107
107
  }
108
108