vxe-pc-ui 4.5.2 → 4.5.4
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/es/icon/style.css +1 -1
- package/es/list/src/list.js +3 -2
- package/es/print/src/util.js +2 -1
- package/es/split/src/split-item.js +16 -0
- package/es/split/src/split.js +226 -53
- package/es/split/style.css +75 -15
- package/es/split/style.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/ui/index.js +7 -2
- package/es/ui/src/dom.js +0 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-split/style.css +75 -15
- package/es/vxe-split/style.min.css +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +304 -54
- package/lib/index.umd.min.js +1 -1
- package/lib/list/src/list.js +2 -1
- package/lib/list/src/list.min.js +1 -1
- package/lib/print/src/util.js +2 -1
- package/lib/print/src/util.min.js +1 -1
- package/lib/split/src/split-item.js +16 -0
- package/lib/split/src/split-item.min.js +1 -1
- package/lib/split/src/split.js +275 -48
- package/lib/split/src/split.min.js +1 -1
- package/lib/split/style/style.css +75 -15
- package/lib/split/style/style.min.css +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/ui/index.js +7 -2
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/dom.js +0 -2
- package/lib/ui/src/dom.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-split/style/style.css +75 -15
- package/lib/vxe-split/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/list/src/list.ts +4 -2
- package/packages/print/src/util.ts +3 -1
- package/packages/split/src/split-item.ts +18 -0
- package/packages/split/src/split.ts +237 -52
- package/packages/ui/index.ts +7 -1
- package/packages/ui/src/dom.ts +0 -2
- package/styles/components/split.scss +98 -15
- package/types/components/split-item.d.ts +5 -1
- package/types/components/split.d.ts +87 -1
- package/types/ui/global-icon.d.ts +6 -0
- /package/es/icon/{iconfont.1743056531953.ttf → iconfont.1743125694154.ttf} +0 -0
- /package/es/icon/{iconfont.1743056531953.woff → iconfont.1743125694154.woff} +0 -0
- /package/es/icon/{iconfont.1743056531953.woff2 → iconfont.1743125694154.woff2} +0 -0
- /package/es/{iconfont.1743056531953.ttf → iconfont.1743125694154.ttf} +0 -0
- /package/es/{iconfont.1743056531953.woff → iconfont.1743125694154.woff} +0 -0
- /package/es/{iconfont.1743056531953.woff2 → iconfont.1743125694154.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1743056531953.ttf → iconfont.1743125694154.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1743056531953.woff → iconfont.1743125694154.woff} +0 -0
- /package/lib/icon/style/{iconfont.1743056531953.woff2 → iconfont.1743125694154.woff2} +0 -0
- /package/lib/{iconfont.1743056531953.ttf → iconfont.1743125694154.ttf} +0 -0
- /package/lib/{iconfont.1743056531953.woff → iconfont.1743125694154.woff} +0 -0
- /package/lib/{iconfont.1743056531953.woff2 → iconfont.1743125694154.woff2} +0 -0
package/es/split/src/split.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent, ref, h, reactive, provide, computed, watch, nextTick, onMounted, onActivated } from 'vue';
|
|
2
|
-
import { getConfig, createEvent, renderEmptyElement } from '../../ui';
|
|
1
|
+
import { defineComponent, ref, h, reactive, provide, computed, watch, nextTick, onMounted, onUnmounted, onActivated } from 'vue';
|
|
2
|
+
import { getConfig, getIcon, createEvent, globalEvents, renderEmptyElement } from '../../ui';
|
|
3
3
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
4
4
|
import { toCssUnit, isScale, addClass, removeClass } from '../../ui/src/dom';
|
|
5
5
|
import { getGlobalDefaultConfig } from '../../ui/src/utils';
|
|
@@ -21,9 +21,17 @@ export default defineComponent({
|
|
|
21
21
|
type: Boolean,
|
|
22
22
|
default: () => getConfig().split.padding
|
|
23
23
|
},
|
|
24
|
-
itemConfig: Object
|
|
24
|
+
itemConfig: Object,
|
|
25
|
+
barConfig: Object,
|
|
26
|
+
actionConfig: Object
|
|
25
27
|
},
|
|
26
|
-
emits: [
|
|
28
|
+
emits: [
|
|
29
|
+
'action-dblclick',
|
|
30
|
+
'action-click',
|
|
31
|
+
'resize-start',
|
|
32
|
+
'resize-drag',
|
|
33
|
+
'resize-end'
|
|
34
|
+
],
|
|
27
35
|
setup(props, context) {
|
|
28
36
|
const { emit, slots } = context;
|
|
29
37
|
const xID = XEUtils.uniqueId();
|
|
@@ -35,8 +43,33 @@ export default defineComponent({
|
|
|
35
43
|
const computeItemOpts = computed(() => {
|
|
36
44
|
return Object.assign({}, getConfig().split.itemConfig, props.itemConfig);
|
|
37
45
|
});
|
|
46
|
+
const computeBarOpts = computed(() => {
|
|
47
|
+
return Object.assign({}, getConfig().split.barConfig, props.barConfig);
|
|
48
|
+
});
|
|
49
|
+
const computeActionOpts = computed(() => {
|
|
50
|
+
return Object.assign({}, getConfig().split.actionConfig, props.actionConfig);
|
|
51
|
+
});
|
|
52
|
+
const computeIsFoldNext = computed(() => {
|
|
53
|
+
const actionOpts = computeActionOpts.value;
|
|
54
|
+
return actionOpts.direction === 'next';
|
|
55
|
+
});
|
|
56
|
+
const computeBarStyle = computed(() => {
|
|
57
|
+
const barOpts = computeBarOpts.value;
|
|
58
|
+
const { width, height } = barOpts;
|
|
59
|
+
const stys = {};
|
|
60
|
+
if (height) {
|
|
61
|
+
stys.height = toCssUnit(height);
|
|
62
|
+
}
|
|
63
|
+
if (width) {
|
|
64
|
+
stys.width = toCssUnit(width);
|
|
65
|
+
}
|
|
66
|
+
return stys;
|
|
67
|
+
});
|
|
38
68
|
const computeMaps = {
|
|
39
|
-
computeItemOpts
|
|
69
|
+
computeItemOpts,
|
|
70
|
+
computeBarOpts,
|
|
71
|
+
computeActionOpts,
|
|
72
|
+
computeIsFoldNext
|
|
40
73
|
};
|
|
41
74
|
const refMaps = {
|
|
42
75
|
refElem
|
|
@@ -64,6 +97,50 @@ export default defineComponent({
|
|
|
64
97
|
}
|
|
65
98
|
return [];
|
|
66
99
|
};
|
|
100
|
+
const getDefaultActionIcon = (item) => {
|
|
101
|
+
const { vertical } = props;
|
|
102
|
+
const { showAction, isExpand } = item;
|
|
103
|
+
const isFoldNext = computeIsFoldNext.value;
|
|
104
|
+
const topIcon = 'SPLIT_TOP_ACTION';
|
|
105
|
+
const bottomIcon = 'SPLIT_BOTTOM_ACTION';
|
|
106
|
+
const leftIcon = 'SPLIT_LEFT_ACTION';
|
|
107
|
+
const rightIcon = 'SPLIT_RIGHT_ACTION';
|
|
108
|
+
if (showAction) {
|
|
109
|
+
let iconName = '';
|
|
110
|
+
if (isFoldNext) {
|
|
111
|
+
if (vertical) {
|
|
112
|
+
iconName = isExpand ? bottomIcon : topIcon;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
iconName = isExpand ? rightIcon : leftIcon;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
if (vertical) {
|
|
120
|
+
iconName = isExpand ? topIcon : bottomIcon;
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
iconName = isExpand ? leftIcon : rightIcon;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (iconName) {
|
|
127
|
+
return getIcon()[iconName];
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return '';
|
|
131
|
+
};
|
|
132
|
+
const reset = () => {
|
|
133
|
+
const { staticItems } = reactData;
|
|
134
|
+
staticItems.forEach(item => {
|
|
135
|
+
item.isExpand = true;
|
|
136
|
+
item.isVisible = true;
|
|
137
|
+
item.foldHeight = 0;
|
|
138
|
+
item.foldWidth = 0;
|
|
139
|
+
item.resizeHeight = 0;
|
|
140
|
+
item.resizeWidth = 0;
|
|
141
|
+
});
|
|
142
|
+
return nextTick();
|
|
143
|
+
};
|
|
67
144
|
const recalculate = () => {
|
|
68
145
|
return nextTick().then(() => {
|
|
69
146
|
const { vertical } = props;
|
|
@@ -139,132 +216,222 @@ export default defineComponent({
|
|
|
139
216
|
evnt.preventDefault();
|
|
140
217
|
const { vertical } = props;
|
|
141
218
|
const { staticItems } = reactData;
|
|
142
|
-
const
|
|
219
|
+
const barEl = evnt.currentTarget;
|
|
220
|
+
const handleEl = barEl.parentElement;
|
|
143
221
|
const el = refElem.value;
|
|
144
222
|
if (!el) {
|
|
145
223
|
return;
|
|
146
224
|
}
|
|
147
|
-
const itemId = handleEl.getAttribute('
|
|
225
|
+
const itemId = handleEl.getAttribute('itemid');
|
|
148
226
|
const itemIndex = XEUtils.findIndexOf(staticItems, item => item.id === itemId);
|
|
149
227
|
const item = staticItems[itemIndex];
|
|
150
228
|
if (!item) {
|
|
151
229
|
return;
|
|
152
230
|
}
|
|
231
|
+
if (!item.isExpand) {
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
const isFoldNext = computeIsFoldNext.value;
|
|
153
235
|
const itemOpts = computeItemOpts.value;
|
|
154
236
|
const allMinWidth = XEUtils.toNumber(itemOpts.minWidth);
|
|
155
237
|
const allMinHeight = XEUtils.toNumber(itemOpts.minHeight);
|
|
156
|
-
const
|
|
157
|
-
const
|
|
158
|
-
const currItemEl = item ? el.querySelector(`.vxe-split-item[
|
|
159
|
-
const
|
|
238
|
+
const targetItem = staticItems[itemIndex + (isFoldNext ? 1 : -1)];
|
|
239
|
+
const targetItemEl = targetItem ? el.querySelector(`.vxe-split-item[itemid="${targetItem.id}"]`) : null;
|
|
240
|
+
const currItemEl = item ? el.querySelector(`.vxe-split-item[itemid="${item.id}"]`) : null;
|
|
241
|
+
const targetWidth = targetItemEl ? targetItemEl.clientWidth : 0;
|
|
160
242
|
const currWidth = currItemEl ? currItemEl.clientWidth : 0;
|
|
161
|
-
const
|
|
243
|
+
const targetHeight = targetItemEl ? targetItemEl.clientHeight : 0;
|
|
162
244
|
const currHeight = currItemEl ? currItemEl.clientHeight : 0;
|
|
163
|
-
const
|
|
245
|
+
const targetMinWidth = XEUtils.toNumber(targetItem ? getGlobalDefaultConfig(targetItem.minWidth, allMinWidth) : allMinWidth);
|
|
164
246
|
const currMinWidth = XEUtils.toNumber(getGlobalDefaultConfig(item.minWidth, allMinWidth));
|
|
165
|
-
const
|
|
247
|
+
const targetMinHeight = XEUtils.toNumber(targetItem ? getGlobalDefaultConfig(targetItem.minHeight, allMinHeight) : allMinHeight);
|
|
166
248
|
const currMinHeight = XEUtils.toNumber(getGlobalDefaultConfig(item.minHeight, allMinHeight));
|
|
167
249
|
const disX = evnt.clientX;
|
|
168
250
|
const disY = evnt.clientY;
|
|
169
251
|
addClass(el, 'is--drag');
|
|
170
|
-
document.onmousemove = evnt => {
|
|
252
|
+
document.onmousemove = (evnt) => {
|
|
171
253
|
evnt.preventDefault();
|
|
172
254
|
if (vertical) {
|
|
173
|
-
const offsetTop = evnt.clientY - disY;
|
|
255
|
+
const offsetTop = isFoldNext ? (disY - evnt.clientY) : (evnt.clientY - disY);
|
|
174
256
|
if (offsetTop > 0) {
|
|
175
|
-
if (
|
|
257
|
+
if (targetItem) {
|
|
176
258
|
if (currHeight - offsetTop >= currMinHeight) {
|
|
177
|
-
|
|
178
|
-
|
|
259
|
+
const reHeight = currHeight - offsetTop;
|
|
260
|
+
targetItem.resizeHeight = targetHeight + offsetTop;
|
|
261
|
+
item.resizeHeight = reHeight;
|
|
262
|
+
dispatchEvent('resize-drag', { item, name: item.name, offsetHeight: offsetTop, resizeHeight: reHeight, offsetWidth: 0, resizeWidth: 0 }, evnt);
|
|
179
263
|
}
|
|
180
264
|
}
|
|
181
265
|
}
|
|
182
266
|
else {
|
|
183
|
-
if (
|
|
184
|
-
if (
|
|
185
|
-
|
|
186
|
-
|
|
267
|
+
if (targetItem) {
|
|
268
|
+
if (targetHeight + offsetTop >= targetMinHeight) {
|
|
269
|
+
const reHeight = currHeight - offsetTop;
|
|
270
|
+
targetItem.resizeHeight = targetHeight + offsetTop;
|
|
271
|
+
item.resizeHeight = reHeight;
|
|
272
|
+
dispatchEvent('resize-drag', { item, name: item.name, offsetHeight: offsetTop, resizeHeight: reHeight, offsetWidth: 0, resizeWidth: 0 }, evnt);
|
|
187
273
|
}
|
|
188
274
|
}
|
|
189
275
|
}
|
|
190
276
|
}
|
|
191
277
|
else {
|
|
192
|
-
const offsetLeft = evnt.clientX - disX;
|
|
278
|
+
const offsetLeft = isFoldNext ? (disX - evnt.clientX) : (evnt.clientX - disX);
|
|
193
279
|
if (offsetLeft > 0) {
|
|
194
|
-
if (
|
|
280
|
+
if (targetItem) {
|
|
195
281
|
if (currWidth - offsetLeft >= currMinWidth) {
|
|
196
|
-
|
|
197
|
-
|
|
282
|
+
const reWidth = currWidth - offsetLeft;
|
|
283
|
+
targetItem.resizeWidth = targetWidth + offsetLeft;
|
|
284
|
+
item.resizeWidth = reWidth;
|
|
285
|
+
dispatchEvent('resize-drag', { item, name: item.name, offsetHeight: 0, resizeHeight: 0, offsetWidth: offsetLeft, resizeWidth: reWidth }, evnt);
|
|
198
286
|
}
|
|
199
287
|
}
|
|
200
288
|
}
|
|
201
289
|
else {
|
|
202
|
-
if (
|
|
203
|
-
if (
|
|
204
|
-
|
|
205
|
-
|
|
290
|
+
if (targetItem) {
|
|
291
|
+
if (targetWidth + offsetLeft >= targetMinWidth) {
|
|
292
|
+
const reWidth = currWidth - offsetLeft;
|
|
293
|
+
targetItem.resizeWidth = targetWidth + offsetLeft;
|
|
294
|
+
item.resizeWidth = reWidth;
|
|
295
|
+
dispatchEvent('resize-drag', { item, name: item.name, offsetHeight: 0, resizeHeight: 0, offsetWidth: offsetLeft, resizeWidth: reWidth }, evnt);
|
|
206
296
|
}
|
|
207
297
|
}
|
|
208
298
|
}
|
|
209
299
|
}
|
|
210
300
|
};
|
|
211
|
-
document.onmouseup = () => {
|
|
301
|
+
document.onmouseup = (evnt) => {
|
|
212
302
|
document.onmousemove = null;
|
|
213
303
|
document.onmouseup = null;
|
|
214
304
|
removeClass(el, 'is--drag');
|
|
305
|
+
dispatchEvent('resize-end', { item, name: item.name, resizeHeight: item.resizeHeight, resizeWidth: item.resizeWidth }, evnt);
|
|
306
|
+
recalculate();
|
|
215
307
|
};
|
|
308
|
+
dispatchEvent('resize-start', { item, name: item.name }, evnt);
|
|
309
|
+
};
|
|
310
|
+
const handleItemActionEvent = (evnt) => {
|
|
311
|
+
const el = refElem.value;
|
|
312
|
+
if (!el) {
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
const { vertical } = props;
|
|
316
|
+
const { staticItems } = reactData;
|
|
317
|
+
const isFoldNext = computeIsFoldNext.value;
|
|
318
|
+
const btnEl = evnt.currentTarget;
|
|
319
|
+
const handleEl = btnEl.parentElement;
|
|
320
|
+
const itemId = handleEl.getAttribute('itemid');
|
|
321
|
+
const itemIndex = XEUtils.findIndexOf(staticItems, item => item.id === itemId);
|
|
322
|
+
const item = staticItems[itemIndex];
|
|
323
|
+
const targetItem = staticItems[itemIndex + (isFoldNext ? 1 : -1)];
|
|
324
|
+
if (item) {
|
|
325
|
+
const { showAction, isExpand } = item;
|
|
326
|
+
if (showAction) {
|
|
327
|
+
if (vertical) {
|
|
328
|
+
if (targetItem) {
|
|
329
|
+
targetItem.isVisible = !isExpand;
|
|
330
|
+
targetItem.foldHeight = 0;
|
|
331
|
+
item.isExpand = !isExpand;
|
|
332
|
+
item.isVisible = true;
|
|
333
|
+
item.foldHeight = isExpand ? (targetItem.resizeHeight || targetItem.renderHeight) + (item.resizeHeight || item.renderHeight) : 0;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
else {
|
|
337
|
+
if (targetItem) {
|
|
338
|
+
targetItem.isVisible = !isExpand;
|
|
339
|
+
targetItem.foldWidth = 0;
|
|
340
|
+
item.isExpand = !isExpand;
|
|
341
|
+
item.isVisible = true;
|
|
342
|
+
item.foldWidth = isExpand ? (targetItem.resizeWidth || targetItem.renderWidth) + (item.resizeWidth || item.renderWidth) : 0;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
dispatchEvent(evnt.type === 'dblclick' ? 'action-dblclick' : 'action-click', { item, name: item.name, targetItem, targetName: targetItem ? targetItem.name : '', expanded: item.isExpand }, evnt);
|
|
346
|
+
recalculate();
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
const handleGlobalResizeEvent = () => {
|
|
351
|
+
recalculate();
|
|
216
352
|
};
|
|
217
353
|
const splitMethods = {
|
|
218
354
|
dispatchEvent,
|
|
219
|
-
recalculate
|
|
355
|
+
recalculate,
|
|
356
|
+
reset
|
|
220
357
|
};
|
|
221
358
|
const splitPrivateMethods = {};
|
|
222
359
|
Object.assign($xeSplit, splitMethods, splitPrivateMethods);
|
|
360
|
+
const renderHandleBar = (item) => {
|
|
361
|
+
const barStyle = computeBarStyle.value;
|
|
362
|
+
const actionOpts = computeActionOpts.value;
|
|
363
|
+
const isFoldNext = computeIsFoldNext.value;
|
|
364
|
+
const { id, isExpand, showAction } = item;
|
|
365
|
+
const btnOns = {};
|
|
366
|
+
if (actionOpts.trigger === 'dblclick') {
|
|
367
|
+
btnOns.onDblclick = handleItemActionEvent;
|
|
368
|
+
}
|
|
369
|
+
else {
|
|
370
|
+
btnOns.onClick = handleItemActionEvent;
|
|
371
|
+
}
|
|
372
|
+
return h('div', {
|
|
373
|
+
itemid: id,
|
|
374
|
+
class: ['vxe-split-item-handle', isFoldNext ? 'to--next' : 'to--prev']
|
|
375
|
+
}, [
|
|
376
|
+
h('div', {
|
|
377
|
+
class: 'vxe-split-item-handle-bar',
|
|
378
|
+
style: barStyle,
|
|
379
|
+
onMousedown: dragEvent
|
|
380
|
+
}),
|
|
381
|
+
showAction
|
|
382
|
+
? h('span', Object.assign({ class: 'vxe-split-item-action-btn' }, btnOns), [
|
|
383
|
+
h('i', {
|
|
384
|
+
class: (isExpand ? actionOpts.openIcon : actionOpts.closeIcon) || getDefaultActionIcon(item)
|
|
385
|
+
})
|
|
386
|
+
])
|
|
387
|
+
: renderEmptyElement($xeSplit)
|
|
388
|
+
]);
|
|
389
|
+
};
|
|
223
390
|
const renderItems = () => {
|
|
224
391
|
const { border, padding, vertical } = props;
|
|
225
392
|
const { staticItems } = reactData;
|
|
393
|
+
const isFoldNext = computeIsFoldNext.value;
|
|
226
394
|
const itemVNs = [];
|
|
227
395
|
staticItems.forEach((item, index) => {
|
|
228
|
-
const { id, slots, renderHeight, renderWidth } = item;
|
|
396
|
+
const { id, slots, renderHeight, resizeHeight, foldHeight, renderWidth, resizeWidth, foldWidth, isVisible, isExpand } = item;
|
|
229
397
|
const defaultSlot = slots ? slots.default : null;
|
|
230
398
|
const stys = {};
|
|
399
|
+
const itemWidth = isVisible ? (foldWidth || resizeWidth || renderWidth) : 0;
|
|
400
|
+
const itemHeight = isVisible ? (foldHeight || resizeHeight || renderHeight) : 0;
|
|
231
401
|
if (vertical) {
|
|
232
|
-
if (
|
|
233
|
-
stys.height = toCssUnit(
|
|
402
|
+
if (itemHeight) {
|
|
403
|
+
stys.height = toCssUnit(itemHeight);
|
|
234
404
|
}
|
|
235
405
|
}
|
|
236
406
|
else {
|
|
237
|
-
if (
|
|
238
|
-
stys.width = toCssUnit(
|
|
407
|
+
if (itemWidth) {
|
|
408
|
+
stys.width = toCssUnit(itemWidth);
|
|
239
409
|
}
|
|
240
410
|
}
|
|
241
411
|
itemVNs.push(h('div', {
|
|
242
|
-
|
|
412
|
+
itemid: id,
|
|
243
413
|
class: ['vxe-split-item', vertical ? 'is--vertical' : 'is--horizontal', {
|
|
244
414
|
'is--padding': padding,
|
|
245
415
|
'is--border': border,
|
|
246
|
-
'is--height':
|
|
247
|
-
'is--width':
|
|
248
|
-
'is--fill': !
|
|
249
|
-
'is--handle': index > 0
|
|
416
|
+
'is--height': itemHeight,
|
|
417
|
+
'is--width': itemWidth,
|
|
418
|
+
'is--fill': isVisible && !itemHeight && !itemWidth,
|
|
419
|
+
'is--handle': index > 0,
|
|
420
|
+
'is--expand': isExpand,
|
|
421
|
+
'is--hidden': !isVisible
|
|
250
422
|
}],
|
|
251
423
|
style: stys
|
|
252
424
|
}, [
|
|
253
|
-
index
|
|
254
|
-
? h('div', {
|
|
255
|
-
xid: id,
|
|
256
|
-
class: 'vxe-split-item-handle',
|
|
257
|
-
onMousedown: dragEvent
|
|
258
|
-
})
|
|
259
|
-
: renderEmptyElement($xeSplit),
|
|
425
|
+
index && !isFoldNext ? renderHandleBar(item) : renderEmptyElement($xeSplit),
|
|
260
426
|
h('div', {
|
|
261
|
-
|
|
427
|
+
itemid: id,
|
|
262
428
|
class: 'vxe-split-item--wrapper'
|
|
263
429
|
}, [
|
|
264
430
|
h('div', {
|
|
265
431
|
class: 'vxe-split-item--inner'
|
|
266
432
|
}, defaultSlot ? callSlot(defaultSlot, {}) : [])
|
|
267
|
-
])
|
|
433
|
+
]),
|
|
434
|
+
isFoldNext && index < staticItems.length - 1 ? renderHandleBar(item) : renderEmptyElement($xeSplit)
|
|
268
435
|
]));
|
|
269
436
|
});
|
|
270
437
|
return h('div', {
|
|
@@ -296,7 +463,13 @@ export default defineComponent({
|
|
|
296
463
|
recalculate();
|
|
297
464
|
});
|
|
298
465
|
onMounted(() => {
|
|
299
|
-
|
|
466
|
+
nextTick(() => {
|
|
467
|
+
recalculate();
|
|
468
|
+
});
|
|
469
|
+
globalEvents.on($xeSplit, 'resize', handleGlobalResizeEvent);
|
|
470
|
+
});
|
|
471
|
+
onUnmounted(() => {
|
|
472
|
+
globalEvents.off($xeSplit, 'resize');
|
|
300
473
|
});
|
|
301
474
|
onActivated(() => {
|
|
302
475
|
recalculate();
|
package/es/split/style.css
CHANGED
|
@@ -32,18 +32,12 @@
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
.vxe-split-item-handle {
|
|
35
|
+
position: relative;
|
|
35
36
|
flex-shrink: 0;
|
|
36
|
-
background-color: var(--vxe-split-handle-bar-background-color);
|
|
37
37
|
-webkit-user-select: none;
|
|
38
38
|
-moz-user-select: none;
|
|
39
39
|
user-select: none;
|
|
40
40
|
}
|
|
41
|
-
.vxe-split-item-handle:hover {
|
|
42
|
-
background-color: var(--vxe-ui-font-primary-lighten-color);
|
|
43
|
-
}
|
|
44
|
-
.vxe-split-item-handle:active {
|
|
45
|
-
background-color: var(--vxe-ui-font-primary-darken-color);
|
|
46
|
-
}
|
|
47
41
|
|
|
48
42
|
.vxe-split-item--wrapper {
|
|
49
43
|
position: relative;
|
|
@@ -51,20 +45,37 @@
|
|
|
51
45
|
overflow: hidden;
|
|
52
46
|
flex-grow: 1;
|
|
53
47
|
}
|
|
54
|
-
.vxe-split-item--wrapper > .vxe-split {
|
|
55
|
-
height: 100%;
|
|
56
|
-
}
|
|
57
48
|
|
|
58
49
|
.vxe-split-item--inner {
|
|
59
50
|
height: 100%;
|
|
60
51
|
width: 100%;
|
|
61
52
|
overflow: auto;
|
|
62
53
|
}
|
|
54
|
+
.vxe-split-item--inner > .vxe-split {
|
|
55
|
+
height: 100%;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.vxe-split-item-handle-bar {
|
|
59
|
+
background-color: var(--vxe-split-handle-bar-background-color);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.vxe-split-item-action-btn {
|
|
63
|
+
display: block;
|
|
64
|
+
position: absolute;
|
|
65
|
+
z-index: 2;
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
background-color: var(--vxe-ui-layout-background-color);
|
|
68
|
+
border: 1px solid var(--vxe-ui-input-border-color);
|
|
69
|
+
transition: transform 0.1s ease-in-out;
|
|
70
|
+
}
|
|
63
71
|
|
|
64
72
|
.vxe-split-item {
|
|
65
73
|
display: flex;
|
|
66
74
|
position: relative;
|
|
67
|
-
overflow:
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
}
|
|
77
|
+
.vxe-split-item.is--hidden {
|
|
78
|
+
width: 0;
|
|
68
79
|
}
|
|
69
80
|
.vxe-split-item.is--padding > .vxe-split-item--wrapper {
|
|
70
81
|
padding: var(--vxe-ui-layout-padding-default);
|
|
@@ -78,12 +89,44 @@
|
|
|
78
89
|
.vxe-split-item.is--border > .vxe-split-item--wrapper, .vxe-split-item.is--border > .vxe-split-item-handle {
|
|
79
90
|
border: 1px solid var(--vxe-ui-base-popup-border-color);
|
|
80
91
|
}
|
|
92
|
+
.vxe-split-item.is--expand.is--horizontal > .vxe-split-item-handle .vxe-split-item-handle-bar {
|
|
93
|
+
cursor: w-resize;
|
|
94
|
+
}
|
|
95
|
+
.vxe-split-item.is--expand.is--vertical > .vxe-split-item-handle .vxe-split-item-handle-bar {
|
|
96
|
+
cursor: n-resize;
|
|
97
|
+
}
|
|
98
|
+
.vxe-split-item.is--expand > .vxe-split-item-handle > .vxe-split-item-handle-bar {
|
|
99
|
+
background-color: var(--vxe-split-handle-bar-background-color);
|
|
100
|
+
}
|
|
101
|
+
.vxe-split-item.is--expand > .vxe-split-item-handle > .vxe-split-item-handle-bar:hover {
|
|
102
|
+
background-color: var(--vxe-ui-font-primary-lighten-color);
|
|
103
|
+
}
|
|
104
|
+
.vxe-split-item.is--expand > .vxe-split-item-handle > .vxe-split-item-handle-bar:active {
|
|
105
|
+
background-color: var(--vxe-ui-font-primary-darken-color);
|
|
106
|
+
}
|
|
81
107
|
.vxe-split-item.is--horizontal {
|
|
82
108
|
flex-direction: row;
|
|
83
109
|
}
|
|
84
|
-
.vxe-split-item.is--horizontal > .vxe-split-item-handle {
|
|
110
|
+
.vxe-split-item.is--horizontal > .vxe-split-item-handle.to--prev .vxe-split-item-action-btn {
|
|
111
|
+
left: 0;
|
|
112
|
+
}
|
|
113
|
+
.vxe-split-item.is--horizontal > .vxe-split-item-handle.to--next .vxe-split-item-action-btn {
|
|
114
|
+
right: 0;
|
|
115
|
+
}
|
|
116
|
+
.vxe-split-item.is--horizontal > .vxe-split-item-handle .vxe-split-item-handle-bar {
|
|
85
117
|
width: var(--vxe-split-handle-bar-width);
|
|
86
|
-
|
|
118
|
+
height: 100%;
|
|
119
|
+
}
|
|
120
|
+
.vxe-split-item.is--horizontal > .vxe-split-item-handle .vxe-split-item-action-btn {
|
|
121
|
+
top: 50%;
|
|
122
|
+
transform: translateY(-50%);
|
|
123
|
+
padding: 1em 0;
|
|
124
|
+
}
|
|
125
|
+
.vxe-split-item.is--horizontal > .vxe-split-item-handle .vxe-split-item-action-btn:hover {
|
|
126
|
+
color: var(--vxe-ui-font-primary-color);
|
|
127
|
+
}
|
|
128
|
+
.vxe-split-item.is--horizontal > .vxe-split-item-handle .vxe-split-item-action-btn:active {
|
|
129
|
+
transform: translateY(-50%) scale(0.9);
|
|
87
130
|
}
|
|
88
131
|
.vxe-split-item.is--horizontal.is--border > .vxe-split-item-handle {
|
|
89
132
|
border-width: 1px 0 1px 0;
|
|
@@ -91,9 +134,26 @@
|
|
|
91
134
|
.vxe-split-item.is--vertical {
|
|
92
135
|
flex-direction: column;
|
|
93
136
|
}
|
|
94
|
-
.vxe-split-item.is--vertical > .vxe-split-item-handle {
|
|
137
|
+
.vxe-split-item.is--vertical > .vxe-split-item-handle.to--prev .vxe-split-item-action-btn {
|
|
138
|
+
top: 0;
|
|
139
|
+
}
|
|
140
|
+
.vxe-split-item.is--vertical > .vxe-split-item-handle.to--next .vxe-split-item-action-btn {
|
|
141
|
+
bottom: 0;
|
|
142
|
+
}
|
|
143
|
+
.vxe-split-item.is--vertical > .vxe-split-item-handle .vxe-split-item-handle-bar {
|
|
95
144
|
height: var(--vxe-split-handle-bar-height);
|
|
96
|
-
|
|
145
|
+
width: 100%;
|
|
146
|
+
}
|
|
147
|
+
.vxe-split-item.is--vertical > .vxe-split-item-handle .vxe-split-item-action-btn {
|
|
148
|
+
left: 50%;
|
|
149
|
+
transform: translateX(-50%);
|
|
150
|
+
padding: 0 1em;
|
|
151
|
+
}
|
|
152
|
+
.vxe-split-item.is--vertical > .vxe-split-item-handle .vxe-split-item-action-btn:hover {
|
|
153
|
+
color: var(--vxe-ui-font-primary-color);
|
|
154
|
+
}
|
|
155
|
+
.vxe-split-item.is--vertical > .vxe-split-item-handle .vxe-split-item-action-btn:active {
|
|
156
|
+
transform: translateX(-50%) scale(0.9);
|
|
97
157
|
}
|
|
98
158
|
.vxe-split-item.is--vertical.is--border > .vxe-split-item-handle {
|
|
99
159
|
border-width: 0 1px 0 1px;
|
package/es/split/style.min.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.vxe-split.is--vertical>.vxe-split-wrapper{flex-direction:column}.vxe-split.is--vertical>.vxe-split-wrapper>.vxe-split-item{width:100%}.vxe-split.is--drag{-webkit-user-select:none;-moz-user-select:none;user-select:none}.vxe-split.is--drag>.vxe-split-wrapper>.vxe-split-item>.vxe-split-item--wrapper::after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;background:0 0}.vxe-split-wrapper{height:100%;display:flex;flex-direction:row;overflow:hidden}.vxe-split-slots{display:none}.vxe-split-item-handle{flex-shrink:0
|
|
1
|
+
.vxe-split.is--vertical>.vxe-split-wrapper{flex-direction:column}.vxe-split.is--vertical>.vxe-split-wrapper>.vxe-split-item{width:100%}.vxe-split.is--drag{-webkit-user-select:none;-moz-user-select:none;user-select:none}.vxe-split.is--drag>.vxe-split-wrapper>.vxe-split-item>.vxe-split-item--wrapper::after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;background:0 0}.vxe-split-wrapper{height:100%;display:flex;flex-direction:row;overflow:hidden}.vxe-split-slots{display:none}.vxe-split-item-handle{position:relative;flex-shrink:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.vxe-split-item--wrapper{position:relative;word-break:break-word;overflow:hidden;flex-grow:1}.vxe-split-item--inner{height:100%;width:100%;overflow:auto}.vxe-split-item--inner>.vxe-split{height:100%}.vxe-split-item-handle-bar{background-color:var(--vxe-split-handle-bar-background-color)}.vxe-split-item-action-btn{display:block;position:absolute;z-index:2;cursor:pointer;background-color:var(--vxe-ui-layout-background-color);border:1px solid var(--vxe-ui-input-border-color);transition:transform .1s ease-in-out}.vxe-split-item{display:flex;position:relative;overflow:hidden}.vxe-split-item.is--hidden{width:0}.vxe-split-item.is--padding>.vxe-split-item--wrapper{padding:var(--vxe-ui-layout-padding-default)}.vxe-split-item.is--fill{flex-grow:1}.vxe-split-item.is--height,.vxe-split-item.is--width{flex-shrink:0}.vxe-split-item.is--border>.vxe-split-item--wrapper,.vxe-split-item.is--border>.vxe-split-item-handle{border:1px solid var(--vxe-ui-base-popup-border-color)}.vxe-split-item.is--expand.is--horizontal>.vxe-split-item-handle .vxe-split-item-handle-bar{cursor:w-resize}.vxe-split-item.is--expand.is--vertical>.vxe-split-item-handle .vxe-split-item-handle-bar{cursor:n-resize}.vxe-split-item.is--expand>.vxe-split-item-handle>.vxe-split-item-handle-bar{background-color:var(--vxe-split-handle-bar-background-color)}.vxe-split-item.is--expand>.vxe-split-item-handle>.vxe-split-item-handle-bar:hover{background-color:var(--vxe-ui-font-primary-lighten-color)}.vxe-split-item.is--expand>.vxe-split-item-handle>.vxe-split-item-handle-bar:active{background-color:var(--vxe-ui-font-primary-darken-color)}.vxe-split-item.is--horizontal{flex-direction:row}.vxe-split-item.is--horizontal>.vxe-split-item-handle.to--prev .vxe-split-item-action-btn{left:0}.vxe-split-item.is--horizontal>.vxe-split-item-handle.to--next .vxe-split-item-action-btn{right:0}.vxe-split-item.is--horizontal>.vxe-split-item-handle .vxe-split-item-handle-bar{width:var(--vxe-split-handle-bar-width);height:100%}.vxe-split-item.is--horizontal>.vxe-split-item-handle .vxe-split-item-action-btn{top:50%;transform:translateY(-50%);padding:1em 0}.vxe-split-item.is--horizontal>.vxe-split-item-handle .vxe-split-item-action-btn:hover{color:var(--vxe-ui-font-primary-color)}.vxe-split-item.is--horizontal>.vxe-split-item-handle .vxe-split-item-action-btn:active{transform:translateY(-50%) scale(.9)}.vxe-split-item.is--horizontal.is--border>.vxe-split-item-handle{border-width:1px 0 1px 0}.vxe-split-item.is--vertical{flex-direction:column}.vxe-split-item.is--vertical>.vxe-split-item-handle.to--prev .vxe-split-item-action-btn{top:0}.vxe-split-item.is--vertical>.vxe-split-item-handle.to--next .vxe-split-item-action-btn{bottom:0}.vxe-split-item.is--vertical>.vxe-split-item-handle .vxe-split-item-handle-bar{height:var(--vxe-split-handle-bar-height);width:100%}.vxe-split-item.is--vertical>.vxe-split-item-handle .vxe-split-item-action-btn{left:50%;transform:translateX(-50%);padding:0 1em}.vxe-split-item.is--vertical>.vxe-split-item-handle .vxe-split-item-action-btn:hover{color:var(--vxe-ui-font-primary-color)}.vxe-split-item.is--vertical>.vxe-split-item-handle .vxe-split-item-action-btn:active{transform:translateX(-50%) scale(.9)}.vxe-split-item.is--vertical.is--border>.vxe-split-item-handle{border-width:0 1px 0 1px}
|