-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add looping mode selection to *-shift ops
- Loading branch information
1 parent
332840f
commit 33b98fa
Showing
24 changed files
with
235 additions
and
68 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
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
14 changes: 14 additions & 0 deletions
14
...nding-edit/contorl-select-looping-mode/binding-control-select-looping-mode.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,14 @@ | ||
<ng-container *ngIf="control"> | ||
<mat-form-field> | ||
<mat-label> | ||
{{ 'controlScheme.loopingModeTitle' | transloco }} | ||
</mat-label> | ||
<mat-select [formControl]="control"> | ||
<mat-option *ngFor="let mode of availableLoopingModes" | ||
[value]="mode" | ||
> | ||
{{ mode | loopingModeToL10nKey | transloco }} | ||
</mat-option> | ||
</mat-select> | ||
</mat-form-field> | ||
</ng-container> |
7 changes: 7 additions & 0 deletions
7
...nding-edit/contorl-select-looping-mode/binding-control-select-looping-mode.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,7 @@ | ||
:host { | ||
display: block; | ||
} | ||
|
||
mat-form-field { | ||
width: 100%; | ||
} |
33 changes: 33 additions & 0 deletions
33
...binding-edit/contorl-select-looping-mode/binding-control-select-looping-mode.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,33 @@ | ||
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; | ||
import { FormControl, ReactiveFormsModule } from '@angular/forms'; | ||
import { MatFormFieldModule } from '@angular/material/form-field'; | ||
import { MatOptionModule } from '@angular/material/core'; | ||
import { MatSelectModule } from '@angular/material/select'; | ||
import { NgForOf, NgIf } from '@angular/common'; | ||
import { TranslocoModule } from '@ngneat/transloco'; | ||
import { LoopingMode } from '@app/store'; | ||
|
||
import { LoopingModeToL10nKeyPipe } from './looping-mode-to-l10n-key.pipe'; | ||
|
||
@Component({ | ||
standalone: true, | ||
selector: 'app-binding-control-select-looping-mode', | ||
templateUrl: './binding-control-select-looping-mode.component.html', | ||
styleUrls: [ './binding-control-select-looping-mode.component.scss' ], | ||
imports: [ | ||
MatFormFieldModule, | ||
MatOptionModule, | ||
MatSelectModule, | ||
NgForOf, | ||
NgIf, | ||
ReactiveFormsModule, | ||
TranslocoModule, | ||
LoopingModeToL10nKeyPipe | ||
], | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class BindingControlSelectLoopingModeComponent { | ||
@Input() public control?: FormControl<LoopingMode>; | ||
|
||
public readonly availableLoopingModes: ReadonlyArray<LoopingMode> = Object.values(LoopingMode); | ||
} |
1 change: 1 addition & 0 deletions
1
src/app/control-schemes/binding-edit/contorl-select-looping-mode/index.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 @@ | ||
export * from './binding-control-select-looping-mode.component'; |
21 changes: 21 additions & 0 deletions
21
...control-schemes/binding-edit/contorl-select-looping-mode/looping-mode-to-l10n-key.pipe.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,21 @@ | ||
import { Pipe, PipeTransform } from '@angular/core'; | ||
import { LoopingMode } from '@app/store'; | ||
|
||
@Pipe({ | ||
standalone: true, | ||
name: 'loopingModeToL10nKey', | ||
pure: true | ||
}) | ||
export class LoopingModeToL10nKeyPipe implements PipeTransform { | ||
private readonly loopingModeToL10nKeyMap: { [k in LoopingMode]: string } = { | ||
[LoopingMode.None]: 'controlScheme.loopingModeNone', | ||
[LoopingMode.Wrap]: 'controlScheme.loopingModeWrap', | ||
[LoopingMode.Mirror]: 'controlScheme.loopingModeMirror' | ||
}; | ||
|
||
public transform( | ||
value: LoopingMode | ||
): string { | ||
return this.loopingModeToL10nKeyMap[value]; | ||
} | ||
} |
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
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.