zydx-plus 1.35.499 → 1.35.500
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": "zydx-plus",
|
|
3
|
-
"version": "1.35.
|
|
3
|
+
"version": "1.35.500",
|
|
4
4
|
"description": "Vue.js",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -50,7 +50,8 @@
|
|
|
50
50
|
"react-dom": "^18.2.0",
|
|
51
51
|
"tldraw": "^2.0.2",
|
|
52
52
|
"@tldraw/editor": "^2.0.2",
|
|
53
|
-
"buffer": "^5.7.1"
|
|
53
|
+
"buffer": "^5.7.1",
|
|
54
|
+
"interactjs": "^1.10.27"
|
|
54
55
|
},
|
|
55
56
|
"peerDependencies": {
|
|
56
57
|
"vue": "^3.2.13"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="drag-pop" :class="{trans: transAll, 'drag-pop-shadow': !fixedStart}" :style="position" :id="id" @click.stop="dragTap">
|
|
3
3
|
<div v-show="!fixedStart" class="drag-head" :style="{'background-color':titleColor}" @click="selectedDrag">
|
|
4
|
-
<span
|
|
4
|
+
<span class="draggable" :style="{'text-align': title === ''? 'center':'left'}" v-html="title"></span>
|
|
5
5
|
<div class="drag-i">
|
|
6
6
|
<!-- <i class="minimize-cir" v-if="minimizeCir" @click.stop="minimizeTap"></i>-->
|
|
7
7
|
<!-- <i class="minimize" v-if="minimize" @click.stop="minimizeTap"></i>-->
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
<slot name="content"></slot>
|
|
18
18
|
</div>
|
|
19
19
|
<div v-show="!fixedStart&&!autoHeight">
|
|
20
|
-
<i :class="{'drag-down2':!(dragStatus&&dragTextShow&&!fixedStart&&!autoHeight)}" class="drag-down" v-if="dragStatus" @mousedown.stop="footDown($event,'d')" @mouseup.stop="footUp"></i
|
|
20
|
+
<!-- <i :class="{'drag-down2':!(dragStatus&&dragTextShow&&!fixedStart&&!autoHeight)}" class="drag-down" v-if="dragStatus" @mousedown.stop="footDown($event,'d')" @mouseup.stop="footUp"></i>-->
|
|
21
21
|
<i :class="{'drag-in2':!(dragStatus&&dragTextShow&&!fixedStart&&!autoHeight)}" class="drag-in" v-if="dragStatus" @mousedown.stop="footDown($event,'in')" @mouseup.stop="footUp"></i>
|
|
22
|
-
<i :class="{'drag-right2':!(dragStatus&&dragTextShow&&!fixedStart&&!autoHeight)}" class="drag-right" v-if="dragStatus" @mousedown.stop="footDown($event,'r')" @mouseup.stop="footUp"></i
|
|
22
|
+
<!-- <i :class="{'drag-right2':!(dragStatus&&dragTextShow&&!fixedStart&&!autoHeight)}" class="drag-right" v-if="dragStatus" @mousedown.stop="footDown($event,'r')" @mouseup.stop="footUp"></i>-->
|
|
23
23
|
</div>
|
|
24
24
|
</div>
|
|
25
25
|
<div class="down-text" v-if="dragStatus&&dragTextShow&&!fixedStart&&!autoHeight">
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
</template>
|
|
35
35
|
|
|
36
36
|
<script>
|
|
37
|
+
import interact from 'interactjs'
|
|
37
38
|
export default {
|
|
38
39
|
name: "zydx-drag-popup",
|
|
39
40
|
data() {
|
|
@@ -163,11 +164,18 @@ export default {
|
|
|
163
164
|
}
|
|
164
165
|
},
|
|
165
166
|
mounted() {
|
|
167
|
+
let that = this
|
|
166
168
|
this.id = Math.random().toString(36).substr(2);
|
|
167
169
|
this.init()
|
|
168
170
|
// 全局监听鼠标抬起事件
|
|
169
|
-
|
|
170
|
-
|
|
171
|
+
interact('.draggable').draggable({
|
|
172
|
+
listeners: {
|
|
173
|
+
move (event) {
|
|
174
|
+
that.y = event.rect.top
|
|
175
|
+
that.x = event.rect.left
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
})
|
|
171
179
|
document.addEventListener('mouseup', this.footUp);
|
|
172
180
|
this.$nextTick(() => {
|
|
173
181
|
this.$emit('updateDrag', {
|
|
@@ -297,38 +305,6 @@ export default {
|
|
|
297
305
|
})
|
|
298
306
|
this.footIsMove = false;
|
|
299
307
|
},
|
|
300
|
-
mousedown(event) {
|
|
301
|
-
event.preventDefault()
|
|
302
|
-
//鼠标按下事件
|
|
303
|
-
this.leftOffset = event.offsetX;
|
|
304
|
-
this.topOffset = event.offsetY;
|
|
305
|
-
this.isMove = true;
|
|
306
|
-
this.dragTap()
|
|
307
|
-
},
|
|
308
|
-
//鼠标移动
|
|
309
|
-
mousemove(event) {
|
|
310
|
-
if (this.state) return;
|
|
311
|
-
if (!this.isMove) return;
|
|
312
|
-
this.x = event.clientX - this.leftOffset;
|
|
313
|
-
this.y = event.clientY - this.topOffset;
|
|
314
|
-
// 边界判断
|
|
315
|
-
if (this.x < -this.footRightOffset / 2) {
|
|
316
|
-
this.x = -this.footRightOffset / 2
|
|
317
|
-
}
|
|
318
|
-
if (this.x > this.clientWidth - this.footRightOffset + this.footRightOffset / 2) {
|
|
319
|
-
this.x = this.clientWidth - this.footRightOffset + this.footRightOffset / 2
|
|
320
|
-
}
|
|
321
|
-
if (this.y < 0) {
|
|
322
|
-
this.y = 0
|
|
323
|
-
}
|
|
324
|
-
if (this.y > this.clientHeight - this.footDownOffset + this.footDownOffset / 2) {
|
|
325
|
-
this.y = this.clientHeight - this.footDownOffset + this.footDownOffset / 2
|
|
326
|
-
}
|
|
327
|
-
},
|
|
328
|
-
//鼠标抬起
|
|
329
|
-
mouseup() {
|
|
330
|
-
this.isMove = false;
|
|
331
|
-
},
|
|
332
308
|
enlarge() {
|
|
333
309
|
this.state = false
|
|
334
310
|
let clientWidth = document.documentElement.clientWidth;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<teleport to="body">
|
|
3
3
|
<div class="drag-pop" :class="{trans: transAll, 'drag-pop-shadow': !fixedStart}" :style="position" :id="id" @click.stop="dragTap">
|
|
4
4
|
<div v-show="!fixedStart" class="drag-head" :style="{'background-color':titleColor}" @click="selectedDrag">
|
|
5
|
-
<span
|
|
5
|
+
<span :style="{'text-align': title === ''? 'center':'left'}" v-html="title"></span>
|
|
6
6
|
<div class="drag-i">
|
|
7
7
|
<!-- <i class="minimize-cir" v-if="minimizeCir" @click.stop="minimizeTap"></i>-->
|
|
8
8
|
<!-- <i class="minimize" v-if="minimize" @click.stop="minimizeTap"></i>-->
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
<slot name="content"></slot>
|
|
19
19
|
</div>
|
|
20
20
|
<div v-show="!fixedStart&&!autoHeight">
|
|
21
|
-
<i :class="{'drag-down2':!(dragStatus&&dragTextShow&&!fixedStart&&!autoHeight)}" class="drag-down" v-if="dragStatus" @mousedown.stop="footDown($event,'d')" @mouseup.stop="footUp"></i
|
|
21
|
+
<!-- <i :class="{'drag-down2':!(dragStatus&&dragTextShow&&!fixedStart&&!autoHeight)}" class="drag-down" v-if="dragStatus" @mousedown.stop="footDown($event,'d')" @mouseup.stop="footUp"></i>-->
|
|
22
22
|
<i :class="{'drag-in2':!(dragStatus&&dragTextShow&&!fixedStart&&!autoHeight)}" class="drag-in" v-if="dragStatus" @mousedown.stop="footDown($event,'in')" @mouseup.stop="footUp"></i>
|
|
23
|
-
<i :class="{'drag-right2':!(dragStatus&&dragTextShow&&!fixedStart&&!autoHeight)}" class="drag-right" v-if="dragStatus" @mousedown.stop="footDown($event,'r')" @mouseup.stop="footUp"></i
|
|
23
|
+
<!-- <i :class="{'drag-right2':!(dragStatus&&dragTextShow&&!fixedStart&&!autoHeight)}" class="drag-right" v-if="dragStatus" @mousedown.stop="footDown($event,'r')" @mouseup.stop="footUp"></i>-->
|
|
24
24
|
</div>
|
|
25
25
|
</div>
|
|
26
26
|
<div class="down-text" v-if="dragStatus&&dragTextShow&&!fixedStart&&!autoHeight">
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
</template>
|
|
37
37
|
|
|
38
38
|
<script>
|
|
39
|
+
import interact from 'interactjs'
|
|
39
40
|
export default {
|
|
40
41
|
name: "zydx-drag-popup2",
|
|
41
42
|
data() {
|
|
@@ -165,11 +166,17 @@ export default {
|
|
|
165
166
|
}
|
|
166
167
|
},
|
|
167
168
|
mounted() {
|
|
169
|
+
const that = this
|
|
168
170
|
this.id = Math.random().toString(36).substr(2);
|
|
169
171
|
this.init()
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
172
|
+
interact('.draggable').draggable({
|
|
173
|
+
listeners: {
|
|
174
|
+
move (event) {
|
|
175
|
+
that.y = event.rect.top
|
|
176
|
+
that.x = event.rect.left
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
})
|
|
173
180
|
document.addEventListener('mouseup', this.footUp);
|
|
174
181
|
this.$nextTick(() => {
|
|
175
182
|
this.$emit('updateDrag', {
|
|
@@ -299,38 +306,6 @@ export default {
|
|
|
299
306
|
})
|
|
300
307
|
this.footIsMove = false;
|
|
301
308
|
},
|
|
302
|
-
mousedown(event) {
|
|
303
|
-
event.preventDefault()
|
|
304
|
-
//鼠标按下事件
|
|
305
|
-
this.leftOffset = event.offsetX;
|
|
306
|
-
this.topOffset = event.offsetY;
|
|
307
|
-
this.isMove = true;
|
|
308
|
-
this.dragTap()
|
|
309
|
-
},
|
|
310
|
-
//鼠标移动
|
|
311
|
-
mousemove(event) {
|
|
312
|
-
if (this.state) return;
|
|
313
|
-
if (!this.isMove) return;
|
|
314
|
-
this.x = event.clientX - this.leftOffset;
|
|
315
|
-
this.y = event.clientY - this.topOffset;
|
|
316
|
-
// 边界判断
|
|
317
|
-
if (this.x < -this.footRightOffset / 2) {
|
|
318
|
-
this.x = -this.footRightOffset / 2
|
|
319
|
-
}
|
|
320
|
-
if (this.x > this.clientWidth - this.footRightOffset + this.footRightOffset / 2) {
|
|
321
|
-
this.x = this.clientWidth - this.footRightOffset + this.footRightOffset / 2
|
|
322
|
-
}
|
|
323
|
-
if (this.y < 0) {
|
|
324
|
-
this.y = 0
|
|
325
|
-
}
|
|
326
|
-
if (this.y > this.clientHeight - this.footDownOffset + this.footDownOffset / 2) {
|
|
327
|
-
this.y = this.clientHeight - this.footDownOffset + this.footDownOffset / 2
|
|
328
|
-
}
|
|
329
|
-
},
|
|
330
|
-
//鼠标抬起
|
|
331
|
-
mouseup() {
|
|
332
|
-
this.isMove = false;
|
|
333
|
-
},
|
|
334
309
|
enlarge() {
|
|
335
310
|
this.state = false
|
|
336
311
|
let clientWidth = document.documentElement.clientWidth;
|