@edsis/angular 21.1.4 → 21.1.27
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/.npmignore +2 -0
- package/README.md +123 -88
- package/brand/etos/README.md +273 -0
- package/brand/etos/package.json +4 -0
- package/chart/README.md +0 -0
- package/chart/package.json +4 -0
- package/collection.json +30 -0
- package/component/package.json +4 -0
- package/etos/styles/color.css +73 -0
- package/etos/styles/index.css +7 -0
- package/etos/styles/layout.css +21 -0
- package/etos/styles/package.css +15 -0
- package/etos/styles/style.css +53 -0
- package/fesm2022/ojiepermana-angular-brand-etos.mjs +1060 -0
- package/fesm2022/ojiepermana-angular-brand-etos.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-chart.mjs +3714 -0
- package/fesm2022/ojiepermana-angular-chart.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component.mjs +4069 -0
- package/fesm2022/ojiepermana-angular-component.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-generator-api.mjs +67 -0
- package/fesm2022/ojiepermana-angular-generator-api.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-layout.mjs +457 -0
- package/fesm2022/ojiepermana-angular-layout.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-navigation.mjs +2315 -0
- package/fesm2022/ojiepermana-angular-navigation.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-theme.mjs +407 -0
- package/fesm2022/ojiepermana-angular-theme.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular.mjs +22 -0
- package/fesm2022/ojiepermana-angular.mjs.map +1 -0
- package/generator/api/README.md +246 -0
- package/generator/api/bin/package.json +3 -0
- package/generator/api/bin/schematics/init/index.js +88 -0
- package/generator/api/bin/schematics/ng-add/index.js +108 -0
- package/generator/api/bin/schematics/sdk/index.js +76 -0
- package/generator/api/bin/src/config/loader.js +41 -0
- package/generator/api/bin/src/config/schema.js +56 -0
- package/generator/api/bin/src/emit/client.js +246 -0
- package/generator/api/bin/src/emit/metadata.js +295 -0
- package/generator/api/bin/src/emit/models.js +106 -0
- package/generator/api/bin/src/emit/navigation.js +56 -0
- package/generator/api/bin/src/emit/operations.js +122 -0
- package/generator/api/bin/src/emit/public-api.js +54 -0
- package/generator/api/bin/src/emit/services.js +87 -0
- package/generator/api/bin/src/engine.js +65 -0
- package/generator/api/bin/src/layout/per-domain.js +355 -0
- package/generator/api/bin/src/parser/bundle.js +25 -0
- package/generator/api/bin/src/parser/ir.js +320 -0
- package/generator/api/bin/src/parser/types.js +7 -0
- package/generator/api/bin/src/render/template.js +58 -0
- package/generator/api/bin/src/writer/index.js +236 -0
- package/generator/api/package.json +4 -0
- package/generator/api/schematics/init/schema.json +19 -0
- package/generator/api/schematics/ng-add/schema.json +14 -0
- package/generator/api/schematics/sdk/schema.json +19 -0
- package/generator/api/sdk.config.example.json +22 -0
- package/generator/guide/README.md +84 -0
- package/generator/guide/bin/package.json +3 -0
- package/generator/guide/bin/schematics/build/index.js +35 -0
- package/generator/guide/bin/schematics/init/index.js +70 -0
- package/generator/guide/bin/src/config/loader.js +50 -0
- package/generator/guide/bin/src/config/schema.js +12 -0
- package/generator/guide/bin/src/engine/component.js +73 -0
- package/generator/guide/bin/src/engine/frontmatter.js +42 -0
- package/generator/guide/bin/src/engine/index.js +42 -0
- package/generator/guide/bin/src/engine/naming.js +39 -0
- package/generator/guide/bin/src/engine/render.js +18 -0
- package/generator/guide/bin/src/engine/routes.js +106 -0
- package/generator/guide/bin/src/engine/walk.js +35 -0
- package/generator/guide/guide.config.example.json +9 -0
- package/generator/guide/schematics/build/schema.json +14 -0
- package/generator/guide/schematics/init/schema.json +19 -0
- package/layout/package.json +4 -0
- package/navigation/package.json +4 -0
- package/package.json +102 -39
- package/theme/package.json +4 -0
- package/theme/styles/etos.css +6 -0
- package/theme/styles/index.css +32 -0
- package/theme/styles/themes/library/_components.css +81 -0
- package/theme/styles/themes/library/_layers.css +15 -0
- package/theme/styles/themes/library/_material-overrides.css +254 -0
- package/theme/styles/themes/library/_tokens.css +55 -0
- package/theme/styles/themes/library/color/amber.css +31 -0
- package/theme/styles/themes/library/color/base.css +36 -0
- package/theme/styles/themes/library/color/blue.css +31 -0
- package/theme/styles/themes/library/color/cyan.css +31 -0
- package/theme/styles/themes/library/color/emerald.css +31 -0
- package/theme/styles/themes/library/color/fuchsia.css +31 -0
- package/theme/styles/themes/library/color/green.css +31 -0
- package/theme/styles/themes/library/color/index.css +22 -0
- package/theme/styles/themes/library/color/indigo.css +31 -0
- package/theme/styles/themes/library/color/lime.css +31 -0
- package/theme/styles/themes/library/color/orange.css +31 -0
- package/theme/styles/themes/library/color/pink.css +31 -0
- package/theme/styles/themes/library/color/purple.css +31 -0
- package/theme/styles/themes/library/color/red.css +31 -0
- package/theme/styles/themes/library/color/rose.css +31 -0
- package/theme/styles/themes/library/color/sky.css +31 -0
- package/theme/styles/themes/library/color/teal.css +31 -0
- package/theme/styles/themes/library/color/violet.css +31 -0
- package/theme/styles/themes/library/color/yellow.css +31 -0
- package/theme/styles/themes/library/style/brutal.css +50 -0
- package/theme/styles/themes/library/style/default.css +54 -0
- package/theme/styles/themes/library/style/index.css +8 -0
- package/theme/styles/themes/library/style/sharp.css +50 -0
- package/theme/styles/themes/library/style/soft.css +50 -0
- package/theme/styles/themes/mode/dark.css +20 -0
- package/theme/styles/themes/mode/index.css +6 -0
- package/theme/styles/themes/mode/light.css +24 -0
- package/theme/styles/themes/tailwind.css +114 -0
- package/types/ojiepermana-angular-brand-etos.d.ts +162 -0
- package/types/ojiepermana-angular-chart.d.ts +1094 -0
- package/types/ojiepermana-angular-component.d.ts +1386 -0
- package/types/ojiepermana-angular-generator-api.d.ts +85 -0
- package/types/ojiepermana-angular-layout.d.ts +163 -0
- package/types/ojiepermana-angular-navigation.d.ts +388 -0
- package/types/ojiepermana-angular-theme.d.ts +171 -0
- package/types/ojiepermana-angular.d.ts +3 -0
- package/fesm2022/edsis-angular-auth.mjs +0 -1209
- package/fesm2022/edsis-angular-auth.mjs.map +0 -1
- package/fesm2022/edsis-angular-sdk-access.mjs +0 -1364
- package/fesm2022/edsis-angular-sdk-access.mjs.map +0 -1
- package/fesm2022/edsis-angular-sdk-approval.mjs +0 -1258
- package/fesm2022/edsis-angular-sdk-approval.mjs.map +0 -1
- package/fesm2022/edsis-angular-sdk-auth.mjs +0 -253
- package/fesm2022/edsis-angular-sdk-auth.mjs.map +0 -1
- package/fesm2022/edsis-angular-sdk-employee.mjs +0 -283
- package/fesm2022/edsis-angular-sdk-employee.mjs.map +0 -1
- package/fesm2022/edsis-angular-sdk-health.mjs +0 -95
- package/fesm2022/edsis-angular-sdk-health.mjs.map +0 -1
- package/fesm2022/edsis-angular-sdk-shared.mjs +0 -2740
- package/fesm2022/edsis-angular-sdk-shared.mjs.map +0 -1
- package/fesm2022/edsis-angular-sdk-storage.mjs +0 -287
- package/fesm2022/edsis-angular-sdk-storage.mjs.map +0 -1
- package/fesm2022/edsis-angular-sdk-user.mjs +0 -488
- package/fesm2022/edsis-angular-sdk-user.mjs.map +0 -1
- package/fesm2022/edsis-angular-sdk.mjs +0 -6730
- package/fesm2022/edsis-angular-sdk.mjs.map +0 -1
- package/fesm2022/edsis-angular.mjs +0 -8
- package/fesm2022/edsis-angular.mjs.map +0 -1
- package/types/edsis-angular-auth.d.ts +0 -119
- package/types/edsis-angular-sdk-access.d.ts +0 -546
- package/types/edsis-angular-sdk-approval.d.ts +0 -637
- package/types/edsis-angular-sdk-auth.d.ts +0 -127
- package/types/edsis-angular-sdk-employee.d.ts +0 -158
- package/types/edsis-angular-sdk-health.d.ts +0 -34
- package/types/edsis-angular-sdk-shared.d.ts +0 -176
- package/types/edsis-angular-sdk-storage.d.ts +0 -101
- package/types/edsis-angular-sdk-user.d.ts +0 -188
- package/types/edsis-angular-sdk.d.ts +0 -1927
- package/types/edsis-angular.d.ts +0 -2
package/.npmignore
ADDED
package/README.md
CHANGED
|
@@ -1,164 +1,199 @@
|
|
|
1
1
|
# @edsis/angular
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 21.2.0.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
- `@edsis/angular/sdk`
|
|
7
|
-
- `@edsis/angular/sdk/shared`
|
|
8
|
-
- `@edsis/angular/sdk/access`
|
|
9
|
-
- `@edsis/angular/sdk/approval`
|
|
10
|
-
- `@edsis/angular/sdk/auth`
|
|
11
|
-
- `@edsis/angular/sdk/employee`
|
|
12
|
-
- `@edsis/angular/sdk/health`
|
|
13
|
-
- `@edsis/angular/sdk/storage`
|
|
14
|
-
- `@edsis/angular/sdk/user`
|
|
5
|
+
## Package manager
|
|
15
6
|
|
|
16
|
-
|
|
7
|
+
Install dependencies from the workspace root with Bun:
|
|
17
8
|
|
|
18
|
-
|
|
9
|
+
```bash
|
|
10
|
+
bun install
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Consumer installation
|
|
14
|
+
|
|
15
|
+
Install the published package into a consumer Angular workspace with Angular
|
|
16
|
+
CLI so the required peer dependencies are added to the app's `package.json`
|
|
17
|
+
and installed in the same flow:
|
|
19
18
|
|
|
20
19
|
```bash
|
|
21
|
-
|
|
20
|
+
ng add @edsis/angular
|
|
22
21
|
```
|
|
23
22
|
|
|
24
|
-
|
|
23
|
+
When updating the library later, use Angular CLI as well:
|
|
25
24
|
|
|
26
25
|
```bash
|
|
27
|
-
|
|
28
|
-
bunx ng build library
|
|
26
|
+
ng update @edsis/angular
|
|
29
27
|
```
|
|
30
28
|
|
|
31
|
-
The
|
|
29
|
+
The package ships `ng-add` and `ng-update` metadata so Angular and RxJS
|
|
30
|
+
companions stay aligned with the supported versions of the library.
|
|
32
31
|
|
|
33
|
-
|
|
32
|
+
If you install the package with `npm install`, `bun add`, `pnpm add`, or `yarn
|
|
33
|
+
add` directly, peer dependency installation falls back to the package
|
|
34
|
+
manager's own behavior.
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
## Navigation primitives
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
`@edsis/angular/navigation` exports the shared sidebar and topbar building blocks used by the demo shells. The vertical navigation selector is now `sidebar` and the projected sidebar slots use `sidebar-header` and `sidebar-footer`.
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<sidebar [ariaLabel]="'Primary'" [appearance]="'default'">
|
|
42
|
+
<div sidebar-header>Brand</div>
|
|
43
|
+
<div sidebar-footer>Footer actions</div>
|
|
44
|
+
</sidebar>
|
|
39
45
|
```
|
|
40
46
|
|
|
41
|
-
|
|
47
|
+
Register items through `NavigationService.registerItems(...)`, or pass them directly with the `items` input when composing a local navigation tree.
|
|
42
48
|
|
|
43
|
-
|
|
44
|
-
- reject the release if the current branch still has commits that are not pushed, is behind, or is diverged from its upstream branch
|
|
45
|
-
- ask for a version bump using `X`, `Y`, or `Z`
|
|
46
|
-
- map `X` to major, `Y` to minor, and `Z` to patch, then increment the current version automatically
|
|
47
|
-
- ask for a final confirmation before continuing
|
|
48
|
-
- run `bun run build:library`
|
|
49
|
-
- commit the version bump and generated SDK updates with `update version ke {{version}}`
|
|
50
|
-
- push the commit
|
|
51
|
-
- publish `dist/library` to the public npm registry
|
|
49
|
+
## SDK generator in a consumer workspace
|
|
52
50
|
|
|
53
|
-
|
|
51
|
+
After `@edsis/angular` is installed, a consumer workspace can scaffold an
|
|
52
|
+
SDK config file under `config/sdk.config.json` and generate an Angular SDK directly from the published
|
|
53
|
+
schematics:
|
|
54
54
|
|
|
55
55
|
```bash
|
|
56
|
-
|
|
56
|
+
ng generate @edsis/angular:sdk-init
|
|
57
|
+
# edit config/sdk.config.json
|
|
58
|
+
ng generate @edsis/angular:sdk
|
|
57
59
|
```
|
|
58
60
|
|
|
59
|
-
|
|
61
|
+
The main consumer flow is: create `config/sdk.config.json`, adjust the OpenAPI
|
|
62
|
+
input and output target, then run the SDK generator.
|
|
60
63
|
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
If you want short script aliases in the consumer app's `package.json`, add:
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"scripts": {
|
|
69
|
+
"gen:sdk:init": "ng generate @edsis/angular:sdk-init",
|
|
70
|
+
"gen:sdk": "ng generate @edsis/angular:sdk"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
63
73
|
```
|
|
64
74
|
|
|
65
|
-
|
|
75
|
+
Consumers do not need a `gen:sdk:build` step because the npm package already
|
|
76
|
+
ships the compiled schematic runtime.
|
|
66
77
|
|
|
67
|
-
|
|
78
|
+
Common follow-up options:
|
|
68
79
|
|
|
69
80
|
```bash
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
bun run version:library 1.2.3
|
|
73
|
-
bun run version:library prerelease --preid beta
|
|
81
|
+
ng generate @edsis/angular:sdk-init --path=config/my-sdk.config.json
|
|
82
|
+
ng generate @edsis/angular:sdk --config=config/my-sdk.config.json --dry-run
|
|
74
83
|
```
|
|
75
84
|
|
|
76
|
-
|
|
77
|
-
`dist/library` picks up the version on the next `bun run build:library`.
|
|
78
|
-
|
|
79
|
-
## Pack and publish locally
|
|
85
|
+
## Code scaffolding
|
|
80
86
|
|
|
81
|
-
|
|
87
|
+
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
|
82
88
|
|
|
83
89
|
```bash
|
|
84
|
-
bun run
|
|
90
|
+
bun run ng generate component component-name
|
|
85
91
|
```
|
|
86
92
|
|
|
87
|
-
|
|
93
|
+
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
|
88
94
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
95
|
+
```bash
|
|
96
|
+
bun run ng --help
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Building
|
|
94
100
|
|
|
95
|
-
|
|
101
|
+
To build the library, run:
|
|
96
102
|
|
|
97
103
|
```bash
|
|
98
|
-
bun run
|
|
104
|
+
bun run build
|
|
99
105
|
```
|
|
100
106
|
|
|
101
|
-
|
|
107
|
+
This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
|
|
108
|
+
|
|
109
|
+
### Publishing the Library
|
|
110
|
+
|
|
111
|
+
Publish the scoped package to the public npm registry from the workspace root.
|
|
112
|
+
|
|
113
|
+
First, log in to npm:
|
|
102
114
|
|
|
103
115
|
```bash
|
|
104
|
-
|
|
116
|
+
npm login
|
|
105
117
|
```
|
|
106
118
|
|
|
107
|
-
|
|
119
|
+
Then run:
|
|
108
120
|
|
|
109
121
|
```bash
|
|
110
|
-
bun run
|
|
122
|
+
bun run publish
|
|
111
123
|
```
|
|
112
124
|
|
|
113
|
-
|
|
125
|
+
This command rebuilds the library and publishes the generated `dist/angular` package with public access.
|
|
114
126
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
127
|
+
### Publishing a Brand Variant
|
|
128
|
+
|
|
129
|
+
Brand variants let the same library publish under another scoped package while keeping only one selected
|
|
130
|
+
folder from `projects/angular/brand`. Shared entrypoints such as `chart`, `component`, `generator`,
|
|
131
|
+
`layout`, `navigation`, and `theme` are still built for every variant.
|
|
132
|
+
|
|
133
|
+
Configure variants in `projects/angular/scripts/package-variants.json`:
|
|
134
|
+
|
|
135
|
+
```json
|
|
136
|
+
{
|
|
137
|
+
"sourcePackageName": "@edsis/angular",
|
|
138
|
+
"variants": {
|
|
139
|
+
"edsis": {
|
|
140
|
+
"packageName": "@edsis/angular",
|
|
141
|
+
"brandId": "etos"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
118
145
|
```
|
|
119
146
|
|
|
120
|
-
|
|
147
|
+
If `brandId` is omitted, it defaults to the npm scope. For example, `@edsis/angular` uses
|
|
148
|
+
`projects/angular/brand/edsis`.
|
|
149
|
+
|
|
150
|
+
Publish a configured variant with:
|
|
121
151
|
|
|
122
152
|
```bash
|
|
123
|
-
bun run publish:
|
|
153
|
+
bun run publish:variant edsis bug
|
|
124
154
|
```
|
|
125
155
|
|
|
126
|
-
|
|
156
|
+
The bump accepts `major`, `minor`, `patch`, `bug`, or `bugs`; `bug` and `bugs` are aliases for a patch
|
|
157
|
+
version bump. Use `--dry-run` to build and smoke-test the variant without committing, pushing, or
|
|
158
|
+
publishing:
|
|
127
159
|
|
|
128
160
|
```bash
|
|
129
|
-
bun run
|
|
161
|
+
bun run publish:variant edsis bug --dry-run
|
|
130
162
|
```
|
|
131
163
|
|
|
132
|
-
|
|
164
|
+
To add a future brand such as `@ala/angular`, create `projects/angular/brand/ala`, add an `ala` entry to
|
|
165
|
+
`package-variants.json`, then run `bun run publish:variant ala bug`. A new npm script is not required
|
|
166
|
+
unless you want a shortcut.
|
|
167
|
+
|
|
168
|
+
If the package scope must differ from the folder name, map it at publish time with `--path`. For example,
|
|
169
|
+
if the Etos source must be published as `@edsis/angular`, run:
|
|
133
170
|
|
|
134
171
|
```bash
|
|
135
|
-
bun run
|
|
172
|
+
bun run publish:variant edsis bug --path=etos
|
|
136
173
|
```
|
|
137
174
|
|
|
138
|
-
`
|
|
175
|
+
This builds package `@edsis/angular` from `projects/angular/brand/etos`, so the brand entrypoint resolves
|
|
176
|
+
as `@edsis/angular/etos`. If the bump is omitted, the script prompts for `major`, `minor`, `patch`, or
|
|
177
|
+
`bug`.
|
|
178
|
+
|
|
179
|
+
## Running unit tests
|
|
139
180
|
|
|
140
|
-
|
|
181
|
+
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
|
141
182
|
|
|
142
183
|
```bash
|
|
143
|
-
bun run
|
|
184
|
+
bun run test
|
|
144
185
|
```
|
|
145
186
|
|
|
146
|
-
##
|
|
187
|
+
## Running end-to-end tests
|
|
147
188
|
|
|
148
|
-
|
|
189
|
+
For end-to-end (e2e) testing, run:
|
|
149
190
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
- manual `workflow_dispatch` runs with an npm tag and optional dry-run
|
|
191
|
+
```bash
|
|
192
|
+
bun run ng e2e
|
|
193
|
+
```
|
|
154
194
|
|
|
155
|
-
|
|
156
|
-
not require a repository `NPM_TOKEN` secret. The npm package must be configured
|
|
157
|
-
to trust this repository workflow as a publisher. On tag pushes, the tag
|
|
158
|
-
version must match `projects/library/package.json`.
|
|
195
|
+
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
|
159
196
|
|
|
160
|
-
|
|
197
|
+
## Additional Resources
|
|
161
198
|
|
|
162
|
-
|
|
163
|
-
2. Select `X`, `Y`, or `Z`, then confirm the computed version.
|
|
164
|
-
3. Let the script build, commit, push, and publish the package.
|
|
199
|
+
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
# Etos Brand
|
|
2
|
+
|
|
3
|
+
Etos implementation lives under `projects/angular/brand/etos`. Published consumers should use `@edsis/angular/etos`.
|
|
4
|
+
|
|
5
|
+
This package is the Etos-specific layer on top of the shared Angular libraries. It owns the Etos brand defaults, shell composition, brand stylesheet, and Etos-only UI such as the profile/theme switcher.
|
|
6
|
+
|
|
7
|
+
Use this folder for Etos-specific implementation:
|
|
8
|
+
|
|
9
|
+
- `core/` contains brand defaults and provider composition.
|
|
10
|
+
- `component/` contains Etos-owned UI such as `EtosThemeSwitcherComponent`.
|
|
11
|
+
- `shells/` contains `EtosLayoutComponent` and the Etos empty, horizontal, and vertical shells.
|
|
12
|
+
- `themes/` contains Etos color, style, layout, and component-facing CSS.
|
|
13
|
+
- `navigation/`, `assets/`, and `docs/` can be added when Etos needs brand-specific behavior beyond shared primitives.
|
|
14
|
+
|
|
15
|
+
Shared services, types, and primitives stay in the generic libraries:
|
|
16
|
+
|
|
17
|
+
- `@edsis/angular/theme`
|
|
18
|
+
- `@edsis/angular/layout`
|
|
19
|
+
- `@edsis/angular/navigation`
|
|
20
|
+
|
|
21
|
+
## Public entrypoint
|
|
22
|
+
|
|
23
|
+
Published consumers should import Etos providers and Etos-owned UI through the short public entrypoint. Shell UI can also be imported through deeper shell aliases:
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import {
|
|
27
|
+
EtosLayoutComponent,
|
|
28
|
+
EtosThemeSwitcherComponent,
|
|
29
|
+
ShellPagesComponent,
|
|
30
|
+
provideEtosBrand,
|
|
31
|
+
provideEtosLayout,
|
|
32
|
+
provideEtosTheme,
|
|
33
|
+
type EtosBrandOptions,
|
|
34
|
+
type EtosThemeSwitcherQuickAction,
|
|
35
|
+
type EtosThemeSwitcherUserInfo,
|
|
36
|
+
} from '@edsis/angular/etos';
|
|
37
|
+
|
|
38
|
+
import { EtosLayoutComponent } from '@edsis/angular/etos/shell/layout';
|
|
39
|
+
import { ShellPagesComponent } from '@edsis/angular/etos/shell/pages';
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`@edsis/angular/etos` currently exports:
|
|
43
|
+
|
|
44
|
+
- `provideEtosBrand()` to apply the Etos theme and layout defaults together and optionally register navigation items.
|
|
45
|
+
- `provideEtosTheme()` to install only the Etos theme wrapper over the shared theme provider.
|
|
46
|
+
- `provideEtosLayout()` to install only the Etos layout wrapper over the shared layout provider.
|
|
47
|
+
- `EtosLayoutComponent` to render the Etos shell from the current layout mode.
|
|
48
|
+
- `EtosThemeSwitcherComponent` and related types for the profile/preferences UI.
|
|
49
|
+
- `ShellPagesComponent` for the fixed-header, scroll-main, optional-footer page shell.
|
|
50
|
+
|
|
51
|
+
Shell-specific UI is exported through deeper entrypoints:
|
|
52
|
+
|
|
53
|
+
- `@edsis/angular/etos/shell/layout` aliases `EtosLayoutComponent`.
|
|
54
|
+
- `@edsis/angular/etos/shell/pages` aliases `ShellPagesComponent`.
|
|
55
|
+
|
|
56
|
+
## Provider setup
|
|
57
|
+
|
|
58
|
+
Etos ships with these defaults:
|
|
59
|
+
|
|
60
|
+
- Theme defaults to brand `etos` with light mode.
|
|
61
|
+
- Layout defaults to `vertical` mode with `wide` width.
|
|
62
|
+
|
|
63
|
+
Recommended provider configuration:
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
import { ApplicationConfig, provideBrowserGlobalErrorListeners } from '@angular/core';
|
|
67
|
+
import { provideRouter } from '@angular/router';
|
|
68
|
+
import { type EtosBrandOptions, provideEtosBrand } from '@edsis/angular/etos';
|
|
69
|
+
|
|
70
|
+
import { AppNavigation } from './app.navigation';
|
|
71
|
+
import { routes } from './app.routes';
|
|
72
|
+
|
|
73
|
+
export const etosBrandConfig = {
|
|
74
|
+
theme: {
|
|
75
|
+
mode: 'light',
|
|
76
|
+
},
|
|
77
|
+
layout: {
|
|
78
|
+
mode: 'vertical',
|
|
79
|
+
},
|
|
80
|
+
navigation: AppNavigation,
|
|
81
|
+
} satisfies EtosBrandOptions;
|
|
82
|
+
|
|
83
|
+
export const appConfig: ApplicationConfig = {
|
|
84
|
+
providers: [provideBrowserGlobalErrorListeners(), provideRouter(routes), provideEtosBrand(etosBrandConfig)],
|
|
85
|
+
};
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`provideEtosBrand()` accepts these Etos-specific options:
|
|
89
|
+
|
|
90
|
+
- `theme` merges into the shared Material theme config while keeping the Etos brand tokens.
|
|
91
|
+
- `layout` merges into the shared Material layout config while keeping the Etos layout defaults.
|
|
92
|
+
- `navigation` registers navigation items during application startup.
|
|
93
|
+
- `navigationId` targets a non-default navigation registry id when needed.
|
|
94
|
+
- `materialDefaults` defaults to `true`; set it to `false` to skip `withMaterialDefaults()`.
|
|
95
|
+
|
|
96
|
+
Use the granular providers when the consumer only needs one part of the Etos stack:
|
|
97
|
+
|
|
98
|
+
```ts
|
|
99
|
+
import { ApplicationConfig } from '@angular/core';
|
|
100
|
+
import { provideEtosLayout, provideEtosTheme } from '@edsis/angular/etos';
|
|
101
|
+
|
|
102
|
+
export const appConfig: ApplicationConfig = {
|
|
103
|
+
providers: [provideEtosTheme(), provideEtosLayout({ mode: 'horizontal', width: 'wide' })],
|
|
104
|
+
};
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Using the brand theme
|
|
108
|
+
|
|
109
|
+
The Etos brand theme has two parts:
|
|
110
|
+
|
|
111
|
+
- TypeScript setup through one of the Etos providers.
|
|
112
|
+
- CSS setup through the Etos stylesheet so the `theme-brand="etos"` tokens are available at runtime.
|
|
113
|
+
|
|
114
|
+
App CSS should import the Etos package stylesheet before Tailwind:
|
|
115
|
+
|
|
116
|
+
```css
|
|
117
|
+
@import '@edsis/angular/etos/styles';
|
|
118
|
+
@import 'tailwindcss';
|
|
119
|
+
@import '@edsis/angular/theme/tailwind/theme.css';
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Using the layout shell
|
|
123
|
+
|
|
124
|
+
`EtosLayoutComponent` is the exported shell component for Etos. It resolves `empty`, `horizontal`, or `vertical` from its `mode` input or from `LayoutService` when the input is omitted.
|
|
125
|
+
|
|
126
|
+
This is the same composition pattern used by the Etos demo:
|
|
127
|
+
|
|
128
|
+
```ts
|
|
129
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
130
|
+
import { RouterLink } from '@angular/router';
|
|
131
|
+
import { EtosLayoutComponent } from '@edsis/angular/etos/shell/layout';
|
|
132
|
+
import {
|
|
133
|
+
type EtosThemeSwitcherQuickAction,
|
|
134
|
+
EtosThemeSwitcherComponent,
|
|
135
|
+
type EtosThemeSwitcherUserInfo,
|
|
136
|
+
} from '@edsis/angular/etos';
|
|
137
|
+
|
|
138
|
+
@Component({
|
|
139
|
+
selector: 'app-pages',
|
|
140
|
+
imports: [RouterLink, EtosLayoutComponent, EtosThemeSwitcherComponent],
|
|
141
|
+
template: `
|
|
142
|
+
<ng-template #layoutBrand>
|
|
143
|
+
<a routerLink="/" class="flex min-w-0 items-center gap-3 px-2 py-1.5 transition-colors">
|
|
144
|
+
<span class="text-sm font-semibold leading-none tracking-tight">angular UI</span>
|
|
145
|
+
</a>
|
|
146
|
+
</ng-template>
|
|
147
|
+
|
|
148
|
+
<ng-template #layoutPanel>
|
|
149
|
+
<div class="flex h-full w-full min-w-0 items-center justify-start gap-3 px-2 py-0">
|
|
150
|
+
<etos-theme-switcher [userInfo]="profileInfo" [quickActions]="quickActions" />
|
|
151
|
+
|
|
152
|
+
<div class="min-w-0 flex flex-col gap-px">
|
|
153
|
+
<span class="truncate text-sm font-semibold leading-none text-foreground">{{ profileName }}</span>
|
|
154
|
+
<span class="truncate text-xs leading-none text-muted-foreground">{{ profileTitle }}</span>
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
</ng-template>
|
|
158
|
+
|
|
159
|
+
<etos-layout [layoutBrandTemplate]="layoutBrand" [layoutProfileTemplate]="layoutPanel" />
|
|
160
|
+
`,
|
|
161
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
162
|
+
})
|
|
163
|
+
export class Pages {
|
|
164
|
+
protected readonly profileName = 'angular';
|
|
165
|
+
protected readonly profileTitle = 'Etos design system navigator';
|
|
166
|
+
protected readonly profileInfo = {
|
|
167
|
+
name: this.profileName,
|
|
168
|
+
subtitle: this.profileTitle,
|
|
169
|
+
avatarSrc: '/avatar-ojie.svg',
|
|
170
|
+
avatarAlt: 'angular avatar',
|
|
171
|
+
} satisfies EtosThemeSwitcherUserInfo;
|
|
172
|
+
|
|
173
|
+
protected readonly quickActions = [
|
|
174
|
+
{ value: 'notifications', label: 'Notifications', icon: 'notifications' },
|
|
175
|
+
{ value: 'sign-out', label: 'Logout', icon: 'logout', tone: 'destructive' },
|
|
176
|
+
] satisfies readonly EtosThemeSwitcherQuickAction[];
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Layout inputs:
|
|
181
|
+
|
|
182
|
+
- `mode`: optional explicit override for the active layout mode.
|
|
183
|
+
- `layoutBrandTemplate`: used in the horizontal brand area and as the default vertical sidebar header.
|
|
184
|
+
- `layoutProfileTemplate`: used in the horizontal profile area and as the default vertical sidebar footer.
|
|
185
|
+
- `sidebarHeaderTemplate`: optional vertical-only override for the sidebar header.
|
|
186
|
+
- `sidebarFooterTemplate`: optional vertical-only override for the sidebar footer.
|
|
187
|
+
|
|
188
|
+
That fallback behavior means a single `layoutBrandTemplate` and `layoutProfileTemplate` pair is enough for most consumers, while vertical layouts can still diverge when needed.
|
|
189
|
+
|
|
190
|
+
## Using the theme switcher
|
|
191
|
+
|
|
192
|
+
`EtosThemeSwitcherComponent` is exported from `@edsis/angular/etos` and is intended to live inside the Etos shell profile area or any consumer-owned profile trigger.
|
|
193
|
+
|
|
194
|
+
Common inputs and output:
|
|
195
|
+
|
|
196
|
+
- `quickActions`: required array rendered in the popup footer. Pass `[]` if you only want the built-in theme and layout controls.
|
|
197
|
+
- `userInfo`: object input for `name`, `subtitle`, `avatarSrc`, and `avatarAlt`.
|
|
198
|
+
- `userName`, `userSubtitle`, `avatarSrc`, and `avatarAlt`: fallback inputs when `userInfo` is not supplied.
|
|
199
|
+
- `notificationShortcut`: configures the standalone notification trigger shown beside the avatar.
|
|
200
|
+
- `showNotificationShortcut`: legacy boolean shortcut for rendering the default notification button.
|
|
201
|
+
- `popoverSide`, `popoverAlign`, and `popoverSideOffset`: explicit popover placement overrides.
|
|
202
|
+
- `actionSelected`: emits the selected quick action or notification shortcut value.
|
|
203
|
+
|
|
204
|
+
The popup always exposes theme scheme, layout mode, and layout width controls. The quick action area is fully consumer-driven:
|
|
205
|
+
|
|
206
|
+
- Provide the action values and labels you need in `quickActions`.
|
|
207
|
+
- Handle actions such as logout in the app consumer through `(actionSelected)`.
|
|
208
|
+
- When `notificationShortcut.value` matches one of the `quickActions` values, the matching popup item is removed to avoid duplication.
|
|
209
|
+
|
|
210
|
+
Popover defaults now follow the active layout automatically:
|
|
211
|
+
|
|
212
|
+
- Vertical layout defaults to `side="top"` and `align="start"`.
|
|
213
|
+
- Horizontal and empty layouts default to `side="bottom"` and `align="end"`.
|
|
214
|
+
|
|
215
|
+
Only pass `popoverSide`, `popoverAlign`, or `popoverSideOffset` when you need to override those defaults.
|
|
216
|
+
|
|
217
|
+
Input shape examples:
|
|
218
|
+
|
|
219
|
+
```ts
|
|
220
|
+
profileInfo = {
|
|
221
|
+
name: 'angular',
|
|
222
|
+
subtitle: 'Etos design system navigator',
|
|
223
|
+
avatarSrc: '/avatar-ojie.svg',
|
|
224
|
+
avatarAlt: 'angular avatar',
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
notificationShortcut = {
|
|
228
|
+
value: 'notifications',
|
|
229
|
+
icon: 'notifications',
|
|
230
|
+
ariaLabel: 'Open notifications for angular',
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
quickActions = [
|
|
234
|
+
{ value: 'notifications', label: 'Notifications', icon: 'notifications' },
|
|
235
|
+
{ value: 'sign-out', label: 'Logout', icon: 'logout', tone: 'destructive' },
|
|
236
|
+
];
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
Example consumer-owned action handling:
|
|
240
|
+
|
|
241
|
+
```html
|
|
242
|
+
<etos-theme-switcher
|
|
243
|
+
[userInfo]="profileInfo"
|
|
244
|
+
[quickActions]="quickActions"
|
|
245
|
+
(actionSelected)="onThemeSwitcherAction($event)" />
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
```ts
|
|
249
|
+
onThemeSwitcherAction(action: string): void {
|
|
250
|
+
if (action === 'sign-out') {
|
|
251
|
+
this.authService.logout();
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
## Workspace usage in this repository
|
|
257
|
+
|
|
258
|
+
The Etos demo under `projects/demo/etos` already uses the short TypeScript entrypoint for provider setup and shell composition:
|
|
259
|
+
|
|
260
|
+
- `src/app/app.config.ts` imports `provideEtosBrand` and passes `navigation: AppNavigation`.
|
|
261
|
+
- `src/pages/pages.ts` imports `EtosLayoutComponent` and `EtosThemeSwitcherComponent` and wires `layoutBrandTemplate` plus `layoutProfileTemplate`.
|
|
262
|
+
|
|
263
|
+
For CSS, the workspace demo currently imports the Etos source stylesheet directly:
|
|
264
|
+
|
|
265
|
+
```css
|
|
266
|
+
@import '../../../angular/etos/themes/index.css';
|
|
267
|
+
@import 'tailwindcss';
|
|
268
|
+
@import '@edsis/angular/theme/tailwind/theme.css';
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
That local CSS path is intentional while developing inside this monorepo. Angular resolves bare CSS package imports from `node_modules/@edsis/angular`, while TypeScript imports in the demo resolve through `tsconfig.json` path aliases. After the package is built, published, and installed with the latest exports, consumers should use `@edsis/angular/etos/styles`.
|
|
272
|
+
|
|
273
|
+
The older `@edsis/angular/theme/styles/etos.css` path is kept only as a compatibility shim.
|
package/chart/README.md
ADDED
|
File without changes
|
package/collection.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../../node_modules/@angular-devkit/schematics/collection-schema.json",
|
|
3
|
+
"schematics": {
|
|
4
|
+
"ng-add": {
|
|
5
|
+
"description": "Add @edsis/angular and its required peer dependencies to an Angular workspace.",
|
|
6
|
+
"factory": "./generator/api/bin/schematics/ng-add/index.js#ngAdd",
|
|
7
|
+
"schema": "./generator/api/schematics/ng-add/schema.json"
|
|
8
|
+
},
|
|
9
|
+
"sdk": {
|
|
10
|
+
"description": "Generate an Angular SDK from an OpenAPI spec.",
|
|
11
|
+
"factory": "./generator/api/bin/schematics/sdk/index.js#sdk",
|
|
12
|
+
"schema": "./generator/api/schematics/sdk/schema.json"
|
|
13
|
+
},
|
|
14
|
+
"sdk-init": {
|
|
15
|
+
"description": "Create config/sdk.config.json under the workspace root.",
|
|
16
|
+
"factory": "./generator/api/bin/schematics/init/index.js#init",
|
|
17
|
+
"schema": "./generator/api/schematics/init/schema.json"
|
|
18
|
+
},
|
|
19
|
+
"guide": {
|
|
20
|
+
"description": "Compile Markdown files into Angular standalone components and a nested route tree.",
|
|
21
|
+
"factory": "./generator/guide/bin/schematics/build/index.js#build",
|
|
22
|
+
"schema": "./generator/guide/schematics/build/schema.json"
|
|
23
|
+
},
|
|
24
|
+
"guide-init": {
|
|
25
|
+
"description": "Create config/guide.config.json under the workspace root.",
|
|
26
|
+
"factory": "./generator/guide/bin/schematics/init/index.js#init",
|
|
27
|
+
"schema": "./generator/guide/schematics/init/schema.json"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|