forked from angular-split/angular-split
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsplit.component.ts
More file actions
621 lines (547 loc) 路 22.2 KB
/
Copy pathsplit.component.ts
File metadata and controls
621 lines (547 loc) 路 22.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
import {
ChangeDetectionStrategy,
Component,
ElementRef,
HostBinding,
InjectionToken,
NgZone,
Renderer2,
booleanAttribute,
computed,
contentChild,
contentChildren,
effect,
inject,
input,
isDevMode,
output,
signal,
} from '@angular/core'
import { takeUntilDestroyed } from '@angular/core/rxjs-interop'
import type { SplitAreaComponent } from '../split-area/split-area.component'
import { Subject, filter, fromEvent, map, pairwise, skipWhile, startWith, switchMap, take, takeUntil, tap } from 'rxjs'
import {
ClientPoint,
createClassesString,
gutterEventsEqualWithDelta,
fromMouseMoveEvent,
fromMouseUpEvent,
getPointFromEvent,
leaveNgZone,
numberAttributeWithFallback,
sum,
toRecord,
assertUnreachable,
} from '../utils'
import { DOCUMENT, NgStyle, NgTemplateOutlet } from '@angular/common'
import { SplitGutterInteractionEvent, SplitAreaSize } from '../models'
import { SplitCustomEventsBehaviorDirective } from '../split-custom-events-behavior.directive'
import { areAreasValid } from '../validations'
import { SplitGutterDirective } from '../gutter/split-gutter.directive'
import { SplitGutterDynamicInjectorDirective } from '../gutter/split-gutter-dynamic-injector.directive'
import { ANGULAR_SPLIT_DEFAULT_OPTIONS } from '../angular-split-config.token'
interface MouseDownContext {
mouseDownEvent: MouseEvent | TouchEvent
gutterIndex: number
gutterElement: HTMLElement
areaBeforeGutterIndex: number
areaAfterGutterIndex: number
}
interface AreaBoundary {
min: number
max: number
}
interface DragStartContext {
startEvent: MouseEvent | TouchEvent | KeyboardEvent
areasPixelSizes: number[]
totalAreasPixelSize: number
areaIndexToBoundaries: Record<number, AreaBoundary>
areaBeforeGutterIndex: number
areaAfterGutterIndex: number
}
export const SPLIT_AREA_CONTRACT = new InjectionToken<SplitAreaComponent>('Split Area Contract')
@Component({
selector: 'as-split',
imports: [NgStyle, SplitCustomEventsBehaviorDirective, SplitGutterDynamicInjectorDirective, NgTemplateOutlet],
exportAs: 'asSplit',
templateUrl: './split.component.html',
styleUrl: './split.component.css',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class SplitComponent {
private readonly document = inject(DOCUMENT)
private readonly renderer = inject(Renderer2)
private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef)
private readonly ngZone = inject(NgZone)
private readonly defaultOptions = inject(ANGULAR_SPLIT_DEFAULT_OPTIONS)
private readonly gutterMouseDownSubject = new Subject<MouseDownContext>()
private readonly dragProgressSubject = new Subject<SplitGutterInteractionEvent>()
/**
* @internal
*/
readonly _areas = contentChildren(SPLIT_AREA_CONTRACT)
protected readonly customGutter = contentChild(SplitGutterDirective)
readonly gutterSize = input(this.defaultOptions.gutterSize, {
transform: numberAttributeWithFallback(this.defaultOptions.gutterSize),
})
readonly gutterStep = input(this.defaultOptions.gutterStep, {
transform: numberAttributeWithFallback(this.defaultOptions.gutterStep),
})
readonly disabled = input(this.defaultOptions.disabled, { transform: booleanAttribute })
readonly gutterClickDeltaPx = input(this.defaultOptions.gutterClickDeltaPx, {
transform: numberAttributeWithFallback(this.defaultOptions.gutterClickDeltaPx),
})
readonly direction = input(this.defaultOptions.direction)
readonly dir = input(this.defaultOptions.dir)
readonly unit = input(this.defaultOptions.unit)
readonly gutterAriaLabel = input<string>()
readonly restrictMove = input(this.defaultOptions.restrictMove, { transform: booleanAttribute })
readonly useTransition = input(this.defaultOptions.useTransition, { transform: booleanAttribute })
readonly gutterDblClickDuration = input(this.defaultOptions.gutterDblClickDuration, {
transform: numberAttributeWithFallback(this.defaultOptions.gutterDblClickDuration),
})
readonly gutterClick = output<SplitGutterInteractionEvent>()
readonly gutterDblClick = output<SplitGutterInteractionEvent>()
readonly dragStart = output<SplitGutterInteractionEvent>()
readonly dragEnd = output<SplitGutterInteractionEvent>()
readonly transitionEnd = output<SplitAreaSize[]>()
readonly dragProgress$ = this.dragProgressSubject.asObservable()
/**
* @internal
*/
readonly _visibleAreas = computed(() => this._areas().filter((area) => area.visible()))
private readonly gridTemplateColumnsStyle = computed(() => this.createGridTemplateColumnsStyle())
private readonly hostClasses = computed(() =>
createClassesString({
[`as-${this.direction()}`]: true,
[`as-${this.unit()}`]: true,
['as-disabled']: this.disabled(),
['as-dragging']: this._isDragging(),
['as-transition']: this.useTransition() && !this._isDragging(),
}),
)
protected readonly draggedGutterIndex = signal<number>(undefined)
/**
* @internal
*/
readonly _isDragging = computed(() => this.draggedGutterIndex() !== undefined)
/**
* @internal
* Should only be used by {@link SplitAreaComponent._internalSize}
*/
readonly _alignedVisibleAreasSizes = computed(() => this.createAlignedVisibleAreasSize())
@HostBinding('class') protected get hostClassesBinding() {
return this.hostClasses()
}
@HostBinding('dir') protected get hostDirBinding() {
return this.dir()
}
constructor() {
if (isDevMode()) {
// Logs warnings to console when the provided areas sizes are invalid
effect(() => {
// Special mode when no size input was declared which is a valid mode
if (this.unit() === 'percent' && this._visibleAreas().every((area) => area.size() === 'auto')) {
return
}
areAreasValid(this._visibleAreas(), this.unit(), true)
})
}
// Responsible for updating grid template style. Must be this way and not based on HostBinding
// as change detection for host binding is bound to the parent component and this style
// is updated on every mouse move. Doing it this way will prevent change detection cycles in parent.
effect(() => {
const gridTemplateColumnsStyle = this.gridTemplateColumnsStyle()
this.renderer.setStyle(this.elementRef.nativeElement, 'grid-template', gridTemplateColumnsStyle)
})
this.gutterMouseDownSubject
.pipe(
filter(
(context) =>
!this.customGutter() ||
this.customGutter()._canStartDragging(
context.mouseDownEvent.target as HTMLElement,
context.gutterIndex + 1,
),
),
switchMap((mouseDownContext) =>
// As we have gutterClickDeltaPx we can't just start the drag but need to make sure
// we are out of the delta pixels. As the delta can be any number we make sure
// we always start the drag if we go out of the gutter (delta based on mouse position is larger than gutter).
// As moving can start inside the drag and end outside of it we always keep track of the previous event
// so once the current is out of the delta size we use the previous one as the drag start baseline.
fromMouseMoveEvent(this.document).pipe(
startWith(mouseDownContext.mouseDownEvent),
pairwise(),
skipWhile(([, currMoveEvent]) =>
gutterEventsEqualWithDelta(
mouseDownContext.mouseDownEvent,
currMoveEvent,
this.gutterClickDeltaPx(),
mouseDownContext.gutterElement,
),
),
take(1),
takeUntil(fromMouseUpEvent(this.document, true)),
tap(() => {
this.ngZone.run(() => {
this.dragStart.emit(this.createDragInteractionEvent(mouseDownContext.gutterIndex))
this.draggedGutterIndex.set(mouseDownContext.gutterIndex)
})
}),
map(([prevMouseEvent]) =>
this.createDragStartContext(
prevMouseEvent,
mouseDownContext.areaBeforeGutterIndex,
mouseDownContext.areaAfterGutterIndex,
),
),
switchMap((dragStartContext) =>
fromMouseMoveEvent(this.document).pipe(
tap((moveEvent) => this.mouseDragMove(moveEvent, dragStartContext)),
takeUntil(fromMouseUpEvent(this.document, true)),
tap({
complete: () =>
this.ngZone.run(() => {
this.dragEnd.emit(this.createDragInteractionEvent(this.draggedGutterIndex()))
this.draggedGutterIndex.set(undefined)
}),
}),
),
),
),
),
takeUntilDestroyed(),
)
.subscribe()
fromEvent<TransitionEvent>(this.elementRef.nativeElement, 'transitionend')
.pipe(
filter((e) => e.propertyName.startsWith('grid-template')),
leaveNgZone(),
takeUntilDestroyed(),
)
.subscribe(() => this.ngZone.run(() => this.transitionEnd.emit(this.createAreaSizes())))
}
protected gutterClicked(gutterIndex: number) {
this.ngZone.run(() => this.gutterClick.emit(this.createDragInteractionEvent(gutterIndex)))
}
protected gutterDoubleClicked(gutterIndex: number) {
this.ngZone.run(() => this.gutterDblClick.emit(this.createDragInteractionEvent(gutterIndex)))
}
protected gutterMouseDown(
e: MouseEvent | TouchEvent,
gutterElement: HTMLElement,
gutterIndex: number,
areaBeforeGutterIndex: number,
areaAfterGutterIndex: number,
) {
e.preventDefault()
e.stopPropagation()
if (this.disabled()) {
return
}
this.gutterMouseDownSubject.next({
mouseDownEvent: e,
gutterElement,
gutterIndex,
areaBeforeGutterIndex,
areaAfterGutterIndex,
})
}
protected gutterKeyDown(
e: KeyboardEvent,
gutterIndex: number,
areaBeforeGutterIndex: number,
areaAfterGutterIndex: number,
) {
if (this.disabled()) {
return
}
const pixelsToMove = 50
const pageMoveMultiplier = 10
let xPointOffset = 0
let yPointOffset = 0
if (this.direction() === 'horizontal') {
// Even though we are going in the x axis we support page up and down
switch (e.key) {
case 'ArrowLeft':
xPointOffset -= pixelsToMove
break
case 'ArrowRight':
xPointOffset += pixelsToMove
break
case 'PageUp':
if (this.dir() === 'rtl') {
xPointOffset -= pixelsToMove * pageMoveMultiplier
} else {
xPointOffset += pixelsToMove * pageMoveMultiplier
}
break
case 'PageDown':
if (this.dir() === 'rtl') {
xPointOffset += pixelsToMove * pageMoveMultiplier
} else {
xPointOffset -= pixelsToMove * pageMoveMultiplier
}
break
default:
return
}
} else {
switch (e.key) {
case 'ArrowUp':
yPointOffset -= pixelsToMove
break
case 'ArrowDown':
yPointOffset += pixelsToMove
break
case 'PageUp':
yPointOffset -= pixelsToMove * pageMoveMultiplier
break
case 'PageDown':
yPointOffset += pixelsToMove * pageMoveMultiplier
break
default:
return
}
}
e.preventDefault()
e.stopPropagation()
const gutterMidPoint = getPointFromEvent(e)
const dragStartContext = this.createDragStartContext(e, areaBeforeGutterIndex, areaAfterGutterIndex)
this.ngZone.run(() => {
this.dragStart.emit(this.createDragInteractionEvent(gutterIndex))
this.draggedGutterIndex.set(gutterIndex)
})
this.dragMoveToPoint({ x: gutterMidPoint.x + xPointOffset, y: gutterMidPoint.y + yPointOffset }, dragStartContext)
this.ngZone.run(() => {
this.dragEnd.emit(this.createDragInteractionEvent(gutterIndex))
this.draggedGutterIndex.set(undefined)
})
}
protected getGutterGridStyle(nextAreaIndex: number) {
const gutterNum = nextAreaIndex * 2
const style = `${gutterNum} / ${gutterNum}`
return {
['grid-column']: this.direction() === 'horizontal' ? style : '1',
['grid-row']: this.direction() === 'vertical' ? style : '1',
}
}
protected getAriaAreaSizeText(area: SplitAreaComponent): string {
const size = area._internalSize()
if (size === '*') {
return undefined
}
return `${size.toFixed(0)} ${this.unit()}`
}
protected getAriaValue(size: SplitAreaSize) {
return size === '*' ? undefined : size
}
private createDragInteractionEvent(gutterIndex: number): SplitGutterInteractionEvent {
return {
gutterNum: gutterIndex + 1,
sizes: this.createAreaSizes(),
}
}
private createAreaSizes() {
return this._visibleAreas().map((area) => area._internalSize())
}
private createDragStartContext(
startEvent: MouseEvent | TouchEvent | KeyboardEvent,
areaBeforeGutterIndex: number,
areaAfterGutterIndex: number,
): DragStartContext {
const splitBoundingRect = this.elementRef.nativeElement.getBoundingClientRect()
const splitSize = this.direction() === 'horizontal' ? splitBoundingRect.width : splitBoundingRect.height
const totalAreasPixelSize = splitSize - (this._visibleAreas().length - 1) * this.gutterSize()
// Use the internal size and split size to calculate the pixel size from wildcard and percent areas
const areaPixelSizesWithWildcard = this._areas().map((area) => {
if (this.unit() === 'pixel') {
return area._internalSize()
} else {
const size = area._internalSize()
if (size === '*') {
return size
}
return (size / 100) * totalAreasPixelSize
}
})
const remainingSize = Math.max(
0,
totalAreasPixelSize - sum(areaPixelSizesWithWildcard, (size) => (size === '*' ? 0 : size)),
)
const areasPixelSizes = areaPixelSizesWithWildcard.map((size) => (size === '*' ? remainingSize : size))
return {
startEvent,
areaBeforeGutterIndex,
areaAfterGutterIndex,
areasPixelSizes,
totalAreasPixelSize,
areaIndexToBoundaries: toRecord(this._areas(), (area, index) => {
const percentToPixels = (percent: number) => (percent / 100) * totalAreasPixelSize
const value: AreaBoundary =
this.unit() === 'pixel'
? {
min: area._normalizedMinSize(),
max: area._normalizedMaxSize(),
}
: {
min: percentToPixels(area._normalizedMinSize()),
max: percentToPixels(area._normalizedMaxSize()),
}
return [index.toString(), value]
}),
}
}
private mouseDragMove(moveEvent: MouseEvent | TouchEvent, dragStartContext: DragStartContext) {
moveEvent.preventDefault()
moveEvent.stopPropagation()
const endPoint = getPointFromEvent(moveEvent)
this.dragMoveToPoint(endPoint, dragStartContext)
}
private dragMoveToPoint(endPoint: ClientPoint, dragStartContext: DragStartContext) {
const startPoint = getPointFromEvent(dragStartContext.startEvent)
const preDirOffset = this.direction() === 'horizontal' ? endPoint.x - startPoint.x : endPoint.y - startPoint.y
const offset = this.direction() === 'horizontal' && this.dir() === 'rtl' ? -preDirOffset : preDirOffset
const isDraggingForward = offset > 0
// Align offset with gutter step and abs it as we need absolute pixels movement
const absSteppedOffset = Math.abs(Math.round(offset / this.gutterStep()) * this.gutterStep())
// Copy as we don't want to edit the original array
const tempAreasPixelSizes = [...dragStartContext.areasPixelSizes]
// As we are going to shuffle the areas order for easier iterations we should work with area indices array
// instead of actual area sizes array.
const areasIndices = tempAreasPixelSizes.map((_, index) => index)
// The two variables below are ordered for iterations with real area indices inside.
// We must also remove the invisible ones as we can't expand or shrink them.
const areasIndicesBeforeGutter = this.restrictMove()
? [dragStartContext.areaBeforeGutterIndex]
: areasIndices
.slice(0, dragStartContext.areaBeforeGutterIndex + 1)
.filter((index) => this._areas()[index].visible())
.reverse()
const areasIndicesAfterGutter = this.restrictMove()
? [dragStartContext.areaAfterGutterIndex]
: areasIndices.slice(dragStartContext.areaAfterGutterIndex).filter((index) => this._areas()[index].visible())
// Based on direction we need to decide which areas are expanding and which are shrinking
const potentialAreasIndicesArrToShrink = isDraggingForward ? areasIndicesAfterGutter : areasIndicesBeforeGutter
const potentialAreasIndicesArrToExpand = isDraggingForward ? areasIndicesBeforeGutter : areasIndicesAfterGutter
let remainingPixels = absSteppedOffset
let potentialShrinkArrIndex = 0
let potentialExpandArrIndex = 0
// We gradually run in both expand and shrink direction transferring pixels from the offset.
// We stop once no pixels are left or we reached the end of either the expanding areas or the shrinking areas
while (
remainingPixels !== 0 &&
potentialShrinkArrIndex < potentialAreasIndicesArrToShrink.length &&
potentialExpandArrIndex < potentialAreasIndicesArrToExpand.length
) {
const areaIndexToShrink = potentialAreasIndicesArrToShrink[potentialShrinkArrIndex]
const areaIndexToExpand = potentialAreasIndicesArrToExpand[potentialExpandArrIndex]
const areaToShrinkSize = tempAreasPixelSizes[areaIndexToShrink]
const areaToExpandSize = tempAreasPixelSizes[areaIndexToExpand]
const areaToShrinkMinSize = dragStartContext.areaIndexToBoundaries[areaIndexToShrink].min
const areaToExpandMaxSize = dragStartContext.areaIndexToBoundaries[areaIndexToExpand].max
// We can only transfer pixels based on the shrinking area min size and the expanding area max size
// to avoid overflow. If any pixels left they will be handled by the next area in the next `while` iteration
const maxPixelsToShrink = areaToShrinkSize - areaToShrinkMinSize
const maxPixelsToExpand = areaToExpandMaxSize - areaToExpandSize
const pixelsToTransfer = Math.min(maxPixelsToShrink, maxPixelsToExpand, remainingPixels)
// Actual pixels transfer
tempAreasPixelSizes[areaIndexToShrink] -= pixelsToTransfer
tempAreasPixelSizes[areaIndexToExpand] += pixelsToTransfer
remainingPixels -= pixelsToTransfer
// Once min threshold reached we need to move to the next area in turn
if (tempAreasPixelSizes[areaIndexToShrink] === areaToShrinkMinSize) {
potentialShrinkArrIndex++
}
// Once max threshold reached we need to move to the next area in turn
if (tempAreasPixelSizes[areaIndexToExpand] === areaToExpandMaxSize) {
potentialExpandArrIndex++
}
}
this._areas().forEach((area, index) => {
// No need to update wildcard size
if (area._internalSize() === '*') {
return
}
if (this.unit() === 'pixel') {
area._internalSize.set(tempAreasPixelSizes[index])
} else {
const percentSize = (tempAreasPixelSizes[index] / dragStartContext.totalAreasPixelSize) * 100
// Fix javascript only working with float numbers which are inaccurate compared to decimals
area._internalSize.set(parseFloat(percentSize.toFixed(10)))
}
})
this.dragProgressSubject.next(this.createDragInteractionEvent(this.draggedGutterIndex()))
}
private createGridTemplateColumnsStyle(): string {
const columns: string[] = []
const sumNonWildcardSizes = sum(this._visibleAreas(), (area) => {
const size = area._internalSize()
return size === '*' ? 0 : size
})
const visibleAreasCount = this._visibleAreas().length
let visitedVisibleAreas = 0
this._areas().forEach((area, index, areas) => {
const unit = this.unit()
const areaSize = area._internalSize()
// Add area size column
if (!area.visible()) {
columns.push(unit === 'percent' || areaSize === '*' ? '0fr' : '0px')
} else {
if (unit === 'pixel') {
const columnValue = areaSize === '*' ? '1fr' : `${areaSize}px`
columns.push(columnValue)
} else {
const percentSize = areaSize === '*' ? 100 - sumNonWildcardSizes : areaSize
const columnValue = `${percentSize}fr`
columns.push(columnValue)
}
visitedVisibleAreas++
}
const isLastArea = index === areas.length - 1
if (isLastArea) {
return
}
const remainingVisibleAreas = visibleAreasCount - visitedVisibleAreas
// Only add gutter with size if this area is visible and there are more visible areas after this one
// to avoid ghost gutters
if (area.visible() && remainingVisibleAreas > 0) {
columns.push(`${this.gutterSize()}px`)
} else {
columns.push('0px')
}
})
return this.direction() === 'horizontal' ? `1fr / ${columns.join(' ')}` : `${columns.join(' ')} / 1fr`
}
private createAlignedVisibleAreasSize(): SplitAreaSize[] {
const visibleAreasSizes = this._visibleAreas().map((area): SplitAreaSize => {
const size = area.size()
return size === 'auto' ? '*' : size
})
const isValid = areAreasValid(this._visibleAreas(), this.unit(), false)
if (isValid) {
return visibleAreasSizes
}
const unit = this.unit()
if (unit === 'percent') {
// Distribute sizes equally
const defaultPercentSize = 100 / visibleAreasSizes.length
return visibleAreasSizes.map(() => defaultPercentSize)
}
if (unit === 'pixel') {
// Make sure only one wildcard area
const wildcardAreas = visibleAreasSizes.filter((areaSize) => areaSize === '*')
if (wildcardAreas.length === 0) {
return ['*', ...visibleAreasSizes.slice(1)]
} else {
const firstWildcardIndex = visibleAreasSizes.findIndex((areaSize) => areaSize === '*')
const defaultPxSize = 100
return visibleAreasSizes.map((areaSize, index) =>
index === firstWildcardIndex || areaSize !== '*' ? areaSize : defaultPxSize,
)
}
}
return assertUnreachable(unit, 'SplitUnit')
}
}