@c8y/tutorial 1019.24.6 → 1020.0.8

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.
Files changed (54) hide show
  1. package/NOTICES +8357 -6666
  2. package/cumulocity.config.ts +208 -200
  3. package/package.json +13 -10
  4. package/src/__mocks/mock.module.ts +21 -0
  5. package/src/__mocks/scoped-mocks/lists.ts +70 -0
  6. package/src/__mocks/utils/generators/alarms.ts +6 -14
  7. package/src/alert/alert-example.components.html +98 -96
  8. package/src/app/app.module.ts +5 -1
  9. package/src/asset-navigator/asset-navigator-example.module.ts +21 -0
  10. package/src/dashboard/named-context-dashboard/named-context-dashboard.component.ts +9 -7
  11. package/src/dashboard/service-dashboard/service-dashboard.component.ts +9 -7
  12. package/src/dashboard/widget-dashboard/widget-dashboard.component.ts +0 -1
  13. package/src/dashboard-tabs/dashboard-tabs.component.ts +95 -0
  14. package/src/dashboard-tabs/dashboard-tabs.module.ts +20 -0
  15. package/src/dashboard-tabs/index.ts +1 -0
  16. package/src/for-of-directive/for-of-example.component.html +83 -16
  17. package/src/for-of-directive/for-of-example.component.ts +17 -3
  18. package/src/grids/async-expandable-rows-grid-example/async-expandable-rows-example.component.ts +21 -0
  19. package/src/grids/async-expandable-rows-grid-example/async-expandable-rows-grid-example.component.html +28 -0
  20. package/src/grids/async-expandable-rows-grid-example/async-expandable-rows-grid-example.component.ts +91 -0
  21. package/src/grids/async-expandable-rows-grid-example/async-expandable-rows-grid-example.module.ts +26 -0
  22. package/src/grids/client-grid-example/client-grid-example.component.html +1 -0
  23. package/src/grids/device-grid-example/device-grid-example.component.html +1 -0
  24. package/src/grids/empty-grid-example/empty-grid-example.component.html +1 -0
  25. package/src/grids/expandable-rows-grid-example/expandable-rows-example.component.ts +12 -0
  26. package/src/grids/expandable-rows-grid-example/expandable-rows-grid-example.component.html +18 -0
  27. package/src/grids/expandable-rows-grid-example/expandable-rows-grid-example.component.ts +84 -0
  28. package/src/grids/expandable-rows-grid-example/expandable-rows-grid-example.module.ts +24 -0
  29. package/src/grids/server-grid-example/server-grid-example.component.html +1 -0
  30. package/src/grids/server-grid-example/server-grid-example.component.ts +2 -1
  31. package/src/grids/sync-expandable-rows-grid-example/sync-expandable-rows-example.component.ts +12 -0
  32. package/src/grids/sync-expandable-rows-grid-example/sync-expandable-rows-grid-example.component.html +18 -0
  33. package/src/grids/sync-expandable-rows-grid-example/sync-expandable-rows-grid-example.component.ts +84 -0
  34. package/src/grids/sync-expandable-rows-grid-example/sync-expandable-rows-grid-example.module.ts +26 -0
  35. package/src/hooks/navigator-route/navigator-route.module.ts +2 -2
  36. package/src/hooks/tabs/tab.ts +1 -1
  37. package/src/list/list/list-check/list-check.component.html +40 -28
  38. package/src/list/list/list-check/list-check.component.ts +45 -7
  39. package/src/list/list/list-timeline/list-timeline.component.html +1 -1
  40. package/src/list/list/list-timeline/list-timeline.component.ts +7 -3
  41. package/src/list/list-virtual-scroll/list-virtual-scroll-check/list-virtual-scroll-check.component.ts +7 -12
  42. package/src/list/list-virtual-scroll/list-virtual-scroll-timeline/list-virtual-scroll-timeline.component.ts +11 -26
  43. package/src/main.ts +6 -4
  44. package/src/polyfills.ts +1 -1
  45. package/src/popconfirm/pop-confirm-example.component.ts +8 -6
  46. package/src/selector/asset-selector-example/different-root/asset-selector-different-root.component.ts +2 -2
  47. package/src/selector/asset-selector-example/general-example/asset-selector-example.component.html +58 -68
  48. package/src/selector/asset-selector-example/multi-select/asset-selector-multi-select.component.ts +1 -1
  49. package/src/selector/asset-selector-example/single-search/asset-selector-single-search.component.ts +2 -2
  50. package/src/selector/asset-selector-example/tree-devices/asset-selector-tree-devices.component.ts +12 -16
  51. package/src/selector/asset-selector-example/tree-search/asset-selector-tree-search.component.ts +14 -18
  52. package/src/selector/asset-selector-example/tree-single/asset-selector-tree-single.component.ts +17 -21
  53. package/src/translations/new-translate/new-translation.component.html +3 -3
  54. package/src/widget/demo-widget-config.component.ts +7 -2
@@ -1,19 +1,86 @@
1
1
  <c8y-title>For of directive</c8y-title>
2
2
 
3
- <div class="input-group input-group-search">
4
- <input
5
- class="form-control"
6
- title="{{ 'Filter' }}"
7
- placeholder="Filter…"
8
- type="search"
9
- (keyup)="setPipe($event.target.value)"
10
- />
11
- <span class="input-group-addon">
12
- <i c8yIcon="search"></i>
13
- </span>
14
- </div>
15
- <!-- important -->
16
- <div *c8yFor="let device of devices; loadMore: 'show'; let i = index; pipe: filterPipe">
17
- {{ i + 1 }}. {{ device.name }}
3
+ <div class="row d-flex-sm">
4
+ <div class="col-sm-3 p-0">
5
+ <div class="d-col p-t-8 p-l-16 p-b-16 p-r-16 form-group-sm bg-level-1">
6
+ <p class="text-medium p-b-16">Config options</p>
7
+
8
+ <div class="form-group">
9
+ <label for="filterInput">Filter pipe</label>
10
+ <input
11
+ class="form-control"
12
+ id="filterInput"
13
+ placeholder="Enter a known device…"
14
+ type="text"
15
+ [(ngModel)]="config.filter"
16
+ />
17
+ </div>
18
+
19
+ <div class="form-group">
20
+ <label for="pageSizeInput">Page size</label>
21
+ <input
22
+ class="form-control"
23
+ id="pageSizeInput"
24
+ type="number"
25
+ [(ngModel)]="config.pageSize"
26
+ min="1"
27
+ max="2000"
28
+ />
29
+ </div>
30
+
31
+ <div class="form-group">
32
+ <label for="maxIterations">Max iterations</label>
33
+ <input
34
+ class="form-control"
35
+ id="maxIterations"
36
+ type="number"
37
+ [(ngModel)]="config.maxIterations"
38
+ min="1"
39
+ />
40
+ </div>
41
+
42
+ <div class="form-group">
43
+ <label>Load more option:</label>
44
+ <div class="c8y-select-wrapper">
45
+ <select
46
+ class="form-control"
47
+ type="text"
48
+ [(ngModel)]="config.loadMore"
49
+ >
50
+ <option value="auto">auto - automatically load more items</option>
51
+ <option value="show">show - show a button to load more items.</option>
52
+ <option value="hidden">none - hidden and not loading more items</option>
53
+ <option value="hidden">hidden - hidden but loading more items</option>
54
+ </select>
55
+ </div>
56
+ </div>
57
+
58
+ <button
59
+ class="btn btn-primary"
60
+ (click)="reload()"
61
+ >
62
+ Apply
63
+ </button>
64
+ </div>
65
+ </div>
66
+ <div class="col-sm-9">
67
+ <p class="text-medium p-t-8">Preview</p>
68
+ <div class="card m-t-16">
69
+ <div class="card-block d-flex d-col p-0">
70
+ <!-- important -->
71
+ <div
72
+ *c8yFor="
73
+ let device of devices;
74
+ let i = index;
75
+ loadMore: config.loadMore;
76
+ pipe: filterPipe;
77
+ maxIterations: config.maxIterations;
78
+ "
79
+ >
80
+ {{ i + 1 }}. {{ device.name }}
81
+ </div>
82
+ <!-- /important -->
83
+ </div>
84
+ </div>
85
+ </div>
18
86
  </div>
19
- <!-- /important -->
@@ -13,19 +13,33 @@ import { map, tap } from 'rxjs/operators';
13
13
  export class ForOfExampleComponent {
14
14
  devices: IResultList<IManagedObject>;
15
15
  filterPipe: ForOfFilterPipe = pipe(tap());
16
+ config = {
17
+ loadMore: 'auto',
18
+ filter: '',
19
+ pageSize: 10,
20
+ maxIterations: 12
21
+ };
16
22
 
17
- constructor(private inventoryService: InventoryService) {
23
+ constructor(private inventoryService: InventoryService) {}
24
+
25
+ ngOnInit(): void {
18
26
  this.loadDevices();
19
27
  }
20
28
 
21
29
  async loadDevices() {
22
30
  this.devices = await this.inventoryService.list({
23
- pageSize: 10,
31
+ pageSize: this.config.pageSize,
24
32
  withTotalPages: true,
25
- fragmentType: 'c8y_IsDevice'
33
+ fragmentType: 'c8y_IsDevice',
34
+ currentPage: 1
26
35
  });
27
36
  }
28
37
 
38
+ async reload() {
39
+ await this.loadDevices();
40
+ this.setPipe(this.config.filter);
41
+ }
42
+
29
43
  setPipe(filterStr: string) {
30
44
  this.filterPipe = pipe(
31
45
  map((data: []) => {
@@ -0,0 +1,21 @@
1
+ import { Component, Input, OnInit } from '@angular/core';
2
+ import { CoreModule } from '@c8y/ngx-components';
3
+
4
+ @Component({
5
+ selector: 'c8y-async-expandable-row-example',
6
+ template: `<div id="{{ context.id }}">Context ID: {{ context.id }}</div>`,
7
+ standalone: true,
8
+ imports: [CoreModule]
9
+ })
10
+ export class AsyncExpandableRowsComponent implements OnInit {
11
+ @Input() context: any;
12
+ @Input() asyncRenderSuccess: () => void;
13
+ @Input() asyncRenderFail: () => void;
14
+
15
+ ngOnInit() {
16
+ // simulate async data loading with a timeout
17
+ setTimeout(() => {
18
+ this.asyncRenderSuccess();
19
+ }, 2000);
20
+ }
21
+ }
@@ -0,0 +1,28 @@
1
+ <c8y-title>Data grid examples - asynchronous expandable rows</c8y-title>
2
+
3
+ <c8y-data-grid
4
+ class="content-fullpage d-flex d-col border-top border-bottom"
5
+ [title]="title"
6
+ [columns]="columns"
7
+ [displayOptions]="displayOptions"
8
+ [rows]="data"
9
+ [pagination]="pagination"
10
+ [selectable]="selectable"
11
+ [expandableRows]="'ASYNC'"
12
+ (itemsSelect)="onItemsSelect($event)"
13
+ [actionControls]="actionControls"
14
+ >
15
+ <div
16
+ *c8yExpandableRow="
17
+ let context;
18
+ let asyncRenderSuccess = asyncRenderSuccess;
19
+ let asyncRenderFail = asyncRenderFail
20
+ "
21
+ >
22
+ <c8y-async-expandable-row-example
23
+ [context]="context"
24
+ [asyncRenderSuccess]="asyncRenderSuccess"
25
+ [asyncRenderFail]="asyncRenderFail"
26
+ ></c8y-async-expandable-row-example>
27
+ </div>
28
+ </c8y-data-grid>
@@ -0,0 +1,91 @@
1
+ import { Component, OnInit } from '@angular/core';
2
+ import { RouterModule } from '@angular/router';
3
+ import { ActionControl, DisplayOptions, Column, CoreModule, Pagination } from '@c8y/ngx-components';
4
+ import { DeviceGridModule } from '@c8y/ngx-components/device-grid';
5
+ import { getData } from '../client-grid-example/data';
6
+ import { AsyncExpandableRowsComponent } from './async-expandable-rows-example.component';
7
+ import { ContextDashboardModule } from '@c8y/ngx-components/context-dashboard';
8
+
9
+ @Component({
10
+ selector: 'c8y-async-expandable-rows-grid-example',
11
+ templateUrl: './async-expandable-rows-grid-example.component.html',
12
+ standalone: true,
13
+ imports: [
14
+ CoreModule,
15
+ DeviceGridModule,
16
+ RouterModule,
17
+ AsyncExpandableRowsComponent,
18
+ ContextDashboardModule
19
+ ]
20
+ })
21
+ export class AsyncExpandableRowsGridComponent implements OnInit {
22
+ /** This will be used as a title for the data grid. */
23
+ title = 'Devices';
24
+
25
+ displayOptions: DisplayOptions = {
26
+ bordered: false,
27
+ striped: true,
28
+ filter: true,
29
+ gridHeader: true,
30
+ hover: false
31
+ };
32
+ columns: Column[] = [
33
+ {
34
+ name: 'id',
35
+ header: 'ID',
36
+ path: 'id',
37
+ filterable: true
38
+ },
39
+ {
40
+ name: 'name',
41
+ header: 'Name',
42
+ path: 'name',
43
+ filterable: true
44
+ },
45
+ {
46
+ name: 'type',
47
+ header: 'Type',
48
+ path: 'type',
49
+ filterable: true
50
+ },
51
+ {
52
+ name: 'creationTime',
53
+ header: 'Creation time',
54
+ path: 'creationTime',
55
+ filterable: true
56
+ },
57
+ {
58
+ name: 'lastUpdated',
59
+ header: 'Last updated',
60
+ path: 'lastUpdated',
61
+ filterable: true
62
+ },
63
+ {
64
+ name: 'owner',
65
+ header: 'Owner',
66
+ path: 'owner',
67
+ filterable: true
68
+ }
69
+ ];
70
+ actionControls: ActionControl[] = [];
71
+ pagination: Pagination = {
72
+ pageSize: 30,
73
+ currentPage: 1
74
+ };
75
+ selectable = true;
76
+ data: any[];
77
+
78
+ ngOnInit() {
79
+ this.data = getData();
80
+ }
81
+
82
+ onItemsSelect(selectedItemIds) {
83
+ console.log('selected items:');
84
+ console.dir(selectedItemIds);
85
+ }
86
+
87
+ onFilter(filter) {
88
+ console.log('filter changed:');
89
+ console.log(filter);
90
+ }
91
+ }
@@ -0,0 +1,26 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { NavigatorNode, hookNavigator, hookRoute } from '@c8y/ngx-components';
4
+
5
+ @NgModule({
6
+ imports: [CommonModule],
7
+ providers: [
8
+ hookRoute({
9
+ path: 'grids/async-expandable-rows-grid-example',
10
+ loadComponent: () =>
11
+ import('./async-expandable-rows-grid-example.component').then(
12
+ m => m.AsyncExpandableRowsGridComponent
13
+ )
14
+ }),
15
+ hookNavigator(
16
+ new NavigatorNode({
17
+ priority: 5,
18
+ path: 'grids/async-expandable-rows-grid-example',
19
+ icon: 'table',
20
+ label: 'Asynchronous expandable rows grid',
21
+ parent: 'Data grid examples'
22
+ })
23
+ )
24
+ ]
25
+ })
26
+ export class AsyncExpandableRowsGridExampleModule {}
@@ -13,4 +13,5 @@
13
13
  (onFilter)="onFilter($event)"
14
14
  (onAddCustomColumn)="onAddCustomColumn($event)"
15
15
  (onRemoveCustomColumn)="onRemoveCustomColumn($event)"
16
+ class="content-fullpage d-flex d-col border-top border-bottom"
16
17
  ></c8y-data-grid>
@@ -26,4 +26,5 @@
26
26
  [actionControls]="[]"
27
27
  (onColumnsChange)="onColumnsChange($event)"
28
28
  (onDeviceQueryStringChange)="onDeviceQueryStringChange($event)"
29
+ class="content-fullpage d-flex d-col border-top border-bottom"
29
30
  ></c8y-device-grid>
@@ -4,6 +4,7 @@
4
4
  [title]="title"
5
5
  [columns]="columns"
6
6
  [actionControls]="actionControls"
7
+ class="content-fullpage d-flex d-col border-top border-bottom"
7
8
  >
8
9
  <c8y-ui-empty-state
9
10
  icon="search"
@@ -0,0 +1,12 @@
1
+ import { Component, Input } from '@angular/core';
2
+ import { CoreModule } from '@c8y/ngx-components';
3
+
4
+ @Component({
5
+ selector: 'c8y-expandable-row-example',
6
+ template: `<div id="{{ context.id }}">Context ID: {{ context.id }}</div>`,
7
+ standalone: true,
8
+ imports: [CoreModule]
9
+ })
10
+ export class ExpandableRowsComponent {
11
+ @Input() context: any;
12
+ }
@@ -0,0 +1,18 @@
1
+ <c8y-title>Data grid examples</c8y-title>
2
+
3
+ <c8y-data-grid
4
+ [title]="title"
5
+ [columns]="columns"
6
+ [displayOptions]="displayOptions"
7
+ [rows]="data"
8
+ [pagination]="pagination"
9
+ [selectable]="selectable"
10
+ [expandableRows]="true"
11
+ (itemsSelect)="onItemsSelect($event)"
12
+ [actionControls]="actionControls"
13
+ class="content-fullpage d-flex d-col border-top border-bottom"
14
+ >
15
+ <div *c8yExpandableRow="let context">
16
+ <c8y-expandable-row-example [context]="context"></c8y-expandable-row-example>
17
+ </div>
18
+ </c8y-data-grid>
@@ -0,0 +1,84 @@
1
+ import { Component, OnInit } from '@angular/core';
2
+ import { RouterModule } from '@angular/router';
3
+ import { ActionControl, DisplayOptions, Column, CoreModule, Pagination } from '@c8y/ngx-components';
4
+ import { DeviceGridModule } from '@c8y/ngx-components/device-grid';
5
+ import { getData } from '../client-grid-example/data';
6
+ import { ExpandableRowsComponent } from './expandable-rows-example.component';
7
+
8
+ @Component({
9
+ selector: 'c8y-expandable-rows-grid-example',
10
+ templateUrl: './expandable-rows-grid-example.component.html',
11
+ standalone: true,
12
+ imports: [CoreModule, DeviceGridModule, RouterModule, ExpandableRowsComponent]
13
+ })
14
+ export class ExpandableRowsGridComponent implements OnInit {
15
+ /** This will be used as a title for the data grid. */
16
+ title = 'Devices';
17
+
18
+ displayOptions: DisplayOptions = {
19
+ bordered: false,
20
+ striped: true,
21
+ filter: true,
22
+ gridHeader: true,
23
+ hover: false
24
+ };
25
+ columns: Column[] = [
26
+ {
27
+ name: 'id',
28
+ header: 'ID',
29
+ path: 'id',
30
+ filterable: true
31
+ },
32
+ {
33
+ name: 'name',
34
+ header: 'Name',
35
+ path: 'name',
36
+ filterable: true
37
+ },
38
+ {
39
+ name: 'type',
40
+ header: 'Type',
41
+ path: 'type',
42
+ filterable: true
43
+ },
44
+ {
45
+ name: 'creationTime',
46
+ header: 'Creation time',
47
+ path: 'creationTime',
48
+ filterable: true
49
+ },
50
+ {
51
+ name: 'lastUpdated',
52
+ header: 'Last updated',
53
+ path: 'lastUpdated',
54
+ filterable: true
55
+ },
56
+ {
57
+ name: 'owner',
58
+ header: 'Owner',
59
+ path: 'owner',
60
+ filterable: true
61
+ }
62
+ ];
63
+ actionControls: ActionControl[] = [];
64
+ pagination: Pagination = {
65
+ pageSize: 30,
66
+ currentPage: 1
67
+ };
68
+ selectable = true;
69
+ data: any[];
70
+
71
+ ngOnInit() {
72
+ this.data = getData();
73
+ }
74
+
75
+ onItemsSelect(selectedItemIds) {
76
+ console.log('selected items:');
77
+ console.dir(selectedItemIds);
78
+ }
79
+
80
+ onFilter(filter) {
81
+ console.log('filter changed:');
82
+ console.log(filter);
83
+ }
84
+ }
@@ -0,0 +1,24 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { NavigatorNode, hookNavigator, hookRoute } from '@c8y/ngx-components';
4
+
5
+ @NgModule({
6
+ imports: [CommonModule],
7
+ providers: [
8
+ hookRoute({
9
+ path: 'grids/expandable-rows-grid-example',
10
+ loadComponent: () =>
11
+ import('./expandable-rows-grid-example.component').then(m => m.ExpandableRowsGridComponent)
12
+ }),
13
+ hookNavigator(
14
+ new NavigatorNode({
15
+ priority: 5,
16
+ path: 'grids/expandable-rows-grid-example',
17
+ icon: 'table',
18
+ label: 'Expandable rows grid',
19
+ parent: 'Data grid examples'
20
+ })
21
+ )
22
+ ]
23
+ })
24
+ export class ExpandableRowsGridExampleModule {}
@@ -16,6 +16,7 @@
16
16
  (itemsSelect)="onItemsSelect($event)"
17
17
  [bulkActionControls]="bulkActionControls"
18
18
  (onConfigChange)="onConfigChange($event)"
19
+ class="content-fullpage d-flex d-col border-top border-bottom"
19
20
  >
20
21
  <c8y-ui-empty-state
21
22
  [icon]="'search'"
@@ -62,7 +62,8 @@ export class ServerGridExampleComponent implements GridConfigContextProvider {
62
62
  bordered: true,
63
63
  striped: true,
64
64
  filter: true,
65
- gridHeader: true
65
+ gridHeader: true,
66
+ hover: true
66
67
  };
67
68
 
68
69
  columns: Column[] = this.service.getColumns();
@@ -0,0 +1,12 @@
1
+ import { Component, Input } from '@angular/core';
2
+ import { CoreModule } from '@c8y/ngx-components';
3
+
4
+ @Component({
5
+ selector: 'c8y-sync-expandable-row-example',
6
+ template: `<div id="{{ context.id }}">Context ID: {{ context.id }}</div>`,
7
+ standalone: true,
8
+ imports: [CoreModule]
9
+ })
10
+ export class SyncExpandableRowsComponent {
11
+ @Input() context: any;
12
+ }
@@ -0,0 +1,18 @@
1
+ <c8y-title>Data grid examples - synchronous expandable rows</c8y-title>
2
+
3
+ <c8y-data-grid
4
+ class="content-fullpage d-flex d-col border-top border-bottom"
5
+ [title]="title"
6
+ [columns]="columns"
7
+ [displayOptions]="displayOptions"
8
+ [rows]="data"
9
+ [pagination]="pagination"
10
+ [selectable]="selectable"
11
+ [expandableRows]="'SYNC'"
12
+ (itemsSelect)="onItemsSelect($event)"
13
+ [actionControls]="actionControls"
14
+ >
15
+ <div *c8yExpandableRow="let context">
16
+ <c8y-sync-expandable-row-example [context]="context"></c8y-sync-expandable-row-example>
17
+ </div>
18
+ </c8y-data-grid>
@@ -0,0 +1,84 @@
1
+ import { Component, OnInit } from '@angular/core';
2
+ import { RouterModule } from '@angular/router';
3
+ import { ActionControl, DisplayOptions, Column, CoreModule, Pagination } from '@c8y/ngx-components';
4
+ import { DeviceGridModule } from '@c8y/ngx-components/device-grid';
5
+ import { getData } from '../client-grid-example/data';
6
+ import { SyncExpandableRowsComponent } from './sync-expandable-rows-example.component';
7
+
8
+ @Component({
9
+ selector: 'c8y-sync-expandable-rows-grid-example',
10
+ templateUrl: './sync-expandable-rows-grid-example.component.html',
11
+ standalone: true,
12
+ imports: [CoreModule, DeviceGridModule, RouterModule, SyncExpandableRowsComponent]
13
+ })
14
+ export class SyncExpandableRowsGridComponent implements OnInit {
15
+ /** This will be used as a title for the data grid. */
16
+ title = 'Devices';
17
+
18
+ displayOptions: DisplayOptions = {
19
+ bordered: false,
20
+ striped: true,
21
+ filter: true,
22
+ gridHeader: true,
23
+ hover: false
24
+ };
25
+ columns: Column[] = [
26
+ {
27
+ name: 'id',
28
+ header: 'ID',
29
+ path: 'id',
30
+ filterable: true
31
+ },
32
+ {
33
+ name: 'name',
34
+ header: 'Name',
35
+ path: 'name',
36
+ filterable: true
37
+ },
38
+ {
39
+ name: 'type',
40
+ header: 'Type',
41
+ path: 'type',
42
+ filterable: true
43
+ },
44
+ {
45
+ name: 'creationTime',
46
+ header: 'Creation time',
47
+ path: 'creationTime',
48
+ filterable: true
49
+ },
50
+ {
51
+ name: 'lastUpdated',
52
+ header: 'Last updated',
53
+ path: 'lastUpdated',
54
+ filterable: true
55
+ },
56
+ {
57
+ name: 'owner',
58
+ header: 'Owner',
59
+ path: 'owner',
60
+ filterable: true
61
+ }
62
+ ];
63
+ actionControls: ActionControl[] = [];
64
+ pagination: Pagination = {
65
+ pageSize: 30,
66
+ currentPage: 1
67
+ };
68
+ selectable = true;
69
+ data: any[];
70
+
71
+ ngOnInit() {
72
+ this.data = getData();
73
+ }
74
+
75
+ onItemsSelect(selectedItemIds) {
76
+ console.log('selected items:');
77
+ console.dir(selectedItemIds);
78
+ }
79
+
80
+ onFilter(filter) {
81
+ console.log('filter changed:');
82
+ console.log(filter);
83
+ }
84
+ }
@@ -0,0 +1,26 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { NavigatorNode, hookNavigator, hookRoute } from '@c8y/ngx-components';
4
+
5
+ @NgModule({
6
+ imports: [CommonModule],
7
+ providers: [
8
+ hookRoute({
9
+ path: 'grids/sync-expandable-rows-grid-example',
10
+ loadComponent: () =>
11
+ import('./sync-expandable-rows-grid-example.component').then(
12
+ m => m.SyncExpandableRowsGridComponent
13
+ )
14
+ }),
15
+ hookNavigator(
16
+ new NavigatorNode({
17
+ priority: 5,
18
+ path: 'grids/sync-expandable-rows-grid-example',
19
+ icon: 'table',
20
+ label: 'Synchronous expandable rows grid',
21
+ parent: 'Data grid examples'
22
+ })
23
+ )
24
+ ]
25
+ })
26
+ export class SyncExpandableRowsGridExampleModule {}
@@ -1,5 +1,5 @@
1
1
  import { NgModule } from '@angular/core';
2
- import { NavigatorNode, hookNavigator, hookRoute } from '@c8y/ngx-components';
2
+ import { NavigatorNode, NavigatorNodeData, hookNavigator, hookRoute } from '@c8y/ngx-components';
3
3
 
4
4
  export const hooks = [
5
5
  hookRoute({
@@ -13,7 +13,7 @@ export const hooks = [
13
13
  icon: 'navigation',
14
14
  label: 'Navigator-route',
15
15
  parent: 'Hooks'
16
- })
16
+ } as NavigatorNodeData)
17
17
  )
18
18
  ];
19
19
 
@@ -18,7 +18,7 @@ export class ExampleTabFactory implements TabFactory {
18
18
  * but these tabs should only displayed if the URL matches
19
19
  * something like: .../apps/tutorial-application/#/world/
20
20
  */
21
- if (this.router.url.match(/tabs/g)) {
21
+ if (this.router.url.match(/\/tabs/g)) {
22
22
  /**
23
23
  * mandatory for a Tab is the path (string) and the label (string)
24
24
  * A click on the tab will load the given path and therefore angular loads the