-
-
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.
Merge pull request #7 from silicia-apps/draft/serene-tamas
add select language component
- Loading branch information
Showing
14 changed files
with
12,744 additions
and
12,518 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<sio-page title="test" color="primary"> | ||
{{ 'M_HOME' | translate }} | ||
<sio-language-selector></sio-language-selector> | ||
</sio-page> |
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
6 changes: 6 additions & 0 deletions
6
libs/core/src/lib/components/language-selector/language-selector.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,6 @@ | ||
<ion-item> | ||
<ion-select [label]="this.label" (ionChange)="this.onChange($event)"> | ||
<ion-select-option value="it">Italiano</ion-select-option> | ||
<ion-select-option value="en">Inglese</ion-select-option> | ||
</ion-select> | ||
</ion-item> |
3 changes: 3 additions & 0 deletions
3
libs/core/src/lib/components/language-selector/language-selector.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,3 @@ | ||
:host { | ||
|
||
} |
43 changes: 43 additions & 0 deletions
43
libs/core/src/lib/components/language-selector/language-selector.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,43 @@ | ||
import { Component, Input, OnInit, ViewChild } from '@angular/core'; | ||
import { IonToggle } from '@ionic/angular'; | ||
import { Select } from '@ngxs/store'; | ||
import { Observable } from 'rxjs'; | ||
import { Loggable, SioCoreLoggerService } from '../../services'; | ||
import { SioColorType } from '../../shared/shared.type'; | ||
import { SioCoreAppComponentState } from '../../store'; | ||
import { TranslateService } from '@ngx-translate/core'; | ||
|
||
@Loggable() | ||
@Component({ | ||
selector: 'sio-language-selector', | ||
templateUrl: './language-selector.component.html', | ||
styleUrls: ['./language-selector.component.scss'], | ||
}) | ||
export class SioCoreLanguageSelectorComponent implements OnInit { | ||
@Input() public caption = 'L_LANGUAGE'; | ||
@Input() public style: 'default' | undefined = undefined; | ||
@Input() public color: SioColorType; | ||
@Input() public icon = 'sunny'; | ||
|
||
public label = 'L_LANGUAGE'; | ||
|
||
//@Select(SioCoreAppComponentState) darkmode$!: Observable<boolean>; | ||
|
||
//@ViewChild('darkmode_toggle', { static: true }) ionToggle!: IonToggle; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-empty-function | ||
constructor( | ||
private sioCoreLoggerService: SioCoreLoggerService, | ||
public sioCoreAppComponentState: SioCoreAppComponentState, | ||
private translateService: TranslateService, | ||
) {} | ||
|
||
ngOnInit(): void { | ||
null; | ||
} | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
public onChange(event: any) { | ||
this.sioCoreLoggerService.debug('set language to ' + event.detail.value); | ||
this.translateService.use(event.detail.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
Oops, something went wrong.