imng-kendo-schematics 7.291.2 → 7.292.2

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": "7.291.2",
3
+ "version": "7.292.2",
4
4
  "description": "Angular Schematics facilitating Angular, Kendo, NGRX and imng package integration",
5
5
  "scripts": {
6
6
  "build": "tsc -p tsconfig.json",
@@ -1,3 +1,4 @@
1
1
  export { <%= classify(singularizedName) %>ListComponent } from './list.component';
2
2
  export { <%= classify(singularizedName) %>ListFacade } from './list.facade';
3
3
  export { <%= classify(singularizedName) %>ApiService } from './api.service';
4
+ export { <%= camelize(singularizedName) %>GridState } from './list.grid-state';
@@ -2,22 +2,13 @@ import { Component, ChangeDetectionStrategy, Input } from '@angular/core';
2
2
  import { KendoODataBasedComponent } from 'imng-kendo-grid-odata';
3
3
  import { ODataState } from 'imng-kendo-odata';
4
4
  import { <%= classify(singularizedName) %>ListFacade } from './list.facade';
5
-
6
- const initialGridState: ODataState = {
7
- take: 5,
8
- skip: 0,
9
- selectors: [<% swaggerProperties.forEach(function(swaggerProperty){ %>
10
- <%= classify(singularizedName) %>Properties.<%= swaggerProperty.snakeCaseName.toUpperCase() %>,<%})%>
11
- ],
12
- sort: [
13
- { field: <%= classify(singularizedName) %>Properties.<%= firstProperty?.snakeCaseName.toUpperCase() %>, dir: 'asc' },
14
- ],
15
- };
5
+ import { <%= camelize(singularizedName) %>GridState } from './list.grid-state';
16
6
 
17
7
  @Component({
18
8
  selector: '<%= appPrefix %>-<%= dasherize(singularizedName) %>-list',
19
9
  templateUrl: './list.component.html',
20
10
  styleUrls: ['./list.component.scss'],
11
+ providers: [<%= classify(singularizedName) %>ListFacade],
21
12
  changeDetection: ChangeDetectionStrategy.OnPush,
22
13
  })
23
14
  export class <%= classify(singularizedName) %>ListComponent extends KendoODataBasedComponent<I<%= classify(singularizedName) %>, <%= classify(singularizedName) %>ListFacade> {
@@ -26,7 +17,7 @@ export class <%= classify(singularizedName) %>ListComponent extends KendoODataBa
26
17
  public currentItem: I<%= classify(singularizedName) %> | undefined;
27
18
 
28
19
  constructor(facade: <%= classify(singularizedName) %>ListFacade) {
29
- super(facade, initialGridState);
20
+ super(facade, <%= camelize(singularizedName) %>GridState);
30
21
  }
31
22
 
32
23
  @Input()
@@ -0,0 +1,19 @@
1
+ import { ODataState } from 'imng-kendo-odata';
2
+
3
+ export const <%= camelize(singularizedName) %>GridState: ODataState = {
4
+ take: 20,
5
+ skip: 0,
6
+ selectors: [<% swaggerProperties.filter(t => t.htmlInputType !== 'object' || t.enum).forEach(function (swaggerProperty) { %>
7
+ <%= classify(singularizedName) %>Properties.<%= swaggerProperty.snakeCaseName.toUpperCase() %>, <%}) %>
8
+ ],
9
+ sort: [
10
+ { field: <%= classify(singularizedName) %>Properties.<%= firstProperty?.snakeCaseName.toUpperCase() %>, dir: 'asc' },
11
+ ], <% if (hasObjects) { %>
12
+ expanders: [<% swaggerObjectProperties.filter(t => !t.enum).forEach(function (swaggerProperty) { %>
13
+ { table: <%= classify(singularizedName) %>Properties.<%= swaggerProperty.snakeCaseName.toUpperCase() %>,
14
+ selectors: [<% swaggerProperty.properties.forEach(function (subSwaggerProperty) { %>
15
+ <%= classify(swaggerProperty.propertyTypeName) %>Properties.<%= subSwaggerProperty.snakeCaseName.toUpperCase() %>, <%}) %>
16
+ ]
17
+ }, <% }) %>
18
+ ]<% } %>
19
+ };