@smartbit4all/ng-client 3.2.31 → 3.2.33

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 (42) hide show
  1. package/esm2020/lib/smart-grid/api/grid-api/api/api.mjs +1 -1
  2. package/esm2020/lib/smart-grid/api/grid-api/api/grid.service.mjs +1 -1
  3. package/esm2020/lib/smart-grid/api/grid-api/api.module.mjs +1 -1
  4. package/esm2020/lib/smart-grid/api/grid-api/configuration.mjs +1 -1
  5. package/esm2020/lib/smart-grid/api/grid-api/encoder.mjs +1 -1
  6. package/esm2020/lib/smart-grid/api/grid-api/index.mjs +1 -1
  7. package/esm2020/lib/smart-grid/api/grid-api/model/gridColumnContentType.mjs +1 -1
  8. package/esm2020/lib/smart-grid/api/grid-api/model/gridColumnMeta.mjs +1 -1
  9. package/esm2020/lib/smart-grid/api/grid-api/model/gridDataAccessConfig.mjs +1 -1
  10. package/esm2020/lib/smart-grid/api/grid-api/model/gridModel.mjs +1 -1
  11. package/esm2020/lib/smart-grid/api/grid-api/model/gridPage.mjs +1 -1
  12. package/esm2020/lib/smart-grid/api/grid-api/model/gridRow.mjs +1 -1
  13. package/esm2020/lib/smart-grid/api/grid-api/model/gridSelectionMode.mjs +1 -1
  14. package/esm2020/lib/smart-grid/api/grid-api/model/gridSelectionType.mjs +1 -1
  15. package/esm2020/lib/smart-grid/api/grid-api/model/gridServerModel.mjs +1 -1
  16. package/esm2020/lib/smart-grid/api/grid-api/model/gridUpdateData.mjs +1 -1
  17. package/esm2020/lib/smart-grid/api/grid-api/model/gridView.mjs +1 -1
  18. package/esm2020/lib/smart-grid/api/grid-api/model/gridViewDescriptor.mjs +1 -1
  19. package/esm2020/lib/smart-grid/api/grid-api/model/models.mjs +1 -1
  20. package/esm2020/lib/smart-grid/api/grid-api/param.mjs +1 -1
  21. package/esm2020/lib/smart-grid/api/grid-api/variables.mjs +1 -1
  22. package/esm2020/lib/smart-table/smarttable.model.mjs +2 -1
  23. package/esm2020/lib/smart-table/tables/material-table/material-table.component.mjs +3 -3
  24. package/esm2020/lib/smart-table/tables/table.mjs +10 -3
  25. package/esm2020/lib/view-context/api/model/imageResource.mjs +1 -1
  26. package/esm2020/lib/view-context/api/model/uiActionButtonType.mjs +3 -2
  27. package/esm2020/lib/view-context/api/model/view.mjs +1 -1
  28. package/fesm2015/smartbit4all-ng-client.mjs +14 -5
  29. package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
  30. package/fesm2020/smartbit4all-ng-client.mjs +14 -5
  31. package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
  32. package/lib/smart-grid/api/grid-api/model/gridDataAccessConfig.d.ts +8 -0
  33. package/lib/smart-grid/api/grid-api/model/gridRow.d.ts +1 -1
  34. package/lib/smart-table/smarttable.model.d.ts +3 -0
  35. package/lib/smart-table/tables/table.d.ts +3 -1
  36. package/lib/view-context/api/model/imageResource.d.ts +3 -0
  37. package/lib/view-context/api/model/uiActionButtonType.d.ts +2 -1
  38. package/lib/view-context/api/model/view.d.ts +3 -0
  39. package/package.json +1 -1
  40. package/smartbit4all-ng-client-3.2.33.tgz +0 -0
  41. package/src/lib/smart-grid/api/grid-api/README.md +226 -226
  42. package/smartbit4all-ng-client-3.2.31.tgz +0 -0
@@ -21,6 +21,14 @@ export interface GridDataAccessConfig {
21
21
  * The path to access the identifier GridRow.data
22
22
  */
23
23
  identifierPath?: Array<string>;
24
+ /**
25
+ * If presented as TREE, this property will be used as id property.
26
+ */
27
+ idProperty?: string;
28
+ /**
29
+ * If presented as TREE, this property will be used as parentId property.
30
+ */
31
+ parentIdProperty?: string;
24
32
  apiClass?: string;
25
33
  kind?: GridDataAccessConfig.KindEnum;
26
34
  }
@@ -21,7 +21,7 @@ export interface GridRow {
21
21
  selectable?: boolean;
22
22
  selected?: boolean;
23
23
  icons: {
24
- [key: string]: ImageResource;
24
+ [key: string]: Array<ImageResource>;
25
25
  };
26
26
  /**
27
27
  * If the grid can be hierarchical then the parent contains the identifiers of the parent row.
@@ -116,6 +116,7 @@ export interface SmartTableInterface<T> {
116
116
  onSelection?: (row: any) => Promise<void>;
117
117
  onAllSelection?: (selected: boolean) => Promise<void>;
118
118
  rowExpander?: SmartTableRowExpander<T>;
119
+ highlightProperty?: string;
119
120
  }
120
121
  export interface SmartTableGridInterface<T> {
121
122
  type: SmartTableInterfaceTypeEnum.GRID;
@@ -145,6 +146,7 @@ export interface SmartTableGridInterface<T> {
145
146
  onAllSelection?: (selected: boolean) => Promise<void>;
146
147
  asyncOnExpand?: boolean;
147
148
  rowExpander?: SmartTableRowExpander<T>;
149
+ highlightProperty?: string;
148
150
  }
149
151
  export interface SmartTableRowExpander<T> {
150
152
  expand(rowId: number): T;
@@ -183,6 +185,7 @@ export declare class SmartTable<T> implements SmartTableInterface<T> {
183
185
  onSelection?: (row: any) => Promise<void>;
184
186
  onAllSelection?: (selected: boolean) => Promise<void>;
185
187
  rowExpander?: SmartTableRowExpander<T>;
188
+ highlightProperty?: string;
186
189
  constructor(config: SmartTableInterface<T>);
187
190
  getPropertyNamesDeeply(element: any): string[];
188
191
  getValueDeeply(model: any, key: string): any;
@@ -6,6 +6,7 @@ import { Subject } from 'rxjs';
6
6
  import { MatTable } from '@angular/material/table';
7
7
  import { ComponentFactoryService } from '../../component-factory-service/projects';
8
8
  import { DefaultActionsPopupComponent } from '../components/default-actions-popup/default-actions-popup.component';
9
+ import { ImageResource } from '../../view-context/api/model/models';
9
10
  import * as i0 from "@angular/core";
10
11
  export declare class Table implements OnInit, OnDestroy {
11
12
  protected cfService: ComponentFactoryService;
@@ -59,9 +60,10 @@ export declare class Table implements OnInit, OnDestroy {
59
60
  isSelected(element: any): boolean;
60
61
  private originalProperty;
61
62
  isImageResource(element: any, header: string): boolean;
63
+ getImageResourceIcons(element: any, header: string): ImageResource[];
62
64
  getImageResourceIcon(element: any, header: string): any;
63
65
  getImageResourceColor(element: any, header: string): any;
64
- getImageResourceStyle(element: any, header: string): any;
66
+ getImageResourceStyle(resource: ImageResource): any;
65
67
  openDefaultActionsMenu(row: any): void;
66
68
  getDefaultActionsForRow(element: any): SmartTableButton[] | undefined;
67
69
  static ɵfac: i0.ɵɵFactoryDeclaration<Table, never>;
@@ -14,6 +14,9 @@ export interface ImageResource {
14
14
  source?: string;
15
15
  identifier?: string;
16
16
  color?: string;
17
+ style?: {
18
+ [key: string]: any;
19
+ };
17
20
  }
18
21
  export declare namespace ImageResource {
19
22
  type KindEnum = 'FE' | 'BE' | 'URL';
@@ -12,7 +12,7 @@
12
12
  /**
13
13
  * Defines the type of the button.
14
14
  */
15
- export declare type UiActionButtonType = 'NORMAL' | 'FLAT' | 'STROKED' | 'RAISED' | 'ICON' | 'MINI_FAB' | 'FAB' | 'SEPARATOR';
15
+ export declare type UiActionButtonType = 'NORMAL' | 'FLAT' | 'STROKED' | 'RAISED' | 'ICON' | 'MINI_FAB' | 'FAB' | 'SEPARATOR' | 'SUBMENU';
16
16
  export declare const UiActionButtonType: {
17
17
  Normal: UiActionButtonType;
18
18
  Flat: UiActionButtonType;
@@ -22,4 +22,5 @@ export declare const UiActionButtonType: {
22
22
  MiniFab: UiActionButtonType;
23
23
  Fab: UiActionButtonType;
24
24
  Separator: UiActionButtonType;
25
+ Submenu: UiActionButtonType;
25
26
  };
@@ -51,6 +51,9 @@ export interface View {
51
51
  widgetModels: {
52
52
  [key: string]: object;
53
53
  };
54
+ widgetServerModels: {
55
+ [key: string]: object;
56
+ };
54
57
  valueSets: {
55
58
  [key: string]: ValueSet;
56
59
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartbit4all/ng-client",
3
- "version": "3.2.31",
3
+ "version": "3.2.33",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "^13.3.9",
6
6
  "@angular/common": "^13.2.0",
@@ -1,226 +1,226 @@
1
- ## @
2
-
3
- ### Building
4
-
5
- To install the required dependencies and to build the typescript sources run:
6
- ```
7
- npm install
8
- npm run build
9
- ```
10
-
11
- ### publishing
12
-
13
- First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!)
14
-
15
- ### consuming
16
-
17
- Navigate to the folder of your consuming project and run one of next commands.
18
-
19
- _published:_
20
-
21
- ```
22
- npm install @ --save
23
- ```
24
-
25
- _without publishing (not recommended):_
26
-
27
- ```
28
- npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save
29
- ```
30
-
31
- _It's important to take the tgz file, otherwise you'll get trouble with links on windows_
32
-
33
- _using `npm link`:_
34
-
35
- In PATH_TO_GENERATED_PACKAGE/dist:
36
- ```
37
- npm link
38
- ```
39
-
40
- In your project:
41
- ```
42
- npm link
43
- ```
44
-
45
- __Note for Windows users:__ The Angular CLI has troubles to use linked npm packages.
46
- Please refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround.
47
- Published packages are not effected by this issue.
48
-
49
-
50
- #### General usage
51
-
52
- In your Angular project:
53
-
54
-
55
- ```
56
- // without configuring providers
57
- import { ApiModule } from '';
58
- import { HttpClientModule } from '@angular/common/http';
59
-
60
- @NgModule({
61
- imports: [
62
- ApiModule,
63
- // make sure to import the HttpClientModule in the AppModule only,
64
- // see https://github.com/angular/angular/issues/20575
65
- HttpClientModule
66
- ],
67
- declarations: [ AppComponent ],
68
- providers: [],
69
- bootstrap: [ AppComponent ]
70
- })
71
- export class AppModule {}
72
- ```
73
-
74
- ```
75
- // configuring providers
76
- import { ApiModule, Configuration, ConfigurationParameters } from '';
77
-
78
- export function apiConfigFactory (): Configuration {
79
- const params: ConfigurationParameters = {
80
- // set configuration parameters here.
81
- }
82
- return new Configuration(params);
83
- }
84
-
85
- @NgModule({
86
- imports: [ ApiModule.forRoot(apiConfigFactory) ],
87
- declarations: [ AppComponent ],
88
- providers: [],
89
- bootstrap: [ AppComponent ]
90
- })
91
- export class AppModule {}
92
- ```
93
-
94
- ```
95
- // configuring providers with an authentication service that manages your access tokens
96
- import { ApiModule, Configuration } from '';
97
-
98
- @NgModule({
99
- imports: [ ApiModule ],
100
- declarations: [ AppComponent ],
101
- providers: [
102
- {
103
- provide: Configuration,
104
- useFactory: (authService: AuthService) => new Configuration(
105
- {
106
- basePath: environment.apiUrl,
107
- accessToken: authService.getAccessToken.bind(authService)
108
- }
109
- ),
110
- deps: [AuthService],
111
- multi: false
112
- }
113
- ],
114
- bootstrap: [ AppComponent ]
115
- })
116
- export class AppModule {}
117
- ```
118
-
119
- ```
120
- import { DefaultApi } from '';
121
-
122
- export class AppComponent {
123
- constructor(private apiGateway: DefaultApi) { }
124
- }
125
- ```
126
-
127
- Note: The ApiModule is restricted to being instantiated once app wide.
128
- This is to ensure that all services are treated as singletons.
129
-
130
- #### Using multiple OpenAPI files / APIs / ApiModules
131
- In order to use multiple `ApiModules` generated from different OpenAPI files,
132
- you can create an alias name when importing the modules
133
- in order to avoid naming conflicts:
134
- ```
135
- import { ApiModule } from 'my-api-path';
136
- import { ApiModule as OtherApiModule } from 'my-other-api-path';
137
- import { HttpClientModule } from '@angular/common/http';
138
-
139
- @NgModule({
140
- imports: [
141
- ApiModule,
142
- OtherApiModule,
143
- // make sure to import the HttpClientModule in the AppModule only,
144
- // see https://github.com/angular/angular/issues/20575
145
- HttpClientModule
146
- ]
147
- })
148
- export class AppModule {
149
-
150
- }
151
- ```
152
-
153
-
154
- ### Set service base path
155
- If different than the generated base path, during app bootstrap, you can provide the base path to your service.
156
-
157
- ```
158
- import { BASE_PATH } from '';
159
-
160
- bootstrap(AppComponent, [
161
- { provide: BASE_PATH, useValue: 'https://your-web-service.com' },
162
- ]);
163
- ```
164
- or
165
-
166
- ```
167
- import { BASE_PATH } from '';
168
-
169
- @NgModule({
170
- imports: [],
171
- declarations: [ AppComponent ],
172
- providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ],
173
- bootstrap: [ AppComponent ]
174
- })
175
- export class AppModule {}
176
- ```
177
-
178
-
179
- #### Using @angular/cli
180
- First extend your `src/environments/*.ts` files by adding the corresponding base path:
181
-
182
- ```
183
- export const environment = {
184
- production: false,
185
- API_BASE_PATH: 'http://127.0.0.1:8080'
186
- };
187
- ```
188
-
189
- In the src/app/app.module.ts:
190
- ```
191
- import { BASE_PATH } from '';
192
- import { environment } from '../environments/environment';
193
-
194
- @NgModule({
195
- declarations: [
196
- AppComponent
197
- ],
198
- imports: [ ],
199
- providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }],
200
- bootstrap: [ AppComponent ]
201
- })
202
- export class AppModule { }
203
- ```
204
-
205
- ### Customizing path parameter encoding
206
-
207
- Without further customization, only [path-parameters][parameter-locations-url] of [style][style-values-url] 'simple'
208
- and Dates for format 'date-time' are encoded correctly.
209
-
210
- Other styles (e.g. "matrix") are not that easy to encode
211
- and thus are best delegated to other libraries (e.g.: [@honoluluhenk/http-param-expander]).
212
-
213
- To implement your own parameter encoding (or call another library),
214
- pass an arrow-function or method-reference to the `encodeParam` property of the Configuration-object
215
- (see [General Usage](#general-usage) above).
216
-
217
- Example value for use in your Configuration-Provider:
218
- ```typescript
219
- new Configuration({
220
- encodeParam: (param: Param) => myFancyParamEncoder(param),
221
- })
222
- ```
223
-
224
- [parameter-locations-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-locations
225
- [style-values-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values
226
- [@honoluluhenk/http-param-expander]: https://www.npmjs.com/package/@honoluluhenk/http-param-expander
1
+ ## @
2
+
3
+ ### Building
4
+
5
+ To install the required dependencies and to build the typescript sources run:
6
+ ```
7
+ npm install
8
+ npm run build
9
+ ```
10
+
11
+ ### publishing
12
+
13
+ First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!)
14
+
15
+ ### consuming
16
+
17
+ Navigate to the folder of your consuming project and run one of next commands.
18
+
19
+ _published:_
20
+
21
+ ```
22
+ npm install @ --save
23
+ ```
24
+
25
+ _without publishing (not recommended):_
26
+
27
+ ```
28
+ npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save
29
+ ```
30
+
31
+ _It's important to take the tgz file, otherwise you'll get trouble with links on windows_
32
+
33
+ _using `npm link`:_
34
+
35
+ In PATH_TO_GENERATED_PACKAGE/dist:
36
+ ```
37
+ npm link
38
+ ```
39
+
40
+ In your project:
41
+ ```
42
+ npm link
43
+ ```
44
+
45
+ __Note for Windows users:__ The Angular CLI has troubles to use linked npm packages.
46
+ Please refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround.
47
+ Published packages are not effected by this issue.
48
+
49
+
50
+ #### General usage
51
+
52
+ In your Angular project:
53
+
54
+
55
+ ```
56
+ // without configuring providers
57
+ import { ApiModule } from '';
58
+ import { HttpClientModule } from '@angular/common/http';
59
+
60
+ @NgModule({
61
+ imports: [
62
+ ApiModule,
63
+ // make sure to import the HttpClientModule in the AppModule only,
64
+ // see https://github.com/angular/angular/issues/20575
65
+ HttpClientModule
66
+ ],
67
+ declarations: [ AppComponent ],
68
+ providers: [],
69
+ bootstrap: [ AppComponent ]
70
+ })
71
+ export class AppModule {}
72
+ ```
73
+
74
+ ```
75
+ // configuring providers
76
+ import { ApiModule, Configuration, ConfigurationParameters } from '';
77
+
78
+ export function apiConfigFactory (): Configuration {
79
+ const params: ConfigurationParameters = {
80
+ // set configuration parameters here.
81
+ }
82
+ return new Configuration(params);
83
+ }
84
+
85
+ @NgModule({
86
+ imports: [ ApiModule.forRoot(apiConfigFactory) ],
87
+ declarations: [ AppComponent ],
88
+ providers: [],
89
+ bootstrap: [ AppComponent ]
90
+ })
91
+ export class AppModule {}
92
+ ```
93
+
94
+ ```
95
+ // configuring providers with an authentication service that manages your access tokens
96
+ import { ApiModule, Configuration } from '';
97
+
98
+ @NgModule({
99
+ imports: [ ApiModule ],
100
+ declarations: [ AppComponent ],
101
+ providers: [
102
+ {
103
+ provide: Configuration,
104
+ useFactory: (authService: AuthService) => new Configuration(
105
+ {
106
+ basePath: environment.apiUrl,
107
+ accessToken: authService.getAccessToken.bind(authService)
108
+ }
109
+ ),
110
+ deps: [AuthService],
111
+ multi: false
112
+ }
113
+ ],
114
+ bootstrap: [ AppComponent ]
115
+ })
116
+ export class AppModule {}
117
+ ```
118
+
119
+ ```
120
+ import { DefaultApi } from '';
121
+
122
+ export class AppComponent {
123
+ constructor(private apiGateway: DefaultApi) { }
124
+ }
125
+ ```
126
+
127
+ Note: The ApiModule is restricted to being instantiated once app wide.
128
+ This is to ensure that all services are treated as singletons.
129
+
130
+ #### Using multiple OpenAPI files / APIs / ApiModules
131
+ In order to use multiple `ApiModules` generated from different OpenAPI files,
132
+ you can create an alias name when importing the modules
133
+ in order to avoid naming conflicts:
134
+ ```
135
+ import { ApiModule } from 'my-api-path';
136
+ import { ApiModule as OtherApiModule } from 'my-other-api-path';
137
+ import { HttpClientModule } from '@angular/common/http';
138
+
139
+ @NgModule({
140
+ imports: [
141
+ ApiModule,
142
+ OtherApiModule,
143
+ // make sure to import the HttpClientModule in the AppModule only,
144
+ // see https://github.com/angular/angular/issues/20575
145
+ HttpClientModule
146
+ ]
147
+ })
148
+ export class AppModule {
149
+
150
+ }
151
+ ```
152
+
153
+
154
+ ### Set service base path
155
+ If different than the generated base path, during app bootstrap, you can provide the base path to your service.
156
+
157
+ ```
158
+ import { BASE_PATH } from '';
159
+
160
+ bootstrap(AppComponent, [
161
+ { provide: BASE_PATH, useValue: 'https://your-web-service.com' },
162
+ ]);
163
+ ```
164
+ or
165
+
166
+ ```
167
+ import { BASE_PATH } from '';
168
+
169
+ @NgModule({
170
+ imports: [],
171
+ declarations: [ AppComponent ],
172
+ providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ],
173
+ bootstrap: [ AppComponent ]
174
+ })
175
+ export class AppModule {}
176
+ ```
177
+
178
+
179
+ #### Using @angular/cli
180
+ First extend your `src/environments/*.ts` files by adding the corresponding base path:
181
+
182
+ ```
183
+ export const environment = {
184
+ production: false,
185
+ API_BASE_PATH: 'http://127.0.0.1:8080'
186
+ };
187
+ ```
188
+
189
+ In the src/app/app.module.ts:
190
+ ```
191
+ import { BASE_PATH } from '';
192
+ import { environment } from '../environments/environment';
193
+
194
+ @NgModule({
195
+ declarations: [
196
+ AppComponent
197
+ ],
198
+ imports: [ ],
199
+ providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }],
200
+ bootstrap: [ AppComponent ]
201
+ })
202
+ export class AppModule { }
203
+ ```
204
+
205
+ ### Customizing path parameter encoding
206
+
207
+ Without further customization, only [path-parameters][parameter-locations-url] of [style][style-values-url] 'simple'
208
+ and Dates for format 'date-time' are encoded correctly.
209
+
210
+ Other styles (e.g. "matrix") are not that easy to encode
211
+ and thus are best delegated to other libraries (e.g.: [@honoluluhenk/http-param-expander]).
212
+
213
+ To implement your own parameter encoding (or call another library),
214
+ pass an arrow-function or method-reference to the `encodeParam` property of the Configuration-object
215
+ (see [General Usage](#general-usage) above).
216
+
217
+ Example value for use in your Configuration-Provider:
218
+ ```typescript
219
+ new Configuration({
220
+ encodeParam: (param: Param) => myFancyParamEncoder(param),
221
+ })
222
+ ```
223
+
224
+ [parameter-locations-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-locations
225
+ [style-values-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values
226
+ [@honoluluhenk/http-param-expander]: https://www.npmjs.com/package/@honoluluhenk/http-param-expander
Binary file