@smartbit4all/ng-client 1.0.29 → 1.1.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.
Files changed (27) hide show
  1. package/esm2020/lib/smart-client/smart-component-api-client.mjs +131 -7
  2. package/esm2020/lib/view-context/api/api/view.service.mjs +55 -1
  3. package/esm2020/lib/view-context/api/model/componentModel.mjs +1 -1
  4. package/esm2020/lib/view-context/api/model/componentModelChange.mjs +1 -1
  5. package/esm2020/lib/view-context/api/model/dataChange.mjs +2 -0
  6. package/esm2020/lib/view-context/api/model/dataChangeEvent.mjs +2 -0
  7. package/esm2020/lib/view-context/api/model/dataChangeKind.mjs +17 -0
  8. package/esm2020/lib/view-context/api/model/models.mjs +5 -1
  9. package/esm2020/lib/view-context/api/model/view.mjs +1 -1
  10. package/esm2020/lib/view-context/api/model/viewEventHandler.mjs +20 -0
  11. package/fesm2015/smartbit4all-ng-client.mjs +222 -6
  12. package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
  13. package/fesm2020/smartbit4all-ng-client.mjs +221 -6
  14. package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
  15. package/lib/smart-client/smart-component-api-client.d.ts +24 -3
  16. package/lib/view-context/api/api/view.service.d.ts +20 -0
  17. package/lib/view-context/api/model/componentModel.d.ts +0 -6
  18. package/lib/view-context/api/model/componentModelChange.d.ts +10 -0
  19. package/lib/view-context/api/model/dataChange.d.ts +27 -0
  20. package/lib/view-context/api/model/dataChangeEvent.d.ts +33 -0
  21. package/lib/view-context/api/model/dataChangeKind.d.ts +20 -0
  22. package/lib/view-context/api/model/models.d.ts +4 -0
  23. package/lib/view-context/api/model/view.d.ts +22 -1
  24. package/lib/view-context/api/model/viewEventHandler.d.ts +30 -0
  25. package/package.json +1 -1
  26. package/smartbit4all-ng-client-1.1.0.tgz +0 -0
  27. package/smartbit4all-ng-client-1.0.29.tgz +0 -0
@@ -1,9 +1,10 @@
1
1
  import { Injector } from '@angular/core';
2
- import { GridOptions, SmartGrid } from '@smartbit4all/grid';
2
+ import { GridOptions, SmartGrid, SmartGridComponent } from '@smartbit4all/grid';
3
+ import { SmarttreeGenericService } from '@smartbit4all/tree';
3
4
  import { Subject } from 'rxjs';
4
5
  import { ComponentModel, SmartViewContextService, UiAction, UiActionAdditionalParams, UiActionDescriptorService, UiActionModel, UiActionRequest, UiActionService, UiActionSpecificDemandResponse, UseUiAction } from '../view-context/projects';
5
6
  import { SmartAuthenticationServiceInterface } from './smart-authentication.service';
6
- import { SmarttreeGenericService } from '@smartbit4all/tree';
7
+ import { SmartForm, SmartformComponent } from '@smartbit4all/form';
7
8
  export declare abstract class SmartComponentApiClient<T> implements UseUiAction {
8
9
  protected inject: Injector;
9
10
  protected auth: SmartAuthenticationServiceInterface;
@@ -30,6 +31,8 @@ export declare abstract class SmartComponentApiClient<T> implements UseUiAction
30
31
  private _smartTreeService?;
31
32
  get smartTreeService(): SmarttreeGenericService | undefined;
32
33
  set smartTreeService(smartTreeService: SmarttreeGenericService | undefined);
34
+ widgets: WidgetMap<SmartGridComponent | SmarttreeGenericService | undefined>;
35
+ formWidgets: WidgetMap<SmartformComponent | undefined>;
33
36
  constructor(inject: Injector, auth: SmartAuthenticationServiceInterface, pageName: string);
34
37
  _ngOnInit(): void;
35
38
  _ngOnDestroy(): void;
@@ -42,7 +45,25 @@ export declare abstract class SmartComponentApiClient<T> implements UseUiAction
42
45
  getModel(): T | undefined;
43
46
  performUiActionRequest(uiActionRequest: UiActionRequest, widgetId?: string, nodeId?: string): Promise<any>;
44
47
  handleSpecificDemandsAsynchronously(uiAction: UiAction, uiActionRequest: UiActionRequest): Promise<UiActionSpecificDemandResponse>;
45
- addGrid(smartGrid: SmartGrid, options: GridOptions, useAsDefaultGrid?: boolean): SmartGrid;
48
+ addGrid(smartGrid: SmartGrid, options: GridOptions, useAsDefaultGrid?: boolean, componentReference?: SmartGridComponent): SmartGrid;
49
+ addForm(smartFormId: string, smartForm: SmartForm, componentReference?: SmartformComponent): SmartForm;
46
50
  setUpDefaultTree(treeId: string): void;
47
51
  createTreeService(treeId: string): SmarttreeGenericService;
52
+ private handleChanges;
53
+ private handleChangeWidgets;
54
+ private setValueDeeply;
55
+ private handleDataChange;
56
+ private handleLayoutChange;
57
+ private handleValueSetChange;
58
+ private handleActionChange;
59
+ private handleConstraintChange;
60
+ }
61
+ export declare class WidgetMap<T> {
62
+ private _widgets;
63
+ get widgets(): Map<string, T>;
64
+ set widgets(widgets: Map<string, T>);
65
+ addWidget(key: string, reference: T, isForm?: boolean): void;
66
+ removeWidget(key: string): void;
67
+ clearWidgets(): void;
68
+ get(key: string): T | undefined;
48
69
  }
@@ -1,6 +1,7 @@
1
1
  import { HttpClient, HttpHeaders, HttpResponse, HttpEvent, HttpParameterCodec, HttpContext } from '@angular/common/http';
2
2
  import { Observable } from 'rxjs';
3
3
  import { ComponentModel } from '../model/componentModel';
4
+ import { DataChange } from '../model/dataChange';
4
5
  import { MessageResult } from '../model/messageResult';
5
6
  import { UiActionRequest } from '../model/uiActionRequest';
6
7
  import { ViewConstraint } from '../model/viewConstraint';
@@ -35,6 +36,25 @@ export declare class ViewService {
35
36
  httpHeaderAccept?: 'application/json';
36
37
  context?: HttpContext;
37
38
  }): Observable<HttpEvent<ViewContextData>>;
39
+ /**
40
+ * Notification of a data change event..
41
+ * @param uuid
42
+ * @param dataChange
43
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
44
+ * @param reportProgress flag to report request and response progress.
45
+ */
46
+ dataChanged(uuid: string, dataChange: DataChange, observe?: 'body', reportProgress?: boolean, options?: {
47
+ httpHeaderAccept?: 'application/json';
48
+ context?: HttpContext;
49
+ }): Observable<ViewContextChange>;
50
+ dataChanged(uuid: string, dataChange: DataChange, observe?: 'response', reportProgress?: boolean, options?: {
51
+ httpHeaderAccept?: 'application/json';
52
+ context?: HttpContext;
53
+ }): Observable<HttpResponse<ViewContextChange>>;
54
+ dataChanged(uuid: string, dataChange: DataChange, observe?: 'events', reportProgress?: boolean, options?: {
55
+ httpHeaderAccept?: 'application/json';
56
+ context?: HttpContext;
57
+ }): Observable<HttpEvent<ViewContextChange>>;
38
58
  /**
39
59
  * @param uuid
40
60
  * @param item
@@ -28,10 +28,4 @@ export interface ComponentModel {
28
28
  valueSets?: {
29
29
  [key: string]: ValueSet;
30
30
  };
31
- /**
32
- * Complex widgets with corresponding initial model.
33
- */
34
- widgetModels: {
35
- [key: string]: object;
36
- };
37
31
  }
@@ -16,4 +16,14 @@ export interface ComponentModelChange {
16
16
  uuid: string;
17
17
  path: string;
18
18
  value?: object;
19
+ /**
20
+ * Changed values, in a key-value map. Refers to different parts of ComponentModel, for example data changes are prefixed with \'data.\', layout changes with \'layouts.\', etc.
21
+ */
22
+ changes: {
23
+ [key: string]: any;
24
+ };
25
+ /**
26
+ * List of changed widgets (widgetIds).
27
+ */
28
+ changedWidgets?: Array<string>;
19
29
  }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * View API
3
+ * View API
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: info@it4all.hu
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import { DataChangeKind } from './dataChangeKind';
13
+ export interface DataChange {
14
+ kind?: DataChangeKind;
15
+ /**
16
+ * Source of the event, typically the key of the widget.
17
+ */
18
+ source?: string;
19
+ /**
20
+ * Changed values, in a key-value map.
21
+ */
22
+ values?: {
23
+ [key: string]: any;
24
+ };
25
+ }
26
+ export declare namespace DataChange {
27
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * View API
3
+ * View API
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: info@it4all.hu
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import { DataChangeKind } from './dataChangeKind';
13
+ export interface DataChangeEvent {
14
+ kind?: DataChangeKind;
15
+ /**
16
+ * Source of the event, typically the key of the widget.
17
+ */
18
+ source?: string;
19
+ /**
20
+ * Values before changed, in a key-value map.
21
+ */
22
+ oldValues?: {
23
+ [key: string]: any;
24
+ };
25
+ /**
26
+ * Values before changed, in a key-value map.
27
+ */
28
+ newValues?: {
29
+ [key: string]: any;
30
+ };
31
+ }
32
+ export declare namespace DataChangeEvent {
33
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * View API
3
+ * View API
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: info@it4all.hu
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ * Defines the kind of the source of this event..
14
+ */
15
+ export declare type DataChangeKind = 'WIDGET' | 'SELECTION' | 'LOOKUP';
16
+ export declare const DataChangeKind: {
17
+ Widget: DataChangeKind;
18
+ Selection: DataChangeKind;
19
+ Lookup: DataChangeKind;
20
+ };
@@ -2,6 +2,9 @@ export * from './closeResult';
2
2
  export * from './componentConstraint';
3
3
  export * from './componentModel';
4
4
  export * from './componentModelChange';
5
+ export * from './dataChange';
6
+ export * from './dataChangeEvent';
7
+ export * from './dataChangeKind';
5
8
  export * from './messageData';
6
9
  export * from './messageOption';
7
10
  export * from './messageOptionType';
@@ -27,6 +30,7 @@ export * from './viewContextChange';
27
30
  export * from './viewContextData';
28
31
  export * from './viewContextUpdate';
29
32
  export * from './viewData';
33
+ export * from './viewEventHandler';
30
34
  export * from './viewState';
31
35
  export * from './viewStateUpdate';
32
36
  export * from './viewType';
@@ -9,6 +9,8 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import { ViewEventHandler } from './viewEventHandler';
13
+ import { SmartLayoutDefinition } from '@smartbit4all/form';
12
14
  import { ViewState } from './viewState';
13
15
  import { UiAction } from './uiAction';
14
16
  import { ValueSet } from './valueSet';
@@ -22,9 +24,18 @@ export interface View {
22
24
  viewName: string;
23
25
  objectUri?: string;
24
26
  branchUri?: string;
27
+ /**
28
+ * The incoming parameters of the view. If we restart the given view with the same model then this parameters remain.
29
+ */
25
30
  parameters: {
26
31
  [key: string]: any;
27
32
  };
33
+ /**
34
+ * The variable to store while the page is opened. It will be cleared if we open it again.
35
+ */
36
+ variables: {
37
+ [key: string]: any;
38
+ };
28
39
  state: ViewState;
29
40
  type: ViewType;
30
41
  containerUuid?: string;
@@ -35,13 +46,23 @@ export interface View {
35
46
  [key: string]: string;
36
47
  };
37
48
  actions: Array<UiAction>;
49
+ eventHandlers: Array<ViewEventHandler>;
38
50
  widgetModels: {
39
51
  [key: string]: object;
40
52
  };
41
- valueSets?: {
53
+ valueSets: {
42
54
  [key: string]: ValueSet;
43
55
  };
44
56
  keepModelOnImplicitClose?: boolean;
57
+ callbacks: {
58
+ [key: string]: object;
59
+ };
60
+ /**
61
+ * The layouts defined in the view. This named layouts can be used by the UI to render
62
+ */
63
+ layouts: {
64
+ [key: string]: SmartLayoutDefinition;
65
+ };
45
66
  }
46
67
  export declare namespace View {
47
68
  }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * View API
3
+ * View API
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: info@it4all.hu
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ * An event handler is a special callback function to call when the given event is occurred. So the event handler can be an action as is or can be fired on a before or after event
14
+ */
15
+ export interface ViewEventHandler {
16
+ /**
17
+ * The event handler path defines the location of the event. We can use regular expressions to fine tune the event definition. In this way we can add before event handler for all the actions we have. The actions will have a predefined path. The path of the normal actions is the action code itself.
18
+ */
19
+ path?: Array<string>;
20
+ viewEventType?: ViewEventHandler.ViewEventTypeEnum;
21
+ invocationRequestDefinition?: any;
22
+ }
23
+ export declare namespace ViewEventHandler {
24
+ type ViewEventTypeEnum = 'before' | 'instead' | 'after';
25
+ const ViewEventTypeEnum: {
26
+ Before: ViewEventTypeEnum;
27
+ Instead: ViewEventTypeEnum;
28
+ After: ViewEventTypeEnum;
29
+ };
30
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartbit4all/ng-client",
3
- "version": "1.0.29",
3
+ "version": "1.1.0",
4
4
  "schematics": "./schematics/collection.json",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^13.2.0",
Binary file
Binary file