@progress/kendo-vue-layout 3.7.4-dev.202211100847 → 3.7.4-dev.202211301436
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/dist/cdn/js/kendo-vue-layout.js +1 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/tilelayout/ResizeHandlers.d.ts +1 -1
- package/dist/es/tilelayout/ResizeHandlers.js +98 -42
- package/dist/es/tilelayout/Tile.js +187 -148
- package/dist/es/tilelayout/TileLayout.js +125 -99
- package/dist/es/tilelayout/interfaces/main.d.ts +18 -4
- package/dist/esm/package-metadata.js +1 -1
- package/dist/esm/tilelayout/ResizeHandlers.d.ts +1 -1
- package/dist/esm/tilelayout/ResizeHandlers.js +98 -42
- package/dist/esm/tilelayout/Tile.js +187 -148
- package/dist/esm/tilelayout/TileLayout.js +125 -99
- package/dist/esm/tilelayout/interfaces/main.d.ts +18 -4
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/tilelayout/ResizeHandlers.d.ts +1 -1
- package/dist/npm/tilelayout/ResizeHandlers.js +98 -42
- package/dist/npm/tilelayout/Tile.js +186 -148
- package/dist/npm/tilelayout/TileLayout.js +124 -98
- package/dist/npm/tilelayout/interfaces/main.d.ts +18 -4
- package/package.json +13 -11
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-vue-layout',
|
|
6
6
|
productName: 'Kendo UI for Vue',
|
|
7
7
|
productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1669818334,
|
|
9
9
|
version: '',
|
|
10
10
|
licensingDocsUrl: 'https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning'
|
|
11
11
|
};
|
|
@@ -1,17 +1,78 @@
|
|
|
1
|
+
var __assign = this && this.__assign || function () {
|
|
2
|
+
__assign = Object.assign || function (t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) {
|
|
6
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
1
13
|
// @ts-ignore
|
|
2
14
|
import * as Vue from 'vue';
|
|
3
15
|
var allVue = Vue;
|
|
4
16
|
var gh = allVue.h;
|
|
5
17
|
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
18
|
+
import { Draggable } from '@progress/kendo-vue-common';
|
|
6
19
|
/**
|
|
7
20
|
* @hidden
|
|
8
21
|
*/
|
|
9
22
|
var ResizeHandlersVue2 = {
|
|
10
23
|
name: 'KendoResizeHandlers',
|
|
11
24
|
props: {
|
|
12
|
-
|
|
25
|
+
direction: String,
|
|
13
26
|
rtl: Boolean
|
|
14
27
|
},
|
|
28
|
+
computed: {
|
|
29
|
+
handleClass: function handleClass() {
|
|
30
|
+
return 'k-resize-handle k-cursor-' + this.direction + '-resize';
|
|
31
|
+
},
|
|
32
|
+
dirStyles: function dirStyles() {
|
|
33
|
+
var direction = this.$props.direction;
|
|
34
|
+
switch (direction) {
|
|
35
|
+
case 'ew':
|
|
36
|
+
return this.rtl ? {
|
|
37
|
+
top: 0,
|
|
38
|
+
width: '9px',
|
|
39
|
+
left: 0,
|
|
40
|
+
right: ''
|
|
41
|
+
} : {
|
|
42
|
+
top: 0,
|
|
43
|
+
width: '9px',
|
|
44
|
+
right: 0,
|
|
45
|
+
left: ''
|
|
46
|
+
};
|
|
47
|
+
case 'ns':
|
|
48
|
+
return {
|
|
49
|
+
left: 0,
|
|
50
|
+
height: '9px'
|
|
51
|
+
};
|
|
52
|
+
case 'nesw':
|
|
53
|
+
case 'nwse':
|
|
54
|
+
return this.rtl ? {
|
|
55
|
+
width: '9px',
|
|
56
|
+
height: '9px',
|
|
57
|
+
right: '',
|
|
58
|
+
left: 0
|
|
59
|
+
} : {
|
|
60
|
+
width: '9px',
|
|
61
|
+
height: '9px',
|
|
62
|
+
right: 0,
|
|
63
|
+
left: ''
|
|
64
|
+
};
|
|
65
|
+
default:
|
|
66
|
+
return {};
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
handleStyle: function handleStyle() {
|
|
70
|
+
return __assign({
|
|
71
|
+
bottom: 0,
|
|
72
|
+
right: 0
|
|
73
|
+
}, this.dirStyles);
|
|
74
|
+
}
|
|
75
|
+
},
|
|
15
76
|
// @ts-ignore
|
|
16
77
|
setup: !isV3 ? undefined : function () {
|
|
17
78
|
var v3 = !!isV3;
|
|
@@ -20,55 +81,50 @@ var ResizeHandlersVue2 = {
|
|
|
20
81
|
};
|
|
21
82
|
},
|
|
22
83
|
render: function render(createElement) {
|
|
84
|
+
var _this2 = this;
|
|
85
|
+
var _this = this;
|
|
23
86
|
var h = gh || createElement;
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
// {(resizable === true) && (
|
|
55
|
-
// <Handle
|
|
56
|
-
// onPress={onPress}
|
|
57
|
-
// onResize={this.handleResize}
|
|
58
|
-
// d={rtl ? 'nesw' : 'nwse'}
|
|
59
|
-
// style={rtl ? { width: 9, height: 9, right: '', left: 0 } : { width: 9, height: 9, right: 0, left: '' }}
|
|
60
|
-
// />)}
|
|
61
|
-
// </React.Fragment>
|
|
62
|
-
;
|
|
87
|
+
var direction = this.$props.direction;
|
|
88
|
+
return (
|
|
89
|
+
// @ts-ignore function children
|
|
90
|
+
h(Draggable, {
|
|
91
|
+
onPress: this.handlePress,
|
|
92
|
+
on: this.v3 ? undefined : {
|
|
93
|
+
"press": this.handlePress,
|
|
94
|
+
"drag": function drag(event) {
|
|
95
|
+
_this.handleResize(event, false, direction);
|
|
96
|
+
},
|
|
97
|
+
"release": function release(event) {
|
|
98
|
+
_this.handleResize(event, true, direction);
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
onDrag: function drag(event) {
|
|
102
|
+
_this.handleResize(event, false, direction);
|
|
103
|
+
},
|
|
104
|
+
onRelease: function release(event) {
|
|
105
|
+
_this.handleResize(event, true, direction);
|
|
106
|
+
}
|
|
107
|
+
}, this.v3 ? function () {
|
|
108
|
+
return [h("div", {
|
|
109
|
+
"class": _this2.handleClass,
|
|
110
|
+
style: _this2.handleStyle
|
|
111
|
+
})];
|
|
112
|
+
} : [h("div", {
|
|
113
|
+
"class": _this2.handleClass,
|
|
114
|
+
style: _this2.handleStyle
|
|
115
|
+
})])
|
|
116
|
+
);
|
|
63
117
|
},
|
|
64
|
-
|
|
65
118
|
methods: {
|
|
66
119
|
handleResize: function handleResize(event, isEnd, direction) {
|
|
67
120
|
event.originalEvent.preventDefault();
|
|
68
|
-
this.$
|
|
121
|
+
this.$emit('resize', event, {
|
|
69
122
|
end: isEnd,
|
|
70
123
|
direction: direction
|
|
71
124
|
});
|
|
125
|
+
},
|
|
126
|
+
handlePress: function handlePress(event) {
|
|
127
|
+
this.$emit('press', event);
|
|
72
128
|
}
|
|
73
129
|
}
|
|
74
130
|
};
|
|
@@ -15,7 +15,7 @@ import * as Vue from 'vue';
|
|
|
15
15
|
var allVue = Vue;
|
|
16
16
|
var gh = allVue.h;
|
|
17
17
|
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
18
|
-
import { canUseDOM,
|
|
18
|
+
import { canUseDOM, Draggable, getDefaultSlots } from '@progress/kendo-vue-common';
|
|
19
19
|
import { ResizeHandlers } from './ResizeHandlers';
|
|
20
20
|
/**
|
|
21
21
|
* @hidden
|
|
@@ -28,12 +28,11 @@ var TileVue2 = {
|
|
|
28
28
|
name: 'KendoTile',
|
|
29
29
|
props: {
|
|
30
30
|
defaultPosition: {
|
|
31
|
-
type: Object,
|
|
32
31
|
required: true
|
|
33
32
|
},
|
|
34
33
|
index: Number,
|
|
35
34
|
hintStyle: Object,
|
|
36
|
-
|
|
35
|
+
hintClass: String,
|
|
37
36
|
header: [String, Function, Object],
|
|
38
37
|
body: [String, Function, Object],
|
|
39
38
|
item: [String, Function, Object],
|
|
@@ -50,85 +49,115 @@ var TileVue2 = {
|
|
|
50
49
|
}
|
|
51
50
|
},
|
|
52
51
|
created: function created() {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
52
|
+
this.oldSize = {};
|
|
53
|
+
this.dragging = false;
|
|
54
|
+
this.resizing = false;
|
|
55
|
+
this.ignoreDrag = false;
|
|
56
|
+
this.pressOffset = {
|
|
57
|
+
x: 0,
|
|
58
|
+
y: 0
|
|
59
|
+
};
|
|
60
|
+
this.pressXY = {
|
|
61
|
+
x: 0,
|
|
62
|
+
y: 0
|
|
63
|
+
};
|
|
64
|
+
this.currentTranslate = {
|
|
65
|
+
x: 0,
|
|
66
|
+
y: 0
|
|
67
|
+
};
|
|
68
|
+
this.prevDefaultPosition = this.$props.defaultPosition;
|
|
69
|
+
this.preventDataOps = undefined;
|
|
70
|
+
},
|
|
71
|
+
computed: {
|
|
72
|
+
wrapperClass: function wrapperClass() {
|
|
73
|
+
return {
|
|
74
|
+
'k-tilelayout-item': true,
|
|
75
|
+
'k-card': true,
|
|
76
|
+
'k-cursor-grab': this.reorderable
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
data: function data() {
|
|
81
|
+
return {
|
|
82
|
+
rtl: false
|
|
83
|
+
};
|
|
69
84
|
},
|
|
70
85
|
mounted: function mounted() {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
86
|
+
if (!this.$el) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (this.$el) {
|
|
90
|
+
this.draggable = this.$refs.draggable;
|
|
91
|
+
}
|
|
92
|
+
if (getComputedStyle(this.$el).direction === 'rtl') {
|
|
93
|
+
this.rtl = true;
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
watch: {
|
|
97
|
+
defaultPosition: function defaultPosition(_, oldValue) {
|
|
98
|
+
this.prevDefaultPosition = oldValue;
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
beforeUpdate: function beforeUpdate() {
|
|
102
|
+
this.oldSize = {};
|
|
103
|
+
var dragElement = this.dragElement();
|
|
104
|
+
if (dragElement) {
|
|
105
|
+
this.oldSize = dragElement.getBoundingClientRect();
|
|
106
|
+
}
|
|
107
|
+
return null;
|
|
79
108
|
},
|
|
80
109
|
updated: function updated() {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
110
|
+
var dragElement = this.dragElement();
|
|
111
|
+
if (!dragElement) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
var newBox = dragElement.getBoundingClientRect();
|
|
115
|
+
var oldBox = this.oldSize;
|
|
116
|
+
var that = this;
|
|
117
|
+
if (this.resizing) {
|
|
118
|
+
var diffCol = newBox.width - oldBox.width;
|
|
119
|
+
if (this.rtl) {
|
|
120
|
+
var currentM = parseFloat(dragElement.style.marginLeft || '0');
|
|
121
|
+
dragElement.style.marginLeft = currentM - diffCol + 'px';
|
|
122
|
+
} else {
|
|
123
|
+
var currentM = parseFloat(dragElement.style.marginRight || '0');
|
|
124
|
+
dragElement.style.marginRight = currentM + diffCol + 'px';
|
|
125
|
+
}
|
|
126
|
+
this.pressXY.x += this.rtl ? -diffCol : diffCol;
|
|
127
|
+
var diffRow = newBox.height - oldBox.height;
|
|
128
|
+
var currentBot = parseFloat(dragElement.style.height.substring(12));
|
|
129
|
+
dragElement.style.height = "calc(100% + ".concat(currentBot + diffRow, "px)");
|
|
130
|
+
this.pressXY.y += diffRow;
|
|
131
|
+
}
|
|
132
|
+
var deltaX = oldBox.left - newBox.left;
|
|
133
|
+
var deltaY = oldBox.top - newBox.top;
|
|
134
|
+
if (deltaX === 0 && deltaY === 0) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (this.dragging) {
|
|
138
|
+
if (this.prevDefaultPosition.order !== this.$props.defaultPosition.order || this.prevDefaultPosition.col !== this.$props.defaultPosition.col) {
|
|
139
|
+
this.currentTranslate.x = 0;
|
|
140
|
+
this.currentTranslate.y = 0;
|
|
141
|
+
dragElement.style.transform = '';
|
|
142
|
+
}
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
if (Math.abs(deltaY) < 15 && Math.abs(deltaX) < 15) {
|
|
146
|
+
// improves performance and removes random flickering
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
requestAnimationFrame(function () {
|
|
150
|
+
var domNode = that.$el;
|
|
151
|
+
if (!domNode) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
domNode.style.transform = "translate(".concat(deltaX, "px, ").concat(deltaY, "px)");
|
|
155
|
+
domNode.style.transition = 'transform 0s';
|
|
156
|
+
requestAnimationFrame(function () {
|
|
157
|
+
domNode.style.transform = '';
|
|
158
|
+
domNode.style.transition = "transform ".concat(ANIMATION_DURATION, "ms cubic-bezier(0.2, 0, 0, 1) 0s");
|
|
159
|
+
});
|
|
160
|
+
});
|
|
132
161
|
},
|
|
133
162
|
// @ts-ignore
|
|
134
163
|
setup: !isV3 ? undefined : function () {
|
|
@@ -160,83 +189,102 @@ var TileVue2 = {
|
|
|
160
189
|
order: position.order
|
|
161
190
|
}, this.$props.hintStyle);
|
|
162
191
|
var card = h("div", {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
element: e
|
|
166
|
-
} : null;
|
|
167
|
-
},
|
|
168
|
-
"class": classNames('k-tilelayout-item k-card', {
|
|
169
|
-
'k-cursor-grab': this.reorderable
|
|
170
|
-
}, this.$props.className),
|
|
171
|
-
style: __assign({
|
|
192
|
+
"class": this.wrapperClass,
|
|
193
|
+
style: {
|
|
172
194
|
height: '100%'
|
|
173
|
-
}
|
|
174
|
-
}, [defaultSlots,
|
|
175
|
-
|
|
176
|
-
|
|
195
|
+
}
|
|
196
|
+
}, [defaultSlots, resizable !== 'vertical' && h(ResizeHandlers, {
|
|
197
|
+
onPress: this.handlePress,
|
|
198
|
+
on: this.v3 ? undefined : {
|
|
199
|
+
"press": this.handlePress,
|
|
200
|
+
"resize": this.handleResize
|
|
201
|
+
},
|
|
202
|
+
onResize: this.handleResize,
|
|
203
|
+
direction: "ew",
|
|
204
|
+
attrs: this.v3 ? undefined : {
|
|
205
|
+
direction: "ew",
|
|
206
|
+
rtl: this.rtl
|
|
207
|
+
},
|
|
208
|
+
rtl: this.rtl
|
|
209
|
+
}), resizable !== 'horizontal' && h(ResizeHandlers, {
|
|
177
210
|
onPress: this.handlePress,
|
|
178
211
|
on: this.v3 ? undefined : {
|
|
179
212
|
"press": this.handlePress,
|
|
180
213
|
"resize": this.handleResize
|
|
181
214
|
},
|
|
182
215
|
onResize: this.handleResize,
|
|
183
|
-
|
|
216
|
+
direction: "ns",
|
|
184
217
|
attrs: this.v3 ? undefined : {
|
|
185
|
-
|
|
186
|
-
rtl: this.
|
|
218
|
+
direction: "ns",
|
|
219
|
+
rtl: this.rtl
|
|
187
220
|
},
|
|
188
|
-
rtl: this.
|
|
221
|
+
rtl: this.rtl
|
|
222
|
+
}), resizable === true && h(ResizeHandlers, {
|
|
223
|
+
onPress: this.handlePress,
|
|
224
|
+
on: this.v3 ? undefined : {
|
|
225
|
+
"press": this.handlePress,
|
|
226
|
+
"resize": this.handleResize
|
|
227
|
+
},
|
|
228
|
+
onResize: this.handleResize,
|
|
229
|
+
direction: this.rtl ? 'nesw' : 'nwse',
|
|
230
|
+
attrs: this.v3 ? undefined : {
|
|
231
|
+
direction: this.rtl ? 'nesw' : 'nwse',
|
|
232
|
+
rtl: this.rtl
|
|
233
|
+
},
|
|
234
|
+
rtl: this.rtl
|
|
189
235
|
})]);
|
|
190
236
|
return h("div", {
|
|
191
237
|
style: itemStyles,
|
|
192
|
-
"class": this.$props.
|
|
238
|
+
"class": this.$props.hintClass
|
|
193
239
|
}, [
|
|
194
240
|
// @ts-ignore function children
|
|
195
241
|
h(Draggable, {
|
|
196
|
-
ref:
|
|
197
|
-
|
|
198
|
-
},
|
|
199
|
-
onDrag: this.$props.reorderable ? this.handleDrag : undefined,
|
|
242
|
+
ref: 'draggable',
|
|
243
|
+
onDrag: this.handleDrag,
|
|
200
244
|
on: this.v3 ? undefined : {
|
|
201
|
-
"drag": this
|
|
202
|
-
"release": this
|
|
203
|
-
"press": this
|
|
245
|
+
"drag": this.handleDrag,
|
|
246
|
+
"release": this.handleRelease,
|
|
247
|
+
"press": this.handlePress
|
|
204
248
|
},
|
|
205
|
-
onRelease: this
|
|
206
|
-
onPress: this
|
|
249
|
+
onRelease: this.handleRelease,
|
|
250
|
+
onPress: this.handlePress
|
|
207
251
|
}, this.v3 ? function () {
|
|
208
252
|
return [card];
|
|
209
253
|
} : [card])]);
|
|
210
254
|
},
|
|
211
255
|
methods: {
|
|
256
|
+
dragElement: function dragElement() {
|
|
257
|
+
return this.draggable && this.draggable.element;
|
|
258
|
+
},
|
|
212
259
|
handleResize: function handleResize(e, q) {
|
|
260
|
+
var dragElement = this.dragElement();
|
|
213
261
|
if (q.end) {
|
|
214
262
|
this.handleRelease();
|
|
215
263
|
return;
|
|
216
264
|
}
|
|
217
|
-
if (!this.
|
|
265
|
+
if (!this.reorderable || !this.$el) {
|
|
218
266
|
return;
|
|
219
267
|
}
|
|
220
268
|
var x = e.clientX;
|
|
221
269
|
var y = e.clientY;
|
|
222
270
|
this.resizing = true;
|
|
223
|
-
var dX = (q.direction !== 'ns' ? x - this.pressXY.x : 0) * (this.
|
|
271
|
+
var dX = (q.direction !== 'ns' ? x - this.pressXY.x : 0) * (this.rtl ? -1 : 1);
|
|
224
272
|
var dY = q.direction !== 'ew' ? y - this.pressXY.y : 0;
|
|
225
|
-
if (
|
|
226
|
-
if (this.
|
|
227
|
-
|
|
273
|
+
if (dragElement) {
|
|
274
|
+
if (this.rtl) {
|
|
275
|
+
dragElement.style.marginLeft = -dX + 'px';
|
|
228
276
|
} else {
|
|
229
|
-
|
|
277
|
+
dragElement.style.marginRight = -dX + 'px';
|
|
230
278
|
}
|
|
231
|
-
|
|
279
|
+
dragElement.style.height = "calc(100% + ".concat(dY, "px)");
|
|
232
280
|
}
|
|
233
|
-
this.
|
|
281
|
+
this.$el.classList.add('k-layout-item-hint', 'k-layout-item-hint-resize');
|
|
234
282
|
if (this.preventDataOps) {
|
|
235
283
|
return;
|
|
236
284
|
}
|
|
237
285
|
var col = 0;
|
|
238
286
|
var row = 0;
|
|
239
|
-
var wrapBox = this.
|
|
287
|
+
var wrapBox = this.$el.getBoundingClientRect();
|
|
240
288
|
if (dX > wrapBox.width / this.$props.defaultPosition.colSpan / 3) {
|
|
241
289
|
col = 1;
|
|
242
290
|
}
|
|
@@ -251,48 +299,49 @@ var TileVue2 = {
|
|
|
251
299
|
row = -1;
|
|
252
300
|
}
|
|
253
301
|
if (col !== 0 || row !== 0) {
|
|
254
|
-
this.$
|
|
302
|
+
this.$emit('update', this.$props.index, 0, 0, row, col);
|
|
255
303
|
}
|
|
256
304
|
},
|
|
257
305
|
handlePress: function handlePress(e) {
|
|
258
|
-
|
|
306
|
+
var dragElement = this.dragElement();
|
|
307
|
+
if (!this.reorderable || !dragElement) {
|
|
259
308
|
return;
|
|
260
309
|
}
|
|
261
310
|
this.ignoreDrag = false;
|
|
262
|
-
if (this.$props.ignoreDrag && this.$props.ignoreDrag(e.
|
|
311
|
+
if (this.$props.ignoreDrag && this.$props.ignoreDrag(e.originalEvent)) {
|
|
263
312
|
this.ignoreDrag = true;
|
|
264
313
|
return;
|
|
265
314
|
}
|
|
266
|
-
if (this
|
|
267
|
-
this.
|
|
268
|
-
this.
|
|
315
|
+
if (this.$el) {
|
|
316
|
+
this.$el.style.zIndex = '10';
|
|
317
|
+
this.$el.classList.add('k-layout-item-hint');
|
|
269
318
|
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
var rec =
|
|
319
|
+
dragElement.classList.remove('k-cursor-grab');
|
|
320
|
+
dragElement.classList.add('k-cursor-grabbing');
|
|
321
|
+
var rec = dragElement.getBoundingClientRect();
|
|
273
322
|
this.pressXY = {
|
|
274
|
-
x: e.
|
|
275
|
-
y: e.
|
|
323
|
+
x: e.clientX,
|
|
324
|
+
y: e.clientY
|
|
276
325
|
};
|
|
277
326
|
this.pressOffset = {
|
|
278
|
-
x: e.
|
|
279
|
-
y: e.
|
|
327
|
+
x: e.clientX - rec.x,
|
|
328
|
+
y: e.clientY - rec.y
|
|
280
329
|
};
|
|
281
330
|
},
|
|
282
331
|
handleDrag: function handleDrag(e) {
|
|
283
|
-
if (this.ignoreDrag) {
|
|
332
|
+
if (!this.reorderable || this.ignoreDrag) {
|
|
284
333
|
return;
|
|
285
334
|
}
|
|
286
|
-
var dragElement = this.dragElement;
|
|
287
|
-
if (e.
|
|
335
|
+
var dragElement = this.dragElement();
|
|
336
|
+
if (e.originalEvent.defaultPrevented || !dragElement) {
|
|
288
337
|
return;
|
|
289
338
|
}
|
|
290
339
|
this.dragging = true;
|
|
291
|
-
e.
|
|
340
|
+
e.originalEvent.preventDefault();
|
|
292
341
|
var rec = dragElement.getBoundingClientRect();
|
|
293
342
|
this.currentTranslate = {
|
|
294
|
-
x: e.
|
|
295
|
-
y: e.
|
|
343
|
+
x: e.clientX - rec.x - this.pressOffset.x + this.currentTranslate.x,
|
|
344
|
+
y: e.clientY - rec.y - this.pressOffset.y + this.currentTranslate.y
|
|
296
345
|
};
|
|
297
346
|
dragElement.style.transform = "translate(".concat(this.currentTranslate.x, "px, ").concat(this.currentTranslate.y, "px)");
|
|
298
347
|
dragElement.style.transition = 'transform 0s';
|
|
@@ -313,7 +362,7 @@ var TileVue2 = {
|
|
|
313
362
|
if (this.currentTranslate.x < 0.7 * -rec.width / this.$props.defaultPosition.colSpan) {
|
|
314
363
|
col = -1;
|
|
315
364
|
}
|
|
316
|
-
this.$
|
|
365
|
+
this.$emit('update', this.$props.index, row, this.rtl ? -col : col, 0, 0);
|
|
317
366
|
},
|
|
318
367
|
handleRelease: function handleRelease() {
|
|
319
368
|
this.dragging = this.resizing = false;
|
|
@@ -321,11 +370,11 @@ var TileVue2 = {
|
|
|
321
370
|
x: 0,
|
|
322
371
|
y: 0
|
|
323
372
|
};
|
|
324
|
-
if (this
|
|
325
|
-
this.
|
|
326
|
-
this.
|
|
373
|
+
if (this.$el) {
|
|
374
|
+
this.$el.style.zIndex = '1';
|
|
375
|
+
this.$el.classList.remove('k-layout-item-hint', 'k-layout-item-hint-resize');
|
|
327
376
|
}
|
|
328
|
-
var dragElement = this.dragElement;
|
|
377
|
+
var dragElement = this.dragElement();
|
|
329
378
|
if (dragElement) {
|
|
330
379
|
dragElement.style.transform = 'translate(0px, 0px)';
|
|
331
380
|
dragElement.style.transition = "transform ".concat(ANIMATION_DURATION, "ms cubic-bezier(0.2, 0, 0, 1) 0s");
|
|
@@ -337,16 +386,6 @@ var TileVue2 = {
|
|
|
337
386
|
}
|
|
338
387
|
}
|
|
339
388
|
}
|
|
340
|
-
// /**
|
|
341
|
-
// * @hidden
|
|
342
|
-
// */
|
|
343
|
-
// getSnapshotBeforeUpdate(_: any) {
|
|
344
|
-
// this.oldSize = {};
|
|
345
|
-
// if (this.dragElement) {
|
|
346
|
-
// this.oldSize = this.dragElement.getBoundingClientRect();
|
|
347
|
-
// }
|
|
348
|
-
// return null;
|
|
349
|
-
// }
|
|
350
389
|
};
|
|
351
390
|
/**
|
|
352
391
|
* @hidden
|