generated from maximegris/angular-electron
-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
35 changed files
with
414 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { ICoreContent } from '../../interfaces'; | ||
import { id } from './id'; | ||
|
||
export const defaultCore: () => ICoreContent = () => ({ | ||
_id: id(), | ||
name: '', | ||
yaml: '', | ||
}); |
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
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
18 changes: 18 additions & 0 deletions
18
src/app/tabs/cores/cores-editor/cores-editor.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
@let editingData = editing(); | ||
|
||
<div role="tablist" class="tabs tabs-boxed rounded-none mb-3"> | ||
|
||
<div class="tab flex flex-row justify-end"> | ||
<button class="btn-sm btn btn-warning mr-3" (click)="doBack()">Go Back</button> | ||
<button class="btn-sm btn btn-secondary" [disabled]="!canSave()" (click)="doSave()">Save</button> | ||
</div> | ||
|
||
</div> | ||
|
||
<div class="flex flex-row gap-2"> | ||
<div class="form-column"> | ||
|
||
<div class="form-row"> | ||
</div> | ||
</div> | ||
</div> |
Empty file.
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,17 @@ | ||
import { Component, computed, signal } from '@angular/core'; | ||
import { ICoreContent } from '../../../../interfaces'; | ||
import { EditorBaseComponent } from '../../../shared/components/editor-base/editor-base.component'; | ||
|
||
@Component({ | ||
selector: 'app-cores-editor', | ||
templateUrl: './cores-editor.component.html', | ||
styleUrl: './cores-editor.component.scss', | ||
}) | ||
export class CoresEditorComponent extends EditorBaseComponent<ICoreContent> { | ||
public currentItem = signal<ICoreContent | undefined>(undefined); | ||
|
||
public canSave = computed(() => { | ||
const data = this.editing(); | ||
return data.yaml; | ||
}); | ||
} |
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,10 @@ | ||
@let editing = isEditing(); | ||
|
||
<app-editor-view-table [class.hidden]="editing" [dataType]="'core content items'" [tableColumns]="tableColumns" | ||
[tableItems]="tableItems()" (create)="createNew()" (filterChanged)="filterChanged($event)" | ||
[defaultFilterState]="tableFilterState()"></app-editor-view-table> | ||
|
||
@if(editing) { | ||
<app-cores-editor class="h-full w-full" [editing]="editingData()" (goBack)="cancelEditing()" | ||
(save)="saveNewData($event)"></app-cores-editor> | ||
} |
Empty file.
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,65 @@ | ||
import { Component, computed } from '@angular/core'; | ||
import { ColDef } from 'ag-grid-community'; | ||
|
||
import { ICoreContent, IModKit } from '../../../interfaces'; | ||
import { defaultCore } from '../../helpers/core'; | ||
import { CellButtonsComponent } from '../../shared/components/cell-buttons/cell-buttons.component'; | ||
import { EditorBaseTableComponent } from '../../shared/components/editor-base-table/editor-base-table.component'; | ||
import { HeaderButtonsComponent } from '../../shared/components/header-buttons/header-buttons.component'; | ||
|
||
type EditingType = ICoreContent; | ||
|
||
@Component({ | ||
selector: 'app-cores', | ||
templateUrl: './cores.component.html', | ||
styleUrl: './cores.component.scss', | ||
}) | ||
export class CoresComponent extends EditorBaseTableComponent<EditingType> { | ||
protected dataKey: keyof Omit<IModKit, 'meta'> = 'drops'; | ||
|
||
public defaultData = defaultCore; | ||
|
||
public tableItems = computed(() => this.modService.mod().cores); | ||
public tableColumns: ColDef[] = [ | ||
{ | ||
field: 'mapName', | ||
flex: 1, | ||
cellDataType: 'text', | ||
filter: 'agTextColumnFilter', | ||
sort: 'asc', | ||
}, | ||
{ | ||
field: 'regionName', | ||
flex: 1, | ||
cellDataType: 'text', | ||
filter: 'agTextColumnFilter', | ||
sort: 'asc', | ||
}, | ||
{ | ||
field: 'isGlobal', | ||
flex: 1, | ||
cellDataType: 'boolean', | ||
sort: 'asc', | ||
}, | ||
{ | ||
field: '', | ||
width: 200, | ||
sortable: false, | ||
suppressMovable: true, | ||
headerComponent: HeaderButtonsComponent, | ||
headerComponentParams: { | ||
showNewButton: true, | ||
newCallback: () => this.createNew(), | ||
}, | ||
cellRenderer: CellButtonsComponent, | ||
cellClass: 'no-adjust', | ||
cellRendererParams: { | ||
showCopyButton: false, | ||
showEditButton: true, | ||
editCallback: (item: EditingType) => this.editExisting(item), | ||
showDeleteButton: true, | ||
deleteCallback: (item: EditingType) => this.deleteData(item), | ||
}, | ||
}, | ||
]; | ||
} |
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 @@ | ||
<p>stems-editor works!</p> |
Empty file.
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,10 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-stems-editor', | ||
templateUrl: './stems-editor.component.html', | ||
styleUrl: './stems-editor.component.scss' | ||
}) | ||
export class StemsEditorComponent { | ||
|
||
} |
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 @@ | ||
<p>stems works!</p> |
Empty file.
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,10 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-stems', | ||
templateUrl: './stems.component.html', | ||
styleUrl: './stems.component.scss' | ||
}) | ||
export class StemsComponent { | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
src/app/tabs/trait-trees/trait-trees-editor/trait-trees-editor.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>trait-trees-editor works!</p> |
Empty file.
10 changes: 10 additions & 0 deletions
10
src/app/tabs/trait-trees/trait-trees-editor/trait-trees-editor.component.ts
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,10 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-trait-trees-editor', | ||
templateUrl: './trait-trees-editor.component.html', | ||
styleUrl: './trait-trees-editor.component.scss' | ||
}) | ||
export class TraitTreesEditorComponent { | ||
|
||
} |
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 @@ | ||
<p>trait-trees works!</p> |
Empty file.
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,10 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-trait-trees', | ||
templateUrl: './trait-trees.component.html', | ||
styleUrl: './trait-trees.component.scss' | ||
}) | ||
export class TraitTreesComponent { | ||
|
||
} |
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,6 @@ | ||
import { HasIdentification } from './identified'; | ||
|
||
export interface ICoreContent extends HasIdentification { | ||
name: string; | ||
yaml: string; | ||
} |
Oops, something went wrong.