@progress/kendo-vue-layout 3.1.2 → 3.1.4-dev.202204051326
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/main.d.ts +9 -0
- package/dist/es/main.js +9 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/panelbar/PanelBar.d.ts +4 -4
- package/dist/es/panelbar/PanelBar.js +62 -95
- package/dist/es/panelbar/PanelBarGroup.d.ts +47 -0
- package/dist/es/panelbar/PanelBarGroup.js +126 -0
- package/dist/es/panelbar/PanelBarItem.d.ts +0 -1
- package/dist/es/panelbar/PanelBarItem.js +118 -125
- package/dist/es/panelbar/interfaces/PanelBarItemProps.d.ts +9 -13
- package/dist/es/panelbar/interfaces/PanelBarProps.d.ts +4 -0
- package/dist/es/panelbar/interfaces/RenderPanelBarItem.d.ts +2 -2
- package/dist/es/panelbar/util.d.ts +7 -21
- package/dist/es/panelbar/util.js +136 -146
- package/dist/es/splitter/Splitter.d.ts +1 -5
- package/dist/es/splitter/Splitter.js +114 -146
- package/dist/es/splitter/SplitterBar.js +117 -67
- package/dist/es/splitter/SplitterPane.d.ts +8 -30
- package/dist/es/splitter/SplitterPane.js +10 -4
- package/dist/npm/main.d.ts +9 -0
- package/dist/npm/main.js +9 -0
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/panelbar/PanelBar.d.ts +4 -4
- package/dist/npm/panelbar/PanelBar.js +62 -94
- package/dist/npm/panelbar/PanelBarGroup.d.ts +47 -0
- package/dist/npm/panelbar/PanelBarGroup.js +138 -0
- package/dist/npm/panelbar/PanelBarItem.d.ts +0 -1
- package/dist/npm/panelbar/PanelBarItem.js +117 -124
- package/dist/npm/panelbar/interfaces/PanelBarItemProps.d.ts +9 -13
- package/dist/npm/panelbar/interfaces/PanelBarProps.d.ts +4 -0
- package/dist/npm/panelbar/interfaces/RenderPanelBarItem.d.ts +2 -2
- package/dist/npm/panelbar/util.d.ts +7 -21
- package/dist/npm/panelbar/util.js +137 -147
- package/dist/npm/splitter/Splitter.d.ts +1 -5
- package/dist/npm/splitter/Splitter.js +113 -145
- package/dist/npm/splitter/SplitterBar.js +117 -67
- package/dist/npm/splitter/SplitterPane.d.ts +8 -30
- package/dist/npm/splitter/SplitterPane.js +9 -3
- package/package.json +10 -10
|
@@ -16,19 +16,6 @@ var __assign = undefined && undefined.__assign || function () {
|
|
|
16
16
|
return __assign.apply(this, arguments);
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
20
|
-
var t = {};
|
|
21
|
-
|
|
22
|
-
for (var p in s) {
|
|
23
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
27
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
28
|
-
}
|
|
29
|
-
return t;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
19
|
Object.defineProperty(exports, "__esModule", {
|
|
33
20
|
value: true
|
|
34
21
|
});
|
|
@@ -70,7 +57,7 @@ var SplitterVue2 = {
|
|
|
70
57
|
props: {
|
|
71
58
|
orientation: {
|
|
72
59
|
type: String,
|
|
73
|
-
default: '
|
|
60
|
+
default: 'horizontal',
|
|
74
61
|
validator: function validator(value) {
|
|
75
62
|
return ['vertical', 'horizontal'].includes(value);
|
|
76
63
|
}
|
|
@@ -82,21 +69,17 @@ var SplitterVue2 = {
|
|
|
82
69
|
isControlledState: function isControlledState() {
|
|
83
70
|
return this.$props.panes !== undefined;
|
|
84
71
|
},
|
|
85
|
-
|
|
86
|
-
return this.panesDuringOnChange !== undefined ?
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
return this.$props.orientation || 'horizontal';
|
|
72
|
+
computedPanes: function computedPanes() {
|
|
73
|
+
// return this.panesDuringOnChange !== undefined ?
|
|
74
|
+
// this.panesDuringOnChange :
|
|
75
|
+
return this.isControlledState ? this.$props.panes : this.currentPanes;
|
|
90
76
|
},
|
|
91
77
|
isRtl: function isRtl() {
|
|
92
|
-
return this
|
|
93
|
-
}
|
|
94
|
-
// return React.Children.toArray(this.$props.children).filter(c => c);
|
|
95
|
-
// },
|
|
96
|
-
|
|
78
|
+
return this.$el && getComputedStyle(this.$el).direction === 'rtl' || false;
|
|
79
|
+
}
|
|
97
80
|
},
|
|
98
81
|
created: function created() {
|
|
99
|
-
kendo_vue_common_2.validatePackage(package_metadata_1.packageMetadata); //
|
|
82
|
+
kendo_vue_common_2.validatePackage(package_metadata_1.packageMetadata); // this.panesDuringOnChange?: SplitterPaneProps[];
|
|
100
83
|
},
|
|
101
84
|
data: function data() {
|
|
102
85
|
return {
|
|
@@ -107,7 +90,7 @@ var SplitterVue2 = {
|
|
|
107
90
|
originalY: 0,
|
|
108
91
|
originalPrevSize: 0,
|
|
109
92
|
originalNextSize: 0,
|
|
110
|
-
|
|
93
|
+
currentPanes: this.$props.defaultPanes || []
|
|
111
94
|
};
|
|
112
95
|
},
|
|
113
96
|
// @ts-ignore
|
|
@@ -119,63 +102,14 @@ var SplitterVue2 = {
|
|
|
119
102
|
},
|
|
120
103
|
// @ts-ignore
|
|
121
104
|
render: function render(createElement) {
|
|
122
|
-
var _this = this;
|
|
123
|
-
|
|
124
105
|
var h = gh || createElement;
|
|
125
|
-
var
|
|
126
|
-
var
|
|
127
|
-
var className = kendo_vue_common_1.classNames('k-widget', 'k-splitter', 'k-splitter-flex', "k-splitter-" + this.orientation, this.$props.className);
|
|
106
|
+
var panesOptions = this.panesOptions();
|
|
107
|
+
var className = kendo_vue_common_1.classNames('k-widget', 'k-splitter', 'k-splitter-flex', "k-splitter-" + this.orientation);
|
|
128
108
|
this.validatePanes(panesOptions);
|
|
129
|
-
return h("div", {
|
|
130
|
-
style: this.$props.style,
|
|
131
|
-
ref: function ref(_ref) {
|
|
132
|
-
return _this._container = _ref;
|
|
133
|
-
},
|
|
134
|
-
"class": className
|
|
135
|
-
}, [this.mapSplitterPanes(panesOptions, panesContent)]);
|
|
136
|
-
},
|
|
137
|
-
methods: {
|
|
138
|
-
validatePanes: function validatePanes(panesOptions) {
|
|
139
|
-
var withoutSize = panesOptions.filter(function (pane) {
|
|
140
|
-
return pane.size === undefined;
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
if (!withoutSize.length) {
|
|
144
|
-
throw new Error('The Splitter should have at least one pane without a set size.');
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
mapPaneOptions: function mapPaneOptions(panes, panesContent) {
|
|
148
|
-
var orientation = this.orientation;
|
|
149
|
-
var _a = this.state,
|
|
150
|
-
dragIndex = _a.dragIndex,
|
|
151
|
-
isDragging = _a.isDragging;
|
|
152
|
-
var paneOptions = [];
|
|
153
|
-
|
|
154
|
-
for (var index = 0; index < panesContent.length; index++) {
|
|
155
|
-
var containsSplitter = false;
|
|
156
|
-
var paneContent = panesContent[index]; // if (React.isValidElement(paneContent)) {
|
|
157
|
-
// containsSplitter = (paneContent.type as React.ComponentType).displayName === 'Splitter';
|
|
158
|
-
// }
|
|
159
|
-
|
|
160
|
-
var overlay = false;
|
|
161
|
-
|
|
162
|
-
if (isDragging && dragIndex !== undefined) {
|
|
163
|
-
overlay = dragIndex === index || dragIndex + 1 === index;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
paneOptions.push(__assign(__assign(__assign({}, PANE_DEFAULTS), {
|
|
167
|
-
orientation: orientation,
|
|
168
|
-
containsSplitter: containsSplitter,
|
|
169
|
-
overlay: overlay
|
|
170
|
-
}), (panes || [])[index]));
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
return paneOptions;
|
|
174
|
-
},
|
|
175
|
-
mapSplitterPanes: function mapSplitterPanes(panes, panesContent) {
|
|
176
|
-
var _this = this;
|
|
177
109
|
|
|
110
|
+
var mapSplitterPanes = function mapSplitterPanes(panes) {
|
|
178
111
|
return panes.map(function (pane, index) {
|
|
112
|
+
var content = kendo_vue_common_1.templateRendering.call(this, pane.content, kendo_vue_common_1.getListeners.call(this));
|
|
179
113
|
var splitterBar;
|
|
180
114
|
var paneKey = index * 2;
|
|
181
115
|
var barKey = paneKey + 1;
|
|
@@ -187,36 +121,90 @@ var SplitterVue2 = {
|
|
|
187
121
|
index: index,
|
|
188
122
|
attrs: this.v3 ? undefined : {
|
|
189
123
|
index: index,
|
|
190
|
-
orientation:
|
|
124
|
+
orientation: this.orientation,
|
|
191
125
|
prev: pane,
|
|
192
126
|
next: next
|
|
193
127
|
},
|
|
194
|
-
orientation:
|
|
128
|
+
orientation: this.orientation,
|
|
195
129
|
prev: pane,
|
|
196
130
|
next: next,
|
|
197
|
-
onDrag:
|
|
131
|
+
onDrag: this.onBarDragResize,
|
|
198
132
|
on: this.v3 ? undefined : {
|
|
199
|
-
"drag":
|
|
200
|
-
"toggle":
|
|
201
|
-
"
|
|
133
|
+
"drag": this.onBarDragResize,
|
|
134
|
+
"toggle": this.onBarToggle,
|
|
135
|
+
"keyboardresize": this.onBarKeyboardResize
|
|
202
136
|
},
|
|
203
|
-
onToggle:
|
|
204
|
-
|
|
137
|
+
onToggle: this.onBarToggle,
|
|
138
|
+
onKeyboardresize: this.onBarKeyboardResize
|
|
205
139
|
});
|
|
206
140
|
}
|
|
207
141
|
|
|
208
142
|
var splitterPane = h(SplitterPane_1.SplitterPane, {
|
|
209
|
-
key: paneKey
|
|
210
|
-
|
|
143
|
+
key: paneKey,
|
|
144
|
+
containsSplitter: pane.containsSplitter,
|
|
145
|
+
attrs: this.v3 ? undefined : {
|
|
146
|
+
containsSplitter: pane.containsSplitter,
|
|
147
|
+
size: pane.size,
|
|
148
|
+
min: pane.min,
|
|
149
|
+
max: pane.max,
|
|
150
|
+
resizable: pane.resizable,
|
|
151
|
+
collapsible: pane.collapsible,
|
|
152
|
+
collapsed: pane.collapsed,
|
|
153
|
+
scrollable: pane.scrollable,
|
|
154
|
+
keepMounted: pane.keepMounted,
|
|
155
|
+
content: content
|
|
156
|
+
},
|
|
157
|
+
size: pane.size,
|
|
158
|
+
min: pane.min,
|
|
159
|
+
max: pane.max,
|
|
160
|
+
resizable: pane.resizable,
|
|
161
|
+
collapsible: pane.collapsible,
|
|
162
|
+
collapsed: pane.collapsed,
|
|
163
|
+
scrollable: pane.scrollable,
|
|
164
|
+
keepMounted: pane.keepMounted,
|
|
165
|
+
content: content
|
|
166
|
+
});
|
|
211
167
|
return [splitterPane, splitterBar];
|
|
168
|
+
}, this);
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
return h("div", {
|
|
172
|
+
"class": className
|
|
173
|
+
}, [mapSplitterPanes.call(this, panesOptions)]);
|
|
174
|
+
},
|
|
175
|
+
methods: {
|
|
176
|
+
validatePanes: function validatePanes(panesOptions) {
|
|
177
|
+
var withoutSize = panesOptions.filter(function (pane) {
|
|
178
|
+
return pane.size === undefined;
|
|
212
179
|
});
|
|
180
|
+
|
|
181
|
+
if (!withoutSize.length) {
|
|
182
|
+
throw new Error('The Splitter should have at least one pane without a set size.');
|
|
183
|
+
}
|
|
213
184
|
},
|
|
214
|
-
|
|
215
|
-
var
|
|
185
|
+
mapPaneOptions: function mapPaneOptions(panes) {
|
|
186
|
+
var orientation = this.orientation;
|
|
187
|
+
var paneOptions = [];
|
|
216
188
|
|
|
217
|
-
var
|
|
189
|
+
for (var index = 0; index < panes.length; index++) {
|
|
190
|
+
var overlay = false;
|
|
191
|
+
|
|
192
|
+
if (this.isDragging && this.dragIndex !== undefined) {
|
|
193
|
+
overlay = this.dragIndex === index || this.dragIndex + 1 === index;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
paneOptions.push(__assign(__assign(__assign({}, PANE_DEFAULTS), {
|
|
197
|
+
orientation: orientation,
|
|
198
|
+
overlay: overlay
|
|
199
|
+
}), panes[index]));
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return paneOptions;
|
|
203
|
+
},
|
|
204
|
+
onBarToggle: function onBarToggle(index, event) {
|
|
205
|
+
var panesOptions = this.panesOptions();
|
|
218
206
|
var updatedState = panesOptions.map(function (pane, idx) {
|
|
219
|
-
var paneProps =
|
|
207
|
+
var paneProps = pane;
|
|
220
208
|
|
|
221
209
|
if (idx === index) {
|
|
222
210
|
return __assign(__assign({}, paneProps), {
|
|
@@ -226,14 +214,11 @@ var SplitterVue2 = {
|
|
|
226
214
|
return __assign({}, paneProps);
|
|
227
215
|
}
|
|
228
216
|
});
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
nativeEvent: event
|
|
235
|
-
});
|
|
236
|
-
}
|
|
217
|
+
this.$emit('change', {
|
|
218
|
+
newState: updatedState,
|
|
219
|
+
isLast: true,
|
|
220
|
+
nativeEvent: event
|
|
221
|
+
});
|
|
237
222
|
},
|
|
238
223
|
onBarDragResize: function onBarDragResize(event, barElement, index, isFirst, isLast) {
|
|
239
224
|
var time = new Date().getTime();
|
|
@@ -249,19 +234,17 @@ var SplitterVue2 = {
|
|
|
249
234
|
}
|
|
250
235
|
|
|
251
236
|
if (isFirst) {
|
|
252
|
-
this.
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
originalNextSize: this.elementSize(nextElement)
|
|
260
|
-
});
|
|
237
|
+
this.isDragging = true;
|
|
238
|
+
this.dragIndex = index;
|
|
239
|
+
this.startTime = time;
|
|
240
|
+
this.originalX = pageX;
|
|
241
|
+
this.originalY = pageY;
|
|
242
|
+
this.originalPrevSize = this.elementSize(prevElement);
|
|
243
|
+
this.originalNextSize = this.elementSize(nextElement);
|
|
261
244
|
return;
|
|
262
245
|
}
|
|
263
246
|
|
|
264
|
-
var _b = this
|
|
247
|
+
var _b = this.$data,
|
|
265
248
|
originalPrevSize = _b.originalPrevSize,
|
|
266
249
|
originalNextSize = _b.originalNextSize,
|
|
267
250
|
startTime = _b.startTime,
|
|
@@ -308,11 +291,11 @@ var SplitterVue2 = {
|
|
|
308
291
|
};
|
|
309
292
|
},
|
|
310
293
|
containerSize: function containerSize() {
|
|
311
|
-
if (!this
|
|
294
|
+
if (!this.$el) {
|
|
312
295
|
return 0;
|
|
313
296
|
}
|
|
314
297
|
|
|
315
|
-
return this.elementSize(this
|
|
298
|
+
return this.elementSize(this.$el, true);
|
|
316
299
|
},
|
|
317
300
|
isPercent: function isPercent(size) {
|
|
318
301
|
return /%$/.test(size);
|
|
@@ -326,19 +309,17 @@ var SplitterVue2 = {
|
|
|
326
309
|
|
|
327
310
|
return result;
|
|
328
311
|
},
|
|
329
|
-
panesOptions: function panesOptions(
|
|
330
|
-
return this.mapPaneOptions(this.
|
|
312
|
+
panesOptions: function panesOptions() {
|
|
313
|
+
return this.mapPaneOptions(this.computedPanes);
|
|
331
314
|
},
|
|
332
315
|
resetDragState: function resetDragState() {
|
|
333
|
-
this.
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
originalNextSize: 0
|
|
341
|
-
});
|
|
316
|
+
this.isDragging = false;
|
|
317
|
+
this.dragIndex = undefined;
|
|
318
|
+
this.startTime = 0;
|
|
319
|
+
this.originalX = 0;
|
|
320
|
+
this.originalY = 0;
|
|
321
|
+
this.originalPrevSize = 0;
|
|
322
|
+
this.originalNextSize = 0;
|
|
342
323
|
},
|
|
343
324
|
elementSize: function elementSize(el, isContainer) {
|
|
344
325
|
var sizeType = isContainer ? 'client' : 'offset';
|
|
@@ -358,7 +339,7 @@ var SplitterVue2 = {
|
|
|
358
339
|
resize: function resize(prevIndex, nextIndex, originalPrevSize, originalNextSize, delta, isLast, event) {
|
|
359
340
|
var _this = this;
|
|
360
341
|
|
|
361
|
-
var panesOptions = this.panesOptions(
|
|
342
|
+
var panesOptions = this.panesOptions();
|
|
362
343
|
var prevOptions = panesOptions[prevIndex];
|
|
363
344
|
var nextOptions = panesOptions[nextIndex];
|
|
364
345
|
var total = originalPrevSize + originalNextSize;
|
|
@@ -406,7 +387,7 @@ var SplitterVue2 = {
|
|
|
406
387
|
}
|
|
407
388
|
|
|
408
389
|
var updatedState = panesOptions.map(function (pane, idx) {
|
|
409
|
-
var paneProps =
|
|
390
|
+
var paneProps = pane;
|
|
410
391
|
|
|
411
392
|
if (idx === prevIndex) {
|
|
412
393
|
return __assign(__assign({}, paneProps), {
|
|
@@ -423,28 +404,15 @@ var SplitterVue2 = {
|
|
|
423
404
|
this.panesDuringOnChange = updatedState;
|
|
424
405
|
|
|
425
406
|
if (!this.isControlledState) {
|
|
426
|
-
this.
|
|
427
|
-
panes: updatedState
|
|
428
|
-
});
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
if (this.$props.onChange) {
|
|
432
|
-
this.$props.onChange({
|
|
433
|
-
newState: updatedState,
|
|
434
|
-
isLast: isLast,
|
|
435
|
-
nativeEvent: event
|
|
436
|
-
});
|
|
407
|
+
this.currentPanes = updatedState;
|
|
437
408
|
}
|
|
438
409
|
|
|
410
|
+
this.$emit('change', {
|
|
411
|
+
newState: updatedState,
|
|
412
|
+
isLast: isLast,
|
|
413
|
+
nativeEvent: event
|
|
414
|
+
});
|
|
439
415
|
this.panesDuringOnChange = undefined;
|
|
440
|
-
},
|
|
441
|
-
getPaneProps: function getPaneProps(pane) {
|
|
442
|
-
var orientation = pane.orientation,
|
|
443
|
-
overlay = pane.overlay,
|
|
444
|
-
containsSplitter = pane.containsSplitter,
|
|
445
|
-
others = __rest(pane, ["orientation", "overlay", "containsSplitter"]);
|
|
446
|
-
|
|
447
|
-
return others;
|
|
448
416
|
}
|
|
449
417
|
}
|
|
450
418
|
};
|
|
@@ -15,6 +15,12 @@ var kendo_vue_common_1 = require("@progress/kendo-vue-common"); // tslint:enable
|
|
|
15
15
|
|
|
16
16
|
var SplitterBarVue2 = {
|
|
17
17
|
name: 'KendoSplitterBar',
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
emits: {
|
|
20
|
+
drag: null,
|
|
21
|
+
toggle: null,
|
|
22
|
+
keyboardresize: null
|
|
23
|
+
},
|
|
18
24
|
props: {
|
|
19
25
|
orientation: {
|
|
20
26
|
type: String,
|
|
@@ -29,13 +35,10 @@ var SplitterBarVue2 = {
|
|
|
29
35
|
},
|
|
30
36
|
created: function created() {
|
|
31
37
|
this.draggable = null;
|
|
32
|
-
this.state = {
|
|
33
|
-
focused: false
|
|
34
|
-
};
|
|
35
38
|
},
|
|
36
39
|
computed: {
|
|
37
40
|
isStatic: function isStatic() {
|
|
38
|
-
var _a = this
|
|
41
|
+
var _a = this.$props,
|
|
39
42
|
prev = _a.prev,
|
|
40
43
|
next = _a.next;
|
|
41
44
|
var betweenResizablePanes = prev.resizable && next.resizable;
|
|
@@ -43,7 +46,7 @@ var SplitterBarVue2 = {
|
|
|
43
46
|
return !betweenResizablePanes && !nearCollapsiblePane;
|
|
44
47
|
},
|
|
45
48
|
isDraggable: function isDraggable() {
|
|
46
|
-
var _a = this
|
|
49
|
+
var _a = this.$props,
|
|
47
50
|
prev = _a.prev,
|
|
48
51
|
next = _a.next;
|
|
49
52
|
var betweenResizablePanes = prev.resizable && next.resizable;
|
|
@@ -51,7 +54,7 @@ var SplitterBarVue2 = {
|
|
|
51
54
|
return !!betweenResizablePanes && !nearCollapsedPane;
|
|
52
55
|
},
|
|
53
56
|
isHorizontal: function isHorizontal() {
|
|
54
|
-
return this
|
|
57
|
+
return this.$props.orientation === 'horizontal';
|
|
55
58
|
}
|
|
56
59
|
},
|
|
57
60
|
data: function data() {
|
|
@@ -59,6 +62,11 @@ var SplitterBarVue2 = {
|
|
|
59
62
|
focused: false
|
|
60
63
|
};
|
|
61
64
|
},
|
|
65
|
+
mounted: function mounted() {
|
|
66
|
+
if (this.$el) {
|
|
67
|
+
this.draggable = this.$refs.draggable;
|
|
68
|
+
}
|
|
69
|
+
},
|
|
62
70
|
// @ts-ignore
|
|
63
71
|
setup: !gh ? undefined : function () {
|
|
64
72
|
var v3 = !!gh;
|
|
@@ -68,6 +76,8 @@ var SplitterBarVue2 = {
|
|
|
68
76
|
},
|
|
69
77
|
// @ts-ignore
|
|
70
78
|
render: function render(createElement) {
|
|
79
|
+
var _this2 = this;
|
|
80
|
+
|
|
71
81
|
var _a;
|
|
72
82
|
|
|
73
83
|
var _this = this;
|
|
@@ -76,72 +86,112 @@ var SplitterBarVue2 = {
|
|
|
76
86
|
var isDraggable = this.isDraggable;
|
|
77
87
|
var isStatic = this.isStatic;
|
|
78
88
|
var isHorizontal = this.isHorizontal;
|
|
79
|
-
var barClasses = kendo_vue_common_1.classNames('k-splitbar', (_a = {}, _a['k-state-focused'] = this.
|
|
89
|
+
var barClasses = kendo_vue_common_1.classNames('k-splitbar', (_a = {}, _a['k-state-focused'] = this.focused, _a['k-splitbar-horizontal'] = isHorizontal, _a['k-splitbar-vertical'] = !isHorizontal, _a['k-splitbar-draggable-horizontal'] = isHorizontal && isDraggable, _a['k-splitbar-draggable-vertical'] = !isHorizontal && isDraggable, _a['k-splitbar-static-horizontal'] = isHorizontal && isStatic, _a['k-splitbar-static-vertical'] = !isHorizontal && isStatic, _a));
|
|
80
90
|
var previousArrowClass = this.previousArrowClass(isHorizontal);
|
|
81
91
|
var nextArrowClass = this.nextArrowClass(isHorizontal);
|
|
82
|
-
return
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
},
|
|
86
|
-
on: this.v3 ? undefined : {
|
|
87
|
-
"press": function onPress(event) {
|
|
92
|
+
return (// @ts-ignore function children
|
|
93
|
+
h(kendo_vue_common_1.Draggable, {
|
|
94
|
+
onPress: function onPress(event) {
|
|
88
95
|
return _this.onDrag(event, true, false);
|
|
89
96
|
},
|
|
90
|
-
|
|
97
|
+
on: this.v3 ? undefined : {
|
|
98
|
+
"press": function onPress(event) {
|
|
99
|
+
return _this.onDrag(event, true, false);
|
|
100
|
+
},
|
|
101
|
+
"drag": function drag(event) {
|
|
102
|
+
return _this.onDrag(event, false, false);
|
|
103
|
+
},
|
|
104
|
+
"release": function release(event) {
|
|
105
|
+
return _this.onDrag(event, false, true);
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
onDrag: function drag(event) {
|
|
91
109
|
return _this.onDrag(event, false, false);
|
|
92
110
|
},
|
|
93
|
-
|
|
111
|
+
onRelease: function release(event) {
|
|
94
112
|
return _this.onDrag(event, false, true);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
return
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
113
|
+
},
|
|
114
|
+
ref: 'draggable'
|
|
115
|
+
}, this.v3 ? function () {
|
|
116
|
+
return [h("div", {
|
|
117
|
+
tabIndex: isStatic ? -1 : 0,
|
|
118
|
+
attrs: _this2.v3 ? undefined : {
|
|
119
|
+
tabIndex: isStatic ? -1 : 0,
|
|
120
|
+
role: 'separator'
|
|
121
|
+
},
|
|
122
|
+
role: 'separator',
|
|
123
|
+
"class": barClasses,
|
|
124
|
+
style: {
|
|
125
|
+
touchAction: 'none'
|
|
126
|
+
},
|
|
127
|
+
onFocusin: _this2.onFocus,
|
|
128
|
+
on: _this2.v3 ? undefined : {
|
|
129
|
+
"focusin": _this2.onFocus,
|
|
130
|
+
"focusout": _this2.onBlur,
|
|
131
|
+
"dblclick": _this2.onToggle,
|
|
132
|
+
"keydown": _this2.onKeyDown
|
|
133
|
+
},
|
|
134
|
+
onFocusout: _this2.onBlur,
|
|
135
|
+
onDblclick: _this2.onToggle,
|
|
136
|
+
onKeydown: _this2.onKeyDown
|
|
137
|
+
}, [h("div", {
|
|
138
|
+
"class": previousArrowClass,
|
|
139
|
+
onClick: _this2.onPrevToggle,
|
|
140
|
+
on: _this2.v3 ? undefined : {
|
|
141
|
+
"click": _this2.onPrevToggle
|
|
142
|
+
}
|
|
143
|
+
}), h("div", {
|
|
144
|
+
"class": 'k-resize-handle'
|
|
145
|
+
}), h("div", {
|
|
146
|
+
"class": nextArrowClass,
|
|
147
|
+
onClick: _this2.onNextToggle,
|
|
148
|
+
on: _this2.v3 ? undefined : {
|
|
149
|
+
"click": _this2.onNextToggle
|
|
150
|
+
}
|
|
151
|
+
})])];
|
|
152
|
+
} : [h("div", {
|
|
106
153
|
tabIndex: isStatic ? -1 : 0,
|
|
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
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
154
|
+
attrs: _this2.v3 ? undefined : {
|
|
155
|
+
tabIndex: isStatic ? -1 : 0,
|
|
156
|
+
role: 'separator'
|
|
157
|
+
},
|
|
158
|
+
role: 'separator',
|
|
159
|
+
"class": barClasses,
|
|
160
|
+
style: {
|
|
161
|
+
touchAction: 'none'
|
|
162
|
+
},
|
|
163
|
+
onFocusin: _this2.onFocus,
|
|
164
|
+
on: _this2.v3 ? undefined : {
|
|
165
|
+
"focusin": _this2.onFocus,
|
|
166
|
+
"focusout": _this2.onBlur,
|
|
167
|
+
"dblclick": _this2.onToggle,
|
|
168
|
+
"keydown": _this2.onKeyDown
|
|
169
|
+
},
|
|
170
|
+
onFocusout: _this2.onBlur,
|
|
171
|
+
onDblclick: _this2.onToggle,
|
|
172
|
+
onKeydown: _this2.onKeyDown
|
|
173
|
+
}, [h("div", {
|
|
174
|
+
"class": previousArrowClass,
|
|
175
|
+
onClick: _this2.onPrevToggle,
|
|
176
|
+
on: _this2.v3 ? undefined : {
|
|
177
|
+
"click": _this2.onPrevToggle
|
|
178
|
+
}
|
|
179
|
+
}), h("div", {
|
|
180
|
+
"class": 'k-resize-handle'
|
|
181
|
+
}), h("div", {
|
|
182
|
+
"class": nextArrowClass,
|
|
183
|
+
onClick: _this2.onNextToggle,
|
|
184
|
+
on: _this2.v3 ? undefined : {
|
|
185
|
+
"click": _this2.onNextToggle
|
|
186
|
+
}
|
|
187
|
+
})])])
|
|
188
|
+
);
|
|
139
189
|
},
|
|
140
190
|
methods: {
|
|
141
191
|
onDrag: function onDrag(data, isFirst, isLast) {
|
|
142
|
-
var event = data
|
|
143
|
-
var index = this
|
|
144
|
-
var element = this
|
|
192
|
+
var event = data;
|
|
193
|
+
var index = this.$props.index;
|
|
194
|
+
var element = this.draggable && this.draggable.element;
|
|
145
195
|
|
|
146
196
|
if (!isLast && event) {
|
|
147
197
|
event.originalEvent.preventDefault();
|
|
@@ -158,7 +208,7 @@ var SplitterBarVue2 = {
|
|
|
158
208
|
this.focused = false;
|
|
159
209
|
},
|
|
160
210
|
onToggle: function onToggle(event) {
|
|
161
|
-
var _a = this
|
|
211
|
+
var _a = this.$props,
|
|
162
212
|
index = _a.index,
|
|
163
213
|
prev = _a.prev,
|
|
164
214
|
next = _a.next;
|
|
@@ -168,7 +218,7 @@ var SplitterBarVue2 = {
|
|
|
168
218
|
}
|
|
169
219
|
},
|
|
170
220
|
onPrevToggle: function onPrevToggle(event) {
|
|
171
|
-
var _a = this
|
|
221
|
+
var _a = this.$props,
|
|
172
222
|
index = _a.index,
|
|
173
223
|
prev = _a.prev;
|
|
174
224
|
|
|
@@ -177,7 +227,7 @@ var SplitterBarVue2 = {
|
|
|
177
227
|
}
|
|
178
228
|
},
|
|
179
229
|
onNextToggle: function onNextToggle(event) {
|
|
180
|
-
var _a = this
|
|
230
|
+
var _a = this.$props,
|
|
181
231
|
index = _a.index,
|
|
182
232
|
next = _a.next;
|
|
183
233
|
|
|
@@ -190,7 +240,7 @@ var SplitterBarVue2 = {
|
|
|
190
240
|
|
|
191
241
|
var keyCode = event && event.keyCode;
|
|
192
242
|
var isHorizontal = this.isHorizontal;
|
|
193
|
-
var index = this
|
|
243
|
+
var index = this.$props.index;
|
|
194
244
|
var element = this.$el; // this.draggable && this.draggable.element;
|
|
195
245
|
|
|
196
246
|
var onKeyboardResize = function onKeyboardResize(el, idx, offset) {
|
|
@@ -221,7 +271,7 @@ var SplitterBarVue2 = {
|
|
|
221
271
|
previousArrowClass: function previousArrowClass(isHorizontal) {
|
|
222
272
|
var _a;
|
|
223
273
|
|
|
224
|
-
var prev = this
|
|
274
|
+
var prev = this.$props.prev;
|
|
225
275
|
var isCollapsible = prev.collapsible;
|
|
226
276
|
var isCollapsed = prev.collapsed;
|
|
227
277
|
return kendo_vue_common_1.classNames('k-icon', (_a = {}, _a['k-hidden'] = !isCollapsible, _a['k-collapse-prev'] = isCollapsible, _a['k-i-arrow-60-left'] = isCollapsible && isHorizontal && !isCollapsed, _a['k-i-arrow-60-right'] = isCollapsible && isHorizontal && isCollapsed, _a['k-i-arrow-60-up'] = isCollapsible && !isHorizontal && !isCollapsed, _a['k-i-arrow-60-down'] = isCollapsible && !isHorizontal && isCollapsed, _a));
|
|
@@ -229,7 +279,7 @@ var SplitterBarVue2 = {
|
|
|
229
279
|
nextArrowClass: function nextArrowClass(isHorizontal) {
|
|
230
280
|
var _a;
|
|
231
281
|
|
|
232
|
-
var next = this
|
|
282
|
+
var next = this.$props.next;
|
|
233
283
|
var isCollapsible = next.collapsible;
|
|
234
284
|
var isCollapsed = next.collapsed;
|
|
235
285
|
return kendo_vue_common_1.classNames('k-icon', (_a = {}, _a['k-hidden'] = !isCollapsible, _a['k-collapse-next'] = isCollapsible, _a['k-i-arrow-60-right'] = isCollapsible && isHorizontal && !isCollapsed, _a['k-i-arrow-60-left'] = isCollapsible && isHorizontal && isCollapsed, _a['k-i-arrow-60-down'] = isCollapsible && !isHorizontal && !isCollapsed, _a['k-i-arrow-60-up'] = isCollapsible && !isHorizontal && isCollapsed, _a));
|