ngx-gp-components-dev-test 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# GP - Components
|
|
2
|
+
|
|
3
|
+
A library providing standard UI components to be used in widgets. All widgets should consist of these components to ensure uniform and recognizable UI experience across all widgets.
|
|
4
|
+
|
|
5
|
+
## Building
|
|
6
|
+
|
|
7
|
+
To build the library, run:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ng build ngx-gp-components
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
|
|
14
|
+
|
|
15
|
+
### Publishing the Library
|
|
16
|
+
|
|
17
|
+
Once the project is built, you can publish your library by following these steps:
|
|
18
|
+
|
|
19
|
+
1. Navigate to the `dist` directory:
|
|
20
|
+
```bash
|
|
21
|
+
cd dist/ngx-gp-components
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
2. Run the `npm publish` command to publish your library to the npm registry:
|
|
25
|
+
```bash
|
|
26
|
+
npm publish
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Running unit tests
|
|
30
|
+
|
|
31
|
+
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
ng test
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Localization
|
|
38
|
+
|
|
39
|
+
To use localization, add the following to your `angular.json` file:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"architect": {
|
|
44
|
+
"build": {
|
|
45
|
+
"options": {
|
|
46
|
+
"assets": [
|
|
47
|
+
"...",
|
|
48
|
+
{
|
|
49
|
+
"glob": "**/*.json",
|
|
50
|
+
"input": "path to localization files in project",
|
|
51
|
+
"output": "assets/i18n"
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The localization files should be in the following format:
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"hello": "Hallo",
|
|
64
|
+
"world": "Welt"
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
The standard localization file is German/'de' and the naming convention is messages.\<language>.json
|
|
68
|
+
|
|
69
|
+
To get the localized string, use the following method:
|
|
70
|
+
```typescript
|
|
71
|
+
getLocalizedString(key)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
For the above json file, calling `getLocalizedString('hello')` will return 'Hallo'.
|