Start adding editor, fix up sidebar styling

This commit is contained in:
2024-06-22 14:19:23 +09:30
parent c9c7878263
commit 9c2531a034
24 changed files with 489 additions and 81 deletions

View File

@@ -19,6 +19,7 @@ export interface FileOrFolder {
isDirectory: boolean;
name: string;
children?: FileOrFolder[];
path: string;
}
interface FileNode {
@@ -31,29 +32,7 @@ interface FileNode {
selector: 'app-file-tree',
standalone: true,
imports: [CommonModule, MatTreeModule, MatIconModule, MatButtonModule],
template: `<mat-tree [dataSource]="dataSource()" [treeControl]="treeControl">
<mat-tree-node
*matTreeNodeDef="let node"
matTreeNodePadding
(click)="fileSelected.emit(node.file)"
>
<button mat-icon-button disabled></button>
{{ node.file.name }}
</mat-tree-node>
<mat-tree-node *matTreeNodeDef="let node; when: hasChild" matTreeNodeToggle>
<button
mat-icon-button
matTreeNodePadding
[attr.aria-label]="'Toggle ' + node.file.name"
>
<mat-icon class="mat-icon-rtl-mirror">
@if (treeControl.isExpanded(node)) { expand_more } @else {
chevron_right }
</mat-icon>
</button>
{{ node.file.name }}
</mat-tree-node>
</mat-tree>`,
templateUrl: './file-tree.component.html',
styleUrl: './file-tree.component.scss',
})
export class FileTreeComponent {