vue-wiring-diagram 1.0.7 → 1.0.8

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": "vue-wiring-diagram",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "A Vue 3.x component for wiring diagram",
5
5
  "type": "module",
6
6
  "main": "dist/vue-wiring-diagram.umd.js",
@@ -217,6 +217,13 @@ const initGraph = () => {
217
217
  controlsKey.value = moment().valueOf()
218
218
  })
219
219
 
220
+ // graph.value.on('node:added', ({node}) => {
221
+ // if(!node.label) {
222
+ // return
223
+ // }
224
+ // node.label = ''
225
+ // })
226
+
220
227
  //选中节点
221
228
  graph.value.on('cell:click', ({cell}) => {
222
229
  console.log('cell:click', cell, cell?.data?.type ?? cell?.shape)
@@ -304,6 +311,14 @@ const initStencil = () => {
304
311
  },
305
312
  placeholder: '搜索',
306
313
  notFoundText: '未找到匹配项',
314
+ getDragNode: (node) => {
315
+ const copyNode = node.clone({ keepId: true })
316
+ copyNode.label = ''
317
+ return copyNode
318
+ },
319
+ getDropNode: (node) => {
320
+ return node.clone({keepId: true})
321
+ },
307
322
  })
308
323
  const text = graph.value.createNode({
309
324
  ...textOptions
@@ -7,6 +7,7 @@
7
7
  display: grid;
8
8
  grid-template-rows: auto 1fr;
9
9
  overflow: hidden;
10
+ //background: url("/packages/assets/image/background.png") #091757 no-repeat center center / cover;
10
11
  background: url("/packages/assets/image/background.png") #091757 no-repeat center center / cover;
11
12
 
12
13
  ::-webkit-scrollbar {