@lukfel/ng-scaffold 21.1.13 → 21.1.14

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 CHANGED
@@ -22,28 +22,39 @@ ng add @lukfel/ng-scaffold
22
22
  ```
23
23
 
24
24
  The ng add command will additionally try to perform the following actions:
25
- * Import `ScaffoldModule`
25
+ * Import `ScaffoldComponent` in root
26
26
  * Inject `ScaffoldService` and initialize `ScaffoldConfig`
27
- * Wrap template with `<lf-scaffold>`
27
+ * Wrap template with `<lf-scaffold>`
28
28
  * Include styles
29
29
 
30
30
 
31
- ## Module
32
- Import the `ScaffoldModule` into your `app.module.ts` file.
31
+ ## Component
32
+ Import the `ScaffoldComponent` into your `app.module.ts` or `app.component.ts` (standalone).
33
33
 
34
- * **Note:** (Optional) The library includes a built-in logging service called `Logger`, which logs library debugging events when a `ScaffoldLibraryConfig` is provided and `debugging` is set to `true`. Logging is automatically disabled in production mode when `production` is set to `true`.
34
+ ```ts
35
+ import { ScaffoldComponent } from '@lukfel/ng-scaffold';
36
+
37
+ ...
38
+ imports: [
39
+ ScaffoldComponent
40
+ ]
41
+ ```
42
+
43
+ ### (Optional) Provider
44
+ The library uses the built-in logging service `Logger` to log debugging events when a `ScaffoldLibraryConfig` is provided and `debugging` is set to `true`. Logging is automatically disabled in production mode when `production` is set to `true`.
35
45
 
36
46
  ```ts
37
- import { ScaffoldModule } from '@lukfel/ng-scaffold';
47
+ import { provideScaffold } from '@lukfel/ng-scaffold';
38
48
  import { isDevMode } from '@angular/core';
39
49
 
40
- @NgModule({
41
50
  ...
42
- imports: [
43
- ScaffoldModule.forRoot({ production: !isDevMode(), debugging: isDevMode() }), // Omit .forRoot(...) if logging is not required
51
+ providers: [
52
+ provideScaffold({
53
+ production: !isDevMode(),
54
+ debugging: isDevMode(),
55
+ outlineIcons: true
56
+ })
44
57
  ]
45
- })
46
- export class AppModule { }
47
58
  ```
48
59
 
49
60
 
@@ -59,7 +70,7 @@ export class AppComponent {
59
70
 
60
71
  public scaffoldConfig: ScaffoldConfig = {
61
72
  // Create your own config or generate it at https://lukfel.github.io/ng-scaffold
62
- headerConfig: { enable: true, title: 'Scaffold works!', gradient: true }
73
+ headerConfig: { enable: true, title: 'Scaffold works!' }
63
74
  };
64
75
 
65
76
  constructor(private scaffoldService: ScaffoldService) {
@@ -265,8 +276,9 @@ This library includes several utility services:
265
276
  - **`LocalStorageService`** – Handle local storage
266
277
 
267
278
  ### Logger
268
- Logs internal library information if `debugging` is `true` and hides application logs during production if `production` is `true`.
269
- * **Note:** `ScaffoldLibraryConfig` must be set during initialization ``ScaffoldModule.forRoot( { production: !isDevMode(), debugging: isDevMode() } )``
279
+ Logs information during development and hides all logs during production.
280
+
281
+ * **Note:** Use the provoder `provideScaffold({ production: !isDevMode() })` to disable logs in production
270
282
 
271
283
  ```ts
272
284
  import { Logger } from '@lukfel/ng-scaffold';
@@ -378,9 +390,9 @@ export class AppComponent {
378
390
 
379
391
 
380
392
  ## (Optional) Standalone Components
381
- In addition to the components provided by default by the the `ScaffoldModule` there are several standalone components that can be utilized.
393
+ In addition to the scaffold components provided by default by the the `ScaffoldComponent` there are several standalone components that can be utilized.
382
394
 
383
- * **Note:** Standalone components must be imported manually and are not part of the `ScaffoldModule` import
395
+ * **Note:** Standalone components must be imported manually and are not part of the `ScaffoldComponent` import
384
396
 
385
397
  ### List
386
398
  A standalone Material Design inspired list and table hybrid component for displaying structured collections of items. It supports avatars, titles, subtitles, actions, selections and dragging — making it ideal for dashboards, inventories, and administrative views.
@@ -537,14 +549,10 @@ Intercept HTTP Calls and automatically show a loading spinner.
537
549
  * **Note:** The loading spinner can also be manually shown by udpating the value for `scaffoldConfig.loading` in the `ScaffoldService`
538
550
 
539
551
  ```ts
540
- import { ScaffoldLoadingInterceptor, ScaffoldModule } from '@lukfel/ng-scaffold';
552
+ import { ScaffoldLoadingInterceptor, ScaffoldComponent } from '@lukfel/ng-scaffold';
541
553
  import { isDevMode } from '@angular/core';
542
554
 
543
- @NgModule({
544
555
  ...
545
- imports: [
546
- ScaffoldModule.forRoot({ production: !isDevMode(), debugging: isDevMode() }), // Omit .forRoot(...) if logging is not required
547
- ],
548
556
  providers: [
549
557
  {
550
558
  provide: HTTP_INTERCEPTORS,
@@ -552,6 +560,4 @@ import { isDevMode } from '@angular/core';
552
560
  multi: true
553
561
  }
554
562
  ]
555
- })
556
- export class AppModule { }
557
563
  ```
@@ -0,0 +1,24 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, Component } from '@angular/core';
3
+ import * as i2 from '@angular/material/button';
4
+ import { MatButtonModule } from '@angular/material/button';
5
+ import * as i1 from '@angular/material/dialog';
6
+ import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
7
+
8
+ class ConfirmDialogComponent {
9
+ constructor() {
10
+ this.config = inject(MAT_DIALOG_DATA);
11
+ }
12
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: ConfirmDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
13
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: ConfirmDialogComponent, isStandalone: true, selector: "lf-confirm-dialog", ngImport: i0, template: "@if (config) {\r\n @if (config.title) {\r\n <h2 mat-dialog-title>{{ config.title }}</h2>\r\n }\r\n\r\n <mat-dialog-content>\r\n @if (config.message) {\r\n <p>{{ config.message }}</p>\r\n }\r\n </mat-dialog-content>\r\n\r\n <mat-dialog-actions align=\"end\">\r\n @if (config.closeLabel) {\r\n <button mat-button [mat-dialog-close]=\"false\">\r\n {{ config.closeLabel }}\r\n </button>\r\n }\r\n @if (config.confirmLabel) {\r\n <button mat-button color=\"primary\" [mat-dialog-close]=\"true\">\r\n {{ config.confirmLabel }}\r\n </button>\r\n }\r\n </mat-dialog-actions>\r\n}\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }] }); }
14
+ }
15
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: ConfirmDialogComponent, decorators: [{
16
+ type: Component,
17
+ args: [{ selector: 'lf-confirm-dialog', standalone: true, imports: [
18
+ MatDialogModule,
19
+ MatButtonModule
20
+ ], template: "@if (config) {\r\n @if (config.title) {\r\n <h2 mat-dialog-title>{{ config.title }}</h2>\r\n }\r\n\r\n <mat-dialog-content>\r\n @if (config.message) {\r\n <p>{{ config.message }}</p>\r\n }\r\n </mat-dialog-content>\r\n\r\n <mat-dialog-actions align=\"end\">\r\n @if (config.closeLabel) {\r\n <button mat-button [mat-dialog-close]=\"false\">\r\n {{ config.closeLabel }}\r\n </button>\r\n }\r\n @if (config.confirmLabel) {\r\n <button mat-button color=\"primary\" [mat-dialog-close]=\"true\">\r\n {{ config.confirmLabel }}\r\n </button>\r\n }\r\n </mat-dialog-actions>\r\n}\r\n" }]
21
+ }] });
22
+
23
+ export { ConfirmDialogComponent };
24
+ //# sourceMappingURL=lukfel-ng-scaffold-confirm-dialog.component-D92LeRJW.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lukfel-ng-scaffold-confirm-dialog.component-D92LeRJW.mjs","sources":["../../../projects/ng-scaffold/src/lib/shared/components/dialogs/confirm-dialog/confirm-dialog.component.ts","../../../projects/ng-scaffold/src/lib/shared/components/dialogs/confirm-dialog/confirm-dialog.component.html"],"sourcesContent":["import { Component, inject } from '@angular/core';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';\r\nimport { ConfirmDialogConfig } from '../../../../models';\r\n\r\n@Component({\r\n selector: 'lf-confirm-dialog',\r\n templateUrl: './confirm-dialog.component.html',\r\n styleUrls: ['./confirm-dialog.component.scss'],\r\n standalone: true,\r\n imports: [\r\n MatDialogModule,\r\n MatButtonModule\r\n ]\r\n})\r\nexport class ConfirmDialogComponent {\r\n public config = inject<ConfirmDialogConfig>(MAT_DIALOG_DATA);\r\n\r\n}\r\n","@if (config) {\r\n @if (config.title) {\r\n <h2 mat-dialog-title>{{ config.title }}</h2>\r\n }\r\n\r\n <mat-dialog-content>\r\n @if (config.message) {\r\n <p>{{ config.message }}</p>\r\n }\r\n </mat-dialog-content>\r\n\r\n <mat-dialog-actions align=\"end\">\r\n @if (config.closeLabel) {\r\n <button mat-button [mat-dialog-close]=\"false\">\r\n {{ config.closeLabel }}\r\n </button>\r\n }\r\n @if (config.confirmLabel) {\r\n <button mat-button color=\"primary\" [mat-dialog-close]=\"true\">\r\n {{ config.confirmLabel }}\r\n </button>\r\n }\r\n </mat-dialog-actions>\r\n}\r\n"],"names":[],"mappings":";;;;;;;MAea,sBAAsB,CAAA;AAVnC,IAAA,WAAA,GAAA;AAWS,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAsB,eAAe,CAAC;AAE7D,IAAA;8GAHY,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAtB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECfnC,moBAwBA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDbI,eAAe,+nBACf,eAAe,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,QAAA,EAAA,iOAAA,EAAA,MAAA,EAAA,CAAA,WAAA,CAAA,EAAA,QAAA,EAAA,CAAA,WAAA,EAAA,WAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAGN,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAVlC,SAAS;+BACE,mBAAmB,EAAA,UAAA,EAGjB,IAAI,EAAA,OAAA,EACP;wBACP,eAAe;wBACf;AACD,qBAAA,EAAA,QAAA,EAAA,moBAAA,EAAA;;;;;"}
@@ -0,0 +1,34 @@
1
+ import { ComponentPortal } from '@angular/cdk/portal';
2
+ import * as i1 from '@angular/common';
3
+ import { CommonModule } from '@angular/common';
4
+ import * as i0 from '@angular/core';
5
+ import { inject, Component } from '@angular/core';
6
+ import { MatProgressSpinner } from '@angular/material/progress-spinner';
7
+ import { CONFIG, ScaffoldService } from './lukfel-ng-scaffold.mjs';
8
+
9
+ class LoadingOverlayComponent {
10
+ constructor() {
11
+ this.libraryConfig = inject(CONFIG, { optional: true });
12
+ this.scaffoldService = inject(ScaffoldService);
13
+ this.portal = null;
14
+ this.loadingOverlayConfig = null;
15
+ }
16
+ ngOnInit() {
17
+ this.loadingOverlayConfig = this.scaffoldService.scaffoldConfig?.loadingOverlayConfig || null;
18
+ if (this.loadingOverlayConfig?.customComponent) {
19
+ this.portal = new ComponentPortal(this.loadingOverlayConfig?.customComponent);
20
+ }
21
+ }
22
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: LoadingOverlayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
23
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: LoadingOverlayComponent, isStandalone: true, selector: "lf-loading-overlay", ngImport: i0, template: "@if (!portal) {\r\n <div\r\n [ngClass]=\"loadingOverlayConfig?.cssClass\"\r\n [class.lf-gradient-spinner]=\"loadingOverlayConfig?.gradient\">\r\n <mat-progress-spinner mode=\"indeterminate\"></mat-progress-spinner>\r\n </div>\r\n} @else {\r\n <ng-template [cdkPortalOutlet]=\"portal\"></ng-template>\r\n}\r\n", styles: [".lf-gradient-spinner{position:relative;display:inline-block}.lf-gradient-spinner mat-progress-spinner,.lf-gradient-spinner mat-spinner{opacity:0}.lf-gradient-spinner:before{content:\"\";position:absolute;inset:0;border-radius:50%;background:conic-gradient(var(--color-primary),var(--color-accent));-webkit-mask:radial-gradient(farthest-side,transparent 77%,black 78%);mask:radial-gradient(farthest-side,transparent 77%,black 78%);animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }] }); }
24
+ }
25
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: LoadingOverlayComponent, decorators: [{
26
+ type: Component,
27
+ args: [{ selector: 'lf-loading-overlay', standalone: true, imports: [
28
+ CommonModule,
29
+ MatProgressSpinner
30
+ ], template: "@if (!portal) {\r\n <div\r\n [ngClass]=\"loadingOverlayConfig?.cssClass\"\r\n [class.lf-gradient-spinner]=\"loadingOverlayConfig?.gradient\">\r\n <mat-progress-spinner mode=\"indeterminate\"></mat-progress-spinner>\r\n </div>\r\n} @else {\r\n <ng-template [cdkPortalOutlet]=\"portal\"></ng-template>\r\n}\r\n", styles: [".lf-gradient-spinner{position:relative;display:inline-block}.lf-gradient-spinner mat-progress-spinner,.lf-gradient-spinner mat-spinner{opacity:0}.lf-gradient-spinner:before{content:\"\";position:absolute;inset:0;border-radius:50%;background:conic-gradient(var(--color-primary),var(--color-accent));-webkit-mask:radial-gradient(farthest-side,transparent 77%,black 78%);mask:radial-gradient(farthest-side,transparent 77%,black 78%);animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}\n"] }]
31
+ }] });
32
+
33
+ export { LoadingOverlayComponent };
34
+ //# sourceMappingURL=lukfel-ng-scaffold-loading-overlay.component-cOyltHTs.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lukfel-ng-scaffold-loading-overlay.component-cOyltHTs.mjs","sources":["../../../projects/ng-scaffold/src/lib/components/loading-overlay/loading-overlay.component.ts","../../../projects/ng-scaffold/src/lib/components/loading-overlay/loading-overlay.component.html"],"sourcesContent":["import { ComponentPortal } from '@angular/cdk/portal';\r\nimport { CommonModule } from '@angular/common';\r\nimport { Component, inject, OnInit } from '@angular/core';\r\nimport { MatProgressSpinner } from '@angular/material/progress-spinner';\r\nimport { CONFIG } from '../../scaffold.config';\r\nimport { LoadingOverlayConfig, ScaffoldLibraryConfig } from '../../models';\r\nimport { ScaffoldService } from '../../services';\r\n\r\n@Component({\r\n selector: 'lf-loading-overlay',\r\n templateUrl: './loading-overlay.component.html',\r\n styleUrls: ['./loading-overlay.component.scss'],\r\n standalone: true,\r\n imports: [\r\n CommonModule,\r\n MatProgressSpinner\r\n ]\r\n})\r\nexport class LoadingOverlayComponent implements OnInit {\r\n\r\n public libraryConfig = inject<ScaffoldLibraryConfig>(CONFIG, { optional: true });\r\n\r\n private scaffoldService = inject(ScaffoldService);\r\n\r\n\r\n public portal: ComponentPortal<any> | null = null;\r\n public loadingOverlayConfig: LoadingOverlayConfig | null = null;\r\n\r\n\r\n ngOnInit(): void {\r\n this.loadingOverlayConfig = this.scaffoldService.scaffoldConfig?.loadingOverlayConfig || null;\r\n\r\n if (this.loadingOverlayConfig?.customComponent) {\r\n this.portal = new ComponentPortal(this.loadingOverlayConfig?.customComponent);\r\n }\r\n }\r\n}\r\n","@if (!portal) {\r\n <div\r\n [ngClass]=\"loadingOverlayConfig?.cssClass\"\r\n [class.lf-gradient-spinner]=\"loadingOverlayConfig?.gradient\">\r\n <mat-progress-spinner mode=\"indeterminate\"></mat-progress-spinner>\r\n </div>\r\n} @else {\r\n <ng-template [cdkPortalOutlet]=\"portal\"></ng-template>\r\n}\r\n"],"names":[],"mappings":";;;;;;;;MAkBa,uBAAuB,CAAA;AAVpC,IAAA,WAAA,GAAA;QAYW,IAAA,CAAA,aAAa,GAAG,MAAM,CAAwB,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAExE,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;QAG1C,IAAA,CAAA,MAAM,GAAgC,IAAI;QAC1C,IAAA,CAAA,oBAAoB,GAAgC,IAAI;AAUlE,IAAA;IAPG,QAAQ,GAAA;AACJ,QAAA,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,eAAe,CAAC,cAAc,EAAE,oBAAoB,IAAI,IAAI;AAE7F,QAAA,IAAI,IAAI,CAAC,oBAAoB,EAAE,eAAe,EAAE;AAC5C,YAAA,IAAI,CAAC,MAAM,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,oBAAoB,EAAE,eAAe,CAAC;QACjF;IACJ;8GAjBS,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAvB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,uBAAuB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EClBpC,kUASA,EAAA,MAAA,EAAA,CAAA,kgBAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDKQ,YAAY,6HACZ,kBAAkB,EAAA,QAAA,EAAA,mCAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,MAAA,EAAA,OAAA,EAAA,UAAA,EAAA,aAAA,CAAA,EAAA,QAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAGb,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAVnC,SAAS;+BACI,oBAAoB,EAAA,UAAA,EAGlB,IAAI,EAAA,OAAA,EACP;wBACL,YAAY;wBACZ;AACH,qBAAA,EAAA,QAAA,EAAA,kUAAA,EAAA,MAAA,EAAA,CAAA,kgBAAA,CAAA,EAAA;;;;;"}