imng-kendo-schematics 19.178.2 → 19.178.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imng-kendo-schematics",
3
- "version": "19.178.2",
3
+ "version": "19.178.4",
4
4
  "description": "Angular Schematics facilitating Angular, Kendo, NGRX and imng package integration",
5
5
  "scripts": {
6
6
  "build": "tsc -p tsconfig.json",
@@ -1,6 +1,5 @@
1
1
  import { Injectable } from '@angular/core';
2
2
  import { NrsrxBaseApiClientService } from 'imng-nrsrx-client-utils';
3
- import { HttpClient } from '@angular/common/http';
4
3
  import { environment } from '@env';
5
4
 
6
5
  @Injectable({
@@ -12,7 +11,4 @@ export class <%= classify(name) %>ApiService extends NrsrxBaseApiClientService<I
12
11
  public override dateOnlyPropertyNames = [<% swaggerProperties.filter(t => t.format === 'date').forEach(function (swaggerProperty, index, dateProperties) { %>
13
12
  <%= classify(singularizedName) %>Properties.<%= swaggerProperty.snakeCaseName.toUpperCase() %><% if (index + 1 < dateProperties.length) { %>,<% }}) %>];
14
13
  <% } %>
15
- constructor(http: HttpClient) {
16
- super(http);
17
- }
18
14
  }
@@ -1,4 +1,4 @@
1
- import { Injectable } from '@angular/core';
1
+ import { Injectable, inject } from '@angular/core';
2
2
  import { Store } from '@ngrx/store';
3
3
  import { IDataEntryFacade } from 'imng-kendo-data-entry';<% if (hasObjects) { %>
4
4
  import { ODataState } from 'imng-kendo-odata';<% } %>
@@ -6,14 +6,14 @@ import { <%= camelize(pluralizedStoreName) %>Feature, <%= camelize(singularizedS
6
6
 
7
7
  @Injectable()
8
8
  export class <%= classify(name) %>CrudFacade implements IDataEntryFacade<I<%= classify(name) %>> {
9
+ private readonly store = inject(Store);
10
+
9
11
  loading$ = this.store.select(<%= camelize(pluralizedStoreName) %>Feature.selectLoading);
10
12
  currentEntity$ = this.store.select(<%= camelize(pluralizedStoreName) %>Feature.selectCurrent<%= classify(name) %>);
11
13
  isEditActive$ = this.store.select(<%= camelize(singularizedStoreName) %>Selectors.selectIsEdit<%= classify(name) %>Active);
12
14
  isNewActive$ = this.store.select(<%= camelize(singularizedStoreName) %>Selectors.selectIsNew<%= classify(name) %>Active);<% swaggerObjectProperties.filter(t=> !t.enum).forEach(function(swaggerProperty){ %>
13
15
  <%= camelize(swaggerProperty.pluralizedName) %>$ = this.store.select(<%= camelize(pluralizedStoreName) %>Feature.select<%= classify(swaggerProperty.pluralizedName) %>);<% }); %>
14
16
 
15
- constructor(private readonly store: Store) {}
16
-
17
17
  public setCurrentEntity(item: I<%= classify(name) %>): void {
18
18
  this.store.dispatch(<%= camelize(singularizedStoreName) %>ActionTypes.setCurrent<%= classify(name) %>(item));
19
19
  }
@@ -1,4 +1,4 @@
1
- import { Component, ChangeDetectionStrategy } from '@angular/core';
1
+ import { Component, ChangeDetectionStrategy, inject } from '@angular/core';
2
2
  import { Router } from '@angular/router';
3
3
  import { DetailExpandEvent } from '@progress/kendo-angular-grid';
4
4
  import { KendoODataBasedComponent } from 'imng-kendo-grid-odata';
@@ -15,15 +15,15 @@ import { <%= camelize(singularizedName) %>GridState } from './list.grid-state';
15
15
  standalone: false,
16
16
  })
17
17
  export class <%= classify(singularizedName) %>ListComponent extends KendoODataBasedComponent<I<%= classify(singularizedName) %>, <%= classify(singularizedName) %>ListFacade> {
18
+ public readonly crudFacade = inject(<%= classify(singularizedName) %>CrudFacade);
19
+
18
20
  public readonly props = <%= classify(singularizedName) %>Properties;<% swaggerObjectProperties.filter(t=> !t.enum).forEach(function(swaggerProperty){ %>
19
21
  public readonly <%= camelize(swaggerProperty.name) %>Props = <%= classify(swaggerProperty.propertyTypeName) %>Properties;<% }) %><% swaggerObjectProperties.filter(t=> t.enum).forEach(function(swaggerProperty){ %>
20
22
  public readonly <%= camelize(swaggerProperty.pluralizedPropertyTypeName) %> = <%= camelize(swaggerProperty.singularizedPropertyTypeName) %>Values;<% }) %>
21
23
  public currentItem: I<%= classify(singularizedName) %> | undefined;
22
24
 
23
- constructor(facade: <%= classify(singularizedName) %>ListFacade,
24
- public readonly crudFacade: <%= classify(singularizedName) %>CrudFacade,
25
- router: Router) {
26
- super(facade, <%= camelize(singularizedName) %>GridState, router);
25
+ constructor() {
26
+ super(inject(<%= classify(singularizedName) %>ListFacade), <%= camelize(singularizedName) %>GridState, inject(Router));
27
27
  }
28
28
 
29
29
  public addItem(): void {
@@ -1,4 +1,4 @@
1
- import { Injectable } from '@angular/core';
1
+ import { Injectable, inject } from '@angular/core';
2
2
  import { Store } from '@ngrx/store';
3
3
  import { IDataDeleteFacade } from 'imng-kendo-data-entry';
4
4
  import { IKendoODataGridFacade } from 'imng-kendo-grid-odata';
@@ -8,13 +8,13 @@ import { <%= camelize(pluralizedStoreName) %>Feature, <%= camelize(storeName) %>
8
8
 
9
9
  @Injectable()
10
10
  export class <%= classify(singularizedName) %>ListFacade implements IKendoODataGridFacade<I<%= classify(name) %>>, IDataDeleteFacade<I<%= classify(name) %>> {
11
+ private readonly store = inject(Store);
12
+
11
13
  loading$ = this.store.select(<%= camelize(pluralizedStoreName) %>Feature.selectLoading);
12
14
  gridData$ = this.store.select(<%= camelize(pluralizedStoreName) %>Feature.selectGridData);
13
15
  gridPagerSettings$ = this.store.select(<%= camelize(pluralizedStoreName) %>Feature.selectGridPagerSettings);
14
16
  gridODataState$ = this.store.select(<%= camelize(pluralizedStoreName) %>Feature.selectGridODataState);
15
17
 
16
- constructor(private readonly store: Store) {}
17
-
18
18
  public loadEntities(state: ODataState): void {
19
19
  this.store.dispatch(<%= camelize(storeName) %>ActionTypes.load<%= classify(pluralizedName) %>Request(state));
20
20
  }
@@ -1,4 +1,4 @@
1
- import { Injectable } from '@angular/core';
1
+ import { Injectable, inject } from '@angular/core';
2
2
  import { createEffect, Actions, ofType } from '@ngrx/effects';
3
3
  import { ODataService } from 'imng-kendo-odata';
4
4
  import { handleEffectError } from 'imng-ngrx-utils';
@@ -10,11 +10,10 @@ import { <%= classify(singularizedName) %>ApiService } from '../<%= dasherize(pl
10
10
  <% } %>
11
11
  @Injectable()
12
12
  export class <%= classify(singularizedName) %>CrudEffects {
13
- constructor(
14
- private readonly actions$: Actions,
15
- private readonly odataService: ODataService,
16
- private readonly <%= camelize(singularizedName) %>ApiService : <%= classify(singularizedName) %>ApiService,
17
- ) {}
13
+ private readonly actions$ = inject(Actions);
14
+ private readonly odataService = inject(ODataService);
15
+ private readonly <%= camelize(singularizedName) %>ApiService = inject(<%= classify(singularizedName) %>ApiService);
16
+
18
17
  <% if (openApiJsonUrl || openApiJsonFileName) { %>
19
18
  save<%= classify(singularizedName) %>Effect$ = createEffect(() => {
20
19
  return this.actions$.pipe(
@@ -1,4 +1,4 @@
1
- import { Injectable } from '@angular/core';
1
+ import { Injectable, inject } from '@angular/core';
2
2
  import { Store } from '@ngrx/store';
3
3
  import { createEffect, Actions, ofType } from '@ngrx/effects';
4
4
  import { concatLatestFrom } from '@ngrx/operators';
@@ -12,11 +12,10 @@ import { environment } from '@env';
12
12
 
13
13
  @Injectable()
14
14
  export class <%= classify(singularizedName) %>ListEffects {
15
- constructor(
16
- private readonly actions$: Actions,
17
- private readonly odataService: ODataService,
18
- private readonly store: Store,
19
- ) {}
15
+ private readonly actions$ = inject(Actions);
16
+ private readonly odataService = inject(ODataService);
17
+ private readonly store = inject(Store);
18
+
20
19
  <% if (openApiJsonUrl || openApiJsonFileName) { %>
21
20
  load<%= classify(pluralizedName) %>Effect$ = createEffect(() => {
22
21
  return this.actions$.pipe(