vxe-pc-ui 3.5.2 → 3.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.
Files changed (58) hide show
  1. package/es/icon/style.css +1 -1
  2. package/es/list/src/list.js +3 -2
  3. package/es/print/src/util.js +2 -1
  4. package/es/split/src/split-item.js +22 -2
  5. package/es/split/src/split.js +225 -52
  6. package/es/split/style.css +74 -14
  7. package/es/split/style.min.css +1 -1
  8. package/es/style.css +1 -1
  9. package/es/style.min.css +1 -1
  10. package/es/ui/index.js +6 -1
  11. package/es/ui/src/dom.js +0 -1
  12. package/es/vxe-split/style.css +74 -14
  13. package/es/vxe-split/style.min.css +1 -1
  14. package/lib/icon/style/style.css +1 -1
  15. package/lib/icon/style/style.min.css +1 -1
  16. package/lib/index.umd.js +299 -54
  17. package/lib/index.umd.min.js +1 -1
  18. package/lib/list/src/list.js +2 -1
  19. package/lib/list/src/list.min.js +1 -1
  20. package/lib/print/src/util.js +2 -1
  21. package/lib/print/src/util.min.js +1 -1
  22. package/lib/split/src/split-item.js +22 -2
  23. package/lib/split/src/split-item.min.js +1 -1
  24. package/lib/split/src/split.js +265 -48
  25. package/lib/split/src/split.min.js +1 -1
  26. package/lib/split/style/style.css +74 -14
  27. package/lib/split/style/style.min.css +1 -1
  28. package/lib/style.css +1 -1
  29. package/lib/style.min.css +1 -1
  30. package/lib/ui/index.js +6 -1
  31. package/lib/ui/index.min.js +1 -1
  32. package/lib/ui/src/dom.js +0 -2
  33. package/lib/ui/src/dom.min.js +1 -1
  34. package/lib/vxe-split/style/style.css +74 -14
  35. package/lib/vxe-split/style/style.min.css +1 -1
  36. package/package.json +1 -1
  37. package/packages/list/src/list.ts +4 -2
  38. package/packages/print/src/util.ts +3 -1
  39. package/packages/split/src/split-item.ts +24 -2
  40. package/packages/split/src/split.ts +235 -52
  41. package/packages/ui/index.ts +7 -1
  42. package/packages/ui/src/dom.ts +0 -2
  43. package/styles/components/split.scss +97 -14
  44. package/types/components/split-item.d.ts +5 -1
  45. package/types/components/split.d.ts +86 -1
  46. package/types/ui/global-icon.d.ts +6 -0
  47. /package/es/icon/{iconfont.1743056503870.ttf → iconfont.1743080331925.ttf} +0 -0
  48. /package/es/icon/{iconfont.1743056503870.woff → iconfont.1743080331925.woff} +0 -0
  49. /package/es/icon/{iconfont.1743056503870.woff2 → iconfont.1743080331925.woff2} +0 -0
  50. /package/es/{iconfont.1743056503870.ttf → iconfont.1743080331925.ttf} +0 -0
  51. /package/es/{iconfont.1743056503870.woff → iconfont.1743080331925.woff} +0 -0
  52. /package/es/{iconfont.1743056503870.woff2 → iconfont.1743080331925.woff2} +0 -0
  53. /package/lib/icon/style/{iconfont.1743056503870.ttf → iconfont.1743080331925.ttf} +0 -0
  54. /package/lib/icon/style/{iconfont.1743056503870.woff → iconfont.1743080331925.woff} +0 -0
  55. /package/lib/icon/style/{iconfont.1743056503870.woff2 → iconfont.1743080331925.woff2} +0 -0
  56. /package/lib/{iconfont.1743056503870.ttf → iconfont.1743080331925.ttf} +0 -0
  57. /package/lib/{iconfont.1743056503870.woff → iconfont.1743080331925.woff} +0 -0
  58. /package/lib/{iconfont.1743056503870.woff2 → iconfont.1743080331925.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: {
@@ -160,82 +194,218 @@ export default /* define-vxe-component start */ defineVxeComponent({
160
194
  evnt.preventDefault()
161
195
  const { vertical } = props
162
196
  const { staticItems } = reactData
163
- const handleEl = evnt.currentTarget as HTMLDivElement
197
+ const barEl = evnt.currentTarget as HTMLDivElement
198
+ const handleEl = barEl.parentElement as HTMLDivElement
164
199
  const el = $xeSplit.$refs.refElem as HTMLDivElement
165
200
  if (!el) {
166
201
  return
167
202
  }
168
- const itemId = handleEl.getAttribute('xid')
203
+ const itemId = handleEl.getAttribute('itemid')
169
204
  const itemIndex = XEUtils.findIndexOf(staticItems, item => item.id === itemId)
170
205
  const item = staticItems[itemIndex]
171
206
  if (!item) {
172
207
  return
173
208
  }
209
+ if (!item.isExpand) {
210
+ return
211
+ }
212
+ const isFoldNext = $xeSplit.computeIsFoldNext
174
213
  const itemOpts = $xeSplit.computeItemOpts
175
214
  const allMinWidth = XEUtils.toNumber(itemOpts.minWidth)
176
215
  const allMinHeight = XEUtils.toNumber(itemOpts.minHeight)
177
- const prevItem = staticItems[itemIndex - 1]
178
- const prevItemEl = prevItem ? el.querySelector<HTMLDivElement>(`.vxe-split-item[xid="${prevItem.id}"]`) : null
179
- const currItemEl = item ? el.querySelector<HTMLDivElement>(`.vxe-split-item[xid="${item.id}"]`) : null
180
- const prevWidth = prevItemEl ? prevItemEl.clientWidth : 0
216
+ const targetItem = staticItems[itemIndex + (isFoldNext ? 1 : -1)]
217
+ const targetItemEl = targetItem ? el.querySelector<HTMLDivElement>(`.vxe-split-item[itemid="${targetItem.id}"]`) : null
218
+ const currItemEl = item ? el.querySelector<HTMLDivElement>(`.vxe-split-item[itemid="${item.id}"]`) : null
219
+ const targetWidth = targetItemEl ? targetItemEl.clientWidth : 0
181
220
  const currWidth = currItemEl ? currItemEl.clientWidth : 0
182
- const prevHeight = prevItemEl ? prevItemEl.clientHeight : 0
221
+ const targetHeight = targetItemEl ? targetItemEl.clientHeight : 0
183
222
  const currHeight = currItemEl ? currItemEl.clientHeight : 0
184
- const prevMinWidth = XEUtils.toNumber(prevItem ? getGlobalDefaultConfig(prevItem.minWidth, allMinWidth) : allMinWidth)
223
+ const targetMinWidth = XEUtils.toNumber(targetItem ? getGlobalDefaultConfig(targetItem.minWidth, allMinWidth) : allMinWidth)
185
224
  const currMinWidth = XEUtils.toNumber(getGlobalDefaultConfig(item.minWidth, allMinWidth))
186
- const prevMinHeight = XEUtils.toNumber(prevItem ? getGlobalDefaultConfig(prevItem.minHeight, allMinHeight) : allMinHeight)
225
+ const targetMinHeight = XEUtils.toNumber(targetItem ? getGlobalDefaultConfig(targetItem.minHeight, allMinHeight) : allMinHeight)
187
226
  const currMinHeight = XEUtils.toNumber(getGlobalDefaultConfig(item.minHeight, allMinHeight))
188
227
  const disX = evnt.clientX
189
228
  const disY = evnt.clientY
190
229
  addClass(el, 'is--drag')
191
- document.onmousemove = evnt => {
230
+ document.onmousemove = (evnt) => {
192
231
  evnt.preventDefault()
193
232
  if (vertical) {
194
- const offsetTop = evnt.clientY - disY
233
+ const offsetTop = isFoldNext ? (disY - evnt.clientY) : (evnt.clientY - disY)
195
234
  if (offsetTop > 0) {
196
- if (prevItem) {
235
+ if (targetItem) {
197
236
  if (currHeight - offsetTop >= currMinHeight) {
198
- prevItem.renderHeight = prevHeight + offsetTop
199
- item.renderHeight = currHeight - offsetTop
237
+ const reHeight = currHeight - offsetTop
238
+ targetItem.resizeHeight = targetHeight + offsetTop
239
+ item.resizeHeight = reHeight
240
+ $xeSplit.dispatchEvent('resize-drag', { item, name: item.name, offsetHeight: offsetTop, resizeHeight: reHeight, offsetWidth: 0, resizeWidth: 0 }, evnt)
200
241
  }
201
242
  }
202
243
  } else {
203
- if (prevItem) {
204
- if (prevHeight + offsetTop >= prevMinHeight) {
205
- prevItem.renderHeight = prevHeight + offsetTop
206
- item.renderHeight = currHeight - offsetTop
244
+ if (targetItem) {
245
+ if (targetHeight + offsetTop >= targetMinHeight) {
246
+ const reHeight = currHeight - offsetTop
247
+ targetItem.resizeHeight = targetHeight + offsetTop
248
+ item.resizeHeight = reHeight
249
+ $xeSplit.dispatchEvent('resize-drag', { item, name: item.name, offsetHeight: offsetTop, resizeHeight: reHeight, offsetWidth: 0, resizeWidth: 0 }, evnt)
207
250
  }
208
251
  }
209
252
  }
210
253
  } else {
211
- const offsetLeft = evnt.clientX - disX
254
+ const offsetLeft = isFoldNext ? (disX - evnt.clientX) : (evnt.clientX - disX)
212
255
  if (offsetLeft > 0) {
213
- if (prevItem) {
256
+ if (targetItem) {
214
257
  if (currWidth - offsetLeft >= currMinWidth) {
215
- prevItem.renderWidth = prevWidth + offsetLeft
216
- item.renderWidth = currWidth - offsetLeft
258
+ const reWidth = currWidth - offsetLeft
259
+ targetItem.resizeWidth = targetWidth + offsetLeft
260
+ item.resizeWidth = reWidth
261
+ $xeSplit.dispatchEvent('resize-drag', { item, name: item.name, offsetHeight: 0, resizeHeight: 0, offsetWidth: offsetLeft, resizeWidth: reWidth }, evnt)
217
262
  }
218
263
  }
219
264
  } else {
220
- if (prevItem) {
221
- if (prevWidth + offsetLeft >= prevMinWidth) {
222
- prevItem.renderWidth = prevWidth + offsetLeft
223
- item.renderWidth = currWidth - offsetLeft
265
+ if (targetItem) {
266
+ if (targetWidth + offsetLeft >= targetMinWidth) {
267
+ const reWidth = currWidth - offsetLeft
268
+ targetItem.resizeWidth = targetWidth + offsetLeft
269
+ item.resizeWidth = reWidth
270
+ $xeSplit.dispatchEvent('resize-drag', { item, name: item.name, offsetHeight: 0, resizeHeight: 0, offsetWidth: offsetLeft, resizeWidth: reWidth }, evnt)
224
271
  }
225
272
  }
226
273
  }
227
274
  }
228
275
  }
229
- document.onmouseup = () => {
276
+ document.onmouseup = (evnt: MouseEvent) => {
230
277
  document.onmousemove = null
231
278
  document.onmouseup = null
232
279
  removeClass(el, 'is--drag')
280
+ $xeSplit.dispatchEvent('resize-end', { item, name: item.name, resizeHeight: item.resizeHeight, resizeWidth: item.resizeWidth }, evnt)
281
+ }
282
+ $xeSplit.dispatchEvent('resize-start', { item, name: item.name }, evnt)
283
+ },
284
+ handleItemActionEvent (evnt: MouseEvent) {
285
+ const $xeSplit = this
286
+ const props = $xeSplit
287
+ const reactData = $xeSplit.reactData
288
+
289
+ const el = $xeSplit.$refs.refElem as HTMLDivElement
290
+ if (!el) {
291
+ return
292
+ }
293
+ const { vertical } = props
294
+ const { staticItems } = reactData
295
+ const isFoldNext = $xeSplit.computeIsFoldNext
296
+ const btnEl = evnt.currentTarget as HTMLDivElement
297
+ const handleEl = btnEl.parentElement as HTMLDivElement
298
+ const itemId = handleEl.getAttribute('itemid')
299
+ const itemIndex = XEUtils.findIndexOf(staticItems, item => item.id === itemId)
300
+ const item = staticItems[itemIndex]
301
+ const targetItem = staticItems[itemIndex + (isFoldNext ? 1 : -1)]
302
+ if (item) {
303
+ const { showAction, isExpand } = item
304
+ if (showAction) {
305
+ if (vertical) {
306
+ if (targetItem) {
307
+ targetItem.isVisible = !isExpand
308
+ targetItem.foldHeight = 0
309
+ item.isExpand = !isExpand
310
+ item.isVisible = true
311
+ item.foldHeight = isExpand ? (targetItem.resizeHeight || targetItem.renderHeight) + (item.resizeHeight || item.renderHeight) : 0
312
+ }
313
+ } else {
314
+ if (targetItem) {
315
+ targetItem.isVisible = !isExpand
316
+ targetItem.foldWidth = 0
317
+ item.isExpand = !isExpand
318
+ item.isVisible = true
319
+ item.foldWidth = isExpand ? (targetItem.resizeWidth || targetItem.renderWidth) + (item.resizeWidth || item.renderWidth) : 0
320
+ }
321
+ }
322
+ $xeSplit.dispatchEvent(evnt.type === 'dblclick' ? 'action-dblclick' : 'action-click', { item, name: item.name, targetItem, targetName: targetItem ? targetItem.name : '', expanded: item.isExpand }, evnt)
323
+ }
324
+ }
325
+ },
326
+ handleGlobalResizeEvent () {
327
+ const $xeSplit = this
328
+
329
+ $xeSplit.recalculate()
330
+ },
331
+ getDefaultActionIcon (item: VxeSplitDefines.ChunkConfig) {
332
+ const $xeSplit = this
333
+ const props = $xeSplit
334
+
335
+ const { vertical } = props
336
+ const { showAction, isExpand } = item
337
+ const isFoldNext = $xeSplit.computeIsFoldNext
338
+ const topIcon = 'SPLIT_TOP_ACTION'
339
+ const bottomIcon = 'SPLIT_BOTTOM_ACTION'
340
+ const leftIcon = 'SPLIT_LEFT_ACTION'
341
+ const rightIcon = 'SPLIT_RIGHT_ACTION'
342
+ if (showAction) {
343
+ let iconName: 'SPLIT_TOP_ACTION' | 'SPLIT_BOTTOM_ACTION' | 'SPLIT_LEFT_ACTION' | 'SPLIT_RIGHT_ACTION' | '' = ''
344
+ if (isFoldNext) {
345
+ if (vertical) {
346
+ iconName = isExpand ? bottomIcon : topIcon
347
+ } else {
348
+ iconName = isExpand ? rightIcon : leftIcon
349
+ }
350
+ } else {
351
+ if (vertical) {
352
+ iconName = isExpand ? topIcon : bottomIcon
353
+ } else {
354
+ iconName = isExpand ? leftIcon : rightIcon
355
+ }
356
+ }
357
+ if (iconName) {
358
+ return getIcon()[iconName]
359
+ }
233
360
  }
361
+ return ''
234
362
  },
235
363
 
236
364
  //
237
365
  // Render
238
366
  //
367
+ renderHandleBar (h: CreateElement, item: VxeSplitDefines.ChunkConfig) {
368
+ const $xeSplit = this
369
+
370
+ const barStyle = $xeSplit.computeBarStyle
371
+ const actionOpts = $xeSplit.computeActionOpts
372
+ const isFoldNext = $xeSplit.computeIsFoldNext
373
+ const { id, isExpand, showAction } = item
374
+
375
+ const btnOns: {
376
+ click?: (evnt: MouseEvent) => void
377
+ dblclick?: (evnt: MouseEvent) => void
378
+ } = {}
379
+ if (actionOpts.trigger === 'dblclick') {
380
+ btnOns.dblclick = $xeSplit.handleItemActionEvent
381
+ } else {
382
+ btnOns.click = $xeSplit.handleItemActionEvent
383
+ }
384
+ return h('div', {
385
+ attrs: {
386
+ itemid: id
387
+ },
388
+ class: ['vxe-split-item-handle', isFoldNext ? 'to--next' : 'to--prev']
389
+ }, [
390
+ h('div', {
391
+ class: 'vxe-split-item-handle-bar',
392
+ style: barStyle,
393
+ on: {
394
+ mousedown: $xeSplit.dragEvent
395
+ }
396
+ }),
397
+ showAction
398
+ ? h('span', {
399
+ class: 'vxe-split-item-action-btn',
400
+ on: btnOns
401
+ }, [
402
+ h('i', {
403
+ class: (isExpand ? actionOpts.openIcon : actionOpts.closeIcon) || $xeSplit.getDefaultActionIcon(item)
404
+ })
405
+ ])
406
+ : renderEmptyElement($xeSplit)
407
+ ])
408
+ },
239
409
  renderItems (h: CreateElement) {
240
410
  const $xeSplit = this
241
411
  const props = $xeSplit
@@ -243,56 +413,52 @@ export default /* define-vxe-component start */ defineVxeComponent({
243
413
 
244
414
  const { border, padding, vertical } = props
245
415
  const { staticItems } = reactData
416
+ const isFoldNext = $xeSplit.computeIsFoldNext
246
417
  const itemVNs: VNode[] = []
247
418
  staticItems.forEach((item, index) => {
248
- const { id, slots, renderHeight, renderWidth } = item
419
+ const { id, slots, renderHeight, resizeHeight, foldHeight, renderWidth, resizeWidth, foldWidth, isVisible, isExpand } = item
249
420
  const defaultSlot = slots ? slots.default : null
250
421
  const stys: Record<string, string | number> = {}
422
+ const itemWidth = isVisible ? (foldWidth || resizeWidth || renderWidth) : 0
423
+ const itemHeight = isVisible ? (foldHeight || resizeHeight || renderHeight) : 0
251
424
  if (vertical) {
252
- if (renderHeight) {
253
- stys.height = toCssUnit(renderHeight)
425
+ if (itemHeight) {
426
+ stys.height = toCssUnit(itemHeight)
254
427
  }
255
428
  } else {
256
- if (renderWidth) {
257
- stys.width = toCssUnit(renderWidth)
429
+ if (itemWidth) {
430
+ stys.width = toCssUnit(itemWidth)
258
431
  }
259
432
  }
260
433
  itemVNs.push(
261
434
  h('div', {
262
435
  attrs: {
263
- xid: id
436
+ itemid: id
264
437
  },
265
438
  class: ['vxe-split-item', vertical ? 'is--vertical' : 'is--horizontal', {
266
439
  'is--padding': padding,
267
440
  'is--border': border,
268
- 'is--height': renderHeight,
269
- 'is--width': renderWidth,
270
- 'is--fill': !renderHeight && !renderWidth,
271
- 'is--handle': index > 0
441
+ 'is--height': itemHeight,
442
+ 'is--width': itemWidth,
443
+ 'is--fill': isVisible && !itemHeight && !itemWidth,
444
+ 'is--handle': index > 0,
445
+ 'is--expand': isExpand,
446
+ 'is--hidden': !isVisible
272
447
  }],
273
448
  style: stys
274
449
  }, [
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),
450
+ index && !isFoldNext ? $xeSplit.renderHandleBar(h, item) : renderEmptyElement($xeSplit),
286
451
  h('div', {
287
452
  attrs: {
288
- xid: id
453
+ itemid: id
289
454
  },
290
455
  class: 'vxe-split-item--wrapper'
291
456
  }, [
292
457
  h('div', {
293
458
  class: 'vxe-split-item--inner'
294
459
  }, defaultSlot ? $xeSplit.callSlot(defaultSlot, { }) : [])
295
- ])
460
+ ]),
461
+ isFoldNext && index < staticItems.length - 1 ? $xeSplit.renderHandleBar(h, item) : renderEmptyElement($xeSplit)
296
462
  ])
297
463
  )
298
464
  })
@@ -326,6 +492,23 @@ export default /* define-vxe-component start */ defineVxeComponent({
326
492
  ])
327
493
  }
328
494
  },
495
+ created () {
496
+ const $xeSplit = this
497
+
498
+ globalEvents.on($xeSplit, 'resize', $xeSplit.handleGlobalResizeEvent)
499
+ },
500
+ mounted () {
501
+ const $xeSplit = this
502
+
503
+ $xeSplit.$nextTick(() => {
504
+ $xeSplit.recalculate()
505
+ })
506
+ },
507
+ beforeDestroy () {
508
+ const $xeSplit = this
509
+
510
+ globalEvents.off($xeSplit, 'resize')
511
+ },
329
512
  render (this: any, h) {
330
513
  return this.renderVN(h)
331
514
  }
@@ -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'
@@ -1,7 +1,5 @@
1
1
  import XEUtils from 'xe-utils'
2
2
 
3
- export const browse = XEUtils.browse()
4
-
5
3
  let tpImgEl: HTMLImageElement | undefined
6
4
 
7
5
  export function initTpImg () {
@@ -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
- width: var(--vxe-split-handle-bar-width);
96
- cursor: w-resize;
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
- height: var(--vxe-split-handle-bar-height);
108
- cursor: n-resize;
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 type VxeSplitItemProps = {
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[])