@lukfel/ng-scaffold 20.0.24 → 20.0.26
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 +25 -6
- package/fesm2022/lukfel-ng-scaffold.mjs +67 -33
- package/fesm2022/lukfel-ng-scaffold.mjs.map +1 -1
- package/index.d.ts +14 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ This Angular library provides a foundational scaffold for modern web and mobile
|
|
|
5
5
|
|
|
6
6
|
- **NPM**: [@lukfel/ng-scaffold](https://www.npmjs.com/package/@lukfel/ng-scaffold)
|
|
7
7
|
- **Demo**: [lukfel.github.io/ng-scaffold](https://lukfel.github.io/ng-scaffold)
|
|
8
|
-
- **Examples**: [
|
|
8
|
+
- **Examples**: [Uglygotchi](https://www.uglygotchi.at), [What a Waste](https://www.what-a-waste.at), [Create a Tournament](https://www.create-a-tournament.com)
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
@@ -146,12 +146,11 @@ export class AppComponent {
|
|
|
146
146
|
}
|
|
147
147
|
```
|
|
148
148
|
|
|
149
|
-
###
|
|
150
|
-
Define the `ScaffoldConfig` in `app.component.ts` and
|
|
149
|
+
### Initialize Configuration
|
|
150
|
+
Define the `ScaffoldConfig` in your `app.component.ts` and initialize the `scaffoldConfig` property in `ScaffoldService`.
|
|
151
151
|
|
|
152
152
|
* **Notes:**
|
|
153
|
-
* If a sub-configuration (e.g
|
|
154
|
-
* Refer to the demo project for full configuration details.
|
|
153
|
+
* If a sub-configuration (e.g. `headerConfig`) is missing or does not have `enable: true`, the corresponding UI element will not be displayed.
|
|
155
154
|
|
|
156
155
|
```ts
|
|
157
156
|
import { ScaffoldService, ScaffoldConfig } from '@lukfel/ng-scaffold';
|
|
@@ -162,7 +161,7 @@ export class AppComponent {
|
|
|
162
161
|
scrollPositionRestoration: true,
|
|
163
162
|
headerConfig: { enable: true, title: 'Scaffold', subtitle: 'by Lukas Felbinger' },
|
|
164
163
|
navbarConfig: { enable: true },
|
|
165
|
-
footerConfig: { enable: true, copyright: '© Lukas Felbinger
|
|
164
|
+
footerConfig: { enable: true, copyright: '© Lukas Felbinger 2025' },
|
|
166
165
|
floatingButtonConfig: { enable: true }
|
|
167
166
|
};
|
|
168
167
|
|
|
@@ -172,6 +171,26 @@ export class AppComponent {
|
|
|
172
171
|
}
|
|
173
172
|
```
|
|
174
173
|
|
|
174
|
+
### Update Configuration (immutable, partial)
|
|
175
|
+
The `ScaffoldService` provides a method `updateScaffoldProperty()` to partially update the `ScaffoldConfig` in a type-safe way. It performs an immutable update, creating a new configuration object with the updated property and emits the new state.
|
|
176
|
+
|
|
177
|
+
```ts
|
|
178
|
+
import { ScaffoldService, DrawerConfig } from '@lukfel/ng-scaffold';
|
|
179
|
+
|
|
180
|
+
export class AppComponent {
|
|
181
|
+
|
|
182
|
+
constructor(private scaffoldService: ScaffoldService) {
|
|
183
|
+
this.scaffoldService.scaffoldConfig = this.scaffoldConfig;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
public toggleDrawer(): void {
|
|
187
|
+
const currentDrawerConfig: DrawerConfig = this.scaffoldService.scaffoldConfig.drawerConfig;
|
|
188
|
+
const updatedDrawerConfig: DrawerConfig = { ...currentDrawerConfig, open: !currentDrawerConfig.open };
|
|
189
|
+
this.scaffoldService.updateScaffoldProperty('drawerConfig', updatedDrawerConfig);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
175
194
|
|
|
176
195
|
|
|
177
196
|
|