@c8y/tutorial 1022.44.3 → 1022.44.7

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,21 +1,21 @@
1
1
  {
2
2
  "name": "@c8y/tutorial",
3
- "version": "1022.44.3",
3
+ "version": "1022.44.7",
4
4
  "description": "This package is used to scaffold a tutorial for Cumulocity IoT Web SDK which explains a lot of concepts.",
5
5
  "dependencies": {
6
- "@c8y/style": "1022.44.3",
7
- "@c8y/ngx-components": "1022.44.3",
8
- "@c8y/client": "1022.44.3",
9
- "@c8y/bootstrap": "1022.44.3",
6
+ "@c8y/style": "1022.44.7",
7
+ "@c8y/ngx-components": "1022.44.7",
8
+ "@c8y/client": "1022.44.7",
9
+ "@c8y/bootstrap": "1022.44.7",
10
10
  "@angular/cdk": "^19.2.19",
11
- "monaco-editor": "~0.52.2",
11
+ "monaco-editor": "~0.53.0",
12
12
  "ngx-bootstrap": "19.0.2",
13
13
  "leaflet": "1.9.4",
14
14
  "rxjs": "7.8.1"
15
15
  },
16
16
  "devDependencies": {
17
- "@c8y/options": "1022.44.3",
18
- "@c8y/devkit": "1022.44.3"
17
+ "@c8y/options": "1022.44.7",
18
+ "@c8y/devkit": "1022.44.7"
19
19
  },
20
20
  "peerDependencies": {
21
21
  "@angular/common": ">=19 <20"
@@ -1,5 +1,5 @@
1
1
  <div class="card-header separator">
2
- <span class="h4 card-title">Bottom drawer title</span>
2
+ <span class="h4 card-title" id="drawerTitle">Bottom drawer title</span>
3
3
  </div>
4
4
  <div class="inner-scroll flex-grow">
5
5
  <div class="card-block">
@@ -1,5 +1,7 @@
1
- import { Component, inject } from '@angular/core';
1
+ import { Component, inject, OnInit, OnDestroy } from '@angular/core';
2
2
  import { BottomDrawerRef } from '@c8y/ngx-components';
3
+ import { Subject } from 'rxjs';
4
+ import { takeUntil } from 'rxjs/operators';
3
5
 
4
6
  @Component({
5
7
  selector: 'tut-bottom-drawer-content-example',
@@ -9,9 +11,10 @@ import { BottomDrawerRef } from '@c8y/ngx-components';
9
11
  class: 'd-contents'
10
12
  }
11
13
  })
12
- export class BottomDrawerContentExampleComponent {
14
+ export class BottomDrawerContentExampleComponent implements OnInit, OnDestroy {
13
15
  bottomDrawerRef = inject(BottomDrawerRef);
14
16
  isDisabled = false;
17
+ destroy$: Subject<boolean> = new Subject<boolean>();
15
18
 
16
19
  result: Promise<string> = new Promise((resolve, reject) => {
17
20
  this._save = resolve;
@@ -21,6 +24,17 @@ export class BottomDrawerContentExampleComponent {
21
24
  private _save: (value: string) => void;
22
25
  private _cancel: (reason?: any) => void;
23
26
 
27
+ ngOnInit() {
28
+ this.bottomDrawerRef.onClosed$.pipe(takeUntil(this.destroy$)).subscribe(() => {
29
+ this._cancel('Drawer closed');
30
+ });
31
+ }
32
+
33
+ ngOnDestroy() {
34
+ this.destroy$.next(true);
35
+ this.destroy$.unsubscribe();
36
+ }
37
+
24
38
  cancel() {
25
39
  this._cancel('User canceled');
26
40
  this.bottomDrawerRef.close();
@@ -19,7 +19,8 @@ export class BottomDrawerExampleComponent {
19
19
  initialState: {
20
20
  // place here any content you want to pass to the component
21
21
  isDisabled: true
22
- }
22
+ },
23
+ disableClickOutside: true
23
24
  });
24
25
 
25
26
  try {