oip-common 0.0.18 → 0.0.21
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 +66 -26
- package/assets/demo/flags/flags.scss +246 -2
- package/assets/i18n/config.en.json +11 -8
- package/assets/i18n/config.ru.json +11 -8
- package/assets/i18n/db-migration.en.json +19 -19
- package/assets/i18n/db-migration.ru.json +19 -19
- package/assets/i18n/notfound.en.json +8 -8
- package/assets/i18n/notfound.ru.json +8 -8
- package/assets/layout/layout.scss +13 -13
- package/fesm2022/oip-common.mjs +1005 -880
- package/fesm2022/oip-common.mjs.map +1 -1
- package/index.d.ts +109 -85
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,26 +1,66 @@
|
|
|
1
|
-
# OipCommon
|
|
2
|
-
|
|
3
|
-
Add assets in angular.json
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/* Your config */
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
```
|
|
1
|
+
# OipCommon
|
|
2
|
+
|
|
3
|
+
Add assets in angular.json
|
|
4
|
+
|
|
5
|
+
```json
|
|
6
|
+
{
|
|
7
|
+
"glob": "**/*",
|
|
8
|
+
"input": "node_modules/oip-common/assets",
|
|
9
|
+
"output": "/assets"
|
|
10
|
+
}
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Add tailwind config
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
const primeui = require("tailwindcss-primeui");
|
|
17
|
+
module.exports = {
|
|
18
|
+
/* Your config */
|
|
19
|
+
content: [, /* Your config */ "./node_modules/oip-common/**/*.{html,ts,scss,css,js,mjs}"]
|
|
20
|
+
/* Your config */
|
|
21
|
+
};
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Add scss
|
|
25
|
+
|
|
26
|
+
```sass
|
|
27
|
+
@use "../../../node_modules/oip-common/assets/oip-common";
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Init L10nService to AppComponent
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { Component, inject, OnInit } from '@angular/core';
|
|
34
|
+
import { SecurityService } from 'oip-common';
|
|
35
|
+
import { RouterOutlet } from '@angular/router';
|
|
36
|
+
import { ToastModule } from 'primeng/toast';
|
|
37
|
+
import { L10nService } from '../../../oip-common/src/services/l10n.service';
|
|
38
|
+
|
|
39
|
+
@Component({
|
|
40
|
+
selector: 'app-root',
|
|
41
|
+
template: `
|
|
42
|
+
<p-toast/>
|
|
43
|
+
<router-outlet></router-outlet>
|
|
44
|
+
`,
|
|
45
|
+
standalone: true,
|
|
46
|
+
imports: [ToastModule, RouterOutlet]
|
|
47
|
+
})
|
|
48
|
+
export class AppComponent implements OnInit {
|
|
49
|
+
private readonly securityService = inject(SecurityService);
|
|
50
|
+
private readonly translateService = inject(L10nService);
|
|
51
|
+
|
|
52
|
+
ngOnInit() {
|
|
53
|
+
this.securityService.auth();
|
|
54
|
+
this.translateService.init([{
|
|
55
|
+
code: 'en',
|
|
56
|
+
name: "English",
|
|
57
|
+
icon: "flag flag-gb"
|
|
58
|
+
}, {
|
|
59
|
+
code: 'ru',
|
|
60
|
+
name: "Русский",
|
|
61
|
+
icon: "flag flag-ru"
|
|
62
|
+
}]);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
```
|