-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
8a2aa50
commit 4fda996
Showing
18 changed files
with
251 additions
and
54 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
28 changes: 28 additions & 0 deletions
28
...tal/database-data/components/database-inline-select/database-inline-select.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,28 @@ | ||
<ng-container *ngIf="store.vm$ | async as vm"> | ||
<div | ||
class="database-inline-select" | ||
tpPlacement="bottom-start" | ||
[tp]="dbSelect" | ||
tpVariation="popper" | ||
> | ||
<div class="text-xl text-600"> | ||
{{ | ||
getSelectedDbName(vm.data, selectedItemId, selectedItemName) | ||
?.displayName | ||
}} | ||
</div> | ||
<span class="mix-icon text-600 text-xxl">arrow_drop_down</span> | ||
</div> | ||
|
||
<ng-template #dbSelect let-hide> | ||
@for (item of vm.data; track item) { | ||
<div | ||
class="mix-menu-item d-flex justify-content-between" | ||
(click)="selectDb(item); hide()" | ||
> | ||
<div class="text-500">{{ item.displayName }}</div> | ||
<div class="text-sub text-s">{{ item.columns.length }} cols</div> | ||
</div> | ||
} | ||
</ng-template> | ||
</ng-container> |
11 changes: 11 additions & 0 deletions
11
...tal/database-data/components/database-inline-select/database-inline-select.component.scss
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,11 @@ | ||
.database-inline-select { | ||
display: flex; | ||
gap: 2px; | ||
align-items: center; | ||
cursor: pointer; | ||
border-bottom: 1px solid var(--border-color-default); | ||
|
||
&:hover { | ||
color: var(--primary-color); | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
...ortal/database-data/components/database-inline-select/database-inline-select.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,45 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { | ||
ChangeDetectionStrategy, | ||
Component, | ||
EventEmitter, | ||
Input, | ||
Output, | ||
inject, | ||
} from '@angular/core'; | ||
import { MixDatabase } from '@mixcore/lib/model'; | ||
import { DatabaseStore } from '@mixcore/share/stores'; | ||
import { TippyDirective } from '@ngneat/helipopper'; | ||
import { tuiPure } from '@taiga-ui/cdk'; | ||
|
||
@Component({ | ||
selector: 'mix-database-inline-select', | ||
standalone: true, | ||
imports: [CommonModule, TippyDirective], | ||
templateUrl: './database-inline-select.component.html', | ||
styleUrl: './database-inline-select.component.scss', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class DatabaseInlineSelectComponent { | ||
public store = inject(DatabaseStore); | ||
|
||
@Input() public selectedItemId?: number; | ||
@Input() public selectedItemName?: string; | ||
@Output() public selectedItemChange = new EventEmitter<MixDatabase>(); | ||
|
||
@tuiPure | ||
public getSelectedDbName( | ||
db: MixDatabase[], | ||
selectedItemId?: number, | ||
selectedItemName?: string | ||
) { | ||
return db.find( | ||
(x) => x.id === selectedItemId || x.systemName === selectedItemName | ||
); | ||
} | ||
|
||
public selectDb(mixDb: MixDatabase) { | ||
this.selectedItemId = mixDb.id; | ||
this.selectedItemChange.emit(mixDb); | ||
} | ||
} |
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
10 changes: 8 additions & 2 deletions
10
libs/mix-share/src/components/sub-toolbar/sub-toolbar.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
Oops, something went wrong.
4fda996
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
mix-portal-angular – ./
mix-portal-angular-mixcore.vercel.app
mix-portal-angular-git-master-mixcore.vercel.app
mix-portal-angular.vercel.app
admin.mixcore.dev
studio.mixcore.net