-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
35b38a6
commit b1ea01b
Showing
28 changed files
with
712 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright (c) 2018-2024 Swiss Federal Railways | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
|
||
import {UUID} from '@scion/toolkit/uuid'; | ||
|
||
/** | ||
* Generates a UID (unique identifier). | ||
*/ | ||
export const UID = { | ||
/** | ||
* Generates a UID (unique identifier) with length 8. | ||
*/ | ||
randomUID: (): string => { | ||
return UUID.randomUUID().substring(0, 8); | ||
}, | ||
}; | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 22 additions & 16 deletions
38
projects/scion/workbench/src/lib/layout/grid-element/grid-element.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,25 @@ | ||
<!-- MPart (leaf) --> | ||
<ng-container *ngIf="element | wbInstanceof:MPart as part" [cdkPortalOutlet]="part.id | wbPartPortal"></ng-container> | ||
@if (element | wbInstanceof:MPart; as part) { | ||
<ng-container [cdkPortalOutlet]="part.id | wbPartPortal"/> | ||
} | ||
|
||
<!-- MTreeNode --> | ||
<ng-container *ngIf="element | wbInstanceof:MTreeNode as treeNode"> | ||
<!-- Node with a single visible child. --> | ||
<wb-grid-element *ngIf="children.length === 1" [element]="children[0].element"></wb-grid-element> | ||
|
||
<!-- Node with multiple visible children. --> | ||
<sci-sashbox *ngIf="children.length > 1" | ||
[direction]="treeNode.direction" | ||
[attr.data-nodeid]="treeNode.nodeId" | ||
(sashStart)="onSashStart()" | ||
(sashEnd)="onSashEnd(treeNode, $event)"> | ||
<ng-template *ngFor="let child of children; index as i; trackBy: indexTrackByFn" sciSash [size]="child.size"> | ||
<wb-grid-element [element]="child.element" [class]="'sash-' + (i + 1)"></wb-grid-element> | ||
</ng-template> | ||
</sci-sashbox> | ||
</ng-container> | ||
@if (element | wbInstanceof:MTreeNode; as treeNode) { | ||
@if (children.length === 1) { | ||
<!-- Node with a single visible child. --> | ||
<wb-grid-element [element]="children[0].element"/> | ||
} | ||
@if (children.length > 1) { | ||
<!-- Node with multiple visible children. --> | ||
<sci-sashbox [direction]="treeNode.direction" | ||
[attr.data-nodeid]="treeNode.id" | ||
(sashStart)="onSashStart()" | ||
(sashEnd)="onSashEnd(treeNode, $event)"> | ||
@for (child of children; track child.element.id) { | ||
<ng-template sciSash [size]="child.size"> | ||
<wb-grid-element [element]="child.element" [class]="'sash-' + ($index + 1)"/> | ||
</ng-template> | ||
} | ||
</sci-sashbox> | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.