vxe-pc-ui 4.5.2 → 4.5.3
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 +210 -52
- package/es/split/style.css +74 -14
- 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 +6 -1
- package/es/ui/src/dom.js +0 -1
- package/es/vxe-split/style.css +74 -14
- 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 +284 -51
- 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 +257 -47
- package/lib/split/src/split.min.js +1 -1
- package/lib/split/style/style.css +74 -14
- 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 +6 -1
- 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/vxe-split/style/style.css +74 -14
- 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 +220 -51
- package/packages/ui/index.ts +7 -1
- package/packages/ui/src/dom.ts +0 -2
- package/styles/components/split.scss +97 -14
- package/types/components/split-item.d.ts +5 -1
- package/types/components/split.d.ts +86 -1
- package/types/ui/global-icon.d.ts +6 -0
- /package/es/icon/{iconfont.1743056531953.ttf → iconfont.1743080348682.ttf} +0 -0
- /package/es/icon/{iconfont.1743056531953.woff → iconfont.1743080348682.woff} +0 -0
- /package/es/icon/{iconfont.1743056531953.woff2 → iconfont.1743080348682.woff2} +0 -0
- /package/es/{iconfont.1743056531953.ttf → iconfont.1743080348682.ttf} +0 -0
- /package/es/{iconfont.1743056531953.woff → iconfont.1743080348682.woff} +0 -0
- /package/es/{iconfont.1743056531953.woff2 → iconfont.1743080348682.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1743056531953.ttf → iconfont.1743080348682.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1743056531953.woff → iconfont.1743080348682.woff} +0 -0
- /package/lib/icon/style/{iconfont.1743056531953.woff2 → iconfont.1743080348682.woff2} +0 -0
- /package/lib/{iconfont.1743056531953.ttf → iconfont.1743080348682.ttf} +0 -0
- /package/lib/{iconfont.1743056531953.woff → iconfont.1743080348682.woff} +0 -0
- /package/lib/{iconfont.1743056531953.woff2 → iconfont.1743080348682.woff2} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent, PropType, ref, h, reactive, provide, VNode, computed, watch, nextTick, onMounted, onActivated } from 'vue'
|
|
2
|
-
import { getConfig, createEvent, renderEmptyElement } from '../../ui'
|
|
1
|
+
import { defineComponent, PropType, ref, h, reactive, provide, VNode, 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'
|
|
@@ -24,9 +24,16 @@ export default defineComponent({
|
|
|
24
24
|
type: Boolean as PropType<VxeSplitPropTypes.Padding>,
|
|
25
25
|
default: () => getConfig().split.padding
|
|
26
26
|
},
|
|
27
|
-
itemConfig: Object as PropType<VxeSplitPropTypes.ItemConfig
|
|
27
|
+
itemConfig: Object as PropType<VxeSplitPropTypes.ItemConfig>,
|
|
28
|
+
barConfig: Object as PropType<VxeSplitPropTypes.BarConfig>,
|
|
29
|
+
actionConfig: Object as PropType<VxeSplitPropTypes.ActionConfig>
|
|
28
30
|
},
|
|
29
31
|
emits: [
|
|
32
|
+
'action-dblclick',
|
|
33
|
+
'action-click',
|
|
34
|
+
'resize-start',
|
|
35
|
+
'resize-drag',
|
|
36
|
+
'resize-end'
|
|
30
37
|
] as VxeSplitEmits,
|
|
31
38
|
setup (props, context) {
|
|
32
39
|
const { emit, slots } = context
|
|
@@ -46,8 +53,37 @@ export default defineComponent({
|
|
|
46
53
|
return Object.assign({}, getConfig().split.itemConfig, props.itemConfig)
|
|
47
54
|
})
|
|
48
55
|
|
|
56
|
+
const computeBarOpts = computed(() => {
|
|
57
|
+
return Object.assign({}, getConfig().split.barConfig, props.barConfig)
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
const computeActionOpts = computed(() => {
|
|
61
|
+
return Object.assign({}, getConfig().split.actionConfig, props.actionConfig)
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
const computeIsFoldNext = computed(() => {
|
|
65
|
+
const actionOpts = computeActionOpts.value
|
|
66
|
+
return actionOpts.direction === 'next'
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
const computeBarStyle = computed(() => {
|
|
70
|
+
const barOpts = computeBarOpts.value
|
|
71
|
+
const { width, height } = barOpts
|
|
72
|
+
const stys: Record<string, string | number> = {}
|
|
73
|
+
if (height) {
|
|
74
|
+
stys.height = toCssUnit(height)
|
|
75
|
+
}
|
|
76
|
+
if (width) {
|
|
77
|
+
stys.width = toCssUnit(width)
|
|
78
|
+
}
|
|
79
|
+
return stys
|
|
80
|
+
})
|
|
81
|
+
|
|
49
82
|
const computeMaps: VxeSplitPrivateComputed = {
|
|
50
|
-
computeItemOpts
|
|
83
|
+
computeItemOpts,
|
|
84
|
+
computeBarOpts,
|
|
85
|
+
computeActionOpts,
|
|
86
|
+
computeIsFoldNext
|
|
51
87
|
}
|
|
52
88
|
|
|
53
89
|
const refMaps: SplitPrivateRef = {
|
|
@@ -81,6 +117,36 @@ export default defineComponent({
|
|
|
81
117
|
return []
|
|
82
118
|
}
|
|
83
119
|
|
|
120
|
+
const getDefaultActionIcon = (item: VxeSplitDefines.ChunkConfig) => {
|
|
121
|
+
const { vertical } = props
|
|
122
|
+
const { showAction, isExpand } = item
|
|
123
|
+
const isFoldNext = computeIsFoldNext.value
|
|
124
|
+
const topIcon = 'SPLIT_TOP_ACTION'
|
|
125
|
+
const bottomIcon = 'SPLIT_BOTTOM_ACTION'
|
|
126
|
+
const leftIcon = 'SPLIT_LEFT_ACTION'
|
|
127
|
+
const rightIcon = 'SPLIT_RIGHT_ACTION'
|
|
128
|
+
if (showAction) {
|
|
129
|
+
let iconName: 'SPLIT_TOP_ACTION' | 'SPLIT_BOTTOM_ACTION' | 'SPLIT_LEFT_ACTION' | 'SPLIT_RIGHT_ACTION' | '' = ''
|
|
130
|
+
if (isFoldNext) {
|
|
131
|
+
if (vertical) {
|
|
132
|
+
iconName = isExpand ? bottomIcon : topIcon
|
|
133
|
+
} else {
|
|
134
|
+
iconName = isExpand ? rightIcon : leftIcon
|
|
135
|
+
}
|
|
136
|
+
} else {
|
|
137
|
+
if (vertical) {
|
|
138
|
+
iconName = isExpand ? topIcon : bottomIcon
|
|
139
|
+
} else {
|
|
140
|
+
iconName = isExpand ? leftIcon : rightIcon
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (iconName) {
|
|
144
|
+
return getIcon()[iconName]
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return ''
|
|
148
|
+
}
|
|
149
|
+
|
|
84
150
|
const recalculate = () => {
|
|
85
151
|
return nextTick().then(() => {
|
|
86
152
|
const { vertical } = props
|
|
@@ -152,77 +218,135 @@ export default defineComponent({
|
|
|
152
218
|
evnt.preventDefault()
|
|
153
219
|
const { vertical } = props
|
|
154
220
|
const { staticItems } = reactData
|
|
155
|
-
const
|
|
221
|
+
const barEl = evnt.currentTarget as HTMLDivElement
|
|
222
|
+
const handleEl = barEl.parentElement as HTMLDivElement
|
|
156
223
|
const el = refElem.value
|
|
157
224
|
if (!el) {
|
|
158
225
|
return
|
|
159
226
|
}
|
|
160
|
-
const itemId = handleEl.getAttribute('
|
|
227
|
+
const itemId = handleEl.getAttribute('itemid')
|
|
161
228
|
const itemIndex = XEUtils.findIndexOf(staticItems, item => item.id === itemId)
|
|
162
229
|
const item = staticItems[itemIndex]
|
|
163
230
|
if (!item) {
|
|
164
231
|
return
|
|
165
232
|
}
|
|
233
|
+
if (!item.isExpand) {
|
|
234
|
+
return
|
|
235
|
+
}
|
|
236
|
+
const isFoldNext = computeIsFoldNext.value
|
|
166
237
|
const itemOpts = computeItemOpts.value
|
|
167
238
|
const allMinWidth = XEUtils.toNumber(itemOpts.minWidth)
|
|
168
239
|
const allMinHeight = XEUtils.toNumber(itemOpts.minHeight)
|
|
169
|
-
const
|
|
170
|
-
const
|
|
171
|
-
const currItemEl = item ? el.querySelector<HTMLDivElement>(`.vxe-split-item[
|
|
172
|
-
const
|
|
240
|
+
const targetItem = staticItems[itemIndex + (isFoldNext ? 1 : -1)]
|
|
241
|
+
const targetItemEl = targetItem ? el.querySelector<HTMLDivElement>(`.vxe-split-item[itemid="${targetItem.id}"]`) : null
|
|
242
|
+
const currItemEl = item ? el.querySelector<HTMLDivElement>(`.vxe-split-item[itemid="${item.id}"]`) : null
|
|
243
|
+
const targetWidth = targetItemEl ? targetItemEl.clientWidth : 0
|
|
173
244
|
const currWidth = currItemEl ? currItemEl.clientWidth : 0
|
|
174
|
-
const
|
|
245
|
+
const targetHeight = targetItemEl ? targetItemEl.clientHeight : 0
|
|
175
246
|
const currHeight = currItemEl ? currItemEl.clientHeight : 0
|
|
176
|
-
const
|
|
247
|
+
const targetMinWidth = XEUtils.toNumber(targetItem ? getGlobalDefaultConfig(targetItem.minWidth, allMinWidth) : allMinWidth)
|
|
177
248
|
const currMinWidth = XEUtils.toNumber(getGlobalDefaultConfig(item.minWidth, allMinWidth))
|
|
178
|
-
const
|
|
249
|
+
const targetMinHeight = XEUtils.toNumber(targetItem ? getGlobalDefaultConfig(targetItem.minHeight, allMinHeight) : allMinHeight)
|
|
179
250
|
const currMinHeight = XEUtils.toNumber(getGlobalDefaultConfig(item.minHeight, allMinHeight))
|
|
180
251
|
const disX = evnt.clientX
|
|
181
252
|
const disY = evnt.clientY
|
|
182
253
|
addClass(el, 'is--drag')
|
|
183
|
-
document.onmousemove = evnt => {
|
|
254
|
+
document.onmousemove = (evnt) => {
|
|
184
255
|
evnt.preventDefault()
|
|
185
256
|
if (vertical) {
|
|
186
|
-
const offsetTop = evnt.clientY - disY
|
|
257
|
+
const offsetTop = isFoldNext ? (disY - evnt.clientY) : (evnt.clientY - disY)
|
|
187
258
|
if (offsetTop > 0) {
|
|
188
|
-
if (
|
|
259
|
+
if (targetItem) {
|
|
189
260
|
if (currHeight - offsetTop >= currMinHeight) {
|
|
190
|
-
|
|
191
|
-
|
|
261
|
+
const reHeight = currHeight - offsetTop
|
|
262
|
+
targetItem.resizeHeight = targetHeight + offsetTop
|
|
263
|
+
item.resizeHeight = reHeight
|
|
264
|
+
dispatchEvent('resize-drag', { item, name: item.name, offsetHeight: offsetTop, resizeHeight: reHeight, offsetWidth: 0, resizeWidth: 0 }, evnt)
|
|
192
265
|
}
|
|
193
266
|
}
|
|
194
267
|
} else {
|
|
195
|
-
if (
|
|
196
|
-
if (
|
|
197
|
-
|
|
198
|
-
|
|
268
|
+
if (targetItem) {
|
|
269
|
+
if (targetHeight + offsetTop >= targetMinHeight) {
|
|
270
|
+
const reHeight = currHeight - offsetTop
|
|
271
|
+
targetItem.resizeHeight = targetHeight + offsetTop
|
|
272
|
+
item.resizeHeight = reHeight
|
|
273
|
+
dispatchEvent('resize-drag', { item, name: item.name, offsetHeight: offsetTop, resizeHeight: reHeight, offsetWidth: 0, resizeWidth: 0 }, evnt)
|
|
199
274
|
}
|
|
200
275
|
}
|
|
201
276
|
}
|
|
202
277
|
} else {
|
|
203
|
-
const offsetLeft = evnt.clientX - disX
|
|
278
|
+
const offsetLeft = isFoldNext ? (disX - evnt.clientX) : (evnt.clientX - disX)
|
|
204
279
|
if (offsetLeft > 0) {
|
|
205
|
-
if (
|
|
280
|
+
if (targetItem) {
|
|
206
281
|
if (currWidth - offsetLeft >= currMinWidth) {
|
|
207
|
-
|
|
208
|
-
|
|
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)
|
|
209
286
|
}
|
|
210
287
|
}
|
|
211
288
|
} else {
|
|
212
|
-
if (
|
|
213
|
-
if (
|
|
214
|
-
|
|
215
|
-
|
|
289
|
+
if (targetItem) {
|
|
290
|
+
if (targetWidth + offsetLeft >= targetMinWidth) {
|
|
291
|
+
const reWidth = currWidth - offsetLeft
|
|
292
|
+
targetItem.resizeWidth = targetWidth + offsetLeft
|
|
293
|
+
item.resizeWidth = reWidth
|
|
294
|
+
dispatchEvent('resize-drag', { item, name: item.name, offsetHeight: 0, resizeHeight: 0, offsetWidth: offsetLeft, resizeWidth: reWidth }, evnt)
|
|
216
295
|
}
|
|
217
296
|
}
|
|
218
297
|
}
|
|
219
298
|
}
|
|
220
299
|
}
|
|
221
|
-
document.onmouseup = () => {
|
|
300
|
+
document.onmouseup = (evnt: MouseEvent) => {
|
|
222
301
|
document.onmousemove = null
|
|
223
302
|
document.onmouseup = null
|
|
224
303
|
removeClass(el, 'is--drag')
|
|
304
|
+
dispatchEvent('resize-end', { item, name: item.name, resizeHeight: item.resizeHeight, resizeWidth: item.resizeWidth }, evnt)
|
|
225
305
|
}
|
|
306
|
+
dispatchEvent('resize-start', { item, name: item.name }, evnt)
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
const handleItemActionEvent = (evnt: MouseEvent) => {
|
|
310
|
+
const el = refElem.value
|
|
311
|
+
if (!el) {
|
|
312
|
+
return
|
|
313
|
+
}
|
|
314
|
+
const { vertical } = props
|
|
315
|
+
const { staticItems } = reactData
|
|
316
|
+
const isFoldNext = computeIsFoldNext.value
|
|
317
|
+
const btnEl = evnt.currentTarget as HTMLDivElement
|
|
318
|
+
const handleEl = btnEl.parentElement as HTMLDivElement
|
|
319
|
+
const itemId = handleEl.getAttribute('itemid')
|
|
320
|
+
const itemIndex = XEUtils.findIndexOf(staticItems, item => item.id === itemId)
|
|
321
|
+
const item = staticItems[itemIndex]
|
|
322
|
+
const targetItem = staticItems[itemIndex + (isFoldNext ? 1 : -1)]
|
|
323
|
+
if (item) {
|
|
324
|
+
const { showAction, isExpand } = item
|
|
325
|
+
if (showAction) {
|
|
326
|
+
if (vertical) {
|
|
327
|
+
if (targetItem) {
|
|
328
|
+
targetItem.isVisible = !isExpand
|
|
329
|
+
targetItem.foldHeight = 0
|
|
330
|
+
item.isExpand = !isExpand
|
|
331
|
+
item.isVisible = true
|
|
332
|
+
item.foldHeight = isExpand ? (targetItem.resizeHeight || targetItem.renderHeight) + (item.resizeHeight || item.renderHeight) : 0
|
|
333
|
+
}
|
|
334
|
+
} else {
|
|
335
|
+
if (targetItem) {
|
|
336
|
+
targetItem.isVisible = !isExpand
|
|
337
|
+
targetItem.foldWidth = 0
|
|
338
|
+
item.isExpand = !isExpand
|
|
339
|
+
item.isVisible = true
|
|
340
|
+
item.foldWidth = isExpand ? (targetItem.resizeWidth || targetItem.renderWidth) + (item.resizeWidth || item.renderWidth) : 0
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
dispatchEvent(evnt.type === 'dblclick' ? 'action-dblclick' : 'action-click', { item, name: item.name, targetItem, targetName: targetItem ? targetItem.name : '', expanded: item.isExpand }, evnt)
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
const handleGlobalResizeEvent = () => {
|
|
349
|
+
recalculate()
|
|
226
350
|
}
|
|
227
351
|
|
|
228
352
|
const splitMethods: SplitMethods = {
|
|
@@ -235,51 +359,88 @@ export default defineComponent({
|
|
|
235
359
|
|
|
236
360
|
Object.assign($xeSplit, splitMethods, splitPrivateMethods)
|
|
237
361
|
|
|
362
|
+
const renderHandleBar = (item: VxeSplitDefines.ChunkConfig) => {
|
|
363
|
+
const barStyle = computeBarStyle.value
|
|
364
|
+
const actionOpts = computeActionOpts.value
|
|
365
|
+
const isFoldNext = computeIsFoldNext.value
|
|
366
|
+
const { id, isExpand, showAction } = item
|
|
367
|
+
|
|
368
|
+
const btnOns: {
|
|
369
|
+
onClick?: (evnt: MouseEvent) => void
|
|
370
|
+
onDblclick?: (evnt: MouseEvent) => void
|
|
371
|
+
} = {}
|
|
372
|
+
if (actionOpts.trigger === 'dblclick') {
|
|
373
|
+
btnOns.onDblclick = handleItemActionEvent
|
|
374
|
+
} else {
|
|
375
|
+
btnOns.onClick = handleItemActionEvent
|
|
376
|
+
}
|
|
377
|
+
return h('div', {
|
|
378
|
+
itemid: id,
|
|
379
|
+
class: ['vxe-split-item-handle', isFoldNext ? 'to--next' : 'to--prev']
|
|
380
|
+
}, [
|
|
381
|
+
h('div', {
|
|
382
|
+
class: 'vxe-split-item-handle-bar',
|
|
383
|
+
style: barStyle,
|
|
384
|
+
onMousedown: dragEvent
|
|
385
|
+
}),
|
|
386
|
+
showAction
|
|
387
|
+
? h('span', {
|
|
388
|
+
class: 'vxe-split-item-action-btn',
|
|
389
|
+
...btnOns
|
|
390
|
+
}, [
|
|
391
|
+
h('i', {
|
|
392
|
+
class: (isExpand ? actionOpts.openIcon : actionOpts.closeIcon) || getDefaultActionIcon(item)
|
|
393
|
+
})
|
|
394
|
+
])
|
|
395
|
+
: renderEmptyElement($xeSplit)
|
|
396
|
+
])
|
|
397
|
+
}
|
|
398
|
+
|
|
238
399
|
const renderItems = () => {
|
|
239
400
|
const { border, padding, vertical } = props
|
|
240
401
|
const { staticItems } = reactData
|
|
402
|
+
const isFoldNext = computeIsFoldNext.value
|
|
241
403
|
const itemVNs: VNode[] = []
|
|
242
404
|
staticItems.forEach((item, index) => {
|
|
243
|
-
const { id, slots, renderHeight, renderWidth } = item
|
|
405
|
+
const { id, slots, renderHeight, resizeHeight, foldHeight, renderWidth, resizeWidth, foldWidth, isVisible, isExpand } = item
|
|
244
406
|
const defaultSlot = slots ? slots.default : null
|
|
245
407
|
const stys: Record<string, string | number> = {}
|
|
408
|
+
const itemWidth = isVisible ? (foldWidth || resizeWidth || renderWidth) : 0
|
|
409
|
+
const itemHeight = isVisible ? (foldHeight || resizeHeight || renderHeight) : 0
|
|
246
410
|
if (vertical) {
|
|
247
|
-
if (
|
|
248
|
-
stys.height = toCssUnit(
|
|
411
|
+
if (itemHeight) {
|
|
412
|
+
stys.height = toCssUnit(itemHeight)
|
|
249
413
|
}
|
|
250
414
|
} else {
|
|
251
|
-
if (
|
|
252
|
-
stys.width = toCssUnit(
|
|
415
|
+
if (itemWidth) {
|
|
416
|
+
stys.width = toCssUnit(itemWidth)
|
|
253
417
|
}
|
|
254
418
|
}
|
|
255
419
|
itemVNs.push(
|
|
256
420
|
h('div', {
|
|
257
|
-
|
|
421
|
+
itemid: id,
|
|
258
422
|
class: ['vxe-split-item', vertical ? 'is--vertical' : 'is--horizontal', {
|
|
259
423
|
'is--padding': padding,
|
|
260
424
|
'is--border': border,
|
|
261
|
-
'is--height':
|
|
262
|
-
'is--width':
|
|
263
|
-
'is--fill': !
|
|
264
|
-
'is--handle': index > 0
|
|
425
|
+
'is--height': itemHeight,
|
|
426
|
+
'is--width': itemWidth,
|
|
427
|
+
'is--fill': isVisible && !itemHeight && !itemWidth,
|
|
428
|
+
'is--handle': index > 0,
|
|
429
|
+
'is--expand': isExpand,
|
|
430
|
+
'is--hidden': !isVisible
|
|
265
431
|
}],
|
|
266
432
|
style: stys
|
|
267
433
|
}, [
|
|
268
|
-
index
|
|
269
|
-
? h('div', {
|
|
270
|
-
xid: id,
|
|
271
|
-
class: 'vxe-split-item-handle',
|
|
272
|
-
onMousedown: dragEvent
|
|
273
|
-
})
|
|
274
|
-
: renderEmptyElement($xeSplit),
|
|
434
|
+
index && !isFoldNext ? renderHandleBar(item) : renderEmptyElement($xeSplit),
|
|
275
435
|
h('div', {
|
|
276
|
-
|
|
436
|
+
itemid: id,
|
|
277
437
|
class: 'vxe-split-item--wrapper'
|
|
278
438
|
}, [
|
|
279
439
|
h('div', {
|
|
280
440
|
class: 'vxe-split-item--inner'
|
|
281
441
|
}, defaultSlot ? callSlot(defaultSlot, { }) : [])
|
|
282
|
-
])
|
|
442
|
+
]),
|
|
443
|
+
isFoldNext && index < staticItems.length - 1 ? renderHandleBar(item) : renderEmptyElement($xeSplit)
|
|
283
444
|
])
|
|
284
445
|
)
|
|
285
446
|
})
|
|
@@ -315,7 +476,15 @@ export default defineComponent({
|
|
|
315
476
|
})
|
|
316
477
|
|
|
317
478
|
onMounted(() => {
|
|
318
|
-
|
|
479
|
+
nextTick(() => {
|
|
480
|
+
recalculate()
|
|
481
|
+
})
|
|
482
|
+
|
|
483
|
+
globalEvents.on($xeSplit, 'resize', handleGlobalResizeEvent)
|
|
484
|
+
})
|
|
485
|
+
|
|
486
|
+
onUnmounted(() => {
|
|
487
|
+
globalEvents.off($xeSplit, 'resize')
|
|
319
488
|
})
|
|
320
489
|
|
|
321
490
|
onActivated(() => {
|
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
80
|
overflow: auto;
|
|
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 {
|
|
@@ -23,17 +23,21 @@ export interface SplitItemPrivateRef {
|
|
|
23
23
|
export interface VxeSplitItemPrivateRef extends SplitItemPrivateRef { }
|
|
24
24
|
|
|
25
25
|
export namespace VxeSplitItemPropTypes {
|
|
26
|
+
export type Name = string | number
|
|
26
27
|
export type Width = string | number
|
|
27
28
|
export type Height = string | number
|
|
28
29
|
export type MinWidth = string | number
|
|
29
30
|
export type MinHeight = string | number
|
|
31
|
+
export type ShowAction = boolean
|
|
30
32
|
}
|
|
31
33
|
|
|
32
|
-
export
|
|
34
|
+
export interface VxeSplitItemProps {
|
|
35
|
+
name?: VxeSplitItemPropTypes.Name
|
|
33
36
|
width?: VxeSplitItemPropTypes.Width
|
|
34
37
|
height?: VxeSplitItemPropTypes.Height
|
|
35
38
|
minWidth?: VxeSplitItemPropTypes.MinWidth
|
|
36
39
|
minHeight?: VxeSplitItemPropTypes.MinHeight
|
|
40
|
+
showAction?: VxeSplitItemPropTypes.ShowAction
|
|
37
41
|
|
|
38
42
|
slots?: {
|
|
39
43
|
default?: string | ((params: VxeSplitItemSlotTypes.DefaultSlotParams) => VxeComponentSlotType | VxeComponentSlotType[])
|