@processpuzzle/widgets
v0.1.3
Published
 [](https://sonarcloud.io/summa
Downloads
26
Readme
@processpuzzle/widgets
This library provides a range of small widgets that can be built into an Angular application. These widgets primarily define UI elements but also domain classes or signal stores. Some of them are even persistent, so they need appropriate configuration to access the backend.
Language Selector Component
The LanguageSelector is an Angular component designed to allow users to select their preferred language in an application. It integrates seamlessly with the Transloco library for internationalization and supports dynamic updates of the application's language.
Features
- Language Selection: Allows switching between predefined languages.
- Integration with Transloco: Updates active language using
TranslocoService. - Dynamic Label Translation: Displays localized language names.
- Single Selection: Users can select only one language at a time.
- Customizable Options: Easily configure available languages and their labels.
Setup and Usage
Installation
Ensure that you have the required dependencies for Angular Material and Transloco installed:
npm install @angular/material @jsverse/translocoTemplate Example
Add the LanguageSelector component to your application:
<pp-language-selector [languages]="languages" [selectedLanguage]="selectedLanguage"></pp-language-selector>Component Configuration
Input Properties
| Input | Type | Description |
| --- | --- | --- |
| languages | Array | An array of available language objects. Each object should include code, label, and flag. |
| selectedLanguage | string | The current active language code. This value indicates which language is selected by default. |
Example Language Configuration:
