@smartbit4all/ng-client 3.3.70 → 3.3.72

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.
@@ -9026,6 +9026,63 @@ class GridService {
9026
9026
  reportProgress: reportProgress
9027
9027
  });
9028
9028
  }
9029
+ selectRows(uuid, gridId, gridSelectionChange, observe = 'body', reportProgress = false, options) {
9030
+ if (uuid === null || uuid === undefined) {
9031
+ throw new Error('Required parameter uuid was null or undefined when calling selectRows.');
9032
+ }
9033
+ if (gridId === null || gridId === undefined) {
9034
+ throw new Error('Required parameter gridId was null or undefined when calling selectRows.');
9035
+ }
9036
+ if (gridSelectionChange === null || gridSelectionChange === undefined) {
9037
+ throw new Error('Required parameter gridSelectionChange was null or undefined when calling selectRows.');
9038
+ }
9039
+ let localVarHeaders = this.defaultHeaders;
9040
+ let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
9041
+ if (localVarHttpHeaderAcceptSelected === undefined) {
9042
+ // to determine the Accept header
9043
+ const httpHeaderAccepts = [
9044
+ 'application/json'
9045
+ ];
9046
+ localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
9047
+ }
9048
+ if (localVarHttpHeaderAcceptSelected !== undefined) {
9049
+ localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
9050
+ }
9051
+ let localVarHttpContext = options && options.context;
9052
+ if (localVarHttpContext === undefined) {
9053
+ localVarHttpContext = new HttpContext();
9054
+ }
9055
+ // to determine the Content-Type header
9056
+ const consumes = [
9057
+ 'application/json'
9058
+ ];
9059
+ const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
9060
+ if (httpContentTypeSelected !== undefined) {
9061
+ localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
9062
+ }
9063
+ let responseType_ = 'json';
9064
+ if (localVarHttpHeaderAcceptSelected) {
9065
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
9066
+ responseType_ = 'text';
9067
+ }
9068
+ else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
9069
+ responseType_ = 'json';
9070
+ }
9071
+ else {
9072
+ responseType_ = 'blob';
9073
+ }
9074
+ }
9075
+ let localVarPath = `/grid/${this.configuration.encodeParam({ name: "uuid", value: uuid, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid" })}/${this.configuration.encodeParam({ name: "gridId", value: gridId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/selects`;
9076
+ return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
9077
+ context: localVarHttpContext,
9078
+ body: gridSelectionChange,
9079
+ responseType: responseType_,
9080
+ withCredentials: this.configuration.withCredentials,
9081
+ headers: localVarHeaders,
9082
+ observe: observe,
9083
+ reportProgress: reportProgress
9084
+ });
9085
+ }
9029
9086
  setPage(uuid, gridIdentifier, offset, limit, observe = 'body', reportProgress = false, options) {
9030
9087
  if (uuid === null || uuid === undefined) {
9031
9088
  throw new Error('Required parameter uuid was null or undefined when calling setPage.');
@@ -9188,6 +9245,18 @@ var GridDataAccessConfigKindEnum;
9188
9245
  })(GridDataAccessConfigKindEnum || (GridDataAccessConfigKindEnum = {}));
9189
9246
  ;
9190
9247
 
9248
+ /**
9249
+ * Grid api
9250
+ * The grid api is resposible for the grid components that shows a list of item.
9251
+ *
9252
+ * The version of the OpenAPI document: 1.0.0
9253
+ * Contact: info@it4all.hu
9254
+ *
9255
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9256
+ * https://openapi-generator.tech
9257
+ * Do not edit the class manually.
9258
+ */
9259
+
9191
9260
  /**
9192
9261
  * Grid api
9193
9262
  * The grid api is resposible for the grid components that shows a list of item.
@@ -9304,6 +9373,11 @@ class SmartGridService {
9304
9373
  .select(smartGrid.gridModel.viewUuid, smartGrid.gridIdentifier, gridRow.id, gridRow.selected)
9305
9374
  .toPromise();
9306
9375
  }
9376
+ async selectRows(smartGrid, selected, unselected) {
9377
+ return await this.api
9378
+ .selectRows(smartGrid.gridModel.viewUuid, smartGrid.gridIdentifier, { selected, unselected })
9379
+ .toPromise();
9380
+ }
9307
9381
  async selectAll(smartGrid, selected) {
9308
9382
  return await this.api
9309
9383
  .selectAll(smartGrid.gridModel.viewUuid, smartGrid.gridIdentifier, selected)
@@ -9730,11 +9804,9 @@ class SmartGridComponent {
9730
9804
  else if (kind === GridViewDescriptorKindEnum.CARDS) {
9731
9805
  layoutDef = SmartLayoutDef.CARD;
9732
9806
  }
9733
- else {
9734
- // default fallback TABLE
9735
- layoutDef = SmartLayoutDef.TABLE;
9807
+ if (layoutDef) {
9808
+ this.smartGrid.layoutDef = layoutDef;
9736
9809
  }
9737
- this.smartGrid.layoutDef = layoutDef;
9738
9810
  }
9739
9811
  if (gridModel?.paginator !== undefined) {
9740
9812
  this.smartGrid.paginator = gridModel.paginator;
@@ -9744,6 +9816,10 @@ class SmartGridComponent {
9744
9816
  else {
9745
9817
  console.error('GridModel is undefined in component!');
9746
9818
  }
9819
+ if (!this.smartGrid.layoutDef) {
9820
+ // fallback, default TABLE
9821
+ this.smartGrid.layoutDef = SmartLayoutDef.TABLE;
9822
+ }
9747
9823
  if (this.smartGrid.layoutDef === SmartLayoutDef.TABLE) {
9748
9824
  this.renderTable();
9749
9825
  }
@@ -10009,8 +10085,7 @@ class SmartGridComponent {
10009
10085
  ?.filter((row) => unselectedIds.includes(row.id))
10010
10086
  .forEach((row) => (row.selected = false));
10011
10087
  }
10012
- let union = selectedIds.concat(unselectedIds);
10013
- this.onSelectList(union);
10088
+ this.onSelectRows(selectedIds, unselectedIds);
10014
10089
  }
10015
10090
  checkAllParentsSelection(node) {
10016
10091
  let parent = this.getParentNode(node);
@@ -10256,20 +10331,14 @@ class SmartGridComponent {
10256
10331
  }
10257
10332
  }
10258
10333
  async onSelect(rowId) {
10259
- this.onSelectList([rowId]);
10260
- }
10261
- async selectRowInternal(rowId) {
10262
- const row = this.service.gridModel.page.rows?.find((gridRow) => gridRow.id === rowId);
10263
- const viewContextChange = await this.service.select(this.smartGrid, row);
10264
- this.smartGrid.viewContextService.handleChanges(viewContextChange.changes);
10265
- }
10266
- async onSelectList(rowIds) {
10267
10334
  this.isBlocked = true;
10268
10335
  if (this.dev) {
10269
10336
  this.render();
10270
10337
  }
10271
10338
  else {
10272
- rowIds.forEach((rowId) => this.selectRowInternal(rowId));
10339
+ const row = this.service.gridModel.page.rows?.find((gridRow) => gridRow.id === rowId);
10340
+ const viewContextChange = await this.service.select(this.smartGrid, row);
10341
+ this.smartGrid.viewContextService.handleChanges(viewContextChange.changes);
10273
10342
  this.refresh();
10274
10343
  }
10275
10344
  }
@@ -10279,6 +10348,19 @@ class SmartGridComponent {
10279
10348
  this.smartGrid.viewContextService.handleChanges(viewContextChange.changes);
10280
10349
  this.refresh();
10281
10350
  }
10351
+ async onSelectRows(selectedIds, unselectedIds) {
10352
+ this.isBlocked = true;
10353
+ if (this.dev) {
10354
+ this.render();
10355
+ }
10356
+ else {
10357
+ let selected = selectedIds.filter((item) => item !== undefined);
10358
+ let unselected = unselectedIds.filter((item) => item !== undefined);
10359
+ const viewContextChange = await this.service.selectRows(this.smartGrid, selected, unselected);
10360
+ this.smartGrid.viewContextService.handleChanges(viewContextChange.changes);
10361
+ this.refresh();
10362
+ }
10363
+ }
10282
10364
  editColumns() {
10283
10365
  let dialogData = {
10284
10366
  content: {