vxe-pc-ui 4.5.1 → 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/README.md +2 -0
- 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 +220 -53
- package/es/split/style.css +82 -13
- 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 +82 -13
- 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 +294 -53
- 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 +265 -47
- package/lib/split/src/split.min.js +1 -1
- package/lib/split/style/style.css +82 -13
- 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 +82 -13
- 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 +230 -52
- package/packages/ui/index.ts +7 -1
- package/packages/ui/src/dom.ts +0 -2
- package/styles/components/split.scss +105 -12
- package/types/components/split-item.d.ts +5 -1
- package/types/components/split.d.ts +88 -1
- package/types/ui/global-icon.d.ts +6 -0
- /package/es/icon/{iconfont.1743051559265.ttf → iconfont.1743080348682.ttf} +0 -0
- /package/es/icon/{iconfont.1743051559265.woff → iconfont.1743080348682.woff} +0 -0
- /package/es/icon/{iconfont.1743051559265.woff2 → iconfont.1743080348682.woff2} +0 -0
- /package/es/{iconfont.1743051559265.ttf → iconfont.1743080348682.ttf} +0 -0
- /package/es/{iconfont.1743051559265.woff → iconfont.1743080348682.woff} +0 -0
- /package/es/{iconfont.1743051559265.woff2 → iconfont.1743080348682.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1743051559265.ttf → iconfont.1743080348682.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1743051559265.woff → iconfont.1743080348682.woff} +0 -0
- /package/lib/icon/style/{iconfont.1743051559265.woff2 → iconfont.1743080348682.woff2} +0 -0
- /package/lib/{iconfont.1743051559265.ttf → iconfont.1743080348682.ttf} +0 -0
- /package/lib/{iconfont.1743051559265.woff → iconfont.1743080348682.woff} +0 -0
- /package/lib/{iconfont.1743051559265.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'
|
|
@@ -20,9 +20,20 @@ export default defineComponent({
|
|
|
20
20
|
type: Boolean as PropType<VxeSplitPropTypes.Border>,
|
|
21
21
|
default: () => getConfig().split.border
|
|
22
22
|
},
|
|
23
|
-
|
|
23
|
+
padding: {
|
|
24
|
+
type: Boolean as PropType<VxeSplitPropTypes.Padding>,
|
|
25
|
+
default: () => getConfig().split.padding
|
|
26
|
+
},
|
|
27
|
+
itemConfig: Object as PropType<VxeSplitPropTypes.ItemConfig>,
|
|
28
|
+
barConfig: Object as PropType<VxeSplitPropTypes.BarConfig>,
|
|
29
|
+
actionConfig: Object as PropType<VxeSplitPropTypes.ActionConfig>
|
|
24
30
|
},
|
|
25
31
|
emits: [
|
|
32
|
+
'action-dblclick',
|
|
33
|
+
'action-click',
|
|
34
|
+
'resize-start',
|
|
35
|
+
'resize-drag',
|
|
36
|
+
'resize-end'
|
|
26
37
|
] as VxeSplitEmits,
|
|
27
38
|
setup (props, context) {
|
|
28
39
|
const { emit, slots } = context
|
|
@@ -42,8 +53,37 @@ export default defineComponent({
|
|
|
42
53
|
return Object.assign({}, getConfig().split.itemConfig, props.itemConfig)
|
|
43
54
|
})
|
|
44
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
|
+
|
|
45
82
|
const computeMaps: VxeSplitPrivateComputed = {
|
|
46
|
-
computeItemOpts
|
|
83
|
+
computeItemOpts,
|
|
84
|
+
computeBarOpts,
|
|
85
|
+
computeActionOpts,
|
|
86
|
+
computeIsFoldNext
|
|
47
87
|
}
|
|
48
88
|
|
|
49
89
|
const refMaps: SplitPrivateRef = {
|
|
@@ -77,6 +117,36 @@ export default defineComponent({
|
|
|
77
117
|
return []
|
|
78
118
|
}
|
|
79
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
|
+
|
|
80
150
|
const recalculate = () => {
|
|
81
151
|
return nextTick().then(() => {
|
|
82
152
|
const { vertical } = props
|
|
@@ -148,79 +218,137 @@ export default defineComponent({
|
|
|
148
218
|
evnt.preventDefault()
|
|
149
219
|
const { vertical } = props
|
|
150
220
|
const { staticItems } = reactData
|
|
151
|
-
const
|
|
221
|
+
const barEl = evnt.currentTarget as HTMLDivElement
|
|
222
|
+
const handleEl = barEl.parentElement as HTMLDivElement
|
|
152
223
|
const el = refElem.value
|
|
153
224
|
if (!el) {
|
|
154
225
|
return
|
|
155
226
|
}
|
|
156
|
-
const itemId = handleEl.getAttribute('
|
|
227
|
+
const itemId = handleEl.getAttribute('itemid')
|
|
157
228
|
const itemIndex = XEUtils.findIndexOf(staticItems, item => item.id === itemId)
|
|
158
229
|
const item = staticItems[itemIndex]
|
|
159
230
|
if (!item) {
|
|
160
231
|
return
|
|
161
232
|
}
|
|
233
|
+
if (!item.isExpand) {
|
|
234
|
+
return
|
|
235
|
+
}
|
|
236
|
+
const isFoldNext = computeIsFoldNext.value
|
|
162
237
|
const itemOpts = computeItemOpts.value
|
|
163
238
|
const allMinWidth = XEUtils.toNumber(itemOpts.minWidth)
|
|
164
239
|
const allMinHeight = XEUtils.toNumber(itemOpts.minHeight)
|
|
165
|
-
const
|
|
166
|
-
const
|
|
167
|
-
const currItemEl = item ? el.querySelector<HTMLDivElement>(`.vxe-split-item[
|
|
168
|
-
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
|
|
169
244
|
const currWidth = currItemEl ? currItemEl.clientWidth : 0
|
|
170
|
-
const
|
|
245
|
+
const targetHeight = targetItemEl ? targetItemEl.clientHeight : 0
|
|
171
246
|
const currHeight = currItemEl ? currItemEl.clientHeight : 0
|
|
172
|
-
const
|
|
247
|
+
const targetMinWidth = XEUtils.toNumber(targetItem ? getGlobalDefaultConfig(targetItem.minWidth, allMinWidth) : allMinWidth)
|
|
173
248
|
const currMinWidth = XEUtils.toNumber(getGlobalDefaultConfig(item.minWidth, allMinWidth))
|
|
174
|
-
const
|
|
249
|
+
const targetMinHeight = XEUtils.toNumber(targetItem ? getGlobalDefaultConfig(targetItem.minHeight, allMinHeight) : allMinHeight)
|
|
175
250
|
const currMinHeight = XEUtils.toNumber(getGlobalDefaultConfig(item.minHeight, allMinHeight))
|
|
176
251
|
const disX = evnt.clientX
|
|
177
252
|
const disY = evnt.clientY
|
|
178
253
|
addClass(el, 'is--drag')
|
|
179
|
-
document.onmousemove = evnt => {
|
|
254
|
+
document.onmousemove = (evnt) => {
|
|
180
255
|
evnt.preventDefault()
|
|
181
256
|
if (vertical) {
|
|
182
|
-
const offsetTop = evnt.clientY - disY
|
|
257
|
+
const offsetTop = isFoldNext ? (disY - evnt.clientY) : (evnt.clientY - disY)
|
|
183
258
|
if (offsetTop > 0) {
|
|
184
|
-
if (
|
|
259
|
+
if (targetItem) {
|
|
185
260
|
if (currHeight - offsetTop >= currMinHeight) {
|
|
186
|
-
|
|
187
|
-
|
|
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)
|
|
188
265
|
}
|
|
189
266
|
}
|
|
190
267
|
} else {
|
|
191
|
-
if (
|
|
192
|
-
if (
|
|
193
|
-
|
|
194
|
-
|
|
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)
|
|
195
274
|
}
|
|
196
275
|
}
|
|
197
276
|
}
|
|
198
277
|
} else {
|
|
199
|
-
const offsetLeft = evnt.clientX - disX
|
|
278
|
+
const offsetLeft = isFoldNext ? (disX - evnt.clientX) : (evnt.clientX - disX)
|
|
200
279
|
if (offsetLeft > 0) {
|
|
201
|
-
if (
|
|
280
|
+
if (targetItem) {
|
|
202
281
|
if (currWidth - offsetLeft >= currMinWidth) {
|
|
203
|
-
|
|
204
|
-
|
|
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)
|
|
205
286
|
}
|
|
206
287
|
}
|
|
207
288
|
} else {
|
|
208
|
-
if (
|
|
209
|
-
if (
|
|
210
|
-
|
|
211
|
-
|
|
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)
|
|
212
295
|
}
|
|
213
296
|
}
|
|
214
297
|
}
|
|
215
298
|
}
|
|
216
299
|
}
|
|
217
|
-
document.onmouseup = () => {
|
|
300
|
+
document.onmouseup = (evnt: MouseEvent) => {
|
|
218
301
|
document.onmousemove = null
|
|
219
302
|
document.onmouseup = null
|
|
220
303
|
removeClass(el, 'is--drag')
|
|
304
|
+
dispatchEvent('resize-end', { item, name: item.name, resizeHeight: item.resizeHeight, resizeWidth: item.resizeWidth }, evnt)
|
|
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
|
+
}
|
|
221
345
|
}
|
|
222
346
|
}
|
|
223
347
|
|
|
348
|
+
const handleGlobalResizeEvent = () => {
|
|
349
|
+
recalculate()
|
|
350
|
+
}
|
|
351
|
+
|
|
224
352
|
const splitMethods: SplitMethods = {
|
|
225
353
|
dispatchEvent,
|
|
226
354
|
recalculate
|
|
@@ -231,46 +359,88 @@ export default defineComponent({
|
|
|
231
359
|
|
|
232
360
|
Object.assign($xeSplit, splitMethods, splitPrivateMethods)
|
|
233
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
|
+
|
|
234
399
|
const renderItems = () => {
|
|
235
|
-
const { border, vertical } = props
|
|
400
|
+
const { border, padding, vertical } = props
|
|
236
401
|
const { staticItems } = reactData
|
|
402
|
+
const isFoldNext = computeIsFoldNext.value
|
|
237
403
|
const itemVNs: VNode[] = []
|
|
238
404
|
staticItems.forEach((item, index) => {
|
|
239
|
-
const { id, slots, renderHeight, renderWidth } = item
|
|
405
|
+
const { id, slots, renderHeight, resizeHeight, foldHeight, renderWidth, resizeWidth, foldWidth, isVisible, isExpand } = item
|
|
240
406
|
const defaultSlot = slots ? slots.default : null
|
|
241
407
|
const stys: Record<string, string | number> = {}
|
|
408
|
+
const itemWidth = isVisible ? (foldWidth || resizeWidth || renderWidth) : 0
|
|
409
|
+
const itemHeight = isVisible ? (foldHeight || resizeHeight || renderHeight) : 0
|
|
242
410
|
if (vertical) {
|
|
243
|
-
if (
|
|
244
|
-
stys.height = toCssUnit(
|
|
411
|
+
if (itemHeight) {
|
|
412
|
+
stys.height = toCssUnit(itemHeight)
|
|
245
413
|
}
|
|
246
414
|
} else {
|
|
247
|
-
if (
|
|
248
|
-
stys.width = toCssUnit(
|
|
415
|
+
if (itemWidth) {
|
|
416
|
+
stys.width = toCssUnit(itemWidth)
|
|
249
417
|
}
|
|
250
418
|
}
|
|
251
419
|
itemVNs.push(
|
|
252
420
|
h('div', {
|
|
253
|
-
|
|
421
|
+
itemid: id,
|
|
254
422
|
class: ['vxe-split-item', vertical ? 'is--vertical' : 'is--horizontal', {
|
|
423
|
+
'is--padding': padding,
|
|
255
424
|
'is--border': border,
|
|
256
|
-
'is--height':
|
|
257
|
-
'is--width':
|
|
258
|
-
'is--fill': !
|
|
259
|
-
'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
|
|
260
431
|
}],
|
|
261
432
|
style: stys
|
|
262
433
|
}, [
|
|
263
|
-
index
|
|
264
|
-
? h('div', {
|
|
265
|
-
xid: id,
|
|
266
|
-
class: 'vxe-split-item-handle',
|
|
267
|
-
onMousedown: dragEvent
|
|
268
|
-
})
|
|
269
|
-
: renderEmptyElement($xeSplit),
|
|
434
|
+
index && !isFoldNext ? renderHandleBar(item) : renderEmptyElement($xeSplit),
|
|
270
435
|
h('div', {
|
|
271
|
-
|
|
436
|
+
itemid: id,
|
|
272
437
|
class: 'vxe-split-item--wrapper'
|
|
273
|
-
},
|
|
438
|
+
}, [
|
|
439
|
+
h('div', {
|
|
440
|
+
class: 'vxe-split-item--inner'
|
|
441
|
+
}, defaultSlot ? callSlot(defaultSlot, { }) : [])
|
|
442
|
+
]),
|
|
443
|
+
isFoldNext && index < staticItems.length - 1 ? renderHandleBar(item) : renderEmptyElement($xeSplit)
|
|
274
444
|
])
|
|
275
445
|
)
|
|
276
446
|
})
|
|
@@ -306,7 +476,15 @@ export default defineComponent({
|
|
|
306
476
|
})
|
|
307
477
|
|
|
308
478
|
onMounted(() => {
|
|
309
|
-
|
|
479
|
+
nextTick(() => {
|
|
480
|
+
recalculate()
|
|
481
|
+
})
|
|
482
|
+
|
|
483
|
+
globalEvents.on($xeSplit, 'resize', handleGlobalResizeEvent)
|
|
484
|
+
})
|
|
485
|
+
|
|
486
|
+
onUnmounted(() => {
|
|
487
|
+
globalEvents.off($xeSplit, 'resize')
|
|
310
488
|
})
|
|
311
489
|
|
|
312
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,31 +42,50 @@
|
|
|
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 {
|
|
56
51
|
position: relative;
|
|
57
52
|
word-break: break-word;
|
|
58
|
-
overflow:
|
|
53
|
+
overflow: hidden;
|
|
59
54
|
flex-grow: 1;
|
|
55
|
+
}
|
|
56
|
+
.vxe-split-item--inner {
|
|
57
|
+
height: 100%;
|
|
58
|
+
width: 100%;
|
|
59
|
+
overflow: auto;
|
|
60
60
|
& > .vxe-split {
|
|
61
61
|
height: 100%;
|
|
62
62
|
}
|
|
63
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);
|
|
75
|
+
}
|
|
64
76
|
|
|
65
77
|
.vxe-split-item {
|
|
66
78
|
display: flex;
|
|
67
79
|
position: relative;
|
|
68
80
|
overflow: auto;
|
|
81
|
+
&.is--hidden {
|
|
82
|
+
width: 0;
|
|
83
|
+
}
|
|
84
|
+
&.is--padding {
|
|
85
|
+
& > .vxe-split-item--wrapper {
|
|
86
|
+
padding: var(--vxe-ui-layout-padding-default);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
69
89
|
&.is--fill {
|
|
70
90
|
flex-grow: 1;
|
|
71
91
|
}
|
|
@@ -79,11 +99,61 @@
|
|
|
79
99
|
border: 1px solid var(--vxe-ui-base-popup-border-color);
|
|
80
100
|
}
|
|
81
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
|
+
}
|
|
82
129
|
&.is--horizontal {
|
|
83
130
|
flex-direction: row;
|
|
84
131
|
& > .vxe-split-item-handle {
|
|
85
|
-
|
|
86
|
-
|
|
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
|
+
}
|
|
87
157
|
}
|
|
88
158
|
&.is--border {
|
|
89
159
|
& > .vxe-split-item-handle {
|
|
@@ -94,8 +164,31 @@
|
|
|
94
164
|
&.is--vertical {
|
|
95
165
|
flex-direction: column;
|
|
96
166
|
& > .vxe-split-item-handle {
|
|
97
|
-
|
|
98
|
-
|
|
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
|
+
}
|
|
99
192
|
}
|
|
100
193
|
&.is--border {
|
|
101
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[])
|