@progress/kendo-vue-layout 3.1.1 → 3.1.3-dev.202203311441
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/panelbar/PanelBar.d.ts +40 -0
- package/dist/es/panelbar/PanelBar.js +329 -0
- package/dist/es/panelbar/PanelBarItem.d.ts +35 -0
- package/dist/es/panelbar/PanelBarItem.js +219 -0
- package/dist/es/panelbar/interfaces/NavigationAction.d.ts +8 -0
- package/dist/es/panelbar/interfaces/NavigationAction.js +9 -0
- package/dist/es/panelbar/interfaces/PanelBarItemClickEventArguments.d.ts +7 -0
- package/dist/es/panelbar/interfaces/PanelBarItemClickEventArguments.js +0 -0
- package/dist/es/panelbar/interfaces/PanelBarItemProps.d.ts +85 -0
- package/dist/es/panelbar/interfaces/PanelBarItemProps.js +0 -0
- package/dist/es/panelbar/interfaces/PanelBarProps.d.ts +54 -0
- package/dist/es/panelbar/interfaces/PanelBarProps.js +0 -0
- package/dist/es/panelbar/interfaces/PanelBarSelectEventArguments.d.ts +13 -0
- package/dist/es/panelbar/interfaces/PanelBarSelectEventArguments.js +0 -0
- package/dist/es/panelbar/interfaces/RenderPanelBarItem.d.ts +14 -0
- package/dist/es/panelbar/interfaces/RenderPanelBarItem.js +0 -0
- package/dist/es/panelbar/util.d.ts +49 -0
- package/dist/es/panelbar/util.js +246 -0
- package/dist/es/splitter/Splitter.d.ts +86 -0
- package/dist/es/splitter/Splitter.js +439 -0
- package/dist/es/splitter/SplitterBar.d.ts +50 -0
- package/dist/es/splitter/SplitterBar.js +231 -0
- package/dist/es/splitter/SplitterPane.d.ts +109 -0
- package/dist/es/splitter/SplitterPane.js +65 -0
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/panelbar/PanelBar.d.ts +40 -0
- package/dist/npm/panelbar/PanelBar.js +343 -0
- package/dist/npm/panelbar/PanelBarItem.d.ts +35 -0
- package/dist/npm/panelbar/PanelBarItem.js +230 -0
- package/dist/npm/panelbar/interfaces/NavigationAction.d.ts +8 -0
- package/dist/npm/panelbar/interfaces/NavigationAction.js +12 -0
- package/dist/npm/panelbar/interfaces/PanelBarItemClickEventArguments.d.ts +7 -0
- package/dist/npm/panelbar/interfaces/PanelBarItemClickEventArguments.js +2 -0
- package/dist/npm/panelbar/interfaces/PanelBarItemProps.d.ts +85 -0
- package/dist/npm/panelbar/interfaces/PanelBarItemProps.js +2 -0
- package/dist/npm/panelbar/interfaces/PanelBarProps.d.ts +54 -0
- package/dist/npm/panelbar/interfaces/PanelBarProps.js +2 -0
- package/dist/npm/panelbar/interfaces/PanelBarSelectEventArguments.d.ts +13 -0
- package/dist/npm/panelbar/interfaces/PanelBarSelectEventArguments.js +2 -0
- package/dist/npm/panelbar/interfaces/RenderPanelBarItem.d.ts +14 -0
- package/dist/npm/panelbar/interfaces/RenderPanelBarItem.js +2 -0
- package/dist/npm/panelbar/util.d.ts +49 -0
- package/dist/npm/panelbar/util.js +264 -0
- package/dist/npm/splitter/Splitter.d.ts +86 -0
- package/dist/npm/splitter/Splitter.js +453 -0
- package/dist/npm/splitter/SplitterBar.d.ts +50 -0
- package/dist/npm/splitter/SplitterBar.js +241 -0
- package/dist/npm/splitter/SplitterPane.d.ts +109 -0
- package/dist/npm/splitter/SplitterPane.js +75 -0
- package/package.json +10 -10
|
@@ -0,0 +1,439 @@
|
|
|
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
|
+
|
|
6
|
+
for (var p in s) {
|
|
7
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
18
|
+
var t = {};
|
|
19
|
+
|
|
20
|
+
for (var p in s) {
|
|
21
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
25
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
26
|
+
}
|
|
27
|
+
return t;
|
|
28
|
+
}; // @ts-ignore
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
import * as Vue from 'vue';
|
|
32
|
+
var allVue = Vue;
|
|
33
|
+
var gh = allVue.h;
|
|
34
|
+
import { SplitterPane } from './SplitterPane';
|
|
35
|
+
import { SplitterBar } from './SplitterBar';
|
|
36
|
+
import { classNames } from '@progress/kendo-vue-common';
|
|
37
|
+
import { validatePackage } from '@progress/kendo-vue-common';
|
|
38
|
+
import { packageMetadata } from '../package-metadata';
|
|
39
|
+
/**
|
|
40
|
+
* @hidden
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
var PANE_DEFAULTS = {
|
|
44
|
+
collapsible: false,
|
|
45
|
+
collapsed: false,
|
|
46
|
+
resizable: true,
|
|
47
|
+
scrollable: true
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* @hidden
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
var DOUBLE_CLICK_WAIT_TIME = 150; // tslint:enable:max-line-length
|
|
54
|
+
|
|
55
|
+
var SplitterVue2 = {
|
|
56
|
+
name: 'KendoSplitter',
|
|
57
|
+
props: {
|
|
58
|
+
orientation: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: 'vertical',
|
|
61
|
+
validator: function validator(value) {
|
|
62
|
+
return ['vertical', 'horizontal'].includes(value);
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
panes: Array,
|
|
66
|
+
defaultPanes: Array
|
|
67
|
+
},
|
|
68
|
+
computed: {
|
|
69
|
+
isControlledState: function isControlledState() {
|
|
70
|
+
return this.$props.panes !== undefined;
|
|
71
|
+
},
|
|
72
|
+
panes: function panes() {
|
|
73
|
+
return this.panesDuringOnChange !== undefined ? this.panesDuringOnChange : this.isControlledState ? this.$props.panes : this.state.panes;
|
|
74
|
+
},
|
|
75
|
+
orientation: function orientation() {
|
|
76
|
+
return this.$props.orientation || 'horizontal';
|
|
77
|
+
},
|
|
78
|
+
isRtl: function isRtl() {
|
|
79
|
+
return this._container && getComputedStyle(this._container).direction === 'rtl' || false;
|
|
80
|
+
} // panesContent(): React.ReactNode[] {
|
|
81
|
+
// return React.Children.toArray(this.$props.children).filter(c => c);
|
|
82
|
+
// },
|
|
83
|
+
|
|
84
|
+
},
|
|
85
|
+
created: function created() {
|
|
86
|
+
validatePackage(packageMetadata); // private panesDuringOnChange?: SplitterPaneProps[];
|
|
87
|
+
},
|
|
88
|
+
data: function data() {
|
|
89
|
+
return {
|
|
90
|
+
isDragging: false,
|
|
91
|
+
dragIndex: undefined,
|
|
92
|
+
startTime: 0,
|
|
93
|
+
originalX: 0,
|
|
94
|
+
originalY: 0,
|
|
95
|
+
originalPrevSize: 0,
|
|
96
|
+
originalNextSize: 0,
|
|
97
|
+
panes: this.$props.defaultPanes || []
|
|
98
|
+
};
|
|
99
|
+
},
|
|
100
|
+
// @ts-ignore
|
|
101
|
+
setup: !gh ? undefined : function () {
|
|
102
|
+
var v3 = !!gh;
|
|
103
|
+
return {
|
|
104
|
+
v3: v3
|
|
105
|
+
};
|
|
106
|
+
},
|
|
107
|
+
// @ts-ignore
|
|
108
|
+
render: function render(createElement) {
|
|
109
|
+
var _this = this;
|
|
110
|
+
|
|
111
|
+
var h = gh || createElement;
|
|
112
|
+
var panesContent = this.panesContent;
|
|
113
|
+
var panesOptions = this.panesOptions(panesContent);
|
|
114
|
+
var className = classNames('k-widget', 'k-splitter', 'k-splitter-flex', "k-splitter-" + this.orientation, this.$props.className);
|
|
115
|
+
this.validatePanes(panesOptions);
|
|
116
|
+
return h("div", {
|
|
117
|
+
style: this.$props.style,
|
|
118
|
+
ref: function ref(_ref) {
|
|
119
|
+
return _this._container = _ref;
|
|
120
|
+
},
|
|
121
|
+
"class": className
|
|
122
|
+
}, [this.mapSplitterPanes(panesOptions, panesContent)]);
|
|
123
|
+
},
|
|
124
|
+
methods: {
|
|
125
|
+
validatePanes: function validatePanes(panesOptions) {
|
|
126
|
+
var withoutSize = panesOptions.filter(function (pane) {
|
|
127
|
+
return pane.size === undefined;
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
if (!withoutSize.length) {
|
|
131
|
+
throw new Error('The Splitter should have at least one pane without a set size.');
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
mapPaneOptions: function mapPaneOptions(panes, panesContent) {
|
|
135
|
+
var orientation = this.orientation;
|
|
136
|
+
var _a = this.state,
|
|
137
|
+
dragIndex = _a.dragIndex,
|
|
138
|
+
isDragging = _a.isDragging;
|
|
139
|
+
var paneOptions = [];
|
|
140
|
+
|
|
141
|
+
for (var index = 0; index < panesContent.length; index++) {
|
|
142
|
+
var containsSplitter = false;
|
|
143
|
+
var paneContent = panesContent[index]; // if (React.isValidElement(paneContent)) {
|
|
144
|
+
// containsSplitter = (paneContent.type as React.ComponentType).displayName === 'Splitter';
|
|
145
|
+
// }
|
|
146
|
+
|
|
147
|
+
var overlay = false;
|
|
148
|
+
|
|
149
|
+
if (isDragging && dragIndex !== undefined) {
|
|
150
|
+
overlay = dragIndex === index || dragIndex + 1 === index;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
paneOptions.push(__assign(__assign(__assign({}, PANE_DEFAULTS), {
|
|
154
|
+
orientation: orientation,
|
|
155
|
+
containsSplitter: containsSplitter,
|
|
156
|
+
overlay: overlay
|
|
157
|
+
}), (panes || [])[index]));
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return paneOptions;
|
|
161
|
+
},
|
|
162
|
+
mapSplitterPanes: function mapSplitterPanes(panes, panesContent) {
|
|
163
|
+
var _this = this;
|
|
164
|
+
|
|
165
|
+
return panes.map(function (pane, index) {
|
|
166
|
+
var splitterBar;
|
|
167
|
+
var paneKey = index * 2;
|
|
168
|
+
var barKey = paneKey + 1;
|
|
169
|
+
|
|
170
|
+
if (index + 1 < panes.length) {
|
|
171
|
+
var next = panes[index + 1];
|
|
172
|
+
splitterBar = h(SplitterBar, {
|
|
173
|
+
key: barKey,
|
|
174
|
+
index: index,
|
|
175
|
+
attrs: this.v3 ? undefined : {
|
|
176
|
+
index: index,
|
|
177
|
+
orientation: pane.orientation,
|
|
178
|
+
prev: pane,
|
|
179
|
+
next: next
|
|
180
|
+
},
|
|
181
|
+
orientation: pane.orientation,
|
|
182
|
+
prev: pane,
|
|
183
|
+
next: next,
|
|
184
|
+
onDrag: _this.onBarDragResize,
|
|
185
|
+
on: this.v3 ? undefined : {
|
|
186
|
+
"drag": _this.onBarDragResize,
|
|
187
|
+
"toggle": _this.onBarToggle,
|
|
188
|
+
"keyboardResize": _this.onBarKeyboardResize
|
|
189
|
+
},
|
|
190
|
+
onToggle: _this.onBarToggle,
|
|
191
|
+
onKeyboardResize: _this.onBarKeyboardResize
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
var splitterPane = h(SplitterPane, {
|
|
196
|
+
key: paneKey
|
|
197
|
+
}, [panesContent[index]]);
|
|
198
|
+
return [splitterPane, splitterBar];
|
|
199
|
+
});
|
|
200
|
+
},
|
|
201
|
+
onBarToggle: function onBarToggle(index, event) {
|
|
202
|
+
var _this = this;
|
|
203
|
+
|
|
204
|
+
var panesOptions = this.panesOptions(this.panesContent);
|
|
205
|
+
var updatedState = panesOptions.map(function (pane, idx) {
|
|
206
|
+
var paneProps = _this.getPaneProps(pane);
|
|
207
|
+
|
|
208
|
+
if (idx === index) {
|
|
209
|
+
return __assign(__assign({}, paneProps), {
|
|
210
|
+
collapsed: !pane.collapsed
|
|
211
|
+
});
|
|
212
|
+
} else {
|
|
213
|
+
return __assign({}, paneProps);
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
if (this.$props.onChange) {
|
|
218
|
+
this.$props.onChange({
|
|
219
|
+
newState: updatedState,
|
|
220
|
+
isLast: true,
|
|
221
|
+
nativeEvent: event
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
onBarDragResize: function onBarDragResize(event, barElement, index, isFirst, isLast) {
|
|
226
|
+
var time = new Date().getTime();
|
|
227
|
+
var pageX = event.pageX,
|
|
228
|
+
pageY = event.pageY;
|
|
229
|
+
|
|
230
|
+
var _a = this.surroudingPanes(barElement),
|
|
231
|
+
prevElement = _a.prevElement,
|
|
232
|
+
nextElement = _a.nextElement;
|
|
233
|
+
|
|
234
|
+
if (!prevElement || !nextElement) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
if (isFirst) {
|
|
239
|
+
this.setState({
|
|
240
|
+
isDragging: true,
|
|
241
|
+
dragIndex: index,
|
|
242
|
+
startTime: time,
|
|
243
|
+
originalX: pageX,
|
|
244
|
+
originalY: pageY,
|
|
245
|
+
originalPrevSize: this.elementSize(prevElement),
|
|
246
|
+
originalNextSize: this.elementSize(nextElement)
|
|
247
|
+
});
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
var _b = this.state,
|
|
252
|
+
originalPrevSize = _b.originalPrevSize,
|
|
253
|
+
originalNextSize = _b.originalNextSize,
|
|
254
|
+
startTime = _b.startTime,
|
|
255
|
+
originalX = _b.originalX,
|
|
256
|
+
originalY = _b.originalY;
|
|
257
|
+
|
|
258
|
+
if (!isFirst && time - startTime < DOUBLE_CLICK_WAIT_TIME) {
|
|
259
|
+
if (isLast) {
|
|
260
|
+
this.resetDragState();
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
var delta;
|
|
267
|
+
|
|
268
|
+
if (this.orientation === 'vertical') {
|
|
269
|
+
delta = pageY - originalY;
|
|
270
|
+
} else if (this.isRtl) {
|
|
271
|
+
delta = originalX - pageX;
|
|
272
|
+
} else {
|
|
273
|
+
delta = pageX - originalX;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
this.resize(index, index + 1, originalPrevSize, originalNextSize, delta, isLast, event);
|
|
277
|
+
|
|
278
|
+
if (isLast) {
|
|
279
|
+
this.resetDragState();
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
onBarKeyboardResize: function onBarKeyboardResize(barElement, index, delta, event) {
|
|
283
|
+
var _a = this.surroudingPanes(barElement),
|
|
284
|
+
prevElement = _a.prevElement,
|
|
285
|
+
nextElement = _a.nextElement;
|
|
286
|
+
|
|
287
|
+
var originalPrevSize = this.elementSize(prevElement);
|
|
288
|
+
var originalNextSize = this.elementSize(nextElement);
|
|
289
|
+
this.resize(index, index + 1, originalPrevSize, originalNextSize, delta, true, event);
|
|
290
|
+
},
|
|
291
|
+
surroudingPanes: function surroudingPanes(barElement) {
|
|
292
|
+
return {
|
|
293
|
+
prevElement: barElement.previousElementSibling,
|
|
294
|
+
nextElement: barElement.nextElementSibling
|
|
295
|
+
};
|
|
296
|
+
},
|
|
297
|
+
containerSize: function containerSize() {
|
|
298
|
+
if (!this._container) {
|
|
299
|
+
return 0;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
return this.elementSize(this._container, true);
|
|
303
|
+
},
|
|
304
|
+
isPercent: function isPercent(size) {
|
|
305
|
+
return /%$/.test(size);
|
|
306
|
+
},
|
|
307
|
+
toPixels: function toPixels(size, splitterSize) {
|
|
308
|
+
var result = parseInt(size, 10);
|
|
309
|
+
|
|
310
|
+
if (this.isPercent(size)) {
|
|
311
|
+
result = splitterSize * result / 100;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
return result;
|
|
315
|
+
},
|
|
316
|
+
panesOptions: function panesOptions(panesContent) {
|
|
317
|
+
return this.mapPaneOptions(this.panes, panesContent);
|
|
318
|
+
},
|
|
319
|
+
resetDragState: function resetDragState() {
|
|
320
|
+
this.setState({
|
|
321
|
+
isDragging: false,
|
|
322
|
+
dragIndex: undefined,
|
|
323
|
+
startTime: 0,
|
|
324
|
+
originalX: 0,
|
|
325
|
+
originalY: 0,
|
|
326
|
+
originalPrevSize: 0,
|
|
327
|
+
originalNextSize: 0
|
|
328
|
+
});
|
|
329
|
+
},
|
|
330
|
+
elementSize: function elementSize(el, isContainer) {
|
|
331
|
+
var sizeType = isContainer ? 'client' : 'offset';
|
|
332
|
+
|
|
333
|
+
if (this.orientation === 'vertical') {
|
|
334
|
+
return el[sizeType + "Height"];
|
|
335
|
+
} else {
|
|
336
|
+
return el[sizeType + "Width"];
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
clamp: function clamp(min, max, v) {
|
|
340
|
+
return Math.min(max, Math.max(min, v));
|
|
341
|
+
},
|
|
342
|
+
fixedSize: function fixedSize(size) {
|
|
343
|
+
return size && size.length > 0;
|
|
344
|
+
},
|
|
345
|
+
resize: function resize(prevIndex, nextIndex, originalPrevSize, originalNextSize, delta, isLast, event) {
|
|
346
|
+
var _this = this;
|
|
347
|
+
|
|
348
|
+
var panesOptions = this.panesOptions(this.panesContent);
|
|
349
|
+
var prevOptions = panesOptions[prevIndex];
|
|
350
|
+
var nextOptions = panesOptions[nextIndex];
|
|
351
|
+
var total = originalPrevSize + originalNextSize;
|
|
352
|
+
var splitterSize = this.containerSize();
|
|
353
|
+
|
|
354
|
+
var px = function px(s) {
|
|
355
|
+
return _this.toPixels(s, splitterSize);
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
var prevDragState = {
|
|
359
|
+
index: prevIndex,
|
|
360
|
+
initialSize: originalPrevSize,
|
|
361
|
+
min: px(prevOptions.min) || total - px(nextOptions.max) || 0,
|
|
362
|
+
max: px(prevOptions.max) || total - px(nextOptions.min) || total
|
|
363
|
+
};
|
|
364
|
+
var nextDragState = {
|
|
365
|
+
index: nextIndex,
|
|
366
|
+
initialSize: originalNextSize,
|
|
367
|
+
min: px(nextOptions.min) || total - px(prevOptions.max) || 0,
|
|
368
|
+
max: px(nextOptions.max) || total - px(prevOptions.min) || total
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
var resize = function resize(paneState, change) {
|
|
372
|
+
var pane = panesOptions[paneState.index];
|
|
373
|
+
|
|
374
|
+
var newSize = _this.clamp(paneState.min, paneState.max, paneState.initialSize + change);
|
|
375
|
+
|
|
376
|
+
if (_this.isPercent(pane.size || '')) {
|
|
377
|
+
return 100 * newSize / splitterSize + '%';
|
|
378
|
+
} else {
|
|
379
|
+
return newSize + 'px';
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
var prevSize;
|
|
384
|
+
var nextSize;
|
|
385
|
+
|
|
386
|
+
if (this.fixedSize(prevOptions.size) && this.fixedSize(nextOptions.size)) {
|
|
387
|
+
prevSize = resize(prevDragState, delta);
|
|
388
|
+
nextSize = resize(nextDragState, -delta);
|
|
389
|
+
} else if (nextOptions.collapsible || this.fixedSize(nextOptions.size)) {
|
|
390
|
+
nextSize = resize(nextDragState, -delta);
|
|
391
|
+
} else {
|
|
392
|
+
prevSize = resize(prevDragState, delta);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
var updatedState = panesOptions.map(function (pane, idx) {
|
|
396
|
+
var paneProps = _this.getPaneProps(pane);
|
|
397
|
+
|
|
398
|
+
if (idx === prevIndex) {
|
|
399
|
+
return __assign(__assign({}, paneProps), {
|
|
400
|
+
size: prevSize
|
|
401
|
+
});
|
|
402
|
+
} else if (idx === nextIndex) {
|
|
403
|
+
return __assign(__assign({}, paneProps), {
|
|
404
|
+
size: nextSize
|
|
405
|
+
});
|
|
406
|
+
} else {
|
|
407
|
+
return __assign({}, paneProps);
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
this.panesDuringOnChange = updatedState;
|
|
411
|
+
|
|
412
|
+
if (!this.isControlledState) {
|
|
413
|
+
this.setState({
|
|
414
|
+
panes: updatedState
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
if (this.$props.onChange) {
|
|
419
|
+
this.$props.onChange({
|
|
420
|
+
newState: updatedState,
|
|
421
|
+
isLast: isLast,
|
|
422
|
+
nativeEvent: event
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
this.panesDuringOnChange = undefined;
|
|
427
|
+
},
|
|
428
|
+
getPaneProps: function getPaneProps(pane) {
|
|
429
|
+
var orientation = pane.orientation,
|
|
430
|
+
overlay = pane.overlay,
|
|
431
|
+
containsSplitter = pane.containsSplitter,
|
|
432
|
+
others = __rest(pane, ["orientation", "overlay", "containsSplitter"]);
|
|
433
|
+
|
|
434
|
+
return others;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
var Splitter = SplitterVue2;
|
|
439
|
+
export { Splitter, SplitterVue2 };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from '../additionalTypes';
|
|
2
|
+
declare type DefaultData<V> = object | ((this: V) => {});
|
|
3
|
+
declare type DefaultMethods<V> = {
|
|
4
|
+
[key: string]: (this: V, ...args: any[]) => any;
|
|
5
|
+
};
|
|
6
|
+
import { SplitterPaneExtendedProps } from './SplitterPane';
|
|
7
|
+
/**
|
|
8
|
+
* @hidden
|
|
9
|
+
*/
|
|
10
|
+
export interface SplitterBarProps {
|
|
11
|
+
orientation: 'vertical' | 'horizontal' | string;
|
|
12
|
+
index: number;
|
|
13
|
+
prev: SplitterPaneExtendedProps;
|
|
14
|
+
next: SplitterPaneExtendedProps;
|
|
15
|
+
onDrag?: (event: any, element: HTMLDivElement, index: number, isFirst: boolean, isLast: boolean) => void;
|
|
16
|
+
onToggle?: (index: number, nativeEvent: any) => void;
|
|
17
|
+
onKeyboardResize?: (element: HTMLDivElement, index: number, delta: number, nativeEvent: any) => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* @hidden
|
|
21
|
+
*/
|
|
22
|
+
export interface SplitterBarState {
|
|
23
|
+
draggable: any | null;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @hidden
|
|
27
|
+
*/
|
|
28
|
+
export interface SplitterBarComputed {
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* @hidden
|
|
33
|
+
*/
|
|
34
|
+
export interface SplitterBarMethods {
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @hidden
|
|
39
|
+
*/
|
|
40
|
+
export interface SplitterBarData {
|
|
41
|
+
focused: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* @hidden
|
|
45
|
+
*/
|
|
46
|
+
export interface SplitterBarAll extends Vue2type, SplitterBarMethods, SplitterBarData, SplitterBarComputed, SplitterBarState {
|
|
47
|
+
}
|
|
48
|
+
declare let SplitterBarVue2: ComponentOptions<SplitterBarAll, DefaultData<SplitterBarData>, DefaultMethods<SplitterBarAll>, SplitterBarComputed, RecordPropsDefinition<SplitterBarProps>>;
|
|
49
|
+
declare const SplitterBar: DefineComponent<SplitterBarProps, any, SplitterBarData, SplitterBarComputed, SplitterBarMethods, {}, {}, {}, string, SplitterBarProps, SplitterBarProps, {}>;
|
|
50
|
+
export { SplitterBar, SplitterBarVue2 };
|