@c8y/tutorial 1021.81.0 → 1022.3.2

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 (77) hide show
  1. package/cumulocity.config.ts +16 -1
  2. package/package.json +13 -12
  3. package/src/__mocks/index.ts +168 -1
  4. package/src/app/app.config.ts +59 -0
  5. package/src/bootstrap.ts +13 -9
  6. package/src/bottom-drawer/bottom-drawer-content-example.component.html +28 -0
  7. package/src/bottom-drawer/bottom-drawer-content-example.component.ts +33 -0
  8. package/src/bottom-drawer/bottom-drawer-example.component.html +7 -0
  9. package/src/bottom-drawer/bottom-drawer-example.component.ts +33 -0
  10. package/src/bottom-drawer/bottom-drawer.providers.ts +17 -0
  11. package/src/breadcrumbs/index.ts +13 -1
  12. package/src/client-interceptor/index.ts +16 -1
  13. package/src/component-styles/syntactically-awesome-style-sheets-example/syntactically-awesome-style-sheets-example.component.scss +4 -2
  14. package/src/countdown/countdown-example.module.ts +1 -1
  15. package/src/dashboard/widget-guide-context-dashboard/widget-guide-context-dashboard.component.ts +1 -9
  16. package/src/date-time-range/date-time-range-example.component.ts +0 -1
  17. package/src/dynamic-forms/index.ts +13 -1
  18. package/src/grids/index.ts +13 -1
  19. package/src/grids/server-grid-example/last-updated-data-grid-column/last-updated.cell-renderer.component.ts +2 -1
  20. package/src/hello/index.ts +18 -1
  21. package/src/hooks/action/logout-action/logout-action.component.ts +3 -4
  22. package/src/hooks/generic-wizard/minimal-setup/minimal-setup.component.ts +4 -1
  23. package/src/hooks/generic-wizard/minimal-setup/multiple-entries-one.component.ts +9 -2
  24. package/src/hooks/generic-wizard/minimal-setup/multiple-entries-two.component.ts +9 -2
  25. package/src/hooks/generic-wizard/wizard.module.ts +9 -2
  26. package/src/hooks/index.ts +13 -1
  27. package/src/hooks/navigator/index.ts +12 -1
  28. package/src/hooks/route/index.ts +42 -1
  29. package/src/hooks/stepper/basic-view/basic-view.component.ts +11 -2
  30. package/src/hooks/stepper/stepper-hook.module.ts +7 -2
  31. package/src/hooks/stepper/steps/step1.component.ts +26 -3
  32. package/src/hooks/stepper/steps/step2.component.ts +4 -1
  33. package/src/hooks/widget-config/additional-config/additional-config.component.ts +16 -0
  34. package/src/hooks/widget-config/basic-view/basic-edit.component.html +18 -0
  35. package/src/hooks/widget-config/basic-view/basic-edit.component.ts +31 -0
  36. package/src/hooks/widget-config/widget-config.providers.ts +59 -0
  37. package/src/i18n.ts +3 -0
  38. package/src/lazy/index.ts +38 -1
  39. package/src/lazy-widget/index.ts +26 -1
  40. package/src/list/index.ts +13 -1
  41. package/src/main.ts +7 -10
  42. package/src/maps/{map-examples.module.ts → index.ts} +4 -9
  43. package/src/provider-configuration/index.ts +0 -2
  44. package/src/provider-configuration/introduction-example/{introduction.module.ts → index.ts} +5 -7
  45. package/src/redirect-to-last-route/index.ts +16 -1
  46. package/src/redirect-to-last-route/redirect-to-last-route-guard.service.ts +11 -2
  47. package/src/selector/alarm-event-selector-example/alarm-event-selector.module.ts +1 -1
  48. package/src/selector/asset-selector-example/general-example/asset-selector-example.component.ts +1 -2
  49. package/src/translations/index.ts +13 -1
  50. package/src/user-menu/index.ts +23 -1
  51. package/src/widget/demo-widget-config.component.ts +11 -3
  52. package/src/widget/demo-widget.component.ts +6 -2
  53. package/src/widget/index.ts +41 -1
  54. package/src/widget-resolvers/alternative-event.resolver.ts +8 -2
  55. package/src/widget-resolvers/index.ts +47 -1
  56. package/src/widget-resolvers/widget-resolvers-config/widget-resolvers-config.component.ts +7 -3
  57. package/src/widget-resolvers/widget-resolvers.component.ts +5 -1
  58. package/src/__mocks/mock.module.ts +0 -173
  59. package/src/app/app.module.ts +0 -76
  60. package/src/breadcrumbs/breadcrumbs.module.ts +0 -14
  61. package/src/client-interceptor/client-interceptor.module.ts +0 -12
  62. package/src/dynamic-forms/dynamic-forms.module.ts +0 -16
  63. package/src/grids/grids.module.ts +0 -17
  64. package/src/hello/hello.module.ts +0 -20
  65. package/src/hooks/hooks.module.ts +0 -19
  66. package/src/hooks/navigator/navigator.module.ts +0 -21
  67. package/src/hooks/route/route.module.ts +0 -51
  68. package/src/lazy/lazy-routing.module.ts +0 -21
  69. package/src/lazy/lazy.hooks.ts +0 -24
  70. package/src/lazy-widget/lazy-widget.module.ts +0 -30
  71. package/src/list/lists.module.ts +0 -17
  72. package/src/redirect-to-last-route/redirect-to-last-route.module.ts +0 -20
  73. package/src/translations/translations.module.ts +0 -18
  74. package/src/user-menu/user-menu.module.ts +0 -13
  75. package/src/user-menu/user-menu.ts +0 -26
  76. package/src/widget/demo-widget.module.ts +0 -55
  77. package/src/widget-resolvers/widget-resolvers.module.ts +0 -52
@@ -1,24 +0,0 @@
1
- import { NavigatorNode, hookNavigator } from '@c8y/ngx-components';
2
-
3
- const root = new NavigatorNode({
4
- label: 'Lazy loaded',
5
- icon: 'hourglass-start'
6
- });
7
-
8
- root.add(
9
- new NavigatorNode({
10
- path: '/lazy/one',
11
- label: 'One',
12
- icon: 'thermometer'
13
- })
14
- );
15
-
16
- root.add(
17
- new NavigatorNode({
18
- path: '/lazy/two',
19
- label: 'Two',
20
- icon: 'thermometer-3'
21
- })
22
- );
23
-
24
- export const hooks = [hookNavigator(root)];
@@ -1,30 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { CommonModule } from '@angular/common';
3
- import { hookWidget } from '@c8y/ngx-components';
4
-
5
- async function loadViewComponent() {
6
- const { LazyWidgetViewComponent } = await import('./lazy-widget-view');
7
- return LazyWidgetViewComponent;
8
- }
9
-
10
- async function loadConfigComponent() {
11
- const { LazyWidgetConfigComponent } = await import('./lazy-widget-config');
12
- return LazyWidgetConfigComponent;
13
- }
14
-
15
- @NgModule({
16
- imports: [CommonModule],
17
- providers: [
18
- hookWidget({
19
- id: 'tutorial-lazy-widget',
20
- label: 'Lazy Loaded Widget',
21
- description: 'Lazy Loaded Widget',
22
- loadComponent: loadViewComponent,
23
- loadConfigComponent: loadConfigComponent,
24
- data: {
25
- schema: () => import('c8y-schema-loader?interfaceName=WidgetConfig!./widget-config.model')
26
- }
27
- })
28
- ]
29
- })
30
- export class LazyWidgetModule {}
@@ -1,17 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { hookNavigator, NavigatorNode } from '@c8y/ngx-components';
3
-
4
- @NgModule({
5
- declarations: [],
6
- imports: [],
7
- providers: [
8
- hookNavigator(
9
- new NavigatorNode({
10
- label: 'Lists',
11
- icon: 'c8y-device',
12
- priority: 97
13
- })
14
- )
15
- ]
16
- })
17
- export class ListsModule {}
@@ -1,20 +0,0 @@
1
- import { NgModule, inject } from '@angular/core';
2
- import { CanActivateFn, RouterModule } from '@angular/router';
3
- import { RedirectToLastRouteGuardService } from './redirect-to-last-route-guard.service';
4
- import { EmptyComponent } from '@c8y/ngx-components';
5
-
6
- @NgModule({
7
- imports: [
8
- RouterModule.forChild([
9
- {
10
- path: 'pickLastRoute',
11
- canActivate: [
12
- ((...args) =>
13
- inject(RedirectToLastRouteGuardService).canActivate(...args)) as CanActivateFn
14
- ],
15
- component: EmptyComponent
16
- }
17
- ])
18
- ]
19
- })
20
- export class RedirectToLastRouteModule {}
@@ -1,18 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { NavigatorNode, hookNavigator } from '@c8y/ngx-components';
3
-
4
- @NgModule({
5
- declarations: [],
6
- imports: [],
7
- exports: [],
8
- providers: [
9
- hookNavigator(
10
- new NavigatorNode({
11
- priority: 20,
12
- icon: 'rocket',
13
- label: 'Translations'
14
- })
15
- )
16
- ]
17
- })
18
- export class TranslationsModule {}
@@ -1,13 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { CoreModule } from '@c8y/ngx-components';
3
- import { ExampleUserMenu } from './user-menu';
4
-
5
- @NgModule({
6
- declarations: [],
7
- imports: [CoreModule],
8
- providers: [ExampleUserMenu]
9
- })
10
- export class UserMenuModule {
11
- // use dependency injection as otherwise ExampleUserMenu will never be instantiated
12
- constructor(private userMenu: ExampleUserMenu) {}
13
- }
@@ -1,26 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
- import { AlertService, gettext, UserMenuService } from '@c8y/ngx-components';
3
-
4
- @Injectable()
5
- export class ExampleUserMenu {
6
- // Inject the c8y UserMenuService
7
- constructor(
8
- private userMenu: UserMenuService,
9
- private alert: AlertService
10
- ) {
11
- // add an item to the user menu
12
- this.userMenu.add({
13
- icon: 'notification',
14
- label: gettext('Notifications'),
15
- priority: 0,
16
- click: () => {
17
- this.onClick();
18
- }
19
- });
20
- }
21
-
22
- // method to be called when button in user menu is clicked
23
- private onClick() {
24
- this.alert.info(gettext('Notification button clicked.'));
25
- }
26
- }
@@ -1,55 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import {
3
- CommonModule as C8yCommonModule,
4
- DynamicComponentErrorStrategy,
5
- DynamicWidgetDefinition,
6
- FormsModule,
7
- hookWidget,
8
- WidgetDataType
9
- } from '@c8y/ngx-components';
10
- import { AssetSelectorModule } from '@c8y/ngx-components/assets-navigator';
11
- import { WidgetConfigDemo } from './demo-widget-config.component';
12
- import { WidgetDemo } from './demo-widget.component';
13
-
14
- /**
15
- * This demo widget provides an example on how
16
- * to use the hookComponent. The component itself
17
- * is implemented in the dashboard on the
18
- * ../hello/hello.component.html by using the
19
- * dynamic-component tag.
20
- */
21
- @NgModule({
22
- declarations: [WidgetDemo, WidgetConfigDemo],
23
- imports: [FormsModule, AssetSelectorModule, C8yCommonModule],
24
- exports: [],
25
- providers: [
26
- hookWidget({
27
- id: 'angular.widget.demo',
28
- label: 'My angular widget',
29
- description: 'This is a description from angular',
30
- component: WidgetDemo,
31
- configComponent: WidgetConfigDemo,
32
- errorStrategy: DynamicComponentErrorStrategy.OVERLAY_ERROR,
33
-
34
- /** new Angular-Dashboard definition */
35
- data: {
36
- schema: () => import('c8y-schema-loader?interfaceName=WidgetConfig!./widget-config.model'),
37
- // The settings object can be used to configure the configComponent
38
- settings: {
39
- noNewWidgets: false, // Set this to true, to don't allow adding new widgets.
40
- ng1: {
41
- options: {
42
- noDeviceTarget: false, // Set this to true to hide the AngularJS device selector.
43
- groupsSelectable: false // Set this, if not only devices should be selectable.
44
- }
45
- }
46
- },
47
- // Settings that are attached to the display component (in this case: WidgetDemo)
48
- displaySettings: {
49
- globalTimeContext: true // Set this to true, to add a global time context binding
50
- }
51
- } as WidgetDataType
52
- } as DynamicWidgetDefinition)
53
- ]
54
- })
55
- export class DashboardWidgetDemoModule {}
@@ -1,52 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { WidgetResolversComponent } from './widget-resolvers.component';
3
- import {
4
- CommonModule,
5
- DynamicComponentDefinition,
6
- DynamicComponentErrorStrategy,
7
- DynamicManagedObjectResolver,
8
- FormsModule,
9
- hookComponent
10
- } from '@c8y/ngx-components';
11
- import { WidgetResolversConfigComponent } from './widget-resolvers-config/widget-resolvers-config.component';
12
- import { DynamicEventResolver } from './event.resolver';
13
- import { SimpleDynamicEventResolver } from './alternative-event.resolver';
14
- import { PropertiesLibraryResolver } from './event-property.resolver';
15
- import { ContextWidgetConfig } from '@c8y/ngx-components/context-dashboard';
16
-
17
- @NgModule({
18
- imports: [CommonModule, FormsModule],
19
- declarations: [WidgetResolversComponent, WidgetResolversConfigComponent],
20
- providers: [
21
- hookComponent({
22
- component: WidgetResolversComponent,
23
- configComponent: WidgetResolversConfigComponent,
24
- id: 'widget-resolvers',
25
- label: 'Demo Resolver Widget',
26
- description: 'Widget demonstrating resolvers.',
27
- resolve: {
28
- source: DynamicManagedObjectResolver,
29
- event: DynamicEventResolver || SimpleDynamicEventResolver,
30
- property: PropertiesLibraryResolver
31
- },
32
- errorStrategy: DynamicComponentErrorStrategy.OVERLAY_ERROR,
33
- data: {
34
- schema: () => import('c8y-schema-loader?interfaceName=WidgetConfig!./widget-config.model'),
35
- settings: {
36
- noNewWidgets: false,
37
- widgetDefaults: {
38
- _width: 2,
39
- _height: 2
40
- },
41
- ng1: {
42
- options: {
43
- noDeviceTarget: true,
44
- groupsSelectable: false
45
- }
46
- }
47
- }
48
- } as ContextWidgetConfig
49
- } satisfies DynamicComponentDefinition)
50
- ]
51
- })
52
- export class WidgetResolversModule {}