@c8y/tutorial 1022.28.2 → 1022.33.0

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.
@@ -45,6 +45,13 @@ export default {
45
45
  }
46
46
  },
47
47
  exports: [
48
+ {
49
+ name: 'Resizable grid example',
50
+ module: 'ResizableGridExampleModule',
51
+ path: './src/resizable-grid-example/resizable-grid-example.module.ts',
52
+ description: 'An example for a grid with two resizable columns.',
53
+ scope: 'self'
54
+ },
48
55
  {
49
56
  name: 'Introduction to asset selector',
50
57
  module: 'AssetSelectorExampleModule',
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "@c8y/tutorial",
3
- "version": "1022.28.2",
3
+ "version": "1022.33.0",
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.28.2",
7
- "@c8y/ngx-components": "1022.28.2",
8
- "@c8y/client": "1022.28.2",
9
- "@c8y/bootstrap": "1022.28.2",
10
- "@angular/cdk": "^19.2.18",
6
+ "@c8y/style": "1022.33.0",
7
+ "@c8y/ngx-components": "1022.33.0",
8
+ "@c8y/client": "1022.33.0",
9
+ "@c8y/bootstrap": "1022.33.0",
10
+ "@angular/cdk": "^19.2.19",
11
11
  "monaco-editor": "~0.52.2",
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.28.2",
18
- "@c8y/devkit": "1022.28.2"
17
+ "@c8y/options": "1022.33.0",
18
+ "@c8y/devkit": "1022.33.0"
19
19
  },
20
20
  "peerDependencies": {
21
21
  "@angular/common": ">=19 <20"
@@ -0,0 +1,36 @@
1
+ import { Component } from '@angular/core';
2
+ import { ResizableGridComponent, CoreModule } from '@c8y/ngx-components';
3
+
4
+ @Component({
5
+ selector: 'tutorial-resizable-grid-example',
6
+ template: `<c8y-title>Resizable Grid</c8y-title>
7
+ <div class="p-t-24">
8
+ <div class="card">
9
+ <c8y-resizable-grid style="height: 350px;">
10
+ <div left-pane>
11
+ <div class="card-header">
12
+ <h4>Left Column</h4>
13
+ </div>
14
+ <div class="card-block">
15
+ <p>This is the left column content. You can resize it by dragging the divider.</p>
16
+ </div>
17
+ </div>
18
+ <div right-pane>
19
+ <div class="card-header">
20
+ <h4>Right Column</h4>
21
+ </div>
22
+ <div class="card-block">
23
+ <p>
24
+ This is the right column content. It will expand or shrink as you resize the left
25
+ column.
26
+ </p>
27
+ </div>
28
+ </div>
29
+ </c8y-resizable-grid>
30
+ </div>
31
+ </div>`,
32
+ standalone: true,
33
+ imports: [ResizableGridComponent, CoreModule]
34
+ })
35
+ export class ResizableGridExampleComponent {}
36
+ // This component demonstrates the usage of the ResizableGridComponent
@@ -0,0 +1,23 @@
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: 'resizable-grid-example',
10
+ loadComponent: () =>
11
+ import('./resizable-grid-example.component').then(m => m.ResizableGridExampleComponent)
12
+ }),
13
+ hookNavigator(
14
+ new NavigatorNode({
15
+ path: '/resizable-grid-example',
16
+ label: 'Resizable grid',
17
+ icon: 'columns',
18
+ priority: 86
19
+ })
20
+ )
21
+ ]
22
+ })
23
+ export class ResizableGridExampleModule {}
@@ -2,7 +2,10 @@ import { Component, inject } from '@angular/core';
2
2
  import { FormsModule } from '@angular/forms';
3
3
  import { IIdentified, IManagedObject, InventoryService } from '@c8y/client';
4
4
  import { BottomDrawerService, TitleComponent } from '@c8y/ngx-components';
5
- import { AssetPropertySelectorDrawerComponent } from '@c8y/ngx-components/asset-properties';
5
+ import {
6
+ AssetPropertySelectorDrawerComponent,
7
+ AssetPropertyType
8
+ } from '@c8y/ngx-components/asset-properties';
6
9
  import {
7
10
  AssetSelectionChangeEvent,
8
11
  AssetSelectorModule
@@ -53,7 +56,7 @@ export class PropertiesSelectorDrawerExampleComponent {
53
56
  inventoryService = inject(InventoryService);
54
57
  model: IIdentified;
55
58
  selectedAsset: IManagedObject;
56
- output: unknown;
59
+ output: AssetPropertyType[] = [];
57
60
  bottomDrawerService = inject(BottomDrawerService);
58
61
 
59
62
  selectionChanged(e: AssetSelectionChangeEvent) {
@@ -70,7 +73,8 @@ export class PropertiesSelectorDrawerExampleComponent {
70
73
  expansionMode: 'collapsedByDefault',
71
74
  showValue: true,
72
75
  showKey: true,
73
- emptyStateContent: 'default-properties'
76
+ emptyStateContent: 'default-properties',
77
+ selectedProperties: this.output
74
78
  }
75
79
  }
76
80
  });
@@ -79,7 +83,7 @@ export class PropertiesSelectorDrawerExampleComponent {
79
83
  const resultOf = await drawer.instance.result;
80
84
  this.output = resultOf;
81
85
  } catch (ex) {
82
- this.output = 'Cancelled';
86
+ this.output = [];
83
87
  }
84
88
  }
85
89
  }
@@ -1,7 +1,7 @@
1
1
  import { Component, inject } from '@angular/core';
2
2
  import { FormsModule } from '@angular/forms';
3
3
  import { IIdentified, IManagedObject, InventoryService } from '@c8y/client';
4
- import { BottomDrawerService, C8yTranslatePipe, TitleComponent } from '@c8y/ngx-components';
4
+ import { C8yTranslatePipe, TitleComponent } from '@c8y/ngx-components';
5
5
  import {
6
6
  AssetPropertyActionDirective,
7
7
  AssetPropertyListComponent,
@@ -97,7 +97,7 @@ import { JsonPipe } from '@angular/common';
97
97
  </div>
98
98
  </fieldset>
99
99
  <label class="c8y-switch">
100
- <input type="checkbox" [(ngModel)]="searchable" />
100
+ <input type="checkbox" [(ngModel)]="filterable" />
101
101
  <span></span>
102
102
  <small>searchable</small>
103
103
  </label>
@@ -116,21 +116,27 @@ import { JsonPipe } from '@angular/common';
116
116
  <span></span>
117
117
  <small>showKey</small>
118
118
  </label>
119
+ <label class="c8y-switch m-0">
120
+ <input type="checkbox" [(ngModel)]="allowAddingCustomProperties" />
121
+ <span></span>
122
+ <small>allowAddingCustomProperties</small>
123
+ </label>
119
124
  </div>
120
125
  </div>
121
126
  <div class="col-xs-12 col-md-5">
122
127
  <div class="card">
123
- <div class="card-inner-scroll d-flex d-col bg-component" style="height: 559px">
128
+ <div class="card-inner-scroll d-flex d-col bg-component" style="height: 591px">
124
129
  <c8y-asset-property-list
125
130
  class="bg-component"
126
131
  [asset]="selectedAsset"
127
132
  [config]="{
128
133
  selectMode: multiSelect,
129
134
  showHeader: showHeader,
130
- searchable: searchable,
135
+ filterable: filterable,
131
136
  showValue: showValue,
132
137
  expansionMode: expansionMode,
133
- showKey: showKey
138
+ showKey: showKey,
139
+ allowAddingCustomProperties: allowAddingCustomProperties
134
140
  }"
135
141
  (selectedProperties)="onSelectedProperties($event)"
136
142
  >
@@ -150,7 +156,7 @@ import { JsonPipe } from '@angular/common';
150
156
  </div>
151
157
  </div>
152
158
  <div class="col-xs-12 col-md-4">
153
- <pre class="inner-scroll" style="height: 559px">{{ assetPropertiesOutput | json }}</pre>
159
+ <pre class="inner-scroll" style="height: 591px">{{ assetPropertiesOutput | json }}</pre>
154
160
  </div>
155
161
  </div>`,
156
162
  standalone: true,
@@ -171,7 +177,6 @@ export class PropertiesSelectorInlineExampleComponent {
171
177
  model: IIdentified;
172
178
  selectedAsset: IManagedObject;
173
179
  assetPropertiesOutput: AssetPropertyType[] | AssetPropertyType;
174
- bottomDrawerService = inject(BottomDrawerService);
175
180
 
176
181
  multiSelect: 'single' | 'multi' | 'none' = 'multi';
177
182
  expansionMode: 'expandedByDefault' | 'collapsedByDefault' | 'nonCollapsible' =
@@ -179,7 +184,8 @@ export class PropertiesSelectorInlineExampleComponent {
179
184
  showHeader = true;
180
185
  showValue = true;
181
186
  showKey = true;
182
- searchable = true;
187
+ filterable = true;
188
+ allowAddingCustomProperties = true;
183
189
 
184
190
  selectionChanged(e: AssetSelectionChangeEvent) {
185
191
  this.selectedAsset = e.change.item;