@c8y/tutorial 1019.24.2 → 1020.0.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.
Files changed (52) 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/widget-dashboard/widget-dashboard.component.ts +0 -1
  11. package/src/dashboard-tabs/dashboard-tabs.component.ts +95 -0
  12. package/src/dashboard-tabs/dashboard-tabs.module.ts +20 -0
  13. package/src/dashboard-tabs/index.ts +1 -0
  14. package/src/for-of-directive/for-of-example.component.html +83 -16
  15. package/src/for-of-directive/for-of-example.component.ts +17 -3
  16. package/src/grids/async-expandable-rows-grid-example/async-expandable-rows-example.component.ts +21 -0
  17. package/src/grids/async-expandable-rows-grid-example/async-expandable-rows-grid-example.component.html +28 -0
  18. package/src/grids/async-expandable-rows-grid-example/async-expandable-rows-grid-example.component.ts +91 -0
  19. package/src/grids/async-expandable-rows-grid-example/async-expandable-rows-grid-example.module.ts +26 -0
  20. package/src/grids/client-grid-example/client-grid-example.component.html +1 -0
  21. package/src/grids/device-grid-example/device-grid-example.component.html +1 -0
  22. package/src/grids/empty-grid-example/empty-grid-example.component.html +1 -0
  23. package/src/grids/expandable-rows-grid-example/expandable-rows-example.component.ts +12 -0
  24. package/src/grids/expandable-rows-grid-example/expandable-rows-grid-example.component.html +18 -0
  25. package/src/grids/expandable-rows-grid-example/expandable-rows-grid-example.component.ts +84 -0
  26. package/src/grids/expandable-rows-grid-example/expandable-rows-grid-example.module.ts +24 -0
  27. package/src/grids/server-grid-example/server-grid-example.component.html +1 -0
  28. package/src/grids/server-grid-example/server-grid-example.component.ts +2 -1
  29. package/src/grids/sync-expandable-rows-grid-example/sync-expandable-rows-example.component.ts +12 -0
  30. package/src/grids/sync-expandable-rows-grid-example/sync-expandable-rows-grid-example.component.html +18 -0
  31. package/src/grids/sync-expandable-rows-grid-example/sync-expandable-rows-grid-example.component.ts +84 -0
  32. package/src/grids/sync-expandable-rows-grid-example/sync-expandable-rows-grid-example.module.ts +26 -0
  33. package/src/hooks/navigator-route/navigator-route.module.ts +2 -2
  34. package/src/hooks/tabs/tab.ts +1 -1
  35. package/src/list/list/list-check/list-check.component.html +40 -28
  36. package/src/list/list/list-check/list-check.component.ts +45 -7
  37. package/src/list/list/list-timeline/list-timeline.component.html +1 -1
  38. package/src/list/list/list-timeline/list-timeline.component.ts +7 -3
  39. package/src/list/list-virtual-scroll/list-virtual-scroll-check/list-virtual-scroll-check.component.ts +7 -12
  40. package/src/list/list-virtual-scroll/list-virtual-scroll-timeline/list-virtual-scroll-timeline.component.ts +11 -26
  41. package/src/main.ts +6 -4
  42. package/src/polyfills.ts +1 -1
  43. package/src/popconfirm/pop-confirm-example.component.ts +8 -6
  44. package/src/selector/asset-selector-example/different-root/asset-selector-different-root.component.ts +2 -2
  45. package/src/selector/asset-selector-example/general-example/asset-selector-example.component.html +58 -68
  46. package/src/selector/asset-selector-example/multi-select/asset-selector-multi-select.component.ts +1 -1
  47. package/src/selector/asset-selector-example/single-search/asset-selector-single-search.component.ts +2 -2
  48. package/src/selector/asset-selector-example/tree-devices/asset-selector-tree-devices.component.ts +12 -16
  49. package/src/selector/asset-selector-example/tree-search/asset-selector-tree-search.component.ts +14 -18
  50. package/src/selector/asset-selector-example/tree-single/asset-selector-tree-single.component.ts +17 -21
  51. package/src/translations/new-translate/new-translation.component.html +3 -3
  52. package/src/widget/demo-widget-config.component.ts +7 -2
@@ -2,17 +2,20 @@ import { Component } from '@angular/core';
2
2
  import { IManagedObject, InventoryService, IResultList } from '@c8y/client';
3
3
  import { CoreModule } from '@c8y/ngx-components';
4
4
  import { RouterModule } from '@angular/router';
5
+ import { BehaviorSubject, map } from 'rxjs';
6
+ import { CommonModule } from '@angular/common';
7
+ import { OnInit } from '@angular/core';
5
8
 
6
9
  @Component({
7
10
  selector: 'list-check',
8
11
  templateUrl: './list-check.component.html',
9
12
  standalone: true,
10
- imports: [CoreModule, RouterModule]
13
+ imports: [CoreModule, RouterModule, CommonModule]
11
14
  })
12
- export class ListCheckComponent {
15
+ export class ListCheckComponent implements OnInit {
13
16
  devices: IResultList<IManagedObject>;
14
- selected = { id: null, name: '' };
15
- checkAll;
17
+ loadedDevices: IManagedObject[] = [];
18
+ selected$: BehaviorSubject<IManagedObject[]> = new BehaviorSubject([]);
16
19
 
17
20
  // The filter object will add query parameters
18
21
  // to the request which is made by the service.
@@ -20,10 +23,37 @@ export class ListCheckComponent {
20
23
  fragmentType: 'c8y_IsDevice',
21
24
  // paging information will be a part of the response now
22
25
  withTotalPages: true,
23
- pageSize: 10
26
+ pageSize: 10,
27
+ currentPage: 1
24
28
  };
25
29
 
26
- constructor(public inventory: InventoryService) {
30
+ isIndeterminate$ = this.selected$.pipe(
31
+ map(selected => {
32
+ return !(selected.length === 0 || selected.length === this.loadedDevices.length);
33
+ })
34
+ );
35
+
36
+ constructor(public inventory: InventoryService) {}
37
+
38
+ itemsChange(newItems: IManagedObject[]) {
39
+ this.loadedDevices.push(...newItems);
40
+ // trigger the isIndeterminate$ observable
41
+ this.selected$.next([...this.selected$.value]);
42
+ }
43
+
44
+ checkAll(checked) {
45
+ if (!checked) {
46
+ this.selected$.next([]);
47
+ return;
48
+ }
49
+ this.selected$.next([...this.loadedDevices]);
50
+ }
51
+
52
+ isSelected(device: IManagedObject) {
53
+ return this.selected$.value.some(d => d.id === device.id);
54
+ }
55
+
56
+ ngOnInit(): void {
27
57
  this.loadDevices();
28
58
  }
29
59
 
@@ -42,6 +72,14 @@ export class ListCheckComponent {
42
72
 
43
73
  // triggered if a device is selected
44
74
  updateSelected(checked, device) {
45
- console.log(checked, device);
75
+ const selected = this.selected$.value;
76
+ const index = selected.findIndex(d => d.id === device.id);
77
+ if (checked && index === -1) {
78
+ this.selected$.next([...selected, device]);
79
+ return;
80
+ } else if (!checked && index > -1) {
81
+ selected.splice(index, 1);
82
+ this.selected$.next(selected);
83
+ }
46
84
  }
47
85
  }
@@ -1,7 +1,7 @@
1
1
  <c8y-title>List example</c8y-title>
2
2
 
3
3
  <c8y-list-group class="m-t-16">
4
- <c8y-li-timeline *c8yFor="let device of devices; let i = index">
4
+ <c8y-li-timeline *c8yFor="let device of devices; loadMore: 'auto'; let i = index">
5
5
  {{ device.creationTime | date }}
6
6
  <c8y-li>
7
7
  <c8y-li-radio (onSelect)="updateSelected($event, device)"></c8y-li-radio>
@@ -2,6 +2,7 @@ import { Component } from '@angular/core';
2
2
  import { IManagedObject, InventoryService, IResultList } from '@c8y/client';
3
3
  import { CoreModule } from '@c8y/ngx-components';
4
4
  import { RouterModule } from '@angular/router';
5
+ import { OnInit } from '@angular/core';
5
6
 
6
7
  @Component({
7
8
  selector: 'list-timeline',
@@ -9,7 +10,7 @@ import { RouterModule } from '@angular/router';
9
10
  standalone: true,
10
11
  imports: [CoreModule, RouterModule]
11
12
  })
12
- export class ListTimelineComponent {
13
+ export class ListTimelineComponent implements OnInit {
13
14
  devices: IResultList<IManagedObject>;
14
15
  selected = { id: null, name: '' };
15
16
 
@@ -19,10 +20,13 @@ export class ListTimelineComponent {
19
20
  fragmentType: 'c8y_IsDevice',
20
21
  // paging information will be a part of the response now
21
22
  withTotalPages: true,
22
- pageSize: 10
23
+ pageSize: 10,
24
+ currentPage: 1
23
25
  };
24
26
 
25
- constructor(public inventory: InventoryService) {
27
+ constructor(public inventory: InventoryService) {}
28
+
29
+ ngOnInit(): void {
26
30
  this.loadDevices();
27
31
  }
28
32
 
@@ -1,5 +1,5 @@
1
1
  import { CoreModule, StepperService, throttle } from '@c8y/ngx-components';
2
- import { Component } from '@angular/core';
2
+ import { Component, OnInit } from '@angular/core';
3
3
  import { IManagedObject, InventoryService, IResultList } from '@c8y/client';
4
4
  import { RouterModule } from '@angular/router';
5
5
 
@@ -13,7 +13,7 @@ import { RouterModule } from '@angular/router';
13
13
  imports: [CoreModule, RouterModule],
14
14
  providers: [StepperService]
15
15
  })
16
- export class ListVirtualScrollCheckComponent {
16
+ export class ListVirtualScrollCheckComponent implements OnInit {
17
17
  devices: IResultList<IManagedObject>;
18
18
  devicesContainerStrategy: IResultList<IManagedObject>;
19
19
  selected = { id: null, name: '' };
@@ -30,20 +30,16 @@ export class ListVirtualScrollCheckComponent {
30
30
  pageSize: 10
31
31
  };
32
32
 
33
- constructor(public inventory: InventoryService) {
34
- this.loadDevices();
35
- this.loadDevicesContainerStrategy();
36
- }
33
+ constructor(public inventory: InventoryService) {}
37
34
 
38
- // Promise-based usage of InventoryService.
39
- async loadDevices() {
40
- this.devices = await this.inventory.list(this.filter);
35
+ ngOnInit(): void {
36
+ this.loadDevicesContainerStrategy();
41
37
  }
42
38
 
43
39
  @throttle(500, { trailing: false })
44
40
  async loadDevicesContainerStrategy() {
45
41
  const filter: any = { ...this.filter };
46
- filter.pageSize = 999999999;
42
+ filter.pageSize = 2000;
47
43
 
48
44
  const items = await this.inventory.list(filter);
49
45
 
@@ -58,8 +54,7 @@ export class ListVirtualScrollCheckComponent {
58
54
  // Delete a managedObject (as device) with given id from database.
59
55
  async deleteDevice(id: string) {
60
56
  if (id && id.length > 0) {
61
- await this.inventory.delete(id);
62
- this.loadDevices();
57
+ console.log('Not really deleting the device.');
63
58
  }
64
59
  }
65
60
 
@@ -1,5 +1,5 @@
1
- import { CoreModule, StepperService, throttle } from '@c8y/ngx-components';
2
- import { Component } from '@angular/core';
1
+ import { CoreModule, StepperService } from '@c8y/ngx-components';
2
+ import { Component, OnInit } from '@angular/core';
3
3
  import { IManagedObject, InventoryService, IResultList } from '@c8y/client';
4
4
  import { RouterModule } from '@angular/router';
5
5
 
@@ -13,11 +13,11 @@ import { RouterModule } from '@angular/router';
13
13
  imports: [CoreModule, RouterModule],
14
14
  providers: [StepperService]
15
15
  })
16
- export class ListVirtualScrollTimelineComponent {
16
+ export class ListVirtualScrollTimelineComponent implements OnInit {
17
17
  devices: IResultList<IManagedObject>;
18
- devicesContainerStrategy: IResultList<IManagedObject>;
19
18
  selected = { id: null, name: '' };
20
- dataMultiplier = 1;
19
+ checkAll;
20
+ enableBasicList = false;
21
21
 
22
22
  // The filter object will add query parameters
23
23
  // to the request which is made by the service.
@@ -25,13 +25,14 @@ export class ListVirtualScrollTimelineComponent {
25
25
  fragmentType: 'c8y_IsDevice',
26
26
  // paging information will be a part of the response now
27
27
  withTotalPages: true,
28
- pageSize: 10
28
+ pageSize: 10,
29
+ currentPage: 1
29
30
  };
30
31
 
31
- constructor(public inventory: InventoryService) {
32
- // _ annotation to mark this string as translatable string.
32
+ constructor(public inventory: InventoryService) {}
33
+
34
+ ngOnInit(): void {
33
35
  this.loadDevices();
34
- this.loadDevicesContainerStrategy();
35
36
  }
36
37
 
37
38
  // Promise-based usage of InventoryService.
@@ -39,26 +40,10 @@ export class ListVirtualScrollTimelineComponent {
39
40
  this.devices = await this.inventory.list(this.filter);
40
41
  }
41
42
 
42
- @throttle(500, { trailing: false })
43
- async loadDevicesContainerStrategy() {
44
- const filter: any = { ...this.filter };
45
- filter.pageSize = 999999999;
46
-
47
- const items = await this.inventory.list(filter);
48
-
49
- // Let us simulate that we have very large amount of data to display:
50
- const template = [...items.data];
51
- while (items.data.length < this.dataMultiplier) {
52
- items.data.push(...template);
53
- }
54
- this.devicesContainerStrategy = items;
55
- }
56
-
57
43
  // Delete a managedObject (as device) with given id from database.
58
44
  async deleteDevice(id: string) {
59
45
  if (id && id.length > 0) {
60
- await this.inventory.delete(id);
61
- this.loadDevices();
46
+ console.log('Not really deleting the device.');
62
47
  }
63
48
  }
64
49
 
package/src/main.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import './i18n';
2
- import { applyOptions, loadOptions, loginOptions } from '@c8y/bootstrap';
2
+ import { applyOptions, loadOptions } from '@c8y/bootstrap';
3
3
 
4
4
  /** Verify that custom webpack config is working */
5
5
  declare const HELLO_WORLD: string;
@@ -12,11 +12,13 @@ applicationSetup();
12
12
 
13
13
  async function applicationSetup() {
14
14
  const options = await applyOptions({
15
- ...(await loadOptions()),
16
- ...((await loginOptions()) as object)
15
+ ...(await loadOptions())
17
16
  });
18
17
 
19
- const mod = await import('./bootstrap');
18
+ const mod = await import(
19
+ /* webpackPreload: true */
20
+ './bootstrap'
21
+ );
20
22
  const bootstrapApp = mod.bootstrap || (window as any).bootstrap || (() => null);
21
23
 
22
24
  return Promise.resolve(bootstrapApp(options)).then(removeProgress);
package/src/polyfills.ts CHANGED
@@ -30,4 +30,4 @@
30
30
  /***************************************************************************************************
31
31
  * Zone JS is required by default for Angular itself.
32
32
  */
33
- import 'zone.js/dist/zone'; // Included with Angular CLI.
33
+ import 'zone.js'; // Included with Angular CLI.
@@ -18,14 +18,14 @@ import {
18
18
  type="button"
19
19
  (click)="triggerPopover(poConfirm)"
20
20
  >
21
- <c8y-popover-confirm
22
- [title]="'Delete item' | translate"
23
- [placement]="'right'"
24
- [outsideClick]="true"
25
- #poConfirm
26
- ></c8y-popover-confirm>
27
21
  <i c8yIcon="minus-circle"></i>
28
22
  </button>
23
+ <c8y-popover-confirm
24
+ [title]="'Delete item' | translate"
25
+ [placement]="'right'"
26
+ [outsideClick]="true"
27
+ #poConfirm
28
+ ></c8y-popover-confirm>
29
29
  </div>`,
30
30
  standalone: true,
31
31
  imports: [ModalModule, CommonModule, HeaderModule]
@@ -50,9 +50,11 @@ export class PopConfirmExampleComponent {
50
50
  try {
51
51
  const remove = await poConfirm.show(this.confirmRemoveColumnButtons);
52
52
  if (!remove) {
53
+ // eslint-disable-next-line no-console
53
54
  console.log('You clicked "Cancel"!');
54
55
  return;
55
56
  }
57
+ // eslint-disable-next-line no-console
56
58
  console.log('You successfully deleted the item!');
57
59
  } catch (e) {
58
60
  // do nothing or display "deletion failed" message
@@ -14,7 +14,7 @@ import { BehaviorSubject } from 'rxjs';
14
14
  <div class="card-header separator">
15
15
  <h4 class="card-title">Miller view different root {{ (rootNode$ | async)?.id }}</h4>
16
16
  </div>
17
- <div class="card-block d-flex d-col p-t-0 p-b-0" style="height: 300px">
17
+ <div class="d-flex d-col" style="height: 300px">
18
18
  <c8y-asset-selector-miller
19
19
  [(ngModel)]="model"
20
20
  (onSelected)="selectionChanged($event)"
@@ -35,7 +35,7 @@ import { BehaviorSubject } from 'rxjs';
35
35
  Miller view single column different root {{ (rootNode$ | async)?.id }}
36
36
  </h4>
37
37
  </div>
38
- <div class="card-block d-flex d-col p-t-0 p-b-0" style="height: 300px">
38
+ <div class="d-flex d-col" style="height: 300px">
39
39
  <c8y-asset-selector-miller
40
40
  class="bg-component"
41
41
  [(ngModel)]="model"
@@ -19,7 +19,7 @@
19
19
  <div class="card-header separator">
20
20
  <h4 class="card-title">Miller view single select child devices</h4>
21
21
  </div>
22
- <div class="card-block d-flex d-col p-t-0 p-b-0" style="height: 300px">
22
+ <div class="d-flex d-col" style="height: 300px">
23
23
  <c8y-asset-selector-miller
24
24
  [(ngModel)]="model"
25
25
  (onSelected)="selectionChanged($event)"
@@ -36,7 +36,7 @@
36
36
  <div class="card-header separator">
37
37
  <h4 class="card-title">Miller view single select</h4>
38
38
  </div>
39
- <div class="card-block d-flex d-col p-t-0 p-b-0" style="height: 300px">
39
+ <div class="d-flex d-col" style="height: 300px">
40
40
  <c8y-asset-selector-miller
41
41
  [(ngModel)]="model"
42
42
  (onSelected)="selectionChanged($event)"
@@ -51,7 +51,7 @@
51
51
  <div class="card-header separator">
52
52
  <h4 class="card-title">Miller view single select only devices</h4>
53
53
  </div>
54
- <div class="card-block d-flex d-col p-t-0 p-b-0" style="height: 300px">
54
+ <div class="d-flex d-col" style="height: 300px">
55
55
  <c8y-asset-selector-miller
56
56
  [(ngModel)]="model"
57
57
  (onSelected)="selectionChanged($event)"
@@ -67,7 +67,7 @@
67
67
  <div class="card-header separator">
68
68
  <h4 class="card-title">Miller view single select with column headers and filter</h4>
69
69
  </div>
70
- <div class="card-block d-flex d-col p-t-0 p-b-0" style="height: 300px">
70
+ <div class="d-flex d-col" style="height: 300px">
71
71
  <c8y-asset-selector-miller
72
72
  [(ngModel)]="model"
73
73
  (onSelected)="selectionChanged($event)"
@@ -84,10 +84,10 @@
84
84
  <div class="card">
85
85
  <div class="card-header separator">
86
86
  <h4 class="card-title">
87
- Miller view single select with column headers, filter, and global search
87
+ Miller view single select with column headers, filter, global search
88
88
  </h4>
89
89
  </div>
90
- <div class="card-block d-flex d-col p-t-0 p-b-0" style="height: 300px">
90
+ <div class="d-flex d-col" style="height: 300px">
91
91
  <c8y-asset-selector-miller
92
92
  [(ngModel)]="model"
93
93
  (onSelected)="selectionChanged($event)"
@@ -97,7 +97,8 @@
97
97
  showFilter: true,
98
98
  showUnassignedDevices: true,
99
99
  showChildDevices: true,
100
- search: true
100
+ search: true,
101
+ showSelected: false
101
102
  }"
102
103
  class="bg-component"
103
104
  ></c8y-asset-selector-miller>
@@ -109,7 +110,7 @@
109
110
  <div class="card-header separator">
110
111
  <h4 class="card-title">Miller view multi select</h4>
111
112
  </div>
112
- <div class="card-block d-flex d-col p-t-0 p-b-0" style="height: 300px">
113
+ <div class="d-flex d-col" style="height: 300px">
113
114
  <c8y-asset-selector-miller
114
115
  [(ngModel)]="model"
115
116
  (onSelected)="selectionChanged($event)"
@@ -129,7 +130,7 @@
129
130
  <div class="card-header separator">
130
131
  <h4 class="card-title">Miller view different root {{ (rootNode$ | async)?.id }}</h4>
131
132
  </div>
132
- <div class="card-block d-flex d-col p-t-0 p-b-0" style="height: 300px">
133
+ <div class="d-flex d-col" style="height: 300px">
133
134
  <c8y-asset-selector-miller
134
135
  [(ngModel)]="model"
135
136
  (onSelected)="selectionChanged($event)"
@@ -150,7 +151,7 @@
150
151
  Miller view single column different root {{ (rootNode$ | async)?.id }}
151
152
  </h4>
152
153
  </div>
153
- <div class="card-block d-flex d-col p-t-0 p-b-0" style="height: 300px">
154
+ <div class="d-flex d-col" style="height: 300px">
154
155
  <c8y-asset-selector-miller
155
156
  [(ngModel)]="model"
156
157
  (onSelected)="selectionChanged($event)"
@@ -176,7 +177,7 @@
176
177
  <div class="card-header separator">
177
178
  <h4 class="card-title">Miller view single select single column with global search</h4>
178
179
  </div>
179
- <div class="card-block d-flex d-col p-t-0 p-b-0 bg-level-1" style="height: 300px">
180
+ <div class="d-flex d-col bg-level-1" style="height: 300px">
180
181
  <c8y-asset-selector-miller
181
182
  [(ngModel)]="model"
182
183
  (onSelected)="selectionChanged($event)"
@@ -196,7 +197,7 @@
196
197
  <div class="card-header separator">
197
198
  <h4 class="card-title">Miller view multi select single column</h4>
198
199
  </div>
199
- <div class="card-block d-flex d-col p-t-0 p-b-0" style="height: 300px">
200
+ <div class="d-flex d-col" style="height: 300px">
200
201
  <c8y-asset-selector-miller
201
202
  [(ngModel)]="model"
202
203
  (onSelected)="selectionChanged($event)"
@@ -233,17 +234,15 @@
233
234
  <div class="card-header separator">
234
235
  <h4 class="card-title">Tree view single select child devices</h4>
235
236
  </div>
236
- <div class="card-block">
237
- <c8y-asset-selector
238
- (onSelected)="selectionChanged($event)"
239
- [(ngModel)]="model"
240
- [config]="{
241
- groupsSelectable: true,
242
- showUnassignedDevices: true,
243
- showChildDevices: true
244
- }"
245
- ></c8y-asset-selector>
246
- </div>
237
+ <c8y-asset-selector
238
+ (onSelected)="selectionChanged($event)"
239
+ [(ngModel)]="model"
240
+ [config]="{
241
+ groupsSelectable: true,
242
+ showUnassignedDevices: true,
243
+ showChildDevices: true
244
+ }"
245
+ ></c8y-asset-selector>
247
246
  </div>
248
247
  </div>
249
248
  <div class="col-sm-6">
@@ -251,16 +250,14 @@
251
250
  <div class="card-header separator">
252
251
  <h4 class="card-title">Tree view multi select</h4>
253
252
  </div>
254
- <div class="card-block">
255
- <c8y-asset-selector
256
- (onSelected)="selectionChanged($event)"
257
- [(ngModel)]="model"
258
- [config]="{
259
- groupsSelectable: true,
260
- multi: true
261
- }"
262
- ></c8y-asset-selector>
263
- </div>
253
+ <c8y-asset-selector
254
+ (onSelected)="selectionChanged($event)"
255
+ [(ngModel)]="model"
256
+ [config]="{
257
+ groupsSelectable: true,
258
+ multi: true
259
+ }"
260
+ ></c8y-asset-selector>
264
261
  </div>
265
262
  </div>
266
263
  </div>
@@ -269,12 +266,10 @@
269
266
  <div class="card-header separator">
270
267
  <h4 class="card-title">Tree view only devices</h4>
271
268
  </div>
272
- <div class="card-block">
273
- <c8y-asset-selector
274
- [(ngModel)]="model"
275
- (onSelected)="selectionChanged($event)"
276
- ></c8y-asset-selector>
277
- </div>
269
+ <c8y-asset-selector
270
+ [(ngModel)]="model"
271
+ (onSelected)="selectionChanged($event)"
272
+ ></c8y-asset-selector>
278
273
  </div>
279
274
  </div>
280
275
 
@@ -283,35 +278,32 @@
283
278
  <div class="card-header separator">
284
279
  <h4 class="card-title">Tree view only groups</h4>
285
280
  </div>
286
- <div class="card-block">
287
- <c8y-asset-selector
288
- [(ngModel)]="model"
289
- (onSelected)="selectionChanged($event)"
290
- [config]="{
291
- groupsSelectable: true,
292
- groupsOnly: true
293
- }"
294
- ></c8y-asset-selector>
295
- </div>
281
+ <c8y-asset-selector
282
+ [(ngModel)]="model"
283
+ (onSelected)="selectionChanged($event)"
284
+ [config]="{
285
+ groupsSelectable: true,
286
+ groupsOnly: true
287
+ }"
288
+ ></c8y-asset-selector>
296
289
  </div>
297
290
  </div>
298
291
 
299
292
  <div class="col-sm-6">
300
293
  <div class="card">
301
294
  <div class="card-header separator">
302
- <h4 class="card-title">Tree view with global search</h4>
303
- </div>
304
- <div class="card-block">
305
- <c8y-asset-selector
306
- [(ngModel)]="model"
307
- (onSelected)="selectionChanged($event)"
308
- [config]="{
309
- groupsSelectable: true,
310
- multi: true,
311
- search: true
312
- }"
313
- ></c8y-asset-selector>
295
+ <h4 class="card-title">Tree view with global search and chips</h4>
314
296
  </div>
297
+ <c8y-asset-selector
298
+ [(ngModel)]="model"
299
+ (onSelected)="selectionChanged($event)"
300
+ [config]="{
301
+ groupsSelectable: true,
302
+ multi: true,
303
+ search: true,
304
+ showSelected: true
305
+ }"
306
+ ></c8y-asset-selector>
315
307
  </div>
316
308
  </div>
317
309
 
@@ -320,13 +312,11 @@
320
312
  <div class="card-header separator">
321
313
  <h4 class="card-title">Tree view different root {{ (rootNode$ | async)?.id }}</h4>
322
314
  </div>
323
- <div class="card-block">
324
- <c8y-asset-selector
325
- [(ngModel)]="model"
326
- (onSelected)="selectionChanged($event)"
327
- [asset]="rootNode$ | async"
328
- ></c8y-asset-selector>
329
- </div>
315
+ <c8y-asset-selector
316
+ [(ngModel)]="model"
317
+ (onSelected)="selectionChanged($event)"
318
+ [asset]="rootNode$ | async"
319
+ ></c8y-asset-selector>
330
320
  </div>
331
321
  </div>
332
322
  </div>
@@ -13,7 +13,7 @@ import { IIdentified } from '@c8y/client';
13
13
  <div class="card-header separator">
14
14
  <h4 class="card-title">Miller view multi select</h4>
15
15
  </div>
16
- <div class="card-block d-flex d-col p-t-0 p-b-0" style="height: 300px">
16
+ <div class="d-flex d-col" style="height: 300px">
17
17
  <c8y-asset-selector-miller
18
18
  [(ngModel)]="model"
19
19
  (onSelected)="selectionChanged($event)"
@@ -13,7 +13,7 @@ import { IIdentified } from '@c8y/client';
13
13
  <div class="card-header separator">
14
14
  <h4 class="card-title">Miller view single select single column with global search</h4>
15
15
  </div>
16
- <div class="card-block d-flex d-col p-t-0 p-b-0 bg-level-1" style="height: 300px">
16
+ <div class="d-flex d-col p-t-0 p-b-0 bg-level-1" style="height: 300px">
17
17
  <c8y-asset-selector-miller
18
18
  [(ngModel)]="model"
19
19
  (onSelected)="selectionChanged($event)"
@@ -33,7 +33,7 @@ import { IIdentified } from '@c8y/client';
33
33
  <div class="card-header separator">
34
34
  <h4 class="card-title">Miller view multi select single column</h4>
35
35
  </div>
36
- <div class="card-block d-flex d-col p-t-0 p-b-0" style="height: 300px">
36
+ <div class="d-flex d-col p-t-0 p-b-0" style="height: 300px">
37
37
  <c8y-asset-selector-miller
38
38
  [(ngModel)]="model"
39
39
  (onSelected)="selectionChanged($event)"
@@ -13,12 +13,10 @@ import { IIdentified } from '@c8y/client';
13
13
  <div class="card-header separator">
14
14
  <h4 class="card-title">Tree view only devices</h4>
15
15
  </div>
16
- <div class="card-block">
17
- <c8y-asset-selector
18
- [(ngModel)]="model"
19
- (onSelected)="selectionChanged($event)"
20
- ></c8y-asset-selector>
21
- </div>
16
+ <c8y-asset-selector
17
+ [(ngModel)]="model"
18
+ (onSelected)="selectionChanged($event)"
19
+ ></c8y-asset-selector>
22
20
  </div>
23
21
  </div>
24
22
 
@@ -27,16 +25,14 @@ import { IIdentified } from '@c8y/client';
27
25
  <div class="card-header separator">
28
26
  <h4 class="card-title">Tree view only groups</h4>
29
27
  </div>
30
- <div class="card-block">
31
- <c8y-asset-selector
32
- [(ngModel)]="model"
33
- (onSelected)="selectionChanged($event)"
34
- [config]="{
35
- groupsSelectable: true,
36
- groupsOnly: true
37
- }"
38
- ></c8y-asset-selector>
39
- </div>
28
+ <c8y-asset-selector
29
+ [(ngModel)]="model"
30
+ (onSelected)="selectionChanged($event)"
31
+ [config]="{
32
+ groupsSelectable: true,
33
+ groupsOnly: true
34
+ }"
35
+ ></c8y-asset-selector>
40
36
  </div>
41
37
  </div>
42
38
  </div>