vxe-pc-ui 3.5.2 → 3.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 +22 -2
- package/es/split/src/split.js +241 -52
- 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 +317 -56
- 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 +22 -2
- package/lib/split/src/split-item.min.js +1 -1
- package/lib/split/src/split.js +281 -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 +24 -2
- package/packages/split/src/split.ts +252 -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.1743056503870.ttf → iconfont.1743125681770.ttf} +0 -0
- /package/es/icon/{iconfont.1743056503870.woff → iconfont.1743125681770.woff} +0 -0
- /package/es/icon/{iconfont.1743056503870.woff2 → iconfont.1743125681770.woff2} +0 -0
- /package/es/{iconfont.1743056503870.ttf → iconfont.1743125681770.ttf} +0 -0
- /package/es/{iconfont.1743056503870.woff → iconfont.1743125681770.woff} +0 -0
- /package/es/{iconfont.1743056503870.woff2 → iconfont.1743125681770.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1743056503870.ttf → iconfont.1743125681770.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1743056503870.woff → iconfont.1743125681770.woff} +0 -0
- /package/lib/icon/style/{iconfont.1743056503870.woff2 → iconfont.1743125681770.woff2} +0 -0
- /package/lib/{iconfont.1743056503870.ttf → iconfont.1743125681770.ttf} +0 -0
- /package/lib/{iconfont.1743056503870.woff → iconfont.1743125681770.woff} +0 -0
- /package/lib/{iconfont.1743056503870.woff2 → iconfont.1743125681770.woff2} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CreateElement, PropType, VNode } from 'vue'
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
3
|
import XEUtils from 'xe-utils'
|
|
4
|
-
import { getConfig, createEvent, globalMixins, renderEmptyElement } from '../../ui'
|
|
4
|
+
import { getConfig, getIcon, createEvent, globalEvents, globalMixins, renderEmptyElement } from '../../ui'
|
|
5
5
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
6
6
|
import { toCssUnit, isScale, addClass, removeClass } from '../../ui/src/dom'
|
|
7
7
|
import { getGlobalDefaultConfig } from '../../ui/src/utils'
|
|
@@ -28,7 +28,9 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
28
28
|
type: Boolean as PropType<VxeSplitPropTypes.Padding>,
|
|
29
29
|
default: () => getConfig().split.padding
|
|
30
30
|
},
|
|
31
|
-
itemConfig: Object as PropType<VxeSplitPropTypes.ItemConfig
|
|
31
|
+
itemConfig: Object as PropType<VxeSplitPropTypes.ItemConfig>,
|
|
32
|
+
barConfig: Object as PropType<VxeSplitPropTypes.BarConfig>,
|
|
33
|
+
actionConfig: Object as PropType<VxeSplitPropTypes.ActionConfig>
|
|
32
34
|
},
|
|
33
35
|
data () {
|
|
34
36
|
const xID = XEUtils.uniqueId()
|
|
@@ -58,6 +60,38 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
58
60
|
const props = $xeSplit
|
|
59
61
|
|
|
60
62
|
return Object.assign({}, getConfig().split.itemConfig, props.itemConfig)
|
|
63
|
+
},
|
|
64
|
+
computeBarOpts () {
|
|
65
|
+
const $xeSplit = this
|
|
66
|
+
const props = $xeSplit
|
|
67
|
+
|
|
68
|
+
return Object.assign({}, getConfig().split.barConfig, props.barConfig)
|
|
69
|
+
},
|
|
70
|
+
computeActionOpts () {
|
|
71
|
+
const $xeSplit = this
|
|
72
|
+
const props = $xeSplit
|
|
73
|
+
|
|
74
|
+
return Object.assign({}, getConfig().split.actionConfig, props.actionConfig)
|
|
75
|
+
},
|
|
76
|
+
computeIsFoldNext () {
|
|
77
|
+
const $xeSplit = this
|
|
78
|
+
|
|
79
|
+
const actionOpts = $xeSplit.computeActionOpts as VxeSplitPropTypes.ActionConfig
|
|
80
|
+
return actionOpts.direction === 'next'
|
|
81
|
+
},
|
|
82
|
+
computeBarStyle () {
|
|
83
|
+
const $xeSplit = this
|
|
84
|
+
|
|
85
|
+
const barOpts = $xeSplit.computeBarOpts
|
|
86
|
+
const { width, height } = barOpts
|
|
87
|
+
const stys: Record<string, string | number> = {}
|
|
88
|
+
if (height) {
|
|
89
|
+
stys.height = toCssUnit(height)
|
|
90
|
+
}
|
|
91
|
+
if (width) {
|
|
92
|
+
stys.width = toCssUnit(width)
|
|
93
|
+
}
|
|
94
|
+
return stys
|
|
61
95
|
}
|
|
62
96
|
},
|
|
63
97
|
methods: {
|
|
@@ -82,6 +116,21 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
82
116
|
}
|
|
83
117
|
return []
|
|
84
118
|
},
|
|
119
|
+
reset () {
|
|
120
|
+
const $xeSplit = this
|
|
121
|
+
const reactData = $xeSplit.reactData
|
|
122
|
+
|
|
123
|
+
const { staticItems } = reactData
|
|
124
|
+
staticItems.forEach(item => {
|
|
125
|
+
item.isExpand = true
|
|
126
|
+
item.isVisible = true
|
|
127
|
+
item.foldHeight = 0
|
|
128
|
+
item.foldWidth = 0
|
|
129
|
+
item.resizeHeight = 0
|
|
130
|
+
item.resizeWidth = 0
|
|
131
|
+
})
|
|
132
|
+
return $xeSplit.$nextTick()
|
|
133
|
+
},
|
|
85
134
|
recalculate () {
|
|
86
135
|
const $xeSplit = this
|
|
87
136
|
const props = $xeSplit
|
|
@@ -160,82 +209,220 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
160
209
|
evnt.preventDefault()
|
|
161
210
|
const { vertical } = props
|
|
162
211
|
const { staticItems } = reactData
|
|
163
|
-
const
|
|
212
|
+
const barEl = evnt.currentTarget as HTMLDivElement
|
|
213
|
+
const handleEl = barEl.parentElement as HTMLDivElement
|
|
164
214
|
const el = $xeSplit.$refs.refElem as HTMLDivElement
|
|
165
215
|
if (!el) {
|
|
166
216
|
return
|
|
167
217
|
}
|
|
168
|
-
const itemId = handleEl.getAttribute('
|
|
218
|
+
const itemId = handleEl.getAttribute('itemid')
|
|
169
219
|
const itemIndex = XEUtils.findIndexOf(staticItems, item => item.id === itemId)
|
|
170
220
|
const item = staticItems[itemIndex]
|
|
171
221
|
if (!item) {
|
|
172
222
|
return
|
|
173
223
|
}
|
|
224
|
+
if (!item.isExpand) {
|
|
225
|
+
return
|
|
226
|
+
}
|
|
227
|
+
const isFoldNext = $xeSplit.computeIsFoldNext
|
|
174
228
|
const itemOpts = $xeSplit.computeItemOpts
|
|
175
229
|
const allMinWidth = XEUtils.toNumber(itemOpts.minWidth)
|
|
176
230
|
const allMinHeight = XEUtils.toNumber(itemOpts.minHeight)
|
|
177
|
-
const
|
|
178
|
-
const
|
|
179
|
-
const currItemEl = item ? el.querySelector<HTMLDivElement>(`.vxe-split-item[
|
|
180
|
-
const
|
|
231
|
+
const targetItem = staticItems[itemIndex + (isFoldNext ? 1 : -1)]
|
|
232
|
+
const targetItemEl = targetItem ? el.querySelector<HTMLDivElement>(`.vxe-split-item[itemid="${targetItem.id}"]`) : null
|
|
233
|
+
const currItemEl = item ? el.querySelector<HTMLDivElement>(`.vxe-split-item[itemid="${item.id}"]`) : null
|
|
234
|
+
const targetWidth = targetItemEl ? targetItemEl.clientWidth : 0
|
|
181
235
|
const currWidth = currItemEl ? currItemEl.clientWidth : 0
|
|
182
|
-
const
|
|
236
|
+
const targetHeight = targetItemEl ? targetItemEl.clientHeight : 0
|
|
183
237
|
const currHeight = currItemEl ? currItemEl.clientHeight : 0
|
|
184
|
-
const
|
|
238
|
+
const targetMinWidth = XEUtils.toNumber(targetItem ? getGlobalDefaultConfig(targetItem.minWidth, allMinWidth) : allMinWidth)
|
|
185
239
|
const currMinWidth = XEUtils.toNumber(getGlobalDefaultConfig(item.minWidth, allMinWidth))
|
|
186
|
-
const
|
|
240
|
+
const targetMinHeight = XEUtils.toNumber(targetItem ? getGlobalDefaultConfig(targetItem.minHeight, allMinHeight) : allMinHeight)
|
|
187
241
|
const currMinHeight = XEUtils.toNumber(getGlobalDefaultConfig(item.minHeight, allMinHeight))
|
|
188
242
|
const disX = evnt.clientX
|
|
189
243
|
const disY = evnt.clientY
|
|
190
244
|
addClass(el, 'is--drag')
|
|
191
|
-
document.onmousemove = evnt => {
|
|
245
|
+
document.onmousemove = (evnt) => {
|
|
192
246
|
evnt.preventDefault()
|
|
193
247
|
if (vertical) {
|
|
194
|
-
const offsetTop = evnt.clientY - disY
|
|
248
|
+
const offsetTop = isFoldNext ? (disY - evnt.clientY) : (evnt.clientY - disY)
|
|
195
249
|
if (offsetTop > 0) {
|
|
196
|
-
if (
|
|
250
|
+
if (targetItem) {
|
|
197
251
|
if (currHeight - offsetTop >= currMinHeight) {
|
|
198
|
-
|
|
199
|
-
|
|
252
|
+
const reHeight = currHeight - offsetTop
|
|
253
|
+
targetItem.resizeHeight = targetHeight + offsetTop
|
|
254
|
+
item.resizeHeight = reHeight
|
|
255
|
+
$xeSplit.dispatchEvent('resize-drag', { item, name: item.name, offsetHeight: offsetTop, resizeHeight: reHeight, offsetWidth: 0, resizeWidth: 0 }, evnt)
|
|
200
256
|
}
|
|
201
257
|
}
|
|
202
258
|
} else {
|
|
203
|
-
if (
|
|
204
|
-
if (
|
|
205
|
-
|
|
206
|
-
|
|
259
|
+
if (targetItem) {
|
|
260
|
+
if (targetHeight + offsetTop >= targetMinHeight) {
|
|
261
|
+
const reHeight = currHeight - offsetTop
|
|
262
|
+
targetItem.resizeHeight = targetHeight + offsetTop
|
|
263
|
+
item.resizeHeight = reHeight
|
|
264
|
+
$xeSplit.dispatchEvent('resize-drag', { item, name: item.name, offsetHeight: offsetTop, resizeHeight: reHeight, offsetWidth: 0, resizeWidth: 0 }, evnt)
|
|
207
265
|
}
|
|
208
266
|
}
|
|
209
267
|
}
|
|
210
268
|
} else {
|
|
211
|
-
const offsetLeft = evnt.clientX - disX
|
|
269
|
+
const offsetLeft = isFoldNext ? (disX - evnt.clientX) : (evnt.clientX - disX)
|
|
212
270
|
if (offsetLeft > 0) {
|
|
213
|
-
if (
|
|
271
|
+
if (targetItem) {
|
|
214
272
|
if (currWidth - offsetLeft >= currMinWidth) {
|
|
215
|
-
|
|
216
|
-
|
|
273
|
+
const reWidth = currWidth - offsetLeft
|
|
274
|
+
targetItem.resizeWidth = targetWidth + offsetLeft
|
|
275
|
+
item.resizeWidth = reWidth
|
|
276
|
+
$xeSplit.dispatchEvent('resize-drag', { item, name: item.name, offsetHeight: 0, resizeHeight: 0, offsetWidth: offsetLeft, resizeWidth: reWidth }, evnt)
|
|
217
277
|
}
|
|
218
278
|
}
|
|
219
279
|
} else {
|
|
220
|
-
if (
|
|
221
|
-
if (
|
|
222
|
-
|
|
223
|
-
|
|
280
|
+
if (targetItem) {
|
|
281
|
+
if (targetWidth + offsetLeft >= targetMinWidth) {
|
|
282
|
+
const reWidth = currWidth - offsetLeft
|
|
283
|
+
targetItem.resizeWidth = targetWidth + offsetLeft
|
|
284
|
+
item.resizeWidth = reWidth
|
|
285
|
+
$xeSplit.dispatchEvent('resize-drag', { item, name: item.name, offsetHeight: 0, resizeHeight: 0, offsetWidth: offsetLeft, resizeWidth: reWidth }, evnt)
|
|
224
286
|
}
|
|
225
287
|
}
|
|
226
288
|
}
|
|
227
289
|
}
|
|
228
290
|
}
|
|
229
|
-
document.onmouseup = () => {
|
|
291
|
+
document.onmouseup = (evnt: MouseEvent) => {
|
|
230
292
|
document.onmousemove = null
|
|
231
293
|
document.onmouseup = null
|
|
232
294
|
removeClass(el, 'is--drag')
|
|
295
|
+
$xeSplit.dispatchEvent('resize-end', { item, name: item.name, resizeHeight: item.resizeHeight, resizeWidth: item.resizeWidth }, evnt)
|
|
296
|
+
$xeSplit.recalculate()
|
|
297
|
+
}
|
|
298
|
+
$xeSplit.dispatchEvent('resize-start', { item, name: item.name }, evnt)
|
|
299
|
+
},
|
|
300
|
+
handleItemActionEvent (evnt: MouseEvent) {
|
|
301
|
+
const $xeSplit = this
|
|
302
|
+
const props = $xeSplit
|
|
303
|
+
const reactData = $xeSplit.reactData
|
|
304
|
+
|
|
305
|
+
const el = $xeSplit.$refs.refElem as HTMLDivElement
|
|
306
|
+
if (!el) {
|
|
307
|
+
return
|
|
308
|
+
}
|
|
309
|
+
const { vertical } = props
|
|
310
|
+
const { staticItems } = reactData
|
|
311
|
+
const isFoldNext = $xeSplit.computeIsFoldNext
|
|
312
|
+
const btnEl = evnt.currentTarget as HTMLDivElement
|
|
313
|
+
const handleEl = btnEl.parentElement as HTMLDivElement
|
|
314
|
+
const itemId = handleEl.getAttribute('itemid')
|
|
315
|
+
const itemIndex = XEUtils.findIndexOf(staticItems, item => item.id === itemId)
|
|
316
|
+
const item = staticItems[itemIndex]
|
|
317
|
+
const targetItem = staticItems[itemIndex + (isFoldNext ? 1 : -1)]
|
|
318
|
+
if (item) {
|
|
319
|
+
const { showAction, isExpand } = item
|
|
320
|
+
if (showAction) {
|
|
321
|
+
if (vertical) {
|
|
322
|
+
if (targetItem) {
|
|
323
|
+
targetItem.isVisible = !isExpand
|
|
324
|
+
targetItem.foldHeight = 0
|
|
325
|
+
item.isExpand = !isExpand
|
|
326
|
+
item.isVisible = true
|
|
327
|
+
item.foldHeight = isExpand ? (targetItem.resizeHeight || targetItem.renderHeight) + (item.resizeHeight || item.renderHeight) : 0
|
|
328
|
+
}
|
|
329
|
+
} else {
|
|
330
|
+
if (targetItem) {
|
|
331
|
+
targetItem.isVisible = !isExpand
|
|
332
|
+
targetItem.foldWidth = 0
|
|
333
|
+
item.isExpand = !isExpand
|
|
334
|
+
item.isVisible = true
|
|
335
|
+
item.foldWidth = isExpand ? (targetItem.resizeWidth || targetItem.renderWidth) + (item.resizeWidth || item.renderWidth) : 0
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
$xeSplit.dispatchEvent(evnt.type === 'dblclick' ? 'action-dblclick' : 'action-click', { item, name: item.name, targetItem, targetName: targetItem ? targetItem.name : '', expanded: item.isExpand }, evnt)
|
|
339
|
+
$xeSplit.recalculate()
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
handleGlobalResizeEvent () {
|
|
344
|
+
const $xeSplit = this
|
|
345
|
+
|
|
346
|
+
$xeSplit.recalculate()
|
|
347
|
+
},
|
|
348
|
+
getDefaultActionIcon (item: VxeSplitDefines.ChunkConfig) {
|
|
349
|
+
const $xeSplit = this
|
|
350
|
+
const props = $xeSplit
|
|
351
|
+
|
|
352
|
+
const { vertical } = props
|
|
353
|
+
const { showAction, isExpand } = item
|
|
354
|
+
const isFoldNext = $xeSplit.computeIsFoldNext
|
|
355
|
+
const topIcon = 'SPLIT_TOP_ACTION'
|
|
356
|
+
const bottomIcon = 'SPLIT_BOTTOM_ACTION'
|
|
357
|
+
const leftIcon = 'SPLIT_LEFT_ACTION'
|
|
358
|
+
const rightIcon = 'SPLIT_RIGHT_ACTION'
|
|
359
|
+
if (showAction) {
|
|
360
|
+
let iconName: 'SPLIT_TOP_ACTION' | 'SPLIT_BOTTOM_ACTION' | 'SPLIT_LEFT_ACTION' | 'SPLIT_RIGHT_ACTION' | '' = ''
|
|
361
|
+
if (isFoldNext) {
|
|
362
|
+
if (vertical) {
|
|
363
|
+
iconName = isExpand ? bottomIcon : topIcon
|
|
364
|
+
} else {
|
|
365
|
+
iconName = isExpand ? rightIcon : leftIcon
|
|
366
|
+
}
|
|
367
|
+
} else {
|
|
368
|
+
if (vertical) {
|
|
369
|
+
iconName = isExpand ? topIcon : bottomIcon
|
|
370
|
+
} else {
|
|
371
|
+
iconName = isExpand ? leftIcon : rightIcon
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
if (iconName) {
|
|
375
|
+
return getIcon()[iconName]
|
|
376
|
+
}
|
|
233
377
|
}
|
|
378
|
+
return ''
|
|
234
379
|
},
|
|
235
380
|
|
|
236
381
|
//
|
|
237
382
|
// Render
|
|
238
383
|
//
|
|
384
|
+
renderHandleBar (h: CreateElement, item: VxeSplitDefines.ChunkConfig) {
|
|
385
|
+
const $xeSplit = this
|
|
386
|
+
|
|
387
|
+
const barStyle = $xeSplit.computeBarStyle
|
|
388
|
+
const actionOpts = $xeSplit.computeActionOpts
|
|
389
|
+
const isFoldNext = $xeSplit.computeIsFoldNext
|
|
390
|
+
const { id, isExpand, showAction } = item
|
|
391
|
+
|
|
392
|
+
const btnOns: {
|
|
393
|
+
click?: (evnt: MouseEvent) => void
|
|
394
|
+
dblclick?: (evnt: MouseEvent) => void
|
|
395
|
+
} = {}
|
|
396
|
+
if (actionOpts.trigger === 'dblclick') {
|
|
397
|
+
btnOns.dblclick = $xeSplit.handleItemActionEvent
|
|
398
|
+
} else {
|
|
399
|
+
btnOns.click = $xeSplit.handleItemActionEvent
|
|
400
|
+
}
|
|
401
|
+
return h('div', {
|
|
402
|
+
attrs: {
|
|
403
|
+
itemid: id
|
|
404
|
+
},
|
|
405
|
+
class: ['vxe-split-item-handle', isFoldNext ? 'to--next' : 'to--prev']
|
|
406
|
+
}, [
|
|
407
|
+
h('div', {
|
|
408
|
+
class: 'vxe-split-item-handle-bar',
|
|
409
|
+
style: barStyle,
|
|
410
|
+
on: {
|
|
411
|
+
mousedown: $xeSplit.dragEvent
|
|
412
|
+
}
|
|
413
|
+
}),
|
|
414
|
+
showAction
|
|
415
|
+
? h('span', {
|
|
416
|
+
class: 'vxe-split-item-action-btn',
|
|
417
|
+
on: btnOns
|
|
418
|
+
}, [
|
|
419
|
+
h('i', {
|
|
420
|
+
class: (isExpand ? actionOpts.openIcon : actionOpts.closeIcon) || $xeSplit.getDefaultActionIcon(item)
|
|
421
|
+
})
|
|
422
|
+
])
|
|
423
|
+
: renderEmptyElement($xeSplit)
|
|
424
|
+
])
|
|
425
|
+
},
|
|
239
426
|
renderItems (h: CreateElement) {
|
|
240
427
|
const $xeSplit = this
|
|
241
428
|
const props = $xeSplit
|
|
@@ -243,56 +430,52 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
243
430
|
|
|
244
431
|
const { border, padding, vertical } = props
|
|
245
432
|
const { staticItems } = reactData
|
|
433
|
+
const isFoldNext = $xeSplit.computeIsFoldNext
|
|
246
434
|
const itemVNs: VNode[] = []
|
|
247
435
|
staticItems.forEach((item, index) => {
|
|
248
|
-
const { id, slots, renderHeight, renderWidth } = item
|
|
436
|
+
const { id, slots, renderHeight, resizeHeight, foldHeight, renderWidth, resizeWidth, foldWidth, isVisible, isExpand } = item
|
|
249
437
|
const defaultSlot = slots ? slots.default : null
|
|
250
438
|
const stys: Record<string, string | number> = {}
|
|
439
|
+
const itemWidth = isVisible ? (foldWidth || resizeWidth || renderWidth) : 0
|
|
440
|
+
const itemHeight = isVisible ? (foldHeight || resizeHeight || renderHeight) : 0
|
|
251
441
|
if (vertical) {
|
|
252
|
-
if (
|
|
253
|
-
stys.height = toCssUnit(
|
|
442
|
+
if (itemHeight) {
|
|
443
|
+
stys.height = toCssUnit(itemHeight)
|
|
254
444
|
}
|
|
255
445
|
} else {
|
|
256
|
-
if (
|
|
257
|
-
stys.width = toCssUnit(
|
|
446
|
+
if (itemWidth) {
|
|
447
|
+
stys.width = toCssUnit(itemWidth)
|
|
258
448
|
}
|
|
259
449
|
}
|
|
260
450
|
itemVNs.push(
|
|
261
451
|
h('div', {
|
|
262
452
|
attrs: {
|
|
263
|
-
|
|
453
|
+
itemid: id
|
|
264
454
|
},
|
|
265
455
|
class: ['vxe-split-item', vertical ? 'is--vertical' : 'is--horizontal', {
|
|
266
456
|
'is--padding': padding,
|
|
267
457
|
'is--border': border,
|
|
268
|
-
'is--height':
|
|
269
|
-
'is--width':
|
|
270
|
-
'is--fill': !
|
|
271
|
-
'is--handle': index > 0
|
|
458
|
+
'is--height': itemHeight,
|
|
459
|
+
'is--width': itemWidth,
|
|
460
|
+
'is--fill': isVisible && !itemHeight && !itemWidth,
|
|
461
|
+
'is--handle': index > 0,
|
|
462
|
+
'is--expand': isExpand,
|
|
463
|
+
'is--hidden': !isVisible
|
|
272
464
|
}],
|
|
273
465
|
style: stys
|
|
274
466
|
}, [
|
|
275
|
-
index
|
|
276
|
-
? h('div', {
|
|
277
|
-
attrs: {
|
|
278
|
-
xid: id
|
|
279
|
-
},
|
|
280
|
-
class: 'vxe-split-item-handle',
|
|
281
|
-
on: {
|
|
282
|
-
mousedown: $xeSplit.dragEvent
|
|
283
|
-
}
|
|
284
|
-
})
|
|
285
|
-
: renderEmptyElement($xeSplit),
|
|
467
|
+
index && !isFoldNext ? $xeSplit.renderHandleBar(h, item) : renderEmptyElement($xeSplit),
|
|
286
468
|
h('div', {
|
|
287
469
|
attrs: {
|
|
288
|
-
|
|
470
|
+
itemid: id
|
|
289
471
|
},
|
|
290
472
|
class: 'vxe-split-item--wrapper'
|
|
291
473
|
}, [
|
|
292
474
|
h('div', {
|
|
293
475
|
class: 'vxe-split-item--inner'
|
|
294
476
|
}, defaultSlot ? $xeSplit.callSlot(defaultSlot, { }) : [])
|
|
295
|
-
])
|
|
477
|
+
]),
|
|
478
|
+
isFoldNext && index < staticItems.length - 1 ? $xeSplit.renderHandleBar(h, item) : renderEmptyElement($xeSplit)
|
|
296
479
|
])
|
|
297
480
|
)
|
|
298
481
|
})
|
|
@@ -326,6 +509,23 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
326
509
|
])
|
|
327
510
|
}
|
|
328
511
|
},
|
|
512
|
+
created () {
|
|
513
|
+
const $xeSplit = this
|
|
514
|
+
|
|
515
|
+
globalEvents.on($xeSplit, 'resize', $xeSplit.handleGlobalResizeEvent)
|
|
516
|
+
},
|
|
517
|
+
mounted () {
|
|
518
|
+
const $xeSplit = this
|
|
519
|
+
|
|
520
|
+
$xeSplit.$nextTick(() => {
|
|
521
|
+
$xeSplit.recalculate()
|
|
522
|
+
})
|
|
523
|
+
},
|
|
524
|
+
beforeDestroy () {
|
|
525
|
+
const $xeSplit = this
|
|
526
|
+
|
|
527
|
+
globalEvents.off($xeSplit, 'resize')
|
|
528
|
+
},
|
|
329
529
|
render (this: any, h) {
|
|
330
530
|
return this.renderVN(h)
|
|
331
531
|
}
|
package/packages/ui/index.ts
CHANGED
|
@@ -562,7 +562,13 @@ setIcon({
|
|
|
562
562
|
|
|
563
563
|
// color-picker
|
|
564
564
|
COLOR_COPY: iconPrefix + 'copy',
|
|
565
|
-
EYE_DROPPER: iconPrefix + 'dropper'
|
|
565
|
+
EYE_DROPPER: iconPrefix + 'dropper',
|
|
566
|
+
|
|
567
|
+
// split
|
|
568
|
+
SPLIT_TOP_ACTION: iconPrefix + 'arrow-up',
|
|
569
|
+
SPLIT_BOTTOM_ACTION: iconPrefix + 'arrow-down',
|
|
570
|
+
SPLIT_LEFT_ACTION: iconPrefix + 'arrow-left',
|
|
571
|
+
SPLIT_RIGHT_ACTION: iconPrefix + 'arrow-right'
|
|
566
572
|
})
|
|
567
573
|
|
|
568
574
|
export * from '@vxe-ui/core'
|
package/packages/ui/src/dom.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@use "sass:list";
|
|
2
|
+
@use '../helpers/baseMixin.scss';
|
|
2
3
|
|
|
3
4
|
.vxe-split {
|
|
4
5
|
&.is--vertical {
|
|
@@ -41,15 +42,9 @@
|
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
.vxe-split-item-handle {
|
|
45
|
+
position: relative;
|
|
44
46
|
flex-shrink: 0;
|
|
45
|
-
background-color: var(--vxe-split-handle-bar-background-color);
|
|
46
47
|
user-select: none;
|
|
47
|
-
&:hover {
|
|
48
|
-
background-color: var(--vxe-ui-font-primary-lighten-color);
|
|
49
|
-
}
|
|
50
|
-
&:active {
|
|
51
|
-
background-color: var(--vxe-ui-font-primary-darken-color);
|
|
52
|
-
}
|
|
53
48
|
}
|
|
54
49
|
|
|
55
50
|
.vxe-split-item--wrapper {
|
|
@@ -57,20 +52,35 @@
|
|
|
57
52
|
word-break: break-word;
|
|
58
53
|
overflow: hidden;
|
|
59
54
|
flex-grow: 1;
|
|
60
|
-
& > .vxe-split {
|
|
61
|
-
height: 100%;
|
|
62
|
-
}
|
|
63
55
|
}
|
|
64
56
|
.vxe-split-item--inner {
|
|
65
57
|
height: 100%;
|
|
66
58
|
width: 100%;
|
|
67
59
|
overflow: auto;
|
|
60
|
+
& > .vxe-split {
|
|
61
|
+
height: 100%;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
.vxe-split-item-handle-bar {
|
|
65
|
+
background-color: var(--vxe-split-handle-bar-background-color);
|
|
66
|
+
}
|
|
67
|
+
.vxe-split-item-action-btn {
|
|
68
|
+
display: block;
|
|
69
|
+
position: absolute;
|
|
70
|
+
z-index: 2;
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
background-color: var(--vxe-ui-layout-background-color);
|
|
73
|
+
border: 1px solid var(--vxe-ui-input-border-color);
|
|
74
|
+
@include baseMixin.createAnimationTransition(transform, 0.1s);
|
|
68
75
|
}
|
|
69
76
|
|
|
70
77
|
.vxe-split-item {
|
|
71
78
|
display: flex;
|
|
72
79
|
position: relative;
|
|
73
|
-
overflow:
|
|
80
|
+
overflow: hidden;
|
|
81
|
+
&.is--hidden {
|
|
82
|
+
width: 0;
|
|
83
|
+
}
|
|
74
84
|
&.is--padding {
|
|
75
85
|
& > .vxe-split-item--wrapper {
|
|
76
86
|
padding: var(--vxe-ui-layout-padding-default);
|
|
@@ -89,11 +99,61 @@
|
|
|
89
99
|
border: 1px solid var(--vxe-ui-base-popup-border-color);
|
|
90
100
|
}
|
|
91
101
|
}
|
|
102
|
+
&.is--expand {
|
|
103
|
+
&.is--horizontal {
|
|
104
|
+
& > .vxe-split-item-handle {
|
|
105
|
+
.vxe-split-item-handle-bar {
|
|
106
|
+
cursor: w-resize;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
&.is--vertical {
|
|
111
|
+
& > .vxe-split-item-handle {
|
|
112
|
+
.vxe-split-item-handle-bar {
|
|
113
|
+
cursor: n-resize;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
& > .vxe-split-item-handle {
|
|
118
|
+
& > .vxe-split-item-handle-bar {
|
|
119
|
+
background-color: var(--vxe-split-handle-bar-background-color);
|
|
120
|
+
&:hover {
|
|
121
|
+
background-color: var(--vxe-ui-font-primary-lighten-color);
|
|
122
|
+
}
|
|
123
|
+
&:active {
|
|
124
|
+
background-color: var(--vxe-ui-font-primary-darken-color);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
92
129
|
&.is--horizontal {
|
|
93
130
|
flex-direction: row;
|
|
94
131
|
& > .vxe-split-item-handle {
|
|
95
|
-
|
|
96
|
-
|
|
132
|
+
&.to--prev {
|
|
133
|
+
.vxe-split-item-action-btn {
|
|
134
|
+
left: 0;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
&.to--next {
|
|
138
|
+
.vxe-split-item-action-btn {
|
|
139
|
+
right: 0;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
.vxe-split-item-handle-bar {
|
|
143
|
+
width: var(--vxe-split-handle-bar-width);
|
|
144
|
+
height: 100%;
|
|
145
|
+
}
|
|
146
|
+
.vxe-split-item-action-btn {
|
|
147
|
+
top: 50%;
|
|
148
|
+
transform: translateY(-50%);
|
|
149
|
+
padding: 1em 0;
|
|
150
|
+
&:hover {
|
|
151
|
+
color: var(--vxe-ui-font-primary-color);
|
|
152
|
+
}
|
|
153
|
+
&:active {
|
|
154
|
+
transform: translateY(-50%) scale(0.9);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
97
157
|
}
|
|
98
158
|
&.is--border {
|
|
99
159
|
& > .vxe-split-item-handle {
|
|
@@ -104,8 +164,31 @@
|
|
|
104
164
|
&.is--vertical {
|
|
105
165
|
flex-direction: column;
|
|
106
166
|
& > .vxe-split-item-handle {
|
|
107
|
-
|
|
108
|
-
|
|
167
|
+
&.to--prev {
|
|
168
|
+
.vxe-split-item-action-btn {
|
|
169
|
+
top: 0;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
&.to--next {
|
|
173
|
+
.vxe-split-item-action-btn {
|
|
174
|
+
bottom: 0;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
.vxe-split-item-handle-bar {
|
|
178
|
+
height: var(--vxe-split-handle-bar-height);
|
|
179
|
+
width: 100%;
|
|
180
|
+
}
|
|
181
|
+
.vxe-split-item-action-btn {
|
|
182
|
+
left: 50%;
|
|
183
|
+
transform: translateX(-50%);
|
|
184
|
+
padding: 0 1em;
|
|
185
|
+
&:hover {
|
|
186
|
+
color: var(--vxe-ui-font-primary-color);
|
|
187
|
+
}
|
|
188
|
+
&:active {
|
|
189
|
+
transform: translateX(-50%) scale(0.9);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
109
192
|
}
|
|
110
193
|
&.is--border {
|
|
111
194
|
& > .vxe-split-item-handle {
|
|
@@ -16,17 +16,21 @@ export interface SplitItemPrivateRef {
|
|
|
16
16
|
export interface VxeSplitItemPrivateRef extends SplitItemPrivateRef { }
|
|
17
17
|
|
|
18
18
|
export namespace VxeSplitItemPropTypes {
|
|
19
|
+
export type Name = string | number
|
|
19
20
|
export type Width = string | number
|
|
20
21
|
export type Height = string | number
|
|
21
22
|
export type MinWidth = string | number
|
|
22
23
|
export type MinHeight = string | number
|
|
24
|
+
export type ShowAction = boolean
|
|
23
25
|
}
|
|
24
26
|
|
|
25
|
-
export
|
|
27
|
+
export interface VxeSplitItemProps {
|
|
28
|
+
name?: VxeSplitItemPropTypes.Name
|
|
26
29
|
width?: VxeSplitItemPropTypes.Width
|
|
27
30
|
height?: VxeSplitItemPropTypes.Height
|
|
28
31
|
minWidth?: VxeSplitItemPropTypes.MinWidth
|
|
29
32
|
minHeight?: VxeSplitItemPropTypes.MinHeight
|
|
33
|
+
showAction?: VxeSplitItemPropTypes.ShowAction
|
|
30
34
|
|
|
31
35
|
slots?: {
|
|
32
36
|
default?: string | ((params: VxeSplitItemSlotTypes.DefaultSlotParams) => VxeComponentSlotType | VxeComponentSlotType[])
|