@c8y/widget-plugin 1021.55.3 → 1021.56.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.
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@c8y/widget-plugin",
3
- "version": "1021.55.3",
3
+ "version": "1021.56.4",
4
4
  "description": "",
5
5
  "dependencies": {
6
- "@c8y/style": "1021.55.3",
7
- "@c8y/ngx-components": "1021.55.3",
8
- "@c8y/client": "1021.55.3",
9
- "@c8y/bootstrap": "1021.55.3",
6
+ "@c8y/style": "1021.56.4",
7
+ "@c8y/ngx-components": "1021.56.4",
8
+ "@c8y/client": "1021.56.4",
9
+ "@c8y/bootstrap": "1021.56.4",
10
10
  "@angular/cdk": "^18.2.14",
11
11
  "ngx-bootstrap": "18.0.0",
12
12
  "rxjs": "^7.8.1"
13
13
  },
14
14
  "devDependencies": {
15
- "@c8y/options": "1021.55.3",
16
- "@c8y/devkit": "1021.55.3"
15
+ "@c8y/options": "1021.56.4",
16
+ "@c8y/devkit": "1021.56.4"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "@angular/common": ">=18 <19"
@@ -1,6 +1,7 @@
1
1
  import { Component, Input } from '@angular/core';
2
2
  import { ControlContainer, NgForm } from '@angular/forms';
3
3
  import { DynamicComponent, OnBeforeSave, AlertService } from '@c8y/ngx-components';
4
+ import { WidgetPluginConfig } from './widget-plugin.model';
4
5
 
5
6
  @Component({
6
7
  selector: 'c8y-widget-plugin-config',
@@ -19,8 +20,8 @@ import { DynamicComponent, OnBeforeSave, AlertService } from '@c8y/ngx-component
19
20
  `,
20
21
  viewProviders: [{ provide: ControlContainer, useExisting: NgForm }]
21
22
  })
22
- export class WidgetPluginConfig implements DynamicComponent, OnBeforeSave {
23
- @Input() config: any = {};
23
+ export class WidgetPluginConfigComponent implements DynamicComponent, OnBeforeSave {
24
+ @Input() config: WidgetPluginConfig = {};
24
25
 
25
26
  constructor(private alert: AlertService) {}
26
27
 
@@ -1,4 +1,5 @@
1
1
  import { Component, Input } from '@angular/core';
2
+ import { WidgetPluginConfig } from './widget-plugin.model';
2
3
 
3
4
  @Component({
4
5
  selector: 'c8y-widget-plugin',
@@ -12,5 +13,5 @@ import { Component, Input } from '@angular/core';
12
13
  styleUrls: ['./widget-plugin.component.css']
13
14
  })
14
15
  export class WidgetPluginComponent {
15
- @Input() config;
16
+ @Input() config: WidgetPluginConfig;
16
17
  }
@@ -0,0 +1,6 @@
1
+ import { IIdentified, IManagedObject } from '@c8y/client';
2
+
3
+ export interface WidgetPluginConfig {
4
+ text?: string;
5
+ device?: IIdentified & Partial<IManagedObject>;
6
+ }
@@ -3,11 +3,11 @@ import { assetPaths } from '../../assets/assets';
3
3
  import { NgModule } from '@angular/core';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import { WidgetPluginComponent } from './widget-plugin.component';
6
- import { WidgetPluginConfig } from './widget-plugin-config.component';
6
+ import { WidgetPluginConfigComponent } from './widget-plugin-config.component';
7
7
  import { FormsModule, gettext, hookWidget } from '@c8y/ngx-components';
8
8
 
9
9
  @NgModule({
10
- declarations: [WidgetPluginComponent, WidgetPluginConfig],
10
+ declarations: [WidgetPluginComponent, WidgetPluginConfigComponent],
11
11
  imports: [CommonModule, FormsModule],
12
12
  providers: [
13
13
  hookWidget({
@@ -16,7 +16,11 @@ import { FormsModule, gettext, hookWidget } from '@c8y/ngx-components';
16
16
  description: gettext('Widget added via Module Federation'),
17
17
  component: WidgetPluginComponent,
18
18
  previewImage: assetPaths.previewImage,
19
- configComponent: WidgetPluginConfig
19
+ configComponent: WidgetPluginConfigComponent,
20
+ data: {
21
+ schema: () =>
22
+ import('c8y-schema-loader?interfaceName=WidgetPluginConfig!./widget-plugin.model')
23
+ }
20
24
  })
21
25
  ]
22
26
  })